aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-10-04 23:17:25 -0400
committerOlof Johansson <olof@lixom.net>2012-10-04 23:17:25 -0400
commit54d69df5849ec2e660aa12ac75562618c10fb499 (patch)
treeadbfb8bcc7cc73b83bf2b784fa331911ba03573a
parentad932bb6b549722a561fb31ac2fa50dcbcb3e36b (diff)
parent46f2007c1efadfa4071c17e75f140c47f09293de (diff)
Merge branch 'late/kirkwood' into late/soc
Merge in the late Kirkwood branch with the OMAP late branch for upstream submission. Final contents described in shared tag. Fixup remove/change conflicts in arch/arm/mach-omap2/devices.c and drivers/spi/spi-omap2-mcspi.c. Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--Documentation/arm/Marvell/README232
-rw-r--r--Documentation/arm/Samsung-S3C24XX/GPIO.txt82
-rw-r--r--Documentation/arm/Samsung/GPIO.txt8
-rw-r--r--Documentation/arm/memory.txt3
-rw-r--r--Documentation/devicetree/bindings/arm/bcm2835.txt8
-rw-r--r--Documentation/devicetree/bindings/arm/mrvl/tauros2.txt17
-rw-r--r--Documentation/devicetree/bindings/arm/msm/timer.txt38
-rw-r--r--Documentation/devicetree/bindings/arm/omap/omap.txt3
-rw-r--r--Documentation/devicetree/bindings/arm/pmu.txt4
-rw-r--r--Documentation/devicetree/bindings/clock/imx23-clock.txt76
-rw-r--r--Documentation/devicetree/bindings/clock/imx28-clock.txt99
-rw-r--r--Documentation/devicetree/bindings/clock/imx6q-clock.txt222
-rw-r--r--Documentation/devicetree/bindings/crypto/mv_cesa.txt20
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-fan.txt25
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-mvebu.txt53
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-samsung.txt43
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-twl4030.txt6
-rw-r--r--Documentation/devicetree/bindings/i2c/trivial-devices.txt1
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt110
-rw-r--r--Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt52
-rw-r--r--Documentation/devicetree/bindings/lpddr2/lpddr2.txt102
-rw-r--r--Documentation/devicetree/bindings/memory-controllers/ti/emif.txt55
-rw-r--r--Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt31
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt95
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt100
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,dove-pinctrl.txt72
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt279
-rw-r--r--Documentation/devicetree/bindings/pinctrl/marvell,mvebu-pinctrl.txt46
-rw-r--r--Documentation/devicetree/bindings/regulator/tps6586x.txt65
-rw-r--r--Documentation/devicetree/bindings/rtc/pxa-rtc.txt14
-rw-r--r--Documentation/devicetree/bindings/timer/brcm,bcm2835-system-timer.txt22
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt1
-rw-r--r--Documentation/spi/ep93xx_spi2
-rw-r--r--MAINTAINERS11
-rw-r--r--arch/arm/Kconfig246
-rw-r--r--arch/arm/Kconfig.debug33
-rw-r--r--arch/arm/Makefile150
-rw-r--r--arch/arm/boot/Makefile2
-rw-r--r--arch/arm/boot/compressed/misc.c6
-rw-r--r--arch/arm/boot/dts/Makefile106
-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/bcm2835-rpi-b.dts12
-rw-r--r--arch/arm/boot/dts/bcm2835.dtsi39
-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/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.dtsi38
-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.dtsi123
-rw-r--r--arch/arm/boot/dts/imx51-babbage.dts44
-rw-r--r--arch/arm/boot/dts/imx51.dtsi146
-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.dtsi199
-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.dtsi316
-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.dts11
-rw-r--r--arch/arm/boot/dts/omap4-sdp.dts127
-rw-r--r--arch/arm/boot/dts/omap4.dtsi195
-rw-r--r--arch/arm/boot/dts/omap5-evm.dts64
-rw-r--r--arch/arm/boot/dts/omap5.dtsi127
-rw-r--r--arch/arm/boot/dts/phy3250.dts4
-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.dtsi5
-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.dts186
-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.dtsi2
-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/configs/bcm2835_defconfig95
-rw-r--r--arch/arm/configs/imx_v6_v7_defconfig4
-rw-r--r--arch/arm/configs/kirkwood_defconfig38
-rw-r--r--arch/arm/configs/kzm9d_defconfig1
-rw-r--r--arch/arm/configs/kzm9g_defconfig1
-rw-r--r--arch/arm/configs/mvebu_defconfig2
-rw-r--r--arch/arm/configs/mxs_defconfig6
-rw-r--r--arch/arm/configs/omap2plus_defconfig1
-rw-r--r--arch/arm/configs/pnx4008_defconfig472
-rw-r--r--arch/arm/configs/prima2_defconfig7
-rw-r--r--arch/arm/configs/tegra_defconfig2
-rw-r--r--arch/arm/include/asm/gpio.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/io.h8
-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/perf_event.h9
-rw-r--r--arch/arm/include/asm/pmu.h77
-rw-r--r--arch/arm/include/asm/smp.h48
-rw-r--r--arch/arm/include/asm/timex.h4
-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/kernel/Makefile3
-rw-r--r--arch/arm/kernel/bios32.c54
-rw-r--r--arch/arm/kernel/debug.S87
-rw-r--r--arch/arm/kernel/head.S4
-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/setup.c4
-rw-r--r--arch/arm/kernel/smp.c72
-rw-r--r--arch/arm/mach-at91/Makefile.boot24
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c2
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c2
-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/include/mach/atmel-mci.h2
-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/setup.c4
-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/map.h)24
-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/arch.c5
-rw-r--r--arch/arm/mach-bcmring/core.c3
-rw-r--r--arch/arm/mach-bcmring/csp/chipc/chipcHw.c137
-rw-r--r--arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c90
-rw-r--r--arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c19
-rw-r--r--arch/arm/mach-bcmring/csp/dmac/dmacHw.c27
-rw-r--r--arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c6
-rw-r--r--arch/arm/mach-bcmring/csp/tmr/tmrHw.c6
-rw-r--r--arch/arm/mach-bcmring/include/cfg_global.h13
-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/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/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/mach/cfg_global.h (renamed from arch/arm/mach-bcmring/include/cfg_global_defines.h)11
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/cap_inline.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h6
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h119
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h6
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h6
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/dmacHw.h (renamed from arch/arm/mach-bcmring/include/csp/dmacHw.h)4
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h106
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h18
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/mm_addr.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/mm_io.h8
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/reg.h (renamed from arch/arm/mach-bcmring/include/csp/reg.h)25
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h10
-rw-r--r--arch/arm/mach-bcmring/include/mach/csp/tmrHw.h (renamed from arch/arm/mach-bcmring/include/csp/tmrHw.h)2
-rw-r--r--arch/arm/mach-bcmring/include/mach/dma.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/reg_nand.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/reg_umi.h4
-rw-r--r--arch/arm/mach-bcmring/mm.c4
-rw-r--r--arch/arm/mach-bcmring/timer.c2
-rw-r--r--arch/arm/mach-davinci/aemif.c2
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c8
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c6
-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.c10
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c6
-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/davinci.h2
-rw-r--r--arch/arm/mach-davinci/devices.c4
-rw-r--r--arch/arm/mach-davinci/dm355.c2
-rw-r--r--arch/arm/mach-davinci/dm365.c4
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h8
-rw-r--r--arch/arm/mach-davinci/include/mach/tnetv107x.h4
-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/core.c8
-rw-r--r--arch/arm/mach-ebsa110/core.h12
-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/simone.c2
-rw-r--r--arch/arm/mach-ep93xx/snappercl15.c2
-rw-r--r--arch/arm/mach-ep93xx/vision_ep9307.c4
-rw-r--r--arch/arm/mach-exynos/Makefile.boot3
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c9
-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/hotplug.c18
-rw-r--r--arch/arm/mach-exynos/include/mach/map.h1
-rw-r--r--arch/arm/mach-exynos/mach-armlex4210.c1
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c1
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c7
-rw-r--r--arch/arm/mach-exynos/mach-origen.c7
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c4
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c8
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c5
-rw-r--r--arch/arm/mach-exynos/platsmp.c27
-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/common.c12
-rw-r--r--arch/arm/mach-footbridge/dc21285.c16
-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-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.c2
-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/Kconfig106
-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-imx35.c11
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c18
-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-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/hotplug.c16
-rw-r--r--arch/arm/mach-imx/imx51-dt.c21
-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.c12
-rw-r--r--arch/arm/mach-imx/mach-kzm_arm11_01.c5
-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/core.c4
-rw-r--r--arch/arm/mach-integrator/cpu.c8
-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.c21
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c6
-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/pci.c53
-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/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/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/cpu.c2
-rw-r--r--arch/arm/mach-ks8695/include/mach/hardware.h2
-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/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/hardware.h2
-rw-r--r--arch/arm/mach-lpc32xx/irq.c7
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c20
-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/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/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-msm/Kconfig41
-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.c9
-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/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.h6
-rw-r--r--arch/arm/mach-msm/include/mach/system.h19
-rw-r--r--arch/arm/mach-msm/io.c30
-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.c9
-rw-r--r--arch/arm/mach-mv78xx0/common.c13
-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/include/mach/common.h9
-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/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.c140
-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-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/board-nhk8815.c2
-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/uncompress.h8
-rw-r--r--arch/arm/mach-omap1/ams-delta-fiq-handler.S2
-rw-r--r--arch/arm/mach-omap1/ams-delta-fiq.c2
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c6
-rw-r--r--arch/arm/mach-omap1/board-fsample.c6
-rw-r--r--arch/arm/mach-omap1/board-generic.c2
-rw-r--r--arch/arm/mach-omap1/board-h2.c8
-rw-r--r--arch/arm/mach-omap1/board-h3.c6
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c2
-rw-r--r--arch/arm/mach-omap1/board-innovator.c6
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c7
-rw-r--r--arch/arm/mach-omap1/board-osk.c6
-rw-r--r--arch/arm/mach-omap1/board-palmte.c8
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c8
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c8
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c6
-rw-r--r--arch/arm/mach-omap1/board-sx1-mmc.c2
-rw-r--r--arch/arm/mach-omap1/board-sx1.c10
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c6
-rw-r--r--arch/arm/mach-omap1/devices.c2
-rw-r--r--arch/arm/mach-omap1/flash.c2
-rw-r--r--arch/arm/mach-omap1/i2c.c2
-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/irda.h (renamed from arch/arm/plat-omap/include/plat/irda.h)0
-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/smp.h5
-rw-r--r--arch/arm/mach-omap1/io.c2
-rw-r--r--arch/arm/mach-omap1/leds.c2
-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.c2
-rw-r--r--arch/arm/mach-omap1/usb.c2
-rw-r--r--arch/arm/mach-omap2/Kconfig1
-rw-r--r--arch/arm/mach-omap2/Makefile108
-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.c2
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c4
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c2
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c3
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c2
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c6
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c4
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c6
-rw-r--r--arch/arm/mach-omap2/board-flash.c4
-rw-r--r--arch/arm/mach-omap2/board-generic.c2
-rw-r--r--arch/arm/mach-omap2/board-h4.c2
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c4
-rw-r--r--arch/arm/mach-omap2/board-ldp.c4
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c4
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c1
-rw-r--r--arch/arm/mach-omap2/board-overo.c7
-rw-r--r--arch/arm/mach-omap2/board-rm680.c2
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c9
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c4
-rw-r--r--arch/arm/mach-omap2/board-rx51.c2
-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-zoom-debugboard.c2
-rw-r--r--arch/arm/mach-omap2/board-zoom-display.c2
-rw-r--r--arch/arm/mach-omap2/common-board-devices.c4
-rw-r--r--arch/arm/mach-omap2/common.c1
-rw-r--r--arch/arm/mach-omap2/common.h5
-rw-r--r--arch/arm/mach-omap2/control.h8
-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.h (renamed from arch/arm/plat-omap/include/plat/debug-devices.h)0
-rw-r--r--arch/arm/mach-omap2/devices.c5
-rw-r--r--arch/arm/mach-omap2/dsp.c2
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c2
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c2
-rw-r--r--arch/arm/mach-omap2/gpmc-smc91x.c2
-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.c2
-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/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.c1
-rw-r--r--arch/arm/mach-omap2/id.c2
-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/smp.h5
-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/mcbsp.c2
-rw-r--r--arch/arm/mach-omap2/omap-hotplug.c18
-rw-r--r--arch/arm/mach-omap2/omap-secure.c2
-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.c22
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c4
-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/omap4-common.c7
-rw-r--r--arch/arm/mach-omap2/omap4-keypad.h (renamed from arch/arm/plat-omap/include/plat/omap4-keypad.h)0
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c27
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c7
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c7
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c10
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c4
-rw-r--r--arch/arm/mach-omap2/sleep44xx.S2
-rw-r--r--arch/arm/mach-omap2/timer.c6
-rw-r--r--arch/arm/mach-omap2/usb-musb.c2
-rw-r--r--arch/arm/mach-omap2/voltage.h2
-rw-r--r--arch/arm/mach-orion5x/addr-map.c3
-rw-r--r--arch/arm/mach-orion5x/common.c18
-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-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/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/Kconfig12
-rw-r--r--arch/arm/mach-pxa/Makefile3
-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.c2
-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.c4
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa3xx-regs.h1
-rw-r--r--arch/arm/mach-pxa/irq.c131
-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.c6
-rw-r--r--arch/arm/mach-pxa/magician.c8
-rw-r--r--arch/arm/mach-pxa/mainstone.c10
-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.c8
-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.c30
-rw-r--r--arch/arm/mach-pxa/spitz.c8
-rw-r--r--arch/arm/mach-pxa/stargate2.c2
-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.c4
-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/core.c106
-rw-r--r--arch/arm/mach-realview/core.h3
-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.c5
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c5
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c6
-rw-r--r--arch/arm/mach-realview/realview_pba8.c5
-rw-r--r--arch/arm/mach-realview/realview_pbx.c6
-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/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.c8
-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.c8
-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.c2
-rw-r--r--arch/arm/mach-s3c64xx/dev-audio.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-anw6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-mini6410.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-ncp.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c8
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6400.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c6
-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/dev-audio.c2
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c4
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c4
-rw-r--r--arch/arm/mach-s5p64x0/setup-i2c0.c2
-rw-r--r--arch/arm/mach-s5p64x0/setup-i2c1.c2
-rw-r--r--arch/arm/mach-s5pc100/dev-audio.c2
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c8
-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/dev-audio.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c4
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c6
-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/assabet.c2
-rw-r--r--arch/arm/mach-sa1100/cerf.c2
-rw-r--r--arch/arm/mach-sa1100/collie.c2
-rw-r--r--arch/arm/mach-sa1100/include/mach/simpad.h2
-rw-r--r--arch/arm/mach-sa1100/lart.c2
-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/core.c18
-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/pci.c5
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c2
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c14
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c8
-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.c17
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c24
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c1
-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/hotplug.c31
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h24
-rw-r--r--arch/arm/mach-shmobile/include/mach/emev2.h7
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h2
-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-rmobile.c6
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c57
-rw-r--r--arch/arm/mach-shmobile/setup-emev2.c22
-rw-r--r--arch/arm/mach-shmobile/setup-sh7367.c2
-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.c47
-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/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.c6
-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/Kconfig27
-rw-r--r--arch/arm/mach-tegra/Makefile18
-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.c26
-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-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.c3
-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/pcie.c95
-rw-r--r--arch/arm/mach-tegra/platsmp.c52
-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.c1625
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks.h42
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks_data.c1144
-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.c1372
-rw-r--r--arch/arm/mach-tegra/tegra_cpu_car.h87
-rw-r--r--arch/arm/mach-u300/Kconfig43
-rw-r--r--arch/arm/mach-u300/Makefile1
-rw-r--r--arch/arm/mach-u300/core.c100
-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.c6
-rw-r--r--arch/arm/mach-u300/include/mach/clkdev.h7
-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/Kconfig1
-rw-r--r--arch/arm/mach-ux500/Makefile2
-rw-r--r--arch/arm/mach-ux500/Makefile.boot2
-rw-r--r--arch/arm/mach-ux500/board-mop500.c6
-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.c7
-rw-r--r--arch/arm/mach-ux500/cpu.c16
-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/gpio.h5
-rw-r--r--arch/arm/mach-ux500/include/mach/id.h44
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h3
-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/core.c5
-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/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.boot10
-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/devices.c2
-rw-r--r--arch/arm/mach-vt8500/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-w90x900/dev.c6
-rw-r--r--arch/arm/mach-w90x900/mach-nuc950evb.c2
-rw-r--r--arch/arm/mm/cache-tauros2.c83
-rw-r--r--arch/arm/mm/ioremap.c14
-rw-r--r--arch/arm/mm/mmu.c54
-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/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/platform-imx-uart.c2
-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.h32
-rw-r--r--arch/arm/plat-mxc/include/mach/gpio.h1
-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/mx31.h6
-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-omap/Makefile2
-rw-r--r--arch/arm/plat-omap/common.c2
-rw-r--r--arch/arm/plat-omap/i2c.c1
-rw-r--r--arch/arm/plat-omap/include/plat/omap-serial.h2
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h2
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h1
-rw-r--r--arch/arm/plat-omap/include/plat/param.h8
-rw-r--r--arch/arm/plat-omap/mux.c90
-rw-r--r--arch/arm/plat-omap/omap_device.c135
-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/common.h8
-rw-r--r--arch/arm/plat-orion/include/plat/mpp.h2
-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/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-samsung/devs.c23
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-fns.h97
-rw-r--r--arch/arm/plat-samsung/s5p-irq-gpioint.c4
-rw-r--r--arch/arm/plat-spear/include/plat/gpio.h1
-rw-r--r--arch/arm/plat-versatile/Makefile2
-rw-r--r--arch/arm/plat-versatile/include/plat/platsmp.h14
-rw-r--r--arch/arm/plat-versatile/platsmp.c10
-rw-r--r--arch/arm/tools/mach-types1
-rw-r--r--drivers/Kconfig2
-rw-r--r--drivers/Makefile2
-rw-r--r--drivers/ata/pata_ep93xx.c2
-rw-r--r--drivers/ata/pata_pxa.c2
-rw-r--r--drivers/ata/pata_samsung_cf.c2
-rw-r--r--drivers/clk/Kconfig13
-rw-r--r--drivers/clk/Makefile10
-rw-r--r--drivers/clk/clk-bcm2835.c59
-rw-r--r--drivers/clk/clk-ls1x.c111
-rw-r--r--drivers/clk/clk-max77686.c244
-rw-r--r--drivers/clk/clk-prima2.c1171
-rw-r--r--drivers/clk/clk.c57
-rw-r--r--drivers/clk/mmp/Makefile9
-rw-r--r--drivers/clk/mmp/clk-apbc.c152
-rw-r--r--drivers/clk/mmp/clk-apmu.c97
-rw-r--r--drivers/clk/mmp/clk-frac.c153
-rw-r--r--drivers/clk/mmp/clk-mmp2.c449
-rw-r--r--drivers/clk/mmp/clk-pxa168.c346
-rw-r--r--drivers/clk/mmp/clk-pxa910.c320
-rw-r--r--drivers/clk/mmp/clk.h35
-rw-r--r--drivers/clk/mxs/clk-imx23.c55
-rw-r--r--drivers/clk/mxs/clk-imx28.c113
-rw-r--r--drivers/clk/ux500/Makefile12
-rw-r--r--drivers/clk/ux500/clk-prcc.c164
-rw-r--r--drivers/clk/ux500/clk-prcmu.c252
-rw-r--r--drivers/clk/ux500/clk.h48
-rw-r--r--drivers/clk/ux500/u8500_clk.c477
-rw-r--r--drivers/clk/ux500/u8540_clk.c21
-rw-r--r--drivers/clk/ux500/u9540_clk.c21
-rw-r--r--drivers/clk/versatile/Makefile1
-rw-r--r--drivers/clk/versatile/clk-realview.c114
-rw-r--r--drivers/clocksource/Makefile1
-rw-r--r--drivers/clocksource/bcm2835_timer.c161
-rw-r--r--drivers/crypto/mv_cesa.c17
-rw-r--r--drivers/crypto/ux500/cryp/cryp_core.c2
-rw-r--r--drivers/crypto/ux500/hash/hash_core.c2
-rw-r--r--drivers/dma/at_hdmac_regs.h2
-rw-r--r--drivers/dma/ep93xx_dma.c2
-rw-r--r--drivers/dma/imx-dma.c2
-rw-r--r--drivers/dma/imx-sdma.c4
-rw-r--r--drivers/dma/mmp_tdma.c2
-rw-r--r--drivers/dma/mv_xor.c2
-rw-r--r--drivers/gpio/Kconfig6
-rw-r--r--drivers/gpio/Makefile1
-rw-r--r--drivers/gpio/gpio-mvebu.c679
-rw-r--r--drivers/gpio/gpio-pxa.c77
-rw-r--r--drivers/gpio/gpio-samsung.c103
-rw-r--r--drivers/gpio/gpio-tegra.c3
-rw-r--r--drivers/gpio/gpio-twl4030.c77
-rw-r--r--drivers/hwmon/gpio-fan.c120
-rw-r--r--drivers/hwmon/s3c-hwmon.c2
-rw-r--r--drivers/i2c/busses/Kconfig2
-rw-r--r--drivers/i2c/busses/i2c-davinci.c2
-rw-r--r--drivers/i2c/busses/i2c-imx.c2
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c121
-rw-r--r--drivers/i2c/busses/i2c-nuc900.c2
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c2
-rw-r--r--drivers/input/keyboard/davinci_keyscan.c2
-rw-r--r--drivers/input/keyboard/ep93xx_keypad.c2
-rw-r--r--drivers/input/keyboard/nomadik-ske-keypad.c2
-rw-r--r--drivers/input/keyboard/omap-keypad.c2
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c2
-rw-r--r--drivers/input/keyboard/pxa930_rotary.c2
-rw-r--r--drivers/input/keyboard/spear-keyboard.c2
-rw-r--r--drivers/input/keyboard/w90p910_keypad.c2
-rw-r--r--drivers/input/mouse/pxa930_trkball.c2
-rw-r--r--drivers/input/mouse/rpcmouse.c2
-rw-r--r--drivers/input/serio/ams_delta_serio.c2
-rw-r--r--drivers/input/touchscreen/s3c2410_ts.c2
-rw-r--r--drivers/irqchip/Kconfig0
-rw-r--r--drivers/irqchip/Makefile1
-rw-r--r--drivers/irqchip/irq-bcm2835.c223
-rw-r--r--drivers/leds/leds-netxbig.c2
-rw-r--r--drivers/leds/leds-ns2.c2
-rw-r--r--drivers/leds/leds-s3c24xx.c2
-rw-r--r--drivers/media/video/davinci/vpbe_venc.c2
-rw-r--r--drivers/media/video/mx1_camera.c2
-rw-r--r--drivers/media/video/mx2_camera.c2
-rw-r--r--drivers/media/video/mx3_camera.c4
-rw-r--r--drivers/media/video/pxa_camera.c2
-rw-r--r--drivers/media/video/s5p-fimc/mipi-csis.c2
-rw-r--r--drivers/mfd/db8500-prcmu.c42
-rw-r--r--drivers/mfd/dbx500-prcmu-regs.h4
-rw-r--r--drivers/mfd/mcp-sa11x0.c2
-rw-r--r--drivers/mfd/tps6586x.c13
-rw-r--r--drivers/mmc/host/davinci_mmc.c2
-rw-r--r--drivers/mmc/host/msm_sdcc.c2
-rw-r--r--drivers/mmc/host/mvsdio.c2
-rw-r--r--drivers/mmc/host/mxcmmc.c4
-rw-r--r--drivers/mmc/host/omap.c1
-rw-r--r--drivers/mmc/host/pxamci.c2
-rw-r--r--drivers/mmc/host/s3cmci.c2
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c2
-rw-r--r--drivers/mmc/host/sdhci-tegra.c2
-rw-r--r--drivers/mtd/nand/ams-delta.c2
-rw-r--r--drivers/mtd/nand/bcm_umi_nand.c12
-rw-r--r--drivers/mtd/nand/davinci_nand.c4
-rw-r--r--drivers/mtd/nand/mxc_nand.c2
-rw-r--r--drivers/mtd/nand/nand_bcm_umi.h73
-rw-r--r--drivers/mtd/nand/nomadik_nand.c2
-rw-r--r--drivers/mtd/nand/omap2.c2
-rw-r--r--drivers/mtd/nand/orion_nand.c2
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c89
-rw-r--r--drivers/mtd/nand/s3c2410.c2
-rw-r--r--drivers/mtd/onenand/omap2.c2
-rw-r--r--drivers/net/ethernet/netx-eth.c2
-rw-r--r--drivers/net/ethernet/seeq/ether3.c4
-rw-r--r--drivers/net/irda/pxaficp_ir.c30
-rw-r--r--drivers/pcmcia/omap_cf.c2
-rw-r--r--drivers/pcmcia/pxa2xx_viper.c2
-rw-r--r--drivers/pinctrl/Kconfig22
-rw-r--r--drivers/pinctrl/Makefile5
-rw-r--r--drivers/pinctrl/pinctrl-armada-370.c421
-rw-r--r--drivers/pinctrl/pinctrl-armada-xp.c468
-rw-r--r--drivers/pinctrl/pinctrl-coh901.c220
-rw-r--r--drivers/pinctrl/pinctrl-dove.c620
-rw-r--r--drivers/pinctrl/pinctrl-kirkwood.c472
-rw-r--r--drivers/pinctrl/pinctrl-mvebu.c754
-rw-r--r--drivers/pinctrl/pinctrl-mvebu.h192
-rw-r--r--drivers/pinctrl/pinctrl-sirf.c58
-rw-r--r--drivers/regulator/tps6586x-regulator.c20
-rw-r--r--drivers/remoteproc/omap_remoteproc.c2
-rw-r--r--drivers/rtc/rtc-pxa.c11
-rw-r--r--drivers/scsi/arm/eesox.c2
-rw-r--r--drivers/sh/pfc/gpio.c1
-rw-r--r--drivers/spi/Kconfig2
-rw-r--r--drivers/spi/spi-davinci.c2
-rw-r--r--drivers/spi/spi-ep93xx.c4
-rw-r--r--drivers/spi/spi-imx.c2
-rw-r--r--drivers/spi/spi-nuc900.c2
-rw-r--r--drivers/spi/spi-omap-uwire.c2
-rw-r--r--drivers/spi/spi-omap2-mcspi.c2
-rw-r--r--drivers/spi/spi-s3c64xx.c2
-rw-r--r--drivers/spi/spi-tegra.c55
-rw-r--r--drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c1
-rw-r--r--drivers/staging/tidspbridge/core/dsp-clock.c2
-rw-r--r--drivers/staging/tidspbridge/core/tiomap3430.c2
-rw-r--r--drivers/staging/tidspbridge/core/tiomap3430_pwr.c2
-rw-r--r--drivers/staging/tidspbridge/core/tiomap_io.c2
-rw-r--r--drivers/staging/tidspbridge/rmgr/drv_interface.c2
-rw-r--r--drivers/tty/serial/imx.c2
-rw-r--r--drivers/tty/serial/serial_ks8695.c4
-rw-r--r--drivers/usb/Kconfig1
-rw-r--r--drivers/usb/gadget/imx_udc.c2
-rw-r--r--drivers/usb/gadget/pxa27x_udc.c2
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c2
-rw-r--r--drivers/usb/host/Kconfig2
-rw-r--r--drivers/usb/host/ehci-mxc.c2
-rw-r--r--drivers/usb/host/ehci-orion.c2
-rw-r--r--drivers/usb/host/ehci-s5p.c2
-rw-r--r--drivers/usb/host/imx21-hcd.h2
-rw-r--r--drivers/usb/host/ohci-da8xx.c2
-rw-r--r--drivers/usb/host/ohci-exynos.c2
-rw-r--r--drivers/usb/host/ohci-hcd.c2
-rw-r--r--drivers/usb/host/ohci-nxp.c84
-rw-r--r--drivers/usb/host/ohci-omap.c2
-rw-r--r--drivers/usb/host/ohci-pxa27x.c4
-rw-r--r--drivers/usb/host/ohci-s3c2410.c2
-rw-r--r--drivers/usb/musb/da8xx.c2
-rw-r--r--drivers/usb/musb/tusb6010_omap.c1
-rw-r--r--drivers/usb/musb/ux500_dma.c2
-rw-r--r--drivers/usb/otg/isp1301_omap.c2
-rw-r--r--drivers/video/backlight/omap1_bl.c2
-rw-r--r--drivers/video/da8xx-fb.c8
-rw-r--r--drivers/video/ep93xx-fb.c2
-rw-r--r--drivers/video/imxfb.c2
-rw-r--r--drivers/video/msm/mddi.c2
-rw-r--r--drivers/video/msm/mddi_client_dummy.c2
-rw-r--r--drivers/video/msm/mddi_client_nt35399.c2
-rw-r--r--drivers/video/msm/mddi_client_toshiba.c2
-rw-r--r--drivers/video/msm/mdp.c2
-rw-r--r--drivers/video/msm/mdp_hw.h2
-rw-r--r--drivers/video/msm/mdp_ppp.c2
-rw-r--r--drivers/video/msm/msm_fb.c2
-rw-r--r--drivers/video/mx3fb.c4
-rw-r--r--drivers/video/nuc900fb.c2
-rw-r--r--drivers/video/nuc900fb.h2
-rw-r--r--drivers/video/omap/lcd_ams_delta.c3
-rw-r--r--drivers/video/omap/lcd_mipid.c2
-rw-r--r--drivers/video/omap/lcd_osk.c2
-rw-r--r--drivers/video/pxafb.c2
-rw-r--r--drivers/video/vt8500lcdfb.c2
-rw-r--r--drivers/video/wm8505fb.c2
-rw-r--r--drivers/watchdog/Kconfig6
-rw-r--r--drivers/watchdog/ks8695_wdt.c14
-rw-r--r--include/linux/bcm2835_timer.h (renamed from arch/arm/mach-picoxcell/include/mach/hardware.h)13
-rw-r--r--include/linux/clk-provider.h6
-rw-r--r--include/linux/clk/bcm2835.h (renamed from arch/arm/mach-socfpga/include/mach/timex.h)9
-rw-r--r--include/linux/irqchip/bcm2835.h (renamed from arch/arm/mach-versatile/include/mach/io.h)16
-rw-r--r--include/linux/mfd/dbx500-prcmu.h1
-rw-r--r--include/linux/mfd/tps6586x.h1
-rw-r--r--include/linux/platform_data/asoc-imx-ssi.h (renamed from arch/arm/plat-mxc/include/mach/ssi.h)0
-rw-r--r--include/linux/platform_data/asoc-kirkwood.h (renamed from arch/arm/plat-orion/include/plat/audio.h)0
-rw-r--r--include/linux/platform_data/asoc-palm27x.h (renamed from arch/arm/mach-pxa/include/mach/palmasoc.h)0
-rw-r--r--include/linux/platform_data/asoc-s3c.h (renamed from arch/arm/plat-samsung/include/plat/audio.h)0
-rw-r--r--include/linux/platform_data/asoc-s3c24xx_simtec.h (renamed from arch/arm/plat-samsung/include/plat/audio-simtec.h)0
-rw-r--r--include/linux/platform_data/asoc-ti-mcbsp.h (renamed from arch/arm/plat-omap/include/plat/mcbsp.h)0
-rw-r--r--include/linux/platform_data/ata-pxa.h (renamed from arch/arm/mach-pxa/include/mach/pata_pxa.h)0
-rw-r--r--include/linux/platform_data/ata-samsung_cf.h (renamed from arch/arm/plat-samsung/include/plat/ata.h)0
-rw-r--r--include/linux/platform_data/atmel-aes.h2
-rw-r--r--include/linux/platform_data/camera-mx1.h (renamed from arch/arm/plat-mxc/include/mach/mx1_camera.h)0
-rw-r--r--include/linux/platform_data/camera-mx2.h (renamed from arch/arm/plat-mxc/include/mach/mx2_cam.h)2
-rw-r--r--include/linux/platform_data/camera-mx3.h (renamed from arch/arm/plat-mxc/include/mach/mx3_camera.h)0
-rw-r--r--include/linux/platform_data/camera-pxa.h (renamed from arch/arm/mach-pxa/include/mach/camera.h)0
-rw-r--r--include/linux/platform_data/clk-realview.h1
-rw-r--r--include/linux/platform_data/clk-ux500.h17
-rw-r--r--include/linux/platform_data/crypto-ux500.h (renamed from arch/arm/mach-ux500/include/mach/crypto-ux500.h)0
-rw-r--r--include/linux/platform_data/dma-atmel.h (renamed from arch/arm/mach-at91/include/mach/at_hdmac.h)0
-rw-r--r--include/linux/platform_data/dma-ep93xx.h (renamed from arch/arm/mach-ep93xx/include/mach/dma.h)0
-rw-r--r--include/linux/platform_data/dma-imx-sdma.h (renamed from arch/arm/plat-mxc/include/mach/sdma.h)0
-rw-r--r--include/linux/platform_data/dma-imx.h (renamed from arch/arm/plat-mxc/include/mach/dma.h)0
-rw-r--r--include/linux/platform_data/dma-mmp_tdma.h (renamed from arch/arm/mach-mmp/include/mach/sram.h)0
-rw-r--r--include/linux/platform_data/dma-mv_xor.h (renamed from arch/arm/plat-orion/include/plat/mv_xor.h)0
-rw-r--r--include/linux/platform_data/dsp-omap.h (renamed from arch/arm/plat-omap/include/plat/dsp.h)0
-rw-r--r--include/linux/platform_data/eth-netx.h (renamed from arch/arm/mach-netx/include/mach/eth.h)0
-rw-r--r--include/linux/platform_data/hwmon-s3c.h (renamed from arch/arm/plat-samsung/include/plat/hwmon.h)0
-rw-r--r--include/linux/platform_data/i2c-davinci.h (renamed from arch/arm/mach-davinci/include/mach/i2c.h)0
-rw-r--r--include/linux/platform_data/i2c-imx.h (renamed from arch/arm/plat-mxc/include/mach/i2c.h)0
-rw-r--r--include/linux/platform_data/i2c-nuc900.h (renamed from arch/arm/mach-w90x900/include/mach/i2c.h)0
-rw-r--r--include/linux/platform_data/i2c-s3c2410.h (renamed from arch/arm/plat-samsung/include/plat/iic.h)0
-rw-r--r--include/linux/platform_data/irda-pxaficp.h (renamed from arch/arm/mach-pxa/include/mach/irda.h)0
-rw-r--r--include/linux/platform_data/keyboard-pxa930_rotary.h (renamed from arch/arm/mach-pxa/include/mach/pxa930_rotary.h)0
-rw-r--r--include/linux/platform_data/keyboard-spear.h (renamed from arch/arm/plat-spear/include/plat/keyboard.h)0
-rw-r--r--include/linux/platform_data/keypad-ep93xx.h (renamed from arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h)0
-rw-r--r--include/linux/platform_data/keypad-nomadik-ske.h (renamed from arch/arm/plat-nomadik/include/plat/ske.h)0
-rw-r--r--include/linux/platform_data/keypad-omap.h (renamed from arch/arm/plat-omap/include/plat/keypad.h)0
-rw-r--r--include/linux/platform_data/keypad-pxa27x.h (renamed from arch/arm/plat-pxa/include/plat/pxa27x_keypad.h)0
-rw-r--r--include/linux/platform_data/keypad-w90p910.h (renamed from arch/arm/mach-w90x900/include/mach/w90p910_keypad.h)0
-rw-r--r--include/linux/platform_data/keyscan-davinci.h (renamed from arch/arm/mach-davinci/include/mach/keyscan.h)0
-rw-r--r--include/linux/platform_data/lcd-mipid.h (renamed from arch/arm/plat-omap/include/plat/lcd_mipid.h)0
-rw-r--r--include/linux/platform_data/leds-kirkwood-netxbig.h (renamed from arch/arm/mach-kirkwood/include/mach/leds-netxbig.h)0
-rw-r--r--include/linux/platform_data/leds-kirkwood-ns2.h (renamed from arch/arm/mach-kirkwood/include/mach/leds-ns2.h)0
-rw-r--r--include/linux/platform_data/leds-s3c24xx.h (renamed from arch/arm/mach-s3c24xx/include/mach/leds-gpio.h)0
-rw-r--r--include/linux/platform_data/mfd-mcp-sa11x0.h (renamed from arch/arm/mach-sa1100/include/mach/mcp.h)0
-rw-r--r--include/linux/platform_data/mipi-csis.h (renamed from arch/arm/plat-samsung/include/plat/mipi_csis.h)0
-rw-r--r--include/linux/platform_data/mmc-davinci.h (renamed from arch/arm/mach-davinci/include/mach/mmc.h)0
-rw-r--r--include/linux/platform_data/mmc-esdhc-imx.h (renamed from arch/arm/plat-mxc/include/mach/esdhc.h)0
-rw-r--r--include/linux/platform_data/mmc-msm_sdcc.h (renamed from arch/arm/mach-msm/include/mach/mmc.h)0
-rw-r--r--include/linux/platform_data/mmc-mvsdio.h (renamed from arch/arm/plat-orion/include/plat/mvsdio.h)0
-rw-r--r--include/linux/platform_data/mmc-mxcmmc.h (renamed from arch/arm/plat-mxc/include/mach/mmc.h)0
-rw-r--r--include/linux/platform_data/mmc-pxamci.h (renamed from arch/arm/mach-pxa/include/mach/mmc.h)0
-rw-r--r--include/linux/platform_data/mmc-s3cmci.h (renamed from arch/arm/plat-samsung/include/plat/mci.h)0
-rw-r--r--include/linux/platform_data/mmc-sdhci-tegra.h (renamed from arch/arm/mach-tegra/include/mach/sdhci.h)6
-rw-r--r--include/linux/platform_data/mouse-pxa930_trkball.h (renamed from arch/arm/mach-pxa/include/mach/pxa930_trkball.h)0
-rw-r--r--include/linux/platform_data/mtd-davinci-aemif.h (renamed from arch/arm/mach-davinci/include/mach/aemif.h)0
-rw-r--r--include/linux/platform_data/mtd-davinci.h (renamed from arch/arm/mach-davinci/include/mach/nand.h)0
-rw-r--r--include/linux/platform_data/mtd-mxc_nand.h (renamed from arch/arm/plat-mxc/include/mach/mxc_nand.h)0
-rw-r--r--include/linux/platform_data/mtd-nand-omap2.h (renamed from arch/arm/plat-omap/include/plat/nand.h)0
-rw-r--r--include/linux/platform_data/mtd-nand-pxa3xx.h (renamed from arch/arm/plat-pxa/include/plat/pxa3xx_nand.h)0
-rw-r--r--include/linux/platform_data/mtd-nand-s3c2410.h (renamed from arch/arm/plat-samsung/include/plat/nand.h)0
-rw-r--r--include/linux/platform_data/mtd-nomadik-nand.h (renamed from arch/arm/mach-nomadik/include/mach/nand.h)0
-rw-r--r--include/linux/platform_data/mtd-onenand-omap2.h (renamed from arch/arm/plat-omap/include/plat/onenand.h)0
-rw-r--r--include/linux/platform_data/mtd-orion_nand.h (renamed from arch/arm/plat-orion/include/plat/orion_nand.h)0
-rw-r--r--include/linux/platform_data/pcmcia-pxa2xx_viper.h (renamed from arch/arm/mach-pxa/include/mach/arcom-pcmcia.h)0
-rw-r--r--include/linux/platform_data/pinctrl-coh901.h (renamed from arch/arm/mach-u300/include/mach/gpio-u300.h)13
-rw-r--r--include/linux/platform_data/remoteproc-omap.h (renamed from arch/arm/plat-omap/include/plat/remoteproc.h)0
-rw-r--r--include/linux/platform_data/serial-imx.h (renamed from arch/arm/plat-mxc/include/mach/imx-uart.h)0
-rw-r--r--include/linux/platform_data/spi-davinci.h (renamed from arch/arm/mach-davinci/include/mach/spi.h)0
-rw-r--r--include/linux/platform_data/spi-ep93xx.h (renamed from arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h)0
-rw-r--r--include/linux/platform_data/spi-imx.h (renamed from arch/arm/plat-mxc/include/mach/spi.h)0
-rw-r--r--include/linux/platform_data/spi-nuc900.h (renamed from arch/arm/mach-w90x900/include/mach/nuc900_spi.h)0
-rw-r--r--include/linux/platform_data/spi-omap2-mcspi.h (renamed from arch/arm/plat-omap/include/plat/mcspi.h)0
-rw-r--r--include/linux/platform_data/spi-s3c64xx.h (renamed from arch/arm/plat-samsung/include/plat/s3c64xx-spi.h)0
-rw-r--r--include/linux/platform_data/touchscreen-s3c2410.h (renamed from arch/arm/plat-samsung/include/plat/ts.h)0
-rw-r--r--include/linux/platform_data/usb-davinci.h (renamed from arch/arm/mach-davinci/include/mach/usb.h)0
-rw-r--r--include/linux/platform_data/usb-ehci-mxc.h (renamed from arch/arm/plat-mxc/include/mach/mxc_ehci.h)0
-rw-r--r--include/linux/platform_data/usb-ehci-orion.h (renamed from arch/arm/plat-orion/include/plat/ehci-orion.h)0
-rw-r--r--include/linux/platform_data/usb-ehci-s5p.h (renamed from arch/arm/plat-samsung/include/plat/ehci.h)0
-rw-r--r--include/linux/platform_data/usb-exynos.h (renamed from arch/arm/mach-exynos/include/mach/ohci.h)0
-rw-r--r--include/linux/platform_data/usb-imx_udc.h (renamed from arch/arm/plat-mxc/include/mach/usb.h)0
-rw-r--r--include/linux/platform_data/usb-musb-ux500.h (renamed from arch/arm/mach-ux500/include/mach/usb.h)0
-rw-r--r--include/linux/platform_data/usb-mx2.h (renamed from arch/arm/plat-mxc/include/mach/mx21-usbhost.h)0
-rw-r--r--include/linux/platform_data/usb-ohci-pxa27x.h (renamed from arch/arm/mach-pxa/include/mach/ohci.h)0
-rw-r--r--include/linux/platform_data/usb-ohci-s3c2410.h (renamed from arch/arm/plat-samsung/include/plat/usb-control.h)0
-rw-r--r--include/linux/platform_data/usb-pxa3xx-ulpi.h (renamed from arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h)0
-rw-r--r--include/linux/platform_data/usb-s3c2410_udc.h (renamed from arch/arm/plat-samsung/include/plat/udc.h)0
-rw-r--r--include/linux/platform_data/video-ep93xx.h (renamed from arch/arm/mach-ep93xx/include/mach/fb.h)0
-rw-r--r--include/linux/platform_data/video-imxfb.h (renamed from arch/arm/plat-mxc/include/mach/imxfb.h)0
-rw-r--r--include/linux/platform_data/video-msm_fb.h (renamed from arch/arm/mach-msm/include/mach/msm_fb.h)0
-rw-r--r--include/linux/platform_data/video-mx3fb.h (renamed from arch/arm/plat-mxc/include/mach/mx3fb.h)0
-rw-r--r--include/linux/platform_data/video-nuc900fb.h (renamed from arch/arm/mach-w90x900/include/mach/fb.h)0
-rw-r--r--include/linux/platform_data/video-pxafb.h (renamed from arch/arm/mach-pxa/include/mach/pxafb.h)0
-rw-r--r--include/linux/platform_data/video-vt8500lcdfb.h (renamed from arch/arm/mach-vt8500/include/mach/vt8500fb.h)0
-rw-r--r--include/linux/platform_data/voltage-omap.h (renamed from arch/arm/plat-omap/include/plat/voltage.h)0
-rw-r--r--include/linux/power/smartreflex.h2
-rw-r--r--sound/soc/ep93xx/ep93xx-ac97.c2
-rw-r--r--sound/soc/ep93xx/ep93xx-i2s.c2
-rw-r--r--sound/soc/ep93xx/ep93xx-pcm.c2
-rw-r--r--sound/soc/fsl/imx-pcm-dma.c2
-rw-r--r--sound/soc/fsl/imx-pcm-fiq.c2
-rw-r--r--sound/soc/fsl/imx-ssi.c2
-rw-r--r--sound/soc/fsl/imx-ssi.h2
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c2
-rw-r--r--sound/soc/kirkwood/kirkwood-openrd.c2
-rw-r--r--sound/soc/kirkwood/kirkwood-t5325.c2
-rw-r--r--sound/soc/omap/am3517evm.c2
-rw-r--r--sound/soc/omap/ams-delta.c4
-rw-r--r--sound/soc/omap/igep0020.c2
-rw-r--r--sound/soc/omap/mcbsp.c2
-rw-r--r--sound/soc/omap/n810.c2
-rw-r--r--sound/soc/omap/omap-mcbsp.c2
-rw-r--r--sound/soc/omap/omap3beagle.c2
-rw-r--r--sound/soc/omap/omap3evm.c2
-rw-r--r--sound/soc/omap/omap3pandora.c2
-rw-r--r--sound/soc/omap/osk5912.c2
-rw-r--r--sound/soc/omap/overo.c2
-rw-r--r--sound/soc/omap/rx51.c2
-rw-r--r--sound/soc/omap/sdp3430.c2
-rw-r--r--sound/soc/omap/zoom2.c2
-rw-r--r--sound/soc/pxa/palm27x.c2
-rw-r--r--sound/soc/samsung/ac97.c2
-rw-r--r--sound/soc/samsung/i2s.c2
-rw-r--r--sound/soc/samsung/pcm.c2
-rw-r--r--sound/soc/samsung/s3c24xx_simtec.c2
-rw-r--r--sound/soc/samsung/spdif.c2
-rw-r--r--sound/soc/tegra/Kconfig2
-rw-r--r--sound/soc/tegra/tegra_pcm.c232
-rw-r--r--sound/soc/tegra/tegra_pcm.h14
1353 files changed, 29820 insertions, 31269 deletions
diff --git a/Documentation/arm/Marvell/README b/Documentation/arm/Marvell/README
new file mode 100644
index 000000000000..8f08a86e03b7
--- /dev/null
+++ b/Documentation/arm/Marvell/README
@@ -0,0 +1,232 @@
1ARM Marvell SoCs
2================
3
4This document lists all the ARM Marvell SoCs that are currently
5supported in mainline by the Linux kernel. As the Marvell families of
6SoCs are large and complex, it is hard to understand where the support
7for a particular SoC is available in the Linux kernel. This document
8tries to help in understanding where those SoCs are supported, and to
9match them with their corresponding public datasheet, when available.
10
11Orion family
12------------
13
14 Flavors:
15 88F5082
16 88F5181
17 88F5181L
18 88F5182
19 Datasheet : http://www.embeddedarm.com/documentation/third-party/MV88F5182-datasheet.pdf
20 Programmer's User Guide : http://www.embeddedarm.com/documentation/third-party/MV88F5182-opensource-manual.pdf
21 User Manual : http://www.embeddedarm.com/documentation/third-party/MV88F5182-usermanual.pdf
22 88F5281
23 Datasheet : http://www.ocmodshop.com/images/reviews/networking/qnap_ts409u/marvel_88f5281_data_sheet.pdf
24 88F6183
25 Core: Feroceon ARMv5 compatible
26 Linux kernel mach directory: arch/arm/mach-orion5x
27 Linux kernel plat directory: arch/arm/plat-orion
28
29Kirkwood family
30---------------
31
32 Flavors:
33 88F6282 a.k.a Armada 300
34 Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
35 88F6283 a.k.a Armada 310
36 Product Brief : http://www.marvell.com/embedded-processors/armada-300/assets/armada_310.pdf
37 88F6190
38 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6190-003_WEB.pdf
39 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
40 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
41 88F6192
42 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6192-003_ver1.pdf
43 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F619x_OpenSource.pdf
44 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
45 88F6182
46 88F6180
47 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6180-003_ver1.pdf
48 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6180_OpenSource.pdf
49 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
50 88F6281
51 Product Brief : http://www.marvell.com/embedded-processors/kirkwood/assets/88F6281-004_ver1.pdf
52 Hardware Spec : http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6281_OpenSource.pdf
53 Functional Spec: http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
54 Homepage: http://www.marvell.com/embedded-processors/kirkwood/
55 Core: Feroceon ARMv5 compatible
56 Linux kernel mach directory: arch/arm/mach-kirkwood
57 Linux kernel plat directory: arch/arm/plat-orion
58
59Discovery family
60----------------
61
62 Flavors:
63 MV78100
64 Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78100-003_WEB.pdf
65 Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78100_OpenSource.pdf
66 Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
67 MV78200
68 Product Brief : http://www.marvell.com/embedded-processors/discovery-innovation/assets/MV78200-002_WEB.pdf
69 Hardware Spec : http://www.marvell.com/embedded-processors/discovery-innovation/assets/HW_MV78200_OpenSource.pdf
70 Functional Spec: http://www.marvell.com/embedded-processors/discovery-innovation/assets/FS_MV76100_78100_78200_OpenSource.pdf
71 MV76100
72 Not supported by the Linux kernel.
73
74 Core: Feroceon ARMv5 compatible
75
76 Linux kernel mach directory: arch/arm/mach-mv78xx0
77 Linux kernel plat directory: arch/arm/plat-orion
78
79EBU Armada family
80-----------------
81
82 Armada 370 Flavors:
83 88F6710
84 88F6707
85 88F6W11
86
87 Armada XP Flavors:
88 MV78230
89 MV78260
90 MV78460
91
92 Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
93 No public datasheet available.
94
95 Core: Sheeva ARMv7 compatible
96
97 Linux kernel mach directory: arch/arm/mach-mvebu
98 Linux kernel plat directory: none
99
100Avanta family
101-------------
102
103 Flavors:
104 88F6510
105 88F6530P
106 88F6550
107 88F6560
108 Homepage : http://www.marvell.com/broadband/
109 Product Brief: http://www.marvell.com/broadband/assets/Marvell_Avanta_88F6510_305_060-001_product_brief.pdf
110 No public datasheet available.
111
112 Core: ARMv5 compatible
113
114 Linux kernel mach directory: no code in mainline yet, planned for the future
115 Linux kernel plat directory: no code in mainline yet, planned for the future
116
117Dove family (application processor)
118-----------------------------------
119
120 Flavors:
121 88AP510 a.k.a Armada 510
122 Product Brief : http://www.marvell.com/application-processors/armada-500/assets/Marvell_Armada510_SoC.pdf
123 Hardware Spec : http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Hardware-Spec.pdf
124 Functional Spec : http://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf
125 Homepage: http://www.marvell.com/application-processors/armada-500/
126 Core: ARMv7 compatible
127 Directory: arch/arm/mach-dove
128
129PXA 2xx/3xx/93x/95x family
130--------------------------
131
132 Flavors:
133 PXA21x, PXA25x, PXA26x
134 Application processor only
135 Core: ARMv5 XScale core
136 PXA270, PXA271, PXA272
137 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_pb.pdf
138 Design guide : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_design_guide.pdf
139 Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_dev_man.pdf
140 Specification : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_emts.pdf
141 Specification update : http://www.marvell.com/application-processors/pxa-family/assets/pxa_27x_spec_update.pdf
142 Application processor only
143 Core: ARMv5 XScale core
144 PXA300, PXA310, PXA320
145 PXA 300 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA300_PB_R4.pdf
146 PXA 310 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA310_PB_R4.pdf
147 PXA 320 Product Brief : http://www.marvell.com/application-processors/pxa-family/assets/PXA320_PB_R4.pdf
148 Design guide : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Design_Guide.pdf
149 Developers manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Developers_Manual.zip
150 Specifications : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_EMTS.pdf
151 Specification Update : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_Spec_Update.zip
152 Reference Manual : http://www.marvell.com/application-processors/pxa-family/assets/PXA3xx_TavorP_BootROM_Ref_Manual.pdf
153 Application processor only
154 Core: ARMv5 XScale core
155 PXA930, PXA935
156 Application processor with Communication processor
157 Core: ARMv5 XScale core
158 PXA955
159 Application processor with Communication processor
160 Core: ARMv7 compatible Sheeva PJ4 core
161
162 Comments:
163
164 * This line of SoCs originates from the XScale family developed by
165 Intel and acquired by Marvell in ~2006. The PXA21x, PXA25x,
166 PXA26x, PXA27x, PXA3xx and PXA93x were developed by Intel, while
167 the later PXA95x were developed by Marvell.
168
169 * Due to their XScale origin, these SoCs have virtually nothing in
170 common with the other (Kirkwood, Dove, etc.) families of Marvell
171 SoCs, except with the MMP/MMP2 family of SoCs.
172
173 Linux kernel mach directory: arch/arm/mach-pxa
174 Linux kernel plat directory: arch/arm/plat-pxa
175
176MMP/MMP2 family (communication processor)
177-----------------------------------------
178
179 Flavors:
180 PXA168, a.k.a Armada 168
181 Homepage : http://www.marvell.com/application-processors/armada-100/armada-168.jsp
182 Product brief : http://www.marvell.com/application-processors/armada-100/assets/pxa_168_pb.pdf
183 Hardware manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_datasheet.pdf
184 Software manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_software_manual.pdf
185 Specification update : http://www.marvell.com/application-processors/armada-100/assets/ARMADA16x_Spec_update.pdf
186 Boot ROM manual : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_ref_manual.pdf
187 App node package : http://www.marvell.com/application-processors/armada-100/assets/armada_16x_app_note_package.pdf
188 Application processor only
189 Core: ARMv5 compatible Marvell PJ1 (Mohawk)
190 PXA910
191 Homepage : http://www.marvell.com/communication-processors/pxa910/
192 Product Brief : http://www.marvell.com/communication-processors/pxa910/assets/Marvell_PXA910_Platform-001_PB_final.pdf
193 Application processor with Communication processor
194 Core: ARMv5 compatible Marvell PJ1 (Mohawk)
195 MMP2, a.k.a Armada 610
196 Product Brief : http://www.marvell.com/application-processors/armada-600/assets/armada610_pb.pdf
197 Application processor only
198 Core: ARMv7 compatible Sheeva PJ4 core
199
200 Comments:
201
202 * This line of SoCs originates from the XScale family developed by
203 Intel and acquired by Marvell in ~2006. All the processors of
204 this MMP/MMP2 family were developed by Marvell.
205
206 * Due to their XScale origin, these SoCs have virtually nothing in
207 common with the other (Kirkwood, Dove, etc.) families of Marvell
208 SoCs, except with the PXA family of SoCs listed above.
209
210 Linux kernel mach directory: arch/arm/mach-mmp
211 Linux kernel plat directory: arch/arm/plat-pxa
212
213Long-term plans
214---------------
215
216 * Unify the mach-dove/, mach-mv78xx0/, mach-orion5x/ and
217 mach-kirkwood/ into the mach-mvebu/ to support all SoCs from the
218 Marvell EBU (Engineering Business Unit) in a single mach-<foo>
219 directory. The plat-orion/ would therefore disappear.
220
221 * Unify the mach-mmp/ and mach-pxa/ into the same mach-pxa
222 directory. The plat-pxa/ would therefore disappear.
223
224Credits
225-------
226
227 Maen Suleiman <maen@marvell.com>
228 Lior Amsalem <alior@marvell.com>
229 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
230 Andrew Lunn <andrew@lunn.ch>
231 Nicolas Pitre <nico@fluxnic.net>
232 Eric Miao <eric.y.miao@gmail.com>
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
index 816d6071669e..8b46c79679c4 100644
--- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt
+++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
@@ -1,4 +1,4 @@
1 S3C2410 GPIO Control 1 S3C24XX GPIO Control
2 ==================== 2 ====================
3 3
4Introduction 4Introduction
@@ -12,7 +12,7 @@ Introduction
12 of the s3c2410 GPIO system, please read the Samsung provided 12 of the s3c2410 GPIO system, please read the Samsung provided
13 data-sheet/users manual to find out the complete list. 13 data-sheet/users manual to find out the complete list.
14 14
15 See Documentation/arm/Samsung/GPIO.txt for the core implemetation. 15 See Documentation/arm/Samsung/GPIO.txt for the core implementation.
16 16
17 17
18GPIOLIB 18GPIOLIB
@@ -41,8 +41,8 @@ GPIOLIB
41GPIOLIB conversion 41GPIOLIB conversion
42------------------ 42------------------
43 43
44If you need to convert your board or driver to use gpiolib from the exiting 44If you need to convert your board or driver to use gpiolib from the phased
45s3c2410 api, then here are some notes on the process. 45out s3c2410 API, then here are some notes on the process.
46 46
471) If your board is exclusively using an GPIO, say to control peripheral 471) If your board is exclusively using an GPIO, say to control peripheral
48 power, then it will require to claim the gpio with gpio_request() before 48 power, then it will require to claim the gpio with gpio_request() before
@@ -55,7 +55,7 @@ s3c2410 api, then here are some notes on the process.
55 as they have the same arguments, and can either take the pin specific 55 as they have the same arguments, and can either take the pin specific
56 values, or the more generic special-function-number arguments. 56 values, or the more generic special-function-number arguments.
57 57
583) s3c2410_gpio_pullup() changs have the problem that whilst the 583) s3c2410_gpio_pullup() changes have the problem that whilst the
59 s3c2410_gpio_pullup(x, 1) can be easily translated to the 59 s3c2410_gpio_pullup(x, 1) can be easily translated to the
60 s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0) 60 s3c_gpio_setpull(x, S3C_GPIO_PULL_NONE), the s3c2410_gpio_pullup(x, 0)
61 are not so easy. 61 are not so easy.
@@ -74,7 +74,7 @@ s3c2410 api, then here are some notes on the process.
74 when using gpio_get_value() on an output pin (s3c2410_gpio_getpin 74 when using gpio_get_value() on an output pin (s3c2410_gpio_getpin
75 would return the value the pin is supposed to be outputting). 75 would return the value the pin is supposed to be outputting).
76 76
776) s3c2410_gpio_getirq() should be directly replacable with the 776) s3c2410_gpio_getirq() should be directly replaceable with the
78 gpio_to_irq() call. 78 gpio_to_irq() call.
79 79
80The s3c2410_gpio and gpio_ calls have always operated on the same gpio 80The s3c2410_gpio and gpio_ calls have always operated on the same gpio
@@ -105,7 +105,7 @@ PIN Numbers
105----------- 105-----------
106 106
107 Each pin has an unique number associated with it in regs-gpio.h, 107 Each pin has an unique number associated with it in regs-gpio.h,
108 eg S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell 108 e.g. S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell
109 the GPIO functions which pin is to be used. 109 the GPIO functions which pin is to be used.
110 110
111 With the conversion to gpiolib, there is no longer a direct conversion 111 With the conversion to gpiolib, there is no longer a direct conversion
@@ -120,31 +120,27 @@ Configuring a pin
120 The following function allows the configuration of a given pin to 120 The following function allows the configuration of a given pin to
121 be changed. 121 be changed.
122 122
123 void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); 123 void s3c_gpio_cfgpin(unsigned int pin, unsigned int function);
124 124
125 Eg: 125 e.g.:
126 126
127 s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0); 127 s3c_gpio_cfgpin(S3C2410_GPA(0), S3C_GPIO_SFN(1));
128 s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1); 128 s3c_gpio_cfgpin(S3C2410_GPE(8), S3C_GPIO_SFN(2));
129 129
130 which would turn GPA(0) into the lowest Address line A0, and set 130 which would turn GPA(0) into the lowest Address line A0, and set
131 GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line. 131 GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line.
132 132
133 The s3c_gpio_cfgpin() call is a functional replacement for this call.
134
135 133
136Reading the current configuration 134Reading the current configuration
137--------------------------------- 135---------------------------------
138 136
139 The current configuration of a pin can be read by using: 137 The current configuration of a pin can be read by using standard
138 gpiolib function:
140 139
141 s3c2410_gpio_getcfg(unsigned int pin); 140 s3c_gpio_getcfg(unsigned int pin);
142 141
143 The return value will be from the same set of values which can be 142 The return value will be from the same set of values which can be
144 passed to s3c2410_gpio_cfgpin(). 143 passed to s3c_gpio_cfgpin().
145
146 The s3c_gpio_getcfg() call should be a functional replacement for
147 this call.
148 144
149 145
150Configuring a pull-up resistor 146Configuring a pull-up resistor
@@ -154,61 +150,33 @@ Configuring a pull-up resistor
154 pull-up resistors enabled. This can be configured by the following 150 pull-up resistors enabled. This can be configured by the following
155 function: 151 function:
156 152
157 void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); 153 void s3c_gpio_setpull(unsigned int pin, unsigned int to);
158
159 Where the to value is zero to set the pull-up off, and 1 to enable
160 the specified pull-up. Any other values are currently undefined.
161
162 The s3c_gpio_setpull() offers similar functionality, but with the
163 ability to encode whether the pull is up or down. Currently there
164 is no 'just on' state, so up or down must be selected.
165
166
167Getting the state of a PIN
168--------------------------
169
170 The state of a pin can be read by using the function:
171
172 unsigned int s3c2410_gpio_getpin(unsigned int pin);
173 154
174 This will return either zero or non-zero. Do not count on this 155 Where the to value is S3C_GPIO_PULL_NONE to set the pull-up off,
175 function returning 1 if the pin is set. 156 and S3C_GPIO_PULL_UP to enable the specified pull-up. Any other
157 values are currently undefined.
176 158
177 This call is now implemented by the relevant gpiolib calls, convert
178 your board or driver to use gpiolib.
179
180
181Setting the state of a PIN
182--------------------------
183
184 The value an pin is outputing can be modified by using the following:
185 159
186 void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); 160Getting and setting the state of a PIN
161--------------------------------------
187 162
188 Which sets the given pin to the value. Use 0 to write 0, and 1 to 163 These calls are now implemented by the relevant gpiolib calls, convert
189 set the output to 1.
190
191 This call is now implemented by the relevant gpiolib calls, convert
192 your board or driver to use gpiolib. 164 your board or driver to use gpiolib.
193 165
194 166
195Getting the IRQ number associated with a PIN 167Getting the IRQ number associated with a PIN
196-------------------------------------------- 168--------------------------------------------
197 169
198 The following function can map the given pin number to an IRQ 170 A standard gpiolib function can map the given pin number to an IRQ
199 number to pass to the IRQ system. 171 number to pass to the IRQ system.
200 172
201 int s3c2410_gpio_getirq(unsigned int pin); 173 int gpio_to_irq(unsigned int pin);
202 174
203 Note, not all pins have an IRQ. 175 Note, not all pins have an IRQ.
204 176
205 This call is now implemented by the relevant gpiolib calls, convert
206 your board or driver to use gpiolib.
207
208 177
209Authour 178Author
210------- 179-------
211 180
212
213Ben Dooks, 03 October 2004 181Ben Dooks, 03 October 2004
214Copyright 2004 Ben Dooks, Simtec Electronics 182Copyright 2004 Ben Dooks, Simtec Electronics
diff --git a/Documentation/arm/Samsung/GPIO.txt b/Documentation/arm/Samsung/GPIO.txt
index 513f2562c1a3..795adfd88081 100644
--- a/Documentation/arm/Samsung/GPIO.txt
+++ b/Documentation/arm/Samsung/GPIO.txt
@@ -5,14 +5,14 @@ Introduction
5------------ 5------------
6 6
7This outlines the Samsung GPIO implementation and the architecture 7This outlines the Samsung GPIO implementation and the architecture
8specific calls provided alongisde the drivers/gpio core. 8specific calls provided alongside the drivers/gpio core.
9 9
10 10
11S3C24XX (Legacy) 11S3C24XX (Legacy)
12---------------- 12----------------
13 13
14See Documentation/arm/Samsung-S3C24XX/GPIO.txt for more information 14See Documentation/arm/Samsung-S3C24XX/GPIO.txt for more information
15about these devices. Their implementation is being brought into line 15about these devices. Their implementation has been brought into line
16with the core samsung implementation described in this document. 16with the core samsung implementation described in this document.
17 17
18 18
@@ -29,7 +29,7 @@ GPIO numbering is synchronised between the Samsung and gpiolib system.
29PIN configuration 29PIN configuration
30----------------- 30-----------------
31 31
32Pin configuration is specific to the Samsung architecutre, with each SoC 32Pin configuration is specific to the Samsung architecture, with each SoC
33registering the necessary information for the core gpio configuration 33registering the necessary information for the core gpio configuration
34implementation to configure pins as necessary. 34implementation to configure pins as necessary.
35 35
@@ -38,5 +38,3 @@ driver or machine to change gpio configuration.
38 38
39See arch/arm/plat-samsung/include/plat/gpio-cfg.h for more information 39See arch/arm/plat-samsung/include/plat/gpio-cfg.h for more information
40on these functions. 40on these functions.
41
42
diff --git a/Documentation/arm/memory.txt b/Documentation/arm/memory.txt
index 208a2d465b92..4bfb9ffbdbc1 100644
--- a/Documentation/arm/memory.txt
+++ b/Documentation/arm/memory.txt
@@ -51,6 +51,9 @@ ffc00000 ffefffff DMA memory mapping region. Memory returned
51ff000000 ffbfffff Reserved for future expansion of DMA 51ff000000 ffbfffff Reserved for future expansion of DMA
52 mapping region. 52 mapping region.
53 53
54fee00000 feffffff Mapping of PCI I/O space. This is a static
55 mapping within the vmalloc space.
56
54VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space. 57VMALLOC_START VMALLOC_END-1 vmalloc() / ioremap() space.
55 Memory returned by vmalloc/ioremap will 58 Memory returned by vmalloc/ioremap will
56 be dynamically placed in this region. 59 be dynamically placed in this region.
diff --git a/Documentation/devicetree/bindings/arm/bcm2835.txt b/Documentation/devicetree/bindings/arm/bcm2835.txt
new file mode 100644
index 000000000000..ac683480c486
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/bcm2835.txt
@@ -0,0 +1,8 @@
1Broadcom BCM2835 device tree bindings
2-------------------------------------------
3
4Boards with the BCM2835 SoC shall have the following properties:
5
6Required root node property:
7
8compatible = "brcm,bcm2835";
diff --git a/Documentation/devicetree/bindings/arm/mrvl/tauros2.txt b/Documentation/devicetree/bindings/arm/mrvl/tauros2.txt
new file mode 100644
index 000000000000..31af1cbb60bd
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mrvl/tauros2.txt
@@ -0,0 +1,17 @@
1* Marvell Tauros2 Cache
2
3Required properties:
4- compatible : Should be "marvell,tauros2-cache".
5- marvell,tauros2-cache-features : Specify the features supported for the
6 tauros2 cache.
7 The features including
8 CACHE_TAUROS2_PREFETCH_ON (1 << 0)
9 CACHE_TAUROS2_LINEFILL_BURST8 (1 << 1)
10 The definition can be found at
11 arch/arm/include/asm/hardware/cache-tauros2.h
12
13Example:
14 L2: l2-cache {
15 compatible = "marvell,tauros2-cache";
16 marvell,tauros2-cache-features = <0x3>;
17 };
diff --git a/Documentation/devicetree/bindings/arm/msm/timer.txt b/Documentation/devicetree/bindings/arm/msm/timer.txt
new file mode 100644
index 000000000000..8c5907b9cae8
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/msm/timer.txt
@@ -0,0 +1,38 @@
1* MSM Timer
2
3Properties:
4
5- compatible : Should at least contain "qcom,msm-timer". More specific
6 properties such as "qcom,msm-gpt" and "qcom,msm-dgt" specify a general
7 purpose timer and a debug timer respectively.
8
9- interrupts : Interrupt indicating a match event.
10
11- reg : Specifies the base address of the timer registers. The second region
12 specifies an optional register used to configure the clock divider.
13
14- clock-frequency : The frequency of the timer in Hz.
15
16Optional:
17
18- cpu-offset : per-cpu offset used when the timer is accessed without the
19 CPU remapping facilities. The offset is cpu-offset * cpu-nr.
20
21Example:
22
23 timer@200a004 {
24 compatible = "qcom,msm-gpt", "qcom,msm-timer";
25 interrupts = <1 2 0x301>;
26 reg = <0x0200a004 0x10>;
27 clock-frequency = <32768>;
28 cpu-offset = <0x40000>;
29 };
30
31 timer@200a024 {
32 compatible = "qcom,msm-dgt", "qcom,msm-timer";
33 interrupts = <1 3 0x301>;
34 reg = <0x0200a024 0x10>,
35 <0x0200a034 0x4>;
36 clock-frequency = <6750000>;
37 cpu-offset = <0x40000>;
38 };
diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt
index ccdd0e53451f..d0051a750587 100644
--- a/Documentation/devicetree/bindings/arm/omap/omap.txt
+++ b/Documentation/devicetree/bindings/arm/omap/omap.txt
@@ -36,6 +36,9 @@ Boards:
36- OMAP3 BeagleBoard : Low cost community board 36- OMAP3 BeagleBoard : Low cost community board
37 compatible = "ti,omap3-beagle", "ti,omap3" 37 compatible = "ti,omap3-beagle", "ti,omap3"
38 38
39- OMAP3 Tobi with Overo : Commercial expansion board with daughter board
40 compatible = "ti,omap3-tobi", "ti,omap3-overo", "ti,omap3"
41
39- OMAP4 SDP : Software Developement Board 42- OMAP4 SDP : Software Developement Board
40 compatible = "ti,omap4-sdp", "ti,omap4430" 43 compatible = "ti,omap4-sdp", "ti,omap4430"
41 44
diff --git a/Documentation/devicetree/bindings/arm/pmu.txt b/Documentation/devicetree/bindings/arm/pmu.txt
index 1c044eb320cc..343781b9f246 100644
--- a/Documentation/devicetree/bindings/arm/pmu.txt
+++ b/Documentation/devicetree/bindings/arm/pmu.txt
@@ -7,8 +7,12 @@ representation in the device tree should be done as under:-
7Required properties: 7Required properties:
8 8
9- compatible : should be one of 9- compatible : should be one of
10 "arm,cortex-a15-pmu"
10 "arm,cortex-a9-pmu" 11 "arm,cortex-a9-pmu"
11 "arm,cortex-a8-pmu" 12 "arm,cortex-a8-pmu"
13 "arm,cortex-a7-pmu"
14 "arm,cortex-a5-pmu"
15 "arm,arm11mpcore-pmu"
12 "arm,arm1176-pmu" 16 "arm,arm1176-pmu"
13 "arm,arm1136-pmu" 17 "arm,arm1136-pmu"
14- interrupts : 1 combined interrupt or 1 per core. 18- interrupts : 1 combined interrupt or 1 per core.
diff --git a/Documentation/devicetree/bindings/clock/imx23-clock.txt b/Documentation/devicetree/bindings/clock/imx23-clock.txt
new file mode 100644
index 000000000000..a0b867ef8d96
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/imx23-clock.txt
@@ -0,0 +1,76 @@
1* Clock bindings for Freescale i.MX23
2
3Required properties:
4- compatible: Should be "fsl,imx23-clkctrl"
5- reg: Address and length of the register set
6- #clock-cells: Should be <1>
7
8The clock consumer should specify the desired clock by having the clock
9ID in its "clocks" phandle cell. The following is a full list of i.MX23
10clocks and IDs.
11
12 Clock ID
13 ------------------
14 ref_xtal 0
15 pll 1
16 ref_cpu 2
17 ref_emi 3
18 ref_pix 4
19 ref_io 5
20 saif_sel 6
21 lcdif_sel 7
22 gpmi_sel 8
23 ssp_sel 9
24 emi_sel 10
25 cpu 11
26 etm_sel 12
27 cpu_pll 13
28 cpu_xtal 14
29 hbus 15
30 xbus 16
31 lcdif_div 17
32 ssp_div 18
33 gpmi_div 19
34 emi_pll 20
35 emi_xtal 21
36 etm_div 22
37 saif_div 23
38 clk32k_div 24
39 rtc 25
40 adc 26
41 spdif_div 27
42 clk32k 28
43 dri 29
44 pwm 30
45 filt 31
46 uart 32
47 ssp 33
48 gpmi 34
49 spdif 35
50 emi 36
51 saif 37
52 lcdif 38
53 etm 39
54 usb 40
55 usb_pwr 41
56
57Examples:
58
59clks: clkctrl@80040000 {
60 compatible = "fsl,imx23-clkctrl";
61 reg = <0x80040000 0x2000>;
62 #clock-cells = <1>;
63 clock-output-names =
64 ...
65 "uart", /* 32 */
66 ...
67 "end_of_list";
68};
69
70auart0: serial@8006c000 {
71 compatible = "fsl,imx23-auart";
72 reg = <0x8006c000 0x2000>;
73 interrupts = <24 25 23>;
74 clocks = <&clks 32>;
75 status = "disabled";
76};
diff --git a/Documentation/devicetree/bindings/clock/imx28-clock.txt b/Documentation/devicetree/bindings/clock/imx28-clock.txt
new file mode 100644
index 000000000000..aa2af2866fe8
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/imx28-clock.txt
@@ -0,0 +1,99 @@
1* Clock bindings for Freescale i.MX28
2
3Required properties:
4- compatible: Should be "fsl,imx28-clkctrl"
5- reg: Address and length of the register set
6- #clock-cells: Should be <1>
7
8The clock consumer should specify the desired clock by having the clock
9ID in its "clocks" phandle cell. The following is a full list of i.MX28
10clocks and IDs.
11
12 Clock ID
13 ------------------
14 ref_xtal 0
15 pll0 1
16 pll1 2
17 pll2 3
18 ref_cpu 4
19 ref_emi 5
20 ref_io0 6
21 ref_io1 7
22 ref_pix 8
23 ref_hsadc 9
24 ref_gpmi 10
25 saif0_sel 11
26 saif1_sel 12
27 gpmi_sel 13
28 ssp0_sel 14
29 ssp1_sel 15
30 ssp2_sel 16
31 ssp3_sel 17
32 emi_sel 18
33 etm_sel 19
34 lcdif_sel 20
35 cpu 21
36 ptp_sel 22
37 cpu_pll 23
38 cpu_xtal 24
39 hbus 25
40 xbus 26
41 ssp0_div 27
42 ssp1_div 28
43 ssp2_div 29
44 ssp3_div 30
45 gpmi_div 31
46 emi_pll 32
47 emi_xtal 33
48 lcdif_div 34
49 etm_div 35
50 ptp 36
51 saif0_div 37
52 saif1_div 38
53 clk32k_div 39
54 rtc 40
55 lradc 41
56 spdif_div 42
57 clk32k 43
58 pwm 44
59 uart 45
60 ssp0 46
61 ssp1 47
62 ssp2 48
63 ssp3 49
64 gpmi 50
65 spdif 51
66 emi 52
67 saif0 53
68 saif1 54
69 lcdif 55
70 etm 56
71 fec 57
72 can0 58
73 can1 59
74 usb0 60
75 usb1 61
76 usb0_pwr 62
77 usb1_pwr 63
78 enet_out 64
79
80Examples:
81
82clks: clkctrl@80040000 {
83 compatible = "fsl,imx28-clkctrl";
84 reg = <0x80040000 0x2000>;
85 #clock-cells = <1>;
86 clock-output-names =
87 ...
88 "uart", /* 45 */
89 ...
90 "end_of_list";
91};
92
93auart0: serial@8006a000 {
94 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
95 reg = <0x8006a000 0x2000>;
96 interrupts = <112 70 71>;
97 clocks = <&clks 45>;
98 status = "disabled";
99};
diff --git a/Documentation/devicetree/bindings/clock/imx6q-clock.txt b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
new file mode 100644
index 000000000000..492bd991d52a
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/imx6q-clock.txt
@@ -0,0 +1,222 @@
1* Clock bindings for Freescale i.MX6 Quad
2
3Required properties:
4- compatible: Should be "fsl,imx6q-ccm"
5- reg: Address and length of the register set
6- interrupts: Should contain CCM interrupt
7- #clock-cells: Should be <1>
8
9The clock consumer should specify the desired clock by having the clock
10ID in its "clocks" phandle cell. The following is a full list of i.MX6Q
11clocks and IDs.
12
13 Clock ID
14 ---------------------------
15 dummy 0
16 ckil 1
17 ckih 2
18 osc 3
19 pll2_pfd0_352m 4
20 pll2_pfd1_594m 5
21 pll2_pfd2_396m 6
22 pll3_pfd0_720m 7
23 pll3_pfd1_540m 8
24 pll3_pfd2_508m 9
25 pll3_pfd3_454m 10
26 pll2_198m 11
27 pll3_120m 12
28 pll3_80m 13
29 pll3_60m 14
30 twd 15
31 step 16
32 pll1_sw 17
33 periph_pre 18
34 periph2_pre 19
35 periph_clk2_sel 20
36 periph2_clk2_sel 21
37 axi_sel 22
38 esai_sel 23
39 asrc_sel 24
40 spdif_sel 25
41 gpu2d_axi 26
42 gpu3d_axi 27
43 gpu2d_core_sel 28
44 gpu3d_core_sel 29
45 gpu3d_shader_sel 30
46 ipu1_sel 31
47 ipu2_sel 32
48 ldb_di0_sel 33
49 ldb_di1_sel 34
50 ipu1_di0_pre_sel 35
51 ipu1_di1_pre_sel 36
52 ipu2_di0_pre_sel 37
53 ipu2_di1_pre_sel 38
54 ipu1_di0_sel 39
55 ipu1_di1_sel 40
56 ipu2_di0_sel 41
57 ipu2_di1_sel 42
58 hsi_tx_sel 43
59 pcie_axi_sel 44
60 ssi1_sel 45
61 ssi2_sel 46
62 ssi3_sel 47
63 usdhc1_sel 48
64 usdhc2_sel 49
65 usdhc3_sel 50
66 usdhc4_sel 51
67 enfc_sel 52
68 emi_sel 53
69 emi_slow_sel 54
70 vdo_axi_sel 55
71 vpu_axi_sel 56
72 cko1_sel 57
73 periph 58
74 periph2 59
75 periph_clk2 60
76 periph2_clk2 61
77 ipg 62
78 ipg_per 63
79 esai_pred 64
80 esai_podf 65
81 asrc_pred 66
82 asrc_podf 67
83 spdif_pred 68
84 spdif_podf 69
85 can_root 70
86 ecspi_root 71
87 gpu2d_core_podf 72
88 gpu3d_core_podf 73
89 gpu3d_shader 74
90 ipu1_podf 75
91 ipu2_podf 76
92 ldb_di0_podf 77
93 ldb_di1_podf 78
94 ipu1_di0_pre 79
95 ipu1_di1_pre 80
96 ipu2_di0_pre 81
97 ipu2_di1_pre 82
98 hsi_tx_podf 83
99 ssi1_pred 84
100 ssi1_podf 85
101 ssi2_pred 86
102 ssi2_podf 87
103 ssi3_pred 88
104 ssi3_podf 89
105 uart_serial_podf 90
106 usdhc1_podf 91
107 usdhc2_podf 92
108 usdhc3_podf 93
109 usdhc4_podf 94
110 enfc_pred 95
111 enfc_podf 96
112 emi_podf 97
113 emi_slow_podf 98
114 vpu_axi_podf 99
115 cko1_podf 100
116 axi 101
117 mmdc_ch0_axi_podf 102
118 mmdc_ch1_axi_podf 103
119 arm 104
120 ahb 105
121 apbh_dma 106
122 asrc 107
123 can1_ipg 108
124 can1_serial 109
125 can2_ipg 110
126 can2_serial 111
127 ecspi1 112
128 ecspi2 113
129 ecspi3 114
130 ecspi4 115
131 ecspi5 116
132 enet 117
133 esai 118
134 gpt_ipg 119
135 gpt_ipg_per 120
136 gpu2d_core 121
137 gpu3d_core 122
138 hdmi_iahb 123
139 hdmi_isfr 124
140 i2c1 125
141 i2c2 126
142 i2c3 127
143 iim 128
144 enfc 129
145 ipu1 130
146 ipu1_di0 131
147 ipu1_di1 132
148 ipu2 133
149 ipu2_di0 134
150 ldb_di0 135
151 ldb_di1 136
152 ipu2_di1 137
153 hsi_tx 138
154 mlb 139
155 mmdc_ch0_axi 140
156 mmdc_ch1_axi 141
157 ocram 142
158 openvg_axi 143
159 pcie_axi 144
160 pwm1 145
161 pwm2 146
162 pwm3 147
163 pwm4 148
164 per1_bch 149
165 gpmi_bch_apb 150
166 gpmi_bch 151
167 gpmi_io 152
168 gpmi_apb 153
169 sata 154
170 sdma 155
171 spba 156
172 ssi1 157
173 ssi2 158
174 ssi3 159
175 uart_ipg 160
176 uart_serial 161
177 usboh3 162
178 usdhc1 163
179 usdhc2 164
180 usdhc3 165
181 usdhc4 166
182 vdo_axi 167
183 vpu_axi 168
184 cko1 169
185 pll1_sys 170
186 pll2_bus 171
187 pll3_usb_otg 172
188 pll4_audio 173
189 pll5_video 174
190 pll6_mlb 175
191 pll7_usb_host 176
192 pll8_enet 177
193 ssi1_ipg 178
194 ssi2_ipg 179
195 ssi3_ipg 180
196 rom 181
197 usbphy1 182
198 usbphy2 183
199 ldb_di0_div_3_5 184
200 ldb_di1_div_3_5 185
201
202Examples:
203
204clks: ccm@020c4000 {
205 compatible = "fsl,imx6q-ccm";
206 reg = <0x020c4000 0x4000>;
207 interrupts = <0 87 0x04 0 88 0x04>;
208 #clock-cells = <1>;
209 clock-output-names = ...
210 "uart_ipg",
211 "uart_serial",
212 ...;
213};
214
215uart1: serial@02020000 {
216 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
217 reg = <0x02020000 0x4000>;
218 interrupts = <0 26 0x04>;
219 clocks = <&clks 160>, <&clks 161>;
220 clock-names = "ipg", "per";
221 status = "disabled";
222};
diff --git a/Documentation/devicetree/bindings/crypto/mv_cesa.txt b/Documentation/devicetree/bindings/crypto/mv_cesa.txt
new file mode 100644
index 000000000000..47229b1a594b
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/mv_cesa.txt
@@ -0,0 +1,20 @@
1Marvell Cryptographic Engines And Security Accelerator
2
3Required properties:
4- compatible : should be "marvell,orion-crypto"
5- reg : base physical address of the engine and length of memory mapped
6 region, followed by base physical address of sram and its memory
7 length
8- reg-names : "regs" , "sram";
9- interrupts : interrupt number
10
11Examples:
12
13 crypto@30000 {
14 compatible = "marvell,orion-crypto";
15 reg = <0x30000 0x10000>,
16 <0x4000000 0x800>;
17 reg-names = "regs" , "sram";
18 interrupts = <22>;
19 status = "okay";
20 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-fan.txt b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
new file mode 100644
index 000000000000..2dd457a3469a
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
@@ -0,0 +1,25 @@
1Bindings for fan connected to GPIO lines
2
3Required properties:
4- compatible : "gpio-fan"
5- gpios: Specifies the pins that map to bits in the control value,
6 ordered MSB-->LSB.
7- gpio-fan,speed-map: A mapping of possible fan RPM speeds and the
8 control value that should be set to achieve them. This array
9 must have the RPM values in ascending order.
10
11Optional properties:
12- alarm-gpios: This pin going active indicates something is wrong with
13 the fan, and a udev event will be fired.
14
15Examples:
16
17 gpio_fan {
18 compatible = "gpio-fan";
19 gpios = <&gpio1 14 1
20 &gpio1 13 1>;
21 gpio-fan,speed-map = <0 0
22 3000 1
23 6000 2>;
24 alarm-gpios = <&gpio1 15 1>;
25 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt b/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
new file mode 100644
index 000000000000..a6f3bec1da7d
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
@@ -0,0 +1,53 @@
1* Marvell EBU GPIO controller
2
3Required properties:
4
5- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio"
6 or "marvell,armadaxp-gpio". "marvell,orion-gpio" should be used for
7 Orion, Kirkwood, Dove, Discovery (except MV78200) and Armada
8 370. "marvell,mv78200-gpio" should be used for the Discovery
9 MV78200. "marvel,armadaxp-gpio" should be used for all Armada XP
10 SoCs (MV78230, MV78260, MV78460).
11
12- reg: Address and length of the register set for the device. Only one
13 entry is expected, except for the "marvell,armadaxp-gpio" variant
14 for which two entries are expected: one for the general registers,
15 one for the per-cpu registers.
16
17- interrupts: The list of interrupts that are used for all the pins
18 managed by this GPIO bank. There can be more than one interrupt
19 (example: 1 interrupt per 8 pins on Armada XP, which means 4
20 interrupts per bank of 32 GPIOs).
21
22- interrupt-controller: identifies the node as an interrupt controller
23
24- #interrupt-cells: specifies the number of cells needed to encode an
25 interrupt source. Should be two.
26 The first cell is the GPIO number.
27 The second cell is used to specify flags:
28 bits[3:0] trigger type and level flags:
29 1 = low-to-high edge triggered.
30 2 = high-to-low edge triggered.
31 4 = active high level-sensitive.
32 8 = active low level-sensitive.
33
34- gpio-controller: marks the device node as a gpio controller
35
36- ngpios: number of GPIOs this controller has
37
38- #gpio-cells: Should be two. The first cell is the pin number. The
39 second cell is reserved for flags, unused at the moment.
40
41Example:
42
43 gpio0: gpio@d0018100 {
44 compatible = "marvell,armadaxp-gpio";
45 reg = <0xd0018100 0x40>,
46 <0xd0018800 0x30>;
47 ngpios = <32>;
48 gpio-controller;
49 #gpio-cells = <2>;
50 interrupt-controller;
51 #interrupt-cells = <2>;
52 interrupts = <16>, <17>, <18>, <19>;
53 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-samsung.txt b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
index 5375625e8cd2..f1e5dfecf55d 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-samsung.txt
@@ -39,3 +39,46 @@ Example:
39 #gpio-cells = <4>; 39 #gpio-cells = <4>;
40 gpio-controller; 40 gpio-controller;
41 }; 41 };
42
43
44Samsung S3C24XX GPIO Controller
45
46Required properties:
47- compatible: Compatible property value should be "samsung,s3c24xx-gpio".
48
49- reg: Physical base address of the controller and length of memory mapped
50 region.
51
52- #gpio-cells: Should be 3. The syntax of the gpio specifier used by client nodes
53 should be the following with values derived from the SoC user manual.
54 <[phandle of the gpio controller node]
55 [pin number within the gpio controller]
56 [mux function]
57 [flags and pull up/down]
58
59 Values for gpio specifier:
60 - Pin number: depending on the controller a number from 0 up to 15.
61 - Mux function: Depending on the SoC and the gpio bank the gpio can be set
62 as input, output or a special function
63 - Flags and Pull Up/Down: the values to use differ for the individual SoCs
64 example S3C2416/S3C2450:
65 0 - Pull Up/Down Disabled.
66 1 - Pull Down Enabled.
67 2 - Pull Up Enabled.
68 Bit 16 (0x00010000) - Input is active low.
69 Consult the user manual for the correct values of Mux and Pull Up/Down.
70
71- gpio-controller: Specifies that the node is a gpio controller.
72- #address-cells: should be 1.
73- #size-cells: should be 1.
74
75Example:
76
77 gpa: gpio-controller@56000000 {
78 #address-cells = <1>;
79 #size-cells = <1>;
80 compatible = "samsung,s3c24xx-gpio";
81 reg = <0x56000000 0x10>;
82 #gpio-cells = <3>;
83 gpio-controller;
84 };
diff --git a/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt b/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt
index 16695d9cf1e8..66788fda1db3 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-twl4030.txt
@@ -11,6 +11,11 @@ Required properties:
11- interrupt-controller: Mark the device node as an interrupt controller 11- interrupt-controller: Mark the device node as an interrupt controller
12 The first cell is the GPIO number. 12 The first cell is the GPIO number.
13 The second cell is not used. 13 The second cell is not used.
14- ti,use-leds : Enables LEDA and LEDB outputs if set
15- ti,debounce : if n-th bit is set, debounces GPIO-n
16- ti,mmc-cd : if n-th bit is set, GPIO-n controls VMMC(n+1)
17- ti,pullups : if n-th bit is set, set a pullup on GPIO-n
18- ti,pulldowns : if n-th bit is set, set a pulldown on GPIO-n
14 19
15Example: 20Example:
16 21
@@ -20,4 +25,5 @@ twl_gpio: gpio {
20 gpio-controller; 25 gpio-controller;
21 #interrupt-cells = <2>; 26 #interrupt-cells = <2>;
22 interrupt-controller; 27 interrupt-controller;
28 ti,use-leds;
23}; 29};
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index 1a85f986961b..2f5322b119eb 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -56,3 +56,4 @@ stm,m41t00 Serial Access TIMEKEEPER
56stm,m41t62 Serial real-time clock (RTC) with alarm 56stm,m41t62 Serial real-time clock (RTC) with alarm
57stm,m41t80 M41T80 - SERIAL ACCESS RTC WITH ALARMS 57stm,m41t80 M41T80 - SERIAL ACCESS RTC WITH ALARMS
58ti,tsc2003 I2C Touch-Screen Controller 58ti,tsc2003 I2C Touch-Screen Controller
59ti,tmp102 Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface
diff --git a/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt
new file mode 100644
index 000000000000..548892c08c59
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm2835-armctrl-ic.txt
@@ -0,0 +1,110 @@
1BCM2835 Top-Level ("ARMCTRL") Interrupt Controller
2
3The BCM2835 contains a custom top-level interrupt controller, which supports
472 interrupt sources using a 2-level register scheme. The interrupt
5controller, or the HW block containing it, is referred to occasionally
6as "armctrl" in the SoC documentation, hence naming of this binding.
7
8Required properties:
9
10- compatible : should be "brcm,bcm2835-armctrl-ic.txt"
11- reg : Specifies base physical address and size of the registers.
12- interrupt-controller : Identifies the node as an interrupt controller
13- #interrupt-cells : Specifies the number of cells needed to encode an
14 interrupt source. The value shall be 2.
15
16 The 1st cell is the interrupt bank; 0 for interrupts in the "IRQ basic
17 pending" register, or 1/2 respectively for interrupts in the "IRQ pending
18 1/2" register.
19
20 The 2nd cell contains the interrupt number within the bank. Valid values
21 are 0..7 for bank 0, and 0..31 for bank 1.
22
23The interrupt sources are as follows:
24
25Bank 0:
260: ARM_TIMER
271: ARM_MAILBOX
282: ARM_DOORBELL_0
293: ARM_DOORBELL_1
304: VPU0_HALTED
315: VPU1_HALTED
326: ILLEGAL_TYPE0
337: ILLEGAL_TYPE1
34
35Bank 1:
360: TIMER0
371: TIMER1
382: TIMER2
393: TIMER3
404: CODEC0
415: CODEC1
426: CODEC2
437: VC_JPEG
448: ISP
459: VC_USB
4610: VC_3D
4711: TRANSPOSER
4812: MULTICORESYNC0
4913: MULTICORESYNC1
5014: MULTICORESYNC2
5115: MULTICORESYNC3
5216: DMA0
5317: DMA1
5418: VC_DMA2
5519: VC_DMA3
5620: DMA4
5721: DMA5
5822: DMA6
5923: DMA7
6024: DMA8
6125: DMA9
6226: DMA10
6327: DMA11
6428: DMA12
6529: AUX
6630: ARM
6731: VPUDMA
68
69Bank 2:
700: HOSTPORT
711: VIDEOSCALER
722: CCP2TX
733: SDC
744: DSI0
755: AVE
766: CAM0
777: CAM1
788: HDMI0
799: HDMI1
8010: PIXELVALVE1
8111: I2CSPISLV
8212: DSI1
8313: PWA0
8414: PWA1
8515: CPR
8616: SMI
8717: GPIO0
8818: GPIO1
8919: GPIO2
9020: GPIO3
9121: VC_I2C
9222: VC_SPI
9323: VC_I2SPCM
9424: VC_SDIO
9525: VC_UART
9626: SLIMBUS
9727: VEC
9828: CPG
9929: RNG
10030: VC_ARASANSDIO
10131: AVSPMON
102
103Example:
104
105intc: interrupt-controller {
106 compatible = "brcm,bcm2835-armctrl-ic";
107 reg = <0x7e00b200 0x200>;
108 interrupt-controller;
109 #interrupt-cells = <2>;
110};
diff --git a/Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt b/Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt
new file mode 100644
index 000000000000..9ceb19e0c7fd
--- /dev/null
+++ b/Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt
@@ -0,0 +1,52 @@
1* AC timing parameters of LPDDR2(JESD209-2) memories for a given speed-bin
2
3Required properties:
4- compatible : Should be "jedec,lpddr2-timings"
5- min-freq : minimum DDR clock frequency for the speed-bin. Type is <u32>
6- max-freq : maximum DDR clock frequency for the speed-bin. Type is <u32>
7
8Optional properties:
9
10The following properties represent AC timing parameters from the memory
11data-sheet of the device for a given speed-bin. All these properties are
12of type <u32> and the default unit is ps (pico seconds). Parameters with
13a different unit have a suffix indicating the unit such as 'tRAS-max-ns'
14- tRCD
15- tWR
16- tRAS-min
17- tRRD
18- tWTR
19- tXP
20- tRTP
21- tDQSCK-max
22- tFAW
23- tZQCS
24- tZQinit
25- tRPab
26- tZQCL
27- tCKESR
28- tRAS-max-ns
29- tDQSCK-max-derated
30
31Example:
32
33timings_elpida_ECB240ABACN_400mhz: lpddr2-timings@0 {
34 compatible = "jedec,lpddr2-timings";
35 min-freq = <10000000>;
36 max-freq = <400000000>;
37 tRPab = <21000>;
38 tRCD = <18000>;
39 tWR = <15000>;
40 tRAS-min = <42000>;
41 tRRD = <10000>;
42 tWTR = <7500>;
43 tXP = <7500>;
44 tRTP = <7500>;
45 tCKESR = <15000>;
46 tDQSCK-max = <5500>;
47 tFAW = <50000>;
48 tZQCS = <90000>;
49 tZQCL = <360000>;
50 tZQinit = <1000000>;
51 tRAS-max-ns = <70000>;
52};
diff --git a/Documentation/devicetree/bindings/lpddr2/lpddr2.txt b/Documentation/devicetree/bindings/lpddr2/lpddr2.txt
new file mode 100644
index 000000000000..58354a075e13
--- /dev/null
+++ b/Documentation/devicetree/bindings/lpddr2/lpddr2.txt
@@ -0,0 +1,102 @@
1* LPDDR2 SDRAM memories compliant to JEDEC JESD209-2
2
3Required properties:
4- compatible : Should be one of - "jedec,lpddr2-nvm", "jedec,lpddr2-s2",
5 "jedec,lpddr2-s4"
6
7 "ti,jedec-lpddr2-s2" should be listed if the memory part is LPDDR2-S2 type
8
9 "ti,jedec-lpddr2-s4" should be listed if the memory part is LPDDR2-S4 type
10
11 "ti,jedec-lpddr2-nvm" should be listed if the memory part is LPDDR2-NVM type
12
13- density : <u32> representing density in Mb (Mega bits)
14
15- io-width : <u32> representing bus width. Possible values are 8, 16, and 32
16
17Optional properties:
18
19The following optional properties represent the minimum value of some AC
20timing parameters of the DDR device in terms of number of clock cycles.
21These values shall be obtained from the device data-sheet.
22- tRRD-min-tck
23- tWTR-min-tck
24- tXP-min-tck
25- tRTP-min-tck
26- tCKE-min-tck
27- tRPab-min-tck
28- tRCD-min-tck
29- tWR-min-tck
30- tRASmin-min-tck
31- tCKESR-min-tck
32- tFAW-min-tck
33
34Child nodes:
35- The lpddr2 node may have one or more child nodes of type "lpddr2-timings".
36 "lpddr2-timings" provides AC timing parameters of the device for
37 a given speed-bin. The user may provide the timings for as many
38 speed-bins as is required. Please see Documentation/devicetree/
39 bindings/lpddr2/lpddr2-timings.txt for more information on "lpddr2-timings"
40
41Example:
42
43elpida_ECB240ABACN : lpddr2 {
44 compatible = "Elpida,ECB240ABACN","jedec,lpddr2-s4";
45 density = <2048>;
46 io-width = <32>;
47
48 tRPab-min-tck = <3>;
49 tRCD-min-tck = <3>;
50 tWR-min-tck = <3>;
51 tRASmin-min-tck = <3>;
52 tRRD-min-tck = <2>;
53 tWTR-min-tck = <2>;
54 tXP-min-tck = <2>;
55 tRTP-min-tck = <2>;
56 tCKE-min-tck = <3>;
57 tCKESR-min-tck = <3>;
58 tFAW-min-tck = <8>;
59
60 timings_elpida_ECB240ABACN_400mhz: lpddr2-timings@0 {
61 compatible = "jedec,lpddr2-timings";
62 min-freq = <10000000>;
63 max-freq = <400000000>;
64 tRPab = <21000>;
65 tRCD = <18000>;
66 tWR = <15000>;
67 tRAS-min = <42000>;
68 tRRD = <10000>;
69 tWTR = <7500>;
70 tXP = <7500>;
71 tRTP = <7500>;
72 tCKESR = <15000>;
73 tDQSCK-max = <5500>;
74 tFAW = <50000>;
75 tZQCS = <90000>;
76 tZQCL = <360000>;
77 tZQinit = <1000000>;
78 tRAS-max-ns = <70000>;
79 };
80
81 timings_elpida_ECB240ABACN_200mhz: lpddr2-timings@1 {
82 compatible = "jedec,lpddr2-timings";
83 min-freq = <10000000>;
84 max-freq = <200000000>;
85 tRPab = <21000>;
86 tRCD = <18000>;
87 tWR = <15000>;
88 tRAS-min = <42000>;
89 tRRD = <10000>;
90 tWTR = <10000>;
91 tXP = <7500>;
92 tRTP = <7500>;
93 tCKESR = <15000>;
94 tDQSCK-max = <5500>;
95 tFAW = <50000>;
96 tZQCS = <90000>;
97 tZQCL = <360000>;
98 tZQinit = <1000000>;
99 tRAS-max-ns = <70000>;
100 };
101
102}
diff --git a/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt b/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
new file mode 100644
index 000000000000..938f8e1ba205
--- /dev/null
+++ b/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
@@ -0,0 +1,55 @@
1* EMIF family of TI SDRAM controllers
2
3EMIF - External Memory Interface - is an SDRAM controller used in
4TI SoCs. EMIF supports, based on the IP revision, one or more of
5DDR2/DDR3/LPDDR2 protocols. This binding describes a given instance
6of the EMIF IP and memory parts attached to it.
7
8Required properties:
9- compatible : Should be of the form "ti,emif-<ip-rev>" where <ip-rev>
10 is the IP revision of the specific EMIF instance.
11
12- phy-type : <u32> indicating the DDR phy type. Following are the
13 allowed values
14 <1> : Attila PHY
15 <2> : Intelli PHY
16
17- device-handle : phandle to a "lpddr2" node representing the memory part
18
19- ti,hwmods : For TI hwmods processing and omap device creation
20 the value shall be "emif<n>" where <n> is the number of the EMIF
21 instance with base 1.
22
23Optional properties:
24- cs1-used : Have this property if CS1 of this EMIF
25 instance has a memory part attached to it. If there is a memory
26 part attached to CS1, it should be the same type as the one on CS0,
27 so there is no need to give the details of this memory part.
28
29- cal-resistor-per-cs : Have this property if the board has one
30 calibration resistor per chip-select.
31
32- hw-caps-read-idle-ctrl: Have this property if the controller
33 supports read idle window programming
34
35- hw-caps-dll-calib-ctrl: Have this property if the controller
36 supports dll calibration control
37
38- hw-caps-ll-interface : Have this property if the controller
39 has a low latency interface and corresponding interrupt events
40
41- hw-caps-temp-alert : Have this property if the controller
42 has capability for generating SDRAM temperature alerts
43
44Example:
45
46emif1: emif@0x4c000000 {
47 compatible = "ti,emif-4d";
48 ti,hwmods = "emif2";
49 phy-type = <1>;
50 device-handle = <&elpida_ECB240ABACN>;
51 cs1-used;
52 hw-caps-read-idle-ctrl;
53 hw-caps-ll-interface;
54 hw-caps-temp-alert;
55};
diff --git a/Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt b/Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt
new file mode 100644
index 000000000000..f1421e2bbab7
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt
@@ -0,0 +1,31 @@
1PXA3xx NAND DT bindings
2
3Required properties:
4
5 - compatible: Should be "marvell,pxa3xx-nand"
6 - reg: The register base for the controller
7 - interrupts: The interrupt to map
8 - #address-cells: Set to <1> if the node includes partitions
9
10Optional properties:
11
12 - marvell,nand-enable-arbiter: Set to enable the bus arbiter
13 - marvell,nand-keep-config: Set to keep the NAND controller config as set
14 by the bootloader
15 - num-cs: Number of chipselect lines to usw
16
17Example:
18
19 nand0: nand@43100000 {
20 compatible = "marvell,pxa3xx-nand";
21 reg = <0x43100000 90>;
22 interrupts = <45>;
23 #address-cells = <1>;
24
25 marvell,nand-enable-arbiter;
26 marvell,nand-keep-config;
27 num-cs = <1>;
28
29 /* partitions (optional) */
30 };
31
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt
new file mode 100644
index 000000000000..01ef408e205f
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-370-pinctrl.txt
@@ -0,0 +1,95 @@
1* Marvell Armada 370 SoC pinctrl driver for mpp
2
3Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding
4part and usage.
5
6Required properties:
7- compatible: "marvell,88f6710-pinctrl"
8
9Available mpp pins/groups and functions:
10Note: brackets (x) are not part of the mpp name for marvell,function and given
11only for more detailed description in this document.
12
13name pins functions
14================================================================================
15mpp0 0 gpio, uart0(rxd)
16mpp1 1 gpo, uart0(txd)
17mpp2 2 gpio, i2c0(sck), uart0(txd)
18mpp3 3 gpio, i2c0(sda), uart0(rxd)
19mpp4 4 gpio, cpu_pd(vdd)
20mpp5 5 gpo, ge0(txclko), uart1(txd), spi1(clk), audio(mclk)
21mpp6 6 gpio, ge0(txd0), sata0(prsnt), tdm(rst), audio(sdo)
22mpp7 7 gpo, ge0(txd1), tdm(tdx), audio(lrclk)
23mpp8 8 gpio, ge0(txd2), uart0(rts), tdm(drx), audio(bclk)
24mpp9 9 gpo, ge0(txd3), uart1(txd), sd0(clk), audio(spdifo)
25mpp10 10 gpio, ge0(txctl), uart0(cts), tdm(fsync), audio(sdi)
26mpp11 11 gpio, ge0(rxd0), uart1(rxd), sd0(cmd), spi0(cs1),
27 sata1(prsnt), spi1(cs1)
28mpp12 12 gpio, ge0(rxd1), i2c1(sda), sd0(d0), spi1(cs0),
29 audio(spdifi)
30mpp13 13 gpio, ge0(rxd2), i2c1(sck), sd0(d1), tdm(pclk),
31 audio(rmclk)
32mpp14 14 gpio, ge0(rxd3), pcie(clkreq0), sd0(d2), spi1(mosi),
33 spi0(cs2)
34mpp15 15 gpio, ge0(rxctl), pcie(clkreq1), sd0(d3), spi1(miso),
35 spi0(cs3)
36mpp16 16 gpio, ge0(rxclk), uart1(rxd), tdm(int), audio(extclk)
37mpp17 17 gpo, ge(mdc)
38mpp18 18 gpio, ge(mdio)
39mpp19 19 gpio, ge0(txclk), ge1(txclkout), tdm(pclk)
40mpp20 20 gpo, ge0(txd4), ge1(txd0)
41mpp21 21 gpo, ge0(txd5), ge1(txd1), uart1(txd)
42mpp22 22 gpo, ge0(txd6), ge1(txd2), uart0(rts)
43mpp23 23 gpo, ge0(txd7), ge1(txd3), spi1(mosi)
44mpp24 24 gpio, ge0(col), ge1(txctl), spi1(cs0)
45mpp25 25 gpio, ge0(rxerr), ge1(rxd0), uart1(rxd)
46mpp26 26 gpio, ge0(crs), ge1(rxd1), spi1(miso)
47mpp27 27 gpio, ge0(rxd4), ge1(rxd2), uart0(cts)
48mpp28 28 gpio, ge0(rxd5), ge1(rxd3)
49mpp29 29 gpio, ge0(rxd6), ge1(rxctl), i2c1(sda)
50mpp30 30 gpio, ge0(rxd7), ge1(rxclk), i2c1(sck)
51mpp31 31 gpio, tclk, ge0(txerr)
52mpp32 32 gpio, spi0(cs0)
53mpp33 33 gpio, dev(bootcs), spi0(cs0)
54mpp34 34 gpo, dev(wen0), spi0(mosi)
55mpp35 35 gpo, dev(oen), spi0(sck)
56mpp36 36 gpo, dev(a1), spi0(miso)
57mpp37 37 gpo, dev(a0), sata0(prsnt)
58mpp38 38 gpio, dev(ready), uart1(cts), uart0(cts)
59mpp39 39 gpo, dev(ad0), audio(spdifo)
60mpp40 40 gpio, dev(ad1), uart1(rts), uart0(rts)
61mpp41 41 gpio, dev(ad2), uart1(rxd)
62mpp42 42 gpo, dev(ad3), uart1(txd)
63mpp43 43 gpo, dev(ad4), audio(bclk)
64mpp44 44 gpo, dev(ad5), audio(mclk)
65mpp45 45 gpo, dev(ad6), audio(lrclk)
66mpp46 46 gpo, dev(ad7), audio(sdo)
67mpp47 47 gpo, dev(ad8), sd0(clk), audio(spdifo)
68mpp48 48 gpio, dev(ad9), uart0(rts), sd0(cmd), sata1(prsnt),
69 spi0(cs1)
70mpp49 49 gpio, dev(ad10), pcie(clkreq1), sd0(d0), spi1(cs0),
71 audio(spdifi)
72mpp50 50 gpio, dev(ad11), uart0(cts), sd0(d1), spi1(miso),
73 audio(rmclk)
74mpp51 51 gpio, dev(ad12), i2c1(sda), sd0(d2), spi1(mosi)
75mpp52 52 gpio, dev(ad13), i2c1(sck), sd0(d3), spi1(sck)
76mpp53 53 gpio, dev(ad14), sd0(clk), tdm(pclk), spi0(cs2),
77 pcie(clkreq1)
78mpp54 54 gpo, dev(ad15), tdm(dtx)
79mpp55 55 gpio, dev(cs1), uart1(txd), tdm(rst), sata1(prsnt),
80 sata0(prsnt)
81mpp56 56 gpio, dev(cs2), uart1(cts), uart0(cts), spi0(cs3),
82 pcie(clkreq0), spi1(cs1)
83mpp57 57 gpio, dev(cs3), uart1(rxd), tdm(fsync), sata0(prsnt),
84 audio(sdo)
85mpp58 58 gpio, dev(cs0), uart1(rts), tdm(int), audio(extclk),
86 uart0(rts)
87mpp59 59 gpo, dev(ale0), uart1(rts), uart0(rts), audio(bclk)
88mpp60 60 gpio, dev(ale1), uart1(rxd), sata0(prsnt), pcie(rst-out),
89 audio(sdi)
90mpp61 61 gpo, dev(wen1), uart1(txd), audio(rclk)
91mpp62 62 gpio, dev(a2), uart1(cts), tdm(drx), pcie(clkreq0),
92 audio(mclk), uart0(cts)
93mpp63 63 gpo, spi0(sck), tclk
94mpp64 64 gpio, spi0(miso), spi0-1(cs1)
95mpp65 65 gpio, spi0(mosi), spi0-1(cs2)
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt
new file mode 100644
index 000000000000..bfa0a2e5e0cb
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-xp-pinctrl.txt
@@ -0,0 +1,100 @@
1* Marvell Armada XP SoC pinctrl driver for mpp
2
3Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding
4part and usage.
5
6Required properties:
7- compatible: "marvell,mv78230-pinctrl", "marvell,mv78260-pinctrl",
8 "marvell,mv78460-pinctrl"
9
10This driver supports all Armada XP variants, i.e. mv78230, mv78260, and mv78460.
11
12Available mpp pins/groups and functions:
13Note: brackets (x) are not part of the mpp name for marvell,function and given
14only for more detailed description in this document.
15
16* Marvell Armada XP (all variants)
17
18name pins functions
19================================================================================
20mpp0 0 gpio, ge0(txclko), lcd(d0)
21mpp1 1 gpio, ge0(txd0), lcd(d1)
22mpp2 2 gpio, ge0(txd1), lcd(d2)
23mpp3 3 gpio, ge0(txd2), lcd(d3)
24mpp4 4 gpio, ge0(txd3), lcd(d4)
25mpp5 5 gpio, ge0(txctl), lcd(d5)
26mpp6 6 gpio, ge0(rxd0), lcd(d6)
27mpp7 7 gpio, ge0(rxd1), lcd(d7)
28mpp8 8 gpio, ge0(rxd2), lcd(d8)
29mpp9 9 gpio, ge0(rxd3), lcd(d9)
30mpp10 10 gpio, ge0(rxctl), lcd(d10)
31mpp11 11 gpio, ge0(rxclk), lcd(d11)
32mpp12 12 gpio, ge0(txd4), ge1(txd0), lcd(d12)
33mpp13 13 gpio, ge0(txd5), ge1(txd1), lcd(d13)
34mpp14 14 gpio, ge0(txd6), ge1(txd2), lcd(d15)
35mpp15 15 gpio, ge0(txd7), ge1(txd3), lcd(d16)
36mpp16 16 gpio, ge0(txd7), ge1(txd3), lcd(d16)
37mpp17 17 gpio, ge0(col), ge1(txctl), lcd(d17)
38mpp18 18 gpio, ge0(rxerr), ge1(rxd0), lcd(d18), ptp(trig)
39mpp19 19 gpio, ge0(crs), ge1(rxd1), lcd(d19), ptp(evreq)
40mpp20 20 gpio, ge0(rxd4), ge1(rxd2), lcd(d20), ptp(clk)
41mpp21 21 gpio, ge0(rxd5), ge1(rxd3), lcd(d21), mem(bat)
42mpp22 22 gpio, ge0(rxd6), ge1(rxctl), lcd(d22), sata0(prsnt)
43mpp23 23 gpio, ge0(rxd7), ge1(rxclk), lcd(d23), sata1(prsnt)
44mpp24 24 gpio, lcd(hsync), sata1(prsnt), nf(bootcs-re), tdm(rst)
45mpp25 25 gpio, lcd(vsync), sata0(prsnt), nf(bootcs-we), tdm(pclk)
46mpp26 26 gpio, lcd(clk), tdm(fsync), vdd(cpu1-pd)
47mpp27 27 gpio, lcd(e), tdm(dtx), ptp(trig)
48mpp28 28 gpio, lcd(pwm), tdm(drx), ptp(evreq)
49mpp29 29 gpio, lcd(ref-clk), tdm(int0), ptp(clk), vdd(cpu0-pd)
50mpp30 30 gpio, tdm(int1), sd0(clk)
51mpp31 31 gpio, tdm(int2), sd0(cmd), vdd(cpu0-pd)
52mpp32 32 gpio, tdm(int3), sd0(d0), vdd(cpu1-pd)
53mpp33 33 gpio, tdm(int4), sd0(d1), mem(bat)
54mpp34 34 gpio, tdm(int5), sd0(d2), sata0(prsnt)
55mpp35 35 gpio, tdm(int6), sd0(d3), sata1(prsnt)
56mpp36 36 gpio, spi(mosi)
57mpp37 37 gpio, spi(miso)
58mpp38 38 gpio, spi(sck)
59mpp39 39 gpio, spi(cs0)
60mpp40 40 gpio, spi(cs1), uart2(cts), lcd(vga-hsync), vdd(cpu1-pd),
61 pcie(clkreq0)
62mpp41 41 gpio, spi(cs2), uart2(rts), lcd(vga-vsync), sata1(prsnt),
63 pcie(clkreq1)
64mpp42 42 gpio, uart2(rxd), uart0(cts), tdm(int7), tdm-1(timer),
65 vdd(cpu0-pd)
66mpp43 43 gpio, uart2(txd), uart0(rts), spi(cs3), pcie(rstout),
67 vdd(cpu2-3-pd){1}
68mpp44 44 gpio, uart2(cts), uart3(rxd), spi(cs4), pcie(clkreq2),
69 mem(bat)
70mpp45 45 gpio, uart2(rts), uart3(txd), spi(cs5), sata1(prsnt)
71mpp46 46 gpio, uart3(rts), uart1(rts), spi(cs6), sata0(prsnt)
72mpp47 47 gpio, uart3(cts), uart1(cts), spi(cs7), pcie(clkreq3),
73 ref(clkout)
74mpp48 48 gpio, tclk, dev(burst/last)
75
76* Marvell Armada XP (mv78260 and mv78460 only)
77
78name pins functions
79================================================================================
80mpp49 49 gpio, dev(we3)
81mpp50 50 gpio, dev(we2)
82mpp51 51 gpio, dev(ad16)
83mpp52 52 gpio, dev(ad17)
84mpp53 53 gpio, dev(ad18)
85mpp54 54 gpio, dev(ad19)
86mpp55 55 gpio, dev(ad20), vdd(cpu0-pd)
87mpp56 56 gpio, dev(ad21), vdd(cpu1-pd)
88mpp57 57 gpio, dev(ad22), vdd(cpu2-3-pd){1}
89mpp58 58 gpio, dev(ad23)
90mpp59 59 gpio, dev(ad24)
91mpp60 60 gpio, dev(ad25)
92mpp61 61 gpio, dev(ad26)
93mpp62 62 gpio, dev(ad27)
94mpp63 63 gpio, dev(ad28)
95mpp64 64 gpio, dev(ad29)
96mpp65 65 gpio, dev(ad30)
97mpp66 66 gpio, dev(ad31)
98
99Notes:
100* {1} vdd(cpu2-3-pd) only available on mv78460.
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,dove-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,dove-pinctrl.txt
new file mode 100644
index 000000000000..a648aaad6110
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,dove-pinctrl.txt
@@ -0,0 +1,72 @@
1* Marvell Dove SoC pinctrl driver for mpp
2
3Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding
4part and usage.
5
6Required properties:
7- compatible: "marvell,dove-pinctrl"
8- clocks: (optional) phandle of pdma clock
9
10Available mpp pins/groups and functions:
11Note: brackets (x) are not part of the mpp name for marvell,function and given
12only for more detailed description in this document.
13
14name pins functions
15================================================================================
16mpp0 0 gpio, pmu, uart2(rts), sdio0(cd), lcd0(pwm)
17mpp1 1 gpio, pmu, uart2(cts), sdio0(wp), lcd1(pwm)
18mpp2 2 gpio, pmu, uart2(txd), sdio0(buspwr), sata(prsnt),
19 uart1(rts)
20mpp3 3 gpio, pmu, uart2(rxd), sdio0(ledctrl), sata(act),
21 uart1(cts), lcd-spi(cs1)
22mpp4 4 gpio, pmu, uart3(rts), sdio1(cd), spi1(miso)
23mpp5 5 gpio, pmu, uart3(cts), sdio1(wp), spi1(cs)
24mpp6 6 gpio, pmu, uart3(txd), sdio1(buspwr), spi1(mosi)
25mpp7 7 gpio, pmu, uart3(rxd), sdio1(ledctrl), spi1(sck)
26mpp8 8 gpio, pmu, watchdog(rstout)
27mpp9 9 gpio, pmu, pex1(clkreq)
28mpp10 10 gpio, pmu, ssp(sclk)
29mpp11 11 gpio, pmu, sata(prsnt), sata-1(act), sdio0(ledctrl),
30 sdio1(ledctrl), pex0(clkreq)
31mpp12 12 gpio, pmu, uart2(rts), audio0(extclk), sdio1(cd), sata(act)
32mpp13 13 gpio, pmu, uart2(cts), audio1(extclk), sdio1(wp),
33 ssp(extclk)
34mpp14 14 gpio, pmu, uart2(txd), sdio1(buspwr), ssp(rxd)
35mpp15 15 gpio, pmu, uart2(rxd), sdio1(ledctrl), ssp(sfrm)
36mpp16 16 gpio, uart3(rts), sdio0(cd), ac97(sdi1), lcd-spi(cs1)
37mpp17 17 gpio, uart3(cts), sdio0(wp), ac97(sdi2), twsi(sda),
38 ac97-1(sysclko)
39mpp18 18 gpio, uart3(txd), sdio0(buspwr), ac97(sdi3), lcd0(pwm)
40mpp19 19 gpio, uart3(rxd), sdio0(ledctrl), twsi(sck)
41mpp20 20 gpio, sdio0(cd), sdio1(cd), spi1(miso), lcd-spi(miso),
42 ac97(sysclko)
43mpp21 21 gpio, sdio0(wp), sdio1(wp), spi1(cs), lcd-spi(cs0),
44 uart1(cts), ssp(sfrm)
45mpp22 22 gpio, sdio0(buspwr), sdio1(buspwr), spi1(mosi),
46 lcd-spi(mosi), uart1(cts), ssp(txd)
47mpp23 23 gpio, sdio0(ledctrl), sdio1(ledctrl), spi1(sck),
48 lcd-spi(sck), ssp(sclk)
49mpp_camera 24-39 gpio, camera
50mpp_sdio0 40-45 gpio, sdio0
51mpp_sdio1 46-51 gpio, sdio1
52mpp_audio1 52-57 gpio, i2s1/spdifo, i2s1, spdifo, twsi, ssp/spdifo, ssp,
53 ssp/twsi
54mpp_spi0 58-61 gpio, spi0
55mpp_uart1 62-63 gpio, uart1
56mpp_nand 64-71 gpo, nand
57audio0 - i2s, ac97
58twsi - none, opt1, opt2, opt3
59
60Notes:
61* group "mpp_audio1" allows the following functions and gpio pins:
62 - gpio : gpio on pins 52-57
63 - i2s1/spdifo : audio1 i2s on pins 52-55 and spdifo on 57, no gpios
64 - i2s1 : audio1 i2s on pins 52-55, gpio on pins 56,57
65 - spdifo : spdifo on pin 57, gpio on pins 52-55
66 - twsi : twsi on pins 56,57, gpio on pins 52-55
67 - ssp/spdifo : ssp on pins 52-55, spdifo on pin 57, no gpios
68 - ssp : ssp on pins 52-55, gpio on pins 56,57
69 - ssp/twsi : ssp on pins 52-55, twsi on pins 56,57, no gpios
70* group "audio0" internally muxes i2s0 or ac97 controller to the dedicated
71 audio0 pins.
72* group "twsi" internally muxes twsi controller to the dedicated or option pins.
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt
new file mode 100644
index 000000000000..361bccb7ec89
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt
@@ -0,0 +1,279 @@
1* Marvell Kirkwood SoC pinctrl driver for mpp
2
3Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding
4part and usage.
5
6Required properties:
7- compatible: "marvell,88f6180-pinctrl",
8 "marvell,88f6190-pinctrl", "marvell,88f6192-pinctrl",
9 "marvell,88f6281-pinctrl", "marvell,88f6282-pinctrl"
10
11This driver supports all kirkwood variants, i.e. 88f6180, 88f619x, and 88f628x.
12
13Available mpp pins/groups and functions:
14Note: brackets (x) are not part of the mpp name for marvell,function and given
15only for more detailed description in this document.
16
17* Marvell Kirkwood 88f6180
18
19name pins functions
20================================================================================
21mpp0 0 gpio, nand(io2), spi(cs)
22mpp1 1 gpo, nand(io3), spi(mosi)
23mpp2 2 gpo, nand(io4), spi(sck)
24mpp3 3 gpo, nand(io5), spi(miso)
25mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk)
26mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig)
27mpp6 6 sysrst(out), spi(mosi), ptp(trig)
28mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
29mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
30 mii(col)
31mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
32 mii(crs)
33mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig)
34mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
35 ptp-2(trig)
36mpp12 12 gpo, sdio(clk)
37mpp13 13 gpio, sdio(cmd), uart1(txd)
38mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col)
39mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd)
40mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs)
41mpp17 17 gpio, sdio(d3)
42mpp18 18 gpo, nand(io0)
43mpp19 19 gpo, nand(io1)
44mpp20 20 gpio, mii(rxerr)
45mpp21 21 gpio, audio(spdifi)
46mpp22 22 gpio, audio(spdifo)
47mpp23 23 gpio, audio(rmclk)
48mpp24 24 gpio, audio(bclk)
49mpp25 25 gpio, audio(sdo)
50mpp26 26 gpio, audio(lrclk)
51mpp27 27 gpio, audio(mclk)
52mpp28 28 gpio, audio(sdi)
53mpp29 29 gpio, audio(extclk)
54
55* Marvell Kirkwood 88f6190
56
57name pins functions
58================================================================================
59mpp0 0 gpio, nand(io2), spi(cs)
60mpp1 1 gpo, nand(io3), spi(mosi)
61mpp2 2 gpo, nand(io4), spi(sck)
62mpp3 3 gpo, nand(io5), spi(miso)
63mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk)
64mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act)
65mpp6 6 sysrst(out), spi(mosi), ptp(trig)
66mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
67mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
68 mii(col), mii-1(rxerr)
69mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
70 mii(crs), sata0(prsnt)
71mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig)
72mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
73 ptp-2(trig), sata0(act)
74mpp12 12 gpo, sdio(clk)
75mpp13 13 gpio, sdio(cmd), uart1(txd)
76mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col)
77mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act)
78mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs)
79mpp17 17 gpio, sdio(d3), sata0(prsnt)
80mpp18 18 gpo, nand(io0)
81mpp19 19 gpo, nand(io1)
82mpp20 20 gpio, ge1(txd0)
83mpp21 21 gpio, ge1(txd1), sata0(act)
84mpp22 22 gpio, ge1(txd2)
85mpp23 23 gpio, ge1(txd3), sata0(prsnt)
86mpp24 24 gpio, ge1(rxd0)
87mpp25 25 gpio, ge1(rxd1)
88mpp26 26 gpio, ge1(rxd2)
89mpp27 27 gpio, ge1(rxd3)
90mpp28 28 gpio, ge1(col)
91mpp29 29 gpio, ge1(txclk)
92mpp30 30 gpio, ge1(rxclk)
93mpp31 31 gpio, ge1(rxclk)
94mpp32 32 gpio, ge1(txclko)
95mpp33 33 gpo, ge1(txclk)
96mpp34 34 gpio, ge1(txen)
97mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr)
98
99* Marvell Kirkwood 88f6192
100
101name pins functions
102================================================================================
103mpp0 0 gpio, nand(io2), spi(cs)
104mpp1 1 gpo, nand(io3), spi(mosi)
105mpp2 2 gpo, nand(io4), spi(sck)
106mpp3 3 gpo, nand(io5), spi(miso)
107mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk), sata1(act)
108mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act)
109mpp6 6 sysrst(out), spi(mosi), ptp(trig)
110mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
111mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
112 mii(col), mii-1(rxerr), sata1(prsnt)
113mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
114 mii(crs), sata0(prsnt)
115mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig), sata1(act)
116mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
117 ptp-2(trig), sata0(act)
118mpp12 12 gpo, sdio(clk)
119mpp13 13 gpio, sdio(cmd), uart1(txd)
120mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt)
121mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act)
122mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs),
123 sata1(act)
124mpp17 17 gpio, sdio(d3), sata0(prsnt)
125mpp18 18 gpo, nand(io0)
126mpp19 19 gpo, nand(io1)
127mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi),
128 sata1(act)
129mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql),
130 audio(spdifo)
131mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk),
132 sata1(prsnt)
133mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql),
134 audio(bclk)
135mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo)
136mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk)
137mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk)
138mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi)
139mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk)
140mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst)
141mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk)
142mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs)
143mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx)
144mpp33 33 gpo, ge1(txclk), tdm(drx)
145mpp34 34 gpio, ge1(txen), tdm(spi-cs1)
146mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql)
147
148* Marvell Kirkwood 88f6281
149
150name pins functions
151================================================================================
152mpp0 0 gpio, nand(io2), spi(cs)
153mpp1 1 gpo, nand(io3), spi(mosi)
154mpp2 2 gpo, nand(io4), spi(sck)
155mpp3 3 gpo, nand(io5), spi(miso)
156mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk), sata1(act)
157mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act)
158mpp6 6 sysrst(out), spi(mosi), ptp(trig)
159mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig)
160mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk),
161 mii(col), mii-1(rxerr), sata1(prsnt)
162mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq),
163 mii(crs), sata0(prsnt)
164mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig), sata1(act)
165mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq),
166 ptp-2(trig), sata0(act)
167mpp12 12 gpio, sdio(clk)
168mpp13 13 gpio, sdio(cmd), uart1(txd)
169mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt)
170mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act)
171mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs),
172 sata1(act)
173mpp17 17 gpio, sdio(d3), sata0(prsnt)
174mpp18 18 gpo, nand(io0)
175mpp19 19 gpo, nand(io1)
176mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi),
177 sata1(act)
178mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql),
179 audio(spdifo)
180mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk),
181 sata1(prsnt)
182mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql),
183 audio(bclk)
184mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo)
185mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk)
186mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk)
187mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi)
188mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk)
189mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst)
190mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk)
191mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs)
192mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx)
193mpp33 33 gpo, ge1(txclk), tdm(drx)
194mpp34 34 gpio, ge1(txen), tdm(spi-cs1), sata1(act)
195mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql)
196mpp36 36 gpio, ts(mp0), tdm(spi-cs1), audio(spdifi)
197mpp37 37 gpio, ts(mp1), tdm(tx2ql), audio(spdifo)
198mpp38 38 gpio, ts(mp2), tdm(rx2ql), audio(rmclk)
199mpp39 39 gpio, ts(mp3), tdm(spi-cs0), audio(bclk)
200mpp40 40 gpio, ts(mp4), tdm(spi-sck), audio(sdo)
201mpp41 41 gpio, ts(mp5), tdm(spi-miso), audio(lrclk)
202mpp42 42 gpio, ts(mp6), tdm(spi-mosi), audio(mclk)
203mpp43 43 gpio, ts(mp7), tdm(int), audio(sdi)
204mpp44 44 gpio, ts(mp8), tdm(rst), audio(extclk)
205mpp45 45 gpio, ts(mp9), tdm(pclk)
206mpp46 46 gpio, ts(mp10), tdm(fs)
207mpp47 47 gpio, ts(mp11), tdm(drx)
208mpp48 48 gpio, ts(mp12), tdm(dtx)
209mpp49 49 gpio, ts(mp9), tdm(rx0ql), ptp(clk)
210
211* Marvell Kirkwood 88f6282
212
213name pins functions
214================================================================================
215mpp0 0 gpio, nand(io2), spi(cs)
216mpp1 1 gpo, nand(io3), spi(mosi)
217mpp2 2 gpo, nand(io4), spi(sck)
218mpp3 3 gpo, nand(io5), spi(miso)
219mpp4 4 gpio, nand(io6), uart0(rxd), sata1(act), lcd(hsync)
220mpp5 5 gpo, nand(io7), uart0(txd), sata0(act), lcd(vsync)
221mpp6 6 sysrst(out), spi(mosi)
222mpp7 7 gpo, spi(cs), lcd(pwm)
223mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), mii(col),
224 mii-1(rxerr), sata1(prsnt)
225mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), mii(crs),
226 sata0(prsnt)
227mpp10 10 gpo, spi(sck), uart0(txd), sata1(act)
228mpp11 11 gpio, spi(miso), uart0(rxd), sata0(act)
229mpp12 12 gpo, sdio(clk), audio(spdifo), spi(mosi), twsi(sda)
230mpp13 13 gpio, sdio(cmd), uart1(txd), audio(rmclk), lcd(pwm)
231mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt),
232 audio(spdifi), audio-1(sdi)
233mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act),
234 spi(cs)
235mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs),
236 sata1(act), lcd(extclk)
237mpp17 17 gpio, sdio(d3), sata0(prsnt), sata1(act), twsi1(sck)
238mpp18 18 gpo, nand(io0), pex(clkreq)
239mpp19 19 gpo, nand(io1)
240mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi),
241 sata1(act), lcd(d0)
242mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql),
243 audio(spdifo), lcd(d1)
244mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk),
245 sata1(prsnt), lcd(d2)
246mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql),
247 audio(bclk), lcd(d3)
248mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo),
249 lcd(d4)
250mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk),
251 lcd(d5)
252mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk),
253 lcd(d6)
254mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi),
255 lcd(d7)
256mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk),
257 lcd(d8)
258mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst), lcd(d9)
259mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk), lcd(d10)
260mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs), lcd(d11)
261mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx), lcd(d12)
262mpp33 33 gpo, ge1(txclk), tdm(drx), lcd(d13)
263mpp34 34 gpio, ge1(txen), tdm(spi-cs1), sata1(act), lcd(d14)
264mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql),
265 lcd(d15)
266mpp36 36 gpio, ts(mp0), tdm(spi-cs1), audio(spdifi), twsi1(sda)
267mpp37 37 gpio, ts(mp1), tdm(tx2ql), audio(spdifo), twsi1(sck)
268mpp38 38 gpio, ts(mp2), tdm(rx2ql), audio(rmclk), lcd(d18)
269mpp39 39 gpio, ts(mp3), tdm(spi-cs0), audio(bclk), lcd(d19)
270mpp40 40 gpio, ts(mp4), tdm(spi-sck), audio(sdo), lcd(d20)
271mpp41 41 gpio, ts(mp5), tdm(spi-miso), audio(lrclk), lcd(d21)
272mpp42 42 gpio, ts(mp6), tdm(spi-mosi), audio(mclk), lcd(d22)
273mpp43 43 gpio, ts(mp7), tdm(int), audio(sdi), lcd(d23)
274mpp44 44 gpio, ts(mp8), tdm(rst), audio(extclk), lcd(clk)
275mpp45 45 gpio, ts(mp9), tdm(pclk), lcd(e)
276mpp46 46 gpio, ts(mp10), tdm(fs), lcd(hsync)
277mpp47 47 gpio, ts(mp11), tdm(drx), lcd(vsync)
278mpp48 48 gpio, ts(mp12), tdm(dtx), lcd(d16)
279mpp49 49 gpo, tdm(rx0ql), pex(clkreq), lcd(d17)
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,mvebu-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,mvebu-pinctrl.txt
new file mode 100644
index 000000000000..0a26c3aa4e6d
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/marvell,mvebu-pinctrl.txt
@@ -0,0 +1,46 @@
1* Marvell SoC pinctrl core driver for mpp
2
3The pinctrl driver enables Marvell SoCs to configure the multi-purpose pins
4(mpp) to a specific function. For each SoC family there is a SoC specific
5driver using this core driver.
6
7Please refer to pinctrl-bindings.txt in this directory for details of the
8common pinctrl bindings used by client devices, including the meaning of the
9phrase "pin configuration node".
10
11A Marvell SoC pin configuration node is a node of a group of pins which can
12be used for a specific device or function. Each node requires one or more
13mpp pins or group of pins and a mpp function common to all pins.
14
15Required properties for pinctrl driver:
16- compatible: "marvell,<soc>-pinctrl"
17 Please refer to each marvell,<soc>-pinctrl.txt binding doc for supported SoCs.
18
19Required properties for pin configuration node:
20- marvell,pins: string array of mpp pins or group of pins to be muxed.
21- marvell,function: string representing a function to mux to for all
22 marvell,pins given in this pin configuration node. The function has to be
23 common for all marvell,pins. Please refer to marvell,<soc>-pinctrl.txt for
24 valid pin/pin group names and available function names for each SoC.
25
26Examples:
27
28uart1: serial@12100 {
29 compatible = "ns16550a";
30 reg = <0x12100 0x100>;
31 reg-shift = <2>;
32 interrupts = <7>;
33
34 pinctrl-0 = <&pmx_uart1_sw>;
35 pinctrl-names = "default";
36};
37
38pinctrl: pinctrl@d0200 {
39 compatible = "marvell,dove-pinctrl";
40 reg = <0xd0200 0x20>;
41
42 pmx_uart1_sw: pmx-uart1-sw {
43 marvell,pins = "mpp_uart1";
44 marvell,function = "uart1";
45 };
46};
diff --git a/Documentation/devicetree/bindings/regulator/tps6586x.txt b/Documentation/devicetree/bindings/regulator/tps6586x.txt
index da80c2ae0915..a2436e1edfc1 100644
--- a/Documentation/devicetree/bindings/regulator/tps6586x.txt
+++ b/Documentation/devicetree/bindings/regulator/tps6586x.txt
@@ -8,7 +8,8 @@ Required properties:
8- gpio-controller: mark the device as a GPIO controller 8- gpio-controller: mark the device as a GPIO controller
9- regulators: list of regulators provided by this controller, must have 9- regulators: list of regulators provided by this controller, must have
10 property "regulator-compatible" to match their hardware counterparts: 10 property "regulator-compatible" to match their hardware counterparts:
11 sm[0-2], ldo[0-9] and ldo_rtc 11 sys, sm[0-2], ldo[0-9] and ldo_rtc
12- sys-supply: The input supply for SYS.
12- vin-sm0-supply: The input supply for the SM0. 13- vin-sm0-supply: The input supply for the SM0.
13- vin-sm1-supply: The input supply for the SM1. 14- vin-sm1-supply: The input supply for the SM1.
14- vin-sm2-supply: The input supply for the SM2. 15- vin-sm2-supply: The input supply for the SM2.
@@ -20,6 +21,9 @@ Required properties:
20 21
21Each regulator is defined using the standard binding for regulators. 22Each regulator is defined using the standard binding for regulators.
22 23
24Note: LDO5 and LDO_RTC is supplied by SYS regulator internally and driver
25 take care of making proper parent child relationship.
26
23Example: 27Example:
24 28
25 pmu: tps6586x@34 { 29 pmu: tps6586x@34 {
@@ -30,6 +34,7 @@ Example:
30 #gpio-cells = <2>; 34 #gpio-cells = <2>;
31 gpio-controller; 35 gpio-controller;
32 36
37 sys-supply = <&some_reg>;
33 vin-sm0-supply = <&some_reg>; 38 vin-sm0-supply = <&some_reg>;
34 vin-sm1-supply = <&some_reg>; 39 vin-sm1-supply = <&some_reg>;
35 vin-sm2-supply = <&some_reg>; 40 vin-sm2-supply = <&some_reg>;
@@ -43,8 +48,16 @@ Example:
43 #address-cells = <1>; 48 #address-cells = <1>;
44 #size-cells = <0>; 49 #size-cells = <0>;
45 50
46 sm0_reg: regulator@0 { 51 sys_reg: regulator@0 {
47 reg = <0>; 52 reg = <0>;
53 regulator-compatible = "sys";
54 regulator-name = "vdd_sys";
55 regulator-boot-on;
56 regulator-always-on;
57 };
58
59 sm0_reg: regulator@1 {
60 reg = <1>;
48 regulator-compatible = "sm0"; 61 regulator-compatible = "sm0";
49 regulator-min-microvolt = < 725000>; 62 regulator-min-microvolt = < 725000>;
50 regulator-max-microvolt = <1500000>; 63 regulator-max-microvolt = <1500000>;
@@ -52,8 +65,8 @@ Example:
52 regulator-always-on; 65 regulator-always-on;
53 }; 66 };
54 67
55 sm1_reg: regulator@1 { 68 sm1_reg: regulator@2 {
56 reg = <1>; 69 reg = <2>;
57 regulator-compatible = "sm1"; 70 regulator-compatible = "sm1";
58 regulator-min-microvolt = < 725000>; 71 regulator-min-microvolt = < 725000>;
59 regulator-max-microvolt = <1500000>; 72 regulator-max-microvolt = <1500000>;
@@ -61,8 +74,8 @@ Example:
61 regulator-always-on; 74 regulator-always-on;
62 }; 75 };
63 76
64 sm2_reg: regulator@2 { 77 sm2_reg: regulator@3 {
65 reg = <2>; 78 reg = <3>;
66 regulator-compatible = "sm2"; 79 regulator-compatible = "sm2";
67 regulator-min-microvolt = <3000000>; 80 regulator-min-microvolt = <3000000>;
68 regulator-max-microvolt = <4550000>; 81 regulator-max-microvolt = <4550000>;
@@ -70,72 +83,72 @@ Example:
70 regulator-always-on; 83 regulator-always-on;
71 }; 84 };
72 85
73 ldo0_reg: regulator@3 { 86 ldo0_reg: regulator@4 {
74 reg = <3>; 87 reg = <4>;
75 regulator-compatible = "ldo0"; 88 regulator-compatible = "ldo0";
76 regulator-name = "PCIE CLK"; 89 regulator-name = "PCIE CLK";
77 regulator-min-microvolt = <3300000>; 90 regulator-min-microvolt = <3300000>;
78 regulator-max-microvolt = <3300000>; 91 regulator-max-microvolt = <3300000>;
79 }; 92 };
80 93
81 ldo1_reg: regulator@4 { 94 ldo1_reg: regulator@5 {
82 reg = <4>; 95 reg = <5>;
83 regulator-compatible = "ldo1"; 96 regulator-compatible = "ldo1";
84 regulator-min-microvolt = < 725000>; 97 regulator-min-microvolt = < 725000>;
85 regulator-max-microvolt = <1500000>; 98 regulator-max-microvolt = <1500000>;
86 }; 99 };
87 100
88 ldo2_reg: regulator@5 { 101 ldo2_reg: regulator@6 {
89 reg = <5>; 102 reg = <6>;
90 regulator-compatible = "ldo2"; 103 regulator-compatible = "ldo2";
91 regulator-min-microvolt = < 725000>; 104 regulator-min-microvolt = < 725000>;
92 regulator-max-microvolt = <1500000>; 105 regulator-max-microvolt = <1500000>;
93 }; 106 };
94 107
95 ldo3_reg: regulator@6 { 108 ldo3_reg: regulator@7 {
96 reg = <6>; 109 reg = <7>;
97 regulator-compatible = "ldo3"; 110 regulator-compatible = "ldo3";
98 regulator-min-microvolt = <1250000>; 111 regulator-min-microvolt = <1250000>;
99 regulator-max-microvolt = <3300000>; 112 regulator-max-microvolt = <3300000>;
100 }; 113 };
101 114
102 ldo4_reg: regulator@7 { 115 ldo4_reg: regulator@8 {
103 reg = <7>; 116 reg = <8>;
104 regulator-compatible = "ldo4"; 117 regulator-compatible = "ldo4";
105 regulator-min-microvolt = <1700000>; 118 regulator-min-microvolt = <1700000>;
106 regulator-max-microvolt = <2475000>; 119 regulator-max-microvolt = <2475000>;
107 }; 120 };
108 121
109 ldo5_reg: regulator@8 { 122 ldo5_reg: regulator@9 {
110 reg = <8>; 123 reg = <9>;
111 regulator-compatible = "ldo5"; 124 regulator-compatible = "ldo5";
112 regulator-min-microvolt = <1250000>; 125 regulator-min-microvolt = <1250000>;
113 regulator-max-microvolt = <3300000>; 126 regulator-max-microvolt = <3300000>;
114 }; 127 };
115 128
116 ldo6_reg: regulator@9 { 129 ldo6_reg: regulator@10 {
117 reg = <9>; 130 reg = <10>;
118 regulator-compatible = "ldo6"; 131 regulator-compatible = "ldo6";
119 regulator-min-microvolt = <1250000>; 132 regulator-min-microvolt = <1250000>;
120 regulator-max-microvolt = <3300000>; 133 regulator-max-microvolt = <3300000>;
121 }; 134 };
122 135
123 ldo7_reg: regulator@10 { 136 ldo7_reg: regulator@11 {
124 reg = <10>; 137 reg = <11>;
125 regulator-compatible = "ldo7"; 138 regulator-compatible = "ldo7";
126 regulator-min-microvolt = <1250000>; 139 regulator-min-microvolt = <1250000>;
127 regulator-max-microvolt = <3300000>; 140 regulator-max-microvolt = <3300000>;
128 }; 141 };
129 142
130 ldo8_reg: regulator@11 { 143 ldo8_reg: regulator@12 {
131 reg = <11>; 144 reg = <12>;
132 regulator-compatible = "ldo8"; 145 regulator-compatible = "ldo8";
133 regulator-min-microvolt = <1250000>; 146 regulator-min-microvolt = <1250000>;
134 regulator-max-microvolt = <3300000>; 147 regulator-max-microvolt = <3300000>;
135 }; 148 };
136 149
137 ldo9_reg: regulator@12 { 150 ldo9_reg: regulator@13 {
138 reg = <12>; 151 reg = <13>;
139 regulator-compatible = "ldo9"; 152 regulator-compatible = "ldo9";
140 regulator-min-microvolt = <1250000>; 153 regulator-min-microvolt = <1250000>;
141 regulator-max-microvolt = <3300000>; 154 regulator-max-microvolt = <3300000>;
diff --git a/Documentation/devicetree/bindings/rtc/pxa-rtc.txt b/Documentation/devicetree/bindings/rtc/pxa-rtc.txt
new file mode 100644
index 000000000000..8c6672a1b7d7
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/pxa-rtc.txt
@@ -0,0 +1,14 @@
1* PXA RTC
2
3PXA specific RTC driver.
4
5Required properties:
6- compatible : Should be "marvell,pxa-rtc"
7
8Examples:
9
10rtc@40900000 {
11 compatible = "marvell,pxa-rtc";
12 reg = <0x40900000 0x3c>;
13 interrupts = <30 31>;
14};
diff --git a/Documentation/devicetree/bindings/timer/brcm,bcm2835-system-timer.txt b/Documentation/devicetree/bindings/timer/brcm,bcm2835-system-timer.txt
new file mode 100644
index 000000000000..2de21c2acf55
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/brcm,bcm2835-system-timer.txt
@@ -0,0 +1,22 @@
1BCM2835 System Timer
2
3The System Timer peripheral provides four 32-bit timer channels and a
4single 64-bit free running counter. Each channel has an output compare
5register, which is compared against the 32 least significant bits of the
6free running counter values, and generates an interrupt.
7
8Required properties:
9
10- compatible : should be "brcm,bcm2835-system-timer.txt"
11- reg : Specifies base physical address and size of the registers.
12- interrupts : A list of 4 interrupt sinks; one per timer channel.
13- clock-frequency : The frequency of the clock that drives the counter, in Hz.
14
15Example:
16
17timer {
18 compatible = "brcm,bcm2835-system-timer";
19 reg = <0x7e003000 0x1000>;
20 interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
21 clock-frequency = <1000000>;
22};
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index db4d3af3643c..4f293e5571f0 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -10,6 +10,7 @@ apm Applied Micro Circuits Corporation (APM)
10arm ARM Ltd. 10arm ARM Ltd.
11atmel Atmel Corporation 11atmel Atmel Corporation
12bosch Bosch Sensortec GmbH 12bosch Bosch Sensortec GmbH
13brcm Broadcom Corporation
13cavium Cavium, Inc. 14cavium Cavium, Inc.
14chrp Common Hardware Reference Platform 15chrp Common Hardware Reference Platform
15cortina Cortina Systems, Inc. 16cortina Cortina Systems, Inc.
diff --git a/Documentation/spi/ep93xx_spi b/Documentation/spi/ep93xx_spi
index d8eb01c15db1..832ddce6e5fb 100644
--- a/Documentation/spi/ep93xx_spi
+++ b/Documentation/spi/ep93xx_spi
@@ -26,7 +26,7 @@ arch/arm/mach-ep93xx/ts72xx.c:
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28 28
29#include <mach/ep93xx_spi.h> 29#include <linux/platform_data/spi-ep93xx.h>
30 30
31/* this is our GPIO line used for chip select */ 31/* this is our GPIO line used for chip select */
32#define MMC_CHIP_SELECT_GPIO EP93XX_GPIO_LINE_EGPIO9 32#define MMC_CHIP_SELECT_GPIO EP93XX_GPIO_LINE_EGPIO9
diff --git a/MAINTAINERS b/MAINTAINERS
index 53cc13c82cb1..9d3965cbf48c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -595,7 +595,6 @@ M: Will Deacon <will.deacon@arm.com>
595S: Maintained 595S: Maintained
596F: arch/arm/kernel/perf_event* 596F: arch/arm/kernel/perf_event*
597F: arch/arm/oprofile/common.c 597F: arch/arm/oprofile/common.c
598F: arch/arm/kernel/pmu.c
599F: arch/arm/include/asm/pmu.h 598F: arch/arm/include/asm/pmu.h
600F: arch/arm/kernel/hw_breakpoint.c 599F: arch/arm/kernel/hw_breakpoint.c
601F: arch/arm/include/asm/hw_breakpoint.h 600F: arch/arm/include/asm/hw_breakpoint.h
@@ -1613,6 +1612,16 @@ L: netdev@vger.kernel.org
1613S: Supported 1612S: Supported
1614F: drivers/net/ethernet/broadcom/bnx2x/ 1613F: drivers/net/ethernet/broadcom/bnx2x/
1615 1614
1615BROADCOM BCM2835 ARM ARCHICTURE
1616M: Stephen Warren <swarren@wwwdotorg.org>
1617L: linux-rpi-kernel@lists.infradead.org (moderated for non-subscribers)
1618T: git git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-rpi.git
1619S: Maintained
1620F: arch/arm/mach-bcm2835/
1621F: arch/arm/boot/dts/bcm2835*
1622F: arch/arm/configs/bcm2835_defconfig
1623F: drivers/*/*bcm2835*
1624
1616BROADCOM TG3 GIGABIT ETHERNET DRIVER 1625BROADCOM TG3 GIGABIT ETHERNET DRIVER
1617M: Matt Carlson <mcarlson@broadcom.com> 1626M: Matt Carlson <mcarlson@broadcom.com>
1618M: Michael Chan <mchan@broadcom.com> 1627M: Michael Chan <mchan@broadcom.com>
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2f88d8d97701..70505d8f85c5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -202,6 +202,13 @@ config ARM_PATCH_PHYS_VIRT
202 this feature (eg, building a kernel for a single machine) and 202 this feature (eg, building a kernel for a single machine) and
203 you need to shrink the kernel to the minimal size. 203 you need to shrink the kernel to the minimal size.
204 204
205config NEED_MACH_GPIO_H
206 bool
207 help
208 Select this when mach/gpio.h is required to provide special
209 definitions for this platform. The need for mach/gpio.h should
210 be avoided when possible.
211
205config NEED_MACH_IO_H 212config NEED_MACH_IO_H
206 bool 213 bool
207 help 214 help
@@ -247,39 +254,29 @@ config MMU
247# 254#
248choice 255choice
249 prompt "ARM system type" 256 prompt "ARM system type"
250 default ARCH_VERSATILE 257 default ARCH_MULTIPLATFORM
251 258
252config ARCH_SOCFPGA 259config ARCH_MULTIPLATFORM
253 bool "Altera SOCFPGA family" 260 bool "Allow multiple platforms to be selected"
254 select ARCH_WANT_OPTIONAL_GPIOLIB 261 select ARM_PATCH_PHYS_VIRT
255 select ARM_AMBA 262 select AUTO_ZRELADDR
256 select ARM_GIC
257 select CACHE_L2X0
258 select CLKDEV_LOOKUP
259 select COMMON_CLK 263 select COMMON_CLK
260 select CPU_V7 264 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 265 select SPARSE_IRQ
267 select USE_OF 266 select USE_OF
268 help 267 depends on MMU
269 This enables support for Altera SOCFPGA Cyclone V platform
270 268
271config ARCH_INTEGRATOR 269config ARCH_INTEGRATOR
272 bool "ARM Ltd. Integrator family" 270 bool "ARM Ltd. Integrator family"
273 select ARM_AMBA 271 select ARM_AMBA
274 select ARCH_HAS_CPUFREQ 272 select ARCH_HAS_CPUFREQ
275 select COMMON_CLK 273 select COMMON_CLK
276 select CLK_VERSATILE 274 select COMMON_CLK_VERSATILE
277 select HAVE_TCM 275 select HAVE_TCM
278 select ICST 276 select ICST
279 select GENERIC_CLOCKEVENTS 277 select GENERIC_CLOCKEVENTS
280 select PLAT_VERSATILE 278 select PLAT_VERSATILE
281 select PLAT_VERSATILE_FPGA_IRQ 279 select PLAT_VERSATILE_FPGA_IRQ
282 select NEED_MACH_IO_H
283 select NEED_MACH_MEMORY_H 280 select NEED_MACH_MEMORY_H
284 select SPARSE_IRQ 281 select SPARSE_IRQ
285 select MULTI_IRQ_HANDLER 282 select MULTI_IRQ_HANDLER
@@ -289,13 +286,12 @@ config ARCH_INTEGRATOR
289config ARCH_REALVIEW 286config ARCH_REALVIEW
290 bool "ARM Ltd. RealView family" 287 bool "ARM Ltd. RealView family"
291 select ARM_AMBA 288 select ARM_AMBA
292 select CLKDEV_LOOKUP 289 select COMMON_CLK
293 select HAVE_MACH_CLKDEV 290 select COMMON_CLK_VERSATILE
294 select ICST 291 select ICST
295 select GENERIC_CLOCKEVENTS 292 select GENERIC_CLOCKEVENTS
296 select ARCH_WANT_OPTIONAL_GPIOLIB 293 select ARCH_WANT_OPTIONAL_GPIOLIB
297 select PLAT_VERSATILE 294 select PLAT_VERSATILE
298 select PLAT_VERSATILE_CLOCK
299 select PLAT_VERSATILE_CLCD 295 select PLAT_VERSATILE_CLCD
300 select ARM_TIMER_SP804 296 select ARM_TIMER_SP804
301 select GPIO_PL061 if GPIOLIB 297 select GPIO_PL061 if GPIOLIB
@@ -312,7 +308,6 @@ config ARCH_VERSATILE
312 select ICST 308 select ICST
313 select GENERIC_CLOCKEVENTS 309 select GENERIC_CLOCKEVENTS
314 select ARCH_WANT_OPTIONAL_GPIOLIB 310 select ARCH_WANT_OPTIONAL_GPIOLIB
315 select NEED_MACH_IO_H if PCI
316 select PLAT_VERSATILE 311 select PLAT_VERSATILE
317 select PLAT_VERSATILE_CLOCK 312 select PLAT_VERSATILE_CLOCK
318 select PLAT_VERSATILE_CLCD 313 select PLAT_VERSATILE_CLCD
@@ -321,64 +316,46 @@ config ARCH_VERSATILE
321 help 316 help
322 This enables support for ARM Ltd Versatile board. 317 This enables support for ARM Ltd Versatile board.
323 318
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 319config ARCH_AT91
343 bool "Atmel AT91" 320 bool "Atmel AT91"
344 select ARCH_REQUIRE_GPIOLIB 321 select ARCH_REQUIRE_GPIOLIB
345 select HAVE_CLK 322 select HAVE_CLK
346 select CLKDEV_LOOKUP 323 select CLKDEV_LOOKUP
347 select IRQ_DOMAIN 324 select IRQ_DOMAIN
325 select NEED_MACH_GPIO_H
348 select NEED_MACH_IO_H if PCCARD 326 select NEED_MACH_IO_H if PCCARD
349 help 327 help
350 This enables support for systems based on Atmel 328 This enables support for systems based on Atmel
351 AT91RM9200 and AT91SAM9* processors. 329 AT91RM9200 and AT91SAM9* processors.
352 330
353config ARCH_BCMRING 331config ARCH_BCM2835
354 bool "Broadcom BCMRING" 332 bool "Broadcom BCM2835 family"
355 depends on MMU 333 select ARCH_WANT_OPTIONAL_GPIOLIB
356 select CPU_V6
357 select ARM_AMBA 334 select ARM_AMBA
335 select ARM_ERRATA_411920
358 select ARM_TIMER_SP804 336 select ARM_TIMER_SP804
359 select CLKDEV_LOOKUP 337 select CLKDEV_LOOKUP
338 select COMMON_CLK
339 select CPU_V6
360 select GENERIC_CLOCKEVENTS 340 select GENERIC_CLOCKEVENTS
361 select ARCH_WANT_OPTIONAL_GPIOLIB 341 select MULTI_IRQ_HANDLER
342 select SPARSE_IRQ
343 select USE_OF
362 help 344 help
363 Support for Broadcom's BCMRing platform. 345 This enables support for the Broadcom BCM2835 SoC. This SoC is
346 use in the Raspberry Pi, and Roku 2 devices.
364 347
365config ARCH_HIGHBANK 348config ARCH_BCMRING
366 bool "Calxeda Highbank-based" 349 bool "Broadcom BCMRING"
367 select ARCH_WANT_OPTIONAL_GPIOLIB 350 depends on MMU
351 select CPU_V6
368 select ARM_AMBA 352 select ARM_AMBA
369 select ARM_GIC
370 select ARM_TIMER_SP804 353 select ARM_TIMER_SP804
371 select CACHE_L2X0
372 select CLKDEV_LOOKUP 354 select CLKDEV_LOOKUP
373 select COMMON_CLK
374 select CPU_V7
375 select GENERIC_CLOCKEVENTS 355 select GENERIC_CLOCKEVENTS
376 select HAVE_ARM_SCU 356 select ARCH_WANT_OPTIONAL_GPIOLIB
377 select HAVE_SMP
378 select SPARSE_IRQ
379 select USE_OF
380 help 357 help
381 Support for the Calxeda Highbank SoC based boards. 358 Support for Broadcom's BCMRing platform.
382 359
383config ARCH_CLPS711X 360config ARCH_CLPS711X
384 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based" 361 bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
@@ -407,21 +384,19 @@ config ARCH_GEMINI
407 help 384 help
408 Support for the Cortina Systems Gemini family SoCs 385 Support for the Cortina Systems Gemini family SoCs
409 386
410config ARCH_PRIMA2 387config ARCH_SIRF
411 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" 388 bool "CSR SiRF"
412 select CPU_V7
413 select NO_IOPORT 389 select NO_IOPORT
414 select ARCH_REQUIRE_GPIOLIB 390 select ARCH_REQUIRE_GPIOLIB
415 select GENERIC_CLOCKEVENTS 391 select GENERIC_CLOCKEVENTS
416 select CLKDEV_LOOKUP 392 select COMMON_CLK
417 select GENERIC_IRQ_CHIP 393 select GENERIC_IRQ_CHIP
418 select MIGHT_HAVE_CACHE_L2X0 394 select MIGHT_HAVE_CACHE_L2X0
419 select PINCTRL 395 select PINCTRL
420 select PINCTRL_SIRF 396 select PINCTRL_SIRF
421 select USE_OF 397 select USE_OF
422 select ZONE_DMA
423 help 398 help
424 Support for CSR SiRFSoC ARM Cortex A9 Platform 399 Support for CSR SiRFprimaII/Marco/Polo platforms
425 400
426config ARCH_EBSA110 401config ARCH_EBSA110
427 bool "EBSA-110" 402 bool "EBSA-110"
@@ -456,7 +431,7 @@ config ARCH_FOOTBRIDGE
456 select FOOTBRIDGE 431 select FOOTBRIDGE
457 select GENERIC_CLOCKEVENTS 432 select GENERIC_CLOCKEVENTS
458 select HAVE_IDE 433 select HAVE_IDE
459 select NEED_MACH_IO_H 434 select NEED_MACH_IO_H if !MMU
460 select NEED_MACH_MEMORY_H 435 select NEED_MACH_MEMORY_H
461 help 436 help
462 Support for systems based on the DC21285 companion chip 437 Support for systems based on the DC21285 companion chip
@@ -513,7 +488,6 @@ config ARCH_IOP13XX
513 select PCI 488 select PCI
514 select ARCH_SUPPORTS_MSI 489 select ARCH_SUPPORTS_MSI
515 select VMSPLIT_1G 490 select VMSPLIT_1G
516 select NEED_MACH_IO_H
517 select NEED_MACH_MEMORY_H 491 select NEED_MACH_MEMORY_H
518 select NEED_RET_TO_USER 492 select NEED_RET_TO_USER
519 help 493 help
@@ -523,6 +497,7 @@ config ARCH_IOP32X
523 bool "IOP32x-based" 497 bool "IOP32x-based"
524 depends on MMU 498 depends on MMU
525 select CPU_XSCALE 499 select CPU_XSCALE
500 select NEED_MACH_GPIO_H
526 select NEED_MACH_IO_H 501 select NEED_MACH_IO_H
527 select NEED_RET_TO_USER 502 select NEED_RET_TO_USER
528 select PLAT_IOP 503 select PLAT_IOP
@@ -536,6 +511,7 @@ config ARCH_IOP33X
536 bool "IOP33x-based" 511 bool "IOP33x-based"
537 depends on MMU 512 depends on MMU
538 select CPU_XSCALE 513 select CPU_XSCALE
514 select NEED_MACH_GPIO_H
539 select NEED_MACH_IO_H 515 select NEED_MACH_IO_H
540 select NEED_RET_TO_USER 516 select NEED_RET_TO_USER
541 select PLAT_IOP 517 select PLAT_IOP
@@ -558,26 +534,14 @@ config ARCH_IXP4XX
558 help 534 help
559 Support for Intel's IXP4XX (XScale) family of processors. 535 Support for Intel's IXP4XX (XScale) family of processors.
560 536
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 537config ARCH_DOVE
574 bool "Marvell Dove" 538 bool "Marvell Dove"
575 select CPU_V7 539 select CPU_V7
576 select PCI
577 select ARCH_REQUIRE_GPIOLIB 540 select ARCH_REQUIRE_GPIOLIB
578 select GENERIC_CLOCKEVENTS 541 select GENERIC_CLOCKEVENTS
579 select NEED_MACH_IO_H 542 select MIGHT_HAVE_PCI
580 select PLAT_ORION 543 select PLAT_ORION_LEGACY
544 select USB_ARCH_HAS_EHCI
581 help 545 help
582 Support for the Marvell Dove SoC 88AP510 546 Support for the Marvell Dove SoC 88AP510
583 547
@@ -587,8 +551,7 @@ config ARCH_KIRKWOOD
587 select PCI 551 select PCI
588 select ARCH_REQUIRE_GPIOLIB 552 select ARCH_REQUIRE_GPIOLIB
589 select GENERIC_CLOCKEVENTS 553 select GENERIC_CLOCKEVENTS
590 select NEED_MACH_IO_H 554 select PLAT_ORION_LEGACY
591 select PLAT_ORION
592 help 555 help
593 Support for the following Marvell Kirkwood series SoCs: 556 Support for the following Marvell Kirkwood series SoCs:
594 88F6180, 88F6192 and 88F6281. 557 88F6180, 88F6192 and 88F6281.
@@ -614,8 +577,7 @@ config ARCH_MV78XX0
614 select PCI 577 select PCI
615 select ARCH_REQUIRE_GPIOLIB 578 select ARCH_REQUIRE_GPIOLIB
616 select GENERIC_CLOCKEVENTS 579 select GENERIC_CLOCKEVENTS
617 select NEED_MACH_IO_H 580 select PLAT_ORION_LEGACY
618 select PLAT_ORION
619 help 581 help
620 Support for the following Marvell MV78xx0 series SoCs: 582 Support for the following Marvell MV78xx0 series SoCs:
621 MV781x0, MV782x0. 583 MV781x0, MV782x0.
@@ -627,8 +589,7 @@ config ARCH_ORION5X
627 select PCI 589 select PCI
628 select ARCH_REQUIRE_GPIOLIB 590 select ARCH_REQUIRE_GPIOLIB
629 select GENERIC_CLOCKEVENTS 591 select GENERIC_CLOCKEVENTS
630 select NEED_MACH_IO_H 592 select PLAT_ORION_LEGACY
631 select PLAT_ORION
632 help 593 help
633 Support for the following Marvell Orion 5x series SoCs: 594 Support for the following Marvell Orion 5x series SoCs:
634 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182), 595 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
@@ -645,6 +606,7 @@ config ARCH_MMP
645 select PLAT_PXA 606 select PLAT_PXA
646 select SPARSE_IRQ 607 select SPARSE_IRQ
647 select GENERIC_ALLOCATOR 608 select GENERIC_ALLOCATOR
609 select NEED_MACH_GPIO_H
648 help 610 help
649 Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line. 611 Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
650 612
@@ -652,8 +614,9 @@ config ARCH_KS8695
652 bool "Micrel/Kendin KS8695" 614 bool "Micrel/Kendin KS8695"
653 select CPU_ARM922T 615 select CPU_ARM922T
654 select ARCH_REQUIRE_GPIOLIB 616 select ARCH_REQUIRE_GPIOLIB
655 select ARCH_USES_GETTIMEOFFSET
656 select NEED_MACH_MEMORY_H 617 select NEED_MACH_MEMORY_H
618 select CLKSRC_MMIO
619 select GENERIC_CLOCKEVENTS
657 help 620 help
658 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based 621 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
659 System-on-Chip devices. 622 System-on-Chip devices.
@@ -683,40 +646,13 @@ config ARCH_TEGRA
683 select HAVE_CLK 646 select HAVE_CLK
684 select HAVE_SMP 647 select HAVE_SMP
685 select MIGHT_HAVE_CACHE_L2X0 648 select MIGHT_HAVE_CACHE_L2X0
686 select NEED_MACH_IO_H if PCI
687 select ARCH_HAS_CPUFREQ 649 select ARCH_HAS_CPUFREQ
688 select USE_OF 650 select USE_OF
651 select COMMON_CLK
689 help 652 help
690 This enables support for NVIDIA Tegra based systems (Tegra APX, 653 This enables support for NVIDIA Tegra based systems (Tegra APX,
691 Tegra 6xx and Tegra 2 series). 654 Tegra 6xx and Tegra 2 series).
692 655
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 656config ARCH_PXA
721 bool "PXA2xx/PXA3xx-based" 657 bool "PXA2xx/PXA3xx-based"
722 depends on MMU 658 depends on MMU
@@ -733,6 +669,7 @@ config ARCH_PXA
733 select MULTI_IRQ_HANDLER 669 select MULTI_IRQ_HANDLER
734 select ARM_CPU_SUSPEND if PM 670 select ARM_CPU_SUSPEND if PM
735 select HAVE_IDE 671 select HAVE_IDE
672 select NEED_MACH_GPIO_H
736 help 673 help
737 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 674 Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
738 675
@@ -795,6 +732,7 @@ config ARCH_SA1100
795 select CLKDEV_LOOKUP 732 select CLKDEV_LOOKUP
796 select ARCH_REQUIRE_GPIOLIB 733 select ARCH_REQUIRE_GPIOLIB
797 select HAVE_IDE 734 select HAVE_IDE
735 select NEED_MACH_GPIO_H
798 select NEED_MACH_MEMORY_H 736 select NEED_MACH_MEMORY_H
799 select SPARSE_IRQ 737 select SPARSE_IRQ
800 help 738 help
@@ -810,6 +748,7 @@ config ARCH_S3C24XX
810 select HAVE_S3C2410_I2C if I2C 748 select HAVE_S3C2410_I2C if I2C
811 select HAVE_S3C_RTC if RTC_CLASS 749 select HAVE_S3C_RTC if RTC_CLASS
812 select HAVE_S3C2410_WATCHDOG if WATCHDOG 750 select HAVE_S3C2410_WATCHDOG if WATCHDOG
751 select NEED_MACH_GPIO_H
813 select NEED_MACH_IO_H 752 select NEED_MACH_IO_H
814 help 753 help
815 Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443 754 Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443
@@ -837,6 +776,7 @@ config ARCH_S3C64XX
837 select SAMSUNG_GPIOLIB_4BIT 776 select SAMSUNG_GPIOLIB_4BIT
838 select HAVE_S3C2410_I2C if I2C 777 select HAVE_S3C2410_I2C if I2C
839 select HAVE_S3C2410_WATCHDOG if WATCHDOG 778 select HAVE_S3C2410_WATCHDOG if WATCHDOG
779 select NEED_MACH_GPIO_H
840 help 780 help
841 Samsung S3C64XX series based systems 781 Samsung S3C64XX series based systems
842 782
@@ -851,6 +791,7 @@ config ARCH_S5P64X0
851 select GENERIC_CLOCKEVENTS 791 select GENERIC_CLOCKEVENTS
852 select HAVE_S3C2410_I2C if I2C 792 select HAVE_S3C2410_I2C if I2C
853 select HAVE_S3C_RTC if RTC_CLASS 793 select HAVE_S3C_RTC if RTC_CLASS
794 select NEED_MACH_GPIO_H
854 help 795 help
855 Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, 796 Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440,
856 SMDK6450. 797 SMDK6450.
@@ -865,6 +806,7 @@ config ARCH_S5PC100
865 select HAVE_S3C2410_I2C if I2C 806 select HAVE_S3C2410_I2C if I2C
866 select HAVE_S3C_RTC if RTC_CLASS 807 select HAVE_S3C_RTC if RTC_CLASS
867 select HAVE_S3C2410_WATCHDOG if WATCHDOG 808 select HAVE_S3C2410_WATCHDOG if WATCHDOG
809 select NEED_MACH_GPIO_H
868 help 810 help
869 Samsung S5PC100 series based systems 811 Samsung S5PC100 series based systems
870 812
@@ -882,6 +824,7 @@ config ARCH_S5PV210
882 select HAVE_S3C2410_I2C if I2C 824 select HAVE_S3C2410_I2C if I2C
883 select HAVE_S3C_RTC if RTC_CLASS 825 select HAVE_S3C_RTC if RTC_CLASS
884 select HAVE_S3C2410_WATCHDOG if WATCHDOG 826 select HAVE_S3C2410_WATCHDOG if WATCHDOG
827 select NEED_MACH_GPIO_H
885 select NEED_MACH_MEMORY_H 828 select NEED_MACH_MEMORY_H
886 help 829 help
887 Samsung S5PV210/S5PC110 series based systems 830 Samsung S5PV210/S5PC110 series based systems
@@ -899,6 +842,7 @@ config ARCH_EXYNOS
899 select HAVE_S3C_RTC if RTC_CLASS 842 select HAVE_S3C_RTC if RTC_CLASS
900 select HAVE_S3C2410_I2C if I2C 843 select HAVE_S3C2410_I2C if I2C
901 select HAVE_S3C2410_WATCHDOG if WATCHDOG 844 select HAVE_S3C2410_WATCHDOG if WATCHDOG
845 select NEED_MACH_GPIO_H
902 select NEED_MACH_MEMORY_H 846 select NEED_MACH_MEMORY_H
903 help 847 help
904 Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5) 848 Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
@@ -912,7 +856,6 @@ config ARCH_SHARK
912 select PCI 856 select PCI
913 select ARCH_USES_GETTIMEOFFSET 857 select ARCH_USES_GETTIMEOFFSET
914 select NEED_MACH_MEMORY_H 858 select NEED_MACH_MEMORY_H
915 select NEED_MACH_IO_H
916 help 859 help
917 Support for the StrongARM based Digital DNARD machine, also known 860 Support for the StrongARM based Digital DNARD machine, also known
918 as "Shark" (<http://www.shark-linux.de/shark.html>). 861 as "Shark" (<http://www.shark-linux.de/shark.html>).
@@ -931,6 +874,7 @@ config ARCH_U300
931 select COMMON_CLK 874 select COMMON_CLK
932 select GENERIC_GPIO 875 select GENERIC_GPIO
933 select ARCH_REQUIRE_GPIOLIB 876 select ARCH_REQUIRE_GPIOLIB
877 select SPARSE_IRQ
934 help 878 help
935 Support for ST-Ericsson U300 series mobile platforms. 879 Support for ST-Ericsson U300 series mobile platforms.
936 880
@@ -971,6 +915,7 @@ config ARCH_DAVINCI
971 select GENERIC_ALLOCATOR 915 select GENERIC_ALLOCATOR
972 select GENERIC_IRQ_CHIP 916 select GENERIC_IRQ_CHIP
973 select ARCH_HAS_HOLES_MEMORYMODEL 917 select ARCH_HAS_HOLES_MEMORYMODEL
918 select NEED_MACH_GPIO_H
974 help 919 help
975 Support for TI's DaVinci platform. 920 Support for TI's DaVinci platform.
976 921
@@ -983,6 +928,7 @@ config ARCH_OMAP
983 select CLKSRC_MMIO 928 select CLKSRC_MMIO
984 select GENERIC_CLOCKEVENTS 929 select GENERIC_CLOCKEVENTS
985 select ARCH_HAS_HOLES_MEMORYMODEL 930 select ARCH_HAS_HOLES_MEMORYMODEL
931 select NEED_MACH_GPIO_H
986 help 932 help
987 Support for TI's OMAP platform (OMAP1/2/3/4). 933 Support for TI's OMAP platform (OMAP1/2/3/4).
988 934
@@ -1022,6 +968,50 @@ config ARCH_ZYNQ
1022 Support for Xilinx Zynq ARM Cortex A9 Platform 968 Support for Xilinx Zynq ARM Cortex A9 Platform
1023endchoice 969endchoice
1024 970
971menu "Multiple platform selection"
972 depends on ARCH_MULTIPLATFORM
973
974comment "CPU Core family selection"
975
976config ARCH_MULTI_V4
977 bool "ARMv4 based platforms (FA526, StrongARM)"
978 select ARCH_MULTI_V4_V5
979 depends on !ARCH_MULTI_V6_V7
980
981config ARCH_MULTI_V4T
982 bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
983 select ARCH_MULTI_V4_V5
984 depends on !ARCH_MULTI_V6_V7
985
986config ARCH_MULTI_V5
987 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
988 select ARCH_MULTI_V4_V5
989 depends on !ARCH_MULTI_V6_V7
990
991config ARCH_MULTI_V4_V5
992 bool
993
994config ARCH_MULTI_V6
995 bool "ARMv6 based platforms (ARM11, Scorpion, ...)"
996 select CPU_V6
997 select ARCH_MULTI_V6_V7
998
999config ARCH_MULTI_V7
1000 bool "ARMv7 based platforms (Cortex-A, PJ4, Krait)"
1001 select CPU_V7
1002 select ARCH_VEXPRESS
1003 default y
1004 select ARCH_MULTI_V6_V7
1005
1006config ARCH_MULTI_V6_V7
1007 bool
1008
1009config ARCH_MULTI_CPU_AUTO
1010 def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7)
1011 select ARCH_MULTI_V5
1012
1013endmenu
1014
1025# 1015#
1026# This is sorted alphabetically by mach-* pathname. However, plat-* 1016# This is sorted alphabetically by mach-* pathname. However, plat-*
1027# Kconfigs may be included either alphabetically (according to the 1017# Kconfigs may be included either alphabetically (according to the
@@ -1049,6 +1039,8 @@ source "arch/arm/mach-gemini/Kconfig"
1049 1039
1050source "arch/arm/mach-h720x/Kconfig" 1040source "arch/arm/mach-h720x/Kconfig"
1051 1041
1042source "arch/arm/mach-highbank/Kconfig"
1043
1052source "arch/arm/mach-integrator/Kconfig" 1044source "arch/arm/mach-integrator/Kconfig"
1053 1045
1054source "arch/arm/mach-iop32x/Kconfig" 1046source "arch/arm/mach-iop32x/Kconfig"
@@ -1084,6 +1076,8 @@ source "arch/arm/mach-omap2/Kconfig"
1084 1076
1085source "arch/arm/mach-orion5x/Kconfig" 1077source "arch/arm/mach-orion5x/Kconfig"
1086 1078
1079source "arch/arm/mach-picoxcell/Kconfig"
1080
1087source "arch/arm/mach-pxa/Kconfig" 1081source "arch/arm/mach-pxa/Kconfig"
1088source "arch/arm/plat-pxa/Kconfig" 1082source "arch/arm/plat-pxa/Kconfig"
1089 1083
@@ -1096,6 +1090,8 @@ source "arch/arm/mach-sa1100/Kconfig"
1096source "arch/arm/plat-samsung/Kconfig" 1090source "arch/arm/plat-samsung/Kconfig"
1097source "arch/arm/plat-s3c24xx/Kconfig" 1091source "arch/arm/plat-s3c24xx/Kconfig"
1098 1092
1093source "arch/arm/mach-socfpga/Kconfig"
1094
1099source "arch/arm/plat-spear/Kconfig" 1095source "arch/arm/plat-spear/Kconfig"
1100 1096
1101source "arch/arm/mach-s3c24xx/Kconfig" 1097source "arch/arm/mach-s3c24xx/Kconfig"
@@ -1118,6 +1114,8 @@ source "arch/arm/mach-exynos/Kconfig"
1118 1114
1119source "arch/arm/mach-shmobile/Kconfig" 1115source "arch/arm/mach-shmobile/Kconfig"
1120 1116
1117source "arch/arm/mach-prima2/Kconfig"
1118
1121source "arch/arm/mach-tegra/Kconfig" 1119source "arch/arm/mach-tegra/Kconfig"
1122 1120
1123source "arch/arm/mach-u300/Kconfig" 1121source "arch/arm/mach-u300/Kconfig"
@@ -1148,6 +1146,10 @@ config PLAT_ORION
1148 select IRQ_DOMAIN 1146 select IRQ_DOMAIN
1149 select COMMON_CLK 1147 select COMMON_CLK
1150 1148
1149config PLAT_ORION_LEGACY
1150 bool
1151 select PLAT_ORION
1152
1151config PLAT_PXA 1153config PLAT_PXA
1152 bool 1154 bool
1153 1155
@@ -1179,12 +1181,6 @@ config XSCALE_PMU
1179 depends on CPU_XSCALE 1181 depends on CPU_XSCALE
1180 default y 1182 default y
1181 1183
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 1184config MULTI_IRQ_HANDLER
1189 bool 1185 bool
1190 help 1186 help
@@ -1757,7 +1753,7 @@ config HIGHPTE
1757 1753
1758config HW_PERF_EVENTS 1754config HW_PERF_EVENTS
1759 bool "Enable hardware performance counter support for perf events" 1755 bool "Enable hardware performance counter support for perf events"
1760 depends on PERF_EVENTS && CPU_HAS_PMU 1756 depends on PERF_EVENTS
1761 default y 1757 default y
1762 help 1758 help
1763 Enable hardware performance counter support for perf events. If 1759 Enable hardware performance counter support for perf events. If
@@ -2060,7 +2056,7 @@ endchoice
2060 2056
2061config XIP_KERNEL 2057config XIP_KERNEL
2062 bool "Kernel Execute-In-Place from ROM" 2058 bool "Kernel Execute-In-Place from ROM"
2063 depends on !ZBOOT_ROM && !ARM_LPAE 2059 depends on !ZBOOT_ROM && !ARM_LPAE && !ARCH_MULTIPLATFORM
2064 help 2060 help
2065 Execute-In-Place allows the kernel to run from non-volatile storage 2061 Execute-In-Place allows the kernel to run from non-volatile storage
2066 directly addressable by the CPU, such as NOR flash. This saves RAM 2062 directly addressable by the CPU, such as NOR flash. This saves RAM
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index e968a52e4881..a7eb28260b2e 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -261,6 +261,20 @@ choice
261 Say Y here if you want the debug print routines to direct 261 Say Y here if you want the debug print routines to direct
262 their output to the serial port on MSM 8960 devices. 262 their output to the serial port on MSM 8960 devices.
263 263
264 config DEBUG_MVEBU_UART
265 bool "Kernel low-level debugging messages via MVEBU UART"
266 depends on ARCH_MVEBU
267 help
268 Say Y here if you want kernel low-level debugging support
269 on MVEBU based platforms.
270
271 config DEBUG_PICOXCELL_UART
272 depends on ARCH_PICOXCELL
273 bool "Use PicoXcell UART for low-level debug"
274 help
275 Say Y here if you want kernel low-level debugging support
276 on PicoXcell based platforms.
277
264 config DEBUG_REALVIEW_STD_PORT 278 config DEBUG_REALVIEW_STD_PORT
265 bool "RealView Default UART" 279 bool "RealView Default UART"
266 depends on ARCH_REALVIEW 280 depends on ARCH_REALVIEW
@@ -310,6 +324,13 @@ choice
310 The uncompressor code port configuration is now handled 324 The uncompressor code port configuration is now handled
311 by CONFIG_S3C_LOWLEVEL_UART_PORT. 325 by CONFIG_S3C_LOWLEVEL_UART_PORT.
312 326
327 config DEBUG_SOCFPGA_UART
328 depends on ARCH_SOCFPGA
329 bool "Use SOCFPGA UART for low-level debug"
330 help
331 Say Y here if you want kernel low-level debugging support
332 on SOCFPGA based platforms.
333
313 config DEBUG_VEXPRESS_UART0_DETECT 334 config DEBUG_VEXPRESS_UART0_DETECT
314 bool "Autodetect UART0 on Versatile Express Cortex-A core tiles" 335 bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
315 depends on ARCH_VEXPRESS && CPU_CP15_MMU 336 depends on ARCH_VEXPRESS && CPU_CP15_MMU
@@ -338,6 +359,7 @@ choice
338 359
339 config DEBUG_LL_UART_NONE 360 config DEBUG_LL_UART_NONE
340 bool "No low-level debugging UART" 361 bool "No low-level debugging UART"
362 depends on !ARCH_MULTIPLATFORM
341 help 363 help
342 Say Y here if your platform doesn't provide a UART option 364 Say Y here if your platform doesn't provide a UART option
343 below. This relies on your platform choosing the right UART 365 below. This relies on your platform choosing the right UART
@@ -373,6 +395,17 @@ choice
373 395
374endchoice 396endchoice
375 397
398config DEBUG_LL_INCLUDE
399 string
400 default "debug/icedcc.S" if DEBUG_ICEDCC
401 default "debug/highbank.S" if DEBUG_HIGHBANK_UART
402 default "debug/mvebu.S" if DEBUG_MVEBU_UART
403 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
404 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
405 default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
406 DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
407 default "mach/debug-macro.S"
408
376config EARLY_PRINTK 409config EARLY_PRINTK
377 bool "Early printk" 410 bool "Early printk"
378 depends on DEBUG_LL 411 depends on DEBUG_LL
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index a051dfbdd7db..1c974cf9db1b 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -135,84 +135,79 @@ 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_BCMRING) += bcmring
141machine-$(CONFIG_ARCH_CNS3XXX) := cns3xxx 141machine-$(CONFIG_ARCH_CLPS711X) += clps711x
142machine-$(CONFIG_ARCH_DAVINCI) := davinci 142machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx
143machine-$(CONFIG_ARCH_DOVE) := dove 143machine-$(CONFIG_ARCH_DAVINCI) += davinci
144machine-$(CONFIG_ARCH_EBSA110) := ebsa110 144machine-$(CONFIG_ARCH_DOVE) += dove
145machine-$(CONFIG_ARCH_EP93XX) := ep93xx 145machine-$(CONFIG_ARCH_EBSA110) += ebsa110
146machine-$(CONFIG_ARCH_GEMINI) := gemini 146machine-$(CONFIG_ARCH_EP93XX) += ep93xx
147machine-$(CONFIG_ARCH_H720X) := h720x 147machine-$(CONFIG_ARCH_GEMINI) += gemini
148machine-$(CONFIG_ARCH_HIGHBANK) := highbank 148machine-$(CONFIG_ARCH_H720X) += h720x
149machine-$(CONFIG_ARCH_INTEGRATOR) := integrator 149machine-$(CONFIG_ARCH_HIGHBANK) += highbank
150machine-$(CONFIG_ARCH_IOP13XX) := iop13xx 150machine-$(CONFIG_ARCH_INTEGRATOR) += integrator
151machine-$(CONFIG_ARCH_IOP32X) := iop32x 151machine-$(CONFIG_ARCH_IOP13XX) += iop13xx
152machine-$(CONFIG_ARCH_IOP33X) := iop33x 152machine-$(CONFIG_ARCH_IOP32X) += iop32x
153machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx 153machine-$(CONFIG_ARCH_IOP33X) += iop33x
154machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood 154machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx
155machine-$(CONFIG_ARCH_KS8695) := ks8695 155machine-$(CONFIG_ARCH_KIRKWOOD) += kirkwood
156machine-$(CONFIG_ARCH_LPC32XX) := lpc32xx 156machine-$(CONFIG_ARCH_KS8695) += ks8695
157machine-$(CONFIG_ARCH_MMP) := mmp 157machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx
158machine-$(CONFIG_ARCH_MSM) := msm 158machine-$(CONFIG_ARCH_MMP) += mmp
159machine-$(CONFIG_ARCH_MV78XX0) := mv78xx0 159machine-$(CONFIG_ARCH_MSM) += msm
160machine-$(CONFIG_ARCH_IMX_V4_V5) := imx 160machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0
161machine-$(CONFIG_ARCH_IMX_V6_V7) := imx 161machine-$(CONFIG_ARCH_MXC) += imx
162machine-$(CONFIG_ARCH_MXS) := mxs 162machine-$(CONFIG_ARCH_MXS) += mxs
163machine-$(CONFIG_ARCH_MVEBU) := mvebu 163machine-$(CONFIG_ARCH_MVEBU) += mvebu
164machine-$(CONFIG_ARCH_NETX) := netx 164machine-$(CONFIG_ARCH_NETX) += netx
165machine-$(CONFIG_ARCH_NOMADIK) := nomadik 165machine-$(CONFIG_ARCH_NOMADIK) += nomadik
166machine-$(CONFIG_ARCH_OMAP1) := omap1 166machine-$(CONFIG_ARCH_OMAP1) += omap1
167machine-$(CONFIG_ARCH_OMAP2PLUS) := omap2 167machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2
168machine-$(CONFIG_ARCH_ORION5X) := orion5x 168machine-$(CONFIG_ARCH_ORION5X) += orion5x
169machine-$(CONFIG_ARCH_PICOXCELL) := picoxcell 169machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell
170machine-$(CONFIG_ARCH_PNX4008) := pnx4008 170machine-$(CONFIG_ARCH_PRIMA2) += prima2
171machine-$(CONFIG_ARCH_PRIMA2) := prima2 171machine-$(CONFIG_ARCH_PXA) += pxa
172machine-$(CONFIG_ARCH_PXA) := pxa 172machine-$(CONFIG_ARCH_REALVIEW) += realview
173machine-$(CONFIG_ARCH_REALVIEW) := realview 173machine-$(CONFIG_ARCH_RPC) += rpc
174machine-$(CONFIG_ARCH_RPC) := rpc 174machine-$(CONFIG_ARCH_S3C24XX) += s3c24xx s3c2412 s3c2440
175machine-$(CONFIG_ARCH_S3C24XX) := s3c24xx s3c2412 s3c2440 175machine-$(CONFIG_ARCH_S3C64XX) += s3c64xx
176machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx 176machine-$(CONFIG_ARCH_S5P64X0) += s5p64x0
177machine-$(CONFIG_ARCH_S5P64X0) := s5p64x0 177machine-$(CONFIG_ARCH_S5PC100) += s5pc100
178machine-$(CONFIG_ARCH_S5PC100) := s5pc100 178machine-$(CONFIG_ARCH_S5PV210) += s5pv210
179machine-$(CONFIG_ARCH_S5PV210) := s5pv210 179machine-$(CONFIG_ARCH_EXYNOS) += exynos
180machine-$(CONFIG_ARCH_EXYNOS4) := exynos 180machine-$(CONFIG_ARCH_SA1100) += sa1100
181machine-$(CONFIG_ARCH_EXYNOS5) := exynos 181machine-$(CONFIG_ARCH_SHARK) += shark
182machine-$(CONFIG_ARCH_SA1100) := sa1100 182machine-$(CONFIG_ARCH_SHMOBILE) += shmobile
183machine-$(CONFIG_ARCH_SHARK) := shark 183machine-$(CONFIG_ARCH_TEGRA) += tegra
184machine-$(CONFIG_ARCH_SHMOBILE) := shmobile 184machine-$(CONFIG_ARCH_U300) += u300
185machine-$(CONFIG_ARCH_TEGRA) := tegra 185machine-$(CONFIG_ARCH_U8500) += ux500
186machine-$(CONFIG_ARCH_U300) := u300 186machine-$(CONFIG_ARCH_VERSATILE) += versatile
187machine-$(CONFIG_ARCH_U8500) := ux500 187machine-$(CONFIG_ARCH_VEXPRESS) += vexpress
188machine-$(CONFIG_ARCH_VERSATILE) := versatile 188machine-$(CONFIG_ARCH_VT8500) += vt8500
189machine-$(CONFIG_ARCH_VEXPRESS) := vexpress 189machine-$(CONFIG_ARCH_W90X900) += w90x900
190machine-$(CONFIG_ARCH_VT8500) := vt8500 190machine-$(CONFIG_FOOTBRIDGE) += footbridge
191machine-$(CONFIG_ARCH_W90X900) := w90x900 191machine-$(CONFIG_ARCH_SOCFPGA) += socfpga
192machine-$(CONFIG_FOOTBRIDGE) := footbridge 192machine-$(CONFIG_ARCH_SPEAR13XX) += spear13xx
193machine-$(CONFIG_ARCH_SOCFPGA) := socfpga 193machine-$(CONFIG_ARCH_SPEAR3XX) += spear3xx
194machine-$(CONFIG_MACH_SPEAR1310) := spear13xx 194machine-$(CONFIG_MACH_SPEAR600) += spear6xx
195machine-$(CONFIG_MACH_SPEAR1340) := spear13xx 195machine-$(CONFIG_ARCH_ZYNQ) += zynq
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 196
202# Platform directory name. This list is sorted alphanumerically 197# Platform directory name. This list is sorted alphanumerically
203# by CONFIG_* macro name. 198# by CONFIG_* macro name.
204plat-$(CONFIG_ARCH_MXC) := mxc 199plat-$(CONFIG_ARCH_MXC) += mxc
205plat-$(CONFIG_ARCH_OMAP) := omap 200plat-$(CONFIG_ARCH_OMAP) += omap
206plat-$(CONFIG_ARCH_S3C64XX) := samsung 201plat-$(CONFIG_ARCH_S3C64XX) += samsung
207plat-$(CONFIG_ARCH_ZYNQ) := versatile 202plat-$(CONFIG_ARCH_ZYNQ) += versatile
208plat-$(CONFIG_PLAT_IOP) := iop 203plat-$(CONFIG_PLAT_IOP) += iop
209plat-$(CONFIG_PLAT_NOMADIK) := nomadik 204plat-$(CONFIG_PLAT_NOMADIK) += nomadik
210plat-$(CONFIG_PLAT_ORION) := orion 205plat-$(CONFIG_PLAT_ORION) += orion
211plat-$(CONFIG_PLAT_PXA) := pxa 206plat-$(CONFIG_PLAT_PXA) += pxa
212plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung 207plat-$(CONFIG_PLAT_S3C24XX) += s3c24xx samsung
213plat-$(CONFIG_PLAT_S5P) := samsung 208plat-$(CONFIG_PLAT_S5P) += samsung
214plat-$(CONFIG_PLAT_SPEAR) := spear 209plat-$(CONFIG_PLAT_SPEAR) += spear
215plat-$(CONFIG_PLAT_VERSATILE) := versatile 210plat-$(CONFIG_PLAT_VERSATILE) += versatile
216 211
217ifeq ($(CONFIG_ARCH_EBSA110),y) 212ifeq ($(CONFIG_ARCH_EBSA110),y)
218# This is what happens if you forget the IOCS16 line. 213# This is what happens if you forget the IOCS16 line.
@@ -230,15 +225,20 @@ MACHINE := arch/arm/mach-$(word 1,$(machine-y))/
230else 225else
231MACHINE := 226MACHINE :=
232endif 227endif
228ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
229MACHINE :=
230endif
233 231
234machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y)) 232machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
235platdirs := $(patsubst %,arch/arm/plat-%/,$(plat-y)) 233platdirs := $(patsubst %,arch/arm/plat-%/,$(plat-y))
236 234
235ifneq ($(CONFIG_ARCH_MULTIPLATFORM),y)
237ifeq ($(KBUILD_SRC),) 236ifeq ($(KBUILD_SRC),)
238KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs)) 237KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
239else 238else
240KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs)) 239KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
241endif 240endif
241endif
242 242
243export TEXT_OFFSET GZFLAGS MMUEXT 243export TEXT_OFFSET GZFLAGS MMUEXT
244 244
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index c877087d2000..3fdab016aa5c 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/misc.c b/arch/arm/boot/compressed/misc.c
index 8e2a8fca5ed2..df899834d84e 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 000000000000..d4ad2df08920
--- /dev/null
+++ b/arch/arm/boot/dts/Makefile
@@ -0,0 +1,106 @@
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 exynos5250-smdk5250.dtb
26dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb
27dtb-$(CONFIG_ARCH_IMX5) += imx51-babbage.dtb \
28 imx53-ard.dtb \
29 imx53-evk.dtb \
30 imx53-qsb.dtb \
31 imx53-smd.dtb
32dtb-$(CONFIG_SOC_IMX6Q) += imx6q-arm2.dtb \
33 imx6q-sabrelite.dtb \
34 imx6q-sabresd.dtb
35dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
36dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
37 kirkwood-dns325.dtb \
38 kirkwood-dockstar.dtb \
39 kirkwood-dreamplug.dtb \
40 kirkwood-goflexnet.dtb \
41 kirkwood-ib62x0.dtb \
42 kirkwood-iconnect.dtb \
43 kirkwood-iomega_ix2_200.dtb \
44 kirkwood-km_kirkwood.dtb \
45 kirkwood-lschlv2.dtb \
46 kirkwood-lsxhl.dtb \
47 kirkwood-ts219-6281.dtb \
48 kirkwood-ts219-6282.dtb
49dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
50 msm8960-cdp.dtb
51dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
52 armada-xp-db.dtb
53dtb-$(CONFIG_ARCH_MXC) += imx51-babbage.dtb \
54 imx53-ard.dtb \
55 imx53-evk.dtb \
56 imx53-qsb.dtb \
57 imx53-smd.dtb \
58 imx6q-arm2.dtb \
59 imx6q-sabrelite.dtb \
60 imx6q-sabresd.dtb
61dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
62 imx23-olinuxino.dtb \
63 imx23-stmp378x_devb.dtb \
64 imx28-apx4devkit.dtb \
65 imx28-cfa10036.dtb \
66 imx28-cfa10049.dtb \
67 imx28-evk.dtb \
68 imx28-m28evk.dtb \
69 imx28-tx28.dtb
70dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
71 omap3-beagle-xm.dtb \
72 omap3-evm.dtb \
73 omap3-tobi.dtb \
74 omap4-panda.dtb \
75 omap4-pandaES.dtb \
76 omap4-var_som.dtb \
77 omap4-sdp.dtb \
78 omap5-evm.dtb
79dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
80dtb-$(CONFIG_ARCH_U8500) += snowball.dtb
81dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
82 r8a7740-armadillo800eva.dtb \
83 sh73a0-kzm9g.dtb
84dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
85 spear1340-evb.dtb
86dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
87 spear310-evb.dtb \
88 spear320-evb.dtb
89dtb-$(CONFIG_ARCH_SPEAR6XX)+= spear600-evb.dtb
90dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
91 tegra20-medcom-wide.dtb \
92 tegra20-paz00.dtb \
93 tegra20-plutux.dtb \
94 tegra20-seaboard.dtb \
95 tegra20-tec.dtb \
96 tegra20-trimslice.dtb \
97 tegra20-ventana.dtb \
98 tegra20-whistler.dtb \
99 tegra30-cardhu-a02.dtb \
100 tegra30-cardhu-a04.dtb
101dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
102 vexpress-v2p-ca9.dtb \
103 vexpress-v2p-ca15-tc1.dtb \
104 vexpress-v2p-ca15_a7.dtb
105
106endif
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index a9af4db7234c..c634f87e230e 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 d6a97d9eff72..185d6325a458 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 bd0cff3f808c..bb31bff01998 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 6b6b932a5a7d..16cc82cdaa81 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 3228ccc83332..2069151afe01 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 f97040d4258d..b1fc728515e9 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 000000000000..ea355192be6f
--- /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 000000000000..2057863f3dfa
--- /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 000000000000..ffac98373792
--- /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/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
new file mode 100644
index 000000000000..7dd860f83f96
--- /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 000000000000..0b619398532c
--- /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/dove-cm-a510.dts b/arch/arm/boot/dts/dove-cm-a510.dts
new file mode 100644
index 000000000000..61a8062e56de
--- /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 000000000000..0adbd5a38095
--- /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 000000000000..e5a920beab45
--- /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 000000000000..96fb824b5e6e
--- /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 d79b28d9c963..a4ba31b23c88 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 000000000000..f97f70f83374
--- /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/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts
index e3486f486b40..035c13f9d3c0 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 20912b1d8893..384d8b66f337 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 757a327ff3e8..85c3864b6a56 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 e6138310e5ce..3f3b6fc229b3 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -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,6 +400,7 @@
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";
@@ -397,6 +415,7 @@
397 compatible = "fsl,imx23-auart"; 415 compatible = "fsl,imx23-auart";
398 reg = <0x8006c000 0x2000>; 416 reg = <0x8006c000 0x2000>;
399 interrupts = <24 25 23>; 417 interrupts = <24 25 23>;
418 clocks = <&clks 32>;
400 status = "disabled"; 419 status = "disabled";
401 }; 420 };
402 421
@@ -404,6 +423,7 @@
404 compatible = "fsl,imx23-auart"; 423 compatible = "fsl,imx23-auart";
405 reg = <0x8006e000 0x2000>; 424 reg = <0x8006e000 0x2000>;
406 interrupts = <59 60 58>; 425 interrupts = <59 60 58>;
426 clocks = <&clks 32>;
407 status = "disabled"; 427 status = "disabled";
408 }; 428 };
409 429
@@ -411,11 +431,15 @@
411 compatible = "arm,pl011", "arm,primecell"; 431 compatible = "arm,pl011", "arm,primecell";
412 reg = <0x80070000 0x2000>; 432 reg = <0x80070000 0x2000>;
413 interrupts = <0>; 433 interrupts = <0>;
434 clocks = <&clks 32>, <&clks 16>;
435 clock-names = "uart", "apb_pclk";
414 status = "disabled"; 436 status = "disabled";
415 }; 437 };
416 438
417 usbphy@8007c000 { 439 usbphy0: usbphy@8007c000 {
440 compatible = "fsl,imx23-usbphy";
418 reg = <0x8007c000 0x2000>; 441 reg = <0x8007c000 0x2000>;
442 clocks = <&clks 41>;
419 status = "disabled"; 443 status = "disabled";
420 }; 444 };
421 }; 445 };
@@ -428,8 +452,12 @@
428 reg = <0x80080000 0x80000>; 452 reg = <0x80080000 0x80000>;
429 ranges; 453 ranges;
430 454
431 usbctrl@80080000 { 455 usb0: usb@80080000 {
456 compatible = "fsl,imx23-usb", "fsl,imx27-usb";
432 reg = <0x80080000 0x40000>; 457 reg = <0x80080000 0x40000>;
458 interrupts = <11>;
459 fsl,usbphy = <&usbphy0>;
460 clocks = <&clks 40>;
433 status = "disabled"; 461 status = "disabled";
434 }; 462 };
435 }; 463 };
diff --git a/arch/arm/boot/dts/imx27-phytec-phycore.dts b/arch/arm/boot/dts/imx27-phytec-phycore.dts
index 2b0ff60247a4..af50469e34b2 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 5303ab680a34..3e54f1498841 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 b383417a558f..5171667a7763 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 000000000000..05c892e931e3
--- /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 773c0e84d1fb..a0ad71ca3a44 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 183a3fd2d859..3bab6b00c52d 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 62bf767409a6..37be532f0055 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 3fa6d190fab4..724147eab84b 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 {
@@ -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
@@ -677,6 +780,7 @@
677 pwm: pwm@80064000 { 780 pwm: pwm@80064000 {
678 compatible = "fsl,imx28-pwm", "fsl,imx23-pwm"; 781 compatible = "fsl,imx28-pwm", "fsl,imx23-pwm";
679 reg = <0x80064000 0x2000>; 782 reg = <0x80064000 0x2000>;
783 clocks = <&clks 44>;
680 #pwm-cells = <2>; 784 #pwm-cells = <2>;
681 fsl,pwm-number = <8>; 785 fsl,pwm-number = <8>;
682 status = "disabled"; 786 status = "disabled";
@@ -691,6 +795,7 @@
691 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 795 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
692 reg = <0x8006a000 0x2000>; 796 reg = <0x8006a000 0x2000>;
693 interrupts = <112 70 71>; 797 interrupts = <112 70 71>;
798 clocks = <&clks 45>;
694 status = "disabled"; 799 status = "disabled";
695 }; 800 };
696 801
@@ -698,6 +803,7 @@
698 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 803 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
699 reg = <0x8006c000 0x2000>; 804 reg = <0x8006c000 0x2000>;
700 interrupts = <113 72 73>; 805 interrupts = <113 72 73>;
806 clocks = <&clks 45>;
701 status = "disabled"; 807 status = "disabled";
702 }; 808 };
703 809
@@ -705,6 +811,7 @@
705 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 811 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
706 reg = <0x8006e000 0x2000>; 812 reg = <0x8006e000 0x2000>;
707 interrupts = <114 74 75>; 813 interrupts = <114 74 75>;
814 clocks = <&clks 45>;
708 status = "disabled"; 815 status = "disabled";
709 }; 816 };
710 817
@@ -712,6 +819,7 @@
712 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 819 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
713 reg = <0x80070000 0x2000>; 820 reg = <0x80070000 0x2000>;
714 interrupts = <115 76 77>; 821 interrupts = <115 76 77>;
822 clocks = <&clks 45>;
715 status = "disabled"; 823 status = "disabled";
716 }; 824 };
717 825
@@ -719,6 +827,7 @@
719 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 827 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
720 reg = <0x80072000 0x2000>; 828 reg = <0x80072000 0x2000>;
721 interrupts = <116 78 79>; 829 interrupts = <116 78 79>;
830 clocks = <&clks 45>;
722 status = "disabled"; 831 status = "disabled";
723 }; 832 };
724 833
@@ -726,18 +835,22 @@
726 compatible = "arm,pl011", "arm,primecell"; 835 compatible = "arm,pl011", "arm,primecell";
727 reg = <0x80074000 0x1000>; 836 reg = <0x80074000 0x1000>;
728 interrupts = <47>; 837 interrupts = <47>;
838 clocks = <&clks 45>, <&clks 26>;
839 clock-names = "uart", "apb_pclk";
729 status = "disabled"; 840 status = "disabled";
730 }; 841 };
731 842
732 usbphy0: usbphy@8007c000 { 843 usbphy0: usbphy@8007c000 {
733 compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy"; 844 compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy";
734 reg = <0x8007c000 0x2000>; 845 reg = <0x8007c000 0x2000>;
846 clocks = <&clks 62>;
735 status = "disabled"; 847 status = "disabled";
736 }; 848 };
737 849
738 usbphy1: usbphy@8007e000 { 850 usbphy1: usbphy@8007e000 {
739 compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy"; 851 compatible = "fsl,imx28-usbphy", "fsl,imx23-usbphy";
740 reg = <0x8007e000 0x2000>; 852 reg = <0x8007e000 0x2000>;
853 clocks = <&clks 63>;
741 status = "disabled"; 854 status = "disabled";
742 }; 855 };
743 }; 856 };
@@ -754,6 +867,7 @@
754 compatible = "fsl,imx28-usb", "fsl,imx27-usb"; 867 compatible = "fsl,imx28-usb", "fsl,imx27-usb";
755 reg = <0x80080000 0x10000>; 868 reg = <0x80080000 0x10000>;
756 interrupts = <93>; 869 interrupts = <93>;
870 clocks = <&clks 60>;
757 fsl,usbphy = <&usbphy0>; 871 fsl,usbphy = <&usbphy0>;
758 status = "disabled"; 872 status = "disabled";
759 }; 873 };
@@ -762,6 +876,7 @@
762 compatible = "fsl,imx28-usb", "fsl,imx27-usb"; 876 compatible = "fsl,imx28-usb", "fsl,imx27-usb";
763 reg = <0x80090000 0x10000>; 877 reg = <0x80090000 0x10000>;
764 interrupts = <92>; 878 interrupts = <92>;
879 clocks = <&clks 61>;
765 fsl,usbphy = <&usbphy1>; 880 fsl,usbphy = <&usbphy1>;
766 status = "disabled"; 881 status = "disabled";
767 }; 882 };
@@ -775,6 +890,8 @@
775 compatible = "fsl,imx28-fec"; 890 compatible = "fsl,imx28-fec";
776 reg = <0x800f0000 0x4000>; 891 reg = <0x800f0000 0x4000>;
777 interrupts = <101>; 892 interrupts = <101>;
893 clocks = <&clks 57>, <&clks 57>;
894 clock-names = "ipg", "ahb";
778 status = "disabled"; 895 status = "disabled";
779 }; 896 };
780 897
@@ -782,6 +899,8 @@
782 compatible = "fsl,imx28-fec"; 899 compatible = "fsl,imx28-fec";
783 reg = <0x800f4000 0x4000>; 900 reg = <0x800f4000 0x4000>;
784 interrupts = <102>; 901 interrupts = <102>;
902 clocks = <&clks 57>, <&clks 57>;
903 clock-names = "ipg", "ahb";
785 status = "disabled"; 904 status = "disabled";
786 }; 905 };
787 906
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index 59d9789e5508..cbd2b1c7487b 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 aba28dc87fc8..2f71a91ca98e 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 {
diff --git a/arch/arm/boot/dts/imx53-ard.dts b/arch/arm/boot/dts/imx53-ard.dts
index da895e93a999..4be76f223526 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 9c798034675e..a124d1e25258 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 2d803a9a6949..08948af86d1a 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 08091029168e..06c68580c842 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 cd37165edce5..221cf3321b0a 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 {
diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts
index d792581672cc..15df4c105e89 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 72f30f3e6171..d152328285a1 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 07509a181178..e596c28c214d 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 fd57079f71a9..35e5895ba3df 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,20 +382,22 @@
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@020c8000 {
@@ -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 {
@@ -514,86 +538,207 @@
514 /* shared pinctrl settings */ 538 /* shared pinctrl settings */
515 audmux { 539 audmux {
516 pinctrl_audmux_1: audmux-1 { 540 pinctrl_audmux_1: audmux-1 {
517 fsl,pins = <18 0x80000000 /* MX6Q_PAD_SD2_DAT0__AUDMUX_AUD4_RXD */ 541 fsl,pins = <
518 1586 0x80000000 /* MX6Q_PAD_SD2_DAT3__AUDMUX_AUD4_TXC */ 542 18 0x80000000 /* MX6Q_PAD_SD2_DAT0__AUDMUX_AUD4_RXD */
519 11 0x80000000 /* MX6Q_PAD_SD2_DAT2__AUDMUX_AUD4_TXD */ 543 1586 0x80000000 /* MX6Q_PAD_SD2_DAT3__AUDMUX_AUD4_TXC */
520 3 0x80000000>; /* MX6Q_PAD_SD2_DAT1__AUDMUX_AUD4_TXFS */ 544 11 0x80000000 /* MX6Q_PAD_SD2_DAT2__AUDMUX_AUD4_TXD */
545 3 0x80000000 /* MX6Q_PAD_SD2_DAT1__AUDMUX_AUD4_TXFS */
546 >;
547 };
548 };
549
550 ecspi1 {
551 pinctrl_ecspi1_1: ecspi1grp-1 {
552 fsl,pins = <
553 101 0x100b1 /* MX6Q_PAD_EIM_D17__ECSPI1_MISO */
554 109 0x100b1 /* MX6Q_PAD_EIM_D18__ECSPI1_MOSI */
555 94 0x100b1 /* MX6Q_PAD_EIM_D16__ECSPI1_SCLK */
556 >;
557 };
558 };
559
560 enet {
561 pinctrl_enet_1: enetgrp-1 {
562 fsl,pins = <
563 695 0x1b0b0 /* MX6Q_PAD_ENET_MDIO__ENET_MDIO */
564 756 0x1b0b0 /* MX6Q_PAD_ENET_MDC__ENET_MDC */
565 24 0x1b0b0 /* MX6Q_PAD_RGMII_TXC__ENET_RGMII_TXC */
566 30 0x1b0b0 /* MX6Q_PAD_RGMII_TD0__ENET_RGMII_TD0 */
567 34 0x1b0b0 /* MX6Q_PAD_RGMII_TD1__ENET_RGMII_TD1 */
568 39 0x1b0b0 /* MX6Q_PAD_RGMII_TD2__ENET_RGMII_TD2 */
569 44 0x1b0b0 /* MX6Q_PAD_RGMII_TD3__ENET_RGMII_TD3 */
570 56 0x1b0b0 /* MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL */
571 702 0x1b0b0 /* MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK */
572 74 0x1b0b0 /* MX6Q_PAD_RGMII_RXC__ENET_RGMII_RXC */
573 52 0x1b0b0 /* MX6Q_PAD_RGMII_RD0__ENET_RGMII_RD0 */
574 61 0x1b0b0 /* MX6Q_PAD_RGMII_RD1__ENET_RGMII_RD1 */
575 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */
576 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */
577 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */
578 >;
579 };
580
581 pinctrl_enet_2: enetgrp-2 {
582 fsl,pins = <
583 890 0x1b0b0 /* MX6Q_PAD_KEY_COL1__ENET_MDIO */
584 909 0x1b0b0 /* MX6Q_PAD_KEY_COL2__ENET_MDC */
585 24 0x1b0b0 /* MX6Q_PAD_RGMII_TXC__ENET_RGMII_TXC */
586 30 0x1b0b0 /* MX6Q_PAD_RGMII_TD0__ENET_RGMII_TD0 */
587 34 0x1b0b0 /* MX6Q_PAD_RGMII_TD1__ENET_RGMII_TD1 */
588 39 0x1b0b0 /* MX6Q_PAD_RGMII_TD2__ENET_RGMII_TD2 */
589 44 0x1b0b0 /* MX6Q_PAD_RGMII_TD3__ENET_RGMII_TD3 */
590 56 0x1b0b0 /* MX6Q_PAD_RGMII_TX_CTL__RGMII_TX_CTL */
591 702 0x1b0b0 /* MX6Q_PAD_ENET_REF_CLK__ENET_TX_CLK */
592 74 0x1b0b0 /* MX6Q_PAD_RGMII_RXC__ENET_RGMII_RXC */
593 52 0x1b0b0 /* MX6Q_PAD_RGMII_RD0__ENET_RGMII_RD0 */
594 61 0x1b0b0 /* MX6Q_PAD_RGMII_RD1__ENET_RGMII_RD1 */
595 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */
596 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */
597 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */
598 >;
521 }; 599 };
522 }; 600 };
523 601
524 gpmi-nand { 602 gpmi-nand {
525 pinctrl_gpmi_nand_1: gpmi-nand-1 { 603 pinctrl_gpmi_nand_1: gpmi-nand-1 {
526 fsl,pins = <1328 0xb0b1 /* MX6Q_PAD_NANDF_CLE__RAWNAND_CLE */ 604 fsl,pins = <
527 1336 0xb0b1 /* MX6Q_PAD_NANDF_ALE__RAWNAND_ALE */ 605 1328 0xb0b1 /* MX6Q_PAD_NANDF_CLE__RAWNAND_CLE */
528 1344 0xb0b1 /* MX6Q_PAD_NANDF_WP_B__RAWNAND_RESETN */ 606 1336 0xb0b1 /* MX6Q_PAD_NANDF_ALE__RAWNAND_ALE */
529 1352 0xb000 /* MX6Q_PAD_NANDF_RB0__RAWNAND_READY0 */ 607 1344 0xb0b1 /* MX6Q_PAD_NANDF_WP_B__RAWNAND_RESETN */
530 1360 0xb0b1 /* MX6Q_PAD_NANDF_CS0__RAWNAND_CE0N */ 608 1352 0xb000 /* MX6Q_PAD_NANDF_RB0__RAWNAND_READY0 */
531 1365 0xb0b1 /* MX6Q_PAD_NANDF_CS1__RAWNAND_CE1N */ 609 1360 0xb0b1 /* MX6Q_PAD_NANDF_CS0__RAWNAND_CE0N */
532 1371 0xb0b1 /* MX6Q_PAD_NANDF_CS2__RAWNAND_CE2N */ 610 1365 0xb0b1 /* MX6Q_PAD_NANDF_CS1__RAWNAND_CE1N */
533 1378 0xb0b1 /* MX6Q_PAD_NANDF_CS3__RAWNAND_CE3N */ 611 1371 0xb0b1 /* MX6Q_PAD_NANDF_CS2__RAWNAND_CE2N */
534 1387 0xb0b1 /* MX6Q_PAD_SD4_CMD__RAWNAND_RDN */ 612 1378 0xb0b1 /* MX6Q_PAD_NANDF_CS3__RAWNAND_CE3N */
535 1393 0xb0b1 /* MX6Q_PAD_SD4_CLK__RAWNAND_WRN */ 613 1387 0xb0b1 /* MX6Q_PAD_SD4_CMD__RAWNAND_RDN */
536 1397 0xb0b1 /* MX6Q_PAD_NANDF_D0__RAWNAND_D0 */ 614 1393 0xb0b1 /* MX6Q_PAD_SD4_CLK__RAWNAND_WRN */
537 1405 0xb0b1 /* MX6Q_PAD_NANDF_D1__RAWNAND_D1 */ 615 1397 0xb0b1 /* MX6Q_PAD_NANDF_D0__RAWNAND_D0 */
538 1413 0xb0b1 /* MX6Q_PAD_NANDF_D2__RAWNAND_D2 */ 616 1405 0xb0b1 /* MX6Q_PAD_NANDF_D1__RAWNAND_D1 */
539 1421 0xb0b1 /* MX6Q_PAD_NANDF_D3__RAWNAND_D3 */ 617 1413 0xb0b1 /* MX6Q_PAD_NANDF_D2__RAWNAND_D2 */
540 1429 0xb0b1 /* MX6Q_PAD_NANDF_D4__RAWNAND_D4 */ 618 1421 0xb0b1 /* MX6Q_PAD_NANDF_D3__RAWNAND_D3 */
541 1437 0xb0b1 /* MX6Q_PAD_NANDF_D5__RAWNAND_D5 */ 619 1429 0xb0b1 /* MX6Q_PAD_NANDF_D4__RAWNAND_D4 */
542 1445 0xb0b1 /* MX6Q_PAD_NANDF_D6__RAWNAND_D6 */ 620 1437 0xb0b1 /* MX6Q_PAD_NANDF_D5__RAWNAND_D5 */
543 1453 0xb0b1 /* MX6Q_PAD_NANDF_D7__RAWNAND_D7 */ 621 1445 0xb0b1 /* MX6Q_PAD_NANDF_D6__RAWNAND_D6 */
544 1463 0x00b1>; /* MX6Q_PAD_SD4_DAT0__RAWNAND_DQS */ 622 1453 0xb0b1 /* MX6Q_PAD_NANDF_D7__RAWNAND_D7 */
623 1463 0x00b1 /* MX6Q_PAD_SD4_DAT0__RAWNAND_DQS */
624 >;
545 }; 625 };
546 }; 626 };
547 627
548 i2c1 { 628 i2c1 {
549 pinctrl_i2c1_1: i2c1grp-1 { 629 pinctrl_i2c1_1: i2c1grp-1 {
550 fsl,pins = <137 0x4001b8b1 /* MX6Q_PAD_EIM_D21__I2C1_SCL */ 630 fsl,pins = <
551 196 0x4001b8b1>; /* MX6Q_PAD_EIM_D28__I2C1_SDA */ 631 137 0x4001b8b1 /* MX6Q_PAD_EIM_D21__I2C1_SCL */
632 196 0x4001b8b1 /* MX6Q_PAD_EIM_D28__I2C1_SDA */
633 >;
634 };
635 };
636
637 uart1 {
638 pinctrl_uart1_1: uart1grp-1 {
639 fsl,pins = <
640 1140 0x1b0b1 /* MX6Q_PAD_CSI0_DAT10__UART1_TXD */
641 1148 0x1b0b1 /* MX6Q_PAD_CSI0_DAT11__UART1_RXD */
642 >;
552 }; 643 };
553 }; 644 };
554 645
555 serial2 { 646 uart2 {
556 pinctrl_serial2_1: serial2grp-1 { 647 pinctrl_uart2_1: uart2grp-1 {
557 fsl,pins = <183 0x1b0b1 /* MX6Q_PAD_EIM_D26__UART2_TXD */ 648 fsl,pins = <
558 191 0x1b0b1>; /* MX6Q_PAD_EIM_D27__UART2_RXD */ 649 183 0x1b0b1 /* MX6Q_PAD_EIM_D26__UART2_TXD */
650 191 0x1b0b1 /* MX6Q_PAD_EIM_D27__UART2_RXD */
651 >;
652 };
653 };
654
655 uart4 {
656 pinctrl_uart4_1: uart4grp-1 {
657 fsl,pins = <
658 877 0x1b0b1 /* MX6Q_PAD_KEY_COL0__UART4_TXD */
659 885 0x1b0b1 /* MX6Q_PAD_KEY_ROW0__UART4_RXD */
660 >;
661 };
662 };
663
664 usbotg {
665 pinctrl_usbotg_1: usbotggrp-1 {
666 fsl,pins = <
667 1592 0x17059 /* MX6Q_PAD_GPIO_1__ANATOP_USBOTG_ID */
668 >;
669 };
670 };
671
672 usdhc2 {
673 pinctrl_usdhc2_1: usdhc2grp-1 {
674 fsl,pins = <
675 1577 0x17059 /* MX6Q_PAD_SD2_CMD__USDHC2_CMD */
676 1569 0x10059 /* MX6Q_PAD_SD2_CLK__USDHC2_CLK */
677 16 0x17059 /* MX6Q_PAD_SD2_DAT0__USDHC2_DAT0 */
678 0 0x17059 /* MX6Q_PAD_SD2_DAT1__USDHC2_DAT1 */
679 8 0x17059 /* MX6Q_PAD_SD2_DAT2__USDHC2_DAT2 */
680 1583 0x17059 /* MX6Q_PAD_SD2_DAT3__USDHC2_DAT3 */
681 1430 0x17059 /* MX6Q_PAD_NANDF_D4__USDHC2_DAT4 */
682 1438 0x17059 /* MX6Q_PAD_NANDF_D5__USDHC2_DAT5 */
683 1446 0x17059 /* MX6Q_PAD_NANDF_D6__USDHC2_DAT6 */
684 1454 0x17059 /* MX6Q_PAD_NANDF_D7__USDHC2_DAT7 */
685 >;
559 }; 686 };
560 }; 687 };
561 688
562 usdhc3 { 689 usdhc3 {
563 pinctrl_usdhc3_1: usdhc3grp-1 { 690 pinctrl_usdhc3_1: usdhc3grp-1 {
564 fsl,pins = <1273 0x17059 /* MX6Q_PAD_SD3_CMD__USDHC3_CMD */ 691 fsl,pins = <
565 1281 0x10059 /* MX6Q_PAD_SD3_CLK__USDHC3_CLK */ 692 1273 0x17059 /* MX6Q_PAD_SD3_CMD__USDHC3_CMD */
566 1289 0x17059 /* MX6Q_PAD_SD3_DAT0__USDHC3_DAT0 */ 693 1281 0x10059 /* MX6Q_PAD_SD3_CLK__USDHC3_CLK */
567 1297 0x17059 /* MX6Q_PAD_SD3_DAT1__USDHC3_DAT1 */ 694 1289 0x17059 /* MX6Q_PAD_SD3_DAT0__USDHC3_DAT0 */
568 1305 0x17059 /* MX6Q_PAD_SD3_DAT2__USDHC3_DAT2 */ 695 1297 0x17059 /* MX6Q_PAD_SD3_DAT1__USDHC3_DAT1 */
569 1312 0x17059 /* MX6Q_PAD_SD3_DAT3__USDHC3_DAT3 */ 696 1305 0x17059 /* MX6Q_PAD_SD3_DAT2__USDHC3_DAT2 */
570 1265 0x17059 /* MX6Q_PAD_SD3_DAT4__USDHC3_DAT4 */ 697 1312 0x17059 /* MX6Q_PAD_SD3_DAT3__USDHC3_DAT3 */
571 1257 0x17059 /* MX6Q_PAD_SD3_DAT5__USDHC3_DAT5 */ 698 1265 0x17059 /* MX6Q_PAD_SD3_DAT4__USDHC3_DAT4 */
572 1249 0x17059 /* MX6Q_PAD_SD3_DAT6__USDHC3_DAT6 */ 699 1257 0x17059 /* MX6Q_PAD_SD3_DAT5__USDHC3_DAT5 */
573 1241 0x17059>; /* MX6Q_PAD_SD3_DAT7__USDHC3_DAT7 */ 700 1249 0x17059 /* MX6Q_PAD_SD3_DAT6__USDHC3_DAT6 */
701 1241 0x17059 /* MX6Q_PAD_SD3_DAT7__USDHC3_DAT7 */
702 >;
703 };
704
705 pinctrl_usdhc3_2: usdhc3grp-2 {
706 fsl,pins = <
707 1273 0x17059 /* MX6Q_PAD_SD3_CMD__USDHC3_CMD */
708 1281 0x10059 /* MX6Q_PAD_SD3_CLK__USDHC3_CLK */
709 1289 0x17059 /* MX6Q_PAD_SD3_DAT0__USDHC3_DAT0 */
710 1297 0x17059 /* MX6Q_PAD_SD3_DAT1__USDHC3_DAT1 */
711 1305 0x17059 /* MX6Q_PAD_SD3_DAT2__USDHC3_DAT2 */
712 1312 0x17059 /* MX6Q_PAD_SD3_DAT3__USDHC3_DAT3 */
713 >;
574 }; 714 };
575 }; 715 };
576 716
577 usdhc4 { 717 usdhc4 {
578 pinctrl_usdhc4_1: usdhc4grp-1 { 718 pinctrl_usdhc4_1: usdhc4grp-1 {
579 fsl,pins = <1386 0x17059 /* MX6Q_PAD_SD4_CMD__USDHC4_CMD */ 719 fsl,pins = <
580 1392 0x10059 /* MX6Q_PAD_SD4_CLK__USDHC4_CLK */ 720 1386 0x17059 /* MX6Q_PAD_SD4_CMD__USDHC4_CMD */
581 1462 0x17059 /* MX6Q_PAD_SD4_DAT0__USDHC4_DAT0 */ 721 1392 0x10059 /* MX6Q_PAD_SD4_CLK__USDHC4_CLK */
582 1470 0x17059 /* MX6Q_PAD_SD4_DAT1__USDHC4_DAT1 */ 722 1462 0x17059 /* MX6Q_PAD_SD4_DAT0__USDHC4_DAT0 */
583 1478 0x17059 /* MX6Q_PAD_SD4_DAT2__USDHC4_DAT2 */ 723 1470 0x17059 /* MX6Q_PAD_SD4_DAT1__USDHC4_DAT1 */
584 1486 0x17059 /* MX6Q_PAD_SD4_DAT3__USDHC4_DAT3 */ 724 1478 0x17059 /* MX6Q_PAD_SD4_DAT2__USDHC4_DAT2 */
585 1493 0x17059 /* MX6Q_PAD_SD4_DAT4__USDHC4_DAT4 */ 725 1486 0x17059 /* MX6Q_PAD_SD4_DAT3__USDHC4_DAT3 */
586 1501 0x17059 /* MX6Q_PAD_SD4_DAT5__USDHC4_DAT5 */ 726 1493 0x17059 /* MX6Q_PAD_SD4_DAT4__USDHC4_DAT4 */
587 1509 0x17059 /* MX6Q_PAD_SD4_DAT6__USDHC4_DAT6 */ 727 1501 0x17059 /* MX6Q_PAD_SD4_DAT5__USDHC4_DAT5 */
588 1517 0x17059>; /* MX6Q_PAD_SD4_DAT7__USDHC4_DAT7 */ 728 1509 0x17059 /* MX6Q_PAD_SD4_DAT6__USDHC4_DAT6 */
729 1517 0x17059 /* MX6Q_PAD_SD4_DAT7__USDHC4_DAT7 */
730 >;
589 }; 731 };
590 };
591 732
592 ecspi1 { 733 pinctrl_usdhc4_2: usdhc4grp-2 {
593 pinctrl_ecspi1_1: ecspi1grp-1 { 734 fsl,pins = <
594 fsl,pins = <101 0x100b1 /* MX6Q_PAD_EIM_D17__ECSPI1_MISO */ 735 1386 0x17059 /* MX6Q_PAD_SD4_CMD__USDHC4_CMD */
595 109 0x100b1 /* MX6Q_PAD_EIM_D18__ECSPI1_MOSI */ 736 1392 0x10059 /* MX6Q_PAD_SD4_CLK__USDHC4_CLK */
596 94 0x100b1>; /* MX6Q_PAD_EIM_D16__ECSPI1_SCLK */ 737 1462 0x17059 /* MX6Q_PAD_SD4_DAT0__USDHC4_DAT0 */
738 1470 0x17059 /* MX6Q_PAD_SD4_DAT1__USDHC4_DAT1 */
739 1478 0x17059 /* MX6Q_PAD_SD4_DAT2__USDHC4_DAT2 */
740 1486 0x17059 /* MX6Q_PAD_SD4_DAT3__USDHC4_DAT3 */
741 >;
597 }; 742 };
598 }; 743 };
599 }; 744 };
@@ -612,6 +757,9 @@
612 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma"; 757 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma";
613 reg = <0x020ec000 0x4000>; 758 reg = <0x020ec000 0x4000>;
614 interrupts = <0 2 0x04>; 759 interrupts = <0 2 0x04>;
760 clocks = <&clks 155>, <&clks 155>;
761 clock-names = "ipg", "ahb";
762 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx6q-to1.bin";
615 }; 763 };
616 }; 764 };
617 765
@@ -635,7 +783,9 @@
635 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 783 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
636 reg = <0x02184000 0x200>; 784 reg = <0x02184000 0x200>;
637 interrupts = <0 43 0x04>; 785 interrupts = <0 43 0x04>;
786 clocks = <&clks 162>;
638 fsl,usbphy = <&usbphy1>; 787 fsl,usbphy = <&usbphy1>;
788 fsl,usbmisc = <&usbmisc 0>;
639 status = "disabled"; 789 status = "disabled";
640 }; 790 };
641 791
@@ -643,7 +793,9 @@
643 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 793 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
644 reg = <0x02184200 0x200>; 794 reg = <0x02184200 0x200>;
645 interrupts = <0 40 0x04>; 795 interrupts = <0 40 0x04>;
796 clocks = <&clks 162>;
646 fsl,usbphy = <&usbphy2>; 797 fsl,usbphy = <&usbphy2>;
798 fsl,usbmisc = <&usbmisc 1>;
647 status = "disabled"; 799 status = "disabled";
648 }; 800 };
649 801
@@ -651,6 +803,8 @@
651 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 803 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
652 reg = <0x02184400 0x200>; 804 reg = <0x02184400 0x200>;
653 interrupts = <0 41 0x04>; 805 interrupts = <0 41 0x04>;
806 clocks = <&clks 162>;
807 fsl,usbmisc = <&usbmisc 2>;
654 status = "disabled"; 808 status = "disabled";
655 }; 809 };
656 810
@@ -658,13 +812,24 @@
658 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 812 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
659 reg = <0x02184600 0x200>; 813 reg = <0x02184600 0x200>;
660 interrupts = <0 42 0x04>; 814 interrupts = <0 42 0x04>;
815 clocks = <&clks 162>;
816 fsl,usbmisc = <&usbmisc 3>;
661 status = "disabled"; 817 status = "disabled";
662 }; 818 };
663 819
820 usbmisc: usbmisc@02184800 {
821 #index-cells = <1>;
822 compatible = "fsl,imx6q-usbmisc";
823 reg = <0x02184800 0x200>;
824 clocks = <&clks 162>;
825 };
826
664 ethernet@02188000 { 827 ethernet@02188000 {
665 compatible = "fsl,imx6q-fec"; 828 compatible = "fsl,imx6q-fec";
666 reg = <0x02188000 0x4000>; 829 reg = <0x02188000 0x4000>;
667 interrupts = <0 118 0x04 0 119 0x04>; 830 interrupts = <0 118 0x04 0 119 0x04>;
831 clocks = <&clks 117>, <&clks 117>;
832 clock-names = "ipg", "ahb";
668 status = "disabled"; 833 status = "disabled";
669 }; 834 };
670 835
@@ -677,6 +842,8 @@
677 compatible = "fsl,imx6q-usdhc"; 842 compatible = "fsl,imx6q-usdhc";
678 reg = <0x02190000 0x4000>; 843 reg = <0x02190000 0x4000>;
679 interrupts = <0 22 0x04>; 844 interrupts = <0 22 0x04>;
845 clocks = <&clks 163>, <&clks 163>, <&clks 163>;
846 clock-names = "ipg", "ahb", "per";
680 status = "disabled"; 847 status = "disabled";
681 }; 848 };
682 849
@@ -684,6 +851,8 @@
684 compatible = "fsl,imx6q-usdhc"; 851 compatible = "fsl,imx6q-usdhc";
685 reg = <0x02194000 0x4000>; 852 reg = <0x02194000 0x4000>;
686 interrupts = <0 23 0x04>; 853 interrupts = <0 23 0x04>;
854 clocks = <&clks 164>, <&clks 164>, <&clks 164>;
855 clock-names = "ipg", "ahb", "per";
687 status = "disabled"; 856 status = "disabled";
688 }; 857 };
689 858
@@ -691,6 +860,8 @@
691 compatible = "fsl,imx6q-usdhc"; 860 compatible = "fsl,imx6q-usdhc";
692 reg = <0x02198000 0x4000>; 861 reg = <0x02198000 0x4000>;
693 interrupts = <0 24 0x04>; 862 interrupts = <0 24 0x04>;
863 clocks = <&clks 165>, <&clks 165>, <&clks 165>;
864 clock-names = "ipg", "ahb", "per";
694 status = "disabled"; 865 status = "disabled";
695 }; 866 };
696 867
@@ -698,6 +869,8 @@
698 compatible = "fsl,imx6q-usdhc"; 869 compatible = "fsl,imx6q-usdhc";
699 reg = <0x0219c000 0x4000>; 870 reg = <0x0219c000 0x4000>;
700 interrupts = <0 25 0x04>; 871 interrupts = <0 25 0x04>;
872 clocks = <&clks 166>, <&clks 166>, <&clks 166>;
873 clock-names = "ipg", "ahb", "per";
701 status = "disabled"; 874 status = "disabled";
702 }; 875 };
703 876
@@ -707,6 +880,7 @@
707 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 880 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
708 reg = <0x021a0000 0x4000>; 881 reg = <0x021a0000 0x4000>;
709 interrupts = <0 36 0x04>; 882 interrupts = <0 36 0x04>;
883 clocks = <&clks 125>;
710 status = "disabled"; 884 status = "disabled";
711 }; 885 };
712 886
@@ -716,6 +890,7 @@
716 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 890 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
717 reg = <0x021a4000 0x4000>; 891 reg = <0x021a4000 0x4000>;
718 interrupts = <0 37 0x04>; 892 interrupts = <0 37 0x04>;
893 clocks = <&clks 126>;
719 status = "disabled"; 894 status = "disabled";
720 }; 895 };
721 896
@@ -725,6 +900,7 @@
725 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 900 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c";
726 reg = <0x021a8000 0x4000>; 901 reg = <0x021a8000 0x4000>;
727 interrupts = <0 38 0x04>; 902 interrupts = <0 38 0x04>;
903 clocks = <&clks 127>;
728 status = "disabled"; 904 status = "disabled";
729 }; 905 };
730 906
@@ -788,6 +964,8 @@
788 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 964 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
789 reg = <0x021e8000 0x4000>; 965 reg = <0x021e8000 0x4000>;
790 interrupts = <0 27 0x04>; 966 interrupts = <0 27 0x04>;
967 clocks = <&clks 160>, <&clks 161>;
968 clock-names = "ipg", "per";
791 status = "disabled"; 969 status = "disabled";
792 }; 970 };
793 971
@@ -795,6 +973,8 @@
795 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 973 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
796 reg = <0x021ec000 0x4000>; 974 reg = <0x021ec000 0x4000>;
797 interrupts = <0 28 0x04>; 975 interrupts = <0 28 0x04>;
976 clocks = <&clks 160>, <&clks 161>;
977 clock-names = "ipg", "per";
798 status = "disabled"; 978 status = "disabled";
799 }; 979 };
800 980
@@ -802,6 +982,8 @@
802 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 982 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
803 reg = <0x021f0000 0x4000>; 983 reg = <0x021f0000 0x4000>;
804 interrupts = <0 29 0x04>; 984 interrupts = <0 29 0x04>;
985 clocks = <&clks 160>, <&clks 161>;
986 clock-names = "ipg", "per";
805 status = "disabled"; 987 status = "disabled";
806 }; 988 };
807 989
@@ -809,6 +991,8 @@
809 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 991 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
810 reg = <0x021f4000 0x4000>; 992 reg = <0x021f4000 0x4000>;
811 interrupts = <0 30 0x04>; 993 interrupts = <0 30 0x04>;
994 clocks = <&clks 160>, <&clks 161>;
995 clock-names = "ipg", "per";
812 status = "disabled"; 996 status = "disabled";
813 }; 997 };
814 }; 998 };
diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 7408655f91b5..9b32d0272825 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 000000000000..08a582414b88
--- /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 f8ca6fa88192..d97cd9d4753e 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 000000000000..865aeec40a26
--- /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 000000000000..75bdb93fed26
--- /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 cef9616f330a..4e5b8154a5be 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 80f74e256408..0514fb41627e 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 45bc4bb04e57..31f2157cd7d7 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 000000000000..9e621b5ad3dd
--- /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 25b50b759dec..77b84e17c477 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 000000000000..bfd76b4a0ddc
--- /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 000000000000..4565d9750f4d
--- /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 cdcb98c7e075..c38cf76df81f 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 f349ee9182ce..e8ba1c247a39 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 000000000000..89808ce01673
--- /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 000000000000..a13d12de77ff
--- /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 810947198208..f38ea8771b44 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 000000000000..96bf0287cb9f
--- /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 9880c12877b3..20b966ee1bb3 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";
@@ -126,3 +127,13 @@
126 ti,non-removable; 127 ti,non-removable;
127 bus-width = <4>; 128 bus-width = <4>;
128}; 129};
130
131&emif1 {
132 cs1-used;
133 device-handle = <&elpida_ECB240ABACN>;
134};
135
136&emif2 {
137 cs1-used;
138 device-handle = <&elpida_ECB240ABACN>;
139};
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 72216e932fc0..94a23b39033d 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,33 @@
115 }; 116 };
116}; 117};
117 118
119&omap4_pmx_core {
120 uart2_pins: pinmux_uart2_pins {
121 pinctrl-single,pins = <
122 0xd8 0x118 /* uart2_cts.uart2_cts INPUT_PULLUP | MODE0 */
123 0xda 0 /* uart2_rts.uart2_rts OUTPUT | MODE0 */
124 0xdc 0x118 /* uart2_rx.uart2_rx INPUT_PULLUP | MODE0 */
125 0xde 0 /* uart2_tx.uart2_tx OUTPUT | MODE0 */
126 >;
127 };
128
129 uart3_pins: pinmux_uart3_pins {
130 pinctrl-single,pins = <
131 0x100 0x118 /* uart3_cts_rctx.uart3_cts_rctx INPUT_PULLUP | MODE0 */
132 0x102 0 /* uart3_rts_sd.uart3_rts_sd OUTPUT | MODE0 */
133 0x104 0x100 /* uart3_rx_irrx.uart3_rx_irrx INPUT | MODE0 */
134 0x106 0 /* uart3_tx_irtx.uart3_tx_irtx OUTPUT | MODE0 */
135 >;
136 };
137
138 uart4_pins: pinmux_uart4_pins {
139 pinctrl-single,pins = <
140 0x11c 0x100 /* uart4_rx.uart4_rx INPUT | MODE0 */
141 0x11e 0 /* uart4_tx.uart4_tx OUTPUT | MODE0 */
142 >;
143 };
144};
145
118&i2c1 { 146&i2c1 {
119 clock-frequency = <400000>; 147 clock-frequency = <400000>;
120 148
@@ -226,3 +254,98 @@
226 bus-width = <4>; 254 bus-width = <4>;
227 ti,non-removable; 255 ti,non-removable;
228}; 256};
257
258&emif1 {
259 cs1-used;
260 device-handle = <&elpida_ECB240ABACN>;
261};
262
263&emif2 {
264 cs1-used;
265 device-handle = <&elpida_ECB240ABACN>;
266};
267
268&keypad {
269 keypad,num-rows = <8>;
270 keypad,num-columns = <8>;
271 linux,keymap = <0x00000012 /* KEY_E */
272 0x00010013 /* KEY_R */
273 0x00020014 /* KEY_T */
274 0x00030066 /* KEY_HOME */
275 0x0004003f /* KEY_F5 */
276 0x000500f0 /* KEY_UNKNOWN */
277 0x00060017 /* KEY_I */
278 0x0007002a /* KEY_LEFTSHIFT */
279 0x01000020 /* KEY_D*/
280 0x01010021 /* KEY_F */
281 0x01020022 /* KEY_G */
282 0x010300e7 /* KEY_SEND */
283 0x01040040 /* KEY_F6 */
284 0x010500f0 /* KEY_UNKNOWN */
285 0x01060025 /* KEY_K */
286 0x0107001c /* KEY_ENTER */
287 0x0200002d /* KEY_X */
288 0x0201002e /* KEY_C */
289 0x0202002f /* KEY_V */
290 0x0203006b /* KEY_END */
291 0x02040041 /* KEY_F7 */
292 0x020500f0 /* KEY_UNKNOWN */
293 0x02060034 /* KEY_DOT */
294 0x0207003a /* KEY_CAPSLOCK */
295 0x0300002c /* KEY_Z */
296 0x0301004e /* KEY_KPLUS */
297 0x03020030 /* KEY_B */
298 0x0303003b /* KEY_F1 */
299 0x03040042 /* KEY_F8 */
300 0x030500f0 /* KEY_UNKNOWN */
301 0x03060018 /* KEY_O */
302 0x03070039 /* KEY_SPACE */
303 0x04000011 /* KEY_W */
304 0x04010015 /* KEY_Y */
305 0x04020016 /* KEY_U */
306 0x0403003c /* KEY_F2 */
307 0x04040073 /* KEY_VOLUMEUP */
308 0x040500f0 /* KEY_UNKNOWN */
309 0x04060026 /* KEY_L */
310 0x04070069 /* KEY_LEFT */
311 0x0500001f /* KEY_S */
312 0x05010023 /* KEY_H */
313 0x05020024 /* KEY_J */
314 0x0503003d /* KEY_F3 */
315 0x05040043 /* KEY_F9 */
316 0x05050072 /* KEY_VOLUMEDOWN */
317 0x05060032 /* KEY_M */
318 0x0507006a /* KEY_RIGHT */
319 0x06000010 /* KEY_Q */
320 0x0601001e /* KEY_A */
321 0x06020031 /* KEY_N */
322 0x0603009e /* KEY_BACK */
323 0x0604000e /* KEY_BACKSPACE */
324 0x060500f0 /* KEY_UNKNOWN */
325 0x06060019 /* KEY_P */
326 0x06070067 /* KEY_UP */
327 0x07000094 /* KEY_PROG1 */
328 0x07010095 /* KEY_PROG2 */
329 0x070200ca /* KEY_PROG3 */
330 0x070300cb /* KEY_PROG4 */
331 0x0704003e /* KEY_F4 */
332 0x070500f0 /* KEY_UNKNOWN */
333 0x07060160 /* KEY_OK */
334 0x0707006c>; /* KEY_DOWN */
335 linux,input-no-autorepeat;
336};
337
338&uart2 {
339 pinctrl-names = "default";
340 pinctrl-0 = <&uart2_pins>;
341};
342
343&uart3 {
344 pinctrl-names = "default";
345 pinctrl-0 = <&uart3_pins>;
346};
347
348&uart4 {
349 pinctrl-names = "default";
350 pinctrl-0 = <&uart4_pins>;
351};
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 04cbbcb6ff91..5d1c48459e6e 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,87 @@
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 };
298 }; 433 };
299}; 434};
diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index 200c39ad1c82..9c41a3f311aa 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -17,4 +17,68 @@
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&mmc1 {
31 vmmc-supply = <&vmmcsd_fixed>;
32 bus-width = <4>;
33};
34
35&mmc2 {
36 vmmc-supply = <&vmmcsd_fixed>;
37 bus-width = <8>;
38 ti,non-removable;
39};
40
41&mmc3 {
42 bus-width = <4>;
43 ti,non-removable;
44};
45
46&mmc4 {
47 status = "disabled";
48};
49
50&mmc5 {
51 status = "disabled";
52};
53
54&i2c2 {
55 clock-frequency = <400000>;
56
57 /* Pressure Sensor */
58 bmp085@77 {
59 compatible = "bosch,bmp085";
60 reg = <0x77>;
61 };
62};
63
64&i2c4 {
65 clock-frequency = <400000>;
66
67 /* Temperature Sensor */
68 tmp102@48{
69 compatible = "ti,tmp102";
70 reg = <0x48>;
71 };
72};
73
74&keypad {
75 keypad,num-rows = <8>;
76 keypad,num-columns = <8>;
77 linux,keymap = <0x02020073 /* VOLUP */
78 0x02030072 /* VOLDOWM */
79 0x020400e7 /* SEND */
80 0x02050066 /* HOME */
81 0x0206006b /* END */
82 0x020700d9>; /* SEARCH */
83 linux,input-no-autorepeat;
20}; 84};
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 57e527083746..9ac75b37c992 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -145,6 +145,41 @@
145 #interrupt-cells = <1>; 145 #interrupt-cells = <1>;
146 }; 146 };
147 147
148 i2c1: i2c@48070000 {
149 compatible = "ti,omap4-i2c";
150 #address-cells = <1>;
151 #size-cells = <0>;
152 ti,hwmods = "i2c1";
153 };
154
155 i2c2: i2c@48072000 {
156 compatible = "ti,omap4-i2c";
157 #address-cells = <1>;
158 #size-cells = <0>;
159 ti,hwmods = "i2c2";
160 };
161
162 i2c3: i2c@48060000 {
163 compatible = "ti,omap4-i2c";
164 #address-cells = <1>;
165 #size-cells = <0>;
166 ti,hwmods = "i2c3";
167 };
168
169 i2c4: i2c@4807A000 {
170 compatible = "ti,omap4-i2c";
171 #address-cells = <1>;
172 #size-cells = <0>;
173 ti,hwmods = "i2c4";
174 };
175
176 i2c5: i2c@4807C000 {
177 compatible = "ti,omap4-i2c";
178 #address-cells = <1>;
179 #size-cells = <0>;
180 ti,hwmods = "i2c5";
181 };
182
148 uart1: serial@4806a000 { 183 uart1: serial@4806a000 {
149 compatible = "ti,omap4-uart"; 184 compatible = "ti,omap4-uart";
150 ti,hwmods = "uart1"; 185 ti,hwmods = "uart1";
@@ -180,5 +215,97 @@
180 ti,hwmods = "uart6"; 215 ti,hwmods = "uart6";
181 clock-frequency = <48000000>; 216 clock-frequency = <48000000>;
182 }; 217 };
218
219 mmc1: mmc@4809c000 {
220 compatible = "ti,omap4-hsmmc";
221 ti,hwmods = "mmc1";
222 ti,dual-volt;
223 ti,needs-special-reset;
224 };
225
226 mmc2: mmc@480b4000 {
227 compatible = "ti,omap4-hsmmc";
228 ti,hwmods = "mmc2";
229 ti,needs-special-reset;
230 };
231
232 mmc3: mmc@480ad000 {
233 compatible = "ti,omap4-hsmmc";
234 ti,hwmods = "mmc3";
235 ti,needs-special-reset;
236 };
237
238 mmc4: mmc@480d1000 {
239 compatible = "ti,omap4-hsmmc";
240 ti,hwmods = "mmc4";
241 ti,needs-special-reset;
242 };
243
244 mmc5: mmc@480d5000 {
245 compatible = "ti,omap4-hsmmc";
246 ti,hwmods = "mmc5";
247 ti,needs-special-reset;
248 };
249
250 keypad: keypad@4ae1c000 {
251 compatible = "ti,omap4-keypad";
252 ti,hwmods = "kbd";
253 };
254
255 mcpdm: mcpdm@40132000 {
256 compatible = "ti,omap4-mcpdm";
257 reg = <0x40132000 0x7f>, /* MPU private access */
258 <0x49032000 0x7f>; /* L3 Interconnect */
259 reg-names = "mpu", "dma";
260 interrupts = <0 112 0x4>;
261 interrupt-parent = <&gic>;
262 ti,hwmods = "mcpdm";
263 };
264
265 dmic: dmic@4012e000 {
266 compatible = "ti,omap4-dmic";
267 reg = <0x4012e000 0x7f>, /* MPU private access */
268 <0x4902e000 0x7f>; /* L3 Interconnect */
269 reg-names = "mpu", "dma";
270 interrupts = <0 114 0x4>;
271 interrupt-parent = <&gic>;
272 ti,hwmods = "dmic";
273 };
274
275 mcbsp1: mcbsp@40122000 {
276 compatible = "ti,omap4-mcbsp";
277 reg = <0x40122000 0xff>, /* MPU private access */
278 <0x49022000 0xff>; /* L3 Interconnect */
279 reg-names = "mpu", "dma";
280 interrupts = <0 17 0x4>;
281 interrupt-names = "common";
282 interrupt-parent = <&gic>;
283 ti,buffer-size = <128>;
284 ti,hwmods = "mcbsp1";
285 };
286
287 mcbsp2: mcbsp@40124000 {
288 compatible = "ti,omap4-mcbsp";
289 reg = <0x40124000 0xff>, /* MPU private access */
290 <0x49024000 0xff>; /* L3 Interconnect */
291 reg-names = "mpu", "dma";
292 interrupts = <0 22 0x4>;
293 interrupt-names = "common";
294 interrupt-parent = <&gic>;
295 ti,buffer-size = <128>;
296 ti,hwmods = "mcbsp2";
297 };
298
299 mcbsp3: mcbsp@40126000 {
300 compatible = "ti,omap4-mcbsp";
301 reg = <0x40126000 0xff>, /* MPU private access */
302 <0x49026000 0xff>; /* L3 Interconnect */
303 reg-names = "mpu", "dma";
304 interrupts = <0 23 0x4>;
305 interrupt-names = "common";
306 interrupt-parent = <&gic>;
307 ti,buffer-size = <128>;
308 ti,hwmods = "mcbsp3";
309 };
183 }; 310 };
184}; 311};
diff --git a/arch/arm/boot/dts/phy3250.dts b/arch/arm/boot/dts/phy3250.dts
index 802ec5b2fd00..a7ad85e4b8f9 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>;
diff --git a/arch/arm/boot/dts/prima2-cb.dts b/arch/arm/boot/dts/prima2-cb.dts
deleted file mode 100644
index 34ae3a64ba25..000000000000
--- 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 000000000000..57286b4e7b87
--- /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 000000000000..055fca542120
--- /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 000000000000..d7c5d721a5c7
--- /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 000000000000..f18aad35e8b3
--- /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 000000000000..f9d92da86783
--- /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.dtsi b/arch/arm/boot/dts/pxa910.dtsi
index aebf32de73b4..a3be44d86bcd 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>;
diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts
index f146dbf6f7f8..c3ef1ad26b6a 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 000000000000..a2d6d6541f83
--- /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 684a9e1ff7e9..ddf287f52d49 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 000000000000..331a3ef24d59
--- /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 85e621ab2968..e60dc7124e92 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,6 +535,10 @@
387 }; 535 };
388 }; 536 };
389 537
538 pmc {
539 nvidia,invert-interrupt;
540 };
541
390 memory-controller@0x7000f400 { 542 memory-controller@0x7000f400 {
391 emc-table@190000 { 543 emc-table@190000 {
392 reg = <190000>; 544 reg = <190000>;
@@ -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 000000000000..f18cec9f6a77
--- /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 000000000000..9aff31b0fe4a
--- /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 be90544e6b59..3e5952fcfbc5 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 6916310bf58f..c636d002d6d8 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 405d1673904e..67a6cd910b96 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>;
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 000000000000..dd4222f00eca
--- /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 000000000000..0828f097ca86
--- /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 c169bced131e..000000000000
--- 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 000000000000..d10c9c5a3606
--- /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 3e4334d14efb..b1497c7d7d68 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 000000000000..a63272422d76
--- /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 000000000000..92693a89160e
--- /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 22f4d1394ed3..ff000172c93c 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 d351b27d7213..123e2c40218a 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/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
new file mode 100644
index 000000000000..7aea70253c63
--- /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/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 3c9f32f9b6b4..565132d02105 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
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index aeb3af541fed..74eee0c78f28 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 26146ffea1a5..8c49df66cac3 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 2388c8610627..5d0c66708960 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
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig
index 2e86b31c33cf..7bcf850eddcd 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 4edcfb4e4dee..36d60dda310c 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
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index e58edc36b406..62303043db9c 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/pnx4008_defconfig b/arch/arm/configs/pnx4008_defconfig
deleted file mode 100644
index 35a31ccacc32..000000000000
--- 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 c328ac65479a..807d4e2acb17 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/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index db2245353f0f..0d6bb738c6de 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -145,6 +145,8 @@ CONFIG_MMC_SDHCI_TEGRA=y
145CONFIG_RTC_CLASS=y 145CONFIG_RTC_CLASS=y
146CONFIG_RTC_DRV_EM3027=y 146CONFIG_RTC_DRV_EM3027=y
147CONFIG_RTC_DRV_TEGRA=y 147CONFIG_RTC_DRV_TEGRA=y
148CONFIG_DMADEVICES=y
149CONFIG_TEGRA20_APB_DMA=y
148CONFIG_STAGING=y 150CONFIG_STAGING=y
149CONFIG_SENSORS_ISL29018=y 151CONFIG_SENSORS_ISL29018=y
150CONFIG_SENSORS_ISL29028=y 152CONFIG_SENSORS_ISL29028=y
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index c402e9b31f4c..477e0206e016 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/hardware/cache-tauros2.h b/arch/arm/include/asm/hardware/cache-tauros2.h
index 538f17ca905b..295e2e40151b 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 2ff2c75a4639..02fe2fbe2477 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/io.h b/arch/arm/include/asm/io.h
index 815c669fec0a..8f4db67533e5 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -113,11 +113,19 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
113#define __iowmb() do { } while (0) 113#define __iowmb() do { } while (0)
114#endif 114#endif
115 115
116/* PCI fixed i/o mapping */
117#define PCI_IO_VIRT_BASE 0xfee00000
118
119extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
120
116/* 121/*
117 * Now, pick up the machine-defined IO definitions 122 * Now, pick up the machine-defined IO definitions
118 */ 123 */
119#ifdef CONFIG_NEED_MACH_IO_H 124#ifdef CONFIG_NEED_MACH_IO_H
120#include <mach/io.h> 125#include <mach/io.h>
126#elif defined(CONFIG_PCI)
127#define IO_SPACE_LIMIT ((resource_size_t)0xfffff)
128#define __io(a) __typesafe_io(PCI_IO_VIRT_BASE + ((a) & IO_SPACE_LIMIT))
121#else 129#else
122#define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT) 130#define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT)
123#endif 131#endif
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 0b1c94b8c652..917d4fcfd9b4 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 a6efcdd6fd25..195ac2f9d3d3 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 26c511fddf8f..db9fedb57f2c 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/perf_event.h b/arch/arm/include/asm/perf_event.h
index e074948d8143..625cd621a436 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/pmu.h b/arch/arm/include/asm/pmu.h
index 4432305f4a2a..a26170dce02e 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/smp.h b/arch/arm/include/asm/smp.h
index ae29293270a3..2e3be16c6766 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/timex.h b/arch/arm/include/asm/timex.h
index ce119442277c..963342acebb7 100644
--- a/arch/arm/include/asm/timex.h
+++ b/arch/arm/include/asm/timex.h
@@ -13,7 +13,11 @@
13#define _ASMARM_TIMEX_H 13#define _ASMARM_TIMEX_H
14 14
15#include <asm/arch_timer.h> 15#include <asm/arch_timer.h>
16#ifdef CONFIG_ARCH_MULTIPLATFORM
17#define CLOCK_TICK_RATE 1000000
18#else
16#include <mach/timex.h> 19#include <mach/timex.h>
20#endif
17 21
18typedef unsigned long cycles_t; 22typedef unsigned long cycles_t;
19 23
diff --git a/arch/arm/mach-highbank/include/mach/debug-macro.S b/arch/arm/include/debug/highbank.S
index cb57fe5bcd04..8cad4322a5a2 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 000000000000..43afcb021fa3
--- /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 22825760c7e1..865c6d02b332 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 58d4ee3ae949..7419deb1b948 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 d6f26d23374f..d6f26d23374f 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 9f509f55d078..9f509f55d078 100644
--- a/arch/arm/mach-vexpress/include/mach/debug-macro.S
+++ b/arch/arm/include/debug/vexpress.S
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 7ad2d5cf7008..1c4321430737 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -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
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 2b2f25e7fef5..b244696de1a3 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;
@@ -423,6 +424,38 @@ static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
423 return irq; 424 return irq;
424} 425}
425 426
427static int __init pcibios_init_resources(int busnr, struct pci_sys_data *sys)
428{
429 int ret;
430 struct pci_host_bridge_window *window;
431
432 if (list_empty(&sys->resources)) {
433 pci_add_resource_offset(&sys->resources,
434 &iomem_resource, sys->mem_offset);
435 }
436
437 list_for_each_entry(window, &sys->resources, list) {
438 if (resource_type(window->res) == IORESOURCE_IO)
439 return 0;
440 }
441
442 sys->io_res.start = (busnr * SZ_64K) ? : pcibios_min_io;
443 sys->io_res.end = (busnr + 1) * SZ_64K - 1;
444 sys->io_res.flags = IORESOURCE_IO;
445 sys->io_res.name = sys->io_res_name;
446 sprintf(sys->io_res_name, "PCI%d I/O", busnr);
447
448 ret = request_resource(&ioport_resource, &sys->io_res);
449 if (ret) {
450 pr_err("PCI: unable to allocate I/O port region (%d)\n", ret);
451 return ret;
452 }
453 pci_add_resource_offset(&sys->resources, &sys->io_res,
454 sys->io_offset);
455
456 return 0;
457}
458
426static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head) 459static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
427{ 460{
428 struct pci_sys_data *sys = NULL; 461 struct pci_sys_data *sys = NULL;
@@ -445,11 +478,10 @@ static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
445 ret = hw->setup(nr, sys); 478 ret = hw->setup(nr, sys);
446 479
447 if (ret > 0) { 480 if (ret > 0) {
448 if (list_empty(&sys->resources)) { 481 ret = pcibios_init_resources(nr, sys);
449 pci_add_resource_offset(&sys->resources, 482 if (ret) {
450 &ioport_resource, sys->io_offset); 483 kfree(sys);
451 pci_add_resource_offset(&sys->resources, 484 break;
452 &iomem_resource, sys->mem_offset);
453 } 485 }
454 486
455 if (hw->scan) 487 if (hw->scan)
@@ -627,3 +659,15 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
627 659
628 return 0; 660 return 0;
629} 661}
662
663void __init pci_map_io_early(unsigned long pfn)
664{
665 struct map_desc pci_io_desc = {
666 .virtual = PCI_IO_VIRT_BASE,
667 .type = MT_DEVICE,
668 .length = SZ_64K,
669 };
670
671 pci_io_desc.pfn = pfn;
672 iotable_init(&pci_io_desc, 1);
673}
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index c45522c36787..66f711b2e0e8 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/head.S b/arch/arm/kernel/head.S
index 3db960e20cb8..9874d0741191 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/*
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index ab243b87118d..93971b1a4f0b 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 000000000000..8d7d8d4de9d6
--- /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 c90fcb2b6967..6ccc07971745 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 f04070bd2183..bd4b090ebcfd 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 f759fe0bab63..426e19f380a2 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 2334bf8a650a..000000000000
--- 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/setup.c b/arch/arm/kernel/setup.c
index a81dcecc7343..725f9f2a9541 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -977,8 +977,10 @@ void __init setup_arch(char **cmdline_p)
977 unflatten_device_tree(); 977 unflatten_device_tree();
978 978
979#ifdef CONFIG_SMP 979#ifdef CONFIG_SMP
980 if (is_smp()) 980 if (is_smp()) {
981 smp_set_ops(mdesc->smp);
981 smp_init_cpus(); 982 smp_init_cpus();
983 }
982#endif 984#endif
983 reserve_crashkernel(); 985 reserve_crashkernel();
984 986
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index ebd8ad274d76..aa4ffe6e5ecf 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -19,7 +19,6 @@
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>
@@ -27,6 +26,7 @@
27#include <linux/completion.h> 26#include <linux/completion.h>
28 27
29#include <linux/atomic.h> 28#include <linux/atomic.h>
29#include <asm/smp.h>
30#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
31#include <asm/cpu.h> 31#include <asm/cpu.h>
32#include <asm/cputype.h> 32#include <asm/cputype.h>
@@ -42,6 +42,7 @@
42#include <asm/ptrace.h> 42#include <asm/ptrace.h>
43#include <asm/localtimer.h> 43#include <asm/localtimer.h>
44#include <asm/smp_plat.h> 44#include <asm/smp_plat.h>
45#include <asm/mach/arch.h>
45 46
46/* 47/*
47 * as from 2.5, kernels no longer have an init_tasks structure 48 * as from 2.5, kernels no longer have an init_tasks structure
@@ -50,6 +51,12 @@
50 */ 51 */
51struct secondary_data secondary_data; 52struct secondary_data secondary_data;
52 53
54/*
55 * control for which core is the next to come out of the secondary
56 * boot "holding pen"
57 */
58volatile int __cpuinitdata pen_release = -1;
59
53enum ipi_msg_type { 60enum ipi_msg_type {
54 IPI_TIMER = 2, 61 IPI_TIMER = 2,
55 IPI_RESCHEDULE, 62 IPI_RESCHEDULE,
@@ -60,6 +67,14 @@ enum ipi_msg_type {
60 67
61static DECLARE_COMPLETION(cpu_running); 68static DECLARE_COMPLETION(cpu_running);
62 69
70static struct smp_operations smp_ops;
71
72void __init smp_set_ops(struct smp_operations *ops)
73{
74 if (ops)
75 smp_ops = *ops;
76};
77
63int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) 78int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
64{ 79{
65 int ret; 80 int ret;
@@ -100,13 +115,64 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
100 return ret; 115 return ret;
101} 116}
102 117
118/* platform specific SMP operations */
119void __init smp_init_cpus(void)
120{
121 if (smp_ops.smp_init_cpus)
122 smp_ops.smp_init_cpus();
123}
124
125static void __init platform_smp_prepare_cpus(unsigned int max_cpus)
126{
127 if (smp_ops.smp_prepare_cpus)
128 smp_ops.smp_prepare_cpus(max_cpus);
129}
130
131static void __cpuinit platform_secondary_init(unsigned int cpu)
132{
133 if (smp_ops.smp_secondary_init)
134 smp_ops.smp_secondary_init(cpu);
135}
136
137int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
138{
139 if (smp_ops.smp_boot_secondary)
140 return smp_ops.smp_boot_secondary(cpu, idle);
141 return -ENOSYS;
142}
143
103#ifdef CONFIG_HOTPLUG_CPU 144#ifdef CONFIG_HOTPLUG_CPU
104static void percpu_timer_stop(void); 145static void percpu_timer_stop(void);
105 146
147static int platform_cpu_kill(unsigned int cpu)
148{
149 if (smp_ops.cpu_kill)
150 return smp_ops.cpu_kill(cpu);
151 return 1;
152}
153
154static void platform_cpu_die(unsigned int cpu)
155{
156 if (smp_ops.cpu_die)
157 smp_ops.cpu_die(cpu);
158}
159
160static int platform_cpu_disable(unsigned int cpu)
161{
162 if (smp_ops.cpu_disable)
163 return smp_ops.cpu_disable(cpu);
164
165 /*
166 * By default, allow disabling all CPUs except the first one,
167 * since this is special on a lot of platforms, e.g. because
168 * of clock tick interrupts.
169 */
170 return cpu == 0 ? -EPERM : 0;
171}
106/* 172/*
107 * __cpu_disable runs on the processor to be shutdown. 173 * __cpu_disable runs on the processor to be shutdown.
108 */ 174 */
109int __cpu_disable(void) 175int __cpuinit __cpu_disable(void)
110{ 176{
111 unsigned int cpu = smp_processor_id(); 177 unsigned int cpu = smp_processor_id();
112 int ret; 178 int ret;
@@ -149,7 +215,7 @@ static DECLARE_COMPLETION(cpu_died);
149 * called on the thread which is asking for a CPU to be shutdown - 215 * called on the thread which is asking for a CPU to be shutdown -
150 * waits until shutdown has completed, or it is timed out. 216 * waits until shutdown has completed, or it is timed out.
151 */ 217 */
152void __cpu_die(unsigned int cpu) 218void __cpuinit __cpu_die(unsigned int cpu)
153{ 219{
154 if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) { 220 if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {
155 pr_err("CPU%u: cpu didn't die\n", cpu); 221 pr_err("CPU%u: cpu didn't die\n", cpu);
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot
index 30bb7332e30b..5309f9b6aabc 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/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 1b47319ca00b..e4c3b3709204 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>
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index b3d365dadef5..dcda24838b5a 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
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
index 46090e642d8e..6bd7300a2bc5 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 6ca680a1d5d1..ee06d7bcdf76 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/include/mach/atmel-mci.h b/arch/arm/mach-at91/include/mach/atmel-mci.h
index 998cb0c07135..cd580a12e904 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/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index 09242b67d277..711a7892d331 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 6f6118d1576a..97ad68a826f8 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/setup.c b/arch/arm/mach-at91/setup.c
index 944bffb08991..e6f52de1062f 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
@@ -88,7 +88,7 @@ void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
88} 88}
89 89
90static struct map_desc at91_io_desc __initdata = { 90static struct map_desc at91_io_desc __initdata = {
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 000000000000..4c3892fe02c3
--- /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 000000000000..2d30e17f5b69
--- /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 000000000000..f6fea4933571
--- /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/map.h b/arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h
index c06afad218bb..d4dfcf7a9cda 100644
--- a/arch/arm/mach-picoxcell/include/mach/map.h
+++ b/arch/arm/mach-bcm2835/include/mach/bcm2835_soc.h
@@ -1,5 +1,8 @@
1/* 1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles 2 * Copyright (C) 2012 Stephen Warren
3 *
4 * Derived from code:
5 * Copyright (C) 2010 Broadcom
3 * 6 *
4 * 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
5 * 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
@@ -11,15 +14,16 @@
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 15 * GNU General Public License for more details.
13 */ 16 */
14#ifndef __PICOXCELL_MAP_H__
15#define __PICOXCELL_MAP_H__
16 17
17#define PHYS_TO_IO(x) (((x) & 0x00ffffff) | 0xfe000000) 18#ifndef __MACH_BCM2835_BCM2835_SOC_H__
19#define __MACH_BCM2835_BCM2835_SOC_H__
18 20
19#ifdef __ASSEMBLY__ 21#include <asm/sizes.h>
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 22
25#endif /* __PICOXCELL_MAP_H__ */ 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
28
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 000000000000..8a161e44ae28
--- /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 6ea02f2176b7..6d021e136ae3 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 000000000000..cc46dcc72377
--- /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/arch.c b/arch/arm/mach-bcmring/arch.c
index 45c97b1ee9b1..c18a5048b6c5 100644
--- a/arch/arm/mach-bcmring/arch.c
+++ b/arch/arm/mach-bcmring/arch.c
@@ -29,7 +29,6 @@
29#include <asm/setup.h> 29#include <asm/setup.h>
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31#include <asm/mach/time.h> 31#include <asm/mach/time.h>
32#include <asm/pmu.h>
33 32
34#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
35#include <mach/dma.h> 34#include <mach/dma.h>
@@ -38,7 +37,7 @@
38#include <mach/csp/chipcHw_def.h> 37#include <mach/csp/chipcHw_def.h>
39#include <mach/csp/chipcHw_inline.h> 38#include <mach/csp/chipcHw_inline.h>
40 39
41#include <cfg_global.h> 40#include <mach/cfg_global.h>
42 41
43#include "core.h" 42#include "core.h"
44 43
@@ -116,7 +115,7 @@ static struct resource pmu_resource = {
116 115
117static struct platform_device pmu_device = { 116static struct platform_device pmu_device = {
118 .name = "arm-pmu", 117 .name = "arm-pmu",
119 .id = ARM_PMU_DEVICE_CPU, 118 .id = -1,
120 .resource = &pmu_resource, 119 .resource = &pmu_resource,
121 .num_resources = 1, 120 .num_resources = 1,
122}; 121};
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c
index adbfb1994582..4b50228a6771 100644
--- a/arch/arm/mach-bcmring/core.c
+++ b/arch/arm/mach-bcmring/core.c
@@ -43,11 +43,10 @@
43#include <asm/mach/time.h> 43#include <asm/mach/time.h>
44#include <asm/mach/map.h> 44#include <asm/mach/map.h>
45 45
46#include <cfg_global.h> 46#include <mach/cfg_global.h>
47 47
48#include "clock.h" 48#include "clock.h"
49 49
50#include <csp/secHw.h>
51#include <mach/csp/secHw_def.h> 50#include <mach/csp/secHw_def.h>
52#include <mach/csp/chipcHw_inline.h> 51#include <mach/csp/chipcHw_inline.h>
53#include <mach/csp/tmrHw_reg.h> 52#include <mach/csp/tmrHw_reg.h>
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw.c
index 96273ff34956..5050833817b7 100644
--- a/arch/arm/mach-bcmring/csp/chipc/chipcHw.c
+++ b/arch/arm/mach-bcmring/csp/chipc/chipcHw.c
@@ -26,15 +26,15 @@
26 26
27/* ---- Include Files ---------------------------------------------------- */ 27/* ---- Include Files ---------------------------------------------------- */
28 28
29#include <csp/errno.h> 29#include <linux/errno.h>
30#include <csp/stdint.h> 30#include <linux/types.h>
31#include <csp/module.h> 31#include <linux/export.h>
32 32
33#include <mach/csp/chipcHw_def.h> 33#include <mach/csp/chipcHw_def.h>
34#include <mach/csp/chipcHw_inline.h> 34#include <mach/csp/chipcHw_inline.h>
35 35
36#include <csp/reg.h> 36#include <mach/csp/reg.h>
37#include <csp/delay.h> 37#include <linux/delay.h>
38 38
39/* ---- Private Constants and Types --------------------------------------- */ 39/* ---- Private Constants and Types --------------------------------------- */
40 40
@@ -61,21 +61,21 @@ static int chipcHw_divide(int num, int denom)
61/****************************************************************************/ 61/****************************************************************************/
62chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */ 62chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configurable clock */
63 ) { 63 ) {
64 volatile uint32_t *pPLLReg = (uint32_t *) 0x0; 64 uint32_t __iomem *pPLLReg = NULL;
65 volatile uint32_t *pClockCtrl = (uint32_t *) 0x0; 65 uint32_t __iomem *pClockCtrl = NULL;
66 volatile uint32_t *pDependentClock = (uint32_t *) 0x0; 66 uint32_t __iomem *pDependentClock = NULL;
67 uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */ 67 uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */
68 uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */ 68 uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */
69 uint32_t dependentClockType = 0; 69 uint32_t dependentClockType = 0;
70 uint32_t vcoHz = 0; 70 uint32_t vcoHz = 0;
71 71
72 /* Get VCO frequencies */ 72 /* Get VCO frequencies */
73 if ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { 73 if ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) {
74 uint64_t adjustFreq = 0; 74 uint64_t adjustFreq = 0;
75 75
76 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * 76 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
77 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * 77 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
78 ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> 78 ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
79 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); 79 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
80 80
81 /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */ 81 /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */
@@ -86,13 +86,13 @@ chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configur
86 } else { 86 } else {
87 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * 87 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
88 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * 88 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
89 ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> 89 ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
90 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); 90 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
91 } 91 }
92 vcoFreqPll2Hz = 92 vcoFreqPll2Hz =
93 chipcHw_XTAL_FREQ_Hz * 93 chipcHw_XTAL_FREQ_Hz *
94 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * 94 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
95 ((pChipcHw->PLLPreDivider2 & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> 95 ((readl(&pChipcHw->PLLPreDivider2) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
96 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); 96 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
97 97
98 switch (clock) { 98 switch (clock) {
@@ -187,51 +187,51 @@ chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configur
187 187
188 if (pPLLReg) { 188 if (pPLLReg) {
189 /* Obtain PLL clock frequency */ 189 /* Obtain PLL clock frequency */
190 if (*pPLLReg & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) { 190 if (readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) {
191 /* Return crystal clock frequency when bypassed */ 191 /* Return crystal clock frequency when bypassed */
192 return chipcHw_XTAL_FREQ_Hz; 192 return chipcHw_XTAL_FREQ_Hz;
193 } else if (clock == chipcHw_CLOCK_DDR) { 193 } else if (clock == chipcHw_CLOCK_DDR) {
194 /* DDR frequency is configured in PLLDivider register */ 194 /* DDR frequency is configured in PLLDivider register */
195 return chipcHw_divide (vcoHz, (((pChipcHw->PLLDivider & 0xFF000000) >> 24) ? ((pChipcHw->PLLDivider & 0xFF000000) >> 24) : 256)); 195 return chipcHw_divide (vcoHz, (((readl(&pChipcHw->PLLDivider) & 0xFF000000) >> 24) ? ((readl(&pChipcHw->PLLDivider) & 0xFF000000) >> 24) : 256));
196 } else { 196 } else {
197 /* From chip revision number B0, LCD clock is internally divided by 2 */ 197 /* From chip revision number B0, LCD clock is internally divided by 2 */
198 if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) { 198 if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) {
199 vcoHz >>= 1; 199 vcoHz >>= 1;
200 } 200 }
201 /* Obtain PLL clock frequency using VCO dividers */ 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)); 202 return chipcHw_divide(vcoHz, ((readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256));
203 } 203 }
204 } else if (pClockCtrl) { 204 } else if (pClockCtrl) {
205 /* Obtain divider clock frequency */ 205 /* Obtain divider clock frequency */
206 uint32_t div; 206 uint32_t div;
207 uint32_t freq = 0; 207 uint32_t freq = 0;
208 208
209 if (*pClockCtrl & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) { 209 if (readl(pClockCtrl) & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) {
210 /* Return crystal clock frequency when bypassed */ 210 /* Return crystal clock frequency when bypassed */
211 return chipcHw_XTAL_FREQ_Hz; 211 return chipcHw_XTAL_FREQ_Hz;
212 } else if (pDependentClock) { 212 } else if (pDependentClock) {
213 /* Identify the dependent clock frequency */ 213 /* Identify the dependent clock frequency */
214 switch (dependentClockType) { 214 switch (dependentClockType) {
215 case PLL_CLOCK: 215 case PLL_CLOCK:
216 if (*pDependentClock & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) { 216 if (readl(pDependentClock) & chipcHw_REG_PLL_CLOCK_BYPASS_SELECT) {
217 /* Use crystal clock frequency when dependent PLL clock is bypassed */ 217 /* Use crystal clock frequency when dependent PLL clock is bypassed */
218 freq = chipcHw_XTAL_FREQ_Hz; 218 freq = chipcHw_XTAL_FREQ_Hz;
219 } else { 219 } else {
220 /* Obtain PLL clock frequency using VCO dividers */ 220 /* Obtain PLL clock frequency using VCO dividers */
221 div = *pDependentClock & chipcHw_REG_PLL_CLOCK_MDIV_MASK; 221 div = readl(pDependentClock) & chipcHw_REG_PLL_CLOCK_MDIV_MASK;
222 freq = div ? chipcHw_divide(vcoHz, div) : 0; 222 freq = div ? chipcHw_divide(vcoHz, div) : 0;
223 } 223 }
224 break; 224 break;
225 case NON_PLL_CLOCK: 225 case NON_PLL_CLOCK:
226 if (pDependentClock == (uint32_t *) &pChipcHw->ACLKClock) { 226 if (pDependentClock == &pChipcHw->ACLKClock) {
227 freq = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS); 227 freq = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS);
228 } else { 228 } else {
229 if (*pDependentClock & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) { 229 if (readl(pDependentClock) & chipcHw_REG_DIV_CLOCK_BYPASS_SELECT) {
230 /* Use crystal clock frequency when dependent divider clock is bypassed */ 230 /* Use crystal clock frequency when dependent divider clock is bypassed */
231 freq = chipcHw_XTAL_FREQ_Hz; 231 freq = chipcHw_XTAL_FREQ_Hz;
232 } else { 232 } else {
233 /* Obtain divider clock frequency using XTAL dividers */ 233 /* Obtain divider clock frequency using XTAL dividers */
234 div = *pDependentClock & chipcHw_REG_DIV_CLOCK_DIV_MASK; 234 div = readl(pDependentClock) & chipcHw_REG_DIV_CLOCK_DIV_MASK;
235 freq = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, (div ? div : 256)); 235 freq = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, (div ? div : 256));
236 } 236 }
237 } 237 }
@@ -242,7 +242,7 @@ chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configur
242 freq = chipcHw_XTAL_FREQ_Hz; 242 freq = chipcHw_XTAL_FREQ_Hz;
243 } 243 }
244 244
245 div = *pClockCtrl & chipcHw_REG_DIV_CLOCK_DIV_MASK; 245 div = readl(pClockCtrl) & chipcHw_REG_DIV_CLOCK_DIV_MASK;
246 return chipcHw_divide(freq, (div ? div : 256)); 246 return chipcHw_divide(freq, (div ? div : 256));
247 } 247 }
248 return 0; 248 return 0;
@@ -261,9 +261,9 @@ chipcHw_freq chipcHw_getClockFrequency(chipcHw_CLOCK_e clock /* [ IN ] Configur
261chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configurable clock */ 261chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configurable clock */
262 uint32_t freq /* [ IN ] Clock frequency in Hz */ 262 uint32_t freq /* [ IN ] Clock frequency in Hz */
263 ) { 263 ) {
264 volatile uint32_t *pPLLReg = (uint32_t *) 0x0; 264 uint32_t __iomem *pPLLReg = NULL;
265 volatile uint32_t *pClockCtrl = (uint32_t *) 0x0; 265 uint32_t __iomem *pClockCtrl = NULL;
266 volatile uint32_t *pDependentClock = (uint32_t *) 0x0; 266 uint32_t __iomem *pDependentClock = NULL;
267 uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */ 267 uint32_t vcoFreqPll1Hz = 0; /* Effective VCO frequency for PLL1 in Hz */
268 uint32_t desVcoFreqPll1Hz = 0; /* Desired 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 */ 269 uint32_t vcoFreqPll2Hz = 0; /* Effective VCO frequency for PLL2 in Hz */
@@ -272,12 +272,12 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu
272 uint32_t desVcoHz = 0; 272 uint32_t desVcoHz = 0;
273 273
274 /* Get VCO frequencies */ 274 /* Get VCO frequencies */
275 if ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { 275 if ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) {
276 uint64_t adjustFreq = 0; 276 uint64_t adjustFreq = 0;
277 277
278 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * 278 vcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
279 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * 279 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
280 ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> 280 ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
281 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); 281 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
282 282
283 /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */ 283 /* Adjusted frequency due to chipcHw_REG_PLL_DIVIDER_NDIV_f_SS */
@@ -289,16 +289,16 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu
289 /* Desired VCO frequency */ 289 /* Desired VCO frequency */
290 desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * 290 desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
291 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * 291 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
292 (((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> 292 (((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
293 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT) + 1); 293 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT) + 1);
294 } else { 294 } else {
295 vcoFreqPll1Hz = desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz * 295 vcoFreqPll1Hz = desVcoFreqPll1Hz = chipcHw_XTAL_FREQ_Hz *
296 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * 296 chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) *
297 ((pChipcHw->PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >> 297 ((readl(&pChipcHw->PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
298 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); 298 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
299 } 299 }
300 vcoFreqPll2Hz = chipcHw_XTAL_FREQ_Hz * chipcHw_divide(chipcHw_REG_PLL_PREDIVIDER_P1, chipcHw_REG_PLL_PREDIVIDER_P2) * 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) >> 301 ((readl(&pChipcHw->PLLPreDivider2) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MASK) >>
302 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT); 302 chipcHw_REG_PLL_PREDIVIDER_NDIV_SHIFT);
303 303
304 switch (clock) { 304 switch (clock) {
@@ -307,8 +307,7 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu
307 { 307 {
308 REG_LOCAL_IRQ_SAVE; 308 REG_LOCAL_IRQ_SAVE;
309 /* Dvide DDR_phy by two to obtain DDR_ctrl clock */ 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) 310 writel((readl(&pChipcHw->DDRClock) & ~chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK) | ((((freq / 2) / chipcHw_getClockFrequency(chipcHw_CLOCK_BUS)) - 1) << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT), &pChipcHw->DDRClock);
311 << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT);
312 REG_LOCAL_IRQ_RESTORE; 311 REG_LOCAL_IRQ_RESTORE;
313 } 312 }
314 pPLLReg = &pChipcHw->DDRClock; 313 pPLLReg = &pChipcHw->DDRClock;
@@ -329,8 +328,7 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu
329 /* Configure the VPM:BUS ratio settings */ 328 /* Configure the VPM:BUS ratio settings */
330 { 329 {
331 REG_LOCAL_IRQ_SAVE; 330 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) 331 writel((readl(&pChipcHw->VPMClock) & ~chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_MASK) | ((chipcHw_divide (freq, chipcHw_getClockFrequency(chipcHw_CLOCK_BUS)) - 1) << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT), &pChipcHw->VPMClock);
333 << chipcHw_REG_PLL_CLOCK_TO_BUS_RATIO_SHIFT);
334 REG_LOCAL_IRQ_RESTORE; 332 REG_LOCAL_IRQ_RESTORE;
335 } 333 }
336 pPLLReg = &pChipcHw->VPMClock; 334 pPLLReg = &pChipcHw->VPMClock;
@@ -428,9 +426,9 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu
428 /* For DDR settings use only the PLL divider clock */ 426 /* For DDR settings use only the PLL divider clock */
429 if (pPLLReg == &pChipcHw->DDRClock) { 427 if (pPLLReg == &pChipcHw->DDRClock) {
430 /* Set M1DIV for PLL1, which controls the DDR clock */ 428 /* 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)); 429 reg32_write(&pChipcHw->PLLDivider, (readl(&pChipcHw->PLLDivider) & 0x00FFFFFF) | ((chipcHw_REG_PLL_DIVIDER_MDIV (desVcoHz, freq)) << 24));
432 /* Calculate expected frequency */ 430 /* Calculate expected frequency */
433 freq = chipcHw_divide(vcoHz, (((pChipcHw->PLLDivider & 0xFF000000) >> 24) ? ((pChipcHw->PLLDivider & 0xFF000000) >> 24) : 256)); 431 freq = chipcHw_divide(vcoHz, (((readl(&pChipcHw->PLLDivider) & 0xFF000000) >> 24) ? ((readl(&pChipcHw->PLLDivider) & 0xFF000000) >> 24) : 256));
434 } else { 432 } else {
435 /* From chip revision number B0, LCD clock is internally divided by 2 */ 433 /* From chip revision number B0, LCD clock is internally divided by 2 */
436 if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) { 434 if ((pPLLReg == &pChipcHw->LCDClock) && (chipcHw_getChipRevisionNumber() != chipcHw_REV_NUMBER_A0)) {
@@ -441,7 +439,7 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu
441 reg32_modify_and(pPLLReg, ~(chipcHw_REG_PLL_CLOCK_MDIV_MASK)); 439 reg32_modify_and(pPLLReg, ~(chipcHw_REG_PLL_CLOCK_MDIV_MASK));
442 reg32_modify_or(pPLLReg, chipcHw_REG_PLL_DIVIDER_MDIV(desVcoHz, freq)); 440 reg32_modify_or(pPLLReg, chipcHw_REG_PLL_DIVIDER_MDIV(desVcoHz, freq));
443 /* Calculate expected frequency */ 441 /* Calculate expected frequency */
444 freq = chipcHw_divide(vcoHz, ((*(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (*(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256)); 442 freq = chipcHw_divide(vcoHz, ((readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) ? (readl(pPLLReg) & chipcHw_REG_PLL_CLOCK_MDIV_MASK) : 256));
445 } 443 }
446 /* Wait for for atleast 200ns as per the protocol to change frequency */ 444 /* Wait for for atleast 200ns as per the protocol to change frequency */
447 udelay(1); 445 udelay(1);
@@ -460,16 +458,16 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu
460 if (pDependentClock) { 458 if (pDependentClock) {
461 switch (dependentClockType) { 459 switch (dependentClockType) {
462 case PLL_CLOCK: 460 case PLL_CLOCK:
463 divider = chipcHw_divide(chipcHw_divide (desVcoHz, (*pDependentClock & chipcHw_REG_PLL_CLOCK_MDIV_MASK)), freq); 461 divider = chipcHw_divide(chipcHw_divide (desVcoHz, (readl(pDependentClock) & chipcHw_REG_PLL_CLOCK_MDIV_MASK)), freq);
464 break; 462 break;
465 case NON_PLL_CLOCK: 463 case NON_PLL_CLOCK:
466 { 464 {
467 uint32_t sourceClock = 0; 465 uint32_t sourceClock = 0;
468 466
469 if (pDependentClock == (uint32_t *) &pChipcHw->ACLKClock) { 467 if (pDependentClock == &pChipcHw->ACLKClock) {
470 sourceClock = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS); 468 sourceClock = chipcHw_getClockFrequency (chipcHw_CLOCK_BUS);
471 } else { 469 } else {
472 uint32_t div = *pDependentClock & chipcHw_REG_DIV_CLOCK_DIV_MASK; 470 uint32_t div = readl(pDependentClock) & chipcHw_REG_DIV_CLOCK_DIV_MASK;
473 sourceClock = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, ((div) ? div : 256)); 471 sourceClock = chipcHw_divide (chipcHw_XTAL_FREQ_Hz, ((div) ? div : 256));
474 } 472 }
475 divider = chipcHw_divide(sourceClock, freq); 473 divider = chipcHw_divide(sourceClock, freq);
@@ -483,7 +481,7 @@ chipcHw_freq chipcHw_setClockFrequency(chipcHw_CLOCK_e clock, /* [ IN ] Configu
483 if (divider) { 481 if (divider) {
484 REG_LOCAL_IRQ_SAVE; 482 REG_LOCAL_IRQ_SAVE;
485 /* Set the divider to obtain the required frequency */ 483 /* 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); 484 writel((readl(pClockCtrl) & (~chipcHw_REG_DIV_CLOCK_DIV_MASK)) | (((divider > 256) ? chipcHw_REG_DIV_CLOCK_DIV_256 : divider) & chipcHw_REG_DIV_CLOCK_DIV_MASK), pClockCtrl);
487 REG_LOCAL_IRQ_RESTORE; 485 REG_LOCAL_IRQ_RESTORE;
488 return freq; 486 return freq;
489 } 487 }
@@ -515,25 +513,26 @@ static int vpmPhaseAlignA0(void)
515 int count = 0; 513 int count = 0;
516 514
517 for (iter = 0; (iter < MAX_PHASE_ALIGN_ATTEMPTS) && (adjustCount < MAX_PHASE_ADJUST_COUNT); iter++) { 515 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; 516 phaseControl = (readl(&pChipcHw->VPMClock) & chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT;
519 phaseValue = 0; 517 phaseValue = 0;
520 prevPhaseComp = 0; 518 prevPhaseComp = 0;
521 519
522 /* Step 1: Look for falling PH_COMP transition */ 520 /* Step 1: Look for falling PH_COMP transition */
523 521
524 /* Read the contents of VPM Clock resgister */ 522 /* Read the contents of VPM Clock resgister */
525 phaseValue = pChipcHw->VPMClock; 523 phaseValue = readl(&pChipcHw->VPMClock);
526 do { 524 do {
527 /* Store previous value of phase comparator */ 525 /* Store previous value of phase comparator */
528 prevPhaseComp = phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP; 526 prevPhaseComp = phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP;
529 /* Change the value of PH_CTRL. */ 527 /* 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)); 528 reg32_write(&pChipcHw->VPMClock,
529 (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
531 /* Wait atleast 20 ns */ 530 /* Wait atleast 20 ns */
532 udelay(1); 531 udelay(1);
533 /* Toggle the LOAD_CH after phase control is written. */ 532 /* Toggle the LOAD_CH after phase control is written. */
534 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; 533 writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock);
535 /* Read the contents of VPM Clock resgister. */ 534 /* Read the contents of VPM Clock resgister. */
536 phaseValue = pChipcHw->VPMClock; 535 phaseValue = readl(&pChipcHw->VPMClock);
537 536
538 if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) { 537 if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) {
539 phaseControl = (0x3F & (phaseControl - 1)); 538 phaseControl = (0x3F & (phaseControl - 1));
@@ -557,12 +556,13 @@ static int vpmPhaseAlignA0(void)
557 556
558 for (count = 0; (count < 5) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) { 557 for (count = 0; (count < 5) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) {
559 phaseControl = (0x3F & (phaseControl + 1)); 558 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)); 559 reg32_write(&pChipcHw->VPMClock,
560 (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
561 /* Wait atleast 20 ns */ 561 /* Wait atleast 20 ns */
562 udelay(1); 562 udelay(1);
563 /* Toggle the LOAD_CH after phase control is written. */ 563 /* Toggle the LOAD_CH after phase control is written. */
564 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; 564 writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock);
565 phaseValue = pChipcHw->VPMClock; 565 phaseValue = readl(&pChipcHw->VPMClock);
566 /* Count number of adjustment made */ 566 /* Count number of adjustment made */
567 adjustCount++; 567 adjustCount++;
568 } 568 }
@@ -581,12 +581,13 @@ static int vpmPhaseAlignA0(void)
581 581
582 for (count = 0; (count < 3) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) { 582 for (count = 0; (count < 3) && ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0); count++) {
583 phaseControl = (0x3F & (phaseControl - 1)); 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)); 584 reg32_write(&pChipcHw->VPMClock,
585 (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
585 /* Wait atleast 20 ns */ 586 /* Wait atleast 20 ns */
586 udelay(1); 587 udelay(1);
587 /* Toggle the LOAD_CH after phase control is written. */ 588 /* Toggle the LOAD_CH after phase control is written. */
588 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; 589 writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock);
589 phaseValue = pChipcHw->VPMClock; 590 phaseValue = readl(&pChipcHw->VPMClock);
590 /* Count number of adjustment made */ 591 /* Count number of adjustment made */
591 adjustCount++; 592 adjustCount++;
592 } 593 }
@@ -605,12 +606,13 @@ static int vpmPhaseAlignA0(void)
605 606
606 for (count = 0; (count < 5); count++) { 607 for (count = 0; (count < 5); count++) {
607 phaseControl = (0x3F & (phaseControl - 1)); 608 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 reg32_write(&pChipcHw->VPMClock,
610 (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
609 /* Wait atleast 20 ns */ 611 /* Wait atleast 20 ns */
610 udelay(1); 612 udelay(1);
611 /* Toggle the LOAD_CH after phase control is written. */ 613 /* Toggle the LOAD_CH after phase control is written. */
612 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; 614 writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock);
613 phaseValue = pChipcHw->VPMClock; 615 phaseValue = readl(&pChipcHw->VPMClock);
614 /* Count number of adjustment made */ 616 /* Count number of adjustment made */
615 adjustCount++; 617 adjustCount++;
616 } 618 }
@@ -631,14 +633,14 @@ static int vpmPhaseAlignA0(void)
631 /* Store previous value of phase comparator */ 633 /* Store previous value of phase comparator */
632 prevPhaseComp = phaseValue; 634 prevPhaseComp = phaseValue;
633 /* Change the value of PH_CTRL. */ 635 /* 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)); 636 reg32_write(&pChipcHw->VPMClock,
637 (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
635 /* Wait atleast 20 ns */ 638 /* Wait atleast 20 ns */
636 udelay(1); 639 udelay(1);
637 /* Toggle the LOAD_CH after phase control is written. */ 640 /* Toggle the LOAD_CH after phase control is written. */
638 pChipcHw->VPMClock ^= 641 writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock);
639 chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE;
640 /* Read the contents of VPM Clock resgister. */ 642 /* Read the contents of VPM Clock resgister. */
641 phaseValue = pChipcHw->VPMClock; 643 phaseValue = readl(&pChipcHw->VPMClock);
642 644
643 if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) { 645 if ((phaseValue & chipcHw_REG_PLL_CLOCK_PHASE_COMP) == 0x0) {
644 phaseControl = (0x3F & (phaseControl - 1)); 646 phaseControl = (0x3F & (phaseControl - 1));
@@ -661,13 +663,13 @@ static int vpmPhaseAlignA0(void)
661 } 663 }
662 664
663 /* For VPM Phase should be perfectly aligned. */ 665 /* For VPM Phase should be perfectly aligned. */
664 phaseControl = (((pChipcHw->VPMClock >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT) - 1) & 0x3F); 666 phaseControl = (((readl(&pChipcHw->VPMClock) >> chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT) - 1) & 0x3F);
665 { 667 {
666 REG_LOCAL_IRQ_SAVE; 668 REG_LOCAL_IRQ_SAVE;
667 669
668 pChipcHw->VPMClock = (pChipcHw->VPMClock & ~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT); 670 writel((readl(&pChipcHw->VPMClock) & ~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT), &pChipcHw->VPMClock);
669 /* Load new phase value */ 671 /* Load new phase value */
670 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; 672 writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock);
671 673
672 REG_LOCAL_IRQ_RESTORE; 674 REG_LOCAL_IRQ_RESTORE;
673 } 675 }
@@ -697,7 +699,7 @@ int chipcHw_vpmPhaseAlign(void)
697 int adjustCount = 0; 699 int adjustCount = 0;
698 700
699 /* Disable VPM access */ 701 /* Disable VPM access */
700 pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE; 702 writel(readl(&pChipcHw->Spare1) & ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE, &pChipcHw->Spare1);
701 /* Disable HW VPM phase alignment */ 703 /* Disable HW VPM phase alignment */
702 chipcHw_vpmHwPhaseAlignDisable(); 704 chipcHw_vpmHwPhaseAlignDisable();
703 /* Enable SW VPM phase alignment */ 705 /* Enable SW VPM phase alignment */
@@ -715,23 +717,24 @@ int chipcHw_vpmPhaseAlign(void)
715 phaseControl--; 717 phaseControl--;
716 } else { 718 } else {
717 /* Enable VPM access */ 719 /* Enable VPM access */
718 pChipcHw->Spare1 |= chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE; 720 writel(readl(&pChipcHw->Spare1) | chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE, &pChipcHw->Spare1);
719 /* Return adjust count */ 721 /* Return adjust count */
720 return adjustCount; 722 return adjustCount;
721 } 723 }
722 /* Change the value of PH_CTRL. */ 724 /* 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)); 725 reg32_write(&pChipcHw->VPMClock,
726 (readl(&pChipcHw->VPMClock) & (~chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_MASK)) | (phaseControl << chipcHw_REG_PLL_CLOCK_PHASE_CONTROL_SHIFT));
724 /* Wait atleast 20 ns */ 727 /* Wait atleast 20 ns */
725 udelay(1); 728 udelay(1);
726 /* Toggle the LOAD_CH after phase control is written. */ 729 /* Toggle the LOAD_CH after phase control is written. */
727 pChipcHw->VPMClock ^= chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE; 730 writel(readl(&pChipcHw->VPMClock) ^ chipcHw_REG_PLL_CLOCK_PHASE_UPDATE_ENABLE, &pChipcHw->VPMClock);
728 /* Count adjustment */ 731 /* Count adjustment */
729 adjustCount++; 732 adjustCount++;
730 } 733 }
731 } 734 }
732 735
733 /* Disable VPM access */ 736 /* Disable VPM access */
734 pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE; 737 writel(readl(&pChipcHw->Spare1) & ~chipcHw_REG_SPARE1_VPM_BUS_ACCESS_ENABLE, &pChipcHw->Spare1);
735 return -1; 738 return -1;
736} 739}
737 740
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c
index 367df75d4bb3..8377d8054168 100644
--- a/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c
+++ b/arch/arm/mach-bcmring/csp/chipc/chipcHw_init.c
@@ -26,15 +26,15 @@
26 26
27/* ---- Include Files ---------------------------------------------------- */ 27/* ---- Include Files ---------------------------------------------------- */
28 28
29#include <csp/errno.h> 29#include <linux/errno.h>
30#include <csp/stdint.h> 30#include <linux/types.h>
31#include <csp/module.h> 31#include <linux/export.h>
32 32
33#include <mach/csp/chipcHw_def.h> 33#include <mach/csp/chipcHw_def.h>
34#include <mach/csp/chipcHw_inline.h> 34#include <mach/csp/chipcHw_inline.h>
35 35
36#include <csp/reg.h> 36#include <mach/csp/reg.h>
37#include <csp/delay.h> 37#include <linux/delay.h>
38/* ---- Private Constants and Types --------------------------------------- */ 38/* ---- Private Constants and Types --------------------------------------- */
39 39
40/* 40/*
@@ -73,9 +73,9 @@ void chipcHw_pll2Enable(uint32_t vcoFreqHz)
73 73
74 { 74 {
75 REG_LOCAL_IRQ_SAVE; 75 REG_LOCAL_IRQ_SAVE;
76 pChipcHw->PLLConfig2 = 76 writel(chipcHw_REG_PLL_CONFIG_D_RESET |
77 chipcHw_REG_PLL_CONFIG_D_RESET | 77 chipcHw_REG_PLL_CONFIG_A_RESET,
78 chipcHw_REG_PLL_CONFIG_A_RESET; 78 &pChipcHw->PLLConfig2);
79 79
80 pllPreDivider2 = chipcHw_REG_PLL_PREDIVIDER_POWER_DOWN | 80 pllPreDivider2 = chipcHw_REG_PLL_PREDIVIDER_POWER_DOWN |
81 chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER | 81 chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER |
@@ -87,28 +87,30 @@ void chipcHw_pll2Enable(uint32_t vcoFreqHz)
87 chipcHw_REG_PLL_PREDIVIDER_P2_SHIFT); 87 chipcHw_REG_PLL_PREDIVIDER_P2_SHIFT);
88 88
89 /* Enable CHIPC registers to control the PLL */ 89 /* Enable CHIPC registers to control the PLL */
90 pChipcHw->PLLStatus |= chipcHw_REG_PLL_STATUS_CONTROL_ENABLE; 90 writel(readl(&pChipcHw->PLLStatus) | chipcHw_REG_PLL_STATUS_CONTROL_ENABLE, &pChipcHw->PLLStatus);
91 91
92 /* Set pre divider to get desired VCO frequency */ 92 /* Set pre divider to get desired VCO frequency */
93 pChipcHw->PLLPreDivider2 = pllPreDivider2; 93 writel(pllPreDivider2, &pChipcHw->PLLPreDivider2);
94 /* Set NDIV Frac */ 94 /* Set NDIV Frac */
95 pChipcHw->PLLDivider2 = chipcHw_REG_PLL_DIVIDER_NDIV_f; 95 writel(chipcHw_REG_PLL_DIVIDER_NDIV_f, &pChipcHw->PLLDivider2);
96 96
97 /* This has to be removed once the default values are fixed for PLL2. */ 97 /* This has to be removed once the default values are fixed for PLL2. */
98 pChipcHw->PLLControl12 = 0x38000700; 98 writel(0x38000700, &pChipcHw->PLLControl12);
99 pChipcHw->PLLControl22 = 0x00000015; 99 writel(0x00000015, &pChipcHw->PLLControl22);
100 100
101 /* Reset PLL2 */ 101 /* Reset PLL2 */
102 if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) { 102 if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) {
103 pChipcHw->PLLConfig2 = chipcHw_REG_PLL_CONFIG_D_RESET | 103 writel(chipcHw_REG_PLL_CONFIG_D_RESET |
104 chipcHw_REG_PLL_CONFIG_A_RESET | 104 chipcHw_REG_PLL_CONFIG_A_RESET |
105 chipcHw_REG_PLL_CONFIG_VCO_1601_3200 | 105 chipcHw_REG_PLL_CONFIG_VCO_1601_3200 |
106 chipcHw_REG_PLL_CONFIG_POWER_DOWN; 106 chipcHw_REG_PLL_CONFIG_POWER_DOWN,
107 &pChipcHw->PLLConfig2);
107 } else { 108 } else {
108 pChipcHw->PLLConfig2 = chipcHw_REG_PLL_CONFIG_D_RESET | 109 writel(chipcHw_REG_PLL_CONFIG_D_RESET |
109 chipcHw_REG_PLL_CONFIG_A_RESET | 110 chipcHw_REG_PLL_CONFIG_A_RESET |
110 chipcHw_REG_PLL_CONFIG_VCO_800_1600 | 111 chipcHw_REG_PLL_CONFIG_VCO_800_1600 |
111 chipcHw_REG_PLL_CONFIG_POWER_DOWN; 112 chipcHw_REG_PLL_CONFIG_POWER_DOWN,
113 &pChipcHw->PLLConfig2);
112 } 114 }
113 REG_LOCAL_IRQ_RESTORE; 115 REG_LOCAL_IRQ_RESTORE;
114 } 116 }
@@ -119,22 +121,25 @@ void chipcHw_pll2Enable(uint32_t vcoFreqHz)
119 { 121 {
120 REG_LOCAL_IRQ_SAVE; 122 REG_LOCAL_IRQ_SAVE;
121 /* Remove analog reset and Power on the PLL */ 123 /* Remove analog reset and Power on the PLL */
122 pChipcHw->PLLConfig2 &= 124 writel(readl(&pChipcHw->PLLConfig2) &
123 ~(chipcHw_REG_PLL_CONFIG_A_RESET | 125 ~(chipcHw_REG_PLL_CONFIG_A_RESET |
124 chipcHw_REG_PLL_CONFIG_POWER_DOWN); 126 chipcHw_REG_PLL_CONFIG_POWER_DOWN),
127 &pChipcHw->PLLConfig2);
125 128
126 REG_LOCAL_IRQ_RESTORE; 129 REG_LOCAL_IRQ_RESTORE;
127 130
128 } 131 }
129 132
130 /* Wait until PLL is locked */ 133 /* Wait until PLL is locked */
131 while (!(pChipcHw->PLLStatus2 & chipcHw_REG_PLL_STATUS_LOCKED)) 134 while (!(readl(&pChipcHw->PLLStatus2) & chipcHw_REG_PLL_STATUS_LOCKED))
132 ; 135 ;
133 136
134 { 137 {
135 REG_LOCAL_IRQ_SAVE; 138 REG_LOCAL_IRQ_SAVE;
136 /* Remove digital reset */ 139 /* Remove digital reset */
137 pChipcHw->PLLConfig2 &= ~chipcHw_REG_PLL_CONFIG_D_RESET; 140 writel(readl(&pChipcHw->PLLConfig2) &
141 ~chipcHw_REG_PLL_CONFIG_D_RESET,
142 &pChipcHw->PLLConfig2);
138 143
139 REG_LOCAL_IRQ_RESTORE; 144 REG_LOCAL_IRQ_RESTORE;
140 } 145 }
@@ -157,9 +162,9 @@ void chipcHw_pll1Enable(uint32_t vcoFreqHz, chipcHw_SPREAD_SPECTRUM_e ssSupport)
157 { 162 {
158 REG_LOCAL_IRQ_SAVE; 163 REG_LOCAL_IRQ_SAVE;
159 164
160 pChipcHw->PLLConfig = 165 writel(chipcHw_REG_PLL_CONFIG_D_RESET |
161 chipcHw_REG_PLL_CONFIG_D_RESET | 166 chipcHw_REG_PLL_CONFIG_A_RESET,
162 chipcHw_REG_PLL_CONFIG_A_RESET; 167 &pChipcHw->PLLConfig);
163 /* Setting VCO frequency */ 168 /* Setting VCO frequency */
164 if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) { 169 if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) {
165 pllPreDivider = 170 pllPreDivider =
@@ -182,30 +187,22 @@ void chipcHw_pll1Enable(uint32_t vcoFreqHz, chipcHw_SPREAD_SPECTRUM_e ssSupport)
182 } 187 }
183 188
184 /* Enable CHIPC registers to control the PLL */ 189 /* Enable CHIPC registers to control the PLL */
185 pChipcHw->PLLStatus |= chipcHw_REG_PLL_STATUS_CONTROL_ENABLE; 190 writel(readl(&pChipcHw->PLLStatus) | chipcHw_REG_PLL_STATUS_CONTROL_ENABLE, &pChipcHw->PLLStatus);
186 191
187 /* Set pre divider to get desired VCO frequency */ 192 /* Set pre divider to get desired VCO frequency */
188 pChipcHw->PLLPreDivider = pllPreDivider; 193 writel(pllPreDivider, &pChipcHw->PLLPreDivider);
189 /* Set NDIV Frac */ 194 /* Set NDIV Frac */
190 if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) { 195 if (ssSupport == chipcHw_SPREAD_SPECTRUM_ALLOW) {
191 pChipcHw->PLLDivider = chipcHw_REG_PLL_DIVIDER_M1DIV | 196 writel(chipcHw_REG_PLL_DIVIDER_M1DIV | chipcHw_REG_PLL_DIVIDER_NDIV_f_SS, &pChipcHw->PLLDivider);
192 chipcHw_REG_PLL_DIVIDER_NDIV_f_SS;
193 } else { 197 } else {
194 pChipcHw->PLLDivider = chipcHw_REG_PLL_DIVIDER_M1DIV | 198 writel(chipcHw_REG_PLL_DIVIDER_M1DIV | chipcHw_REG_PLL_DIVIDER_NDIV_f, &pChipcHw->PLLDivider);
195 chipcHw_REG_PLL_DIVIDER_NDIV_f;
196 } 199 }
197 200
198 /* Reset PLL1 */ 201 /* Reset PLL1 */
199 if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) { 202 if (vcoFreqHz > chipcHw_REG_PLL_CONFIG_VCO_SPLIT_FREQ) {
200 pChipcHw->PLLConfig = chipcHw_REG_PLL_CONFIG_D_RESET | 203 writel(chipcHw_REG_PLL_CONFIG_D_RESET | chipcHw_REG_PLL_CONFIG_A_RESET | chipcHw_REG_PLL_CONFIG_VCO_1601_3200 | chipcHw_REG_PLL_CONFIG_POWER_DOWN, &pChipcHw->PLLConfig);
201 chipcHw_REG_PLL_CONFIG_A_RESET |
202 chipcHw_REG_PLL_CONFIG_VCO_1601_3200 |
203 chipcHw_REG_PLL_CONFIG_POWER_DOWN;
204 } else { 204 } else {
205 pChipcHw->PLLConfig = chipcHw_REG_PLL_CONFIG_D_RESET | 205 writel(chipcHw_REG_PLL_CONFIG_D_RESET | chipcHw_REG_PLL_CONFIG_A_RESET | chipcHw_REG_PLL_CONFIG_VCO_800_1600 | chipcHw_REG_PLL_CONFIG_POWER_DOWN, &pChipcHw->PLLConfig);
206 chipcHw_REG_PLL_CONFIG_A_RESET |
207 chipcHw_REG_PLL_CONFIG_VCO_800_1600 |
208 chipcHw_REG_PLL_CONFIG_POWER_DOWN;
209 } 206 }
210 207
211 REG_LOCAL_IRQ_RESTORE; 208 REG_LOCAL_IRQ_RESTORE;
@@ -216,22 +213,19 @@ void chipcHw_pll1Enable(uint32_t vcoFreqHz, chipcHw_SPREAD_SPECTRUM_e ssSupport)
216 { 213 {
217 REG_LOCAL_IRQ_SAVE; 214 REG_LOCAL_IRQ_SAVE;
218 /* Remove analog reset and Power on the PLL */ 215 /* Remove analog reset and Power on the PLL */
219 pChipcHw->PLLConfig &= 216 writel(readl(&pChipcHw->PLLConfig) & ~(chipcHw_REG_PLL_CONFIG_A_RESET | chipcHw_REG_PLL_CONFIG_POWER_DOWN), &pChipcHw->PLLConfig);
220 ~(chipcHw_REG_PLL_CONFIG_A_RESET |
221 chipcHw_REG_PLL_CONFIG_POWER_DOWN);
222 REG_LOCAL_IRQ_RESTORE; 217 REG_LOCAL_IRQ_RESTORE;
223 } 218 }
224 219
225 /* Wait until PLL is locked */ 220 /* Wait until PLL is locked */
226 while (!(pChipcHw->PLLStatus & chipcHw_REG_PLL_STATUS_LOCKED) 221 while (!(readl(&pChipcHw->PLLStatus) & chipcHw_REG_PLL_STATUS_LOCKED)
227 || !(pChipcHw-> 222 || !(readl(&pChipcHw->PLLStatus2) & chipcHw_REG_PLL_STATUS_LOCKED))
228 PLLStatus2 & chipcHw_REG_PLL_STATUS_LOCKED))
229 ; 223 ;
230 224
231 /* Remove digital reset */ 225 /* Remove digital reset */
232 { 226 {
233 REG_LOCAL_IRQ_SAVE; 227 REG_LOCAL_IRQ_SAVE;
234 pChipcHw->PLLConfig &= ~chipcHw_REG_PLL_CONFIG_D_RESET; 228 writel(readl(&pChipcHw->PLLConfig) & ~chipcHw_REG_PLL_CONFIG_D_RESET, &pChipcHw->PLLConfig);
235 REG_LOCAL_IRQ_RESTORE; 229 REG_LOCAL_IRQ_RESTORE;
236 } 230 }
237 } 231 }
@@ -267,11 +261,7 @@ void chipcHw_Init(chipcHw_INIT_PARAM_t *initParam /* [ IN ] Misc chip initializ
267 chipcHw_clearStickyBits(chipcHw_REG_STICKY_CHIP_SOFT_RESET); 261 chipcHw_clearStickyBits(chipcHw_REG_STICKY_CHIP_SOFT_RESET);
268 262
269 /* Before configuring the ARM clock, atleast we need to make sure BUS clock maintains the proper ratio with ARM clock */ 263 /* Before configuring the ARM clock, atleast we need to make sure BUS clock maintains the proper ratio with ARM clock */
270 pChipcHw->ACLKClock = 264 writel((readl(&pChipcHw->ACLKClock) & ~chipcHw_REG_ACLKClock_CLK_DIV_MASK) | (initParam-> armBusRatio & chipcHw_REG_ACLKClock_CLK_DIV_MASK), &pChipcHw->ACLKClock);
271 (pChipcHw->
272 ACLKClock & ~chipcHw_REG_ACLKClock_CLK_DIV_MASK) | (initParam->
273 armBusRatio &
274 chipcHw_REG_ACLKClock_CLK_DIV_MASK);
275 265
276 /* Set various core component frequencies. The order in which this is done is important for some. */ 266 /* 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 */ 267 /* The RTBUS (DDR PHY) is derived from the BUS, and the BUS from the ARM, and VPM needs to know BUS */
diff --git a/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c b/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c
index 2671d8896bbb..f95ce913fa1e 100644
--- a/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c
+++ b/arch/arm/mach-bcmring/csp/chipc/chipcHw_reset.c
@@ -13,11 +13,11 @@
13*****************************************************************************/ 13*****************************************************************************/
14 14
15/* ---- Include Files ---------------------------------------------------- */ 15/* ---- Include Files ---------------------------------------------------- */
16#include <csp/stdint.h> 16#include <linux/types.h>
17#include <mach/csp/chipcHw_def.h> 17#include <mach/csp/chipcHw_def.h>
18#include <mach/csp/chipcHw_inline.h> 18#include <mach/csp/chipcHw_inline.h>
19#include <csp/intcHw.h> 19#include <mach/csp/intcHw_reg.h>
20#include <csp/cache.h> 20#include <asm/cacheflush.h>
21 21
22/* ---- Private Constants and Types --------------------------------------- */ 22/* ---- Private Constants and Types --------------------------------------- */
23/* ---- Private Variables ------------------------------------------------- */ 23/* ---- Private Variables ------------------------------------------------- */
@@ -50,17 +50,18 @@ void chipcHw_reset(uint32_t mask)
50 chipcHw_softReset(chipcHw_REG_SOFT_RESET_CHIP_SOFT); 50 chipcHw_softReset(chipcHw_REG_SOFT_RESET_CHIP_SOFT);
51 } 51 }
52 /* Bypass the PLL clocks before reboot */ 52 /* Bypass the PLL clocks before reboot */
53 pChipcHw->UARTClock |= chipcHw_REG_PLL_CLOCK_BYPASS_SELECT; 53 writel(readl(&pChipcHw->UARTClock) | chipcHw_REG_PLL_CLOCK_BYPASS_SELECT,
54 pChipcHw->SPIClock |= chipcHw_REG_PLL_CLOCK_BYPASS_SELECT; 54 &pChipcHw->UARTClock);
55 writel(readl(&pChipcHw->SPIClock) | chipcHw_REG_PLL_CLOCK_BYPASS_SELECT,
56 &pChipcHw->SPIClock);
55 57
56 /* Copy the chipcHw_warmReset_run_from_aram function into ARAM */ 58 /* Copy the chipcHw_warmReset_run_from_aram function into ARAM */
57 do { 59 do {
58 ((uint32_t *) MM_IO_BASE_ARAM)[i] = 60 writel(((uint32_t *) &chipcHw_reset_run_from_aram)[i], ((uint32_t __iomem *) MM_IO_BASE_ARAM) + i);
59 ((uint32_t *) &chipcHw_reset_run_from_aram)[i];
60 i++; 61 i++;
61 } while (((uint32_t *) MM_IO_BASE_ARAM)[i - 1] != 0xe1a0f00f); /* 0xe1a0f00f == asm ("mov r15, r15"); */ 62 } while (readl(((uint32_t __iomem*) MM_IO_BASE_ARAM) + i - 1) != 0xe1a0f00f); /* 0xe1a0f00f == asm ("mov r15, r15"); */
62 63
63 CSP_CACHE_FLUSH_ALL; 64 flush_cache_all();
64 65
65 /* run the function from ARAM */ 66 /* run the function from ARAM */
66 runFunc(); 67 runFunc();
diff --git a/arch/arm/mach-bcmring/csp/dmac/dmacHw.c b/arch/arm/mach-bcmring/csp/dmac/dmacHw.c
index 6b9be2e98e51..547f746c7ff4 100644
--- a/arch/arm/mach-bcmring/csp/dmac/dmacHw.c
+++ b/arch/arm/mach-bcmring/csp/dmac/dmacHw.c
@@ -25,11 +25,11 @@
25/****************************************************************************/ 25/****************************************************************************/
26 26
27/* ---- Include Files ---------------------------------------------------- */ 27/* ---- Include Files ---------------------------------------------------- */
28#include <csp/stdint.h> 28#include <linux/types.h>
29#include <csp/string.h> 29#include <linux/string.h>
30#include <stddef.h> 30#include <linux/stddef.h>
31 31
32#include <csp/dmacHw.h> 32#include <mach/csp/dmacHw.h>
33#include <mach/csp/dmacHw_reg.h> 33#include <mach/csp/dmacHw_reg.h>
34#include <mach/csp/dmacHw_priv.h> 34#include <mach/csp/dmacHw_priv.h>
35#include <mach/csp/chipcHw_inline.h> 35#include <mach/csp/chipcHw_inline.h>
@@ -55,33 +55,32 @@ static uint32_t GetFifoSize(dmacHw_HANDLE_t handle /* [ IN ] DMA Channel handl
55 ) { 55 ) {
56 uint32_t val = 0; 56 uint32_t val = 0;
57 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle); 57 dmacHw_CBLK_t *pCblk = dmacHw_HANDLE_TO_CBLK(handle);
58 dmacHw_MISC_t *pMiscReg = 58 dmacHw_MISC_t __iomem *pMiscReg = (void __iomem *)dmacHw_REG_MISC_BASE(pCblk->module);
59 (dmacHw_MISC_t *) dmacHw_REG_MISC_BASE(pCblk->module);
60 59
61 switch (pCblk->channel) { 60 switch (pCblk->channel) {
62 case 0: 61 case 0:
63 val = (pMiscReg->CompParm2.lo & 0x70000000) >> 28; 62 val = (readl(&pMiscReg->CompParm2.lo) & 0x70000000) >> 28;
64 break; 63 break;
65 case 1: 64 case 1:
66 val = (pMiscReg->CompParm3.hi & 0x70000000) >> 28; 65 val = (readl(&pMiscReg->CompParm3.hi) & 0x70000000) >> 28;
67 break; 66 break;
68 case 2: 67 case 2:
69 val = (pMiscReg->CompParm3.lo & 0x70000000) >> 28; 68 val = (readl(&pMiscReg->CompParm3.lo) & 0x70000000) >> 28;
70 break; 69 break;
71 case 3: 70 case 3:
72 val = (pMiscReg->CompParm4.hi & 0x70000000) >> 28; 71 val = (readl(&pMiscReg->CompParm4.hi) & 0x70000000) >> 28;
73 break; 72 break;
74 case 4: 73 case 4:
75 val = (pMiscReg->CompParm4.lo & 0x70000000) >> 28; 74 val = (readl(&pMiscReg->CompParm4.lo) & 0x70000000) >> 28;
76 break; 75 break;
77 case 5: 76 case 5:
78 val = (pMiscReg->CompParm5.hi & 0x70000000) >> 28; 77 val = (readl(&pMiscReg->CompParm5.hi) & 0x70000000) >> 28;
79 break; 78 break;
80 case 6: 79 case 6:
81 val = (pMiscReg->CompParm5.lo & 0x70000000) >> 28; 80 val = (readl(&pMiscReg->CompParm5.lo) & 0x70000000) >> 28;
82 break; 81 break;
83 case 7: 82 case 7:
84 val = (pMiscReg->CompParm6.hi & 0x70000000) >> 28; 83 val = (readl(&pMiscReg->CompParm6.hi) & 0x70000000) >> 28;
85 break; 84 break;
86 } 85 }
87 86
diff --git a/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c b/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c
index a1f328357aa4..fe438699d11e 100644
--- a/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c
+++ b/arch/arm/mach-bcmring/csp/dmac/dmacHw_extra.c
@@ -26,10 +26,10 @@
26 26
27/* ---- Include Files ---------------------------------------------------- */ 27/* ---- Include Files ---------------------------------------------------- */
28 28
29#include <csp/stdint.h> 29#include <linux/types.h>
30#include <stddef.h> 30#include <linux/stddef.h>
31 31
32#include <csp/dmacHw.h> 32#include <mach/csp/dmacHw.h>
33#include <mach/csp/dmacHw_reg.h> 33#include <mach/csp/dmacHw_reg.h>
34#include <mach/csp/dmacHw_priv.h> 34#include <mach/csp/dmacHw_priv.h>
35 35
diff --git a/arch/arm/mach-bcmring/csp/tmr/tmrHw.c b/arch/arm/mach-bcmring/csp/tmr/tmrHw.c
index 16225e43f3c3..dc4137ff75ca 100644
--- a/arch/arm/mach-bcmring/csp/tmr/tmrHw.c
+++ b/arch/arm/mach-bcmring/csp/tmr/tmrHw.c
@@ -26,10 +26,10 @@
26 26
27/* ---- Include Files ---------------------------------------------------- */ 27/* ---- Include Files ---------------------------------------------------- */
28 28
29#include <csp/errno.h> 29#include <linux/errno.h>
30#include <csp/stdint.h> 30#include <linux/types.h>
31 31
32#include <csp/tmrHw.h> 32#include <mach/csp/tmrHw.h>
33#include <mach/csp/tmrHw_reg.h> 33#include <mach/csp/tmrHw_reg.h>
34 34
35#define tmrHw_ASSERT(a) if (!(a)) *(char *)0 = 0 35#define tmrHw_ASSERT(a) if (!(a)) *(char *)0 = 0
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 f01da877148e..000000000000
--- 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/csp/cache.h b/arch/arm/mach-bcmring/include/csp/cache.h
deleted file mode 100644
index caa20e59db99..000000000000
--- 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 8b3d80367293..000000000000
--- 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/errno.h b/arch/arm/mach-bcmring/include/csp/errno.h
deleted file mode 100644
index 51357dd5b666..000000000000
--- 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 1c639c8ee08f..000000000000
--- 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 c30d2a5975a6..000000000000
--- 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/secHw.h b/arch/arm/mach-bcmring/include/csp/secHw.h
deleted file mode 100644
index b9d7e0732dfc..000000000000
--- 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 3a8718bbf700..000000000000
--- 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 ad9e4005f141..000000000000
--- 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/cfg_global_defines.h b/arch/arm/mach-bcmring/include/mach/cfg_global.h
index b5beb0b30734..449133eacdf5 100644
--- a/arch/arm/mach-bcmring/include/cfg_global_defines.h
+++ b/arch/arm/mach-bcmring/include/mach/cfg_global.h
@@ -38,3 +38,14 @@
38 38
39#define IMAGE_HEADER_SIZE_CHECKSUM 4 39#define IMAGE_HEADER_SIZE_CHECKSUM 4
40#endif 40#endif
41#ifndef _CFG_GLOBAL_H_
42#define _CFG_GLOBAL_H_
43
44#define CFG_GLOBAL_CHIP BCM11107
45#define CFG_GLOBAL_CHIP_FAMILY CFG_GLOBAL_CHIP_FAMILY_BCMRING
46#define CFG_GLOBAL_CHIP_REV 0xB0
47#define CFG_GLOBAL_RAM_SIZE 0x10000000
48#define CFG_GLOBAL_RAM_BASE 0x00000000
49#define CFG_GLOBAL_RAM_RESERVED_SIZE 0x000000
50
51#endif /* _CFG_GLOBAL_H_ */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h b/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h
index 933ce68ed90b..0a89e0c63419 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/cap_inline.h
@@ -17,7 +17,7 @@
17 17
18/* ---- Include Files ---------------------------------------------------- */ 18/* ---- Include Files ---------------------------------------------------- */
19#include <mach/csp/cap.h> 19#include <mach/csp/cap.h>
20#include <cfg_global.h> 20#include <mach/cfg_global.h>
21 21
22/* ---- Public Constants and Types --------------------------------------- */ 22/* ---- Public Constants and Types --------------------------------------- */
23#define CAP_CONFIG0_VPM_DIS 0x00000001 23#define CAP_CONFIG0_VPM_DIS 0x00000001
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h
index 161973385faf..39f09cb89208 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_def.h
@@ -17,9 +17,9 @@
17 17
18/* ---- Include Files ----------------------------------------------------- */ 18/* ---- Include Files ----------------------------------------------------- */
19 19
20#include <csp/stdint.h> 20#include <linux/types.h>
21#include <csp/errno.h> 21#include <linux/errno.h>
22#include <csp/reg.h> 22#include <mach/csp/reg.h>
23#include <mach/csp/chipcHw_reg.h> 23#include <mach/csp/chipcHw_reg.h>
24 24
25/* ---- Public Constants and Types ---------------------------------------- */ 25/* ---- Public Constants and Types ---------------------------------------- */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h
index 03238c299001..a66f3f7abb86 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_inline.h
@@ -17,8 +17,8 @@
17 17
18/* ---- Include Files ----------------------------------------------------- */ 18/* ---- Include Files ----------------------------------------------------- */
19 19
20#include <csp/errno.h> 20#include <linux/errno.h>
21#include <csp/reg.h> 21#include <mach/csp/reg.h>
22#include <mach/csp/chipcHw_reg.h> 22#include <mach/csp/chipcHw_reg.h>
23#include <mach/csp/chipcHw_def.h> 23#include <mach/csp/chipcHw_def.h>
24 24
@@ -47,7 +47,7 @@ static inline void chipcHw_setClock(chipcHw_CLOCK_e clock,
47/****************************************************************************/ 47/****************************************************************************/
48static inline uint32_t chipcHw_getChipId(void) 48static inline uint32_t chipcHw_getChipId(void)
49{ 49{
50 return pChipcHw->ChipId; 50 return readl(&pChipcHw->ChipId);
51} 51}
52 52
53/****************************************************************************/ 53/****************************************************************************/
@@ -59,15 +59,16 @@ static inline uint32_t chipcHw_getChipId(void)
59/****************************************************************************/ 59/****************************************************************************/
60static inline void chipcHw_enableSpreadSpectrum(void) 60static inline void chipcHw_enableSpreadSpectrum(void)
61{ 61{
62 if ((pChipcHw-> 62 if ((readl(&pChipcHw->
63 PLLPreDivider & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) != 63 PLLPreDivider) & chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_MASK) !=
64 chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) { 64 chipcHw_REG_PLL_PREDIVIDER_NDIV_MODE_INTEGER) {
65 ddrcReg_PHY_ADDR_CTL_REGP->ssCfg = 65 writel((0xFFFF << ddrcReg_PHY_ADDR_SS_CFG_NDIV_AMPLITUDE_SHIFT) |
66 (0xFFFF << ddrcReg_PHY_ADDR_SS_CFG_NDIV_AMPLITUDE_SHIFT) |
67 (ddrcReg_PHY_ADDR_SS_CFG_MIN_CYCLE_PER_TICK << 66 (ddrcReg_PHY_ADDR_SS_CFG_MIN_CYCLE_PER_TICK <<
68 ddrcReg_PHY_ADDR_SS_CFG_CYCLE_PER_TICK_SHIFT); 67 ddrcReg_PHY_ADDR_SS_CFG_CYCLE_PER_TICK_SHIFT),
69 ddrcReg_PHY_ADDR_CTL_REGP->ssCtl |= 68 &ddrcReg_PHY_ADDR_CTL_REGP->ssCfg);
70 ddrcReg_PHY_ADDR_SS_CTRL_ENABLE; 69 writel(readl(&ddrcReg_PHY_ADDR_CTL_REGP->ssCtl) |
70 ddrcReg_PHY_ADDR_SS_CTRL_ENABLE,
71 &ddrcReg_PHY_ADDR_CTL_REGP->ssCtl);
71 } 72 }
72} 73}
73 74
@@ -93,8 +94,8 @@ static inline void chipcHw_disableSpreadSpectrum(void)
93/****************************************************************************/ 94/****************************************************************************/
94static inline uint32_t chipcHw_getChipProductId(void) 95static inline uint32_t chipcHw_getChipProductId(void)
95{ 96{
96 return (pChipcHw-> 97 return (readl(&pChipcHw->
97 ChipId & chipcHw_REG_CHIPID_BASE_MASK) >> 98 ChipId) & chipcHw_REG_CHIPID_BASE_MASK) >>
98 chipcHw_REG_CHIPID_BASE_SHIFT; 99 chipcHw_REG_CHIPID_BASE_SHIFT;
99} 100}
100 101
@@ -109,7 +110,7 @@ static inline uint32_t chipcHw_getChipProductId(void)
109/****************************************************************************/ 110/****************************************************************************/
110static inline chipcHw_REV_NUMBER_e chipcHw_getChipRevisionNumber(void) 111static inline chipcHw_REV_NUMBER_e chipcHw_getChipRevisionNumber(void)
111{ 112{
112 return pChipcHw->ChipId & chipcHw_REG_CHIPID_REV_MASK; 113 return readl(&pChipcHw->ChipId) & chipcHw_REG_CHIPID_REV_MASK;
113} 114}
114 115
115/****************************************************************************/ 116/****************************************************************************/
@@ -156,7 +157,7 @@ static inline void chipcHw_busInterfaceClockDisable(uint32_t mask)
156/****************************************************************************/ 157/****************************************************************************/
157static inline uint32_t chipcHw_getBusInterfaceClockStatus(void) 158static inline uint32_t chipcHw_getBusInterfaceClockStatus(void)
158{ 159{
159 return pChipcHw->BusIntfClock; 160 return readl(&pChipcHw->BusIntfClock);
160} 161}
161 162
162/****************************************************************************/ 163/****************************************************************************/
@@ -215,8 +216,9 @@ static inline void chipcHw_softResetDisable(uint64_t mask)
215 216
216 /* Deassert module soft reset */ 217 /* Deassert module soft reset */
217 REG_LOCAL_IRQ_SAVE; 218 REG_LOCAL_IRQ_SAVE;
218 pChipcHw->SoftReset1 ^= ctrl1; 219 writel(readl(&pChipcHw->SoftReset1) ^ ctrl1, &pChipcHw->SoftReset1);
219 pChipcHw->SoftReset2 ^= (ctrl2 & (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK)); 220 writel(readl(&pChipcHw->SoftReset2) ^ (ctrl2 &
221 (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK)), &pChipcHw->SoftReset2);
220 REG_LOCAL_IRQ_RESTORE; 222 REG_LOCAL_IRQ_RESTORE;
221} 223}
222 224
@@ -227,9 +229,10 @@ static inline void chipcHw_softResetEnable(uint64_t mask)
227 uint32_t unhold = 0; 229 uint32_t unhold = 0;
228 230
229 REG_LOCAL_IRQ_SAVE; 231 REG_LOCAL_IRQ_SAVE;
230 pChipcHw->SoftReset1 |= ctrl1; 232 writel(readl(&pChipcHw->SoftReset1) | ctrl1, &pChipcHw->SoftReset1);
231 /* Mask out unhold request bits */ 233 /* Mask out unhold request bits */
232 pChipcHw->SoftReset2 |= (ctrl2 & (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK)); 234 writel(readl(&pChipcHw->SoftReset2) | (ctrl2 &
235 (~chipcHw_REG_SOFT_RESET_UNHOLD_MASK)), &pChipcHw->SoftReset2);
233 236
234 /* Process unhold requests */ 237 /* Process unhold requests */
235 if (ctrl2 & chipcHw_REG_SOFT_RESET_VPM_GLOBAL_UNHOLD) { 238 if (ctrl2 & chipcHw_REG_SOFT_RESET_VPM_GLOBAL_UNHOLD) {
@@ -246,7 +249,7 @@ static inline void chipcHw_softResetEnable(uint64_t mask)
246 249
247 if (unhold) { 250 if (unhold) {
248 /* Make sure unhold request is effective */ 251 /* Make sure unhold request is effective */
249 pChipcHw->SoftReset1 &= ~unhold; 252 writel(readl(&pChipcHw->SoftReset1) & ~unhold, &pChipcHw->SoftReset1);
250 } 253 }
251 REG_LOCAL_IRQ_RESTORE; 254 REG_LOCAL_IRQ_RESTORE;
252} 255}
@@ -307,7 +310,7 @@ static inline void chipcHw_setOTPOption(uint64_t mask)
307/****************************************************************************/ 310/****************************************************************************/
308static inline uint32_t chipcHw_getStickyBits(void) 311static inline uint32_t chipcHw_getStickyBits(void)
309{ 312{
310 return pChipcHw->Sticky; 313 return readl(&pChipcHw->Sticky);
311} 314}
312 315
313/****************************************************************************/ 316/****************************************************************************/
@@ -328,7 +331,7 @@ static inline void chipcHw_setStickyBits(uint32_t mask)
328 bits |= chipcHw_REG_STICKY_POR_BROM; 331 bits |= chipcHw_REG_STICKY_POR_BROM;
329 } else { 332 } else {
330 uint32_t sticky; 333 uint32_t sticky;
331 sticky = pChipcHw->Sticky; 334 sticky = readl(pChipcHw->Sticky);
332 335
333 if ((mask & chipcHw_REG_STICKY_BOOT_DONE) 336 if ((mask & chipcHw_REG_STICKY_BOOT_DONE)
334 && (sticky & chipcHw_REG_STICKY_BOOT_DONE) == 0) { 337 && (sticky & chipcHw_REG_STICKY_BOOT_DONE) == 0) {
@@ -355,7 +358,7 @@ static inline void chipcHw_setStickyBits(uint32_t mask)
355 bits |= chipcHw_REG_STICKY_GENERAL_5; 358 bits |= chipcHw_REG_STICKY_GENERAL_5;
356 } 359 }
357 } 360 }
358 pChipcHw->Sticky = bits; 361 writel(bits, pChipcHw->Sticky);
359 REG_LOCAL_IRQ_RESTORE; 362 REG_LOCAL_IRQ_RESTORE;
360} 363}
361 364
@@ -377,7 +380,7 @@ static inline void chipcHw_clearStickyBits(uint32_t mask)
377 (chipcHw_REG_STICKY_BOOT_DONE | chipcHw_REG_STICKY_GENERAL_1 | 380 (chipcHw_REG_STICKY_BOOT_DONE | chipcHw_REG_STICKY_GENERAL_1 |
378 chipcHw_REG_STICKY_GENERAL_2 | chipcHw_REG_STICKY_GENERAL_3 | 381 chipcHw_REG_STICKY_GENERAL_2 | chipcHw_REG_STICKY_GENERAL_3 |
379 chipcHw_REG_STICKY_GENERAL_4 | chipcHw_REG_STICKY_GENERAL_5)) { 382 chipcHw_REG_STICKY_GENERAL_4 | chipcHw_REG_STICKY_GENERAL_5)) {
380 uint32_t sticky = pChipcHw->Sticky; 383 uint32_t sticky = readl(&pChipcHw->Sticky);
381 384
382 if ((mask & chipcHw_REG_STICKY_BOOT_DONE) 385 if ((mask & chipcHw_REG_STICKY_BOOT_DONE)
383 && (sticky & chipcHw_REG_STICKY_BOOT_DONE)) { 386 && (sticky & chipcHw_REG_STICKY_BOOT_DONE)) {
@@ -410,7 +413,7 @@ static inline void chipcHw_clearStickyBits(uint32_t mask)
410 mask &= ~chipcHw_REG_STICKY_GENERAL_5; 413 mask &= ~chipcHw_REG_STICKY_GENERAL_5;
411 } 414 }
412 } 415 }
413 pChipcHw->Sticky = bits | mask; 416 writel(bits | mask, &pChipcHw->Sticky);
414 REG_LOCAL_IRQ_RESTORE; 417 REG_LOCAL_IRQ_RESTORE;
415} 418}
416 419
@@ -426,7 +429,7 @@ static inline void chipcHw_clearStickyBits(uint32_t mask)
426/****************************************************************************/ 429/****************************************************************************/
427static inline uint32_t chipcHw_getSoftStraps(void) 430static inline uint32_t chipcHw_getSoftStraps(void)
428{ 431{
429 return pChipcHw->SoftStraps; 432 return readl(&pChipcHw->SoftStraps);
430} 433}
431 434
432/****************************************************************************/ 435/****************************************************************************/
@@ -456,7 +459,7 @@ static inline void chipcHw_setSoftStraps(uint32_t strapOptions)
456/****************************************************************************/ 459/****************************************************************************/
457static inline uint32_t chipcHw_getPinStraps(void) 460static inline uint32_t chipcHw_getPinStraps(void)
458{ 461{
459 return pChipcHw->PinStraps; 462 return readl(&pChipcHw->PinStraps);
460} 463}
461 464
462/****************************************************************************/ 465/****************************************************************************/
@@ -671,9 +674,9 @@ static inline void chipcHw_selectGE3(void)
671/****************************************************************************/ 674/****************************************************************************/
672static inline chipcHw_GPIO_FUNCTION_e chipcHw_getGpioPinFunction(int pin) 675static inline chipcHw_GPIO_FUNCTION_e chipcHw_getGpioPinFunction(int pin)
673{ 676{
674 return (*((uint32_t *) chipcHw_REG_GPIO_MUX(pin)) & 677 return (readl(chipcHw_REG_GPIO_MUX(pin))) &
675 (chipcHw_REG_GPIO_MUX_MASK << 678 (chipcHw_REG_GPIO_MUX_MASK <<
676 chipcHw_REG_GPIO_MUX_POSITION(pin))) >> 679 chipcHw_REG_GPIO_MUX_POSITION(pin)) >>
677 chipcHw_REG_GPIO_MUX_POSITION(pin); 680 chipcHw_REG_GPIO_MUX_POSITION(pin);
678} 681}
679 682
@@ -841,8 +844,8 @@ static inline void chipcHw_setUsbDevice(void)
841static inline void chipcHw_setClock(chipcHw_CLOCK_e clock, 844static inline void chipcHw_setClock(chipcHw_CLOCK_e clock,
842 chipcHw_OPTYPE_e type, int mode) 845 chipcHw_OPTYPE_e type, int mode)
843{ 846{
844 volatile uint32_t *pPLLReg = (uint32_t *) 0x0; 847 uint32_t __iomem *pPLLReg = NULL;
845 volatile uint32_t *pClockCtrl = (uint32_t *) 0x0; 848 uint32_t __iomem *pClockCtrl = NULL;
846 849
847 switch (clock) { 850 switch (clock) {
848 case chipcHw_CLOCK_DDR: 851 case chipcHw_CLOCK_DDR:
@@ -1071,7 +1074,7 @@ static inline void chipcHw_bypassClockDisable(chipcHw_CLOCK_e clock)
1071/****************************************************************************/ 1074/****************************************************************************/
1072static inline int chipcHw_isSoftwareStrapsEnable(void) 1075static inline int chipcHw_isSoftwareStrapsEnable(void)
1073{ 1076{
1074 return pChipcHw->SoftStraps & 0x00000001; 1077 return readl(&pChipcHw->SoftStraps) & 0x00000001;
1075} 1078}
1076 1079
1077/****************************************************************************/ 1080/****************************************************************************/
@@ -1138,7 +1141,7 @@ static inline void chipcHw_pll2TestDisable(void)
1138/****************************************************************************/ 1141/****************************************************************************/
1139static inline int chipcHw_isPllTestEnable(void) 1142static inline int chipcHw_isPllTestEnable(void)
1140{ 1143{
1141 return pChipcHw->PLLConfig & chipcHw_REG_PLL_CONFIG_TEST_ENABLE; 1144 return readl(&pChipcHw->PLLConfig) & chipcHw_REG_PLL_CONFIG_TEST_ENABLE;
1142} 1145}
1143 1146
1144/****************************************************************************/ 1147/****************************************************************************/
@@ -1147,7 +1150,7 @@ static inline int chipcHw_isPllTestEnable(void)
1147/****************************************************************************/ 1150/****************************************************************************/
1148static inline int chipcHw_isPll2TestEnable(void) 1151static inline int chipcHw_isPll2TestEnable(void)
1149{ 1152{
1150 return pChipcHw->PLLConfig2 & chipcHw_REG_PLL_CONFIG_TEST_ENABLE; 1153 return readl(&pChipcHw->PLLConfig2) & chipcHw_REG_PLL_CONFIG_TEST_ENABLE;
1151} 1154}
1152 1155
1153/****************************************************************************/ 1156/****************************************************************************/
@@ -1183,8 +1186,8 @@ static inline void chipcHw_pll2TestSelect(uint32_t val)
1183/****************************************************************************/ 1186/****************************************************************************/
1184static inline uint8_t chipcHw_getPllTestSelected(void) 1187static inline uint8_t chipcHw_getPllTestSelected(void)
1185{ 1188{
1186 return (uint8_t) ((pChipcHw-> 1189 return (uint8_t) ((readl(&pChipcHw->
1187 PLLConfig & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK) 1190 PLLConfig) & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK)
1188 >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT); 1191 >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT);
1189} 1192}
1190 1193
@@ -1194,8 +1197,8 @@ static inline uint8_t chipcHw_getPllTestSelected(void)
1194/****************************************************************************/ 1197/****************************************************************************/
1195static inline uint8_t chipcHw_getPll2TestSelected(void) 1198static inline uint8_t chipcHw_getPll2TestSelected(void)
1196{ 1199{
1197 return (uint8_t) ((pChipcHw-> 1200 return (uint8_t) ((readl(&pChipcHw->
1198 PLLConfig2 & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK) 1201 PLLConfig2) & chipcHw_REG_PLL_CONFIG_TEST_SELECT_MASK)
1199 >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT); 1202 >> chipcHw_REG_PLL_CONFIG_TEST_SELECT_SHIFT);
1200} 1203}
1201 1204
@@ -1208,7 +1211,8 @@ static inline uint8_t chipcHw_getPll2TestSelected(void)
1208static inline void chipcHw_pll1Disable(void) 1211static inline void chipcHw_pll1Disable(void)
1209{ 1212{
1210 REG_LOCAL_IRQ_SAVE; 1213 REG_LOCAL_IRQ_SAVE;
1211 pChipcHw->PLLConfig |= chipcHw_REG_PLL_CONFIG_POWER_DOWN; 1214 writel(readl(&pChipcHw->PLLConfig) | chipcHw_REG_PLL_CONFIG_POWER_DOWN,
1215 &pChipcHw->PLLConfig);
1212 REG_LOCAL_IRQ_RESTORE; 1216 REG_LOCAL_IRQ_RESTORE;
1213} 1217}
1214 1218
@@ -1221,7 +1225,8 @@ static inline void chipcHw_pll1Disable(void)
1221static inline void chipcHw_pll2Disable(void) 1225static inline void chipcHw_pll2Disable(void)
1222{ 1226{
1223 REG_LOCAL_IRQ_SAVE; 1227 REG_LOCAL_IRQ_SAVE;
1224 pChipcHw->PLLConfig2 |= chipcHw_REG_PLL_CONFIG_POWER_DOWN; 1228 writel(readl(&pChipcHw->PLLConfig2) | chipcHw_REG_PLL_CONFIG_POWER_DOWN,
1229 &pChipcHw->PLLConfig2);
1225 REG_LOCAL_IRQ_RESTORE; 1230 REG_LOCAL_IRQ_RESTORE;
1226} 1231}
1227 1232
@@ -1233,7 +1238,8 @@ static inline void chipcHw_pll2Disable(void)
1233static inline void chipcHw_ddrPhaseAlignInterruptEnable(void) 1238static inline void chipcHw_ddrPhaseAlignInterruptEnable(void)
1234{ 1239{
1235 REG_LOCAL_IRQ_SAVE; 1240 REG_LOCAL_IRQ_SAVE;
1236 pChipcHw->Spare1 |= chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE; 1241 writel(readl(&pChipcHw->Spare1) | chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE,
1242 &pChipcHw->Spare1);
1237 REG_LOCAL_IRQ_RESTORE; 1243 REG_LOCAL_IRQ_RESTORE;
1238} 1244}
1239 1245
@@ -1245,7 +1251,8 @@ static inline void chipcHw_ddrPhaseAlignInterruptEnable(void)
1245static inline void chipcHw_ddrPhaseAlignInterruptDisable(void) 1251static inline void chipcHw_ddrPhaseAlignInterruptDisable(void)
1246{ 1252{
1247 REG_LOCAL_IRQ_SAVE; 1253 REG_LOCAL_IRQ_SAVE;
1248 pChipcHw->Spare1 &= ~chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE; 1254 writel(readl(&pChipcHw->Spare1) & ~chipcHw_REG_SPARE1_DDR_PHASE_INTR_ENABLE,
1255 &pChipcHw->Spare1);
1249 REG_LOCAL_IRQ_RESTORE; 1256 REG_LOCAL_IRQ_RESTORE;
1250} 1257}
1251 1258
@@ -1333,7 +1340,8 @@ static inline void chipcHw_ddrHwPhaseAlignDisable(void)
1333static inline void chipcHw_vpmSwPhaseAlignEnable(void) 1340static inline void chipcHw_vpmSwPhaseAlignEnable(void)
1334{ 1341{
1335 REG_LOCAL_IRQ_SAVE; 1342 REG_LOCAL_IRQ_SAVE;
1336 pChipcHw->VPMPhaseCtrl1 |= chipcHw_REG_VPM_SW_PHASE_CTRL_ENABLE; 1343 writel(readl(&pChipcHw->VPMPhaseCtrl1) | chipcHw_REG_VPM_SW_PHASE_CTRL_ENABLE,
1344 &pChipcHw->VPMPhaseCtrl1);
1337 REG_LOCAL_IRQ_RESTORE; 1345 REG_LOCAL_IRQ_RESTORE;
1338} 1346}
1339 1347
@@ -1372,7 +1380,8 @@ static inline void chipcHw_vpmHwPhaseAlignEnable(void)
1372static inline void chipcHw_vpmHwPhaseAlignDisable(void) 1380static inline void chipcHw_vpmHwPhaseAlignDisable(void)
1373{ 1381{
1374 REG_LOCAL_IRQ_SAVE; 1382 REG_LOCAL_IRQ_SAVE;
1375 pChipcHw->VPMPhaseCtrl1 &= ~chipcHw_REG_VPM_HW_PHASE_CTRL_ENABLE; 1383 writel(readl(&pChipcHw->VPMPhaseCtrl1) & ~chipcHw_REG_VPM_HW_PHASE_CTRL_ENABLE,
1384 &pChipcHw->VPMPhaseCtrl1);
1376 REG_LOCAL_IRQ_RESTORE; 1385 REG_LOCAL_IRQ_RESTORE;
1377} 1386}
1378 1387
@@ -1474,8 +1483,8 @@ chipcHw_setVpmHwPhaseAlignMargin(chipcHw_VPM_HW_PHASE_MARGIN_e margin)
1474/****************************************************************************/ 1483/****************************************************************************/
1475static inline uint32_t chipcHw_isDdrHwPhaseAligned(void) 1484static inline uint32_t chipcHw_isDdrHwPhaseAligned(void)
1476{ 1485{
1477 return (pChipcHw-> 1486 return (readl(&pChipcHw->
1478 PhaseAlignStatus & chipcHw_REG_DDR_PHASE_ALIGNED) ? 1 : 0; 1487 PhaseAlignStatus) & chipcHw_REG_DDR_PHASE_ALIGNED) ? 1 : 0;
1479} 1488}
1480 1489
1481/****************************************************************************/ 1490/****************************************************************************/
@@ -1488,8 +1497,8 @@ static inline uint32_t chipcHw_isDdrHwPhaseAligned(void)
1488/****************************************************************************/ 1497/****************************************************************************/
1489static inline uint32_t chipcHw_isVpmHwPhaseAligned(void) 1498static inline uint32_t chipcHw_isVpmHwPhaseAligned(void)
1490{ 1499{
1491 return (pChipcHw-> 1500 return (readl(&pChipcHw->
1492 PhaseAlignStatus & chipcHw_REG_VPM_PHASE_ALIGNED) ? 1 : 0; 1501 PhaseAlignStatus) & chipcHw_REG_VPM_PHASE_ALIGNED) ? 1 : 0;
1493} 1502}
1494 1503
1495/****************************************************************************/ 1504/****************************************************************************/
@@ -1500,8 +1509,8 @@ static inline uint32_t chipcHw_isVpmHwPhaseAligned(void)
1500/****************************************************************************/ 1509/****************************************************************************/
1501static inline uint32_t chipcHw_getDdrHwPhaseAlignStatus(void) 1510static inline uint32_t chipcHw_getDdrHwPhaseAlignStatus(void)
1502{ 1511{
1503 return (pChipcHw-> 1512 return (readl(&pChipcHw->
1504 PhaseAlignStatus & chipcHw_REG_DDR_PHASE_STATUS_MASK) >> 1513 PhaseAlignStatus) & chipcHw_REG_DDR_PHASE_STATUS_MASK) >>
1505 chipcHw_REG_DDR_PHASE_STATUS_SHIFT; 1514 chipcHw_REG_DDR_PHASE_STATUS_SHIFT;
1506} 1515}
1507 1516
@@ -1513,8 +1522,8 @@ static inline uint32_t chipcHw_getDdrHwPhaseAlignStatus(void)
1513/****************************************************************************/ 1522/****************************************************************************/
1514static inline uint32_t chipcHw_getVpmHwPhaseAlignStatus(void) 1523static inline uint32_t chipcHw_getVpmHwPhaseAlignStatus(void)
1515{ 1524{
1516 return (pChipcHw-> 1525 return (readl(&pChipcHw->
1517 PhaseAlignStatus & chipcHw_REG_VPM_PHASE_STATUS_MASK) >> 1526 PhaseAlignStatus) & chipcHw_REG_VPM_PHASE_STATUS_MASK) >>
1518 chipcHw_REG_VPM_PHASE_STATUS_SHIFT; 1527 chipcHw_REG_VPM_PHASE_STATUS_SHIFT;
1519} 1528}
1520 1529
@@ -1526,8 +1535,8 @@ static inline uint32_t chipcHw_getVpmHwPhaseAlignStatus(void)
1526/****************************************************************************/ 1535/****************************************************************************/
1527static inline uint32_t chipcHw_getDdrPhaseControl(void) 1536static inline uint32_t chipcHw_getDdrPhaseControl(void)
1528{ 1537{
1529 return (pChipcHw-> 1538 return (readl(&pChipcHw->
1530 PhaseAlignStatus & chipcHw_REG_DDR_PHASE_CTRL_MASK) >> 1539 PhaseAlignStatus) & chipcHw_REG_DDR_PHASE_CTRL_MASK) >>
1531 chipcHw_REG_DDR_PHASE_CTRL_SHIFT; 1540 chipcHw_REG_DDR_PHASE_CTRL_SHIFT;
1532} 1541}
1533 1542
@@ -1539,8 +1548,8 @@ static inline uint32_t chipcHw_getDdrPhaseControl(void)
1539/****************************************************************************/ 1548/****************************************************************************/
1540static inline uint32_t chipcHw_getVpmPhaseControl(void) 1549static inline uint32_t chipcHw_getVpmPhaseControl(void)
1541{ 1550{
1542 return (pChipcHw-> 1551 return (readl(&pChipcHw->
1543 PhaseAlignStatus & chipcHw_REG_VPM_PHASE_CTRL_MASK) >> 1552 PhaseAlignStatus) & chipcHw_REG_VPM_PHASE_CTRL_MASK) >>
1544 chipcHw_REG_VPM_PHASE_CTRL_SHIFT; 1553 chipcHw_REG_VPM_PHASE_CTRL_SHIFT;
1545} 1554}
1546 1555
diff --git a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h
index b162448f613c..26f5d0e4e1dd 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/chipcHw_reg.h
@@ -24,7 +24,7 @@
24#define CHIPCHW_REG_H 24#define CHIPCHW_REG_H
25 25
26#include <mach/csp/mm_io.h> 26#include <mach/csp/mm_io.h>
27#include <csp/reg.h> 27#include <mach/csp/reg.h>
28#include <mach/csp/ddrcReg.h> 28#include <mach/csp/ddrcReg.h>
29 29
30#define chipcHw_BASE_ADDRESS MM_IO_BASE_CHIPC 30#define chipcHw_BASE_ADDRESS MM_IO_BASE_CHIPC
@@ -131,8 +131,8 @@ typedef struct {
131 uint32_t MiscInput_0_15; /* Input type for MISC 0 - 16 */ 131 uint32_t MiscInput_0_15; /* Input type for MISC 0 - 16 */
132} chipcHw_REG_t; 132} chipcHw_REG_t;
133 133
134#define pChipcHw ((volatile chipcHw_REG_t *) chipcHw_BASE_ADDRESS) 134#define pChipcHw ((chipcHw_REG_t __iomem *) chipcHw_BASE_ADDRESS)
135#define pChipcPhysical ((volatile chipcHw_REG_t *) MM_ADDR_IO_CHIPC) 135#define pChipcPhysical (MM_ADDR_IO_CHIPC)
136 136
137#define chipcHw_REG_CHIPID_BASE_MASK 0xFFFFF000 137#define chipcHw_REG_CHIPID_BASE_MASK 0xFFFFF000
138#define chipcHw_REG_CHIPID_BASE_SHIFT 12 138#define chipcHw_REG_CHIPID_BASE_SHIFT 12
diff --git a/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h b/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h
index f1b68e26fa6d..39da2c1fdafb 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/ddrcReg.h
@@ -30,8 +30,8 @@ extern "C" {
30 30
31/* ---- Include Files ---------------------------------------------------- */ 31/* ---- Include Files ---------------------------------------------------- */
32 32
33#include <csp/reg.h> 33#include <mach/csp/reg.h>
34#include <csp/stdint.h> 34#include <linux/types.h>
35 35
36#include <mach/csp/mm_io.h> 36#include <mach/csp/mm_io.h>
37 37
@@ -416,7 +416,7 @@ extern "C" {
416 } ddrcReg_PHY_ADDR_CTL_REG_t; 416 } ddrcReg_PHY_ADDR_CTL_REG_t;
417 417
418#define ddrcReg_PHY_ADDR_CTL_REG_OFFSET 0x0400 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)) 419#define ddrcReg_PHY_ADDR_CTL_REGP ((volatile ddrcReg_PHY_ADDR_CTL_REG_t __iomem*) (MM_IO_BASE_DDRC + ddrcReg_PHY_ADDR_CTL_REG_OFFSET))
420 420
421/* @todo These SS definitions are duplicates of ones below */ 421/* @todo These SS definitions are duplicates of ones below */
422 422
diff --git a/arch/arm/mach-bcmring/include/csp/dmacHw.h b/arch/arm/mach-bcmring/include/mach/csp/dmacHw.h
index e6a1dc484ca7..9dc90f46a84d 100644
--- a/arch/arm/mach-bcmring/include/csp/dmacHw.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/dmacHw.h
@@ -23,9 +23,9 @@
23#ifndef _DMACHW_H 23#ifndef _DMACHW_H
24#define _DMACHW_H 24#define _DMACHW_H
25 25
26#include <stddef.h> 26#include <linux/stddef.h>
27 27
28#include <csp/stdint.h> 28#include <linux/types.h>
29#include <mach/csp/dmacHw_reg.h> 29#include <mach/csp/dmacHw_reg.h>
30 30
31/* Define DMA Channel ID using DMA controller number (m) and channel number (c). 31/* Define DMA Channel ID using DMA controller number (m) and channel number (c).
diff --git a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h
index d67e2f8c22de..9d9455e0c391 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_priv.h
@@ -24,7 +24,7 @@
24#ifndef _DMACHW_PRIV_H 24#ifndef _DMACHW_PRIV_H
25#define _DMACHW_PRIV_H 25#define _DMACHW_PRIV_H
26 26
27#include <csp/stdint.h> 27#include <linux/types.h>
28 28
29/* Data type for DMA Link List Item */ 29/* Data type for DMA Link List Item */
30typedef struct { 30typedef struct {
diff --git a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h
index f1ecf96f2da5..7cd0aafa6f6e 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/dmacHw_reg.h
@@ -24,7 +24,7 @@
24#ifndef _DMACHW_REG_H 24#ifndef _DMACHW_REG_H
25#define _DMACHW_REG_H 25#define _DMACHW_REG_H
26 26
27#include <csp/stdint.h> 27#include <linux/types.h>
28#include <mach/csp/mm_io.h> 28#include <mach/csp/mm_io.h>
29 29
30/* Data type for 64 bit little endian register */ 30/* Data type for 64 bit little endian register */
@@ -121,75 +121,75 @@ typedef struct {
121} dmacHw_MISC_t; 121} dmacHw_MISC_t;
122 122
123/* Base registers */ 123/* Base registers */
124#define dmacHw_0_MODULE_BASE_ADDR (char *) MM_IO_BASE_DMA0 /* DMAC 0 module's base address */ 124#define dmacHw_0_MODULE_BASE_ADDR (char __iomem*) 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 */ 125#define dmacHw_1_MODULE_BASE_ADDR (char __iomem*) MM_IO_BASE_DMA1 /* DMAC 1 module's base address */
126 126
127extern uint32_t dmaChannelCount_0; 127extern uint32_t dmaChannelCount_0;
128extern uint32_t dmaChannelCount_1; 128extern uint32_t dmaChannelCount_1;
129 129
130/* Define channel specific registers */ 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)))) 131#define dmacHw_CHAN_BASE(module, chan) ((dmacHw_CH_REG_t __iomem*) ((char __iomem*)((module) ? dmacHw_1_MODULE_BASE_ADDR : dmacHw_0_MODULE_BASE_ADDR) + ((chan) * sizeof(dmacHw_CH_REG_t))))
132 132
133/* Raw interrupt status registers */ 133/* Raw interrupt status registers */
134#define dmacHw_REG_INT_RAW_BASE(module) ((char *)dmacHw_CHAN_BASE((module), ((module) ? dmaChannelCount_1 : dmaChannelCount_0))) 134#define dmacHw_REG_INT_RAW_BASE(module) ((char __iomem *)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) 135#define dmacHw_REG_INT_RAW_TRAN(module) (((dmacHw_INT_RAW_t __iomem *) 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) 136#define dmacHw_REG_INT_RAW_BLOCK(module) (((dmacHw_INT_RAW_t __iomem *) 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) 137#define dmacHw_REG_INT_RAW_STRAN(module) (((dmacHw_INT_RAW_t __iomem *) 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) 138#define dmacHw_REG_INT_RAW_DTRAN(module) (((dmacHw_INT_RAW_t __iomem *) 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) 139#define dmacHw_REG_INT_RAW_ERROR(module) (((dmacHw_INT_RAW_t __iomem *) dmacHw_REG_INT_RAW_BASE((module)))->RawErr.lo)
140 140
141/* Interrupt status registers */ 141/* Interrupt status registers */
142#define dmacHw_REG_INT_STAT_BASE(module) ((char *)(dmacHw_REG_INT_RAW_BASE((module)) + sizeof(dmacHw_INT_RAW_t))) 142#define dmacHw_REG_INT_STAT_BASE(module) ((char __iomem*)(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) 143#define dmacHw_REG_INT_STAT_TRAN(module) (((dmacHw_INT_STATUS_t __iomem *) 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) 144#define dmacHw_REG_INT_STAT_BLOCK(module) (((dmacHw_INT_STATUS_t __iomem *) 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) 145#define dmacHw_REG_INT_STAT_STRAN(module) (((dmacHw_INT_STATUS_t __iomem *) 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) 146#define dmacHw_REG_INT_STAT_DTRAN(module) (((dmacHw_INT_STATUS_t __iomem *) 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) 147#define dmacHw_REG_INT_STAT_ERROR(module) (((dmacHw_INT_STATUS_t __iomem *) dmacHw_REG_INT_STAT_BASE((module)))->StatusErr.lo)
148 148
149/* Interrupt status registers */ 149/* Interrupt status registers */
150#define dmacHw_REG_INT_MASK_BASE(module) ((char *)(dmacHw_REG_INT_STAT_BASE((module)) + sizeof(dmacHw_INT_STATUS_t))) 150#define dmacHw_REG_INT_MASK_BASE(module) ((char __iomem*)(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) 151#define dmacHw_REG_INT_MASK_TRAN(module) (((dmacHw_INT_MASK_t __iomem *) 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) 152#define dmacHw_REG_INT_MASK_BLOCK(module) (((dmacHw_INT_MASK_t __iomem *) 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) 153#define dmacHw_REG_INT_MASK_STRAN(module) (((dmacHw_INT_MASK_t __iomem *) 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) 154#define dmacHw_REG_INT_MASK_DTRAN(module) (((dmacHw_INT_MASK_t __iomem *) 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) 155#define dmacHw_REG_INT_MASK_ERROR(module) (((dmacHw_INT_MASK_t __iomem *) dmacHw_REG_INT_MASK_BASE((module)))->MaskErr.lo)
156 156
157/* Interrupt clear registers */ 157/* Interrupt clear registers */
158#define dmacHw_REG_INT_CLEAR_BASE(module) ((char *)(dmacHw_REG_INT_MASK_BASE((module)) + sizeof(dmacHw_INT_MASK_t))) 158#define dmacHw_REG_INT_CLEAR_BASE(module) ((char __iomem*)(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) 159#define dmacHw_REG_INT_CLEAR_TRAN(module) (((dmacHw_INT_CLEAR_t __iomem *) 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) 160#define dmacHw_REG_INT_CLEAR_BLOCK(module) (((dmacHw_INT_CLEAR_t __iomem *) 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) 161#define dmacHw_REG_INT_CLEAR_STRAN(module) (((dmacHw_INT_CLEAR_t __iomem *) 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) 162#define dmacHw_REG_INT_CLEAR_DTRAN(module) (((dmacHw_INT_CLEAR_t __iomem *) 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) 163#define dmacHw_REG_INT_CLEAR_ERROR(module) (((dmacHw_INT_CLEAR_t __iomem *) 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) 164#define dmacHw_REG_INT_STATUS(module) (((dmacHw_INT_CLEAR_t __iomem *) dmacHw_REG_INT_CLEAR_BASE((module)))->StatusInt.lo)
165 165
166/* Software handshaking registers */ 166/* Software handshaking registers */
167#define dmacHw_REG_SW_HS_BASE(module) ((char *)(dmacHw_REG_INT_CLEAR_BASE((module)) + sizeof(dmacHw_INT_CLEAR_t))) 167#define dmacHw_REG_SW_HS_BASE(module) ((char __iomem*)(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) 168#define dmacHw_REG_SW_HS_SRC_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) 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) 169#define dmacHw_REG_SW_HS_DST_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) 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) 170#define dmacHw_REG_SW_HS_SRC_SGL_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) 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) 171#define dmacHw_REG_SW_HS_DST_SGL_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) 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) 172#define dmacHw_REG_SW_HS_SRC_LST_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) 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) 173#define dmacHw_REG_SW_HS_DST_LST_REQ(module) (((dmacHw_SW_HANDSHAKE_t __iomem *) dmacHw_REG_SW_HS_BASE((module)))->LstDstReg.lo)
174 174
175/* Miscellaneous registers */ 175/* Miscellaneous registers */
176#define dmacHw_REG_MISC_BASE(module) ((char *)(dmacHw_REG_SW_HS_BASE((module)) + sizeof(dmacHw_SW_HANDSHAKE_t))) 176#define dmacHw_REG_MISC_BASE(module) ((char __iomem*)(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) 177#define dmacHw_REG_MISC_CFG(module) (((dmacHw_MISC_t __iomem*) 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) 178#define dmacHw_REG_MISC_CH_ENABLE(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->ChEnReg.lo)
179#define dmacHw_REG_MISC_ID(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->DmaIdReg.lo) 179#define dmacHw_REG_MISC_ID(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->DmaIdReg.lo)
180#define dmacHw_REG_MISC_TEST(module) (((dmacHw_MISC_t *) dmacHw_REG_MISC_BASE((module)))->DmaTestReg.lo) 180#define dmacHw_REG_MISC_TEST(module) (((dmacHw_MISC_t __iomem*) 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) 181#define dmacHw_REG_MISC_COMP_PARAM1_LO(module) (((dmacHw_MISC_t __iomem*) 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) 182#define dmacHw_REG_MISC_COMP_PARAM1_HI(module) (((dmacHw_MISC_t __iomem*) 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) 183#define dmacHw_REG_MISC_COMP_PARAM2_LO(module) (((dmacHw_MISC_t __iomem*) 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) 184#define dmacHw_REG_MISC_COMP_PARAM2_HI(module) (((dmacHw_MISC_t __iomem*) 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) 185#define dmacHw_REG_MISC_COMP_PARAM3_LO(module) (((dmacHw_MISC_t __iomem*) 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) 186#define dmacHw_REG_MISC_COMP_PARAM3_HI(module) (((dmacHw_MISC_t __iomem*) 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) 187#define dmacHw_REG_MISC_COMP_PARAM4_LO(module) (((dmacHw_MISC_t __iomem*) 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) 188#define dmacHw_REG_MISC_COMP_PARAM4_HI(module) (((dmacHw_MISC_t __iomem*) 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) 189#define dmacHw_REG_MISC_COMP_PARAM5_LO(module) (((dmacHw_MISC_t __iomem*) 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) 190#define dmacHw_REG_MISC_COMP_PARAM5_HI(module) (((dmacHw_MISC_t __iomem*) 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) 191#define dmacHw_REG_MISC_COMP_PARAM6_LO(module) (((dmacHw_MISC_t __iomem*) 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) 192#define dmacHw_REG_MISC_COMP_PARAM6_HI(module) (((dmacHw_MISC_t __iomem*) dmacHw_REG_MISC_BASE((module)))->CompParm6.hi)
193 193
194/* Channel control registers */ 194/* Channel control registers */
195#define dmacHw_REG_SAR(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelSar.lo) 195#define dmacHw_REG_SAR(module, chan) (dmacHw_CHAN_BASE((module), (chan))->ChannelSar.lo)
diff --git a/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h b/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h
index cfa91bed9d34..27f59dd27792 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/hw_cfg.h
@@ -18,7 +18,7 @@
18 18
19/* ---- Include Files ---------------------------------------------------- */ 19/* ---- Include Files ---------------------------------------------------- */
20 20
21#include <cfg_global.h> 21#include <mach/cfg_global.h>
22#include <mach/csp/cap_inline.h> 22#include <mach/csp/cap_inline.h>
23 23
24#if defined(__KERNEL__) 24#if defined(__KERNEL__)
diff --git a/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h b/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h
index 0aeb6a6fe7f8..f59db25b5632 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/intcHw_reg.h
@@ -27,8 +27,8 @@
27#define _INTCHW_REG_H 27#define _INTCHW_REG_H
28 28
29/* ---- Include Files ---------------------------------------------------- */ 29/* ---- Include Files ---------------------------------------------------- */
30#include <csp/stdint.h> 30#include <linux/types.h>
31#include <csp/reg.h> 31#include <mach/csp/reg.h>
32#include <mach/csp/mm_io.h> 32#include <mach/csp/mm_io.h>
33 33
34/* ---- Public Constants and Types --------------------------------------- */ 34/* ---- Public Constants and Types --------------------------------------- */
@@ -37,9 +37,9 @@
37#define INTCHW_NUM_INTC 3 37#define INTCHW_NUM_INTC 3
38 38
39/* Defines for interrupt controllers. This simplifies and cleans up the function calls. */ 39/* Defines for interrupt controllers. This simplifies and cleans up the function calls. */
40#define INTCHW_INTC0 ((void *)MM_IO_BASE_INTC0) 40#define INTCHW_INTC0 (MM_IO_BASE_INTC0)
41#define INTCHW_INTC1 ((void *)MM_IO_BASE_INTC1) 41#define INTCHW_INTC1 (MM_IO_BASE_INTC1)
42#define INTCHW_SINTC ((void *)MM_IO_BASE_SINTC) 42#define INTCHW_SINTC (MM_IO_BASE_SINTC)
43 43
44/* INTC0 - interrupt controller 0 */ 44/* INTC0 - interrupt controller 0 */
45#define INTCHW_INTC0_PIF_BITNUM 31 /* Peripheral interface interrupt */ 45#define INTCHW_INTC0_PIF_BITNUM 31 /* Peripheral interface interrupt */
@@ -232,15 +232,15 @@
232/* ---- Public Variable Externs ------------------------------------------ */ 232/* ---- Public Variable Externs ------------------------------------------ */
233/* ---- Public Function Prototypes --------------------------------------- */ 233/* ---- Public Function Prototypes --------------------------------------- */
234/* Clear one or more IRQ interrupts. */ 234/* Clear one or more IRQ interrupts. */
235static inline void intcHw_irq_disable(void *basep, uint32_t mask) 235static inline void intcHw_irq_disable(void __iomem *basep, uint32_t mask)
236{ 236{
237 __REG32(basep + INTCHW_INTENCLEAR) = mask; 237 writel(mask, basep + INTCHW_INTENCLEAR);
238} 238}
239 239
240/* Enables one or more IRQ interrupts. */ 240/* Enables one or more IRQ interrupts. */
241static inline void intcHw_irq_enable(void *basep, uint32_t mask) 241static inline void intcHw_irq_enable(void __iomem *basep, uint32_t mask)
242{ 242{
243 __REG32(basep + INTCHW_INTENABLE) = mask; 243 writel(mask, basep + INTCHW_INTENABLE);
244} 244}
245 245
246#endif /* _INTCHW_REG_H */ 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
index ad58cf873377..d571962f2904 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h
@@ -29,7 +29,7 @@
29/* ---- Include Files ---------------------------------------------------- */ 29/* ---- Include Files ---------------------------------------------------- */
30 30
31#if !defined(CSP_SIMULATION) 31#if !defined(CSP_SIMULATION)
32#include <cfg_global.h> 32#include <mach/cfg_global.h>
33#endif 33#endif
34 34
35/* ---- Public Constants and Types --------------------------------------- */ 35/* ---- Public Constants and Types --------------------------------------- */
diff --git a/arch/arm/mach-bcmring/include/mach/csp/mm_io.h b/arch/arm/mach-bcmring/include/mach/csp/mm_io.h
index de92ec6a01aa..47450c23685a 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/mm_io.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/mm_io.h
@@ -30,7 +30,7 @@
30#include <mach/csp/mm_addr.h> 30#include <mach/csp/mm_addr.h>
31 31
32#if !defined(CSP_SIMULATION) 32#if !defined(CSP_SIMULATION)
33#include <cfg_global.h> 33#include <mach/cfg_global.h>
34#endif 34#endif
35 35
36/* ---- Public Constants and Types --------------------------------------- */ 36/* ---- Public Constants and Types --------------------------------------- */
@@ -49,7 +49,7 @@
49#ifdef __ASSEMBLY__ 49#ifdef __ASSEMBLY__
50#define MM_IO_PHYS_TO_VIRT(phys) (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF)) 50#define MM_IO_PHYS_TO_VIRT(phys) (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF))
51#else 51#else
52#define MM_IO_PHYS_TO_VIRT(phys) (((phys) == MM_ADDR_IO_VPM_EXTMEM_RSVD) ? 0xF0000000 : \ 52#define MM_IO_PHYS_TO_VIRT(phys) (void __iomem *)(((phys) == MM_ADDR_IO_VPM_EXTMEM_RSVD) ? 0xF0000000 : \
53 (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF))) 53 (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF)))
54#endif 54#endif
55#endif 55#endif
@@ -60,8 +60,8 @@
60#ifdef __ASSEMBLY__ 60#ifdef __ASSEMBLY__
61#define MM_IO_VIRT_TO_PHYS(virt) ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF)) 61#define MM_IO_VIRT_TO_PHYS(virt) ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF))
62#else 62#else
63#define MM_IO_VIRT_TO_PHYS(virt) (((virt) == 0xF0000000) ? MM_ADDR_IO_VPM_EXTMEM_RSVD : \ 63#define MM_IO_VIRT_TO_PHYS(virt) (((unsigned long)(virt) == 0xF0000000) ? MM_ADDR_IO_VPM_EXTMEM_RSVD : \
64 ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF))) 64 ((((unsigned long)(virt) & 0x0F000000) << 4) | ((unsigned long)(virt) & 0xFFFFFF)))
65#endif 65#endif
66#endif 66#endif
67 67
diff --git a/arch/arm/mach-bcmring/include/csp/reg.h b/arch/arm/mach-bcmring/include/mach/csp/reg.h
index 56654d23c3d7..d9cbdca8cd25 100644
--- a/arch/arm/mach-bcmring/include/csp/reg.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/reg.h
@@ -25,13 +25,14 @@
25 25
26/* ---- Include Files ---------------------------------------------------- */ 26/* ---- Include Files ---------------------------------------------------- */
27 27
28#include <csp/stdint.h> 28#include <linux/types.h>
29#include <linux/io.h>
29 30
30/* ---- Public Constants and Types --------------------------------------- */ 31/* ---- Public Constants and Types --------------------------------------- */
31 32
32#define __REG32(x) (*((volatile uint32_t *)(x))) 33#define __REG32(x) (*((volatile uint32_t __iomem *)(x)))
33#define __REG16(x) (*((volatile uint16_t *)(x))) 34#define __REG16(x) (*((volatile uint16_t __iomem *)(x)))
34#define __REG8(x) (*((volatile uint8_t *) (x))) 35#define __REG8(x) (*((volatile uint8_t __iomem *) (x)))
35 36
36/* Macros used to define a sequence of reserved registers. The start / end */ 37/* 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/* are byte offsets in the particular register definition, with the "end" */
@@ -84,31 +85,31 @@
84 85
85#endif 86#endif
86 87
87static inline void reg32_modify_and(volatile uint32_t *reg, uint32_t value) 88static inline void reg32_modify_and(volatile uint32_t __iomem *reg, uint32_t value)
88{ 89{
89 REG_LOCAL_IRQ_SAVE; 90 REG_LOCAL_IRQ_SAVE;
90 *reg &= value; 91 __raw_writel(__raw_readl(reg) & value, reg);
91 REG_LOCAL_IRQ_RESTORE; 92 REG_LOCAL_IRQ_RESTORE;
92} 93}
93 94
94static inline void reg32_modify_or(volatile uint32_t *reg, uint32_t value) 95static inline void reg32_modify_or(volatile uint32_t __iomem *reg, uint32_t value)
95{ 96{
96 REG_LOCAL_IRQ_SAVE; 97 REG_LOCAL_IRQ_SAVE;
97 *reg |= value; 98 __raw_writel(__raw_readl(reg) | value, reg);
98 REG_LOCAL_IRQ_RESTORE; 99 REG_LOCAL_IRQ_RESTORE;
99} 100}
100 101
101static inline void reg32_modify_mask(volatile uint32_t *reg, uint32_t mask, 102static inline void reg32_modify_mask(volatile uint32_t __iomem *reg, uint32_t mask,
102 uint32_t value) 103 uint32_t value)
103{ 104{
104 REG_LOCAL_IRQ_SAVE; 105 REG_LOCAL_IRQ_SAVE;
105 *reg = (*reg & mask) | value; 106 __raw_writel((__raw_readl(reg) & mask) | value, reg);
106 REG_LOCAL_IRQ_RESTORE; 107 REG_LOCAL_IRQ_RESTORE;
107} 108}
108 109
109static inline void reg32_write(volatile uint32_t *reg, uint32_t value) 110static inline void reg32_write(volatile uint32_t __iomem *reg, uint32_t value)
110{ 111{
111 *reg = value; 112 __raw_writel(value, reg);
112} 113}
113 114
114#endif /* CSP_REG_H */ 115#endif /* CSP_REG_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
index 9cd6a032ab71..55d3cd4fd1e7 100644
--- a/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/secHw_inline.h
@@ -34,7 +34,7 @@
34/****************************************************************************/ 34/****************************************************************************/
35static inline void secHw_setSecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */ 35static inline void secHw_setSecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */
36 ) { 36 ) {
37 secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC; 37 secHw_REGS_t __iomem *regp = MM_IO_BASE_TZPC;
38 38
39 if (mask & 0x0000FFFF) { 39 if (mask & 0x0000FFFF) {
40 regp->reg[secHw_IDX_LS].setSecure = mask & 0x0000FFFF; 40 regp->reg[secHw_IDX_LS].setSecure = mask & 0x0000FFFF;
@@ -53,13 +53,13 @@ static inline void secHw_setSecure(uint32_t mask /* mask of type secHw_BLK_MASK
53/****************************************************************************/ 53/****************************************************************************/
54static inline void secHw_setUnsecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */ 54static inline void secHw_setUnsecure(uint32_t mask /* mask of type secHw_BLK_MASK_XXXXXX */
55 ) { 55 ) {
56 secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC; 56 secHw_REGS_t __iomem *regp = MM_IO_BASE_TZPC;
57 57
58 if (mask & 0x0000FFFF) { 58 if (mask & 0x0000FFFF) {
59 regp->reg[secHw_IDX_LS].setUnsecure = mask & 0x0000FFFF; 59 writel(mask & 0x0000FFFF, &regp->reg[secHw_IDX_LS].setUnsecure);
60 } 60 }
61 if (mask & 0xFFFF0000) { 61 if (mask & 0xFFFF0000) {
62 regp->reg[secHw_IDX_MS].setUnsecure = mask >> 16; 62 writel(mask >> 16, &regp->reg[secHw_IDX_MS].setUnsecure);
63 } 63 }
64} 64}
65 65
@@ -71,7 +71,7 @@ static inline void secHw_setUnsecure(uint32_t mask /* mask of type secHw_BLK_MA
71/****************************************************************************/ 71/****************************************************************************/
72static inline uint32_t secHw_getStatus(void) 72static inline uint32_t secHw_getStatus(void)
73{ 73{
74 secHw_REGS_t *regp = (secHw_REGS_t *) MM_IO_BASE_TZPC; 74 secHw_REGS_t __iomem *regp = MM_IO_BASE_TZPC;
75 75
76 return (regp->reg[1].status << 16) + regp->reg[0].status; 76 return (regp->reg[1].status << 16) + regp->reg[0].status;
77} 77}
diff --git a/arch/arm/mach-bcmring/include/csp/tmrHw.h b/arch/arm/mach-bcmring/include/mach/csp/tmrHw.h
index 2cbb530db8ea..1cc882ae60f5 100644
--- a/arch/arm/mach-bcmring/include/csp/tmrHw.h
+++ b/arch/arm/mach-bcmring/include/mach/csp/tmrHw.h
@@ -23,7 +23,7 @@
23#ifndef _TMRHW_H 23#ifndef _TMRHW_H
24#define _TMRHW_H 24#define _TMRHW_H
25 25
26#include <csp/stdint.h> 26#include <linux/types.h>
27 27
28typedef uint32_t tmrHw_ID_t; /* Timer ID */ 28typedef uint32_t tmrHw_ID_t; /* Timer ID */
29typedef uint32_t tmrHw_COUNT_t; /* Timer count */ 29typedef uint32_t tmrHw_COUNT_t; /* Timer count */
diff --git a/arch/arm/mach-bcmring/include/mach/dma.h b/arch/arm/mach-bcmring/include/mach/dma.h
index 72543781207b..13e01384d6fc 100644
--- a/arch/arm/mach-bcmring/include/mach/dma.h
+++ b/arch/arm/mach-bcmring/include/mach/dma.h
@@ -27,7 +27,7 @@
27 27
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/semaphore.h> 29#include <linux/semaphore.h>
30#include <csp/dmacHw.h> 30#include <mach/csp/dmacHw.h>
31#include <mach/timer.h> 31#include <mach/timer.h>
32 32
33/* ---- Constants and Types ---------------------------------------------- */ 33/* ---- Constants and Types ---------------------------------------------- */
diff --git a/arch/arm/mach-bcmring/include/mach/hardware.h b/arch/arm/mach-bcmring/include/mach/hardware.h
index 6ae20a649a97..a0c92b4b8c60 100644
--- a/arch/arm/mach-bcmring/include/mach/hardware.h
+++ b/arch/arm/mach-bcmring/include/mach/hardware.h
@@ -22,7 +22,7 @@
22#define __ASM_ARCH_HARDWARE_H 22#define __ASM_ARCH_HARDWARE_H
23 23
24#include <asm/sizes.h> 24#include <asm/sizes.h>
25#include <cfg_global.h> 25#include <mach/cfg_global.h>
26#include <mach/csp/mm_io.h> 26#include <mach/csp/mm_io.h>
27 27
28/* Hardware addresses of major areas. 28/* Hardware addresses of major areas.
diff --git a/arch/arm/mach-bcmring/include/mach/reg_nand.h b/arch/arm/mach-bcmring/include/mach/reg_nand.h
index 387376ffb56b..f8d51a8b0b15 100644
--- a/arch/arm/mach-bcmring/include/mach/reg_nand.h
+++ b/arch/arm/mach-bcmring/include/mach/reg_nand.h
@@ -30,7 +30,7 @@
30#define __ASM_ARCH_REG_NAND_H 30#define __ASM_ARCH_REG_NAND_H
31 31
32/* ---- Include Files ---------------------------------------------------- */ 32/* ---- Include Files ---------------------------------------------------- */
33#include <csp/reg.h> 33#include <mach/csp/reg.h>
34#include <mach/reg_umi.h> 34#include <mach/reg_umi.h>
35 35
36/* ---- Constants and Types ---------------------------------------------- */ 36/* ---- Constants and Types ---------------------------------------------- */
diff --git a/arch/arm/mach-bcmring/include/mach/reg_umi.h b/arch/arm/mach-bcmring/include/mach/reg_umi.h
index 0992842caa77..56dd9de7d83f 100644
--- a/arch/arm/mach-bcmring/include/mach/reg_umi.h
+++ b/arch/arm/mach-bcmring/include/mach/reg_umi.h
@@ -30,7 +30,7 @@
30#define __ASM_ARCH_REG_UMI_H 30#define __ASM_ARCH_REG_UMI_H
31 31
32/* ---- Include Files ---------------------------------------------------- */ 32/* ---- Include Files ---------------------------------------------------- */
33#include <csp/reg.h> 33#include <mach/csp/reg.h>
34#include <mach/csp/mm_io.h> 34#include <mach/csp/mm_io.h>
35 35
36/* ---- Constants and Types ---------------------------------------------- */ 36/* ---- Constants and Types ---------------------------------------------- */
@@ -233,5 +233,5 @@
233#define REG_UMI_BCH_ERR_LOC_WORD 0x00000018 233#define REG_UMI_BCH_ERR_LOC_WORD 0x00000018
234/* location within a page (512 byte) */ 234/* location within a page (512 byte) */
235#define REG_UMI_BCH_ERR_LOC_PAGE 0x00001FE0 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)) 236#define REG_UMI_BCH_ERR_LOC_ADDR(index) (readl(HW_UMI_BASE + 0x64 + (index / 2)*4) >> ((index % 2) * 16))
237#endif 237#endif
diff --git a/arch/arm/mach-bcmring/mm.c b/arch/arm/mach-bcmring/mm.c
index 1adec78ec940..33824a81cac4 100644
--- a/arch/arm/mach-bcmring/mm.c
+++ b/arch/arm/mach-bcmring/mm.c
@@ -20,12 +20,12 @@
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <mach/csp/mm_io.h> 21#include <mach/csp/mm_io.h>
22 22
23#define IO_DESC(va, sz) { .virtual = va, \ 23#define IO_DESC(va, sz) { .virtual = (unsigned long)va, \
24 .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \ 24 .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \
25 .length = sz, \ 25 .length = sz, \
26 .type = MT_DEVICE } 26 .type = MT_DEVICE }
27 27
28#define MEM_DESC(va, sz) { .virtual = va, \ 28#define MEM_DESC(va, sz) { .virtual = (unsigned long)va, \
29 .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \ 29 .pfn = __phys_to_pfn(HW_IO_VIRT_TO_PHYS(va)), \
30 .length = sz, \ 30 .length = sz, \
31 .type = MT_MEMORY } 31 .type = MT_MEMORY }
diff --git a/arch/arm/mach-bcmring/timer.c b/arch/arm/mach-bcmring/timer.c
index af9c3d7e2a0c..59412903466e 100644
--- a/arch/arm/mach-bcmring/timer.c
+++ b/arch/arm/mach-bcmring/timer.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <csp/tmrHw.h> 17#include <mach/csp/tmrHw.h>
18 18
19#include <mach/timer.h> 19#include <mach/timer.h>
20/* The core.c file initializes timers 1 and 3 as a linux clocksource. */ 20/* The core.c file initializes timers 1 and 3 as a linux clocksource. */
diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c
index 1ce70a91f2e9..f091a9010c2f 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/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 0031864e7f11..95b5e102ceb1 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 0149fb453be3..1295e616ceee 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -40,10 +40,10 @@
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 47
48#define DA850_EVM_PHY_ID "davinci_mdio-0:00" 48#define DA850_EVM_PHY_ID "davinci_mdio-0:00"
49#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) 49#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 1c7b1f46a8f3..88ebea89abdf 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 8e7703213b08..2f88103c6459 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 688a9c556dc9..1b4a8adcfdc9 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 d34ed55912b2..ca72fc4b8cca 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -31,13 +31,13 @@
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#include <mach/aemif.h> 40#include <linux/platform_data/mtd-davinci-aemif.h>
41 41
42#include "davinci.h" 42#include "davinci.h"
43 43
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 958679a20e13..9944367b4931 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -38,11 +38,11 @@
38 38
39#include <mach/common.h> 39#include <mach/common.h>
40#include <mach/serial.h> 40#include <mach/serial.h>
41#include <mach/i2c.h> 41#include <linux/platform_data/i2c-davinci.h>
42#include <mach/nand.h> 42#include <linux/platform_data/mtd-davinci.h>
43#include <mach/clock.h> 43#include <mach/clock.h>
44#include <mach/cdce949.h> 44#include <mach/cdce949.h>
45#include <mach/aemif.h> 45#include <linux/platform_data/mtd-davinci-aemif.h>
46 46
47#include "davinci.h" 47#include "davinci.h"
48#include "clock.h" 48#include "clock.h"
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index beecde3a1d2f..43e4a0d663fa 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 f6b9fc70161b..144bf31d68dd 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 9078acf94bac..6957787fa7f3 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/davinci.h b/arch/arm/mach-davinci/davinci.h
index 8db0fc6809dd..a37fc44e29bc 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -24,7 +24,7 @@
24#include <linux/spi/spi.h> 24#include <linux/spi/spi.h>
25 25
26#include <mach/asp.h> 26#include <mach/asp.h>
27#include <mach/keyscan.h> 27#include <linux/platform_data/keyscan-davinci.h>
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29 29
30#include <media/davinci/vpfe_capture.h> 30#include <media/davinci/vpfe_capture.h>
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index d2f9666284a7..3a42b6f79aa9 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"
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 678cd99b7336..adbde33eca01 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -27,7 +27,7 @@
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 <mach/asp.h>
30#include <mach/spi.h> 30#include <linux/platform_data/spi-davinci.h>
31#include <mach/gpio-davinci.h> 31#include <mach/gpio-davinci.h>
32 32
33#include "davinci.h" 33#include "davinci.h"
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index a50d49de1883..719e22f2a37e 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -30,8 +30,8 @@
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 <mach/asp.h>
33#include <mach/keyscan.h> 33#include <linux/platform_data/keyscan-davinci.h>
34#include <mach/spi.h> 34#include <linux/platform_data/spi-davinci.h>
35#include <mach/gpio-davinci.h> 35#include <mach/gpio-davinci.h>
36 36
37#include "davinci.h" 37#include "davinci.h"
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index a2f1f274f189..33e78ae2a254 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -19,12 +19,12 @@
19 19
20#include <mach/serial.h> 20#include <mach/serial.h>
21#include <mach/edma.h> 21#include <mach/edma.h>
22#include <mach/i2c.h>
23#include <mach/asp.h> 22#include <mach/asp.h>
24#include <mach/mmc.h>
25#include <mach/usb.h>
26#include <mach/pm.h> 23#include <mach/pm.h>
27#include <mach/spi.h> 24#include <linux/platform_data/i2c-davinci.h>
25#include <linux/platform_data/mmc-davinci.h>
26#include <linux/platform_data/usb-davinci.h>
27#include <linux/platform_data/spi-davinci.h>
28 28
29extern void __iomem *da8xx_syscfg0_base; 29extern void __iomem *da8xx_syscfg0_base;
30extern void __iomem *da8xx_syscfg1_base; 30extern void __iomem *da8xx_syscfg1_base;
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h
index 83e5926f3c46..1656a02e3eda 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/usb.c b/arch/arm/mach-davinci/usb.c
index 23d2b6d9fa63..f77b95336e2b 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 dd937c526a45..00154e74ce6b 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 fa0f01856060..5e683baf96cf 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 6321567d8eaa..b37bef1d5ffa 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 6432a3ba864b..1a233404b735 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 f953bb54aa9d..99f259e8cf33 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 d52b0ef313b7..661725e3115a 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 e7e5101e35a5..000000000000
--- 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 29c8b85355a5..000000000000
--- 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 3ad9f946a9e8..7bcd0dfce4b1 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 9bc97a5baaa8..087711524e8a 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 7f70afc26f91..60bd729a1ba5 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 47921b0cdc65..bb15b26041cb 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/core.c b/arch/arm/mach-ebsa110/core.c
index 6f8068692edf..f0fe6b5350e2 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 c93c9e43012d..afe137ee172e 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-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 4afe52aaaff3..e85bf17f2d2a 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 16976d7bdc8a..d8bfd02f5047 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 337ab7cf4c16..b8f53d57a299 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/simone.c b/arch/arm/mach-ep93xx/simone.c
index 33dc07917417..0eb3f17a6fa2 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 01abd3516a77..50043eef1cf2 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/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c
index 2905a4929bdc..ba92e25e3016 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/Makefile.boot b/arch/arm/mach-exynos/Makefile.boot
index 31bd181b0514..b9862e22bf10 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-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index 774533c67066..3b00e299b624 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);
@@ -672,10 +667,6 @@ static struct clk exynos5_init_clocks_off[] = {
672 .enable = exynos5_clk_ip_fsys_ctrl, 667 .enable = exynos5_clk_ip_fsys_ctrl,
673 .ctrlbit = (1 << 7), 668 .ctrlbit = (1 << 7),
674 }, { 669 }, {
675 .name = "gps",
676 .enable = exynos5_clk_ip_gps_ctrl,
677 .ctrlbit = ((1 << 3) | (1 << 2) | (1 << 0)),
678 }, {
679 .name = "nfcon", 670 .name = "nfcon",
680 .enable = exynos5_clk_ip_fsys_ctrl, 671 .enable = exynos5_clk_ip_fsys_ctrl,
681 .ctrlbit = (1 << 22), 672 .ctrlbit = (1 << 22),
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index aed2eeb06517..dac146df79ac 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 b33a5b67b547..ae321c7cb15f 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 b8e75300c77d..14ed7951a2c6 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/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index 9c17a0a43858..f4d7dd20cdac 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 c72b675b3e4b..9d1f3ac86db2 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -131,7 +131,6 @@
131#define EXYNOS5_PA_SYSMMU_JPEG 0x11F20000 131#define EXYNOS5_PA_SYSMMU_JPEG 0x11F20000
132#define EXYNOS5_PA_SYSMMU_IOP 0x12360000 132#define EXYNOS5_PA_SYSMMU_IOP 0x12360000
133#define EXYNOS5_PA_SYSMMU_RTIC 0x12370000 133#define EXYNOS5_PA_SYSMMU_RTIC 0x12370000
134#define EXYNOS5_PA_SYSMMU_GPS 0x12630000
135#define EXYNOS5_PA_SYSMMU_ISP 0x13260000 134#define EXYNOS5_PA_SYSMMU_ISP 0x13260000
136#define EXYNOS5_PA_SYSMMU_DRC 0x12370000 135#define EXYNOS5_PA_SYSMMU_DRC 0x12370000
137#define EXYNOS5_PA_SYSMMU_SCALERC 0x13280000 136#define EXYNOS5_PA_SYSMMU_SCALERC 0x13280000
diff --git a/arch/arm/mach-exynos/mach-armlex4210.c b/arch/arm/mach-exynos/mach-armlex4210.c
index 5a3daa0168d8..3f37a5e8a1f4 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-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index ef770bc2318f..8833060f77e9 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -79,6 +79,7 @@ static char const *exynos5250_dt_compat[] __initdata = {
79DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") 79DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
80 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 80 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
81 .init_irq = exynos5_init_irq, 81 .init_irq = exynos5_init_irq,
82 .smp = smp_ops(exynos_smp_ops),
82 .map_io = exynos5250_dt_map_io, 83 .map_io = exynos5250_dt_map_io,
83 .handle_irq = gic_handle_irq, 84 .handle_irq = gic_handle_irq,
84 .init_machine = exynos5250_dt_machine_init, 85 .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 ea785fcaf6c3..480cd78f1920 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -45,14 +45,14 @@
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
@@ -1383,6 +1383,7 @@ static void __init nuri_machine_init(void)
1383MACHINE_START(NURI, "NURI") 1383MACHINE_START(NURI, "NURI")
1384 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ 1384 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
1385 .atag_offset = 0x100, 1385 .atag_offset = 0x100,
1386 .smp = smp_ops(exynos_smp_ops),
1386 .init_irq = exynos4_init_irq, 1387 .init_irq = exynos4_init_irq,
1387 .map_io = nuri_map_io, 1388 .map_io = nuri_map_io,
1388 .handle_irq = gic_handle_irq, 1389 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 4e574c24581c..fc23f74ade81 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -35,8 +35,8 @@
35#include <plat/cpu.h> 35#include <plat/cpu.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/sdhci.h> 37#include <plat/sdhci.h>
38#include <plat/iic.h> 38#include <linux/platform_data/i2c-s3c2410.h>
39#include <plat/ehci.h> 39#include <linux/platform_data/usb-ehci-s5p.h>
40#include <plat/clock.h> 40#include <plat/clock.h>
41#include <plat/gpio-cfg.h> 41#include <plat/gpio-cfg.h>
42#include <plat/backlight.h> 42#include <plat/backlight.h>
@@ -44,7 +44,7 @@
44#include <plat/mfc.h> 44#include <plat/mfc.h>
45#include <plat/hdmi.h> 45#include <plat/hdmi.h>
46 46
47#include <mach/ohci.h> 47#include <linux/platform_data/usb-exynos.h>
48#include <mach/map.h> 48#include <mach/map.h>
49 49
50#include <drm/exynos_drm.h> 50#include <drm/exynos_drm.h>
@@ -806,6 +806,7 @@ static void __init origen_machine_init(void)
806MACHINE_START(ORIGEN, "ORIGEN") 806MACHINE_START(ORIGEN, "ORIGEN")
807 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */ 807 /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
808 .atag_offset = 0x100, 808 .atag_offset = 0x100,
809 .smp = smp_ops(exynos_smp_ops),
809 .init_irq = exynos4_init_irq, 810 .init_irq = exynos4_init_irq,
810 .map_io = origen_map_io, 811 .map_io = origen_map_io,
811 .handle_irq = gic_handle_irq, 812 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index b26beb13ebef..589f1db140f0 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -32,7 +32,7 @@
32#include <plat/devs.h> 32#include <plat/devs.h>
33#include <plat/fb.h> 33#include <plat/fb.h>
34#include <plat/gpio-cfg.h> 34#include <plat/gpio-cfg.h>
35#include <plat/iic.h> 35#include <linux/platform_data/i2c-s3c2410.h>
36#include <plat/keypad.h> 36#include <plat/keypad.h>
37#include <plat/mfc.h> 37#include <plat/mfc.h>
38#include <plat/regs-fb.h> 38#include <plat/regs-fb.h>
@@ -370,6 +370,7 @@ static void __init smdk4x12_machine_init(void)
370MACHINE_START(SMDK4212, "SMDK4212") 370MACHINE_START(SMDK4212, "SMDK4212")
371 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 371 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
372 .atag_offset = 0x100, 372 .atag_offset = 0x100,
373 .smp = smp_ops(exynos_smp_ops),
373 .init_irq = exynos4_init_irq, 374 .init_irq = exynos4_init_irq,
374 .map_io = smdk4x12_map_io, 375 .map_io = smdk4x12_map_io,
375 .handle_irq = gic_handle_irq, 376 .handle_irq = gic_handle_irq,
@@ -383,6 +384,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
383 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 384 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
384 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ 385 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
385 .atag_offset = 0x100, 386 .atag_offset = 0x100,
387 .smp = smp_ops(exynos_smp_ops),
386 .init_irq = exynos4_init_irq, 388 .init_irq = exynos4_init_irq,
387 .map_io = smdk4x12_map_io, 389 .map_io = smdk4x12_map_io,
388 .handle_irq = gic_handle_irq, 390 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index 73f2bce097e1..6e52cbd0b3e0 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -34,16 +34,16 @@
34#include <plat/fb.h> 34#include <plat/fb.h>
35#include <plat/keypad.h> 35#include <plat/keypad.h>
36#include <plat/sdhci.h> 36#include <plat/sdhci.h>
37#include <plat/iic.h> 37#include <linux/platform_data/i2c-s3c2410.h>
38#include <plat/gpio-cfg.h> 38#include <plat/gpio-cfg.h>
39#include <plat/backlight.h> 39#include <plat/backlight.h>
40#include <plat/mfc.h> 40#include <plat/mfc.h>
41#include <plat/ehci.h> 41#include <linux/platform_data/usb-ehci-s5p.h>
42#include <plat/clock.h> 42#include <plat/clock.h>
43#include <plat/hdmi.h> 43#include <plat/hdmi.h>
44 44
45#include <mach/map.h> 45#include <mach/map.h>
46#include <mach/ohci.h> 46#include <linux/platform_data/usb-exynos.h>
47 47
48#include <drm/exynos_drm.h> 48#include <drm/exynos_drm.h>
49#include "common.h" 49#include "common.h"
@@ -417,6 +417,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
417 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 417 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
418 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ 418 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
419 .atag_offset = 0x100, 419 .atag_offset = 0x100,
420 .smp = smp_ops(exynos_smp_ops),
420 .init_irq = exynos4_init_irq, 421 .init_irq = exynos4_init_irq,
421 .map_io = smdkv310_map_io, 422 .map_io = smdkv310_map_io,
422 .handle_irq = gic_handle_irq, 423 .handle_irq = gic_handle_irq,
@@ -429,6 +430,7 @@ MACHINE_END
429MACHINE_START(SMDKC210, "SMDKC210") 430MACHINE_START(SMDKC210, "SMDKC210")
430 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 431 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
431 .atag_offset = 0x100, 432 .atag_offset = 0x100,
433 .smp = smp_ops(exynos_smp_ops),
432 .init_irq = exynos4_init_irq, 434 .init_irq = exynos4_init_irq,
433 .map_io = smdkv310_map_io, 435 .map_io = smdkv310_map_io,
434 .handle_irq = gic_handle_irq, 436 .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 4d1f40d44ed1..98d3aced2289 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -34,7 +34,7 @@
34#include <plat/clock.h> 34#include <plat/clock.h>
35#include <plat/cpu.h> 35#include <plat/cpu.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/iic.h> 37#include <linux/platform_data/i2c-s3c2410.h>
38#include <plat/gpio-cfg.h> 38#include <plat/gpio-cfg.h>
39#include <plat/fb.h> 39#include <plat/fb.h>
40#include <plat/mfc.h> 40#include <plat/mfc.h>
@@ -43,7 +43,7 @@
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
@@ -1155,6 +1155,7 @@ static void __init universal_machine_init(void)
1155MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210") 1155MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1156 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ 1156 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
1157 .atag_offset = 0x100, 1157 .atag_offset = 0x100,
1158 .smp = smp_ops(exynos_smp_ops),
1158 .init_irq = exynos4_init_irq, 1159 .init_irq = exynos4_init_irq,
1159 .map_io = universal_map_io, 1160 .map_io = universal_map_io,
1160 .handle_irq = gic_handle_irq, 1161 .handle_irq = gic_handle_irq,
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 36c3984aaa47..8d57e4223bdb 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
@@ -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-i2c0.c b/arch/arm/mach-exynos/setup-i2c0.c
index b90d94c17f7c..5700f23629f7 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 fd7235a43f6e..8d2279cc85dc 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 2694b19e8b37..0ed62fc42a77 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 379bd306993f..7787fd26076b 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 9f3c04855b76..edc847f89826 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 77e1a1e57c76..d88af7f75954 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 284d12b7af0e..c590286c9d3a 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 b7611ee359a2..1bba75568a5f 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/common.c b/arch/arm/mach-footbridge/common.c
index 3e6aaa6361da..a42b369bc439 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 9d62e3381024..a7cd2cf5e08d 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/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S
index e5acde25ffc5..c169f0c99b2a 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 aba531eebbc6..aba46388cc0c 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-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
new file mode 100644
index 000000000000..0e1d0a42a3ea
--- /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 dae9661a7689..000000000000
--- 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 141ed5171826..286ec82a4f63 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 d75b0a78d88a..af1da34ccf9d 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -152,6 +152,7 @@ static void highbank_power_off(void)
152static void __init highbank_init(void) 152static void __init highbank_init(void)
153{ 153{
154 pm_power_off = highbank_power_off; 154 pm_power_off = highbank_power_off;
155 highbank_pm_init();
155 156
156 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 157 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
157} 158}
@@ -162,6 +163,7 @@ static const char *highbank_match[] __initconst = {
162}; 163};
163 164
164DT_MACHINE_START(HIGHBANK, "Highbank") 165DT_MACHINE_START(HIGHBANK, "Highbank")
166 .smp = smp_ops(highbank_smp_ops),
165 .map_io = highbank_map_io, 167 .map_io = highbank_map_io,
166 .init_irq = highbank_init_irq, 168 .init_irq = highbank_init_irq,
167 .timer = &highbank_timer, 169 .timer = &highbank_timer,
diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c
index 977cebbea580..2c1b8c3c8e45 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 40a8c178f10d..000000000000
--- 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 88dac7a55a97..000000000000
--- 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 bbe20e696325..000000000000
--- 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 d01364c72b45..fa9560ec6e70 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 33b3beb89982..de866f21331f 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 afd542ad6f97..7ca5fe45945f 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -101,13 +101,8 @@ config SOC_IMX51
101 select SOC_IMX5 101 select SOC_IMX5
102 select ARCH_MX5 102 select ARCH_MX5
103 select ARCH_MX51 103 select ARCH_MX51
104 104 select PINCTRL
105config SOC_IMX53 105 select PINCTRL_IMX51
106 bool
107 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
@@ -561,7 +556,6 @@ config MACH_BUG
561config MACH_IMX31_DT 556config MACH_IMX31_DT
562 bool "Support i.MX31 platforms from device tree" 557 bool "Support i.MX31 platforms from device tree"
563 select SOC_IMX31 558 select SOC_IMX31
564 select USE_OF
565 help 559 help
566 Include support for Freescale i.MX31 based platforms 560 Include support for Freescale i.MX31 based platforms
567 using the device tree for discovery. 561 using the device tree for discovery.
@@ -737,95 +731,19 @@ config MACH_EUKREA_MBIMXSD51_BASEBOARD
737 731
738endchoice 732endchoice
739 733
740config MX51_EFIKA_COMMON 734comment "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
779config MACH_MX53_EVK
780 bool "Support MX53 EVK platforms"
781 select SOC_IMX53
782 select IMX_HAVE_PLATFORM_IMX2_WDT
783 select IMX_HAVE_PLATFORM_IMX_UART
784 select IMX_HAVE_PLATFORM_IMX_I2C
785 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
786 select IMX_HAVE_PLATFORM_SPI_IMX
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 735
803config MACH_MX53_LOCO 736config SOC_IMX53
804 bool "Support MX53 LOCO platforms" 737 bool "i.MX53 support"
805 select SOC_IMX53 738 select SOC_IMX5
806 select IMX_HAVE_PLATFORM_IMX2_WDT 739 select ARCH_MX5
807 select IMX_HAVE_PLATFORM_IMX_I2C 740 select ARCH_MX53
808 select IMX_HAVE_PLATFORM_IMX_UART 741 select HAVE_CAN_FLEXCAN if CAN
809 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 742 select PINCTRL
810 select IMX_HAVE_PLATFORM_GPIO_KEYS 743 select PINCTRL_IMX53
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 744
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 745 help
825 Include support for MX53 ARD platform. This includes specific 746 This enables support for Freescale i.MX53 processor.
826 configurations for the board and its peripherals.
827
828comment "i.MX6 family:"
829 747
830config SOC_IMX6Q 748config SOC_IMX6Q
831 bool "i.MX6 Quad support" 749 bool "i.MX6 Quad support"
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index d004d37ad9d8..895754aeb4f3 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 05541cf4a878..b27815de8473 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 ea13e61bd5f3..cf65148bc519 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-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index 65fb8bcd86cb..177259b523cd 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,6 +231,7 @@ 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[ssi1_gate], NULL, "imx-ssi.0"); 237 clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
@@ -253,6 +257,7 @@ int __init mx35_clocks_init()
253 clk_register_clkdev(clk[usbotg_gate], "ahb", "fsl-usb2-udc"); 257 clk_register_clkdev(clk[usbotg_gate], "ahb", "fsl-usb2-udc");
254 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); 258 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
255 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");
256 261
257 clk_prepare_enable(clk[spba_gate]); 262 clk_prepare_enable(clk[spba_gate]);
258 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 4bdcaa97bd98..e5165a84f93f 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
@@ -421,8 +423,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); 423 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); 424 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); 425 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); 426 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); 427 mx53_can_sel, ARRAY_SIZE(mx53_can_sel));
428 clk[can1_serial_gate] = imx_clk_gate2("can1_serial_gate", "can_sel", MXC_CCM_CCGR6, 22);
429 clk[can1_ipg_gate] = imx_clk_gate2("can1_ipg_gate", "ipg", MXC_CCM_CCGR6, 20);
430 clk[can2_serial_gate] = imx_clk_gate2("can2_serial_gate", "can_sel", MXC_CCM_CCGR4, 8);
431 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); 432 clk[i2c3_gate] = imx_clk_gate2("i2c3_gate", "per_root", MXC_CCM_CCGR1, 22);
427 433
428 for (i = 0; i < ARRAY_SIZE(clk); i++) 434 for (i = 0; i < ARRAY_SIZE(clk); i++)
@@ -455,6 +461,10 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
455 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "63fcc000.ssi"); 461 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "63fcc000.ssi");
456 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "50014000.ssi"); 462 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "50014000.ssi");
457 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "63fd0000.ssi"); 463 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "63fd0000.ssi");
464 clk_register_clkdev(clk[can1_ipg_gate], "ipg", "53fc8000.can");
465 clk_register_clkdev(clk[can1_serial_gate], "per", "53fc8000.can");
466 clk_register_clkdev(clk[can2_ipg_gate], "ipg", "53fcc000.can");
467 clk_register_clkdev(clk[can2_serial_gate], "per", "53fcc000.can");
458 468
459 /* set SDHC root clock to 200MHZ*/ 469 /* set SDHC root clock to 200MHZ*/
460 clk_set_rate(clk[esdhc_a_podf], 200000000); 470 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 4233d9e3531d..3ec242f3341e 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 2d856f9ccf59..02be73178912 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 000000000000..f5e8be8e7f11
--- /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 1bf64fe2523c..5f2d8acca25f 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-imx53.h b/arch/arm/mach-imx/devices-imx53.h
deleted file mode 100644
index 77e0db96c448..000000000000
--- 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 014aa985faae..000000000000
--- 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 05bb41d99728..412c583a24b0 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 fa69419eabdd..cd6e1f81508d 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 faad0f15ac7f..9a880c78af34 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 73574c30cf50..779e16eb65cb 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 a6a4afb0ad62..cf8d00e5cce1 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/hotplug.c b/arch/arm/mach-imx/hotplug.c
index f8f7437c83b8..b07b778dc9a8 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 d4067fe36357..f233b4bb2342 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/imx53-dt.c b/arch/arm/mach-imx/mach-imx53.c
index 1b7a2fc36591..29711e95579f 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 045b3f6a387d..36979d3dfe34 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -22,7 +22,6 @@
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>
27#include <linux/micrel_phy.h> 26#include <linux/micrel_phy.h>
28#include <linux/mfd/anatop.h> 27#include <linux/mfd/anatop.h>
@@ -100,7 +99,6 @@ static void __init imx6q_sabrelite_cko1_setup(void)
100 clk_set_parent(cko1_sel, ahb); 99 clk_set_parent(cko1_sel, ahb);
101 rate = clk_round_rate(cko1, 16000000); 100 rate = clk_round_rate(cko1, 16000000);
102 clk_set_rate(cko1, rate); 101 clk_set_rate(cko1, rate);
103 clk_register_clkdev(cko1, NULL, "0-000a");
104put_clk: 102put_clk:
105 if (!IS_ERR(cko1_sel)) 103 if (!IS_ERR(cko1_sel))
106 clk_put(cko1_sel); 104 clk_put(cko1_sel);
@@ -159,12 +157,6 @@ static void __init imx6q_usb_init(void)
159 157
160static void __init imx6q_init_machine(void) 158static void __init imx6q_init_machine(void)
161{ 159{
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")) 160 if (of_machine_is_compatible("fsl,imx6q-sabrelite"))
169 imx6q_sabrelite_init(); 161 imx6q_sabrelite_init();
170 162
@@ -218,14 +210,12 @@ static struct sys_timer imx6q_timer = {
218}; 210};
219 211
220static const char *imx6q_dt_compat[] __initdata = { 212static const char *imx6q_dt_compat[] __initdata = {
221 "fsl,imx6q-arm2",
222 "fsl,imx6q-sabrelite",
223 "fsl,imx6q-sabresd",
224 "fsl,imx6q", 213 "fsl,imx6q",
225 NULL, 214 NULL,
226}; 215};
227 216
228DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)") 217DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)")
218 .smp = smp_ops(imx_smp_ops),
229 .map_io = imx6q_map_io, 219 .map_io = imx6q_map_io,
230 .init_irq = imx6q_init_irq, 220 .init_irq = imx6q_init_irq,
231 .handle_irq = imx6q_handle_irq, 221 .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 5d08533ab2c7..0330078ff788 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-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index d37f4809c556..e774b07f48d3 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 c8785b39eaed..ef57cff5abfb 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 d46290b288ed..459e754ef8c9 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 8d09c0126cab..000000000000
--- 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 fdbd181b97ef..000000000000
--- 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 6c28e65f424d..000000000000
--- 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 09fe2197b491..000000000000
--- 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 8abe23c1d3c8..000000000000
--- 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 b15d6a6d3b68..000000000000
--- 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 52d8f534be10..acb0aadb4255 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 b09ee12a4ff0..fb38436ca67f 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 ee870c49bc63..000000000000
--- 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 ab98c6fec9eb..2ac43e1a2dfd 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/core.c b/arch/arm/mach-integrator/core.c
index 3fa6c51390da..a432d4325f89 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -95,8 +95,8 @@ arch_initcall(integrator_init);
95 * UART0 7 6 95 * UART0 7 6
96 * UART1 5 4 96 * UART1 5 4
97 */ 97 */
98#define SC_CTRLC IO_ADDRESS(INTEGRATOR_SC_CTRLC) 98#define SC_CTRLC __io_address(INTEGRATOR_SC_CTRLC)
99#define SC_CTRLS IO_ADDRESS(INTEGRATOR_SC_CTRLS) 99#define SC_CTRLS __io_address(INTEGRATOR_SC_CTRLS)
100 100
101static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) 101static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl)
102{ 102{
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c
index fbb457779895..590c192cdf4d 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/io.h b/arch/arm/mach-integrator/include/mach/io.h
deleted file mode 100644
index 8de70de3dd0a..000000000000
--- 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 ec467baade09..4c0347526851 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 0xe8000000
328#define PCI_CONFIG_VADDR 0xec000000
329#define PCI_V3_VADDR 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 3b2267529f5e..2215d96cd735 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -50,6 +50,7 @@
50#include <asm/mach/arch.h> 50#include <asm/mach/arch.h>
51#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
52#include <asm/mach/map.h> 52#include <asm/mach/map.h>
53#include <asm/mach/pci.h>
53#include <asm/mach/time.h> 54#include <asm/mach/time.h>
54 55
55#include <plat/fpga-irq.h> 56#include <plat/fpga-irq.h>
@@ -73,7 +74,7 @@
73 * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M) 74 * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M)
74 * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M) 75 * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M)
75 * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k) 76 * ed000000 62000000 PCI V3 regs PHYS_PCI_V3_BASE (max 64k)
76 * ee000000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M) 77 * fee00000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M)
77 * ef000000 Cache flush 78 * ef000000 Cache flush
78 * f1000000 10000000 Core module registers 79 * f1000000 10000000 Core module registers
79 * f1100000 11000000 System controller registers 80 * f1100000 11000000 System controller registers
@@ -133,25 +134,20 @@ static struct map_desc ap_io_desc[] __initdata = {
133 .length = SZ_4K, 134 .length = SZ_4K,
134 .type = MT_DEVICE 135 .type = MT_DEVICE
135 }, { 136 }, {
136 .virtual = PCI_MEMORY_VADDR, 137 .virtual = (unsigned long)PCI_MEMORY_VADDR,
137 .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE), 138 .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE),
138 .length = SZ_16M, 139 .length = SZ_16M,
139 .type = MT_DEVICE 140 .type = MT_DEVICE
140 }, { 141 }, {
141 .virtual = PCI_CONFIG_VADDR, 142 .virtual = (unsigned long)PCI_CONFIG_VADDR,
142 .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE), 143 .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE),
143 .length = SZ_16M, 144 .length = SZ_16M,
144 .type = MT_DEVICE 145 .type = MT_DEVICE
145 }, { 146 }, {
146 .virtual = PCI_V3_VADDR, 147 .virtual = (unsigned long)PCI_V3_VADDR,
147 .pfn = __phys_to_pfn(PHYS_PCI_V3_BASE), 148 .pfn = __phys_to_pfn(PHYS_PCI_V3_BASE),
148 .length = SZ_64K, 149 .length = SZ_64K,
149 .type = MT_DEVICE 150 .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 } 151 }
156}; 152};
157 153
@@ -159,6 +155,7 @@ static void __init ap_map_io(void)
159{ 155{
160 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); 156 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc));
161 vga_base = PCI_MEMORY_VADDR; 157 vga_base = PCI_MEMORY_VADDR;
158 pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE));
162} 159}
163 160
164#define INTEGRATOR_SC_VALID_INT 0x003fffff 161#define INTEGRATOR_SC_VALID_INT 0x003fffff
@@ -317,9 +314,9 @@ static void __init ap_init(void)
317/* 314/*
318 * Where is the timer (VA)? 315 * Where is the timer (VA)?
319 */ 316 */
320#define TIMER0_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER0_BASE) 317#define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE)
321#define TIMER1_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER1_BASE) 318#define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE)
322#define TIMER2_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER2_BASE) 319#define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE)
323 320
324static unsigned long timer_reload; 321static unsigned long timer_reload;
325 322
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 82d5c837cc74..3df5fc369361 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -59,7 +59,7 @@
59 59
60#define INTCP_ETH_SIZE 0x10 60#define INTCP_ETH_SIZE 0x10
61 61
62#define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE) 62#define INTCP_VA_CTRL_BASE __io_address(INTEGRATOR_CP_CTL_BASE)
63#define INTCP_FLASHPROG 0x04 63#define INTCP_FLASHPROG 0x04
64#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) 64#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0)
65#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) 65#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1)
@@ -265,8 +265,8 @@ static struct platform_device *intcp_devs[] __initdata = {
265 */ 265 */
266static unsigned int mmc_status(struct device *dev) 266static unsigned int mmc_status(struct device *dev)
267{ 267{
268 unsigned int status = readl(IO_ADDRESS(0xca000000 + 4)); 268 unsigned int status = readl(__io_address(0xca000000 + 4));
269 writel(8, IO_ADDRESS(INTEGRATOR_CP_CTL_BASE + 8)); 269 writel(8, __io_address(INTEGRATOR_CP_CTL_BASE + 8));
270 270
271 return status & 8; 271 return status & 8;
272} 272}
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index b866880e82ac..bbeca59df66b 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 f13188518025..000000000000
--- 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 e190dcd7d72d..7480f58267aa 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 1afa99ef97fa..7c032d0ab24a 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 3c364198db9c..183dc8b5511b 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/pci.c b/arch/arm/mach-iop13xx/pci.c
index 861cb12ef436..9082b84aeebb 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,
@@ -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 c70cf5b41e31..d45a80b3080e 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 daabb1fa6c2c..3181f61ea63e 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 c15a100ba779..02e20c3912ba 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 e2ada265bb8d..000000000000
--- 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 f7c1b6595660..000000000000
--- 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/common.c b/arch/arm/mach-ixp4xx/common.c
index a9f80943d01f..fdf91a160884 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 b2ef65db0e91..ebc0ba31ce85 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 ef37f2635b0e..000000000000
--- 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 97c530f66e78..eb68b61ce975 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 ca5c15a4e626..50bca5032b7e 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 055c85a1cc46..294779f892d9 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 a13299d758e1..760a0efe7580 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 e9a7180863d9..8f0d162a1e1d 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 4ab35065a144..43d16d6714b8 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 000000000000..f2fbb023e679
--- /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 aeb234d0d0e3..20af53a56c0e 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 e4eb450de301..70c5a2882409 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 413e2c8ef5fe..001ca8c96980 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 d7a9198ed300..d084b1e2943a 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 000000000000..158fb97d0397
--- /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 000000000000..f7d32834b757
--- /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 1201191d7f1b..3991077f58a2 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 304dd1abfdca..bcffd7ca1ca2 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 6e1bac929ab5..2c1a453df201 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 be90b7d0e10b..c49b177c1523 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 61d9a552a054..23dcb19cc2a7 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 bdaed3867d13..7cb55f982243 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 a115142f8690..5c82b7dce4e2 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 84f340b546c0..000000000000
--- 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 5d0ab61700d2..000000000000
--- 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 c5b68510776b..041653a04a9c 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/irq.c b/arch/arm/mach-kirkwood/irq.c
index 720063ffa19d..884703535a0a 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 e6bba01bae38..88b0788bacae 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 31ae8de34e93..a3b091470b8a 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 7e99c3f340fc..134ef50d58fc 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 6e8b2efa3c35..ec544918b12c 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 f742a66a7045..19072c84008f 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 ef922079348b..9717101a7437 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 4ea70e5f7137..28d0abaf4bd9 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 5bbca2680442..367a9400f532 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/cpu.c b/arch/arm/mach-ks8695/cpu.c
index 7f3f24053a00..ddb24222918e 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/include/mach/hardware.h b/arch/arm/mach-ks8695/include/mach/hardware.h
index 5e0c388143da..5090338c0db2 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/regs-timer.h b/arch/arm/mach-ks8695/include/mach/regs-timer.h
deleted file mode 100644
index e620cda99d2d..000000000000
--- 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 9495cb4d701a..8879d610308a 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/time.c b/arch/arm/mach-ks8695/time.c
index ec783a3070ae..46c84bc7792c 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 697323b5f92d..d7392a475247 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 a48dc2dec485..0d4db8c544b5 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/hardware.h b/arch/arm/mach-lpc32xx/include/mach/hardware.h
index 33e1dde37bd9..69065de97a3d 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 5b1cc35e6fba..3c6332753358 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 b07dcc90829d..8f2a2f8712d7 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -37,6 +37,8 @@
37#include <linux/of_irq.h> 37#include <linux/of_irq.h>
38#include <linux/of_platform.h> 38#include <linux/of_platform.h>
39#include <linux/clk.h> 39#include <linux/clk.h>
40#include <linux/mtd/lpc32xx_slc.h>
41#include <linux/mtd/lpc32xx_mlc.h>
40 42
41#include <asm/setup.h> 43#include <asm/setup.h>
42#include <asm/mach-types.h> 44#include <asm/mach-types.h>
@@ -223,6 +225,14 @@ static struct mmci_platform_data lpc32xx_mmci_data = {
223 * gather, and the MMCI driver doesn't do it this way */ 225 * gather, and the MMCI driver doesn't do it this way */
224}; 226};
225 227
228static struct lpc32xx_slc_platform_data lpc32xx_slc_data = {
229 .dma_filter = pl08x_filter_id,
230};
231
232static struct lpc32xx_mlc_platform_data lpc32xx_mlc_data = {
233 .dma_filter = pl08x_filter_id,
234};
235
226static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = { 236static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
227 OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", &lpc32xx_ssp0_data), 237 OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", &lpc32xx_ssp0_data),
228 OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", &lpc32xx_ssp1_data), 238 OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", &lpc32xx_ssp1_data),
@@ -230,6 +240,10 @@ static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
230 OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd), 240 OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd),
231 OF_DEV_AUXDATA("arm,pl18x", 0x20098000, "20098000.sd", 241 OF_DEV_AUXDATA("arm,pl18x", 0x20098000, "20098000.sd",
232 &lpc32xx_mmci_data), 242 &lpc32xx_mmci_data),
243 OF_DEV_AUXDATA("nxp,lpc3220-slc", 0x20020000, "20020000.flash",
244 &lpc32xx_slc_data),
245 OF_DEV_AUXDATA("nxp,lpc3220-mlc", 0x200a8000, "200a8000.flash",
246 &lpc32xx_mlc_data),
233 { } 247 { }
234}; 248};
235 249
@@ -253,12 +267,6 @@ static void __init lpc3250_machine_init(void)
253 267
254 of_platform_populate(NULL, of_default_bus_match_table, 268 of_platform_populate(NULL, of_default_bus_match_table,
255 lpc32xx_auxdata_lookup, NULL); 269 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} 270}
263 271
264static char const *lpc32xx_dt_compat[] __initdata = { 272static char const *lpc32xx_dt_compat[] __initdata = {
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig
index 7fddd01b85b9..d697d07a1bf0 100644
--- a/arch/arm/mach-mmp/Kconfig
+++ b/arch/arm/mach-mmp/Kconfig
@@ -108,18 +108,21 @@ endmenu
108config CPU_PXA168 108config CPU_PXA168
109 bool 109 bool
110 select CPU_MOHAWK 110 select CPU_MOHAWK
111 select COMMON_CLK
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
116 select CPU_MOHAWK 117 select CPU_MOHAWK
118 select COMMON_CLK
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
122 select CPU_PJ4 124 select CPU_PJ4
125 select COMMON_CLK
123 help 126 help
124 Select code specific to MMP2. MMP2 is ARMv7 compatible. 127 Select code specific to MMP2. MMP2 is ARMv7 compatible.
125 128
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile
index b786f7e6cd1f..095c155d6fb8 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 223090b1444d..e5dba9c5dc54 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 000000000000..21d22002cd19
--- /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 000000000000..5e6c18ccebd4
--- /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 000000000000..933ea71d0b56
--- /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 1c9d6c1ea97a..bd453274fca2 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/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h
index cba22fed2265..c4ca4d17194a 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 09dcd6e2b6a8..37632d964d50 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 793634c837ef..3b58a3b2d7df 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 68b0c93ec6a1..ddc812f40341 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 7af8deb63e83..93c8d0e29bb9 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/irq.c b/arch/arm/mach-mmp/irq.c
index e60c7d98922b..3c71246cd994 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 c709a24a9d25..3a3768c7a191 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 62d787c34475..b7f074f15498 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 6da52e9f2bdc..8b1e16fbb7a5 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 7e8a5a2e1ec7..a6c08ede4491 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 42bef6674ecf..dd30ea74785c 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-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 1cd40ad301d3..b2740c800e8c 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -38,8 +38,6 @@ config ARCH_QSD8X50
38 38
39config ARCH_MSM8X60 39config ARCH_MSM8X60
40 bool "MSM8X60" 40 bool "MSM8X60"
41 select MACH_MSM8X60_SURF if (!MACH_MSM8X60_RUMI3 && !MACH_MSM8X60_SIM \
42 && !MACH_MSM8X60_FFA)
43 select ARCH_MSM_SCORPIONMP 41 select ARCH_MSM_SCORPIONMP
44 select ARM_GIC 42 select ARM_GIC
45 select CPU_V7 43 select CPU_V7
@@ -47,16 +45,17 @@ config ARCH_MSM8X60
47 select GPIO_MSM_V2 45 select GPIO_MSM_V2
48 select MSM_GPIOMUX 46 select MSM_GPIOMUX
49 select MSM_SCM if SMP 47 select MSM_SCM if SMP
48 select USE_OF
50 49
51config ARCH_MSM8960 50config ARCH_MSM8960
52 bool "MSM8960" 51 bool "MSM8960"
53 select ARCH_MSM_SCORPIONMP 52 select ARCH_MSM_SCORPIONMP
54 select MACH_MSM8960_SIM if (!MACH_MSM8960_RUMI3)
55 select ARM_GIC 53 select ARM_GIC
56 select CPU_V7 54 select CPU_V7
57 select MSM_V2_TLMM 55 select MSM_V2_TLMM
58 select MSM_GPIOMUX 56 select MSM_GPIOMUX
59 select MSM_SCM if SMP 57 select MSM_SCM if SMP
58 select USE_OF
60 59
61endchoice 60endchoice
62 61
@@ -112,42 +111,6 @@ config MACH_QSD8X50A_ST1_5
112 help 111 help
113 Support for the Qualcomm ST1.5. 112 Support for the Qualcomm ST1.5.
114 113
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 114endmenu
152 115
153config MSM_SMD_PKG3 116config MSM_SMD_PKG3
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 4ad3969b9881..17519faf082f 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 805d4ee53f7e..000000000000
--- 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 415de2eb9a5e..000000000000
--- 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 000000000000..b5b4de2cdf9e
--- /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 000000000000..4490edb71c17
--- /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 4fa3e99d9a62..6ce542e2e21c 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 cf1f89a5dc62..df00bc03ce74 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 451ab1d43c92..000000000000
--- 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 a5001378135d..effa6f4336c7 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 65f4a1daa2e5..000000000000
--- 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 e37a724cd1eb..000000000000
--- 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 c8fe0edb9761..a344a373928b 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -32,11 +32,10 @@
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 38#include "common.h"
39extern struct sys_timer msm_timer;
40 39
41static const resource_size_t qsd8x50_surf_smc91x_base __initdata = 0x70000300; 40static const resource_size_t qsd8x50_surf_smc91x_base __initdata = 0x70000300;
42static const unsigned qsd8x50_surf_smc91x_gpio __initdata = 156; 41static const unsigned qsd8x50_surf_smc91x_gpio __initdata = 156;
@@ -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 2e569ab10eef..b7b0fc7e3278 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 8650342b7493..3723e55819d6 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 89bf6b426699..f9a5db6d2ced 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 bbe13f12fa01..4ba0800e243e 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 63b711311086..a52c970df157 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 000000000000..633a7159d5ff
--- /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 000000000000..a9bab53dddf4
--- /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 993780f490ad..f66ee6ea8720 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 09b4f1403824..e90ab5938c5f 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 d9e1f26475de..000000000000
--- 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 131633b12a34..4db61d5fe317 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 02cae5e2951c..354b91d4c3ac 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 a446fc14221f..750446feb444 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 0c9e13c65743..000000000000
--- 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 435f8edfafd1..8cebedb11233 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 40a8c178f10d..000000000000
--- 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/msm_iomap-7x00.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
index 6c4046c21296..67dc0e98b958 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 f944fe65a657..198202c267c8 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 a1752c0284fc..9819a556acae 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 da77cc1d545d..0faa894729b7 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 5aed57dc808c..c6d38f1d0c98 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
@@ -63,12 +63,8 @@
63#define MSM8X60_TMR0_SIZE SZ_4K 63#define MSM8X60_TMR0_SIZE SZ_4K
64 64
65#ifdef CONFIG_DEBUG_MSM8660_UART 65#ifdef CONFIG_DEBUG_MSM8660_UART
66#define MSM_DEBUG_UART_BASE 0xE1040000 66#define MSM_DEBUG_UART_BASE 0xF0040000
67#define MSM_DEBUG_UART_PHYS 0x19C40000 67#define MSM_DEBUG_UART_PHYS 0x19C40000
68#endif 68#endif
69 69
70#ifndef __ASSEMBLY__
71extern void msm_map_msm8x60_io(void);
72#endif
73
74#endif 70#endif
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 f5fb2ec87ffe..000000000000
--- 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 a1e7b1168850..3854f6f20ce2 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,
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index e012dc8391cf..7ed69b69c87c 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 9980dc736e7b..8f1eecd88186 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 657be73297db..c5a2eddc6cdc 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 812808254936..476549a8a709 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 a9bc84180d21..343c435b4176 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,7 +48,7 @@ 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/*
@@ -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 3057f7d4329a..131cd4883f3d 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,
diff --git a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
index eb187e0e059b..5f03484584d4 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 c7d9d00d8fc1..000000000000
--- 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 e807c4c52a0b..46200a183cf2 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 eff9a750bbe2..32073444024b 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 2e56e86b6d68..a9a154a646dd 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 caa2c5e734fe..416d46ef7ebd 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 e61d2b8fdf50..57f996b6aa0e 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 2579a2fc2334..000000000000
--- 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 000000000000..fe454a4430be
--- /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 4ef923b032ec..49d791548ad6 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 25f0ca8d7820..aac9bebc6b03 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 40a8c178f10d..40a8c178f10d 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 ab324a3748f2..000000000000
--- 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 d6a100ccf302..000000000000
--- 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 9a8bbda195b2..ecc431909d6f 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 fed3695a1339..3d3c8a973062 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 4582999cf080..07b11fe6453f 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 9ee5cede3d42..000000000000
--- 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 fcab431060f4..000000000000
--- 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 cf50b5a66dda..000000000000
--- 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 19659de1c4e8..000000000000
--- 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 5f72d9787444..000000000000
--- 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 27608f5d2ac8..000000000000
--- 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 46824501de00..000000000000
--- 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 ae96a4fd8f14..000000000000
--- 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 43a6b4bae6fe..000000000000
--- 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 cd99f19ec637..000000000000
--- 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 3e22df5944a8..000000000000
--- 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 79222ec8ede1..000000000000
--- 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 b33c9d05c552..000000000000
--- 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 680f5a902936..000000000000
--- 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 f6e3a60b4201..000000000000
--- 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 76b53f73418e..000000000000
--- 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 639eaee15553..000000000000
--- 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/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index de6c7ba42544..4dec79563f19 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -17,21 +17,12 @@ extern void mxs_timer_init(int);
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 27
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
37#endif /* __MACH_MXS_COMMON_H__ */ 28#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 e8b1d958240b..000000000000
--- 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 40a8c178f10d..000000000000
--- 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 b0190a4822f2..000000000000
--- 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 f50fefd10520..000000000000
--- 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 7abdf58b8bb7..000000000000
--- 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/iomux.c b/arch/arm/mach-mxs/iomux.c
deleted file mode 100644
index 0e804e2f11f4..000000000000
--- 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 f5f061757deb..000000000000
--- 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 4c00c879b893..000000000000
--- 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 e7272a41939d..000000000000
--- 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 dafd48e86c8c..000000000000
--- 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 8dabfe81d07c..433af893ad8a 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -12,8 +12,10 @@
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>
16#include <linux/init.h> 18#include <linux/gpio.h>
17#include <linux/init.h> 19#include <linux/init.h>
18#include <linux/irqdomain.h> 20#include <linux/irqdomain.h>
19#include <linux/micrel_phy.h> 21#include <linux/micrel_phy.h>
@@ -21,9 +23,12 @@
21#include <linux/of_irq.h> 23#include <linux/of_irq.h>
22#include <linux/of_platform.h> 24#include <linux/of_platform.h>
23#include <linux/phy.h> 25#include <linux/phy.h>
26#include <linux/pinctrl/consumer.h>
24#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
25#include <asm/mach/time.h> 28#include <asm/mach/time.h>
26#include <mach/common.h> 29#include <mach/common.h>
30#include <mach/digctl.h>
31#include <mach/mxs.h>
27 32
28static struct fb_videomode mx23evk_video_modes[] = { 33static struct fb_videomode mx23evk_video_modes[] = {
29 { 34 {
@@ -99,9 +104,40 @@ static struct fb_videomode apx4devkit_video_modes[] = {
99 104
100static struct mxsfb_platform_data mxsfb_pdata __initdata; 105static struct mxsfb_platform_data mxsfb_pdata __initdata;
101 106
107/*
108 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
109 */
110#define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
111
112static int flexcan0_en, flexcan1_en;
113
114static void mx28evk_flexcan_switch(void)
115{
116 if (flexcan0_en || flexcan1_en)
117 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 1);
118 else
119 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 0);
120}
121
122static void mx28evk_flexcan0_switch(int enable)
123{
124 flexcan0_en = enable;
125 mx28evk_flexcan_switch();
126}
127
128static void mx28evk_flexcan1_switch(int enable)
129{
130 flexcan1_en = enable;
131 mx28evk_flexcan_switch();
132}
133
134static struct flexcan_platform_data flexcan_pdata[2];
135
102static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = { 136static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
103 OF_DEV_AUXDATA("fsl,imx23-lcdif", 0x80030000, NULL, &mxsfb_pdata), 137 OF_DEV_AUXDATA("fsl,imx23-lcdif", 0x80030000, NULL, &mxsfb_pdata),
104 OF_DEV_AUXDATA("fsl,imx28-lcdif", 0x80030000, NULL, &mxsfb_pdata), 138 OF_DEV_AUXDATA("fsl,imx28-lcdif", 0x80030000, NULL, &mxsfb_pdata),
139 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]),
140 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]),
105 { /* sentinel */ } 141 { /* sentinel */ }
106}; 142};
107 143
@@ -237,13 +273,21 @@ static void __init imx28_evk_init(void)
237 mxsfb_pdata.mode_count = ARRAY_SIZE(mx28evk_video_modes); 273 mxsfb_pdata.mode_count = ARRAY_SIZE(mx28evk_video_modes);
238 mxsfb_pdata.default_bpp = 32; 274 mxsfb_pdata.default_bpp = 32;
239 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT; 275 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
276
277 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
240} 278}
241 279
242static void __init m28evk_init(void) 280static void __init imx28_evk_post_init(void)
243{ 281{
244 enable_clk_enet_out(); 282 if (!gpio_request_one(MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT,
245 update_fec_mac_prop(OUI_DENX); 283 "flexcan-switch")) {
284 flexcan_pdata[0].transceiver_switch = mx28evk_flexcan0_switch;
285 flexcan_pdata[1].transceiver_switch = mx28evk_flexcan1_switch;
286 }
287}
246 288
289static void __init m28evk_init(void)
290{
247 mxsfb_pdata.mode_list = m28evk_video_modes; 291 mxsfb_pdata.mode_list = m28evk_video_modes;
248 mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes); 292 mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
249 mxsfb_pdata.default_bpp = 16; 293 mxsfb_pdata.default_bpp = 16;
@@ -270,6 +314,80 @@ static void __init apx4devkit_init(void)
270 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT; 314 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
271} 315}
272 316
317#define ENET0_MDC__GPIO_4_0 MXS_GPIO_NR(4, 0)
318#define ENET0_MDIO__GPIO_4_1 MXS_GPIO_NR(4, 1)
319#define ENET0_RX_EN__GPIO_4_2 MXS_GPIO_NR(4, 2)
320#define ENET0_RXD0__GPIO_4_3 MXS_GPIO_NR(4, 3)
321#define ENET0_RXD1__GPIO_4_4 MXS_GPIO_NR(4, 4)
322#define ENET0_TX_EN__GPIO_4_6 MXS_GPIO_NR(4, 6)
323#define ENET0_TXD0__GPIO_4_7 MXS_GPIO_NR(4, 7)
324#define ENET0_TXD1__GPIO_4_8 MXS_GPIO_NR(4, 8)
325#define ENET_CLK__GPIO_4_16 MXS_GPIO_NR(4, 16)
326
327#define TX28_FEC_PHY_POWER MXS_GPIO_NR(3, 29)
328#define TX28_FEC_PHY_RESET MXS_GPIO_NR(4, 13)
329#define TX28_FEC_nINT MXS_GPIO_NR(4, 5)
330
331static const struct gpio tx28_gpios[] __initconst = {
332 { ENET0_MDC__GPIO_4_0, GPIOF_OUT_INIT_LOW, "GPIO_4_0" },
333 { ENET0_MDIO__GPIO_4_1, GPIOF_OUT_INIT_LOW, "GPIO_4_1" },
334 { ENET0_RX_EN__GPIO_4_2, GPIOF_OUT_INIT_LOW, "GPIO_4_2" },
335 { ENET0_RXD0__GPIO_4_3, GPIOF_OUT_INIT_LOW, "GPIO_4_3" },
336 { ENET0_RXD1__GPIO_4_4, GPIOF_OUT_INIT_LOW, "GPIO_4_4" },
337 { ENET0_TX_EN__GPIO_4_6, GPIOF_OUT_INIT_LOW, "GPIO_4_6" },
338 { ENET0_TXD0__GPIO_4_7, GPIOF_OUT_INIT_LOW, "GPIO_4_7" },
339 { ENET0_TXD1__GPIO_4_8, GPIOF_OUT_INIT_LOW, "GPIO_4_8" },
340 { ENET_CLK__GPIO_4_16, GPIOF_OUT_INIT_LOW, "GPIO_4_16" },
341 { TX28_FEC_PHY_POWER, GPIOF_OUT_INIT_LOW, "fec-phy-power" },
342 { TX28_FEC_PHY_RESET, GPIOF_OUT_INIT_LOW, "fec-phy-reset" },
343 { TX28_FEC_nINT, GPIOF_DIR_IN, "fec-int" },
344};
345
346static void __init tx28_post_init(void)
347{
348 struct device_node *np;
349 struct platform_device *pdev;
350 struct pinctrl *pctl;
351 int ret;
352
353 enable_clk_enet_out();
354
355 np = of_find_compatible_node(NULL, NULL, "fsl,imx28-fec");
356 pdev = of_find_device_by_node(np);
357 if (!pdev) {
358 pr_err("%s: failed to find fec device\n", __func__);
359 return;
360 }
361
362 pctl = pinctrl_get_select(&pdev->dev, "gpio_mode");
363 if (IS_ERR(pctl)) {
364 pr_err("%s: failed to get pinctrl state\n", __func__);
365 return;
366 }
367
368 ret = gpio_request_array(tx28_gpios, ARRAY_SIZE(tx28_gpios));
369 if (ret) {
370 pr_err("%s: failed to request gpios: %d\n", __func__, ret);
371 return;
372 }
373
374 /* Power up fec phy */
375 gpio_set_value(TX28_FEC_PHY_POWER, 1);
376 msleep(26); /* 25ms according to data sheet */
377
378 /* Mode strap pins */
379 gpio_set_value(ENET0_RX_EN__GPIO_4_2, 1);
380 gpio_set_value(ENET0_RXD0__GPIO_4_3, 1);
381 gpio_set_value(ENET0_RXD1__GPIO_4_4, 1);
382
383 udelay(100); /* minimum assertion time for nRST */
384
385 /* Deasserting FEC PHY RESET */
386 gpio_set_value(TX28_FEC_PHY_RESET, 1);
387
388 pinctrl_put(pctl);
389}
390
273static void __init mxs_machine_init(void) 391static void __init mxs_machine_init(void)
274{ 392{
275 if (of_machine_is_compatible("fsl,imx28-evk")) 393 if (of_machine_is_compatible("fsl,imx28-evk"))
@@ -283,22 +401,20 @@ static void __init mxs_machine_init(void)
283 401
284 of_platform_populate(NULL, of_default_bus_match_table, 402 of_platform_populate(NULL, of_default_bus_match_table,
285 mxs_auxdata_lookup, NULL); 403 mxs_auxdata_lookup, NULL);
404
405 if (of_machine_is_compatible("karo,tx28"))
406 tx28_post_init();
407
408 if (of_machine_is_compatible("fsl,imx28-evk"))
409 imx28_evk_post_init();
286} 410}
287 411
288static const char *imx23_dt_compat[] __initdata = { 412static const char *imx23_dt_compat[] __initdata = {
289 "fsl,imx23-evk",
290 "fsl,stmp378x_devb"
291 "olimex,imx23-olinuxino",
292 "fsl,imx23", 413 "fsl,imx23",
293 NULL, 414 NULL,
294}; 415};
295 416
296static const char *imx28_dt_compat[] __initdata = { 417static 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", 418 "fsl,imx28",
303 NULL, 419 NULL,
304}; 420};
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 6548965e4a76..000000000000
--- 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 8837029de1a4..000000000000
--- 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 dccb67a9e7c4..a4294aa9f301 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 0f71f82101cc..000000000000
--- 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 8ed425457d30..000000000000
--- 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-netx/nxdb500.c b/arch/arm/mach-netx/nxdb500.c
index 180ea899a48a..8b781ff7c9e9 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 58009e29b20e..b26dbce334f2 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 122e99826ef6..257382efafa0 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/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index f4535a7dadf5..381c08027df4 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -34,7 +34,7 @@
34#include <plat/gpio-nomadik.h> 34#include <plat/gpio-nomadik.h>
35#include <plat/mtu.h> 35#include <plat/mtu.h>
36 36
37#include <mach/nand.h> 37#include <linux/platform_data/mtd-nomadik-nand.h>
38#include <mach/fsmc.h> 38#include <mach/fsmc.h>
39 39
40#include "cpu-8815.h" 40#include "cpu-8815.h"
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 efdde0ae0a4f..000000000000
--- 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 6316dba3bfc8..02035e459f50 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/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index 071003bc8456..7d4687e9cbdf 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/ams-delta-fiq-handler.S b/arch/arm/mach-omap1/ams-delta-fiq-handler.S
index d2b6acce8fc1..3d1e1c250a1a 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq-handler.S
+++ b/arch/arm/mach-omap1/ams-delta-fiq-handler.S
@@ -16,7 +16,7 @@
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/irqs.h>
22#include <mach/ams-delta-fiq.h> 22#include <mach/ams-delta-fiq.h>
diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c
index 68e8e5654c0a..f12a12af3523 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 6f192c4900b1..9518bf5996dc 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -35,9 +35,9 @@
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37 37
38#include <plat/board-ams-delta.h> 38#include <mach/board-ams-delta.h>
39#include <plat/keypad.h> 39#include <linux/platform_data/keypad-omap.h>
40#include <plat/mux.h> 40#include <mach/mux.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 6d985521a39e..4b6de70c47a6 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -28,10 +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 35
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37 37
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 04b5fdaff831..4ec579fdd366 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -22,7 +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 26
27#include <mach/usb.h> 27#include <mach/usb.h>
28 28
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index fe79c56b2dc0..af283a2bc7c7 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -37,12 +37,12 @@
37#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
39 39
40#include <plat/mux.h> 40#include <mach/mux.h>
41#include <plat/dma.h> 41#include <plat/dma.h>
42#include <plat/tc.h> 42#include <plat/tc.h>
43#include <plat/irda.h> 43#include <mach/irda.h>
44#include <plat/keypad.h> 44#include <linux/platform_data/keypad-omap.h>
45#include <plat/flash.h> 45#include <mach/flash.h>
46 46
47#include <mach/hardware.h> 47#include <mach/hardware.h>
48#include <mach/usb.h> 48#include <mach/usb.h>
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 6c46f33894fb..06d11b1ee9c6 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -39,11 +39,11 @@
39#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
40#include <asm/mach/map.h> 40#include <asm/mach/map.h>
41 41
42#include <plat/mux.h> 42#include <mach/mux.h>
43#include <plat/tc.h> 43#include <plat/tc.h>
44#include <plat/keypad.h> 44#include <linux/platform_data/keypad-omap.h>
45#include <plat/dma.h> 45#include <plat/dma.h>
46#include <plat/flash.h> 46#include <mach/flash.h>
47 47
48#include <mach/hardware.h> 48#include <mach/hardware.h>
49#include <mach/irqs.h> 49#include <mach/irqs.h>
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 1dcb751b8fe5..87ab2086ef96 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -37,12 +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 <mach/omap7xx.h> 45#include <mach/omap7xx.h>
45#include <plat/keypad.h>
46#include <plat/mmc.h> 46#include <plat/mmc.h>
47 47
48#include <mach/irqs.h> 48#include <mach/irqs.h>
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index f21c2966daad..db5f7d2976e7 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 ec01f03d0446..7d5c06d6a52a 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -21,13 +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/keypad.h>
30#include <plat/lcd_mipid.h>
31#include <plat/mmc.h> 32#include <plat/mmc.h>
32#include <plat/clock.h> 33#include <plat/clock.h>
33 34
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 3b2d9071022a..2f1f9b967576 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -46,8 +46,8 @@
46#include <asm/mach/arch.h> 46#include <asm/mach/arch.h>
47#include <asm/mach/map.h> 47#include <asm/mach/map.h>
48 48
49#include <plat/flash.h> 49#include <mach/flash.h>
50#include <plat/mux.h> 50#include <mach/mux.h>
51#include <plat/tc.h> 51#include <plat/tc.h>
52 52
53#include <mach/hardware.h> 53#include <mach/hardware.h>
@@ -304,7 +304,7 @@ static struct omap_lcd_config osk_lcd_config __initdata = {
304#include <linux/spi/spi.h> 304#include <linux/spi/spi.h>
305#include <linux/spi/ads7846.h> 305#include <linux/spi/ads7846.h>
306 306
307#include <plat/keypad.h> 307#include <linux/platform_data/keypad-omap.h>
308 308
309static struct at24_platform_data at24c04 = { 309static struct at24_platform_data at24c04 = {
310 .byte_len = SZ_4K / 8, 310 .byte_len = SZ_4K / 8,
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 49f8d745ea1f..1c578d58923a 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -34,12 +34,12 @@
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/flash.h> 37#include <mach/flash.h>
38#include <plat/mux.h> 38#include <mach/mux.h>
39#include <plat/tc.h> 39#include <plat/tc.h>
40#include <plat/dma.h> 40#include <plat/dma.h>
41#include <plat/irda.h> 41#include <mach/irda.h>
42#include <plat/keypad.h> 42#include <linux/platform_data/keypad-omap.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 01523cd78e58..97158095083c 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -34,12 +34,12 @@
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <plat/led.h> 36#include <plat/led.h>
37#include <plat/flash.h> 37#include <mach/flash.h>
38#include <plat/mux.h> 38#include <mach/mux.h>
39#include <plat/dma.h> 39#include <plat/dma.h>
40#include <plat/tc.h> 40#include <plat/tc.h>
41#include <plat/irda.h> 41#include <mach/irda.h>
42#include <plat/keypad.h> 42#include <linux/platform_data/keypad-omap.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 a7abce69043a..e311032e7eeb 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -36,12 +36,12 @@
36#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38 38
39#include <plat/flash.h> 39#include <mach/flash.h>
40#include <plat/mux.h> 40#include <mach/mux.h>
41#include <plat/dma.h> 41#include <plat/dma.h>
42#include <plat/tc.h> 42#include <plat/tc.h>
43#include <plat/irda.h> 43#include <mach/irda.h>
44#include <plat/keypad.h> 44#include <linux/platform_data/keypad-omap.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 277e0bc60a43..198b05417bfc 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -22,16 +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 35
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37 37
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c
index b59f78850e69..5932d56e17bf 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 2e1fff26a2f3..13bf2cc56814 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -28,18 +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/keypad.h> 42#include <mach/board-sx1.h>
42#include <plat/board-sx1.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-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 1668af3017de..ad75e3411d46 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -31,9 +31,9 @@
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 38
39#include <mach/hardware.h> 39#include <mach/hardware.h>
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 7a5a3285e965..726c02c9c0cd 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -20,7 +20,7 @@
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/mux.h> 23#include <mach/mux.h>
24#include <plat/dma.h> 24#include <plat/dma.h>
25#include <plat/mmc.h> 25#include <plat/mmc.h>
26 26
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index 401eb3c080c2..73ae6169aa4a 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/i2c.c b/arch/arm/mach-omap1/i2c.c
index 5446c9912641..a0551a6d7451 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/plat-omap/include/plat/board-ams-delta.h b/arch/arm/mach-omap1/include/mach/board-ams-delta.h
index ad6f865d1f16..ad6f865d1f16 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 355adbdaae33..355adbdaae33 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 27916b210f57..27916b210f57 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 0d88499b79e9..0d88499b79e9 100644
--- a/arch/arm/plat-omap/include/plat/flash.h
+++ b/arch/arm/mach-omap1/include/mach/flash.h
diff --git a/arch/arm/plat-omap/include/plat/irda.h b/arch/arm/mach-omap1/include/mach/irda.h
index 40f60339d1c6..40f60339d1c6 100644
--- a/arch/arm/plat-omap/include/plat/irda.h
+++ b/arch/arm/mach-omap1/include/mach/irda.h
diff --git a/arch/arm/plat-omap/include/plat/mux.h b/arch/arm/mach-omap1/include/mach/mux.h
index 323948959200..323948959200 100644
--- a/arch/arm/plat-omap/include/plat/mux.h
+++ b/arch/arm/mach-omap1/include/mach/mux.h
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 80a371c06e59..000000000000
--- 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 6c95a59f0f16..6a5baab1f4cb 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/leds.c b/arch/arm/mach-omap1/leds.c
index 7b1a3833165d..4071479f7106 100644
--- a/arch/arm/mach-omap1/leds.c
+++ b/arch/arm/mach-omap1/leds.c
@@ -11,7 +11,7 @@
11#include <asm/leds.h> 11#include <asm/leds.h>
12#include <asm/mach-types.h> 12#include <asm/mach-types.h>
13 13
14#include <plat/mux.h> 14#include <mach/mux.h>
15 15
16#include "leds.h" 16#include "leds.h"
17 17
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index adf00975b9bb..bdc2e7541adb 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 e9cc52d4cb28..667ce5027f63 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 b2560d32b3a0..47ec16155483 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 0d1709b1a6fe..b9d6834af835 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -22,7 +22,7 @@
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <plat/mux.h> 25#include <mach/mux.h>
26#include <plat/fpga.h> 26#include <plat/fpga.h>
27 27
28#include "pm.h" 28#include "pm.h"
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index 65f88176fba8..84267edd9421 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 346fd26f3aa6..eef99b77c40b 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -18,6 +18,7 @@ config ARCH_OMAP2PLUS_TYPICAL
18 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4 18 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
19 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4 19 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
20 select HIGHMEM 20 select HIGHMEM
21 select PINCTRL
21 help 22 help
22 Compile a kernel suitable for booting most boards 23 Compile a kernel suitable for booting most boards
23 24
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 0deb30072977..b807deb0f521 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
@@ -231,10 +211,10 @@ obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
231obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o 211obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
232obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o 212obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
233obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o 213obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
234obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o 214obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o
235obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o 215obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o
236obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o 216obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o
237obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o 217obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o
238obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o 218obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o
239obj-$(CONFIG_MACH_OVERO) += board-overo.o 219obj-$(CONFIG_MACH_OVERO) += board-overo.o
240obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o 220obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o
diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c
index 2c90ac686686..d0c54c573d34 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 95594495fcf6..95594495fcf6 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 0900eac57d56..95b384d54f8a 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -36,7 +36,7 @@
36#include "common.h" 36#include "common.h"
37#include <plat/gpmc.h> 37#include <plat/gpmc.h>
38#include <plat/usb.h> 38#include <plat/usb.h>
39#include <plat/gpmc-smc91x.h> 39#include "gpmc-smc91x.h"
40 40
41#include <video/omapdss.h> 41#include <video/omapdss.h>
42#include <video/omap-panel-generic-dpi.h> 42#include <video/omap-panel-generic-dpi.h>
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 5453173ff57b..96cd3693e1ae 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -24,12 +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 <asm/mach-types.h> 29#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
31 32
32#include <plat/mcspi.h>
33#include <plat/usb.h> 33#include <plat/usb.h>
34#include "common.h" 34#include "common.h"
35#include <plat/dma.h> 35#include <plat/dma.h>
@@ -37,7 +37,7 @@
37#include <video/omapdss.h> 37#include <video/omapdss.h>
38#include <video/omap-panel-tfp410.h> 38#include <video/omap-panel-tfp410.h>
39 39
40#include <plat/gpmc-smc91x.h> 40#include "gpmc-smc91x.h"
41 41
42#include "board-flash.h" 42#include "board-flash.h"
43#include "mux.h" 43#include "mux.h"
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 8518b1345988..fc224ad86747 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -17,7 +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/gpmc-smc91x.h> 20#include "gpmc-smc91x.h"
21#include <plat/usb.h> 21#include <plat/usb.h>
22 22
23#include <mach/board-zoom.h> 23#include <mach/board-zoom.h>
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index db43e22526c0..6fe90796d462 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -36,7 +36,7 @@
36#include "common.h" 36#include "common.h"
37#include <plat/usb.h> 37#include <plat/usb.h>
38#include <plat/mmc.h> 38#include <plat/mmc.h>
39#include <plat/omap4-keypad.h> 39#include "omap4-keypad.h"
40#include <video/omapdss.h> 40#include <video/omapdss.h>
41#include <video/omap-panel-nokia-dsi.h> 41#include <video/omap-panel-nokia-dsi.h>
42#include <video/omap-panel-picodlp.h> 42#include <video/omap-panel-picodlp.h>
@@ -907,6 +907,7 @@ static void __init omap_4430sdp_init(void)
907MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") 907MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
908 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ 908 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
909 .atag_offset = 0x100, 909 .atag_offset = 0x100,
910 .smp = smp_ops(omap4_smp_ops),
910 .reserve = omap_reserve, 911 .reserve = omap_reserve,
911 .map_io = omap4_map_io, 912 .map_io = omap4_map_io,
912 .init_early = omap4430_init_early, 913 .init_early = omap4430_init_early,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 403d048a00ee..0d99c9110d01 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -27,7 +27,7 @@
27#include <linux/mmc/host.h> 27#include <linux/mmc/host.h>
28#include <linux/platform_data/gpio-omap.h> 28#include <linux/platform_data/gpio-omap.h>
29 29
30#include <mach/am35xx.h> 30#include "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>
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 34cb90471d96..8ffd612c5e07 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -39,13 +39,13 @@
39#include <asm/mach/map.h> 39#include <asm/mach/map.h>
40 40
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,
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 27a5450751ed..59c0a45f75b0 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -40,10 +40,10 @@
40 40
41#include "common.h" 41#include "common.h"
42#include <plat/usb.h> 42#include <plat/usb.h>
43#include <plat/nand.h> 43#include <linux/platform_data/mtd-nand-omap2.h>
44#include <plat/gpmc.h> 44#include <plat/gpmc.h>
45 45
46#include <mach/am35xx.h> 46#include "am35xx.h"
47 47
48#include "mux.h" 48#include "mux.h"
49#include "control.h" 49#include "control.h"
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 18b63ad56274..7bb8056d4388 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -32,7 +32,7 @@
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#include <mach/id.h> 35#include "id.h"
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
@@ -40,13 +40,13 @@
40 40
41#include "common.h" 41#include "common.h"
42#include <plat/gpmc.h> 42#include <plat/gpmc.h>
43#include <plat/nand.h> 43#include <linux/platform_data/mtd-nand-omap2.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 48
49#include <plat/mcspi.h> 49#include <linux/platform_data/spi-omap2-mcspi.h>
50#include <linux/input/matrix_keypad.h> 50#include <linux/input/matrix_keypad.h>
51#include <linux/spi/spi.h> 51#include <linux/spi/spi.h>
52#include <linux/dm9000.h> 52#include <linux/dm9000.h>
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 9017813f9abc..0cabe61cd507 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -19,8 +19,8 @@
19 19
20#include <plat/cpu.h> 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 "common.h"
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 2ea7c577b295..601ecdfb1cf9 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -125,6 +125,7 @@ static const char *omap4_boards_compat[] __initdata = {
125 125
126DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") 126DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
127 .reserve = omap_reserve, 127 .reserve = omap_reserve,
128 .smp = smp_ops(omap4_smp_ops),
128 .map_io = omap4_map_io, 129 .map_io = omap4_map_io,
129 .init_early = omap4430_init_early, 130 .init_early = omap4430_init_early,
130 .init_irq = omap_gic_of_init, 131 .init_irq = omap_gic_of_init,
@@ -145,6 +146,7 @@ static const char *omap5_boards_compat[] __initdata = {
145 146
146DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") 147DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
147 .reserve = omap_reserve, 148 .reserve = omap_reserve,
149 .smp = smp_ops(omap4_smp_ops),
148 .map_io = omap5_map_io, 150 .map_io = omap5_map_io,
149 .init_early = omap5_init_early, 151 .init_early = omap5_init_early,
150 .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 313b3f426a56..8d04bf851af4 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -34,7 +34,7 @@
34#include <plat/menelaus.h> 34#include <plat/menelaus.h>
35#include <plat/dma.h> 35#include <plat/dma.h>
36#include <plat/gpmc.h> 36#include <plat/gpmc.h>
37#include <plat/debug-devices.h> 37#include "debug-devices.h"
38 38
39#include <video/omapdss.h> 39#include <video/omapdss.h>
40#include <video/omap-panel-generic-dpi.h> 40#include <video/omap-panel-generic-dpi.h>
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 8408bb2748a6..fb8bd837dd13 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -35,7 +35,7 @@
35 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,
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 3f3a552b1036..ee8c3cfb95b3 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -28,17 +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 <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/mcspi.h>
37#include "common.h" 37#include "common.h"
38#include <plat/gpmc.h> 38#include <plat/gpmc.h>
39#include <mach/board-zoom.h> 39#include <mach/board-zoom.h>
40#include <plat/usb.h> 40#include <plat/usb.h>
41#include <plat/gpmc-smsc911x.h> 41#include "gpmc-smsc911x.h"
42 42
43#include <video/omapdss.h> 43#include <video/omapdss.h>
44#include <video/omap-panel-generic-dpi.h> 44#include <video/omap-panel-generic-dpi.h>
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 4b43fe311571..d95f727ca39a 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -20,6 +20,8 @@
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>
@@ -27,8 +29,6 @@
27 29
28#include "common.h" 30#include "common.h"
29#include <plat/menelaus.h> 31#include <plat/menelaus.h>
30#include <plat/mcspi.h>
31#include <plat/onenand.h>
32#include <plat/mmc.h> 32#include <plat/mmc.h>
33 33
34#include "mux.h" 34#include "mux.h"
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 801bcb4c5e22..68ff8d51973c 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -42,7 +42,7 @@
42#include <video/omapdss.h> 42#include <video/omapdss.h>
43#include <video/omap-panel-tfp410.h> 43#include <video/omap-panel-tfp410.h>
44#include <plat/gpmc.h> 44#include <plat/gpmc.h>
45#include <plat/nand.h> 45#include <linux/platform_data/mtd-nand-omap2.h>
46#include <plat/usb.h> 46#include <plat/usb.h>
47#include <plat/omap_device.h> 47#include <plat/omap_device.h>
48 48
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index b94873d0c6b6..3fe5f0f69c73 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -45,9 +45,9 @@
45#include <asm/mach/map.h> 45#include <asm/mach/map.h>
46 46
47#include <plat/usb.h> 47#include <plat/usb.h>
48#include <plat/nand.h> 48#include <linux/platform_data/mtd-nand-omap2.h>
49#include "common.h" 49#include "common.h"
50#include <plat/mcspi.h> 50#include <linux/platform_data/spi-omap2-mcspi.h>
51#include <video/omapdss.h> 51#include <video/omapdss.h>
52#include <video/omap-panel-tfp410.h> 52#include <video/omap-panel-tfp410.h>
53 53
@@ -118,7 +118,7 @@ static void __init omap3_evm_get_revision(void)
118} 118}
119 119
120#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 120#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
121#include <plat/gpmc-smsc911x.h> 121#include "gpmc-smsc911x.h"
122 122
123static struct omap_smsc911x_platform_data smsc911x_cfg = { 123static struct omap_smsc911x_platform_data smsc911x_cfg = {
124 .cs = OMAP3EVM_SMSC911X_CS, 124 .cs = OMAP3EVM_SMSC911X_CS,
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index b5e56fa83c19..7bd8253b5d1d 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -34,7 +34,7 @@
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/gpmc-smsc911x.h> 37#include "gpmc-smsc911x.h"
38#include <plat/gpmc.h> 38#include <plat/gpmc.h>
39#include <plat/sdrc.h> 39#include <plat/sdrc.h>
40#include <plat/usb.h> 40#include <plat/usb.h>
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index e700a98feba6..00a1f4ae6e44 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -35,16 +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 "common.h" 44#include "common.h"
44#include <plat/mcspi.h>
45#include <plat/usb.h> 45#include <plat/usb.h>
46#include <video/omapdss.h> 46#include <video/omapdss.h>
47#include <plat/nand.h> 47#include <linux/platform_data/mtd-nand-omap2.h>
48 48
49#include "mux.h" 49#include "mux.h"
50#include "sdram-micron-mt46h32m32lf-6.h" 50#include "sdram-micron-mt46h32m32lf-6.h"
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index b8756f0d2a08..c7f3d026e6d4 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -41,13 +41,13 @@
41 41
42#include "common.h" 42#include "common.h"
43#include <plat/gpmc.h> 43#include <plat/gpmc.h>
44#include <plat/nand.h> 44#include <linux/platform_data/mtd-nand-omap2.h>
45#include <plat/usb.h> 45#include <plat/usb.h>
46#include <video/omapdss.h> 46#include <video/omapdss.h>
47#include <video/omap-panel-generic-dpi.h> 47#include <video/omap-panel-generic-dpi.h>
48#include <video/omap-panel-tfp410.h> 48#include <video/omap-panel-tfp410.h>
49 49
50#include <plat/mcspi.h> 50#include <linux/platform_data/spi-omap2-mcspi.h>
51#include <linux/input/matrix_keypad.h> 51#include <linux/input/matrix_keypad.h>
52#include <linux/spi/spi.h> 52#include <linux/spi/spi.h>
53#include <linux/interrupt.h> 53#include <linux/interrupt.h>
@@ -60,7 +60,7 @@
60#include "common-board-devices.h" 60#include "common-board-devices.h"
61 61
62#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 62#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
63#include <plat/gpmc-smsc911x.h> 63#include "gpmc-smsc911x.h"
64 64
65#define OMAP3STALKER_ETHR_START 0x2c000000 65#define OMAP3STALKER_ETHR_START 0x2c000000
66#define OMAP3STALKER_ETHR_SIZE 1024 66#define OMAP3STALKER_ETHR_SIZE 1024
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 0e2f838e4009..944ffc436577 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>
@@ -45,7 +45,7 @@
45 45
46#include "common.h" 46#include "common.h"
47#include <plat/gpmc.h> 47#include <plat/gpmc.h>
48#include <plat/nand.h> 48#include <linux/platform_data/mtd-nand-omap2.h>
49#include <plat/usb.h> 49#include <plat/usb.h>
50 50
51#include "mux.h" 51#include "mux.h"
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 8ae2c599dd7f..556e777b9c40 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -516,6 +516,7 @@ static void __init omap4_panda_init(void)
516MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") 516MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
517 /* Maintainer: David Anders - Texas Instruments Inc */ 517 /* Maintainer: David Anders - Texas Instruments Inc */
518 .atag_offset = 0x100, 518 .atag_offset = 0x100,
519 .smp = smp_ops(omap4_smp_ops),
519 .reserve = omap_reserve, 520 .reserve = omap_reserve,
520 .map_io = omap4_map_io, 521 .map_io = omap4_map_io,
521 .init_early = omap4430_init_early, 522 .init_early = omap4430_init_early,
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 13c101c2c643..2e7f24030fc9 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -37,6 +37,9 @@
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>
@@ -47,8 +50,6 @@
47#include <video/omap-panel-generic-dpi.h> 50#include <video/omap-panel-generic-dpi.h>
48#include <video/omap-panel-tfp410.h> 51#include <video/omap-panel-tfp410.h>
49#include <plat/gpmc.h> 52#include <plat/gpmc.h>
50#include <plat/nand.h>
51#include <plat/mcspi.h>
52#include <plat/usb.h> 53#include <plat/usb.h>
53 54
54#include "mux.h" 55#include "mux.h"
@@ -113,7 +114,7 @@ static inline void __init overo_ads7846_init(void) { return; }
113#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 114#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
114 115
115#include <linux/smsc911x.h> 116#include <linux/smsc911x.h>
116#include <plat/gpmc-smsc911x.h> 117#include "gpmc-smsc911x.h"
117 118
118static struct omap_smsc911x_platform_data smsc911x_cfg = { 119static struct omap_smsc911x_platform_data smsc911x_cfg = {
119 .id = 0, 120 .id = 0,
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 00773a32524a..45997bfbcbd2 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,6 @@
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#include <plat/serial.h>
31 31
32#include "mux.h" 32#include "mux.h"
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 456049055daa..3945c5017085 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -25,16 +25,17 @@
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 "common.h" 33#include "common.h"
32#include <plat/dma.h> 34#include <plat/dma.h>
33#include <plat/gpmc.h> 35#include <plat/gpmc.h>
34#include <plat/onenand.h> 36#include "gpmc-smc91x.h"
35#include <plat/gpmc-smc91x.h>
36 37
37#include <mach/board-rx51.h> 38#include "board-rx51.h"
38 39
39#include <sound/tlv320aic3x.h> 40#include <sound/tlv320aic3x.h>
40#include <sound/tpa6130a2-plat.h> 41#include <sound/tpa6130a2-plat.h>
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index 2c1289bd5e6a..c22e111bcd00 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 93b466150002..7bbb05d9689b 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -17,12 +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 <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 24#include <asm/mach/map.h>
24 25
25#include <plat/mcspi.h>
26#include "common.h" 26#include "common.h"
27#include <plat/dma.h> 27#include <plat/dma.h>
28#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 b76f49e7eed5..b76f49e7eed5 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-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
index 0d8d91917d10..afb2278a29f6 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -18,7 +18,7 @@
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
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index ea79bc299baf..b940ab2259fb 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -14,7 +14,7 @@
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
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index f81dd0a18aaf..48daac2581b4 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -24,8 +24,8 @@
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.h"
31#include "common-board-devices.h" 31#include "common-board-devices.h"
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 8e43c4d885d5..17950c6e130b 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -17,7 +17,6 @@
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/mux.h>
21#include <plat/clock.h> 20#include <plat/clock.h>
22 21
23#include "soc.h" 22#include "soc.h"
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index da0f5c187353..7045e4d61ac3 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -285,6 +285,11 @@ extern void omap_secondary_startup(void);
285extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask); 285extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
286extern void omap_auxcoreboot_addr(u32 cpu_addr); 286extern void omap_auxcoreboot_addr(u32 cpu_addr);
287extern 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
288extern void omap5_secondary_startup(void); 293extern void omap5_secondary_startup(void);
289#endif 294#endif
290 295
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index 5594b42372ee..a89e8256fd0e 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -16,10 +16,10 @@
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 "am33xx.h" 24#include "am33xx.h"
25 25
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 01970824e0e5..01970824e0e5 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 c88420de1151..c88420de1151 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 17c9b37042c0..17c9b37042c0 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 a0af9baec3f7..a0af9baec3f7 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/plat-omap/include/plat/debug-devices.h b/arch/arm/mach-omap2/debug-devices.h
index a4edbd2f7484..a4edbd2f7484 100644
--- a/arch/arm/plat-omap/include/plat/debug-devices.h
+++ b/arch/arm/mach-omap2/debug-devices.h
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 1b7e1c6e5359..c8c211731d26 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -22,13 +22,12 @@
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24#include <asm/mach/map.h> 24#include <asm/mach/map.h>
25#include <asm/pmu.h>
26 25
27#include "iomap.h" 26#include "iomap.h"
28#include <plat/dma.h> 27#include <plat/dma.h>
29#include <plat/omap_hwmod.h> 28#include <plat/omap_hwmod.h>
30#include <plat/omap_device.h> 29#include <plat/omap_device.h>
31#include <plat/omap4-keypad.h> 30#include "omap4-keypad.h"
32 31
33#include "soc.h" 32#include "soc.h"
34#include "common.h" 33#include "common.h"
@@ -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{
diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c
index a636ebc16b39..98388109f22a 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/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 9e9f47ad6187..4acf497faeb3 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -13,10 +13,10 @@
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/nand.h>
20#include <plat/gpmc.h> 20#include <plat/gpmc.h>
21 21
22#include "soc.h" 22#include "soc.h"
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index b66fb8e5faaa..916716e1da3b 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -15,10 +15,10 @@
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/onenand.h>
22#include <plat/gpmc.h> 22#include <plat/gpmc.h>
23 23
24#include "soc.h" 24#include "soc.h"
diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c
index 245839dfc722..565475310374 100644
--- a/arch/arm/mach-omap2/gpmc-smc91x.c
+++ b/arch/arm/mach-omap2/gpmc-smc91x.c
@@ -18,7 +18,7 @@
18#include <linux/smc91x.h> 18#include <linux/smc91x.h>
19 19
20#include <plat/gpmc.h> 20#include <plat/gpmc.h>
21#include <plat/gpmc-smc91x.h> 21#include "gpmc-smc91x.h"
22 22
23#include "soc.h" 23#include "soc.h"
24 24
diff --git a/arch/arm/plat-omap/include/plat/gpmc-smc91x.h b/arch/arm/mach-omap2/gpmc-smc91x.h
index b64fbee4d567..b64fbee4d567 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 a3a28878f0c9..249a0b440cd6 100644
--- a/arch/arm/mach-omap2/gpmc-smsc911x.c
+++ b/arch/arm/mach-omap2/gpmc-smsc911x.c
@@ -21,7 +21,7 @@
21#include <linux/smsc911x.h> 21#include <linux/smsc911x.h>
22 22
23#include <plat/gpmc.h> 23#include <plat/gpmc.h>
24#include <plat/gpmc-smsc911x.h> 24#include "gpmc-smsc911x.h"
25 25
26static struct resource gpmc_smsc911x_resources[] = { 26static struct resource gpmc_smsc911x_resources[] = {
27 [0] = { 27 [0] = {
diff --git a/arch/arm/plat-omap/include/plat/gpmc-smsc911x.h b/arch/arm/mach-omap2/gpmc-smsc911x.h
index ea6c9c88c725..ea6c9c88c725 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/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c
index cdd6dda03828..e003f2bba30c 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 0c1efc846d8d..0c1efc846d8d 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 80399d740952..03ebf47cfa9a 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -19,7 +19,6 @@
19 19
20#include <plat/mmc.h> 20#include <plat/mmc.h>
21#include <plat/omap-pm.h> 21#include <plat/omap-pm.h>
22#include <plat/mux.h>
23#include <plat/omap_device.h> 22#include <plat/omap_device.h>
24 23
25#include "mux.h" 24#include "mux.h"
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 6b98a178fbe0..cf2362ccb234 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -23,7 +23,7 @@
23 23
24#include "common.h" 24#include "common.h"
25 25
26#include <mach/id.h> 26#include "id.h"
27 27
28#include "soc.h" 28#include "soc.h"
29#include "control.h" 29#include "control.h"
diff --git a/arch/arm/mach-omap2/include/mach/id.h b/arch/arm/mach-omap2/id.h
index 02ed3aa56f1e..02ed3aa56f1e 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/smp.h b/arch/arm/mach-omap2/include/mach/smp.h
deleted file mode 100644
index 323675f21b69..000000000000
--- 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/plat-omap/include/plat/l3_2xxx.h b/arch/arm/mach-omap2/l3_2xxx.h
index b8b5641379b0..b8b5641379b0 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 cde1938c5f82..cde1938c5f82 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 3f39cf8a35c6..3f39cf8a35c6 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 881a858b1ffc..881a858b1ffc 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/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index d493727632e9..7d47407d6d46 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -17,9 +17,9 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/platform_data/asoc-ti-mcbsp.h>
20 21
21#include <plat/dma.h> 22#include <plat/dma.h>
22#include <plat/mcbsp.h>
23#include <plat/omap_device.h> 23#include <plat/omap_device.h>
24#include <linux/pm_runtime.h> 24#include <linux/pm_runtime.h>
25 25
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c
index 414083b427df..e712d1725a8b 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-secure.c b/arch/arm/mach-omap2/omap-secure.c
index d9ae4a53d818..a004cb9acf52 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
diff --git a/arch/arm/mach-omap2/include/mach/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h
index c90a43589abe..c90a43589abe 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 19cc5f504f7e..4d05fa8a4e48 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -24,8 +24,8 @@
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/omap-secure.h> 27#include "omap-secure.h"
28#include <mach/omap-wakeupgen.h> 28#include "omap-wakeupgen.h"
29#include <asm/cputype.h> 29#include <asm/cputype.h>
30 30
31#include "soc.h" 31#include "soc.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 ecaad7d371ee..b3275babf192 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -27,8 +27,8 @@
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 "soc.h"
34#include "omap4-sar-layout.h" 34#include "omap4-sar-layout.h"
diff --git a/arch/arm/mach-omap2/include/mach/omap-wakeupgen.h b/arch/arm/mach-omap2/omap-wakeupgen.h
index b0fd16f5c391..b0fd16f5c391 100644
--- a/arch/arm/mach-omap2/include/mach/omap-wakeupgen.h
+++ b/arch/arm/mach-omap2/omap-wakeupgen.h
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 73c1440a8253..e1f289748c5d 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -29,7 +29,7 @@
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/omap-wakeupgen.h> 32#include "omap-wakeupgen.h"
33 33
34#include "soc.h" 34#include "soc.h"
35#include "common.h" 35#include "common.h"
@@ -170,7 +170,10 @@ static int __init omap_l2_cache_init(void)
170 /* Enable PL310 L2 Cache controller */ 170 /* Enable PL310 L2 Cache controller */
171 omap_smc1(0x102, 0x1); 171 omap_smc1(0x102, 0x1);
172 172
173 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);
174 177
175 /* 178 /*
176 * 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 20de0d5a7e77..20de0d5a7e77 100644
--- a/arch/arm/plat-omap/include/plat/omap4-keypad.h
+++ b/arch/arm/mach-omap2/omap4-keypad.h
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 6af64bbd9e1d..299ca2821ad1 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3403,6 +3403,33 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
3403} 3403}
3404 3404
3405/** 3405/**
3406 * omap_hwmod_fill_dma_resources - fill struct resource array with dma data
3407 * @oh: struct omap_hwmod *
3408 * @res: pointer to the array of struct resource to fill
3409 *
3410 * Fill the struct resource array @res with dma resource data from the
3411 * omap_hwmod @oh. Intended to be called by code that registers
3412 * omap_devices. See also omap_hwmod_count_resources(). Returns the
3413 * number of array elements filled.
3414 */
3415int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res)
3416{
3417 int i, sdma_reqs_cnt;
3418 int r = 0;
3419
3420 sdma_reqs_cnt = _count_sdma_reqs(oh);
3421 for (i = 0; i < sdma_reqs_cnt; i++) {
3422 (res + r)->name = (oh->sdma_reqs + i)->name;
3423 (res + r)->start = (oh->sdma_reqs + i)->dma_req;
3424 (res + r)->end = (oh->sdma_reqs + i)->dma_req;
3425 (res + r)->flags = IORESOURCE_DMA;
3426 r++;
3427 }
3428
3429 return r;
3430}
3431
3432/**
3406 * omap_hwmod_get_resource_byname - fetch IP block integration data by name 3433 * omap_hwmod_get_resource_byname - fetch IP block integration data by name
3407 * @oh: struct omap_hwmod * to operate on 3434 * @oh: struct omap_hwmod * to operate on
3408 * @type: one of the IORESOURCE_* constants from include/linux/ioport.h 3435 * @type: one of the IORESOURCE_* constants from include/linux/ioport.h
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index e778ff4e1887..b5db6007c523 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -12,14 +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 <plat/dma.h> 18#include <plat/dma.h>
17#include <plat/serial.h> 19#include <plat/serial.h>
18#include <plat/i2c.h> 20#include <plat/i2c.h>
19#include <plat/mcspi.h>
20#include <plat/dmtimer.h> 21#include <plat/dmtimer.h>
21#include <plat/l3_2xxx.h> 22#include "l3_2xxx.h"
22#include <plat/l4_2xxx.h> 23#include "l4_2xxx.h"
23#include <plat/mmc.h> 24#include <plat/mmc.h>
24 25
25#include "omap_hwmod_common_data.h" 26#include "omap_hwmod_common_data.h"
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index cc4ed9024372..c455e41b0237 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -12,15 +12,16 @@
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 <plat/dma.h> 19#include <plat/dma.h>
17#include <plat/serial.h> 20#include <plat/serial.h>
18#include <plat/i2c.h> 21#include <plat/i2c.h>
19#include <plat/mcbsp.h>
20#include <plat/mcspi.h>
21#include <plat/dmtimer.h> 22#include <plat/dmtimer.h>
22#include <plat/mmc.h> 23#include <plat/mmc.h>
23#include <plat/l3_2xxx.h> 24#include "l3_2xxx.h"
24 25
25#include "soc.h" 26#include "soc.h"
26#include "omap_hwmod_common_data.h" 27#include "omap_hwmod_common_data.h"
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 bea700e928e7..8851bbb6bb24 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,7 +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 17
18#include "omap_hwmod_common_data.h" 18#include "omap_hwmod_common_data.h"
19 19
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 c83d6c517be4..1a1287d62648 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
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 d59a9ce40d2a..35dcdb66a4e0 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
@@ -13,7 +13,7 @@
13#include <linux/platform_data/gpio-omap.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 17
18#include "omap_hwmod_common_data.h" 18#include "omap_hwmod_common_data.h"
19#include "cm-regbits-24xx.h" 19#include "cm-regbits-24xx.h"
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index 22433cb2bec0..59d5c1cd316d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -17,9 +17,9 @@
17#include <plat/omap_hwmod.h> 17#include <plat/omap_hwmod.h>
18#include <plat/cpu.h> 18#include <plat/cpu.h>
19#include <linux/platform_data/gpio-omap.h> 19#include <linux/platform_data/gpio-omap.h>
20#include <linux/platform_data/spi-omap2-mcspi.h>
20#include <plat/dma.h> 21#include <plat/dma.h>
21#include <plat/mmc.h> 22#include <plat/mmc.h>
22#include <plat/mcspi.h>
23#include <plat/i2c.h> 23#include <plat/i2c.h>
24 24
25#include "omap_hwmod_common_data.h" 25#include "omap_hwmod_common_data.h"
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 016429d89bb0..285777241d5a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -20,16 +20,16 @@
20#include <plat/omap_hwmod.h> 20#include <plat/omap_hwmod.h>
21#include <plat/dma.h> 21#include <plat/dma.h>
22#include <plat/serial.h> 22#include <plat/serial.h>
23#include <plat/l3_3xxx.h> 23#include "l3_3xxx.h"
24#include <plat/l4_3xxx.h> 24#include "l4_3xxx.h"
25#include <plat/i2c.h> 25#include <plat/i2c.h>
26#include <plat/mmc.h> 26#include <plat/mmc.h>
27#include <plat/mcbsp.h> 27#include <linux/platform_data/asoc-ti-mcbsp.h>
28#include <plat/mcspi.h> 28#include <linux/platform_data/spi-omap2-mcspi.h>
29#include <plat/dmtimer.h> 29#include <plat/dmtimer.h>
30#include <plat/iommu.h> 30#include <plat/iommu.h>
31 31
32#include <mach/am35xx.h> 32#include "am35xx.h"
33 33
34#include "soc.h" 34#include "soc.h"
35#include "omap_hwmod_common_data.h" 35#include "omap_hwmod_common_data.h"
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index e6b8d02d0b0e..ae0acaf506ed 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -25,8 +25,8 @@
25#include <plat/omap_hwmod.h> 25#include <plat/omap_hwmod.h>
26#include <plat/i2c.h> 26#include <plat/i2c.h>
27#include <plat/dma.h> 27#include <plat/dma.h>
28#include <plat/mcspi.h> 28#include <linux/platform_data/spi-omap2-mcspi.h>
29#include <plat/mcbsp.h> 29#include <linux/platform_data/asoc-ti-mcbsp.h>
30#include <plat/mmc.h> 30#include <plat/mmc.h>
31#include <plat/dmtimer.h> 31#include <plat/dmtimer.h>
32#include <plat/common.h> 32#include <plat/common.h>
diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S
index b7d8ead4b86a..88ff83a0942e 100644
--- a/arch/arm/mach-omap2/sleep44xx.S
+++ b/arch/arm/mach-omap2/sleep44xx.S
@@ -14,7 +14,7 @@
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 <mach/omap-secure.h> 17#include "omap-secure.h"
18 18
19#include "common.h" 19#include "common.h"
20#include "omap44xx.h" 20#include "omap44xx.h"
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 5214d5bfba27..810aa1a332e1 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -36,6 +36,7 @@
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 <asm/smp_twd.h> 42#include <asm/smp_twd.h>
@@ -394,6 +395,11 @@ static void __init omap4_timer_init(void)
394 if (omap_rev() != OMAP4430_REV_ES1_0) { 395 if (omap_rev() != OMAP4430_REV_ES1_0) {
395 int err; 396 int err;
396 397
398 if (of_have_populated_dt()) {
399 twd_local_timer_of_register();
400 return;
401 }
402
397 err = twd_local_timer_register(&twd_local_timer); 403 err = twd_local_timer_register(&twd_local_timer);
398 if (err) 404 if (err)
399 pr_err("twd_local_timer_register failed %d\n", err); 405 pr_err("twd_local_timer_register failed %d\n", err);
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 89150b2435e5..136c64bc9028 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -28,7 +28,7 @@
28#include <plat/usb.h> 28#include <plat/usb.h>
29#include <plat/omap_device.h> 29#include <plat/omap_device.h>
30 30
31#include <mach/am35xx.h> 31#include "am35xx.h"
32 32
33#include "mux.h" 33#include "mux.h"
34 34
diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
index 0ac2caf15941..7283b7ed7de8 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-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c
index eaac83d1df6f..b5efc0fd31cb 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 410291c67666..3e07f52f2127 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,
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
index d75dcfa0f01c..e3629c063df2 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 49a3fd630313..41fe2b1ff47c 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 d470864b4e42..e533588880ff 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 11a3c1e9801f..461fd69a10ae 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 a1d0b78decb1..000000000000
--- 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 1aa5d0a50a0b..000000000000
--- 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 683e085ce162..d265f5484a8e 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 17da7091d310..30a192b9c517 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 1e458efafb9a..f1ae10ae5bd4 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 0180c393c711..3506f16c0bf2 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 cb19e1661bb3..cd50e328db2a 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-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
new file mode 100644
index 000000000000..868796f8085c
--- /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 b3271754e9fd..000000000000
--- 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 8f9a0b47a7fa..f6c0849af5e9 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 40a8c178f10d..000000000000
--- 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/picoxcell_soc.h b/arch/arm/mach-picoxcell/include/mach/picoxcell_soc.h
deleted file mode 100644
index 5566fc88ddbc..000000000000
--- 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 6c540a69f405..000000000000
--- 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 b60b19d1d739..000000000000
--- 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 777564c90a12..000000000000
--- 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 9fa19baa7f2e..000000000000
--- 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 a4a3819c96cb..000000000000
--- 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 39720d6c0d01..000000000000
--- 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 a00d2f1254ed..000000000000
--- 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 a4739e9fb2fb..000000000000
--- 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 d3e71d3847b4..000000000000
--- 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 550cfc2a1f2e..000000000000
--- 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 8d2a5ef52c90..000000000000
--- 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 469d60d97f5c..000000000000
--- 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 f094bf8bfb18..000000000000
--- 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 77a555846719..000000000000
--- 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 41027dd7cf74..000000000000
--- 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 7b98b828d368..000000000000
--- 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 2a690ca33870..000000000000
--- 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 f6b33cf23ae2..000000000000
--- 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 368c2c10a308..000000000000
--- 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 2fa685bff858..000000000000
--- 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 b383c7de7ab4..000000000000
--- 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 bb4751ee2539..000000000000
--- 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 41e4201972d5..000000000000
--- 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 26f8d06b142a..000000000000
--- 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 374c138ac1ac..000000000000
--- 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 f4eed495d295..000000000000
--- 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 0cfe8af3d3be..000000000000
--- 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 75e88c570aa7..000000000000
--- 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 000000000000..41fc85327673
--- /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 ZONE_DMA
10 select SIRF_IRQ
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 13dd1604d951..fc9ce22e2b5a 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 aebad7e565cf..000000000000
--- 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 8f0429d4b79f..f25a54194639 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 83125c6a30b3..0c898fcf909c 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 a7b9415d30f8..7dee9176e77a 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 f224107de7bc..d95bf252f694 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 fe2d1f80ef50..8e6288de69b9 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 PXA3xx
31 select CPU_PXA300
32 select POWER_SUPPLY
33 select HAVE_PWM
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
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index be0f7df8685c..2bedc9ed076c 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
diff --git a/arch/arm/mach-pxa/am200epd.c b/arch/arm/mach-pxa/am200epd.c
index ccdac4b6a469..ffa6d811aad8 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 76c4b9494031..3dfec1ec462d 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 9244493dbcb7..208229342514 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 2a37a9a8f621..d4e9499832dc 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 431ef56700c4..2503db9e3253 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 8fa4ad27edf3..fc3afc7cd366 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -24,7 +24,7 @@
24#include <mach/pxa25x.h> 24#include <mach/pxa25x.h>
25#include <mach/pxa27x.h> 25#include <mach/pxa27x.h>
26#include <mach/audio.h> 26#include <mach/audio.h>
27#include <mach/pxafb.h> 27#include <linux/platform_data/video-pxafb.h>
28#include <mach/smemc.h> 28#include <mach/smemc.h>
29 29
30#include <asm/hardware/it8152.h> 30#include <asm/hardware/it8152.h>
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 3e4e9fe2d462..cc2b23afcaaf 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 d28e802e2448..8404b24240ea 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 248804bb2c9d..2d4a7b4d5d78 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 bb6def8ec979..a9c9c163dd95 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 d88e7b37f1da..25515cd7e68f 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 68cc75fac219..8240291ab8cf 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 c1fe32db4755..7c83f52c549c 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 67f0de37f46e..7039f44b3647 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 166eee5b8a70..ddaa04de8e22 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 97f82ad341bf..1b6411439ec8 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 4cb2391a782e..be2ee9bf5c6e 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 15ab2533667d..dc58fa0edb66 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 e529a35a44ce..60755a6bb1c6 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 e6311988add2..5ecbd17b5641 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 6ff466bd43e8..c36151940d17 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"
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
index 207ecb49a61b..f4d48d20754e 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/irq.c b/arch/arm/mach-pxa/irq.c
index 5dae15ea6718..b6cc1816463e 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/littleton.c b/arch/arm/mach-pxa/littleton.c
index 1fb86edb857c..402874f9021f 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 cee9ce2fc0b5..1a63eaa89867 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 0ca0db787903..44dd7565707e 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -46,9 +46,9 @@
46#include <mach/audio.h> 46#include <mach/audio.h>
47#include <mach/lubbock.h> 47#include <mach/lubbock.h>
48#include <mach/udc.h> 48#include <mach/udc.h>
49#include <mach/irda.h> 49#include <linux/platform_data/irda-pxaficp.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/pm.h> 52#include <mach/pm.h>
53#include <mach/smemc.h> 53#include <mach/smemc.h>
54 54
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 39561dcf65f2..f7922404d941 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 1aebaf719462..5d9475730a3f 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -45,11 +45,11 @@
45#include <mach/pxa27x.h> 45#include <mach/pxa27x.h>
46#include <mach/mainstone.h> 46#include <mach/mainstone.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/irda.h> 50#include <linux/platform_data/irda-pxaficp.h>
51#include <mach/ohci.h> 51#include <linux/platform_data/usb-ohci-pxa27x.h>
52#include <plat/pxa27x_keypad.h> 52#include <linux/platform_data/keypad-pxa27x.h>
53#include <mach/smemc.h> 53#include <mach/smemc.h>
54 54
55#include "generic.h" 55#include "generic.h"
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index bf99022b021f..2831308dba68 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 83570a79e7d2..d04ed4961e60 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 dad71cfa34c8..17d4c53017ca 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 31e0433d83ba..8bcc96e3b0db 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 0f6bd4fcfa3b..5ca7b904a30e 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 e2d97eed07a7..ca924cfedfc0 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 c054827c567f..997e6da9a9c4 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"
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index fbdebee39a53..3f3c48f2f7ce 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 0da35dccfd89..8b4366628a12 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 a97b59965bb9..8cdd4f58e253 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 cb723e84bc27..113c57a03565 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 89d98c832189..2910bb935c75 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 000000000000..c9192cea0033
--- /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 4726c246dcdc..8047ee0effc5 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 f8ec85450c42..447dcbb22f6f 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 5ead6d480c6d..7dbe3ccf1993 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 dffb7e813d98..656a1bb16d14 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 d89d87ae144c..25b08bfa997b 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 86c95a5d8533..08d87a5d2639 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 bdf4cb88ca0a..9a154bad1984 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -879,7 +879,7 @@ static const struct platform_suspend_ops sharpsl_pm_ops = {
879 879
880static int __devinit sharpsl_pm_probe(struct platform_device *pdev) 880static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
881{ 881{
882 int ret; 882 int ret, irq;
883 883
884 if (!pdev->dev.platform_data) 884 if (!pdev->dev.platform_data)
885 return -EINVAL; 885 return -EINVAL;
@@ -907,24 +907,28 @@ static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
907 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock); 907 gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
908 908
909 /* Register interrupt handlers */ 909 /* 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)) { 910 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)); 911 if (request_irq(irq, sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
912 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
912 } 913 }
913 914
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)) { 915 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)); 916 if (request_irq(irq, sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
917 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
916 } 918 }
917 919
918 if (sharpsl_pm.machinfo->gpio_fatal) { 920 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)) { 921 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)); 922 if (request_irq(irq, sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
923 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
921 } 924 }
922 } 925 }
923 926
924 if (sharpsl_pm.machinfo->batfull_irq) { 927 if (sharpsl_pm.machinfo->batfull_irq) {
925 /* Register interrupt handler. */ 928 /* 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)) { 929 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)); 930 if (request_irq(irq, sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
931 dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", irq);
928 } 932 }
929 } 933 }
930 934
@@ -953,14 +957,14 @@ static int sharpsl_pm_remove(struct platform_device *pdev)
953 957
954 led_trigger_unregister_simple(sharpsl_charge_led_trigger); 958 led_trigger_unregister_simple(sharpsl_charge_led_trigger);
955 959
956 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr); 960 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); 961 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
958 962
959 if (sharpsl_pm.machinfo->gpio_fatal) 963 if (sharpsl_pm.machinfo->gpio_fatal)
960 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr); 964 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
961 965
962 if (sharpsl_pm.machinfo->batfull_irq) 966 if (sharpsl_pm.machinfo->batfull_irq)
963 free_irq(PXA_GPIO_TO_IRQ(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr); 967 free_irq(gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
964 968
965 gpio_free(sharpsl_pm.machinfo->gpio_batlock); 969 gpio_free(sharpsl_pm.machinfo->gpio_batlock);
966 gpio_free(sharpsl_pm.machinfo->gpio_batfull); 970 gpio_free(sharpsl_pm.machinfo->gpio_batfull);
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 363d91b44ecb..2073f0e6db0d 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 30b1b0b3c7f7..08ea7a84a291 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>
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index 736bfdc50ee6..1a25f8a7b0ce 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 4d4eb60bad1e..233629edf7ee 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 166dd32cc1d3..fbbcbed4d1d4 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 130379fb9d0f..392412ce4dac 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>
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index e1740acd15f1..491b6c9a2a9b 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 b9320cb8a11f..97529face7aa 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 af3d4f7646d7..abd3aa145083 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 98eec80623e3..226279fac9d4 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/core.c b/arch/arm/mach-realview/core.c
index 45868bb43cbd..ff007d15e0ec 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -30,7 +30,6 @@
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>
@@ -226,115 +225,10 @@ struct mmci_platform_data realview_mmc1_plat_data = {
226 .cd_invert = true, 225 .cd_invert = true,
227}; 226};
228 227
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) 228void __init realview_init_early(void)
328{ 229{
329 void __iomem *sys = __io_address(REALVIEW_SYS_BASE); 230 void __iomem *sys = __io_address(REALVIEW_SYS_BASE);
330 231
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); 232 versatile_sched_clock_init(sys + REALVIEW_SYS_24MHz_OFFSET, 24000000);
339} 233}
340 234
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index f8f2c0ac4c01..78cd970c80f2 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -56,4 +56,7 @@ extern void realview_init_early(void);
56extern void realview_fixup(struct tag *tags, char **from, 56extern void realview_fixup(struct tag *tags, char **from,
57 struct meminfo *meminfo); 57 struct meminfo *meminfo);
58 58
59extern struct smp_operations realview_smp_ops;
60extern void realview_cpu_die(unsigned int cpu);
61
59#endif 62#endif
diff --git a/arch/arm/mach-realview/hotplug.c b/arch/arm/mach-realview/hotplug.c
index 57d9efba2956..53818e5cd3ad 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 e58d0771b64e..000000000000
--- 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 40a8c178f10d..000000000000
--- 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 17c878ddbc70..300f7064465d 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 baf382c5e776..ce7747692c8b 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -27,12 +27,12 @@
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h> 28#include <linux/amba/pl022.h>
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/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/leds.h>
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35#include <asm/pmu.h>
36#include <asm/pgtable.h> 36#include <asm/pgtable.h>
37#include <asm/hardware/gic.h> 37#include <asm/hardware/gic.h>
38#include <asm/hardware/cache-l2x0.h> 38#include <asm/hardware/cache-l2x0.h>
@@ -297,7 +297,7 @@ static struct resource pmu_resources[] = {
297 297
298static struct platform_device pmu_device = { 298static struct platform_device pmu_device = {
299 .name = "arm-pmu", 299 .name = "arm-pmu",
300 .id = ARM_PMU_DEVICE_CPU, 300 .id = -1,
301 .num_resources = ARRAY_SIZE(pmu_resources), 301 .num_resources = ARRAY_SIZE(pmu_resources),
302 .resource = pmu_resources, 302 .resource = pmu_resources,
303}; 303};
@@ -414,6 +414,7 @@ static void __init realview_eb_timer_init(void)
414 else 414 else
415 timer_irq = IRQ_EB_TIMER0_1; 415 timer_irq = IRQ_EB_TIMER0_1;
416 416
417 realview_clk_init(__io_address(REALVIEW_SYS_BASE), false);
417 realview_timer_init(timer_irq); 418 realview_timer_init(timer_irq);
418 realview_eb_twd_init(); 419 realview_eb_twd_init();
419} 420}
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index b1d7cafa1a6d..e21711d72ee2 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -29,12 +29,12 @@
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/leds.h>
36#include <asm/mach-types.h> 37#include <asm/mach-types.h>
37#include <asm/pmu.h>
38#include <asm/pgtable.h> 38#include <asm/pgtable.h>
39#include <asm/hardware/gic.h> 39#include <asm/hardware/gic.h>
40#include <asm/hardware/cache-l2x0.h> 40#include <asm/hardware/cache-l2x0.h>
@@ -280,7 +280,7 @@ static struct resource pmu_resource = {
280 280
281static struct platform_device pmu_device = { 281static struct platform_device pmu_device = {
282 .name = "arm-pmu", 282 .name = "arm-pmu",
283 .id = ARM_PMU_DEVICE_CPU, 283 .id = -1,
284 .num_resources = 1, 284 .num_resources = 1,
285 .resource = &pmu_resource, 285 .resource = &pmu_resource,
286}; 286};
@@ -326,6 +326,7 @@ static void __init realview_pb1176_timer_init(void)
326 timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE); 326 timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE);
327 timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20; 327 timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20;
328 328
329 realview_clk_init(__io_address(REALVIEW_SYS_BASE), true);
329 realview_timer_init(IRQ_DC1176_TIMER0); 330 realview_timer_init(IRQ_DC1176_TIMER0);
330} 331}
331 332
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index a98c536e3327..a80269981dd4 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -27,12 +27,12 @@
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
28#include <linux/amba/pl022.h> 28#include <linux/amba/pl022.h>
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/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/leds.h>
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35#include <asm/pmu.h>
36#include <asm/pgtable.h> 36#include <asm/pgtable.h>
37#include <asm/hardware/gic.h> 37#include <asm/hardware/gic.h>
38#include <asm/hardware/cache-l2x0.h> 38#include <asm/hardware/cache-l2x0.h>
@@ -263,7 +263,7 @@ static struct resource pmu_resources[] = {
263 263
264static struct platform_device pmu_device = { 264static struct platform_device pmu_device = {
265 .name = "arm-pmu", 265 .name = "arm-pmu",
266 .id = ARM_PMU_DEVICE_CPU, 266 .id = -1,
267 .num_resources = ARRAY_SIZE(pmu_resources), 267 .num_resources = ARRAY_SIZE(pmu_resources),
268 .resource = pmu_resources, 268 .resource = pmu_resources,
269}; 269};
@@ -312,6 +312,7 @@ static void __init realview_pb11mp_timer_init(void)
312 timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); 312 timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE);
313 timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; 313 timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20;
314 314
315 realview_clk_init(__io_address(REALVIEW_SYS_BASE), false);
315 realview_timer_init(IRQ_TC11MP_TIMER0_1); 316 realview_timer_init(IRQ_TC11MP_TIMER0_1);
316 realview_pb11mp_twd_init(); 317 realview_pb11mp_twd_init();
317} 318}
@@ -366,6 +367,7 @@ static void __init realview_pb11mp_init(void)
366MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore") 367MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
367 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 368 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
368 .atag_offset = 0x100, 369 .atag_offset = 0x100,
370 .smp = smp_ops(realview_smp_ops),
369 .fixup = realview_fixup, 371 .fixup = realview_fixup,
370 .map_io = realview_pb11mp_map_io, 372 .map_io = realview_pb11mp_map_io,
371 .init_early = realview_init_early, 373 .init_early = realview_init_early,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 59650174e6ed..1435cd863965 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -27,11 +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 <asm/irq.h> 32#include <asm/irq.h>
32#include <asm/leds.h> 33#include <asm/leds.h>
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34#include <asm/pmu.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/hardware/gic.h> 36#include <asm/hardware/gic.h>
37 37
@@ -241,7 +241,7 @@ static struct resource pmu_resource = {
241 241
242static struct platform_device pmu_device = { 242static struct platform_device pmu_device = {
243 .name = "arm-pmu", 243 .name = "arm-pmu",
244 .id = ARM_PMU_DEVICE_CPU, 244 .id = -1,
245 .num_resources = 1, 245 .num_resources = 1,
246 .resource = &pmu_resource, 246 .resource = &pmu_resource,
247}; 247};
@@ -261,6 +261,7 @@ static void __init realview_pba8_timer_init(void)
261 timer2_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE); 261 timer2_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE);
262 timer3_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE) + 0x20; 262 timer3_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE) + 0x20;
263 263
264 realview_clk_init(__io_address(REALVIEW_SYS_BASE), false);
264 realview_timer_init(IRQ_PBA8_TIMER0_1); 265 realview_timer_init(IRQ_PBA8_TIMER0_1);
265} 266}
266 267
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 3f2f605624e9..a4b1aa93bb5a 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -26,11 +26,11 @@
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/leds.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33#include <asm/pmu.h>
34#include <asm/smp_twd.h> 34#include <asm/smp_twd.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/hardware/gic.h> 36#include <asm/hardware/gic.h>
@@ -280,7 +280,7 @@ static struct resource pmu_resources[] = {
280 280
281static struct platform_device pmu_device = { 281static struct platform_device pmu_device = {
282 .name = "arm-pmu", 282 .name = "arm-pmu",
283 .id = ARM_PMU_DEVICE_CPU, 283 .id = -1,
284 .num_resources = ARRAY_SIZE(pmu_resources), 284 .num_resources = ARRAY_SIZE(pmu_resources),
285 .resource = pmu_resources, 285 .resource = pmu_resources,
286}; 286};
@@ -320,6 +320,7 @@ static void __init realview_pbx_timer_init(void)
320 timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE); 320 timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE);
321 timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20; 321 timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20;
322 322
323 realview_clk_init(__io_address(REALVIEW_SYS_BASE), false);
323 realview_timer_init(IRQ_PBX_TIMER0_1); 324 realview_timer_init(IRQ_PBX_TIMER0_1);
324 realview_pbx_twd_init(); 325 realview_pbx_twd_init();
325} 326}
@@ -403,6 +404,7 @@ static void __init realview_pbx_init(void)
403MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") 404MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
404 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 405 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
405 .atag_offset = 0x100, 406 .atag_offset = 0x100,
407 .smp = smp_ops(realview_smp_ops),
406 .fixup = realview_pbx_fixup, 408 .fixup = realview_pbx_fixup,
407 .map_io = realview_pbx_map_io, 409 .map_io = realview_pbx_map_io,
408 .init_early = realview_init_early, 410 .init_early = realview_init_early,
diff --git a/arch/arm/mach-s3c24xx/common-smdk.c b/arch/arm/mach-s3c24xx/common-smdk.c
index 87e75a250d5e..3b2cf6db3634 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 a5eeb62ce1c2..57aee916bdb1 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/mach-amlm5900.c b/arch/arm/mach-s3c24xx/mach-amlm5900.c
index ea2c4b003d58..f4ad99c1e476 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 5a7d0c0010f7..1ee8c4638743 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 7a05abf1270b..00381fe5de32 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 1cf1720682d3..6a30ce7e4aa7 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 92e1f93a6bca..4a963467b7ee 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 bb8d008d5a5c..9638b337593c 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
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index ae73ba34ecc6..c9954e26b492 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 bd6d2525debe..393c0f1ac11a 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 383d00ca8f60..c53a9bfe1417 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 5c05ba1c330f..a2b92b0898e2 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 ad2792dfbee1..5876c6ba7500 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 95d077255024..bb36d832bd3d 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 bc4b6efb3b27..bca39f0232b3 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 678bbca2b5e5..7b6ba13d7285 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 7ee73f27f207..379fde521d37 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 56af35447598..dacbb9a2122a 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 bdc27e772876..82796b97cb04 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 b11451b853d8..ce99fd8bbbc5 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 c3100a044fbe..db2787aa1e5e 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -39,17 +39,17 @@
39#include <mach/regs-s3c2443-clock.h> 39#include <mach/regs-s3c2443-clock.h>
40 40
41#include <mach/idle.h> 41#include <mach/idle.h>
42#include <mach/leds-gpio.h> 42#include <linux/platform_data/leds-s3c24xx.h>
43#include <plat/iic.h> 43#include <linux/platform_data/i2c-s3c2410.h>
44 44
45#include <plat/s3c2416.h> 45#include <plat/s3c2416.h>
46#include <plat/gpio-cfg.h> 46#include <plat/gpio-cfg.h>
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/nand.h> 50#include <linux/platform_data/mtd-nand-s3c2410.h>
51#include <plat/sdhci.h> 51#include <plat/sdhci.h>
52#include <plat/udc.h> 52#include <linux/platform_data/usb-s3c2410_udc.h>
53#include <linux/platform_data/s3c-hsudc.h> 53#include <linux/platform_data/s3c-hsudc.h>
54 54
55#include <plat/regs-fb-v4.h> 55#include <plat/regs-fb-v4.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index 83a1036d7dcb..b7ff882c6ce6 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 209236956222..2568656f046f 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 fe990289ee7d..495bf5cf52e9 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 bd5f189f0424..14d5b12e388c 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 94bfaa1fb148..f1d44ae11833 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 9e90a7cbd1d6..7b4f33332d19 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 11881c9a38c0..fd0ef05763a9 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 d91c1a725139..17f8356177c1 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"
diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
index 124fd5d63006..35f3e07eaccc 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 ffa29ddfdfce..15c58dfc4584 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -42,7 +42,7 @@
42#include <asm/mach-types.h> 42#include <asm/mach-types.h>
43 43
44#include <plat/regs-serial.h> 44#include <plat/regs-serial.h>
45#include <plat/iic.h> 45#include <linux/platform_data/i2c-s3c2410.h>
46#include <plat/fb.h> 46#include <plat/fb.h>
47#include <plat/regs-fb-v4.h> 47#include <plat/regs-fb-v4.h>
48 48
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 9e382e7c77cb..181aa99427fe 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -24,7 +24,7 @@
24#include <sound/wm8962.h> 24#include <sound/wm8962.h>
25#include <sound/wm9081.h> 25#include <sound/wm9081.h>
26 26
27#include <plat/s3c64xx-spi.h> 27#include <linux/platform_data/spi-s3c64xx.h>
28 28
29#include <mach/crag6410.h> 29#include <mach/crag6410.h>
30 30
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 09cd81207a3f..717d675188d4 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -61,14 +61,14 @@
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"
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 689088162f77..02222b32b7d3 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -34,9 +34,9 @@
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35 35
36#include <plat/regs-serial.h> 36#include <plat/regs-serial.h>
37#include <plat/iic.h> 37#include <linux/platform_data/i2c-s3c2410.h>
38#include <plat/fb.h> 38#include <plat/fb.h>
39#include <plat/nand.h> 39#include <linux/platform_data/mtd-nand-s3c2410.h>
40 40
41#include <plat/clock.h> 41#include <plat/clock.h>
42#include <plat/devs.h> 42#include <plat/devs.h>
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 5539a255a704..09311cc40115 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -38,9 +38,9 @@
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> 44#include <plat/regs-fb-v4.h>
45 45
46#include <video/platform_lcd.h> 46#include <video/platform_lcd.h>
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index cad2e05eddf7..46ee88d16815 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -37,7 +37,7 @@
37#include <asm/mach-types.h> 37#include <asm/mach-types.h>
38 38
39#include <plat/regs-serial.h> 39#include <plat/regs-serial.h>
40#include <plat/iic.h> 40#include <linux/platform_data/i2c-s3c2410.h>
41#include <plat/fb.h> 41#include <plat/fb.h>
42 42
43#include <plat/clock.h> 43#include <plat/clock.h>
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 326b21604bc3..6daca203e72b 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -39,9 +39,9 @@
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> 45#include <plat/regs-fb-v4.h>
46 46
47#include <video/platform_lcd.h> 47#include <video/platform_lcd.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index ceeb1de40376..c6d7390939ae 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-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index b0f4525c66bd..a928fae5694e 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 0fe4f1503f4f..2547a8846472 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -60,8 +60,8 @@
60#include <mach/regs-gpio.h> 60#include <mach/regs-gpio.h>
61#include <mach/regs-sys.h> 61#include <mach/regs-sys.h>
62#include <mach/regs-srom.h> 62#include <mach/regs-srom.h>
63#include <plat/ata.h> 63#include <linux/platform_data/ata-samsung_cf.h>
64#include <plat/iic.h> 64#include <linux/platform_data/i2c-s3c2410.h>
65#include <plat/fb.h> 65#include <plat/fb.h>
66#include <plat/gpio-cfg.h> 66#include <plat/gpio-cfg.h>
67 67
@@ -69,7 +69,7 @@
69#include <plat/devs.h> 69#include <plat/devs.h>
70#include <plat/cpu.h> 70#include <plat/cpu.h>
71#include <plat/adc.h> 71#include <plat/adc.h>
72#include <plat/ts.h> 72#include <linux/platform_data/touchscreen-s3c2410.h>
73#include <plat/keypad.h> 73#include <plat/keypad.h>
74#include <plat/backlight.h> 74#include <plat/backlight.h>
75#include <plat/regs-fb-v4.h> 75#include <plat/regs-fb-v4.h>
diff --git a/arch/arm/mach-s3c64xx/setup-i2c0.c b/arch/arm/mach-s3c64xx/setup-i2c0.c
index 241af94a9e70..40666ba8d607 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 3d13a961986d..3fdb24c4e62a 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 41b425602d88..648d8b85bf6b 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/dev-audio.c b/arch/arm/mach-s5p64x0/dev-audio.c
index 91113ddc51da..a0d6edfd23a0 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 92fefad505cc..dea78a848244 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -45,10 +45,10 @@
45#include <plat/clock.h> 45#include <plat/clock.h>
46#include <plat/devs.h> 46#include <plat/devs.h>
47#include <plat/cpu.h> 47#include <plat/cpu.h>
48#include <plat/iic.h> 48#include <linux/platform_data/i2c-s3c2410.h>
49#include <plat/pll.h> 49#include <plat/pll.h>
50#include <plat/adc.h> 50#include <plat/adc.h>
51#include <plat/ts.h> 51#include <linux/platform_data/touchscreen-s3c2410.h>
52#include <plat/s5p-time.h> 52#include <plat/s5p-time.h>
53#include <plat/backlight.h> 53#include <plat/backlight.h>
54#include <plat/fb.h> 54#include <plat/fb.h>
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index e2335ecf6eae..6f14fc729b8f 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -45,10 +45,10 @@
45#include <plat/clock.h> 45#include <plat/clock.h>
46#include <plat/devs.h> 46#include <plat/devs.h>
47#include <plat/cpu.h> 47#include <plat/cpu.h>
48#include <plat/iic.h> 48#include <linux/platform_data/i2c-s3c2410.h>
49#include <plat/pll.h> 49#include <plat/pll.h>
50#include <plat/adc.h> 50#include <plat/adc.h>
51#include <plat/ts.h> 51#include <linux/platform_data/touchscreen-s3c2410.h>
52#include <plat/s5p-time.h> 52#include <plat/s5p-time.h>
53#include <plat/backlight.h> 53#include <plat/backlight.h>
54#include <plat/fb.h> 54#include <plat/fb.h>
diff --git a/arch/arm/mach-s5p64x0/setup-i2c0.c b/arch/arm/mach-s5p64x0/setup-i2c0.c
index 46b463917c54..a32edc545e6c 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 6ad3b986021c..ca2c5c7f8aa6 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/dev-audio.c b/arch/arm/mach-s5pc100/dev-audio.c
index 9d4bde3f1110..1cc252cef268 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 0c3ae38d27ca..5d2c0934928b 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -44,12 +44,12 @@
44#include <plat/devs.h> 44#include <plat/devs.h>
45#include <plat/cpu.h> 45#include <plat/cpu.h>
46#include <plat/fb.h> 46#include <plat/fb.h>
47#include <plat/iic.h> 47#include <linux/platform_data/i2c-s3c2410.h>
48#include <plat/ata.h> 48#include <linux/platform_data/ata-samsung_cf.h>
49#include <plat/adc.h> 49#include <plat/adc.h>
50#include <plat/keypad.h> 50#include <plat/keypad.h>
51#include <plat/ts.h> 51#include <linux/platform_data/touchscreen-s3c2410.h>
52#include <plat/audio.h> 52#include <linux/platform_data/asoc-s3c.h>
53#include <plat/backlight.h> 53#include <plat/backlight.h>
54#include <plat/regs-fb-v4.h> 54#include <plat/regs-fb-v4.h>
55 55
diff --git a/arch/arm/mach-s5pc100/setup-i2c0.c b/arch/arm/mach-s5pc100/setup-i2c0.c
index eaef7a3bda49..89a6a769d622 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 aaff74a90dee..faa667ef02cb 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/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c
index 8367749c3eec..0a5480bbcbd5 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-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index 822a55950685..00f1e47d490a 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -43,7 +43,7 @@
43#include <plat/devs.h> 43#include <plat/devs.h>
44#include <plat/cpu.h> 44#include <plat/cpu.h>
45#include <plat/fb.h> 45#include <plat/fb.h>
46#include <plat/iic.h> 46#include <linux/platform_data/i2c-s3c2410.h>
47#include <plat/keypad.h> 47#include <plat/keypad.h>
48#include <plat/sdhci.h> 48#include <plat/sdhci.h>
49#include <plat/clock.h> 49#include <plat/clock.h>
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index dfc29236321c..d9c99fcc1aa7 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 918b23d71fdf..7d6fab420508 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -38,9 +38,9 @@
38#include <plat/devs.h> 38#include <plat/devs.h>
39#include <plat/cpu.h> 39#include <plat/cpu.h>
40#include <plat/adc.h> 40#include <plat/adc.h>
41#include <plat/ts.h> 41#include <linux/platform_data/touchscreen-s3c2410.h>
42#include <plat/ata.h> 42#include <linux/platform_data/ata-samsung_cf.h>
43#include <plat/iic.h> 43#include <linux/platform_data/i2c-s3c2410.h>
44#include <plat/keypad.h> 44#include <plat/keypad.h>
45#include <plat/pm.h> 45#include <plat/pm.h>
46#include <plat/fb.h> 46#include <plat/fb.h>
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
index 74e99bc0dc9b..18785cb5e1ef 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 0f1cc3a1c1e8..4a15849766c0 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 f61365a34c56..4777f6b97a92 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 2f91b5cefbc6..bbce6c74b915 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/assabet.c b/arch/arm/mach-sa1100/assabet.c
index d673211f121c..ba49241b02f0 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -37,7 +37,7 @@
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38#include <asm/mach/serial_sa1100.h> 38#include <asm/mach/serial_sa1100.h>
39#include <mach/assabet.h> 39#include <mach/assabet.h>
40#include <mach/mcp.h> 40#include <linux/platform_data/mfd-mcp-sa11x0.h>
41#include <mach/irqs.h> 41#include <mach/irqs.h>
42 42
43#include "generic.h" 43#include "generic.h"
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 09d7f4b4b354..985d0b584717 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -28,7 +28,7 @@
28#include <asm/mach/serial_sa1100.h> 28#include <asm/mach/serial_sa1100.h>
29 29
30#include <mach/cerf.h> 30#include <mach/cerf.h>
31#include <mach/mcp.h> 31#include <linux/platform_data/mfd-mcp-sa11x0.h>
32#include <mach/irqs.h> 32#include <mach/irqs.h>
33#include "generic.h" 33#include "generic.h"
34 34
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index ea5cff38745c..170cb6107f68 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/include/mach/simpad.h b/arch/arm/mach-sa1100/include/mach/simpad.h
index cdea671e8931..ac2ea767215d 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 b775a0abec0a..7dc1a89b1273 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -16,7 +16,7 @@
16#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18#include <asm/mach/serial_sa1100.h> 18#include <asm/mach/serial_sa1100.h>
19#include <mach/mcp.h> 19#include <linux/platform_data/mfd-mcp-sa11x0.h>
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21 21
22#include "generic.h" 22#include "generic.h"
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 5d33fc3108ef..ff6b7b35bca9 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 fbd53593be54..71790e581d93 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/core.c b/arch/arm/mach-shark/core.c
index 2704bcd869cd..d35b94ef73b7 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -21,9 +21,6 @@
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23 23
24#define IO_BASE 0xe0000000
25#define IO_SIZE 0x08000000
26#define IO_START 0x40000000
27#define ROMCARD_SIZE 0x08000000 24#define ROMCARD_SIZE 0x08000000
28#define ROMCARD_START 0x10000000 25#define ROMCARD_START 0x10000000
29 26
@@ -104,20 +101,6 @@ arch_initcall(shark_init);
104 101
105extern void shark_init_irq(void); 102extern void shark_init_irq(void);
106 103
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 104#define IRQ_TIMER 0
122#define HZ_TIME ((1193180 + HZ/2) / HZ) 105#define HZ_TIME ((1193180 + HZ/2) / HZ)
123 106
@@ -158,7 +141,6 @@ static void shark_init_early(void)
158MACHINE_START(SHARK, "Shark") 141MACHINE_START(SHARK, "Shark")
159 /* Maintainer: Alexander Schulz */ 142 /* Maintainer: Alexander Schulz */
160 .atag_offset = 0x3000, 143 .atag_offset = 0x3000,
161 .map_io = shark_map_io,
162 .init_early = shark_init_early, 144 .init_early = shark_init_early,
163 .init_irq = shark_init_irq, 145 .init_irq = shark_init_irq,
164 .timer = &shark_timer, 146 .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 20eb2bf2a42b..d129119a3f69 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 5901b09fc96a..c9e49f049532 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 1a45fc01ff1d..000000000000
--- 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/pci.c b/arch/arm/mach-shark/pci.c
index 9089407d5326..b8b4ab323a3e 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)
@@ -44,6 +47,8 @@ static int __init shark_pci_init(void)
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/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index d82c010fdfc6..25eb88a923e6 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 f172ca85905c..bc3b5da59e25 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,9 +1226,9 @@ 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{
1232 u32 srcr4; 1234 u32 srcr4;
@@ -1304,7 +1306,7 @@ static void __init ap4evb_init(void)
1304 gpio_request(GPIO_FN_OVCN2_1, NULL); 1306 gpio_request(GPIO_FN_OVCN2_1, NULL);
1305 1307
1306 /* setup USB phy */ 1308 /* setup USB phy */
1307 __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */ 1309 __raw_writew(0x8a0a, IOMEM(0xE6058130)); /* USBCR4 */
1308 1310
1309 /* enable FSI2 port A (ak4643) */ 1311 /* enable FSI2 port A (ak4643) */
1310 gpio_request(GPIO_FN_FSIAIBT, NULL); 1312 gpio_request(GPIO_FN_FSIAIBT, NULL);
@@ -1453,7 +1455,7 @@ static void __init ap4evb_init(void)
1453 gpio_request(GPIO_FN_HDMI_CEC, NULL); 1455 gpio_request(GPIO_FN_HDMI_CEC, NULL);
1454 1456
1455 /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */ 1457 /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */
1456#define SRCR4 0xe61580bc 1458#define SRCR4 IOMEM(0xe61580bc)
1457 srcr4 = __raw_readl(SRCR4); 1459 srcr4 = __raw_readl(SRCR4);
1458 __raw_writel(srcr4 | (1 << 13), SRCR4); 1460 __raw_writel(srcr4 | (1 << 13), SRCR4);
1459 udelay(50); 1461 udelay(50);
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 453a6e50db8b..206c3227f83d 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -54,6 +54,8 @@
54#include <sound/sh_fsi.h> 54#include <sound/sh_fsi.h>
55#include <sound/simple_card.h> 55#include <sound/simple_card.h>
56 56
57#include "sh-gpio.h"
58
57/* 59/*
58 * CON1 Camera Module 60 * CON1 Camera Module
59 * CON2 Extension Bus 61 * CON2 Extension Bus
@@ -135,7 +137,7 @@
135 * usbhsf_power_ctrl() 137 * usbhsf_power_ctrl()
136 */ 138 */
137#define IRQ7 evt2irq(0x02e0) 139#define IRQ7 evt2irq(0x02e0)
138#define USBCR1 0xe605810a 140#define USBCR1 IOMEM(0xe605810a)
139#define USBH 0xC6700000 141#define USBH 0xC6700000
140#define USBH_USBCTR 0x10834 142#define USBH_USBCTR 0x10834
141 143
@@ -950,8 +952,8 @@ clock_error:
950/* 952/*
951 * board init 953 * board init
952 */ 954 */
953#define GPIO_PORT7CR 0xe6050007 955#define GPIO_PORT7CR IOMEM(0xe6050007)
954#define GPIO_PORT8CR 0xe6050008 956#define GPIO_PORT8CR IOMEM(0xe6050008)
955static void __init eva_init(void) 957static void __init eva_init(void)
956{ 958{
957 struct platform_device *usb = NULL; 959 struct platform_device *usb = NULL;
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c
index 4129008eae29..cb8c994e1430 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 796fa00ad3c4..b179d4c213bb 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 fa5dfc5c8ed6..35c126caa4d8 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 21dbe54304d5..bf88f9a8b7ac 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 2c986eaae7b4..b52bc0d1273f 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 53b7ea92c32c..6525835abc0a 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,
@@ -763,12 +763,20 @@ static void __init kzm_init(void)
763 platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices)); 763 platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
764} 764}
765 765
766static void kzm9g_restart(char mode, const char *cmd)
767{
768#define RESCNT2 0xe6188020
769 /* Do soft power on reset */
770 writel((1 << 31), RESCNT2);
771}
772
766static const char *kzm9g_boards_compat_dt[] __initdata = { 773static const char *kzm9g_boards_compat_dt[] __initdata = {
767 "renesas,kzm9g", 774 "renesas,kzm9g",
768 NULL, 775 NULL,
769}; 776};
770 777
771DT_MACHINE_START(KZM9G_DT, "kzm9g") 778DT_MACHINE_START(KZM9G_DT, "kzm9g")
779 .smp = smp_ops(sh73a0_smp_ops),
772 .map_io = sh73a0_map_io, 780 .map_io = sh73a0_map_io,
773 .init_early = sh73a0_add_early_devices, 781 .init_early = sh73a0_add_early_devices,
774 .nr_irqs = NR_IRQS_LEGACY, 782 .nr_irqs = NR_IRQS_LEGACY,
@@ -777,5 +785,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
777 .init_machine = kzm_init, 785 .init_machine = kzm_init,
778 .init_late = shmobile_init_late, 786 .init_late = shmobile_init_late,
779 .timer = &shmobile_timer, 787 .timer = &shmobile_timer,
788 .restart = kzm9g_restart,
780 .dt_compat = kzm9g_boards_compat_dt, 789 .dt_compat = kzm9g_boards_compat_dt,
781MACHINE_END 790MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index c129542f6aed..62783b5d8813 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,12 +1404,12 @@ 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{
1413 u32 srcr4; 1415 u32 srcr4;
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index fcf5a47f4772..01ce3f15c6a3 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -102,6 +102,7 @@ static void __init marzen_init(void)
102} 102}
103 103
104MACHINE_START(MARZEN, "marzen") 104MACHINE_START(MARZEN, "marzen")
105 .smp = smp_ops(r8a7779_smp_ops),
105 .map_io = r8a7779_map_io, 106 .map_io = r8a7779_map_io,
106 .init_early = r8a7779_add_early_devices, 107 .init_early = r8a7779_add_early_devices,
107 .nr_irqs = NR_IRQS_LEGACY, 108 .nr_irqs = NR_IRQS_LEGACY,
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index ad5fccc7b5e7..6729e0032180 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 339c62c824d5..3cafb6ab5e9a 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 162b791b8984..ef0a95e592c4 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 5a2894b1c965..430a90ffa120 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 85f2a3ec2c44..b8480d19e1c8 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 7f8da18a8580..516ff7f3e434 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/hotplug.c b/arch/arm/mach-shmobile/hotplug.c
index 828d22f3af57..b09a0bdbf813 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 45e61dada030..f80f9c549393 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -4,11 +4,10 @@
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 *);
@@ -58,11 +57,6 @@ extern struct clk sh73a0_extal2_clk;
58extern struct clk sh73a0_extcki_clk; 57extern struct clk sh73a0_extcki_clk;
59extern struct clk sh73a0_extalr_clk; 58extern struct clk sh73a0_extalr_clk;
60 59
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); 60extern void r8a7740_init_irq(void);
67extern void r8a7740_map_io(void); 61extern void r8a7740_map_io(void);
68extern void r8a7740_add_early_devices(void); 62extern void r8a7740_add_early_devices(void);
@@ -79,11 +73,6 @@ extern void r8a7779_pinmux_init(void);
79extern void r8a7779_pm_init(void); 73extern void r8a7779_pm_init(void);
80extern void r8a7740_meram_workaround(void); 74extern void r8a7740_meram_workaround(void);
81 75
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); 76extern void r8a7779_register_twd(void);
88 77
89extern void shmobile_init_late(void); 78extern void shmobile_init_late(void);
@@ -100,4 +89,15 @@ 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
103#endif /* __ARCH_MACH_COMMON_H */ 103#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 e6b0c1bf4b7e..ac3751705cab 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/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index b07ad318eb2e..f504c5e81b47 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -360,4 +360,6 @@ extern void r8a7779_add_device_to_domain(struct r8a7779_pm_domain *r8a7779_pd,
360#define r8a7779_add_device_to_domain(pd, pdev) do { } while (0) 360#define r8a7779_add_device_to_domain(pd, pdev) do { } while (0)
361#endif /* CONFIG_PM */ 361#endif /* CONFIG_PM */
362 362
363extern struct smp_operations r8a7779_smp_ops;
364
363#endif /* __ASM_R8A7779_H__ */ 365#endif /* __ASM_R8A7779_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
index fe950f25d793..606d31d02a4e 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 f04fad4ec4fb..ef66f1a8aa2e 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 2587a22842f2..a91caad7db7c 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 588555a67d9c..f0c5e5190601 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 ce9e7fa5cc8a..134d1b9a8821 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 d14c9b048077..cbc26ba2a0a2 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 e6e524654e67..c0c137f39052 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 336093f9210a..7a1525fd6ada 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 2f10511946ad..f3117f67fa25 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 4a547b803268..b442f9d8c716 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 fde0d23121dc..ed8d2351915e 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-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index a8562540f1d6..32e177275e47 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
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index 792037069226..162121842a2b 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -29,45 +29,46 @@
29#include <mach/pm-rmobile.h> 29#include <mach/pm-rmobile.h>
30 30
31/* DBG */ 31/* DBG */
32#define DBGREG1 0xe6100020 32#define DBGREG1 IOMEM(0xe6100020)
33#define DBGREG9 0xe6100040 33#define DBGREG9 IOMEM(0xe6100040)
34 34
35/* CPGA */ 35/* CPGA */
36#define SYSTBCR 0xe6150024 36#define SYSTBCR IOMEM(0xe6150024)
37#define MSTPSR0 0xe6150030 37#define MSTPSR0 IOMEM(0xe6150030)
38#define MSTPSR1 0xe6150038 38#define MSTPSR1 IOMEM(0xe6150038)
39#define MSTPSR2 0xe6150040 39#define MSTPSR2 IOMEM(0xe6150040)
40#define MSTPSR3 0xe6150048 40#define MSTPSR3 IOMEM(0xe6150048)
41#define MSTPSR4 0xe615004c 41#define MSTPSR4 IOMEM(0xe615004c)
42#define PLLC01STPCR 0xe61500c8 42#define PLLC01STPCR IOMEM(0xe61500c8)
43 43
44/* SYSC */ 44/* SYSC */
45#define SBAR 0xe6180020 45#define SBAR IOMEM(0xe6180020)
46#define WUPRMSK 0xe6180028 46#define WUPRMSK IOMEM(0xe6180028)
47#define WUPSMSK 0xe618002c 47#define WUPSMSK IOMEM(0xe618002c)
48#define WUPSMSK2 0xe6180048 48#define WUPSMSK2 IOMEM(0xe6180048)
49#define WUPSFAC 0xe6180098 49#define WUPSFAC IOMEM(0xe6180098)
50#define IRQCR 0xe618022c 50#define IRQCR IOMEM(0xe618022c)
51#define IRQCR2 0xe6180238 51#define IRQCR2 IOMEM(0xe6180238)
52#define IRQCR3 0xe6180244 52#define IRQCR3 IOMEM(0xe6180244)
53#define IRQCR4 0xe6180248 53#define IRQCR4 IOMEM(0xe6180248)
54#define PDNSEL 0xe6180254 54#define PDNSEL IOMEM(0xe6180254)
55 55
56/* INTC */ 56/* INTC */
57#define ICR1A 0xe6900000 57#define ICR1A IOMEM(0xe6900000)
58#define ICR2A 0xe6900004 58#define ICR2A IOMEM(0xe6900004)
59#define ICR3A 0xe6900008 59#define ICR3A IOMEM(0xe6900008)
60#define ICR4A 0xe690000c 60#define ICR4A IOMEM(0xe690000c)
61#define INTMSK00A 0xe6900040 61#define INTMSK00A IOMEM(0xe6900040)
62#define INTMSK10A 0xe6900044 62#define INTMSK10A IOMEM(0xe6900044)
63#define INTMSK20A 0xe6900048 63#define INTMSK20A IOMEM(0xe6900048)
64#define INTMSK30A 0xe690004c 64#define INTMSK30A IOMEM(0xe690004c)
65 65
66/* MFIS */ 66/* MFIS */
67/* FIXME: pointing where? */
67#define SMFRAM 0xe6a70000 68#define SMFRAM 0xe6a70000
68 69
69/* AP-System Core */ 70/* AP-System Core */
70#define APARMBAREA 0xe6f10020 71#define APARMBAREA IOMEM(0xe6f10020)
71 72
72#ifdef CONFIG_PM 73#ifdef CONFIG_PM
73 74
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
index dae9aa68bb09..a47beeb18283 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-sh7367.c b/arch/arm/mach-shmobile/setup-sh7367.c
index 2e3074ab75b3..e647f5410879 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-sh7377.c b/arch/arm/mach-shmobile/setup-sh7377.c
index 855b1506caf8..edcf98bb7012 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 d230af656fc9..db99a4ade80c 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 844507d937cb..e834763ac2a5 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 6a35c4a31e6c..f978c5d0e1ae 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
@@ -86,7 +104,7 @@ int __cpuinit emev2_boot_secondary(unsigned int cpu)
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 6d1d0238cbf7..2ce6af9a6a37 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 e36c41c4ab40..624f00f70abf 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 000000000000..803a3281feb5
--- /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 dae9661a7689..000000000000
--- a/arch/arm/mach-socfpga/Makefile.boot
+++ /dev/null
@@ -1 +0,0 @@
1zreladdr-y := 0x00008000
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 bbe20e696325..000000000000
--- 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 403efd7e6d27..4674a4c221db 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 5c6867b46d09..a7d2dd11a4f2 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 dac57fd0cdfd..c33f4d9361bd 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 85f176311f63..000000000000
--- 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 65f27def239b..07d90acc92c8 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 f5d07f2663d7..2eaa3fa7b432 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 732d29bc7330..9fbbfc5650aa 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 81e4ed76ad06..081014fb314a 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 cf936b106e27..e10648801b2e 100644
--- a/arch/arm/mach-spear13xx/spear13xx.c
+++ b/arch/arm/mach-spear13xx/spear13xx.c
@@ -114,17 +114,17 @@ void __init spear13xx_l2x0_init(void)
114 */ 114 */
115struct map_desc spear13xx_io_desc[] __initdata = { 115struct map_desc spear13xx_io_desc[] __initdata = {
116 { 116 {
117 .virtual = VA_PERIP_GRP2_BASE, 117 .virtual = (unsigned long)VA_PERIP_GRP2_BASE,
118 .pfn = __phys_to_pfn(PERIP_GRP2_BASE), 118 .pfn = __phys_to_pfn(PERIP_GRP2_BASE),
119 .length = SZ_16M, 119 .length = SZ_16M,
120 .type = MT_DEVICE 120 .type = MT_DEVICE
121 }, { 121 }, {
122 .virtual = VA_PERIP_GRP1_BASE, 122 .virtual = (unsigned long)VA_PERIP_GRP1_BASE,
123 .pfn = __phys_to_pfn(PERIP_GRP1_BASE), 123 .pfn = __phys_to_pfn(PERIP_GRP1_BASE),
124 .length = SZ_16M, 124 .length = SZ_16M,
125 .type = MT_DEVICE 125 .type = MT_DEVICE
126 }, { 126 }, {
127 .virtual = VA_A9SM_AND_MPMC_BASE, 127 .virtual = (unsigned long)VA_A9SM_AND_MPMC_BASE,
128 .pfn = __phys_to_pfn(A9SM_AND_MPMC_BASE), 128 .pfn = __phys_to_pfn(A9SM_AND_MPMC_BASE),
129 .length = SZ_16M, 129 .length = SZ_16M,
130 .type = MT_DEVICE 130 .type = MT_DEVICE
diff --git a/arch/arm/mach-spear3xx/Makefile.boot b/arch/arm/mach-spear3xx/Makefile.boot
index d93e2177e6ec..4674a4c221db 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 2ac74c6db7f1..000000000000
--- 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 af493da37ab6..4674a4c221db 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 d42cefc0356d..000000000000
--- 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 9077aaa398d9..5f3c03b61f8e 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -34,7 +34,6 @@ config ARCH_TEGRA_3x_SOC
34 select USB_ARCH_HAS_EHCI if USB_SUPPORT 34 select USB_ARCH_HAS_EHCI if USB_SUPPORT
35 select USB_ULPI if USB 35 select USB_ULPI if USB
36 select USB_ULPI_VIEWPORT if USB_SUPPORT 36 select USB_ULPI_VIEWPORT if USB_SUPPORT
37 select USE_OF
38 select ARM_ERRATA_743622 37 select ARM_ERRATA_743622
39 select ARM_ERRATA_751472 38 select ARM_ERRATA_751472
40 select ARM_ERRATA_754322 39 select ARM_ERRATA_754322
@@ -60,25 +59,6 @@ config TEGRA_AHB
60 59
61comment "Tegra board type" 60comment "Tegra board type"
62 61
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 62choice
83 prompt "Default low-level debug console UART" 63 prompt "Default low-level debug console UART"
84 default TEGRA_DEBUG_UART_NONE 64 default TEGRA_DEBUG_UART_NONE
@@ -130,13 +110,6 @@ config TEGRA_DEBUG_UART_AUTO_SCRATCH
130 110
131endchoice 111endchoice
132 112
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 113config TEGRA_EMC_SCALING_ENABLE
141 bool "Enable scaling the memory frequency" 114 bool "Enable scaling the memory frequency"
142 115
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index c3d7303b9ac8..04eb74e3f601 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -12,13 +12,16 @@ obj-y += powergate.o
12obj-y += apbio.o 12obj-y += apbio.o
13obj-$(CONFIG_CPU_IDLE) += cpuidle.o 13obj-$(CONFIG_CPU_IDLE) += cpuidle.o
14obj-$(CONFIG_CPU_IDLE) += sleep.o 14obj-$(CONFIG_CPU_IDLE) += sleep.o
15obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_clocks.o 15obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks.o
16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks_data.o
16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o 17obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o
18obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-t20.o
17obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o 19obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o
20obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks_data.o
21obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-t30.o
18obj-$(CONFIG_SMP) += platsmp.o headsmp.o 22obj-$(CONFIG_SMP) += platsmp.o headsmp.o
19obj-$(CONFIG_SMP) += reset.o 23obj-$(CONFIG_SMP) += reset.o
20obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 24obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
21obj-$(CONFIG_TEGRA_SYSTEM_DMA) += dma.o
22obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o 25obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
23obj-$(CONFIG_TEGRA_PCI) += pcie.o 26obj-$(CONFIG_TEGRA_PCI) += pcie.o
24obj-$(CONFIG_USB_SUPPORT) += usb_phy.o 27obj-$(CONFIG_USB_SUPPORT) += usb_phy.o
@@ -26,13 +29,6 @@ obj-$(CONFIG_USB_SUPPORT) += usb_phy.o
26obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o 29obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
27obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o 30obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
28 31
29obj-$(CONFIG_MACH_HARMONY) += board-harmony.o 32obj-$(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 33
34obj-$(CONFIG_MACH_PAZ00) += board-paz00.o 34obj-$(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 7a1bb62ddcf0..29433816233c 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 dc0fe389be56..b5015d0f1912 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 c0999633a9ab..5d8c8fb060b0 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -42,9 +42,9 @@
42#include <mach/irqs.h> 42#include <mach/irqs.h>
43 43
44#include "board.h" 44#include "board.h"
45#include "board-harmony.h"
46#include "clock.h" 45#include "clock.h"
47#include "devices.h" 46#include "devices.h"
47#include "common.h"
48 48
49struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { 49struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
50 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL), 50 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL),
@@ -71,6 +71,7 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
71 71
72static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = { 72static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
73 /* name parent rate enabled */ 73 /* name parent rate enabled */
74 { "uarta", "pll_p", 216000000, true },
74 { "uartd", "pll_p", 216000000, true }, 75 { "uartd", "pll_p", 216000000, true },
75 { "usbd", "clk_m", 12000000, false }, 76 { "usbd", "clk_m", 12000000, false },
76 { "usb2", "clk_m", 12000000, false }, 77 { "usb2", "clk_m", 12000000, false },
@@ -95,54 +96,40 @@ static void __init tegra_dt_init(void)
95 tegra20_auxdata_lookup, NULL); 96 tegra20_auxdata_lookup, NULL);
96} 97}
97 98
98#ifdef CONFIG_MACH_TRIMSLICE
99static void __init trimslice_init(void) 99static void __init trimslice_init(void)
100{ 100{
101#ifdef CONFIG_TEGRA_PCI
101 int ret; 102 int ret;
102 103
103 ret = tegra_pcie_init(true, true); 104 ret = tegra_pcie_init(true, true);
104 if (ret) 105 if (ret)
105 pr_err("tegra_pci_init() failed: %d\n", ret); 106 pr_err("tegra_pci_init() failed: %d\n", ret);
106}
107#endif 107#endif
108}
108 109
109#ifdef CONFIG_MACH_HARMONY
110static void __init harmony_init(void) 110static void __init harmony_init(void)
111{ 111{
112#ifdef CONFIG_TEGRA_PCI
112 int ret; 113 int ret;
113 114
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(); 115 ret = harmony_pcie_init();
121 if (ret) 116 if (ret)
122 pr_err("harmony_pcie_init() failed: %d\n", ret); 117 pr_err("harmony_pcie_init() failed: %d\n", ret);
123}
124#endif 118#endif
119}
125 120
126#ifdef CONFIG_MACH_PAZ00
127static void __init paz00_init(void) 121static void __init paz00_init(void)
128{ 122{
129 tegra_paz00_wifikill_init(); 123 tegra_paz00_wifikill_init();
130} 124}
131#endif
132 125
133static struct { 126static struct {
134 char *machine; 127 char *machine;
135 void (*init)(void); 128 void (*init)(void);
136} board_init_funcs[] = { 129} board_init_funcs[] = {
137#ifdef CONFIG_MACH_TRIMSLICE
138 { "compulab,trimslice", trimslice_init }, 130 { "compulab,trimslice", trimslice_init },
139#endif
140#ifdef CONFIG_MACH_HARMONY
141 { "nvidia,harmony", harmony_init }, 131 { "nvidia,harmony", harmony_init },
142#endif
143#ifdef CONFIG_MACH_PAZ00
144 { "compal,paz00", paz00_init }, 132 { "compal,paz00", paz00_init },
145#endif
146}; 133};
147 134
148static void __init tegra_dt_init_late(void) 135static void __init tegra_dt_init_late(void)
@@ -166,6 +153,7 @@ static const char *tegra20_dt_board_compat[] = {
166 153
167DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)") 154DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
168 .map_io = tegra_map_common_io, 155 .map_io = tegra_map_common_io,
156 .smp = smp_ops(tegra_smp_ops),
169 .init_early = tegra20_init_early, 157 .init_early = tegra20_init_early,
170 .init_irq = tegra_dt_init_irq, 158 .init_irq = tegra_dt_init_irq,
171 .handle_irq = gic_handle_irq, 159 .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 53bf60f11580..e4a676d4ddf7 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 e8c3fda9bec2..3cdc1bb8254c 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 83d420fbc58c..000000000000
--- 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 b7344beec102..000000000000
--- 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 e65e837f4013..000000000000
--- 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 139d96c93843..000000000000
--- 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 6f1111b48e7c..000000000000
--- 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 4b64af5cab27..740e16f64728 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 3c9f8da37ea3..25c08ecef52f 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-trimslice-pinmux.c b/arch/arm/mach-tegra/board-trimslice-pinmux.c
deleted file mode 100644
index 7b39511c0d4d..000000000000
--- 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 776aa9564d5d..000000000000
--- 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 50f128d87779..000000000000
--- 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 58f981c0819c..fd82085eca5d 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 bc300657deba..2aa37f5c44c0 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 96fef6bcc651..0b0a5f556d34 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 000000000000..02f71b4f1e51
--- /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 ceb52db1e2f1..627bf0f4262e 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
index c70e65ffa36b..61e9603744a7 100644
--- a/arch/arm/mach-tegra/devices.c
+++ b/arch/arm/mach-tegra/devices.c
@@ -23,7 +23,6 @@
23#include <linux/fsl_devices.h> 23#include <linux/fsl_devices.h>
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25#include <linux/i2c-tegra.h> 25#include <linux/i2c-tegra.h>
26#include <asm/pmu.h>
27#include <mach/irqs.h> 26#include <mach/irqs.h>
28#include <mach/iomap.h> 27#include <mach/iomap.h>
29#include <mach/dma.h> 28#include <mach/dma.h>
@@ -516,7 +515,7 @@ static struct resource tegra_pmu_resources[] = {
516 515
517struct platform_device tegra_pmu_device = { 516struct platform_device tegra_pmu_device = {
518 .name = "arm-pmu", 517 .name = "arm-pmu",
519 .id = ARM_PMU_DEVICE_CPU, 518 .id = -1,
520 .num_resources = ARRAY_SIZE(tegra_pmu_resources), 519 .num_resources = ARRAY_SIZE(tegra_pmu_resources),
521 .resource = tegra_pmu_resources, 520 .resource = tegra_pmu_resources,
522}; 521};
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
deleted file mode 100644
index 29c5114d607c..000000000000
--- 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 f946d129423c..0b7db174a5de 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 fef9c2c51370..6addc78cb6b2 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 d8dc9ddd6d18..dca5141a2c31 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 d97e403303a0..95f3a547c770 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 9077092812c0..3081cc6dda3b 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 40a8c178f10d..000000000000
--- 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 fe700f9ce7dc..000000000000
--- 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 7e76da73121c..fee3a94c4549 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/pcie.c b/arch/arm/mach-tegra/pcie.c
index d3ad5150d660..3463fb5b79c7 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{
@@ -391,24 +376,7 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
391 pp = tegra_pcie.port + nr; 376 pp = tegra_pcie.port + nr;
392 pp->root_bus_nr = sys->busnr; 377 pp->root_bus_nr = sys->busnr;
393 378
394 /* 379 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 380
413 /* 381 /*
414 * IORESOURCE_MEM 382 * IORESOURCE_MEM
@@ -416,18 +384,18 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
416 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), 384 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
417 "PCIe %d MEM", pp->index); 385 "PCIe %d MEM", pp->index);
418 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; 386 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0;
419 pp->res[1].name = pp->mem_space_name; 387 pp->res[0].name = pp->mem_space_name;
420 if (pp->index == 0) { 388 if (pp->index == 0) {
421 pp->res[1].start = MEM_BASE_0; 389 pp->res[0].start = MEM_BASE_0;
422 pp->res[1].end = pp->res[1].start + MEM_SIZE_0 - 1; 390 pp->res[0].end = pp->res[0].start + MEM_SIZE_0 - 1;
423 } else { 391 } else {
424 pp->res[1].start = MEM_BASE_1; 392 pp->res[0].start = MEM_BASE_1;
425 pp->res[1].end = pp->res[1].start + MEM_SIZE_1 - 1; 393 pp->res[0].end = pp->res[0].start + MEM_SIZE_1 - 1;
426 } 394 }
427 pp->res[1].flags = IORESOURCE_MEM; 395 pp->res[0].flags = IORESOURCE_MEM;
428 if (request_resource(&iomem_resource, &pp->res[1])) 396 if (request_resource(&iomem_resource, &pp->res[0]))
429 panic("Request PCIe Memory resource failed\n"); 397 panic("Request PCIe Memory resource failed\n");
430 pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); 398 pci_add_resource_offset(&sys->resources, &pp->res[0], sys->mem_offset);
431 399
432 /* 400 /*
433 * IORESOURCE_MEM | IORESOURCE_PREFETCH 401 * IORESOURCE_MEM | IORESOURCE_PREFETCH
@@ -435,18 +403,18 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
435 snprintf(pp->prefetch_space_name, sizeof(pp->prefetch_space_name), 403 snprintf(pp->prefetch_space_name, sizeof(pp->prefetch_space_name),
436 "PCIe %d PREFETCH MEM", pp->index); 404 "PCIe %d PREFETCH MEM", pp->index);
437 pp->prefetch_space_name[sizeof(pp->prefetch_space_name) - 1] = 0; 405 pp->prefetch_space_name[sizeof(pp->prefetch_space_name) - 1] = 0;
438 pp->res[2].name = pp->prefetch_space_name; 406 pp->res[1].name = pp->prefetch_space_name;
439 if (pp->index == 0) { 407 if (pp->index == 0) {
440 pp->res[2].start = PREFETCH_MEM_BASE_0; 408 pp->res[1].start = PREFETCH_MEM_BASE_0;
441 pp->res[2].end = pp->res[2].start + PREFETCH_MEM_SIZE_0 - 1; 409 pp->res[1].end = pp->res[1].start + PREFETCH_MEM_SIZE_0 - 1;
442 } else { 410 } else {
443 pp->res[2].start = PREFETCH_MEM_BASE_1; 411 pp->res[1].start = PREFETCH_MEM_BASE_1;
444 pp->res[2].end = pp->res[2].start + PREFETCH_MEM_SIZE_1 - 1; 412 pp->res[1].end = pp->res[1].start + PREFETCH_MEM_SIZE_1 - 1;
445 } 413 }
446 pp->res[2].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH; 414 pp->res[1].flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
447 if (request_resource(&iomem_resource, &pp->res[2])) 415 if (request_resource(&iomem_resource, &pp->res[1]))
448 panic("Request PCIe Prefetch Memory resource failed\n"); 416 panic("Request PCIe Prefetch Memory resource failed\n");
449 pci_add_resource_offset(&sys->resources, &pp->res[2], sys->mem_offset); 417 pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset);
450 418
451 return 1; 419 return 1;
452} 420}
@@ -541,8 +509,8 @@ static void tegra_pcie_setup_translations(void)
541 509
542 /* Bar 2: downstream IO bar */ 510 /* Bar 2: downstream IO bar */
543 fpci_bar = ((__u32)0xfdfc << 16); 511 fpci_bar = ((__u32)0xfdfc << 16);
544 size = MMIO_SIZE; 512 size = SZ_128K;
545 axi_address = MMIO_BASE; 513 axi_address = TEGRA_PCIE_IO_BASE;
546 afi_writel(axi_address, AFI_AXI_BAR2_START); 514 afi_writel(axi_address, AFI_AXI_BAR2_START);
547 afi_writel(size >> 12, AFI_AXI_BAR2_SZ); 515 afi_writel(size >> 12, AFI_AXI_BAR2_SZ);
548 afi_writel(fpci_bar, AFI_FPCI_BAR2); 516 afi_writel(fpci_bar, AFI_FPCI_BAR2);
@@ -776,7 +744,6 @@ static void tegra_pcie_clocks_put(void)
776 744
777static int __init tegra_pcie_get_resources(void) 745static int __init tegra_pcie_get_resources(void)
778{ 746{
779 struct resource *res_mmio = &tegra_pcie.res_mmio;
780 int err; 747 int err;
781 748
782 err = tegra_pcie_clocks_get(); 749 err = tegra_pcie_clocks_get();
@@ -798,34 +765,16 @@ static int __init tegra_pcie_get_resources(void)
798 goto err_map_reg; 765 goto err_map_reg;
799 } 766 }
800 767
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, 768 err = request_irq(INT_PCIE_INTR, tegra_pcie_isr,
816 IRQF_SHARED, "PCIE", &tegra_pcie); 769 IRQF_SHARED, "PCIE", &tegra_pcie);
817 if (err) { 770 if (err) {
818 pr_err("PCIE: Failed to register IRQ: %d\n", err); 771 pr_err("PCIE: Failed to register IRQ: %d\n", err);
819 goto err_irq; 772 goto err_req_io;
820 } 773 }
821 set_irq_flags(INT_PCIE_INTR, IRQF_VALID); 774 set_irq_flags(INT_PCIE_INTR, IRQF_VALID);
822 775
823 return 0; 776 return 0;
824 777
825err_irq:
826 iounmap(tegra_pcie_io_base);
827err_map_io:
828 release_resource(&tegra_pcie.res_mmio);
829err_req_io: 778err_req_io:
830 iounmap(tegra_pcie.regs); 779 iounmap(tegra_pcie.regs);
831err_map_reg: 780err_map_reg:
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 1a208dbf682f..81cb26591acf 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/sleep-t20.S b/arch/arm/mach-tegra/sleep-t20.S
new file mode 100644
index 000000000000..a36ae413e2b8
--- /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 000000000000..777d9cee8b90
--- /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 d29b156a8011..ea81554c4833 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 000000000000..e25a7cd703d9
--- /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 000000000000..9273b0dffc66
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra20_clocks.c
@@ -0,0 +1,1625 @@
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#include <mach/suspend.h>
32
33#include "clock.h"
34#include "fuse.h"
35#include "tegra2_emc.h"
36#include "tegra_cpu_car.h"
37
38#define RST_DEVICES 0x004
39#define RST_DEVICES_SET 0x300
40#define RST_DEVICES_CLR 0x304
41#define RST_DEVICES_NUM 3
42
43#define CLK_OUT_ENB 0x010
44#define CLK_OUT_ENB_SET 0x320
45#define CLK_OUT_ENB_CLR 0x324
46#define CLK_OUT_ENB_NUM 3
47
48#define CLK_MASK_ARM 0x44
49#define MISC_CLK_ENB 0x48
50
51#define OSC_CTRL 0x50
52#define OSC_CTRL_OSC_FREQ_MASK (3<<30)
53#define OSC_CTRL_OSC_FREQ_13MHZ (0<<30)
54#define OSC_CTRL_OSC_FREQ_19_2MHZ (1<<30)
55#define OSC_CTRL_OSC_FREQ_12MHZ (2<<30)
56#define OSC_CTRL_OSC_FREQ_26MHZ (3<<30)
57#define OSC_CTRL_MASK (0x3f2 | OSC_CTRL_OSC_FREQ_MASK)
58
59#define OSC_FREQ_DET 0x58
60#define OSC_FREQ_DET_TRIG (1<<31)
61
62#define OSC_FREQ_DET_STATUS 0x5C
63#define OSC_FREQ_DET_BUSY (1<<31)
64#define OSC_FREQ_DET_CNT_MASK 0xFFFF
65
66#define PERIPH_CLK_SOURCE_I2S1 0x100
67#define PERIPH_CLK_SOURCE_EMC 0x19c
68#define PERIPH_CLK_SOURCE_OSC 0x1fc
69#define PERIPH_CLK_SOURCE_NUM \
70 ((PERIPH_CLK_SOURCE_OSC - PERIPH_CLK_SOURCE_I2S1) / 4)
71
72#define PERIPH_CLK_SOURCE_MASK (3<<30)
73#define PERIPH_CLK_SOURCE_SHIFT 30
74#define PERIPH_CLK_SOURCE_PWM_MASK (7<<28)
75#define PERIPH_CLK_SOURCE_PWM_SHIFT 28
76#define PERIPH_CLK_SOURCE_ENABLE (1<<28)
77#define PERIPH_CLK_SOURCE_DIVU71_MASK 0xFF
78#define PERIPH_CLK_SOURCE_DIVU16_MASK 0xFFFF
79#define PERIPH_CLK_SOURCE_DIV_SHIFT 0
80
81#define SDMMC_CLK_INT_FB_SEL (1 << 23)
82#define SDMMC_CLK_INT_FB_DLY_SHIFT 16
83#define SDMMC_CLK_INT_FB_DLY_MASK (0xF << SDMMC_CLK_INT_FB_DLY_SHIFT)
84
85#define PLL_BASE 0x0
86#define PLL_BASE_BYPASS (1<<31)
87#define PLL_BASE_ENABLE (1<<30)
88#define PLL_BASE_REF_ENABLE (1<<29)
89#define PLL_BASE_OVERRIDE (1<<28)
90#define PLL_BASE_DIVP_MASK (0x7<<20)
91#define PLL_BASE_DIVP_SHIFT 20
92#define PLL_BASE_DIVN_MASK (0x3FF<<8)
93#define PLL_BASE_DIVN_SHIFT 8
94#define PLL_BASE_DIVM_MASK (0x1F)
95#define PLL_BASE_DIVM_SHIFT 0
96
97#define PLL_OUT_RATIO_MASK (0xFF<<8)
98#define PLL_OUT_RATIO_SHIFT 8
99#define PLL_OUT_OVERRIDE (1<<2)
100#define PLL_OUT_CLKEN (1<<1)
101#define PLL_OUT_RESET_DISABLE (1<<0)
102
103#define PLL_MISC(c) (((c)->flags & PLL_ALT_MISC_REG) ? 0x4 : 0xc)
104
105#define PLL_MISC_DCCON_SHIFT 20
106#define PLL_MISC_CPCON_SHIFT 8
107#define PLL_MISC_CPCON_MASK (0xF<<PLL_MISC_CPCON_SHIFT)
108#define PLL_MISC_LFCON_SHIFT 4
109#define PLL_MISC_LFCON_MASK (0xF<<PLL_MISC_LFCON_SHIFT)
110#define PLL_MISC_VCOCON_SHIFT 0
111#define PLL_MISC_VCOCON_MASK (0xF<<PLL_MISC_VCOCON_SHIFT)
112
113#define PLLU_BASE_POST_DIV (1<<20)
114
115#define PLLD_MISC_CLKENABLE (1<<30)
116#define PLLD_MISC_DIV_RST (1<<23)
117#define PLLD_MISC_DCCON_SHIFT 12
118
119#define PLLE_MISC_READY (1 << 15)
120
121#define PERIPH_CLK_TO_ENB_REG(c) ((c->u.periph.clk_num / 32) * 4)
122#define PERIPH_CLK_TO_ENB_SET_REG(c) ((c->u.periph.clk_num / 32) * 8)
123#define PERIPH_CLK_TO_ENB_BIT(c) (1 << (c->u.periph.clk_num % 32))
124
125#define SUPER_CLK_MUX 0x00
126#define SUPER_STATE_SHIFT 28
127#define SUPER_STATE_MASK (0xF << SUPER_STATE_SHIFT)
128#define SUPER_STATE_STANDBY (0x0 << SUPER_STATE_SHIFT)
129#define SUPER_STATE_IDLE (0x1 << SUPER_STATE_SHIFT)
130#define SUPER_STATE_RUN (0x2 << SUPER_STATE_SHIFT)
131#define SUPER_STATE_IRQ (0x3 << SUPER_STATE_SHIFT)
132#define SUPER_STATE_FIQ (0x4 << SUPER_STATE_SHIFT)
133#define SUPER_SOURCE_MASK 0xF
134#define SUPER_FIQ_SOURCE_SHIFT 12
135#define SUPER_IRQ_SOURCE_SHIFT 8
136#define SUPER_RUN_SOURCE_SHIFT 4
137#define SUPER_IDLE_SOURCE_SHIFT 0
138
139#define SUPER_CLK_DIVIDER 0x04
140
141#define BUS_CLK_DISABLE (1<<3)
142#define BUS_CLK_DIV_MASK 0x3
143
144#define PMC_CTRL 0x0
145 #define PMC_CTRL_BLINK_ENB (1 << 7)
146
147#define PMC_DPD_PADS_ORIDE 0x1c
148 #define PMC_DPD_PADS_ORIDE_BLINK_ENB (1 << 20)
149
150#define PMC_BLINK_TIMER_DATA_ON_SHIFT 0
151#define PMC_BLINK_TIMER_DATA_ON_MASK 0x7fff
152#define PMC_BLINK_TIMER_ENB (1 << 15)
153#define PMC_BLINK_TIMER_DATA_OFF_SHIFT 16
154#define PMC_BLINK_TIMER_DATA_OFF_MASK 0xffff
155
156/* Tegra CPU clock and reset control regs */
157#define TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX 0x4c
158#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET 0x340
159#define TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR 0x344
160
161#define CPU_CLOCK(cpu) (0x1 << (8 + cpu))
162#define CPU_RESET(cpu) (0x1111ul << (cpu))
163
164static void __iomem *reg_clk_base = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
165static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
166
167/*
168 * Some clocks share a register with other clocks. Any clock op that
169 * non-atomically modifies a register used by another clock must lock
170 * clock_register_lock first.
171 */
172static DEFINE_SPINLOCK(clock_register_lock);
173
174/*
175 * Some peripheral clocks share an enable bit, so refcount the enable bits
176 * in registers CLK_ENABLE_L, CLK_ENABLE_H, and CLK_ENABLE_U
177 */
178static int tegra_periph_clk_enable_refcount[3 * 32];
179
180#define clk_writel(value, reg) \
181 __raw_writel(value, reg_clk_base + (reg))
182#define clk_readl(reg) \
183 __raw_readl(reg_clk_base + (reg))
184#define pmc_writel(value, reg) \
185 __raw_writel(value, reg_pmc_base + (reg))
186#define pmc_readl(reg) \
187 __raw_readl(reg_pmc_base + (reg))
188
189static unsigned long clk_measure_input_freq(void)
190{
191 u32 clock_autodetect;
192 clk_writel(OSC_FREQ_DET_TRIG | 1, OSC_FREQ_DET);
193 do {} while (clk_readl(OSC_FREQ_DET_STATUS) & OSC_FREQ_DET_BUSY);
194 clock_autodetect = clk_readl(OSC_FREQ_DET_STATUS);
195 if (clock_autodetect >= 732 - 3 && clock_autodetect <= 732 + 3) {
196 return 12000000;
197 } else if (clock_autodetect >= 794 - 3 && clock_autodetect <= 794 + 3) {
198 return 13000000;
199 } else if (clock_autodetect >= 1172 - 3 && clock_autodetect <= 1172 + 3) {
200 return 19200000;
201 } else if (clock_autodetect >= 1587 - 3 && clock_autodetect <= 1587 + 3) {
202 return 26000000;
203 } else {
204 pr_err("%s: Unexpected clock autodetect value %d",
205 __func__, clock_autodetect);
206 BUG();
207 return 0;
208 }
209}
210
211static int clk_div71_get_divider(unsigned long parent_rate, unsigned long rate)
212{
213 s64 divider_u71 = parent_rate * 2;
214 divider_u71 += rate - 1;
215 do_div(divider_u71, rate);
216
217 if (divider_u71 - 2 < 0)
218 return 0;
219
220 if (divider_u71 - 2 > 255)
221 return -EINVAL;
222
223 return divider_u71 - 2;
224}
225
226static int clk_div16_get_divider(unsigned long parent_rate, unsigned long rate)
227{
228 s64 divider_u16;
229
230 divider_u16 = parent_rate;
231 divider_u16 += rate - 1;
232 do_div(divider_u16, rate);
233
234 if (divider_u16 - 1 < 0)
235 return 0;
236
237 if (divider_u16 - 1 > 0xFFFF)
238 return -EINVAL;
239
240 return divider_u16 - 1;
241}
242
243static unsigned long tegra_clk_fixed_recalc_rate(struct clk_hw *hw,
244 unsigned long parent_rate)
245{
246 return to_clk_tegra(hw)->fixed_rate;
247}
248
249struct clk_ops tegra_clk_32k_ops = {
250 .recalc_rate = tegra_clk_fixed_recalc_rate,
251};
252
253/* clk_m functions */
254static unsigned long tegra20_clk_m_recalc_rate(struct clk_hw *hw,
255 unsigned long prate)
256{
257 if (!to_clk_tegra(hw)->fixed_rate)
258 to_clk_tegra(hw)->fixed_rate = clk_measure_input_freq();
259 return to_clk_tegra(hw)->fixed_rate;
260}
261
262static void tegra20_clk_m_init(struct clk_hw *hw)
263{
264 struct clk_tegra *c = to_clk_tegra(hw);
265 u32 osc_ctrl = clk_readl(OSC_CTRL);
266 u32 auto_clock_control = osc_ctrl & ~OSC_CTRL_OSC_FREQ_MASK;
267
268 switch (c->fixed_rate) {
269 case 12000000:
270 auto_clock_control |= OSC_CTRL_OSC_FREQ_12MHZ;
271 break;
272 case 13000000:
273 auto_clock_control |= OSC_CTRL_OSC_FREQ_13MHZ;
274 break;
275 case 19200000:
276 auto_clock_control |= OSC_CTRL_OSC_FREQ_19_2MHZ;
277 break;
278 case 26000000:
279 auto_clock_control |= OSC_CTRL_OSC_FREQ_26MHZ;
280 break;
281 default:
282 BUG();
283 }
284 clk_writel(auto_clock_control, OSC_CTRL);
285}
286
287struct clk_ops tegra_clk_m_ops = {
288 .init = tegra20_clk_m_init,
289 .recalc_rate = tegra20_clk_m_recalc_rate,
290};
291
292/* super clock functions */
293/* "super clocks" on tegra have two-stage muxes and a clock skipping
294 * super divider. We will ignore the clock skipping divider, since we
295 * can't lower the voltage when using the clock skip, but we can if we
296 * lower the PLL frequency.
297 */
298static int tegra20_super_clk_is_enabled(struct clk_hw *hw)
299{
300 struct clk_tegra *c = to_clk_tegra(hw);
301 u32 val;
302
303 val = clk_readl(c->reg + SUPER_CLK_MUX);
304 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
305 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
306 c->state = ON;
307 return c->state;
308}
309
310static int tegra20_super_clk_enable(struct clk_hw *hw)
311{
312 struct clk_tegra *c = to_clk_tegra(hw);
313 clk_writel(0, c->reg + SUPER_CLK_DIVIDER);
314 return 0;
315}
316
317static void tegra20_super_clk_disable(struct clk_hw *hw)
318{
319 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
320
321 /* oops - don't disable the CPU clock! */
322 BUG();
323}
324
325static u8 tegra20_super_clk_get_parent(struct clk_hw *hw)
326{
327 struct clk_tegra *c = to_clk_tegra(hw);
328 int val = clk_readl(c->reg + SUPER_CLK_MUX);
329 int source;
330 int shift;
331
332 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
333 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
334 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
335 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
336 source = (val >> shift) & SUPER_SOURCE_MASK;
337 return source;
338}
339
340static int tegra20_super_clk_set_parent(struct clk_hw *hw, u8 index)
341{
342 struct clk_tegra *c = to_clk_tegra(hw);
343 u32 val = clk_readl(c->reg + SUPER_CLK_MUX);
344 int shift;
345
346 BUG_ON(((val & SUPER_STATE_MASK) != SUPER_STATE_RUN) &&
347 ((val & SUPER_STATE_MASK) != SUPER_STATE_IDLE));
348 shift = ((val & SUPER_STATE_MASK) == SUPER_STATE_IDLE) ?
349 SUPER_IDLE_SOURCE_SHIFT : SUPER_RUN_SOURCE_SHIFT;
350 val &= ~(SUPER_SOURCE_MASK << shift);
351 val |= index << shift;
352
353 clk_writel(val, c->reg);
354
355 return 0;
356}
357
358/* FIX ME: Need to switch parents to change the source PLL rate */
359static unsigned long tegra20_super_clk_recalc_rate(struct clk_hw *hw,
360 unsigned long prate)
361{
362 return prate;
363}
364
365static long tegra20_super_clk_round_rate(struct clk_hw *hw, unsigned long rate,
366 unsigned long *prate)
367{
368 return *prate;
369}
370
371static int tegra20_super_clk_set_rate(struct clk_hw *hw, unsigned long rate,
372 unsigned long parent_rate)
373{
374 return 0;
375}
376
377struct clk_ops tegra_super_ops = {
378 .is_enabled = tegra20_super_clk_is_enabled,
379 .enable = tegra20_super_clk_enable,
380 .disable = tegra20_super_clk_disable,
381 .set_parent = tegra20_super_clk_set_parent,
382 .get_parent = tegra20_super_clk_get_parent,
383 .set_rate = tegra20_super_clk_set_rate,
384 .round_rate = tegra20_super_clk_round_rate,
385 .recalc_rate = tegra20_super_clk_recalc_rate,
386};
387
388static unsigned long tegra20_twd_clk_recalc_rate(struct clk_hw *hw,
389 unsigned long parent_rate)
390{
391 struct clk_tegra *c = to_clk_tegra(hw);
392 u64 rate = parent_rate;
393
394 if (c->mul != 0 && c->div != 0) {
395 rate *= c->mul;
396 rate += c->div - 1; /* round up */
397 do_div(rate, c->div);
398 }
399
400 return rate;
401}
402
403struct clk_ops tegra_twd_ops = {
404 .recalc_rate = tegra20_twd_clk_recalc_rate,
405};
406
407static u8 tegra20_cop_clk_get_parent(struct clk_hw *hw)
408{
409 return 0;
410}
411
412struct clk_ops tegra_cop_ops = {
413 .get_parent = tegra20_cop_clk_get_parent,
414};
415
416/* virtual cop clock functions. Used to acquire the fake 'cop' clock to
417 * reset the COP block (i.e. AVP) */
418void tegra2_cop_clk_reset(struct clk_hw *hw, bool assert)
419{
420 unsigned long reg = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
421
422 pr_debug("%s %s\n", __func__, assert ? "assert" : "deassert");
423 clk_writel(1 << 1, reg);
424}
425
426/* bus clock functions */
427static int tegra20_bus_clk_is_enabled(struct clk_hw *hw)
428{
429 struct clk_tegra *c = to_clk_tegra(hw);
430 u32 val = clk_readl(c->reg);
431
432 c->state = ((val >> c->reg_shift) & BUS_CLK_DISABLE) ? OFF : ON;
433 return c->state;
434}
435
436static int tegra20_bus_clk_enable(struct clk_hw *hw)
437{
438 struct clk_tegra *c = to_clk_tegra(hw);
439 unsigned long flags;
440 u32 val;
441
442 spin_lock_irqsave(&clock_register_lock, flags);
443
444 val = clk_readl(c->reg);
445 val &= ~(BUS_CLK_DISABLE << c->reg_shift);
446 clk_writel(val, c->reg);
447
448 spin_unlock_irqrestore(&clock_register_lock, flags);
449
450 return 0;
451}
452
453static void tegra20_bus_clk_disable(struct clk_hw *hw)
454{
455 struct clk_tegra *c = to_clk_tegra(hw);
456 unsigned long flags;
457 u32 val;
458
459 spin_lock_irqsave(&clock_register_lock, flags);
460
461 val = clk_readl(c->reg);
462 val |= BUS_CLK_DISABLE << c->reg_shift;
463 clk_writel(val, c->reg);
464
465 spin_unlock_irqrestore(&clock_register_lock, flags);
466}
467
468static unsigned long tegra20_bus_clk_recalc_rate(struct clk_hw *hw,
469 unsigned long prate)
470{
471 struct clk_tegra *c = to_clk_tegra(hw);
472 u32 val = clk_readl(c->reg);
473 u64 rate = prate;
474
475 c->div = ((val >> c->reg_shift) & BUS_CLK_DIV_MASK) + 1;
476 c->mul = 1;
477
478 if (c->mul != 0 && c->div != 0) {
479 rate *= c->mul;
480 rate += c->div - 1; /* round up */
481 do_div(rate, c->div);
482 }
483 return rate;
484}
485
486static int tegra20_bus_clk_set_rate(struct clk_hw *hw, unsigned long rate,
487 unsigned long parent_rate)
488{
489 struct clk_tegra *c = to_clk_tegra(hw);
490 int ret = -EINVAL;
491 unsigned long flags;
492 u32 val;
493 int i;
494
495 spin_lock_irqsave(&clock_register_lock, flags);
496
497 val = clk_readl(c->reg);
498 for (i = 1; i <= 4; i++) {
499 if (rate == parent_rate / i) {
500 val &= ~(BUS_CLK_DIV_MASK << c->reg_shift);
501 val |= (i - 1) << c->reg_shift;
502 clk_writel(val, c->reg);
503 c->div = i;
504 c->mul = 1;
505 ret = 0;
506 break;
507 }
508 }
509
510 spin_unlock_irqrestore(&clock_register_lock, flags);
511
512 return ret;
513}
514
515static long tegra20_bus_clk_round_rate(struct clk_hw *hw, unsigned long rate,
516 unsigned long *prate)
517{
518 unsigned long parent_rate = *prate;
519 s64 divider;
520
521 if (rate >= parent_rate)
522 return rate;
523
524 divider = parent_rate;
525 divider += rate - 1;
526 do_div(divider, rate);
527
528 if (divider < 0)
529 return divider;
530
531 if (divider > 4)
532 divider = 4;
533 do_div(parent_rate, divider);
534
535 return parent_rate;
536}
537
538struct clk_ops tegra_bus_ops = {
539 .is_enabled = tegra20_bus_clk_is_enabled,
540 .enable = tegra20_bus_clk_enable,
541 .disable = tegra20_bus_clk_disable,
542 .set_rate = tegra20_bus_clk_set_rate,
543 .round_rate = tegra20_bus_clk_round_rate,
544 .recalc_rate = tegra20_bus_clk_recalc_rate,
545};
546
547/* Blink output functions */
548static int tegra20_blink_clk_is_enabled(struct clk_hw *hw)
549{
550 struct clk_tegra *c = to_clk_tegra(hw);
551 u32 val;
552
553 val = pmc_readl(PMC_CTRL);
554 c->state = (val & PMC_CTRL_BLINK_ENB) ? ON : OFF;
555 return c->state;
556}
557
558static unsigned long tegra20_blink_clk_recalc_rate(struct clk_hw *hw,
559 unsigned long prate)
560{
561 struct clk_tegra *c = to_clk_tegra(hw);
562 u64 rate = prate;
563 u32 val;
564
565 c->mul = 1;
566 val = pmc_readl(c->reg);
567
568 if (val & PMC_BLINK_TIMER_ENB) {
569 unsigned int on_off;
570
571 on_off = (val >> PMC_BLINK_TIMER_DATA_ON_SHIFT) &
572 PMC_BLINK_TIMER_DATA_ON_MASK;
573 val >>= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
574 val &= PMC_BLINK_TIMER_DATA_OFF_MASK;
575 on_off += val;
576 /* each tick in the blink timer is 4 32KHz clocks */
577 c->div = on_off * 4;
578 } else {
579 c->div = 1;
580 }
581
582 if (c->mul != 0 && c->div != 0) {
583 rate *= c->mul;
584 rate += c->div - 1; /* round up */
585 do_div(rate, c->div);
586 }
587 return rate;
588}
589
590static int tegra20_blink_clk_enable(struct clk_hw *hw)
591{
592 u32 val;
593
594 val = pmc_readl(PMC_DPD_PADS_ORIDE);
595 pmc_writel(val | PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
596
597 val = pmc_readl(PMC_CTRL);
598 pmc_writel(val | PMC_CTRL_BLINK_ENB, PMC_CTRL);
599
600 return 0;
601}
602
603static void tegra20_blink_clk_disable(struct clk_hw *hw)
604{
605 u32 val;
606
607 val = pmc_readl(PMC_CTRL);
608 pmc_writel(val & ~PMC_CTRL_BLINK_ENB, PMC_CTRL);
609
610 val = pmc_readl(PMC_DPD_PADS_ORIDE);
611 pmc_writel(val & ~PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
612}
613
614static int tegra20_blink_clk_set_rate(struct clk_hw *hw, unsigned long rate,
615 unsigned long parent_rate)
616{
617 struct clk_tegra *c = to_clk_tegra(hw);
618
619 if (rate >= parent_rate) {
620 c->div = 1;
621 pmc_writel(0, c->reg);
622 } else {
623 unsigned int on_off;
624 u32 val;
625
626 on_off = DIV_ROUND_UP(parent_rate / 8, rate);
627 c->div = on_off * 8;
628
629 val = (on_off & PMC_BLINK_TIMER_DATA_ON_MASK) <<
630 PMC_BLINK_TIMER_DATA_ON_SHIFT;
631 on_off &= PMC_BLINK_TIMER_DATA_OFF_MASK;
632 on_off <<= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
633 val |= on_off;
634 val |= PMC_BLINK_TIMER_ENB;
635 pmc_writel(val, c->reg);
636 }
637
638 return 0;
639}
640
641static long tegra20_blink_clk_round_rate(struct clk_hw *hw, unsigned long rate,
642 unsigned long *prate)
643{
644 int div;
645 int mul;
646 long round_rate = *prate;
647
648 mul = 1;
649
650 if (rate >= *prate) {
651 div = 1;
652 } else {
653 div = DIV_ROUND_UP(*prate / 8, rate);
654 div *= 8;
655 }
656
657 round_rate *= mul;
658 round_rate += div - 1;
659 do_div(round_rate, div);
660
661 return round_rate;
662}
663
664struct clk_ops tegra_blink_clk_ops = {
665 .is_enabled = tegra20_blink_clk_is_enabled,
666 .enable = tegra20_blink_clk_enable,
667 .disable = tegra20_blink_clk_disable,
668 .set_rate = tegra20_blink_clk_set_rate,
669 .round_rate = tegra20_blink_clk_round_rate,
670 .recalc_rate = tegra20_blink_clk_recalc_rate,
671};
672
673/* PLL Functions */
674static int tegra20_pll_clk_wait_for_lock(struct clk_tegra *c)
675{
676 udelay(c->u.pll.lock_delay);
677 return 0;
678}
679
680static int tegra20_pll_clk_is_enabled(struct clk_hw *hw)
681{
682 struct clk_tegra *c = to_clk_tegra(hw);
683 u32 val = clk_readl(c->reg + PLL_BASE);
684
685 c->state = (val & PLL_BASE_ENABLE) ? ON : OFF;
686 return c->state;
687}
688
689static unsigned long tegra20_pll_clk_recalc_rate(struct clk_hw *hw,
690 unsigned long prate)
691{
692 struct clk_tegra *c = to_clk_tegra(hw);
693 u32 val = clk_readl(c->reg + PLL_BASE);
694 u64 rate = prate;
695
696 if (c->flags & PLL_FIXED && !(val & PLL_BASE_OVERRIDE)) {
697 const struct clk_pll_freq_table *sel;
698 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
699 if (sel->input_rate == prate &&
700 sel->output_rate == c->u.pll.fixed_rate) {
701 c->mul = sel->n;
702 c->div = sel->m * sel->p;
703 break;
704 }
705 }
706 pr_err("Clock %s has unknown fixed frequency\n",
707 __clk_get_name(hw->clk));
708 BUG();
709 } else if (val & PLL_BASE_BYPASS) {
710 c->mul = 1;
711 c->div = 1;
712 } else {
713 c->mul = (val & PLL_BASE_DIVN_MASK) >> PLL_BASE_DIVN_SHIFT;
714 c->div = (val & PLL_BASE_DIVM_MASK) >> PLL_BASE_DIVM_SHIFT;
715 if (c->flags & PLLU)
716 c->div *= (val & PLLU_BASE_POST_DIV) ? 1 : 2;
717 else
718 c->div *= (val & PLL_BASE_DIVP_MASK) ? 2 : 1;
719 }
720
721 if (c->mul != 0 && c->div != 0) {
722 rate *= c->mul;
723 rate += c->div - 1; /* round up */
724 do_div(rate, c->div);
725 }
726 return rate;
727}
728
729static int tegra20_pll_clk_enable(struct clk_hw *hw)
730{
731 struct clk_tegra *c = to_clk_tegra(hw);
732 u32 val;
733 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
734
735 val = clk_readl(c->reg + PLL_BASE);
736 val &= ~PLL_BASE_BYPASS;
737 val |= PLL_BASE_ENABLE;
738 clk_writel(val, c->reg + PLL_BASE);
739
740 tegra20_pll_clk_wait_for_lock(c);
741
742 return 0;
743}
744
745static void tegra20_pll_clk_disable(struct clk_hw *hw)
746{
747 struct clk_tegra *c = to_clk_tegra(hw);
748 u32 val;
749 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
750
751 val = clk_readl(c->reg);
752 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
753 clk_writel(val, c->reg);
754}
755
756static int tegra20_pll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
757 unsigned long parent_rate)
758{
759 struct clk_tegra *c = to_clk_tegra(hw);
760 unsigned long input_rate = parent_rate;
761 const struct clk_pll_freq_table *sel;
762 u32 val;
763
764 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
765
766 if (c->flags & PLL_FIXED) {
767 int ret = 0;
768 if (rate != c->u.pll.fixed_rate) {
769 pr_err("%s: Can not change %s fixed rate %lu to %lu\n",
770 __func__, __clk_get_name(hw->clk),
771 c->u.pll.fixed_rate, rate);
772 ret = -EINVAL;
773 }
774 return ret;
775 }
776
777 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
778 if (sel->input_rate == input_rate && sel->output_rate == rate) {
779 c->mul = sel->n;
780 c->div = sel->m * sel->p;
781
782 val = clk_readl(c->reg + PLL_BASE);
783 if (c->flags & PLL_FIXED)
784 val |= PLL_BASE_OVERRIDE;
785 val &= ~(PLL_BASE_DIVP_MASK | PLL_BASE_DIVN_MASK |
786 PLL_BASE_DIVM_MASK);
787 val |= (sel->m << PLL_BASE_DIVM_SHIFT) |
788 (sel->n << PLL_BASE_DIVN_SHIFT);
789 BUG_ON(sel->p < 1 || sel->p > 2);
790 if (c->flags & PLLU) {
791 if (sel->p == 1)
792 val |= PLLU_BASE_POST_DIV;
793 } else {
794 if (sel->p == 2)
795 val |= 1 << PLL_BASE_DIVP_SHIFT;
796 }
797 clk_writel(val, c->reg + PLL_BASE);
798
799 if (c->flags & PLL_HAS_CPCON) {
800 val = clk_readl(c->reg + PLL_MISC(c));
801 val &= ~PLL_MISC_CPCON_MASK;
802 val |= sel->cpcon << PLL_MISC_CPCON_SHIFT;
803 clk_writel(val, c->reg + PLL_MISC(c));
804 }
805
806 if (c->state == ON)
807 tegra20_pll_clk_enable(hw);
808 return 0;
809 }
810 }
811 return -EINVAL;
812}
813
814static long tegra20_pll_clk_round_rate(struct clk_hw *hw, unsigned long rate,
815 unsigned long *prate)
816{
817 struct clk_tegra *c = to_clk_tegra(hw);
818 const struct clk_pll_freq_table *sel;
819 unsigned long input_rate = *prate;
820 u64 output_rate = *prate;
821 int mul;
822 int div;
823
824 if (c->flags & PLL_FIXED)
825 return c->u.pll.fixed_rate;
826
827 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++)
828 if (sel->input_rate == input_rate && sel->output_rate == rate) {
829 mul = sel->n;
830 div = sel->m * sel->p;
831 break;
832 }
833
834 if (sel->input_rate == 0)
835 return -EINVAL;
836
837 output_rate *= mul;
838 output_rate += div - 1; /* round up */
839 do_div(output_rate, div);
840
841 return output_rate;
842}
843
844struct clk_ops tegra_pll_ops = {
845 .is_enabled = tegra20_pll_clk_is_enabled,
846 .enable = tegra20_pll_clk_enable,
847 .disable = tegra20_pll_clk_disable,
848 .set_rate = tegra20_pll_clk_set_rate,
849 .recalc_rate = tegra20_pll_clk_recalc_rate,
850 .round_rate = tegra20_pll_clk_round_rate,
851};
852
853static void tegra20_pllx_clk_init(struct clk_hw *hw)
854{
855 struct clk_tegra *c = to_clk_tegra(hw);
856
857 if (tegra_sku_id == 7)
858 c->max_rate = 750000000;
859}
860
861struct clk_ops tegra_pllx_ops = {
862 .init = tegra20_pllx_clk_init,
863 .is_enabled = tegra20_pll_clk_is_enabled,
864 .enable = tegra20_pll_clk_enable,
865 .disable = tegra20_pll_clk_disable,
866 .set_rate = tegra20_pll_clk_set_rate,
867 .recalc_rate = tegra20_pll_clk_recalc_rate,
868 .round_rate = tegra20_pll_clk_round_rate,
869};
870
871static int tegra20_plle_clk_enable(struct clk_hw *hw)
872{
873 struct clk_tegra *c = to_clk_tegra(hw);
874 u32 val;
875
876 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
877
878 mdelay(1);
879
880 val = clk_readl(c->reg + PLL_BASE);
881 if (!(val & PLLE_MISC_READY))
882 return -EBUSY;
883
884 val = clk_readl(c->reg + PLL_BASE);
885 val |= PLL_BASE_ENABLE | PLL_BASE_BYPASS;
886 clk_writel(val, c->reg + PLL_BASE);
887
888 return 0;
889}
890
891struct clk_ops tegra_plle_ops = {
892 .is_enabled = tegra20_pll_clk_is_enabled,
893 .enable = tegra20_plle_clk_enable,
894 .set_rate = tegra20_pll_clk_set_rate,
895 .recalc_rate = tegra20_pll_clk_recalc_rate,
896 .round_rate = tegra20_pll_clk_round_rate,
897};
898
899/* Clock divider ops */
900static int tegra20_pll_div_clk_is_enabled(struct clk_hw *hw)
901{
902 struct clk_tegra *c = to_clk_tegra(hw);
903 u32 val = clk_readl(c->reg);
904
905 val >>= c->reg_shift;
906 c->state = (val & PLL_OUT_CLKEN) ? ON : OFF;
907 if (!(val & PLL_OUT_RESET_DISABLE))
908 c->state = OFF;
909 return c->state;
910}
911
912static unsigned long tegra20_pll_div_clk_recalc_rate(struct clk_hw *hw,
913 unsigned long prate)
914{
915 struct clk_tegra *c = to_clk_tegra(hw);
916 u64 rate = prate;
917 u32 val = clk_readl(c->reg);
918 u32 divu71;
919
920 val >>= c->reg_shift;
921
922 if (c->flags & DIV_U71) {
923 divu71 = (val & PLL_OUT_RATIO_MASK) >> PLL_OUT_RATIO_SHIFT;
924 c->div = (divu71 + 2);
925 c->mul = 2;
926 } else if (c->flags & DIV_2) {
927 c->div = 2;
928 c->mul = 1;
929 } else {
930 c->div = 1;
931 c->mul = 1;
932 }
933
934 rate *= c->mul;
935 rate += c->div - 1; /* round up */
936 do_div(rate, c->div);
937
938 return rate;
939}
940
941static int tegra20_pll_div_clk_enable(struct clk_hw *hw)
942{
943 struct clk_tegra *c = to_clk_tegra(hw);
944 unsigned long flags;
945 u32 new_val;
946 u32 val;
947
948 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
949
950 if (c->flags & DIV_U71) {
951 spin_lock_irqsave(&clock_register_lock, flags);
952 val = clk_readl(c->reg);
953 new_val = val >> c->reg_shift;
954 new_val &= 0xFFFF;
955
956 new_val |= PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE;
957
958 val &= ~(0xFFFF << c->reg_shift);
959 val |= new_val << c->reg_shift;
960 clk_writel(val, c->reg);
961 spin_unlock_irqrestore(&clock_register_lock, flags);
962 return 0;
963 } else if (c->flags & DIV_2) {
964 BUG_ON(!(c->flags & PLLD));
965 spin_lock_irqsave(&clock_register_lock, flags);
966 val = clk_readl(c->reg);
967 val &= ~PLLD_MISC_DIV_RST;
968 clk_writel(val, c->reg);
969 spin_unlock_irqrestore(&clock_register_lock, flags);
970 return 0;
971 }
972 return -EINVAL;
973}
974
975static void tegra20_pll_div_clk_disable(struct clk_hw *hw)
976{
977 struct clk_tegra *c = to_clk_tegra(hw);
978 unsigned long flags;
979 u32 new_val;
980 u32 val;
981
982 pr_debug("%s: %s\n", __func__, __clk_get_name(hw->clk));
983
984 if (c->flags & DIV_U71) {
985 spin_lock_irqsave(&clock_register_lock, flags);
986 val = clk_readl(c->reg);
987 new_val = val >> c->reg_shift;
988 new_val &= 0xFFFF;
989
990 new_val &= ~(PLL_OUT_CLKEN | PLL_OUT_RESET_DISABLE);
991
992 val &= ~(0xFFFF << c->reg_shift);
993 val |= new_val << c->reg_shift;
994 clk_writel(val, c->reg);
995 spin_unlock_irqrestore(&clock_register_lock, flags);
996 } else if (c->flags & DIV_2) {
997 BUG_ON(!(c->flags & PLLD));
998 spin_lock_irqsave(&clock_register_lock, flags);
999 val = clk_readl(c->reg);
1000 val |= PLLD_MISC_DIV_RST;
1001 clk_writel(val, c->reg);
1002 spin_unlock_irqrestore(&clock_register_lock, flags);
1003 }
1004}
1005
1006static int tegra20_pll_div_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1007 unsigned long parent_rate)
1008{
1009 struct clk_tegra *c = to_clk_tegra(hw);
1010 unsigned long flags;
1011 int divider_u71;
1012 u32 new_val;
1013 u32 val;
1014
1015 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1016
1017 if (c->flags & DIV_U71) {
1018 divider_u71 = clk_div71_get_divider(parent_rate, rate);
1019 if (divider_u71 >= 0) {
1020 spin_lock_irqsave(&clock_register_lock, flags);
1021 val = clk_readl(c->reg);
1022 new_val = val >> c->reg_shift;
1023 new_val &= 0xFFFF;
1024 if (c->flags & DIV_U71_FIXED)
1025 new_val |= PLL_OUT_OVERRIDE;
1026 new_val &= ~PLL_OUT_RATIO_MASK;
1027 new_val |= divider_u71 << PLL_OUT_RATIO_SHIFT;
1028
1029 val &= ~(0xFFFF << c->reg_shift);
1030 val |= new_val << c->reg_shift;
1031 clk_writel(val, c->reg);
1032 c->div = divider_u71 + 2;
1033 c->mul = 2;
1034 spin_unlock_irqrestore(&clock_register_lock, flags);
1035 return 0;
1036 }
1037 } else if (c->flags & DIV_2) {
1038 if (parent_rate == rate * 2)
1039 return 0;
1040 }
1041 return -EINVAL;
1042}
1043
1044static long tegra20_pll_div_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1045 unsigned long *prate)
1046{
1047 struct clk_tegra *c = to_clk_tegra(hw);
1048 unsigned long parent_rate = *prate;
1049 int divider;
1050
1051 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1052
1053 if (c->flags & DIV_U71) {
1054 divider = clk_div71_get_divider(parent_rate, rate);
1055 if (divider < 0)
1056 return divider;
1057 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1058 } else if (c->flags & DIV_2) {
1059 return DIV_ROUND_UP(parent_rate, 2);
1060 }
1061 return -EINVAL;
1062}
1063
1064struct clk_ops tegra_pll_div_ops = {
1065 .is_enabled = tegra20_pll_div_clk_is_enabled,
1066 .enable = tegra20_pll_div_clk_enable,
1067 .disable = tegra20_pll_div_clk_disable,
1068 .set_rate = tegra20_pll_div_clk_set_rate,
1069 .round_rate = tegra20_pll_div_clk_round_rate,
1070 .recalc_rate = tegra20_pll_div_clk_recalc_rate,
1071};
1072
1073/* Periph clk ops */
1074
1075static int tegra20_periph_clk_is_enabled(struct clk_hw *hw)
1076{
1077 struct clk_tegra *c = to_clk_tegra(hw);
1078
1079 c->state = ON;
1080
1081 if (!c->u.periph.clk_num)
1082 goto out;
1083
1084 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1085 PERIPH_CLK_TO_ENB_BIT(c)))
1086 c->state = OFF;
1087
1088 if (!(c->flags & PERIPH_NO_RESET))
1089 if (clk_readl(RST_DEVICES + PERIPH_CLK_TO_ENB_REG(c)) &
1090 PERIPH_CLK_TO_ENB_BIT(c))
1091 c->state = OFF;
1092
1093out:
1094 return c->state;
1095}
1096
1097static int tegra20_periph_clk_enable(struct clk_hw *hw)
1098{
1099 struct clk_tegra *c = to_clk_tegra(hw);
1100 unsigned long flags;
1101 u32 val;
1102
1103 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
1104
1105 if (!c->u.periph.clk_num)
1106 return 0;
1107
1108 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
1109 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 1)
1110 return 0;
1111
1112 spin_lock_irqsave(&clock_register_lock, flags);
1113
1114 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1115 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
1116 if (!(c->flags & PERIPH_NO_RESET) && !(c->flags & PERIPH_MANUAL_RESET))
1117 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1118 RST_DEVICES_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1119 if (c->flags & PERIPH_EMC_ENB) {
1120 /* The EMC peripheral clock has 2 extra enable bits */
1121 /* FIXME: Do they need to be disabled? */
1122 val = clk_readl(c->reg);
1123 val |= 0x3 << 24;
1124 clk_writel(val, c->reg);
1125 }
1126
1127 spin_unlock_irqrestore(&clock_register_lock, flags);
1128
1129 return 0;
1130}
1131
1132static void tegra20_periph_clk_disable(struct clk_hw *hw)
1133{
1134 struct clk_tegra *c = to_clk_tegra(hw);
1135 unsigned long flags;
1136
1137 pr_debug("%s on clock %s\n", __func__, __clk_get_name(hw->clk));
1138
1139 if (!c->u.periph.clk_num)
1140 return;
1141
1142 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]--;
1143
1144 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] > 0)
1145 return;
1146
1147 spin_lock_irqsave(&clock_register_lock, flags);
1148
1149 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1150 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1151
1152 spin_unlock_irqrestore(&clock_register_lock, flags);
1153}
1154
1155void tegra2_periph_clk_reset(struct clk_hw *hw, bool assert)
1156{
1157 struct clk_tegra *c = to_clk_tegra(hw);
1158 unsigned long base = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
1159
1160 pr_debug("%s %s on clock %s\n", __func__,
1161 assert ? "assert" : "deassert", __clk_get_name(hw->clk));
1162
1163 BUG_ON(!c->u.periph.clk_num);
1164
1165 if (!(c->flags & PERIPH_NO_RESET))
1166 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1167 base + PERIPH_CLK_TO_ENB_SET_REG(c));
1168}
1169
1170static int tegra20_periph_clk_set_parent(struct clk_hw *hw, u8 index)
1171{
1172 struct clk_tegra *c = to_clk_tegra(hw);
1173 u32 val;
1174 u32 mask;
1175 u32 shift;
1176
1177 pr_debug("%s: %s %d\n", __func__, __clk_get_name(hw->clk), index);
1178
1179 if (c->flags & MUX_PWM) {
1180 shift = PERIPH_CLK_SOURCE_PWM_SHIFT;
1181 mask = PERIPH_CLK_SOURCE_PWM_MASK;
1182 } else {
1183 shift = PERIPH_CLK_SOURCE_SHIFT;
1184 mask = PERIPH_CLK_SOURCE_MASK;
1185 }
1186
1187 val = clk_readl(c->reg);
1188 val &= ~mask;
1189 val |= (index) << shift;
1190
1191 clk_writel(val, c->reg);
1192
1193 return 0;
1194}
1195
1196static u8 tegra20_periph_clk_get_parent(struct clk_hw *hw)
1197{
1198 struct clk_tegra *c = to_clk_tegra(hw);
1199 u32 val = clk_readl(c->reg);
1200 u32 mask;
1201 u32 shift;
1202
1203 if (c->flags & MUX_PWM) {
1204 shift = PERIPH_CLK_SOURCE_PWM_SHIFT;
1205 mask = PERIPH_CLK_SOURCE_PWM_MASK;
1206 } else {
1207 shift = PERIPH_CLK_SOURCE_SHIFT;
1208 mask = PERIPH_CLK_SOURCE_MASK;
1209 }
1210
1211 if (c->flags & MUX)
1212 return (val & mask) >> shift;
1213 else
1214 return 0;
1215}
1216
1217static unsigned long tegra20_periph_clk_recalc_rate(struct clk_hw *hw,
1218 unsigned long prate)
1219{
1220 struct clk_tegra *c = to_clk_tegra(hw);
1221 unsigned long rate = prate;
1222 u32 val = clk_readl(c->reg);
1223
1224 if (c->flags & DIV_U71) {
1225 u32 divu71 = val & PERIPH_CLK_SOURCE_DIVU71_MASK;
1226 c->div = divu71 + 2;
1227 c->mul = 2;
1228 } else if (c->flags & DIV_U16) {
1229 u32 divu16 = val & PERIPH_CLK_SOURCE_DIVU16_MASK;
1230 c->div = divu16 + 1;
1231 c->mul = 1;
1232 } else {
1233 c->div = 1;
1234 c->mul = 1;
1235 return rate;
1236 }
1237
1238 if (c->mul != 0 && c->div != 0) {
1239 rate *= c->mul;
1240 rate += c->div - 1; /* round up */
1241 do_div(rate, c->div);
1242 }
1243
1244 return rate;
1245}
1246
1247static int tegra20_periph_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1248 unsigned long parent_rate)
1249{
1250 struct clk_tegra *c = to_clk_tegra(hw);
1251 u32 val;
1252 int divider;
1253
1254 val = clk_readl(c->reg);
1255
1256 if (c->flags & DIV_U71) {
1257 divider = clk_div71_get_divider(parent_rate, rate);
1258
1259 if (divider >= 0) {
1260 val = clk_readl(c->reg);
1261 val &= ~PERIPH_CLK_SOURCE_DIVU71_MASK;
1262 val |= divider;
1263 clk_writel(val, c->reg);
1264 c->div = divider + 2;
1265 c->mul = 2;
1266 return 0;
1267 }
1268 } else if (c->flags & DIV_U16) {
1269 divider = clk_div16_get_divider(parent_rate, rate);
1270 if (divider >= 0) {
1271 val = clk_readl(c->reg);
1272 val &= ~PERIPH_CLK_SOURCE_DIVU16_MASK;
1273 val |= divider;
1274 clk_writel(val, c->reg);
1275 c->div = divider + 1;
1276 c->mul = 1;
1277 return 0;
1278 }
1279 } else if (parent_rate <= rate) {
1280 c->div = 1;
1281 c->mul = 1;
1282 return 0;
1283 }
1284
1285 return -EINVAL;
1286}
1287
1288static long tegra20_periph_clk_round_rate(struct clk_hw *hw,
1289 unsigned long rate, unsigned long *prate)
1290{
1291 struct clk_tegra *c = to_clk_tegra(hw);
1292 unsigned long parent_rate = __clk_get_rate(__clk_get_parent(hw->clk));
1293 int divider;
1294
1295 pr_debug("%s: %s %lu\n", __func__, __clk_get_name(hw->clk), rate);
1296
1297 if (prate)
1298 parent_rate = *prate;
1299
1300 if (c->flags & DIV_U71) {
1301 divider = clk_div71_get_divider(parent_rate, rate);
1302 if (divider < 0)
1303 return divider;
1304
1305 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
1306 } else if (c->flags & DIV_U16) {
1307 divider = clk_div16_get_divider(parent_rate, rate);
1308 if (divider < 0)
1309 return divider;
1310 return DIV_ROUND_UP(parent_rate, divider + 1);
1311 }
1312 return -EINVAL;
1313}
1314
1315struct clk_ops tegra_periph_clk_ops = {
1316 .is_enabled = tegra20_periph_clk_is_enabled,
1317 .enable = tegra20_periph_clk_enable,
1318 .disable = tegra20_periph_clk_disable,
1319 .set_parent = tegra20_periph_clk_set_parent,
1320 .get_parent = tegra20_periph_clk_get_parent,
1321 .set_rate = tegra20_periph_clk_set_rate,
1322 .round_rate = tegra20_periph_clk_round_rate,
1323 .recalc_rate = tegra20_periph_clk_recalc_rate,
1324};
1325
1326/* External memory controller clock ops */
1327static void tegra20_emc_clk_init(struct clk_hw *hw)
1328{
1329 struct clk_tegra *c = to_clk_tegra(hw);
1330 c->max_rate = __clk_get_rate(hw->clk);
1331}
1332
1333static long tegra20_emc_clk_round_rate(struct clk_hw *hw, unsigned long rate,
1334 unsigned long *prate)
1335{
1336 struct clk_tegra *c = to_clk_tegra(hw);
1337 long emc_rate;
1338 long clk_rate;
1339
1340 /*
1341 * The slowest entry in the EMC clock table that is at least as
1342 * fast as rate.
1343 */
1344 emc_rate = tegra_emc_round_rate(rate);
1345 if (emc_rate < 0)
1346 return c->max_rate;
1347
1348 /*
1349 * The fastest rate the PLL will generate that is at most the
1350 * requested rate.
1351 */
1352 clk_rate = tegra20_periph_clk_round_rate(hw, emc_rate, NULL);
1353
1354 /*
1355 * If this fails, and emc_rate > clk_rate, it's because the maximum
1356 * rate in the EMC tables is larger than the maximum rate of the EMC
1357 * clock. The EMC clock's max rate is the rate it was running when the
1358 * kernel booted. Such a mismatch is probably due to using the wrong
1359 * BCT, i.e. using a Tegra20 BCT with an EMC table written for Tegra25.
1360 */
1361 WARN_ONCE(emc_rate != clk_rate,
1362 "emc_rate %ld != clk_rate %ld",
1363 emc_rate, clk_rate);
1364
1365 return emc_rate;
1366}
1367
1368static int tegra20_emc_clk_set_rate(struct clk_hw *hw, unsigned long rate,
1369 unsigned long parent_rate)
1370{
1371 int ret;
1372
1373 /*
1374 * The Tegra2 memory controller has an interlock with the clock
1375 * block that allows memory shadowed registers to be updated,
1376 * and then transfer them to the main registers at the same
1377 * time as the clock update without glitches.
1378 */
1379 ret = tegra_emc_set_rate(rate);
1380 if (ret < 0)
1381 return ret;
1382
1383 ret = tegra20_periph_clk_set_rate(hw, rate, parent_rate);
1384 udelay(1);
1385
1386 return ret;
1387}
1388
1389struct clk_ops tegra_emc_clk_ops = {
1390 .init = tegra20_emc_clk_init,
1391 .is_enabled = tegra20_periph_clk_is_enabled,
1392 .enable = tegra20_periph_clk_enable,
1393 .disable = tegra20_periph_clk_disable,
1394 .set_parent = tegra20_periph_clk_set_parent,
1395 .get_parent = tegra20_periph_clk_get_parent,
1396 .set_rate = tegra20_emc_clk_set_rate,
1397 .round_rate = tegra20_emc_clk_round_rate,
1398 .recalc_rate = tegra20_periph_clk_recalc_rate,
1399};
1400
1401/* Clock doubler ops */
1402static int tegra20_clk_double_is_enabled(struct clk_hw *hw)
1403{
1404 struct clk_tegra *c = to_clk_tegra(hw);
1405
1406 c->state = ON;
1407
1408 if (!c->u.periph.clk_num)
1409 goto out;
1410
1411 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1412 PERIPH_CLK_TO_ENB_BIT(c)))
1413 c->state = OFF;
1414
1415out:
1416 return c->state;
1417};
1418
1419static unsigned long tegra20_clk_double_recalc_rate(struct clk_hw *hw,
1420 unsigned long prate)
1421{
1422 struct clk_tegra *c = to_clk_tegra(hw);
1423 u64 rate = prate;
1424
1425 c->mul = 2;
1426 c->div = 1;
1427
1428 rate *= c->mul;
1429 rate += c->div - 1; /* round up */
1430 do_div(rate, c->div);
1431
1432 return rate;
1433}
1434
1435static long tegra20_clk_double_round_rate(struct clk_hw *hw, unsigned long rate,
1436 unsigned long *prate)
1437{
1438 unsigned long output_rate = *prate;
1439
1440 do_div(output_rate, 2);
1441 return output_rate;
1442}
1443
1444static int tegra20_clk_double_set_rate(struct clk_hw *hw, unsigned long rate,
1445 unsigned long parent_rate)
1446{
1447 if (rate != 2 * parent_rate)
1448 return -EINVAL;
1449 return 0;
1450}
1451
1452struct clk_ops tegra_clk_double_ops = {
1453 .is_enabled = tegra20_clk_double_is_enabled,
1454 .enable = tegra20_periph_clk_enable,
1455 .disable = tegra20_periph_clk_disable,
1456 .set_rate = tegra20_clk_double_set_rate,
1457 .recalc_rate = tegra20_clk_double_recalc_rate,
1458 .round_rate = tegra20_clk_double_round_rate,
1459};
1460
1461/* Audio sync clock ops */
1462static int tegra20_audio_sync_clk_is_enabled(struct clk_hw *hw)
1463{
1464 struct clk_tegra *c = to_clk_tegra(hw);
1465 u32 val = clk_readl(c->reg);
1466
1467 c->state = (val & (1<<4)) ? OFF : ON;
1468 return c->state;
1469}
1470
1471static int tegra20_audio_sync_clk_enable(struct clk_hw *hw)
1472{
1473 struct clk_tegra *c = to_clk_tegra(hw);
1474
1475 clk_writel(0, c->reg);
1476 return 0;
1477}
1478
1479static void tegra20_audio_sync_clk_disable(struct clk_hw *hw)
1480{
1481 struct clk_tegra *c = to_clk_tegra(hw);
1482 clk_writel(1, c->reg);
1483}
1484
1485static u8 tegra20_audio_sync_clk_get_parent(struct clk_hw *hw)
1486{
1487 struct clk_tegra *c = to_clk_tegra(hw);
1488 u32 val = clk_readl(c->reg);
1489 int source;
1490
1491 source = val & 0xf;
1492 return source;
1493}
1494
1495static int tegra20_audio_sync_clk_set_parent(struct clk_hw *hw, u8 index)
1496{
1497 struct clk_tegra *c = to_clk_tegra(hw);
1498 u32 val;
1499
1500 val = clk_readl(c->reg);
1501 val &= ~0xf;
1502 val |= index;
1503
1504 clk_writel(val, c->reg);
1505
1506 return 0;
1507}
1508
1509struct clk_ops tegra_audio_sync_clk_ops = {
1510 .is_enabled = tegra20_audio_sync_clk_is_enabled,
1511 .enable = tegra20_audio_sync_clk_enable,
1512 .disable = tegra20_audio_sync_clk_disable,
1513 .set_parent = tegra20_audio_sync_clk_set_parent,
1514 .get_parent = tegra20_audio_sync_clk_get_parent,
1515};
1516
1517/* cdev1 and cdev2 (dap_mclk1 and dap_mclk2) ops */
1518
1519static int tegra20_cdev_clk_is_enabled(struct clk_hw *hw)
1520{
1521 struct clk_tegra *c = to_clk_tegra(hw);
1522 /* We could un-tristate the cdev1 or cdev2 pingroup here; this is
1523 * currently done in the pinmux code. */
1524 c->state = ON;
1525
1526 BUG_ON(!c->u.periph.clk_num);
1527
1528 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1529 PERIPH_CLK_TO_ENB_BIT(c)))
1530 c->state = OFF;
1531 return c->state;
1532}
1533
1534static int tegra20_cdev_clk_enable(struct clk_hw *hw)
1535{
1536 struct clk_tegra *c = to_clk_tegra(hw);
1537 BUG_ON(!c->u.periph.clk_num);
1538
1539 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1540 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
1541 return 0;
1542}
1543
1544static void tegra20_cdev_clk_disable(struct clk_hw *hw)
1545{
1546 struct clk_tegra *c = to_clk_tegra(hw);
1547 BUG_ON(!c->u.periph.clk_num);
1548
1549 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1550 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1551}
1552
1553static unsigned long tegra20_cdev_recalc_rate(struct clk_hw *hw,
1554 unsigned long prate)
1555{
1556 return to_clk_tegra(hw)->fixed_rate;
1557}
1558
1559struct clk_ops tegra_cdev_clk_ops = {
1560 .is_enabled = tegra20_cdev_clk_is_enabled,
1561 .enable = tegra20_cdev_clk_enable,
1562 .disable = tegra20_cdev_clk_disable,
1563 .recalc_rate = tegra20_cdev_recalc_rate,
1564};
1565
1566/* Tegra20 CPU clock and reset control functions */
1567static void tegra20_wait_cpu_in_reset(u32 cpu)
1568{
1569 unsigned int reg;
1570
1571 do {
1572 reg = readl(reg_clk_base +
1573 TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET);
1574 cpu_relax();
1575 } while (!(reg & (1 << cpu))); /* check CPU been reset or not */
1576
1577 return;
1578}
1579
1580static void tegra20_put_cpu_in_reset(u32 cpu)
1581{
1582 writel(CPU_RESET(cpu),
1583 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET);
1584 dmb();
1585}
1586
1587static void tegra20_cpu_out_of_reset(u32 cpu)
1588{
1589 writel(CPU_RESET(cpu),
1590 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR);
1591 wmb();
1592}
1593
1594static void tegra20_enable_cpu_clock(u32 cpu)
1595{
1596 unsigned int reg;
1597
1598 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1599 writel(reg & ~CPU_CLOCK(cpu),
1600 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1601 barrier();
1602 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1603}
1604
1605static void tegra20_disable_cpu_clock(u32 cpu)
1606{
1607 unsigned int reg;
1608
1609 reg = readl(reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1610 writel(reg | CPU_CLOCK(cpu),
1611 reg_clk_base + TEGRA_CLK_RST_CONTROLLER_CLK_CPU_CMPLX);
1612}
1613
1614static struct tegra_cpu_car_ops tegra20_cpu_car_ops = {
1615 .wait_for_reset = tegra20_wait_cpu_in_reset,
1616 .put_in_reset = tegra20_put_cpu_in_reset,
1617 .out_of_reset = tegra20_cpu_out_of_reset,
1618 .enable_clock = tegra20_enable_cpu_clock,
1619 .disable_clock = tegra20_disable_cpu_clock,
1620};
1621
1622void __init tegra20_cpu_car_ops_init(void)
1623{
1624 tegra_cpu_car_ops = &tegra20_cpu_car_ops;
1625}
diff --git a/arch/arm/mach-tegra/tegra20_clocks.h b/arch/arm/mach-tegra/tegra20_clocks.h
new file mode 100644
index 000000000000..8bfd31bcc490
--- /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 000000000000..e81dcd239c95
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra20_clocks_data.c
@@ -0,0 +1,1144 @@
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#include <mach/suspend.h>
32
33#include "clock.h"
34#include "fuse.h"
35#include "tegra2_emc.h"
36#include "tegra20_clocks.h"
37#include "tegra_cpu_car.h"
38
39/* Clock definitions */
40
41#define DEFINE_CLK_TEGRA(_name, _rate, _ops, _flags, \
42 _parent_names, _parents, _parent) \
43 static struct clk tegra_##_name = { \
44 .hw = &tegra_##_name##_hw.hw, \
45 .name = #_name, \
46 .rate = _rate, \
47 .ops = _ops, \
48 .flags = _flags, \
49 .parent_names = _parent_names, \
50 .parents = _parents, \
51 .num_parents = ARRAY_SIZE(_parent_names), \
52 .parent = _parent, \
53 };
54
55static struct clk tegra_clk_32k;
56static struct clk_tegra tegra_clk_32k_hw = {
57 .hw = {
58 .clk = &tegra_clk_32k,
59 },
60 .fixed_rate = 32768,
61};
62
63static struct clk tegra_clk_32k = {
64 .name = "clk_32k",
65 .rate = 32768,
66 .ops = &tegra_clk_32k_ops,
67 .hw = &tegra_clk_32k_hw.hw,
68 .flags = CLK_IS_ROOT,
69};
70
71static struct clk tegra_clk_m;
72static struct clk_tegra tegra_clk_m_hw = {
73 .hw = {
74 .clk = &tegra_clk_m,
75 },
76 .flags = ENABLE_ON_INIT,
77 .reg = 0x1fc,
78 .reg_shift = 28,
79 .max_rate = 26000000,
80 .fixed_rate = 0,
81};
82
83static struct clk tegra_clk_m = {
84 .name = "clk_m",
85 .ops = &tegra_clk_m_ops,
86 .hw = &tegra_clk_m_hw.hw,
87 .flags = CLK_IS_ROOT,
88};
89
90#define DEFINE_PLL(_name, _flags, _reg, _max_rate, _input_min, \
91 _input_max, _cf_min, _cf_max, _vco_min, \
92 _vco_max, _freq_table, _lock_delay, _ops, \
93 _fixed_rate, _parent) \
94 static const char *tegra_##_name##_parent_names[] = { \
95 #_parent, \
96 }; \
97 static struct clk *tegra_##_name##_parents[] = { \
98 &tegra_##_parent, \
99 }; \
100 static struct clk tegra_##_name; \
101 static struct clk_tegra tegra_##_name##_hw = { \
102 .hw = { \
103 .clk = &tegra_##_name, \
104 }, \
105 .flags = _flags, \
106 .reg = _reg, \
107 .max_rate = _max_rate, \
108 .u.pll = { \
109 .input_min = _input_min, \
110 .input_max = _input_max, \
111 .cf_min = _cf_min, \
112 .cf_max = _cf_max, \
113 .vco_min = _vco_min, \
114 .vco_max = _vco_max, \
115 .freq_table = _freq_table, \
116 .lock_delay = _lock_delay, \
117 .fixed_rate = _fixed_rate, \
118 }, \
119 }; \
120 static struct clk tegra_##_name = { \
121 .name = #_name, \
122 .ops = &_ops, \
123 .hw = &tegra_##_name##_hw.hw, \
124 .parent = &tegra_##_parent, \
125 .parent_names = tegra_##_name##_parent_names, \
126 .parents = tegra_##_name##_parents, \
127 .num_parents = 1, \
128 };
129
130#define DEFINE_PLL_OUT(_name, _flags, _reg, _reg_shift, \
131 _max_rate, _ops, _parent, _clk_flags) \
132 static const char *tegra_##_name##_parent_names[] = { \
133 #_parent, \
134 }; \
135 static struct clk *tegra_##_name##_parents[] = { \
136 &tegra_##_parent, \
137 }; \
138 static struct clk tegra_##_name; \
139 static struct clk_tegra tegra_##_name##_hw = { \
140 .hw = { \
141 .clk = &tegra_##_name, \
142 }, \
143 .flags = _flags, \
144 .reg = _reg, \
145 .max_rate = _max_rate, \
146 .reg_shift = _reg_shift, \
147 }; \
148 static struct clk tegra_##_name = { \
149 .name = #_name, \
150 .ops = &tegra_pll_div_ops, \
151 .hw = &tegra_##_name##_hw.hw, \
152 .parent = &tegra_##_parent, \
153 .parent_names = tegra_##_name##_parent_names, \
154 .parents = tegra_##_name##_parents, \
155 .num_parents = 1, \
156 .flags = _clk_flags, \
157 };
158
159
160static struct clk_pll_freq_table tegra_pll_s_freq_table[] = {
161 {32768, 12000000, 366, 1, 1, 0},
162 {32768, 13000000, 397, 1, 1, 0},
163 {32768, 19200000, 586, 1, 1, 0},
164 {32768, 26000000, 793, 1, 1, 0},
165 {0, 0, 0, 0, 0, 0},
166};
167
168DEFINE_PLL(pll_s, PLL_ALT_MISC_REG, 0xf0, 26000000, 32768, 32768, 0,
169 0, 12000000, 26000000, tegra_pll_s_freq_table, 300,
170 tegra_pll_ops, 0, clk_32k);
171
172static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
173 { 12000000, 600000000, 600, 12, 1, 8 },
174 { 13000000, 600000000, 600, 13, 1, 8 },
175 { 19200000, 600000000, 500, 16, 1, 6 },
176 { 26000000, 600000000, 600, 26, 1, 8 },
177 { 0, 0, 0, 0, 0, 0 },
178};
179
180DEFINE_PLL(pll_c, PLL_HAS_CPCON, 0x80, 600000000, 2000000, 31000000, 1000000,
181 6000000, 20000000, 1400000000, tegra_pll_c_freq_table, 300,
182 tegra_pll_ops, 0, clk_m);
183
184DEFINE_PLL_OUT(pll_c_out1, DIV_U71, 0x84, 0, 600000000,
185 tegra_pll_div_ops, pll_c, 0);
186
187static struct clk_pll_freq_table tegra_pll_m_freq_table[] = {
188 { 12000000, 666000000, 666, 12, 1, 8},
189 { 13000000, 666000000, 666, 13, 1, 8},
190 { 19200000, 666000000, 555, 16, 1, 8},
191 { 26000000, 666000000, 666, 26, 1, 8},
192 { 12000000, 600000000, 600, 12, 1, 8},
193 { 13000000, 600000000, 600, 13, 1, 8},
194 { 19200000, 600000000, 375, 12, 1, 6},
195 { 26000000, 600000000, 600, 26, 1, 8},
196 { 0, 0, 0, 0, 0, 0 },
197};
198
199DEFINE_PLL(pll_m, PLL_HAS_CPCON, 0x90, 800000000, 2000000, 31000000, 1000000,
200 6000000, 20000000, 1200000000, tegra_pll_m_freq_table, 300,
201 tegra_pll_ops, 0, clk_m);
202
203DEFINE_PLL_OUT(pll_m_out1, DIV_U71, 0x94, 0, 600000000,
204 tegra_pll_div_ops, pll_m, 0);
205
206static struct clk_pll_freq_table tegra_pll_p_freq_table[] = {
207 { 12000000, 216000000, 432, 12, 2, 8},
208 { 13000000, 216000000, 432, 13, 2, 8},
209 { 19200000, 216000000, 90, 4, 2, 1},
210 { 26000000, 216000000, 432, 26, 2, 8},
211 { 12000000, 432000000, 432, 12, 1, 8},
212 { 13000000, 432000000, 432, 13, 1, 8},
213 { 19200000, 432000000, 90, 4, 1, 1},
214 { 26000000, 432000000, 432, 26, 1, 8},
215 { 0, 0, 0, 0, 0, 0 },
216};
217
218
219DEFINE_PLL(pll_p, ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON, 0xa0, 432000000,
220 2000000, 31000000, 1000000, 6000000, 20000000, 1400000000,
221 tegra_pll_p_freq_table, 300, tegra_pll_ops, 216000000, clk_m);
222
223DEFINE_PLL_OUT(pll_p_out1, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4, 0,
224 432000000, tegra_pll_div_ops, pll_p, 0);
225DEFINE_PLL_OUT(pll_p_out2, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa4, 16,
226 432000000, tegra_pll_div_ops, pll_p, 0);
227DEFINE_PLL_OUT(pll_p_out3, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8, 0,
228 432000000, tegra_pll_div_ops, pll_p, 0);
229DEFINE_PLL_OUT(pll_p_out4, ENABLE_ON_INIT | DIV_U71 | DIV_U71_FIXED, 0xa8, 16,
230 432000000, tegra_pll_div_ops, pll_p, 0);
231
232static struct clk_pll_freq_table tegra_pll_a_freq_table[] = {
233 { 28800000, 56448000, 49, 25, 1, 1},
234 { 28800000, 73728000, 64, 25, 1, 1},
235 { 28800000, 24000000, 5, 6, 1, 1},
236 { 0, 0, 0, 0, 0, 0 },
237};
238
239DEFINE_PLL(pll_a, PLL_HAS_CPCON, 0xb0, 73728000, 2000000, 31000000, 1000000,
240 6000000, 20000000, 1400000000, tegra_pll_a_freq_table, 300,
241 tegra_pll_ops, 0, pll_p_out1);
242
243DEFINE_PLL_OUT(pll_a_out0, DIV_U71, 0xb4, 0, 73728000,
244 tegra_pll_div_ops, pll_a, 0);
245
246static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
247 { 12000000, 216000000, 216, 12, 1, 4},
248 { 13000000, 216000000, 216, 13, 1, 4},
249 { 19200000, 216000000, 135, 12, 1, 3},
250 { 26000000, 216000000, 216, 26, 1, 4},
251
252 { 12000000, 594000000, 594, 12, 1, 8},
253 { 13000000, 594000000, 594, 13, 1, 8},
254 { 19200000, 594000000, 495, 16, 1, 8},
255 { 26000000, 594000000, 594, 26, 1, 8},
256
257 { 12000000, 1000000000, 1000, 12, 1, 12},
258 { 13000000, 1000000000, 1000, 13, 1, 12},
259 { 19200000, 1000000000, 625, 12, 1, 8},
260 { 26000000, 1000000000, 1000, 26, 1, 12},
261
262 { 0, 0, 0, 0, 0, 0 },
263};
264
265DEFINE_PLL(pll_d, PLL_HAS_CPCON | PLLD, 0xd0, 1000000000, 2000000, 40000000,
266 1000000, 6000000, 40000000, 1000000000, tegra_pll_d_freq_table,
267 1000, tegra_pll_ops, 0, clk_m);
268
269DEFINE_PLL_OUT(pll_d_out0, DIV_2 | PLLD, 0, 0, 500000000,
270 tegra_pll_div_ops, pll_d, CLK_SET_RATE_PARENT);
271
272static struct clk_pll_freq_table tegra_pll_u_freq_table[] = {
273 { 12000000, 480000000, 960, 12, 2, 0},
274 { 13000000, 480000000, 960, 13, 2, 0},
275 { 19200000, 480000000, 200, 4, 2, 0},
276 { 26000000, 480000000, 960, 26, 2, 0},
277 { 0, 0, 0, 0, 0, 0 },
278};
279
280DEFINE_PLL(pll_u, PLLU, 0xc0, 480000000, 2000000, 40000000, 1000000, 6000000,
281 48000000, 960000000, tegra_pll_u_freq_table, 1000,
282 tegra_pll_ops, 0, clk_m);
283
284static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
285 /* 1 GHz */
286 { 12000000, 1000000000, 1000, 12, 1, 12},
287 { 13000000, 1000000000, 1000, 13, 1, 12},
288 { 19200000, 1000000000, 625, 12, 1, 8},
289 { 26000000, 1000000000, 1000, 26, 1, 12},
290
291 /* 912 MHz */
292 { 12000000, 912000000, 912, 12, 1, 12},
293 { 13000000, 912000000, 912, 13, 1, 12},
294 { 19200000, 912000000, 760, 16, 1, 8},
295 { 26000000, 912000000, 912, 26, 1, 12},
296
297 /* 816 MHz */
298 { 12000000, 816000000, 816, 12, 1, 12},
299 { 13000000, 816000000, 816, 13, 1, 12},
300 { 19200000, 816000000, 680, 16, 1, 8},
301 { 26000000, 816000000, 816, 26, 1, 12},
302
303 /* 760 MHz */
304 { 12000000, 760000000, 760, 12, 1, 12},
305 { 13000000, 760000000, 760, 13, 1, 12},
306 { 19200000, 760000000, 950, 24, 1, 8},
307 { 26000000, 760000000, 760, 26, 1, 12},
308
309 /* 750 MHz */
310 { 12000000, 750000000, 750, 12, 1, 12},
311 { 13000000, 750000000, 750, 13, 1, 12},
312 { 19200000, 750000000, 625, 16, 1, 8},
313 { 26000000, 750000000, 750, 26, 1, 12},
314
315 /* 608 MHz */
316 { 12000000, 608000000, 608, 12, 1, 12},
317 { 13000000, 608000000, 608, 13, 1, 12},
318 { 19200000, 608000000, 380, 12, 1, 8},
319 { 26000000, 608000000, 608, 26, 1, 12},
320
321 /* 456 MHz */
322 { 12000000, 456000000, 456, 12, 1, 12},
323 { 13000000, 456000000, 456, 13, 1, 12},
324 { 19200000, 456000000, 380, 16, 1, 8},
325 { 26000000, 456000000, 456, 26, 1, 12},
326
327 /* 312 MHz */
328 { 12000000, 312000000, 312, 12, 1, 12},
329 { 13000000, 312000000, 312, 13, 1, 12},
330 { 19200000, 312000000, 260, 16, 1, 8},
331 { 26000000, 312000000, 312, 26, 1, 12},
332
333 { 0, 0, 0, 0, 0, 0 },
334};
335
336DEFINE_PLL(pll_x, PLL_HAS_CPCON | PLL_ALT_MISC_REG, 0xe0, 1000000000, 2000000,
337 31000000, 1000000, 6000000, 20000000, 1200000000,
338 tegra_pll_x_freq_table, 300, tegra_pllx_ops, 0, clk_m);
339
340static struct clk_pll_freq_table tegra_pll_e_freq_table[] = {
341 { 12000000, 100000000, 200, 24, 1, 0 },
342 { 0, 0, 0, 0, 0, 0 },
343};
344
345DEFINE_PLL(pll_e, PLL_ALT_MISC_REG, 0xe8, 100000000, 12000000, 12000000, 0, 0,
346 0, 0, tegra_pll_e_freq_table, 0, tegra_plle_ops, 0, clk_m);
347
348static const char *tegra_common_parent_names[] = {
349 "clk_m",
350};
351
352static struct clk *tegra_common_parents[] = {
353 &tegra_clk_m,
354};
355
356static struct clk tegra_clk_d;
357static struct clk_tegra tegra_clk_d_hw = {
358 .hw = {
359 .clk = &tegra_clk_d,
360 },
361 .flags = PERIPH_NO_RESET,
362 .reg = 0x34,
363 .reg_shift = 12,
364 .max_rate = 52000000,
365 .u.periph = {
366 .clk_num = 90,
367 },
368};
369
370static struct clk tegra_clk_d = {
371 .name = "clk_d",
372 .hw = &tegra_clk_d_hw.hw,
373 .ops = &tegra_clk_double_ops,
374 .parent = &tegra_clk_m,
375 .parent_names = tegra_common_parent_names,
376 .parents = tegra_common_parents,
377 .num_parents = ARRAY_SIZE(tegra_common_parent_names),
378};
379
380static struct clk tegra_cdev1;
381static struct clk_tegra tegra_cdev1_hw = {
382 .hw = {
383 .clk = &tegra_cdev1,
384 },
385 .fixed_rate = 26000000,
386 .u.periph = {
387 .clk_num = 94,
388 },
389};
390static struct clk tegra_cdev1 = {
391 .name = "cdev1",
392 .hw = &tegra_cdev1_hw.hw,
393 .ops = &tegra_cdev_clk_ops,
394 .flags = CLK_IS_ROOT,
395};
396
397/* dap_mclk2, belongs to the cdev2 pingroup. */
398static struct clk tegra_cdev2;
399static struct clk_tegra tegra_cdev2_hw = {
400 .hw = {
401 .clk = &tegra_cdev2,
402 },
403 .fixed_rate = 26000000,
404 .u.periph = {
405 .clk_num = 93,
406 },
407};
408static struct clk tegra_cdev2 = {
409 .name = "cdev2",
410 .hw = &tegra_cdev2_hw.hw,
411 .ops = &tegra_cdev_clk_ops,
412 .flags = CLK_IS_ROOT,
413};
414
415/* initialized before peripheral clocks */
416static struct clk_mux_sel mux_audio_sync_clk[8+1];
417static const struct audio_sources {
418 const char *name;
419 int value;
420} mux_audio_sync_clk_sources[] = {
421 { .name = "spdif_in", .value = 0 },
422 { .name = "i2s1", .value = 1 },
423 { .name = "i2s2", .value = 2 },
424 { .name = "pll_a_out0", .value = 4 },
425#if 0 /* FIXME: not implemented */
426 { .name = "ac97", .value = 3 },
427 { .name = "ext_audio_clk2", .value = 5 },
428 { .name = "ext_audio_clk1", .value = 6 },
429 { .name = "ext_vimclk", .value = 7 },
430#endif
431 { NULL, 0 }
432};
433
434static const char *audio_parent_names[] = {
435 "spdif_in",
436 "i2s1",
437 "i2s2",
438 "dummy",
439 "pll_a_out0",
440 "dummy",
441 "dummy",
442 "dummy",
443};
444
445static struct clk *audio_parents[] = {
446 NULL,
447 NULL,
448 NULL,
449 NULL,
450 NULL,
451 NULL,
452 NULL,
453 NULL,
454};
455
456static struct clk tegra_audio;
457static struct clk_tegra tegra_audio_hw = {
458 .hw = {
459 .clk = &tegra_audio,
460 },
461 .reg = 0x38,
462 .max_rate = 73728000,
463};
464DEFINE_CLK_TEGRA(audio, 0, &tegra_audio_sync_clk_ops, 0, audio_parent_names,
465 audio_parents, NULL);
466
467static const char *audio_2x_parent_names[] = {
468 "audio",
469};
470
471static struct clk *audio_2x_parents[] = {
472 &tegra_audio,
473};
474
475static struct clk tegra_audio_2x;
476static struct clk_tegra tegra_audio_2x_hw = {
477 .hw = {
478 .clk = &tegra_audio_2x,
479 },
480 .flags = PERIPH_NO_RESET,
481 .max_rate = 48000000,
482 .reg = 0x34,
483 .reg_shift = 8,
484 .u.periph = {
485 .clk_num = 89,
486 },
487};
488DEFINE_CLK_TEGRA(audio_2x, 0, &tegra_clk_double_ops, 0, audio_2x_parent_names,
489 audio_2x_parents, &tegra_audio);
490
491static struct clk_lookup tegra_audio_clk_lookups[] = {
492 { .con_id = "audio", .clk = &tegra_audio },
493 { .con_id = "audio_2x", .clk = &tegra_audio_2x }
494};
495
496/* This is called after peripheral clocks are initialized, as the
497 * audio_sync clock depends on some of the peripheral clocks.
498 */
499
500static void init_audio_sync_clock_mux(void)
501{
502 int i;
503 struct clk_mux_sel *sel = mux_audio_sync_clk;
504 const struct audio_sources *src = mux_audio_sync_clk_sources;
505 struct clk_lookup *lookup;
506
507 for (i = 0; src->name; i++, sel++, src++) {
508 sel->input = tegra_get_clock_by_name(src->name);
509 if (!sel->input)
510 pr_err("%s: could not find clk %s\n", __func__,
511 src->name);
512 audio_parents[src->value] = sel->input;
513 sel->value = src->value;
514 }
515
516 lookup = tegra_audio_clk_lookups;
517 for (i = 0; i < ARRAY_SIZE(tegra_audio_clk_lookups); i++, lookup++) {
518 struct clk *c = lookup->clk;
519 struct clk_tegra *clk = to_clk_tegra(c->hw);
520 __clk_init(NULL, c);
521 INIT_LIST_HEAD(&clk->shared_bus_list);
522 clk->lookup.con_id = lookup->con_id;
523 clk->lookup.clk = c;
524 clkdev_add(&clk->lookup);
525 tegra_clk_add(c);
526 }
527}
528
529static const char *mux_cclk[] = {
530 "clk_m",
531 "pll_c",
532 "clk_32k",
533 "pll_m",
534 "pll_p",
535 "pll_p_out4",
536 "pll_p_out3",
537 "clk_d",
538 "pll_x",
539};
540
541
542static struct clk *mux_cclk_p[] = {
543 &tegra_clk_m,
544 &tegra_pll_c,
545 &tegra_clk_32k,
546 &tegra_pll_m,
547 &tegra_pll_p,
548 &tegra_pll_p_out4,
549 &tegra_pll_p_out3,
550 &tegra_clk_d,
551 &tegra_pll_x,
552};
553
554static const char *mux_sclk[] = {
555 "clk_m",
556 "pll_c_out1",
557 "pll_p_out4",
558 "pllp_p_out3",
559 "pll_p_out2",
560 "clk_d",
561 "clk_32k",
562 "pll_m_out1",
563};
564
565static struct clk *mux_sclk_p[] = {
566 &tegra_clk_m,
567 &tegra_pll_c_out1,
568 &tegra_pll_p_out4,
569 &tegra_pll_p_out3,
570 &tegra_pll_p_out2,
571 &tegra_clk_d,
572 &tegra_clk_32k,
573 &tegra_pll_m_out1,
574};
575
576static struct clk tegra_cclk;
577static struct clk_tegra tegra_cclk_hw = {
578 .hw = {
579 .clk = &tegra_cclk,
580 },
581 .reg = 0x20,
582 .max_rate = 1000000000,
583};
584DEFINE_CLK_TEGRA(cclk, 0, &tegra_super_ops, 0, mux_cclk,
585 mux_cclk_p, NULL);
586
587static const char *mux_twd[] = {
588 "cclk",
589};
590
591static struct clk *mux_twd_p[] = {
592 &tegra_cclk,
593};
594
595static struct clk tegra_clk_twd;
596static struct clk_tegra tegra_clk_twd_hw = {
597 .hw = {
598 .clk = &tegra_clk_twd,
599 },
600 .max_rate = 1000000000,
601 .mul = 1,
602 .div = 4,
603};
604
605static struct clk tegra_clk_twd = {
606 .name = "twd",
607 .ops = &tegra_twd_ops,
608 .hw = &tegra_clk_twd_hw.hw,
609 .parent = &tegra_cclk,
610 .parent_names = mux_twd,
611 .parents = mux_twd_p,
612 .num_parents = ARRAY_SIZE(mux_twd),
613};
614
615static struct clk tegra_sclk;
616static struct clk_tegra tegra_sclk_hw = {
617 .hw = {
618 .clk = &tegra_sclk,
619 },
620 .reg = 0x28,
621 .max_rate = 240000000,
622 .min_rate = 120000000,
623};
624DEFINE_CLK_TEGRA(sclk, 0, &tegra_super_ops, 0, mux_sclk,
625 mux_sclk_p, NULL);
626
627static const char *tegra_cop_parent_names[] = {
628 "tegra_sclk",
629};
630
631static struct clk *tegra_cop_parents[] = {
632 &tegra_sclk,
633};
634
635static struct clk tegra_cop;
636static struct clk_tegra tegra_cop_hw = {
637 .hw = {
638 .clk = &tegra_cop,
639 },
640 .max_rate = 240000000,
641 .reset = &tegra2_cop_clk_reset,
642};
643DEFINE_CLK_TEGRA(cop, 0, &tegra_cop_ops, CLK_SET_RATE_PARENT,
644 tegra_cop_parent_names, tegra_cop_parents, &tegra_sclk);
645
646static const char *tegra_hclk_parent_names[] = {
647 "tegra_sclk",
648};
649
650static struct clk *tegra_hclk_parents[] = {
651 &tegra_sclk,
652};
653
654static struct clk tegra_hclk;
655static struct clk_tegra tegra_hclk_hw = {
656 .hw = {
657 .clk = &tegra_hclk,
658 },
659 .flags = DIV_BUS,
660 .reg = 0x30,
661 .reg_shift = 4,
662 .max_rate = 240000000,
663};
664DEFINE_CLK_TEGRA(hclk, 0, &tegra_bus_ops, 0, tegra_hclk_parent_names,
665 tegra_hclk_parents, &tegra_sclk);
666
667static const char *tegra_pclk_parent_names[] = {
668 "tegra_hclk",
669};
670
671static struct clk *tegra_pclk_parents[] = {
672 &tegra_hclk,
673};
674
675static struct clk tegra_pclk;
676static struct clk_tegra tegra_pclk_hw = {
677 .hw = {
678 .clk = &tegra_pclk,
679 },
680 .flags = DIV_BUS,
681 .reg = 0x30,
682 .reg_shift = 0,
683 .max_rate = 120000000,
684};
685DEFINE_CLK_TEGRA(pclk, 0, &tegra_bus_ops, 0, tegra_pclk_parent_names,
686 tegra_pclk_parents, &tegra_hclk);
687
688static const char *tegra_blink_parent_names[] = {
689 "clk_32k",
690};
691
692static struct clk *tegra_blink_parents[] = {
693 &tegra_clk_32k,
694};
695
696static struct clk tegra_blink;
697static struct clk_tegra tegra_blink_hw = {
698 .hw = {
699 .clk = &tegra_blink,
700 },
701 .reg = 0x40,
702 .max_rate = 32768,
703};
704DEFINE_CLK_TEGRA(blink, 0, &tegra_blink_clk_ops, 0, tegra_blink_parent_names,
705 tegra_blink_parents, &tegra_clk_32k);
706
707static const char *mux_pllm_pllc_pllp_plla[] = {
708 "pll_m",
709 "pll_c",
710 "pll_p",
711 "pll_a_out0",
712};
713
714static struct clk *mux_pllm_pllc_pllp_plla_p[] = {
715 &tegra_pll_m,
716 &tegra_pll_c,
717 &tegra_pll_p,
718 &tegra_pll_a_out0,
719};
720
721static const char *mux_pllm_pllc_pllp_clkm[] = {
722 "pll_m",
723 "pll_c",
724 "pll_p",
725 "clk_m",
726};
727
728static struct clk *mux_pllm_pllc_pllp_clkm_p[] = {
729 &tegra_pll_m,
730 &tegra_pll_c,
731 &tegra_pll_p,
732 &tegra_clk_m,
733};
734
735static const char *mux_pllp_pllc_pllm_clkm[] = {
736 "pll_p",
737 "pll_c",
738 "pll_m",
739 "clk_m",
740};
741
742static struct clk *mux_pllp_pllc_pllm_clkm_p[] = {
743 &tegra_pll_p,
744 &tegra_pll_c,
745 &tegra_pll_m,
746 &tegra_clk_m,
747};
748
749static const char *mux_pllaout0_audio2x_pllp_clkm[] = {
750 "pll_a_out0",
751 "audio_2x",
752 "pll_p",
753 "clk_m",
754};
755
756static struct clk *mux_pllaout0_audio2x_pllp_clkm_p[] = {
757 &tegra_pll_a_out0,
758 &tegra_audio_2x,
759 &tegra_pll_p,
760 &tegra_clk_m,
761};
762
763static const char *mux_pllp_plld_pllc_clkm[] = {
764 "pllp",
765 "pll_d_out0",
766 "pll_c",
767 "clk_m",
768};
769
770static struct clk *mux_pllp_plld_pllc_clkm_p[] = {
771 &tegra_pll_p,
772 &tegra_pll_d_out0,
773 &tegra_pll_c,
774 &tegra_clk_m,
775};
776
777static const char *mux_pllp_pllc_audio_clkm_clk32[] = {
778 "pll_p",
779 "pll_c",
780 "audio",
781 "clk_m",
782 "clk_32k",
783};
784
785static struct clk *mux_pllp_pllc_audio_clkm_clk32_p[] = {
786 &tegra_pll_p,
787 &tegra_pll_c,
788 &tegra_audio,
789 &tegra_clk_m,
790 &tegra_clk_32k,
791};
792
793static const char *mux_pllp_pllc_pllm[] = {
794 "pll_p",
795 "pll_c",
796 "pll_m"
797};
798
799static struct clk *mux_pllp_pllc_pllm_p[] = {
800 &tegra_pll_p,
801 &tegra_pll_c,
802 &tegra_pll_m,
803};
804
805static const char *mux_clk_m[] = {
806 "clk_m",
807};
808
809static struct clk *mux_clk_m_p[] = {
810 &tegra_clk_m,
811};
812
813static const char *mux_pllp_out3[] = {
814 "pll_p_out3",
815};
816
817static struct clk *mux_pllp_out3_p[] = {
818 &tegra_pll_p_out3,
819};
820
821static const char *mux_plld[] = {
822 "pll_d",
823};
824
825static struct clk *mux_plld_p[] = {
826 &tegra_pll_d,
827};
828
829static const char *mux_clk_32k[] = {
830 "clk_32k",
831};
832
833static struct clk *mux_clk_32k_p[] = {
834 &tegra_clk_32k,
835};
836
837static const char *mux_pclk[] = {
838 "pclk",
839};
840
841static struct clk *mux_pclk_p[] = {
842 &tegra_pclk,
843};
844
845static struct clk tegra_emc;
846static struct clk_tegra tegra_emc_hw = {
847 .hw = {
848 .clk = &tegra_emc,
849 },
850 .reg = 0x19c,
851 .max_rate = 800000000,
852 .flags = MUX | DIV_U71 | PERIPH_EMC_ENB,
853 .reset = &tegra2_periph_clk_reset,
854 .u.periph = {
855 .clk_num = 57,
856 },
857};
858DEFINE_CLK_TEGRA(emc, 0, &tegra_emc_clk_ops, 0, mux_pllm_pllc_pllp_clkm,
859 mux_pllm_pllc_pllp_clkm_p, NULL);
860
861#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, \
862 _max, _inputs, _flags) \
863 static struct clk tegra_##_name; \
864 static struct clk_tegra tegra_##_name##_hw = { \
865 .hw = { \
866 .clk = &tegra_##_name, \
867 }, \
868 .lookup = { \
869 .dev_id = _dev, \
870 .con_id = _con, \
871 }, \
872 .reg = _reg, \
873 .flags = _flags, \
874 .max_rate = _max, \
875 .u.periph = { \
876 .clk_num = _clk_num, \
877 }, \
878 .reset = tegra2_periph_clk_reset, \
879 }; \
880 static struct clk tegra_##_name = { \
881 .name = #_name, \
882 .ops = &tegra_periph_clk_ops, \
883 .hw = &tegra_##_name##_hw.hw, \
884 .parent_names = _inputs, \
885 .parents = _inputs##_p, \
886 .num_parents = ARRAY_SIZE(_inputs), \
887 };
888
889PERIPH_CLK(apbdma, "tegra-apbdma", NULL, 34, 0, 108000000, mux_pclk, 0);
890PERIPH_CLK(rtc, "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET);
891PERIPH_CLK(timer, "timer", NULL, 5, 0, 26000000, mux_clk_m, 0);
892PERIPH_CLK(i2s1, "tegra20-i2s.0", NULL, 11, 0x100, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
893PERIPH_CLK(i2s2, "tegra20-i2s.1", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
894PERIPH_CLK(spdif_out, "spdif_out", NULL, 10, 0x108, 100000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71);
895PERIPH_CLK(spdif_in, "spdif_in", NULL, 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71);
896PERIPH_CLK(pwm, "tegra-pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_audio_clkm_clk32, MUX | DIV_U71 | MUX_PWM);
897PERIPH_CLK(spi, "spi", NULL, 43, 0x114, 40000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
898PERIPH_CLK(xio, "xio", NULL, 45, 0x120, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
899PERIPH_CLK(twc, "twc", NULL, 16, 0x12c, 150000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
900PERIPH_CLK(sbc1, "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
901PERIPH_CLK(sbc2, "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
902PERIPH_CLK(sbc3, "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
903PERIPH_CLK(sbc4, "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
904PERIPH_CLK(ide, "ide", NULL, 25, 0x144, 100000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
905PERIPH_CLK(ndflash, "tegra_nand", NULL, 13, 0x160, 164000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
906PERIPH_CLK(vfir, "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
907PERIPH_CLK(sdmmc1, "sdhci-tegra.0", NULL, 14, 0x150, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
908PERIPH_CLK(sdmmc2, "sdhci-tegra.1", NULL, 9, 0x154, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
909PERIPH_CLK(sdmmc3, "sdhci-tegra.2", NULL, 69, 0x1bc, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
910PERIPH_CLK(sdmmc4, "sdhci-tegra.3", NULL, 15, 0x164, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
911PERIPH_CLK(vcp, "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0);
912PERIPH_CLK(bsea, "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0);
913PERIPH_CLK(bsev, "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0);
914PERIPH_CLK(vde, "tegra-avp", "vde", 61, 0x1c8, 250000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage and process_id */
915PERIPH_CLK(csite, "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* max rate ??? */
916/* FIXME: what is la? */
917PERIPH_CLK(la, "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
918PERIPH_CLK(owr, "tegra_w1", NULL, 71, 0x1cc, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71);
919PERIPH_CLK(nor, "nor", NULL, 42, 0x1d0, 92000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* requires min voltage */
920PERIPH_CLK(mipi, "mipi", NULL, 50, 0x174, 60000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71); /* scales with voltage */
921PERIPH_CLK(i2c1, "tegra-i2c.0", NULL, 12, 0x124, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
922PERIPH_CLK(i2c2, "tegra-i2c.1", NULL, 54, 0x198, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
923PERIPH_CLK(i2c3, "tegra-i2c.2", NULL, 67, 0x1b8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
924PERIPH_CLK(dvc, "tegra-i2c.3", NULL, 47, 0x128, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U16);
925PERIPH_CLK(i2c1_i2c, "tegra-i2c.0", "i2c", 0, 0, 72000000, mux_pllp_out3, 0);
926PERIPH_CLK(i2c2_i2c, "tegra-i2c.1", "i2c", 0, 0, 72000000, mux_pllp_out3, 0);
927PERIPH_CLK(i2c3_i2c, "tegra-i2c.2", "i2c", 0, 0, 72000000, mux_pllp_out3, 0);
928PERIPH_CLK(dvc_i2c, "tegra-i2c.3", "i2c", 0, 0, 72000000, mux_pllp_out3, 0);
929PERIPH_CLK(uarta, "tegra-uart.0", NULL, 6, 0x178, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
930PERIPH_CLK(uartb, "tegra-uart.1", NULL, 7, 0x17c, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
931PERIPH_CLK(uartc, "tegra-uart.2", NULL, 55, 0x1a0, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
932PERIPH_CLK(uartd, "tegra-uart.3", NULL, 65, 0x1c0, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
933PERIPH_CLK(uarte, "tegra-uart.4", NULL, 66, 0x1c4, 600000000, mux_pllp_pllc_pllm_clkm, MUX);
934PERIPH_CLK(3d, "3d", NULL, 24, 0x158, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_MANUAL_RESET); /* scales with voltage and process_id */
935PERIPH_CLK(2d, "2d", NULL, 21, 0x15c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
936PERIPH_CLK(vi, "tegra_camera", "vi", 20, 0x148, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
937PERIPH_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 */
938PERIPH_CLK(epp, "epp", NULL, 19, 0x16c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
939PERIPH_CLK(mpe, "mpe", NULL, 60, 0x170, 250000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
940PERIPH_CLK(host1x, "host1x", NULL, 28, 0x180, 166000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71); /* scales with voltage and process_id */
941PERIPH_CLK(cve, "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
942PERIPH_CLK(tvo, "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
943PERIPH_CLK(hdmi, "hdmi", NULL, 51, 0x18c, 600000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
944PERIPH_CLK(tvdac, "tvdac", NULL, 53, 0x194, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71); /* requires min voltage */
945PERIPH_CLK(disp1, "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_plld_pllc_clkm, MUX); /* scales with voltage and process_id */
946PERIPH_CLK(disp2, "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_plld_pllc_clkm, MUX); /* scales with voltage and process_id */
947PERIPH_CLK(usbd, "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
948PERIPH_CLK(usb2, "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
949PERIPH_CLK(usb3, "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0); /* requires min voltage */
950PERIPH_CLK(dsi, "dsi", NULL, 48, 0, 500000000, mux_plld, 0); /* scales with voltage */
951PERIPH_CLK(csi, "tegra_camera", "csi", 52, 0, 72000000, mux_pllp_out3, 0);
952PERIPH_CLK(isp, "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0); /* same frequency as VI */
953PERIPH_CLK(csus, "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET);
954PERIPH_CLK(pex, NULL, "pex", 70, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
955PERIPH_CLK(afi, NULL, "afi", 72, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
956PERIPH_CLK(pcie_xclk, NULL, "pcie_xclk", 74, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET);
957
958static struct clk *tegra_list_clks[] = {
959 &tegra_apbdma,
960 &tegra_rtc,
961 &tegra_i2s1,
962 &tegra_i2s2,
963 &tegra_spdif_out,
964 &tegra_spdif_in,
965 &tegra_pwm,
966 &tegra_spi,
967 &tegra_xio,
968 &tegra_twc,
969 &tegra_sbc1,
970 &tegra_sbc2,
971 &tegra_sbc3,
972 &tegra_sbc4,
973 &tegra_ide,
974 &tegra_ndflash,
975 &tegra_vfir,
976 &tegra_sdmmc1,
977 &tegra_sdmmc2,
978 &tegra_sdmmc3,
979 &tegra_sdmmc4,
980 &tegra_vcp,
981 &tegra_bsea,
982 &tegra_bsev,
983 &tegra_vde,
984 &tegra_csite,
985 &tegra_la,
986 &tegra_owr,
987 &tegra_nor,
988 &tegra_mipi,
989 &tegra_i2c1,
990 &tegra_i2c2,
991 &tegra_i2c3,
992 &tegra_dvc,
993 &tegra_i2c1_i2c,
994 &tegra_i2c2_i2c,
995 &tegra_i2c3_i2c,
996 &tegra_dvc_i2c,
997 &tegra_uarta,
998 &tegra_uartb,
999 &tegra_uartc,
1000 &tegra_uartd,
1001 &tegra_uarte,
1002 &tegra_3d,
1003 &tegra_2d,
1004 &tegra_vi,
1005 &tegra_vi_sensor,
1006 &tegra_epp,
1007 &tegra_mpe,
1008 &tegra_host1x,
1009 &tegra_cve,
1010 &tegra_tvo,
1011 &tegra_hdmi,
1012 &tegra_tvdac,
1013 &tegra_disp1,
1014 &tegra_disp2,
1015 &tegra_usbd,
1016 &tegra_usb2,
1017 &tegra_usb3,
1018 &tegra_dsi,
1019 &tegra_csi,
1020 &tegra_isp,
1021 &tegra_csus,
1022 &tegra_pex,
1023 &tegra_afi,
1024 &tegra_pcie_xclk,
1025};
1026
1027#define CLK_DUPLICATE(_name, _dev, _con) \
1028 { \
1029 .name = _name, \
1030 .lookup = { \
1031 .dev_id = _dev, \
1032 .con_id = _con, \
1033 }, \
1034 }
1035
1036/* Some clocks may be used by different drivers depending on the board
1037 * configuration. List those here to register them twice in the clock lookup
1038 * table under two names.
1039 */
1040static struct clk_duplicate tegra_clk_duplicates[] = {
1041 CLK_DUPLICATE("uarta", "serial8250.0", NULL),
1042 CLK_DUPLICATE("uartb", "serial8250.1", NULL),
1043 CLK_DUPLICATE("uartc", "serial8250.2", NULL),
1044 CLK_DUPLICATE("uartd", "serial8250.3", NULL),
1045 CLK_DUPLICATE("uarte", "serial8250.4", NULL),
1046 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
1047 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
1048 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
1049 CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
1050 CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
1051 CLK_DUPLICATE("host1x", "tegra_grhost", "host1x"),
1052 CLK_DUPLICATE("2d", "tegra_grhost", "gr2d"),
1053 CLK_DUPLICATE("3d", "tegra_grhost", "gr3d"),
1054 CLK_DUPLICATE("epp", "tegra_grhost", "epp"),
1055 CLK_DUPLICATE("mpe", "tegra_grhost", "mpe"),
1056 CLK_DUPLICATE("cop", "tegra-avp", "cop"),
1057 CLK_DUPLICATE("vde", "tegra-aes", "vde"),
1058 CLK_DUPLICATE("cclk", NULL, "cpu"),
1059 CLK_DUPLICATE("twd", "smp_twd", NULL),
1060};
1061
1062#define CLK(dev, con, ck) \
1063 { \
1064 .dev_id = dev, \
1065 .con_id = con, \
1066 .clk = ck, \
1067 }
1068
1069static struct clk *tegra_ptr_clks[] = {
1070 &tegra_clk_32k,
1071 &tegra_pll_s,
1072 &tegra_clk_m,
1073 &tegra_pll_m,
1074 &tegra_pll_m_out1,
1075 &tegra_pll_c,
1076 &tegra_pll_c_out1,
1077 &tegra_pll_p,
1078 &tegra_pll_p_out1,
1079 &tegra_pll_p_out2,
1080 &tegra_pll_p_out3,
1081 &tegra_pll_p_out4,
1082 &tegra_pll_a,
1083 &tegra_pll_a_out0,
1084 &tegra_pll_d,
1085 &tegra_pll_d_out0,
1086 &tegra_pll_u,
1087 &tegra_pll_x,
1088 &tegra_pll_e,
1089 &tegra_cclk,
1090 &tegra_clk_twd,
1091 &tegra_sclk,
1092 &tegra_hclk,
1093 &tegra_pclk,
1094 &tegra_clk_d,
1095 &tegra_cdev1,
1096 &tegra_cdev2,
1097 &tegra_blink,
1098 &tegra_cop,
1099 &tegra_emc,
1100};
1101
1102static void tegra2_init_one_clock(struct clk *c)
1103{
1104 struct clk_tegra *clk = to_clk_tegra(c->hw);
1105 int ret;
1106
1107 ret = __clk_init(NULL, c);
1108 if (ret)
1109 pr_err("clk init failed %s\n", __clk_get_name(c));
1110
1111 INIT_LIST_HEAD(&clk->shared_bus_list);
1112 if (!clk->lookup.dev_id && !clk->lookup.con_id)
1113 clk->lookup.con_id = c->name;
1114 clk->lookup.clk = c;
1115 clkdev_add(&clk->lookup);
1116 tegra_clk_add(c);
1117}
1118
1119void __init tegra2_init_clocks(void)
1120{
1121 int i;
1122 struct clk *c;
1123
1124 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
1125 tegra2_init_one_clock(tegra_ptr_clks[i]);
1126
1127 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
1128 tegra2_init_one_clock(tegra_list_clks[i]);
1129
1130 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
1131 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
1132 if (!c) {
1133 pr_err("%s: Unknown duplicate clock %s\n", __func__,
1134 tegra_clk_duplicates[i].name);
1135 continue;
1136 }
1137
1138 tegra_clk_duplicates[i].lookup.clk = c;
1139 clkdev_add(&tegra_clk_duplicates[i].lookup);
1140 }
1141
1142 init_audio_sync_clock_mux();
1143 tegra20_cpu_car_ops_init();
1144}
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
deleted file mode 100644
index a703844b2061..000000000000
--- 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 6674f100e16f..5cd502c27163 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 000000000000..f2f88fef6b8b
--- /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 000000000000..c10449603df0
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra30_clocks_data.c
@@ -0,0 +1,1372 @@
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", NULL, 12, 0x124, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1075PERIPH_CLK(i2c2, "tegra-i2c.1", NULL, 54, 0x198, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1076PERIPH_CLK(i2c3, "tegra-i2c.2", NULL, 67, 0x1b8, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1077PERIPH_CLK(i2c4, "tegra-i2c.3", NULL, 103, 0x3c4, 26000000, mux_pllp_clkm, MUX | DIV_U16 | PERIPH_ON_APB);
1078PERIPH_CLK(i2c5, "tegra-i2c.4", NULL, 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};
1291
1292struct clk *tegra_ptr_clks[] = {
1293 &tegra_clk_32k,
1294 &tegra_clk_m,
1295 &tegra_clk_m_div2,
1296 &tegra_clk_m_div4,
1297 &tegra_pll_ref,
1298 &tegra_pll_m,
1299 &tegra_pll_m_out1,
1300 &tegra_pll_c,
1301 &tegra_pll_c_out1,
1302 &tegra_pll_p,
1303 &tegra_pll_p_out1,
1304 &tegra_pll_p_out2,
1305 &tegra_pll_p_out3,
1306 &tegra_pll_p_out4,
1307 &tegra_pll_a,
1308 &tegra_pll_a_out0,
1309 &tegra_pll_d,
1310 &tegra_pll_d_out0,
1311 &tegra_pll_d2,
1312 &tegra_pll_d2_out0,
1313 &tegra_pll_u,
1314 &tegra_pll_x,
1315 &tegra_pll_x_out0,
1316 &tegra_pll_e,
1317 &tegra_clk_cclk_g,
1318 &tegra_cml0,
1319 &tegra_cml1,
1320 &tegra_pciex,
1321 &tegra_clk_sclk,
1322 &tegra_clk_blink,
1323 &tegra30_clk_twd,
1324};
1325
1326static void tegra30_init_one_clock(struct clk *c)
1327{
1328 struct clk_tegra *clk = to_clk_tegra(c->hw);
1329 __clk_init(NULL, c);
1330 INIT_LIST_HEAD(&clk->shared_bus_list);
1331 if (!clk->lookup.dev_id && !clk->lookup.con_id)
1332 clk->lookup.con_id = c->name;
1333 clk->lookup.clk = c;
1334 clkdev_add(&clk->lookup);
1335 tegra_clk_add(c);
1336}
1337
1338void __init tegra30_init_clocks(void)
1339{
1340 int i;
1341 struct clk *c;
1342
1343 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
1344 tegra30_init_one_clock(tegra_ptr_clks[i]);
1345
1346 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
1347 tegra30_init_one_clock(tegra_list_clks[i]);
1348
1349 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
1350 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
1351 if (!c) {
1352 pr_err("%s: Unknown duplicate clock %s\n", __func__,
1353 tegra_clk_duplicates[i].name);
1354 continue;
1355 }
1356
1357 tegra_clk_duplicates[i].lookup.clk = c;
1358 clkdev_add(&tegra_clk_duplicates[i].lookup);
1359 }
1360
1361 for (i = 0; i < ARRAY_SIZE(tegra_sync_source_list); i++)
1362 tegra30_init_one_clock(tegra_sync_source_list[i]);
1363 for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_list); i++)
1364 tegra30_init_one_clock(tegra_clk_audio_list[i]);
1365 for (i = 0; i < ARRAY_SIZE(tegra_clk_audio_2x_list); i++)
1366 tegra30_init_one_clock(tegra_clk_audio_2x_list[i]);
1367
1368 for (i = 0; i < ARRAY_SIZE(tegra_clk_out_list); i++)
1369 tegra30_init_one_clock(tegra_clk_out_list[i]);
1370
1371 tegra30_cpu_car_ops_init();
1372}
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 000000000000..30d063ad2bef
--- /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-u300/Kconfig b/arch/arm/mach-u300/Kconfig
index 54d8f34fdee5..f7e12ede008c 100644
--- a/arch/arm/mach-u300/Kconfig
+++ b/arch/arm/mach-u300/Kconfig
@@ -1,6 +1,6 @@
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
@@ -10,46 +10,7 @@ config MACH_U300
10 select PINCTRL_U300 10 select PINCTRL_U300
11 select PINCTRL_COH901 11 select PINCTRL_COH901
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 7e47d37aeb0e..5a86c58da396 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 03acf1883ec7..ef6f602b7e48 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,
@@ -1651,7 +1603,7 @@ static struct platform_device *platform_devs[] __initdata = {
1651 * together so some interrupts are connected to the first one and some 1603 * together so some interrupts are connected to the first one and some
1652 * to the second one. 1604 * to the second one.
1653 */ 1605 */
1654void __init u300_init_irq(void) 1606static void __init u300_init_irq(void)
1655{ 1607{
1656 u32 mask[2] = {0, 0}; 1608 u32 mask[2] = {0, 0};
1657 struct clk *clk; 1609 struct clk *clk;
@@ -1756,29 +1708,11 @@ static void __init u300_init_check_chip(void)
1756 printk(KERN_INFO "Initializing U300 system on %s baseband chip " \ 1708 printk(KERN_INFO "Initializing U300 system on %s baseband chip " \
1757 "(chip ID 0x%04x)\n", chipname, val); 1709 "(chip ID 0x%04x)\n", chipname, val);
1758 1710
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) { 1711 if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) {
1768 printk(KERN_ERR "Platform configured for BS335 " \ 1712 printk(KERN_ERR "Platform configured for BS335 " \
1769 " with DB3350 but %s detected, expect problems!", 1713 " with DB3350 but %s detected, expect problems!",
1770 chipname); 1714 chipname);
1771 } 1715 }
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} 1716}
1783 1717
1784/* 1718/*
@@ -1811,7 +1745,7 @@ static void __init u300_assign_physmem(void)
1811 } 1745 }
1812} 1746}
1813 1747
1814void __init u300_init_devices(void) 1748static void __init u300_init_machine(void)
1815{ 1749{
1816 int i; 1750 int i;
1817 u16 val; 1751 u16 val;
@@ -1852,7 +1786,7 @@ void __init u300_init_devices(void)
1852/* Forward declare this function from the watchdog */ 1786/* Forward declare this function from the watchdog */
1853void coh901327_watchdog_reset(void); 1787void coh901327_watchdog_reset(void);
1854 1788
1855void u300_restart(char mode, const char *cmd) 1789static void u300_restart(char mode, const char *cmd)
1856{ 1790{
1857 switch (mode) { 1791 switch (mode) {
1858 case 's': 1792 case 's':
@@ -1868,3 +1802,15 @@ void u300_restart(char mode, const char *cmd)
1868 /* Wait for system do die/reset. */ 1802 /* Wait for system do die/reset. */
1869 while (1); 1803 while (1);
1870} 1804}
1805
1806MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board")
1807 /* Maintainer: Linus Walleij <linus.walleij@stericsson.com> */
1808 .atag_offset = 0x100,
1809 .map_io = u300_map_io,
1810 .nr_irqs = NR_IRQS_U300,
1811 .init_irq = u300_init_irq,
1812 .handle_irq = vic_handle_irq,
1813 .timer = &u300_timer,
1814 .init_machine = u300_init_machine,
1815 .restart = u300_restart,
1816MACHINE_END
diff --git a/arch/arm/mach-u300/include/mach/dma_channels.h b/arch/arm/mach-u300/dma_channels.h
index b239149ba0d0..4e8a88fbca49 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 cb04bd6ab3e7..0d4620ed853c 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
@@ -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 92e3cc872c66..000000000000
--- 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.h b/arch/arm/mach-u300/include/mach/gpio.h
deleted file mode 100644
index 40a8c178f10d..000000000000
--- 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 ec09c1e07b1a..e27425a63fa1 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 096333f32fc3..000000000000
--- 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 6e84f07a7c6f..10bdd0be9774 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 65f87c523892..1e49d901f2c9 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 a1affacfa59c..02e6659286d5 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 56ac06d38ec1..1da10e20e996 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 000000000000..b5e9791762e0
--- /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 847dc25300c6..83f50772e169 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 f30c69d91d99..000000000000
--- 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 53d3d46dec12..a258996d954b 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -11,6 +11,7 @@ config UX500_SOC_COMMON
11 select CACHE_L2X0 11 select CACHE_L2X0
12 select PINCTRL 12 select PINCTRL
13 select PINCTRL_NOMADIK 13 select PINCTRL_NOMADIK
14 select COMMON_CLK
14 15
15config UX500_SOC_DB8500 16config UX500_SOC_DB8500
16 bool 17 bool
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 026086ff9e6c..5691ef679d01 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
diff --git a/arch/arm/mach-ux500/Makefile.boot b/arch/arm/mach-ux500/Makefile.boot
index dd5cd00e2554..760a0efe7580 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.c b/arch/arm/mach-ux500/board-mop500.c
index 1d2e3c6f8b59..7ebfcc7d7515 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -48,7 +48,7 @@
48#include <mach/setup.h> 48#include <mach/setup.h>
49#include <mach/devices.h> 49#include <mach/devices.h>
50#include <mach/irqs.h> 50#include <mach/irqs.h>
51#include <mach/crypto-ux500.h> 51#include <linux/platform_data/crypto-ux500.h>
52 52
53#include "ste-dma40-db8500.h" 53#include "ste-dma40-db8500.h"
54#include "devices-db8500.h" 54#include "devices-db8500.h"
@@ -673,6 +673,7 @@ static void __init hrefv60_init_machine(void)
673MACHINE_START(U8500, "ST-Ericsson MOP500 platform") 673MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
674 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */ 674 /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
675 .atag_offset = 0x100, 675 .atag_offset = 0x100,
676 .smp = smp_ops(ux500_smp_ops),
676 .map_io = u8500_map_io, 677 .map_io = u8500_map_io,
677 .init_irq = ux500_init_irq, 678 .init_irq = ux500_init_irq,
678 /* we re-use nomadik timer here */ 679 /* we re-use nomadik timer here */
@@ -684,6 +685,7 @@ MACHINE_END
684 685
685MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") 686MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
686 .atag_offset = 0x100, 687 .atag_offset = 0x100,
688 .smp = smp_ops(ux500_smp_ops),
687 .map_io = u8500_map_io, 689 .map_io = u8500_map_io,
688 .init_irq = ux500_init_irq, 690 .init_irq = ux500_init_irq,
689 .timer = &ux500_timer, 691 .timer = &ux500_timer,
@@ -694,6 +696,7 @@ MACHINE_END
694 696
695MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") 697MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
696 .atag_offset = 0x100, 698 .atag_offset = 0x100,
699 .smp = smp_ops(ux500_smp_ops),
697 .map_io = u8500_map_io, 700 .map_io = u8500_map_io,
698 .init_irq = ux500_init_irq, 701 .init_irq = ux500_init_irq,
699 /* we re-use nomadik timer here */ 702 /* we re-use nomadik timer here */
@@ -823,6 +826,7 @@ static const char * u8500_dt_board_compat[] = {
823 826
824 827
825DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)") 828DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
829 .smp = smp_ops(ux500_smp_ops),
826 .map_io = u8500_map_io, 830 .map_io = u8500_map_io,
827 .init_irq = ux500_init_irq, 831 .init_irq = ux500_init_irq,
828 /* we re-use nomadik timer here */ 832 /* we re-use nomadik timer here */
diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c
index dc12394295d5..75d5b512a3d5 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 8d73b066a18d..000000000000
--- 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 65d27a13f46d..000000000000
--- 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 db3c52d56ca4..aef2c68e9ec1 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -19,12 +19,11 @@
19#include <linux/mfd/abx500/ab8500.h> 19#include <linux/mfd/abx500/ab8500.h>
20 20
21#include <asm/mach/map.h> 21#include <asm/mach/map.h>
22#include <asm/pmu.h>
23#include <plat/gpio-nomadik.h> 22#include <plat/gpio-nomadik.h>
24#include <mach/hardware.h> 23#include <mach/hardware.h>
25#include <mach/setup.h> 24#include <mach/setup.h>
26#include <mach/devices.h> 25#include <mach/devices.h>
27#include <mach/usb.h> 26#include <linux/platform_data/usb-musb-ux500.h>
28#include <mach/db8500-regs.h> 27#include <mach/db8500-regs.h>
29 28
30#include "devices-db8500.h" 29#include "devices-db8500.h"
@@ -80,7 +79,7 @@ void __init u8500_map_io(void)
80 79
81 iotable_init(u8500_common_io_desc, ARRAY_SIZE(u8500_common_io_desc)); 80 iotable_init(u8500_common_io_desc, ARRAY_SIZE(u8500_common_io_desc));
82 81
83 if (cpu_is_u9540()) 82 if (cpu_is_ux540_family())
84 iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc)); 83 iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc));
85 else 84 else
86 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); 85 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
@@ -122,7 +121,7 @@ struct arm_pmu_platdata db8500_pmu_platdata = {
122 121
123static struct platform_device db8500_pmu_device = { 122static struct platform_device db8500_pmu_device = {
124 .name = "arm-pmu", 123 .name = "arm-pmu",
125 .id = ARM_PMU_DEVICE_CPU, 124 .id = -1,
126 .num_resources = ARRAY_SIZE(db8500_pmu_resources), 125 .num_resources = ARRAY_SIZE(db8500_pmu_resources),
127 .resource = db8500_pmu_resources, 126 .resource = db8500_pmu_resources,
128 .dev.platform_data = &db8500_pmu_platdata, 127 .dev.platform_data = &db8500_pmu_platdata,
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index e2360e7c770d..3d62c64c84c4 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,7 @@ 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 if (cpu_is_u8500_family() || cpu_is_ux540_family()) {
55 dist_base = __io_address(U8500_GIC_DIST_BASE); 53 dist_base = __io_address(U8500_GIC_DIST_BASE);
56 cpu_base = __io_address(U8500_GIC_CPU_BASE); 54 cpu_base = __io_address(U8500_GIC_CPU_BASE);
57 } else 55 } else
@@ -70,13 +68,17 @@ void __init ux500_init_irq(void)
70 */ 68 */
71 if (cpu_is_u8500_family()) 69 if (cpu_is_u8500_family())
72 db8500_prcmu_early_init(); 70 db8500_prcmu_early_init();
73 clk_init(); 71
72 if (cpu_is_u8500_family())
73 u8500_clk_init();
74 else if (cpu_is_u9540())
75 u9540_clk_init();
76 else if (cpu_is_u8540())
77 u8540_clk_init();
74} 78}
75 79
76void __init ux500_init_late(void) 80void __init ux500_init_late(void)
77{ 81{
78 clk_debugfs_init();
79 clk_init_smp_twd_cpufreq();
80} 82}
81 83
82static const char * __init ux500_get_machine(void) 84static 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 ecdd8386cffb..7fbf0ba336e1 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 c76f0f456f04..2f6af259015d 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/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h
deleted file mode 100644
index c01ef66537f3..000000000000
--- 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 c6e2db9e9e51..9c42642ab168 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/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index 7914e5eaa9c7..6be4c4d2ab88 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/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index da1d5ad5bd45..3db7782f3afb 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 66e7f00884ab..6f39731951b0 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 a74af389bc63..145482e74418 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/core.c b/arch/arm/mach-versatile/core.c
index cd8ea3588f93..ca7902c6ed18 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -169,11 +169,6 @@ static struct map_desc versatile_io_desc[] __initdata = {
169 .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE), 169 .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE),
170 .length = VERSATILE_PCI_CFG_BASE_SIZE, 170 .length = VERSATILE_PCI_CFG_BASE_SIZE,
171 .type = MT_DEVICE 171 .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 }, 172 },
178#endif 173#endif
179}; 174};
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 40a8c178f10d..000000000000
--- 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 408e58da46c6..3e5d425e2a92 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/pci.c b/arch/arm/mach-versatile/pci.c
index e95bf84cc837..2f84f4094f13 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 fc3730f01650..c95296066203 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 90551b9780ab..42703e8b4d3b 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 318d308dfb93..000000000000
--- a/arch/arm/mach-vexpress/Makefile.boot
+++ /dev/null
@@ -1,10 +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
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index a3a4980770bd..f134cd4a85f1 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 61c492403b05..4f471fa3e3c5 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 c504a72b94d6..a141b98d84fe 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 40a8c178f10d..000000000000
--- 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 4b10ee7657a6..f8f7f782eb55 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 00029bacd43c..000000000000
--- 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 1e472eb0bbdc..000000000000
--- 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 14ba1128ae8d..7db27c8c05cc 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 37608f22ee31..5f6b7d543e55 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),
@@ -663,6 +664,7 @@ const static char *v2m_dt_match[] __initconst = {
663 664
664DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") 665DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express")
665 .dt_compat = v2m_dt_match, 666 .dt_compat = v2m_dt_match,
667 .smp = smp_ops(vexpress_smp_ops),
666 .map_io = v2m_dt_map_io, 668 .map_io = v2m_dt_map_io,
667 .init_early = v2m_dt_init_early, 669 .init_early = v2m_dt_init_early,
668 .init_irq = v2m_dt_init_irq, 670 .init_irq = v2m_dt_init_irq,
@@ -671,5 +673,3 @@ DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express")
671 .handle_irq = gic_handle_irq, 673 .handle_irq = gic_handle_irq,
672 .restart = v2m_restart, 674 .restart = v2m_restart,
673MACHINE_END 675MACHINE_END
674
675#endif
diff --git a/arch/arm/mach-vt8500/devices.c b/arch/arm/mach-vt8500/devices.c
index 1fcdc36b358d..82b4bcedffba 100644
--- a/arch/arm/mach-vt8500/devices.c
+++ b/arch/arm/mach-vt8500/devices.c
@@ -23,7 +23,7 @@
23 23
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25 25
26#include <mach/vt8500fb.h> 26#include <linux/platform_data/video-vt8500lcdfb.h>
27#include <mach/i8042.h> 27#include <mach/i8042.h>
28#include "devices.h" 28#include "devices.h"
29 29
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 40a8c178f10d..000000000000
--- a/arch/arm/mach-vt8500/include/mach/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c
index 48f5b9fdfb7f..7abdb9645c5b 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/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c
index 067d8f9166dc..500fe5932ce9 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/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
index 23a7643e9a87..1be0f4e5e6eb 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/ioremap.c b/arch/arm/mm/ioremap.c
index 566750fa57d4..9d869f93a3da 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,
@@ -383,3 +384,16 @@ void __arm_iounmap(volatile void __iomem *io_addr)
383 arch_iounmap(io_addr); 384 arch_iounmap(io_addr);
384} 385}
385EXPORT_SYMBOL(__arm_iounmap); 386EXPORT_SYMBOL(__arm_iounmap);
387
388#ifdef CONFIG_PCI
389int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
390{
391 BUG_ON(offset + SZ_64K > IO_SPACE_LIMIT);
392
393 return ioremap_page_range(PCI_IO_VIRT_BASE + offset,
394 PCI_IO_VIRT_BASE + offset + SZ_64K,
395 phys_addr,
396 __pgprot(get_mem_type(MT_DEVICE)->prot_pte));
397}
398EXPORT_SYMBOL_GPL(pci_ioremap_io);
399#endif
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index c2fa21d0103e..18144e6a3115 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,
@@ -777,14 +778,27 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
777 create_mapping(md); 778 create_mapping(md);
778 vm->addr = (void *)(md->virtual & PAGE_MASK); 779 vm->addr = (void *)(md->virtual & PAGE_MASK);
779 vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK)); 780 vm->size = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
780 vm->phys_addr = __pfn_to_phys(md->pfn); 781 vm->phys_addr = __pfn_to_phys(md->pfn);
781 vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING; 782 vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
782 vm->flags |= VM_ARM_MTYPE(md->type); 783 vm->flags |= VM_ARM_MTYPE(md->type);
783 vm->caller = iotable_init; 784 vm->caller = iotable_init;
784 vm_area_add_early(vm++); 785 vm_area_add_early(vm++);
785 } 786 }
786} 787}
787 788
789void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
790 void *caller)
791{
792 struct vm_struct *vm;
793
794 vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));
795 vm->addr = (void *)addr;
796 vm->size = size;
797 vm->flags = VM_IOREMAP | VM_ARM_EMPTY_MAPPING;
798 vm->caller = caller;
799 vm_area_add_early(vm);
800}
801
788#ifndef CONFIG_ARM_LPAE 802#ifndef CONFIG_ARM_LPAE
789 803
790/* 804/*
@@ -802,14 +816,7 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
802 816
803static void __init pmd_empty_section_gap(unsigned long addr) 817static void __init pmd_empty_section_gap(unsigned long addr)
804{ 818{
805 struct vm_struct *vm; 819 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_EMPTY_MAPPING;
811 vm->caller = pmd_empty_section_gap;
812 vm_area_add_early(vm);
813} 820}
814 821
815static void __init fill_pmd_gaps(void) 822static void __init fill_pmd_gaps(void)
@@ -858,6 +865,28 @@ static void __init fill_pmd_gaps(void)
858#define fill_pmd_gaps() do { } while (0) 865#define fill_pmd_gaps() do { } while (0)
859#endif 866#endif
860 867
868#if defined(CONFIG_PCI) && !defined(CONFIG_NEED_MACH_IO_H)
869static void __init pci_reserve_io(void)
870{
871 struct vm_struct *vm;
872 unsigned long addr;
873
874 /* we're still single threaded hence no lock needed here */
875 for (vm = vmlist; vm; vm = vm->next) {
876 if (!(vm->flags & VM_ARM_STATIC_MAPPING))
877 continue;
878 addr = (unsigned long)vm->addr;
879 addr &= ~(SZ_2M - 1);
880 if (addr == PCI_IO_VIRT_BASE)
881 return;
882
883 }
884 vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io);
885}
886#else
887#define pci_reserve_io() do { } while (0)
888#endif
889
861static void * __initdata vmalloc_min = 890static void * __initdata vmalloc_min =
862 (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET); 891 (void *)(VMALLOC_END - (240 << 20) - VMALLOC_OFFSET);
863 892
@@ -1141,6 +1170,9 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
1141 mdesc->map_io(); 1170 mdesc->map_io();
1142 fill_pmd_gaps(); 1171 fill_pmd_gaps();
1143 1172
1173 /* Reserve fixed i/o space in VMALLOC region */
1174 pci_reserve_io();
1175
1144 /* 1176 /*
1145 * Finally flush the caches and tlb to ensure that we're in a 1177 * Finally flush the caches and tlb to ensure that we're in a
1146 * consistent state wrt the writebuffer. This also ensures that 1178 * consistent state wrt the writebuffer. This also ensures that
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c
index 8daae9b230ea..362474b5c40d 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 a2024b8685a1..ad9f9744a82d 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 bade586fed0f..5b217f460f18 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/Makefile b/arch/arm/plat-mxc/Makefile
index 6ac720031150..149237e24850 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 5079787273d2..000000000000
--- 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 73db34bf588a..b5b6f8083130 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/platform-imx-uart.c b/arch/arm/plat-mxc/devices/platform-imx-uart.c
index 2020d84956c3..d390f00bd294 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-sdhci-esdhc-imx.c b/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
index 5955f5da82ee..3793e475cd95 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 bd940c795cbb..000000000000
--- 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 7128e9710417..ead901814c0d 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 a7f5bb1084d7..9e3e3d8ae8c2 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;
@@ -98,7 +98,7 @@ struct imx_imxdi_rtc_data {
98struct platform_device *__init imx_add_imxdi_rtc( 98struct platform_device *__init imx_add_imxdi_rtc(
99 const struct imx_imxdi_rtc_data *data); 99 const struct imx_imxdi_rtc_data *data);
100 100
101#include <mach/imxfb.h> 101#include <linux/platform_data/video-imxfb.h>
102struct imx_imx_fb_data { 102struct imx_imx_fb_data {
103 resource_size_t iobase; 103 resource_size_t iobase;
104 resource_size_t iosize; 104 resource_size_t iosize;
@@ -108,7 +108,7 @@ struct platform_device *__init imx_add_imx_fb(
108 const struct imx_imx_fb_data *data, 108 const struct imx_imx_fb_data *data,
109 const struct imx_fb_platform_data *pdata); 109 const struct imx_fb_platform_data *pdata);
110 110
111#include <mach/i2c.h> 111#include <linux/platform_data/i2c-imx.h>
112struct imx_imx_i2c_data { 112struct imx_imx_i2c_data {
113 int id; 113 int id;
114 resource_size_t iobase; 114 resource_size_t iobase;
@@ -129,7 +129,7 @@ struct platform_device *__init imx_add_imx_keypad(
129 const struct imx_imx_keypad_data *data, 129 const struct imx_imx_keypad_data *data,
130 const struct matrix_keymap_data *pdata); 130 const struct matrix_keymap_data *pdata);
131 131
132#include <mach/ssi.h> 132#include <linux/platform_data/asoc-imx-ssi.h>
133struct imx_imx_ssi_data { 133struct imx_imx_ssi_data {
134 int id; 134 int id;
135 resource_size_t iobase; 135 resource_size_t iobase;
@@ -144,7 +144,7 @@ struct platform_device *__init imx_add_imx_ssi(
144 const struct imx_imx_ssi_data *data, 144 const struct imx_imx_ssi_data *data,
145 const struct imx_ssi_platform_data *pdata); 145 const struct imx_ssi_platform_data *pdata);
146 146
147#include <mach/imx-uart.h> 147#include <linux/platform_data/serial-imx.h>
148struct imx_imx_uart_3irq_data { 148struct imx_imx_uart_3irq_data {
149 int id; 149 int id;
150 resource_size_t iobase; 150 resource_size_t iobase;
@@ -167,7 +167,7 @@ struct platform_device *__init imx_add_imx_uart_1irq(
167 const struct imx_imx_uart_1irq_data *data, 167 const struct imx_imx_uart_1irq_data *data,
168 const struct imxuart_platform_data *pdata); 168 const struct imxuart_platform_data *pdata);
169 169
170#include <mach/usb.h> 170#include <linux/platform_data/usb-imx_udc.h>
171struct imx_imx_udc_data { 171struct imx_imx_udc_data {
172 resource_size_t iobase; 172 resource_size_t iobase;
173 resource_size_t iosize; 173 resource_size_t iosize;
@@ -183,8 +183,8 @@ struct platform_device *__init imx_add_imx_udc(
183 const struct imx_imx_udc_data *data, 183 const struct imx_imx_udc_data *data,
184 const struct imxusb_platform_data *pdata); 184 const struct imxusb_platform_data *pdata);
185 185
186#include <mach/mx3fb.h> 186#include <linux/platform_data/video-mx3fb.h>
187#include <mach/mx3_camera.h> 187#include <linux/platform_data/camera-mx3.h>
188struct imx_ipu_core_data { 188struct imx_ipu_core_data {
189 resource_size_t iobase; 189 resource_size_t iobase;
190 resource_size_t synirq; 190 resource_size_t synirq;
@@ -199,7 +199,7 @@ struct platform_device *__init imx_add_mx3_sdc_fb(
199 const struct imx_ipu_core_data *data, 199 const struct imx_ipu_core_data *data,
200 struct mx3fb_platform_data *pdata); 200 struct mx3fb_platform_data *pdata);
201 201
202#include <mach/mx1_camera.h> 202#include <linux/platform_data/camera-mx1.h>
203struct imx_mx1_camera_data { 203struct imx_mx1_camera_data {
204 resource_size_t iobase; 204 resource_size_t iobase;
205 resource_size_t iosize; 205 resource_size_t iosize;
@@ -209,7 +209,7 @@ struct platform_device *__init imx_add_mx1_camera(
209 const struct imx_mx1_camera_data *data, 209 const struct imx_mx1_camera_data *data,
210 const struct mx1_camera_pdata *pdata); 210 const struct mx1_camera_pdata *pdata);
211 211
212#include <mach/mx2_cam.h> 212#include <linux/platform_data/camera-mx2.h>
213struct imx_mx2_camera_data { 213struct imx_mx2_camera_data {
214 resource_size_t iobasecsi; 214 resource_size_t iobasecsi;
215 resource_size_t iosizecsi; 215 resource_size_t iosizecsi;
@@ -224,7 +224,7 @@ struct platform_device *__init imx_add_mx2_camera(
224struct platform_device *__init imx_add_mx2_emmaprp( 224struct platform_device *__init imx_add_mx2_emmaprp(
225 const struct imx_mx2_camera_data *data); 225 const struct imx_mx2_camera_data *data);
226 226
227#include <mach/mxc_ehci.h> 227#include <linux/platform_data/usb-ehci-mxc.h>
228struct imx_mxc_ehci_data { 228struct imx_mxc_ehci_data {
229 int id; 229 int id;
230 resource_size_t iobase; 230 resource_size_t iobase;
@@ -234,7 +234,7 @@ struct platform_device *__init imx_add_mxc_ehci(
234 const struct imx_mxc_ehci_data *data, 234 const struct imx_mxc_ehci_data *data,
235 const struct mxc_usbh_platform_data *pdata); 235 const struct mxc_usbh_platform_data *pdata);
236 236
237#include <mach/mmc.h> 237#include <linux/platform_data/mmc-mxcmmc.h>
238struct imx_mxc_mmc_data { 238struct imx_mxc_mmc_data {
239 int id; 239 int id;
240 resource_size_t iobase; 240 resource_size_t iobase;
@@ -246,7 +246,7 @@ struct platform_device *__init imx_add_mxc_mmc(
246 const struct imx_mxc_mmc_data *data, 246 const struct imx_mxc_mmc_data *data,
247 const struct imxmmc_platform_data *pdata); 247 const struct imxmmc_platform_data *pdata);
248 248
249#include <mach/mxc_nand.h> 249#include <linux/platform_data/mtd-mxc_nand.h>
250struct imx_mxc_nand_data { 250struct imx_mxc_nand_data {
251 /* 251 /*
252 * id is traditionally 0, but -1 is more appropriate. We use -1 for new 252 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
@@ -295,7 +295,7 @@ struct imx_mxc_w1_data {
295struct platform_device *__init imx_add_mxc_w1( 295struct platform_device *__init imx_add_mxc_w1(
296 const struct imx_mxc_w1_data *data); 296 const struct imx_mxc_w1_data *data);
297 297
298#include <mach/esdhc.h> 298#include <linux/platform_data/mmc-esdhc-imx.h>
299struct imx_sdhci_esdhc_imx_data { 299struct imx_sdhci_esdhc_imx_data {
300 const char *devid; 300 const char *devid;
301 int id; 301 int id;
@@ -306,7 +306,7 @@ struct platform_device *__init imx_add_sdhci_esdhc_imx(
306 const struct imx_sdhci_esdhc_imx_data *data, 306 const struct imx_sdhci_esdhc_imx_data *data,
307 const struct esdhc_platform_data *pdata); 307 const struct esdhc_platform_data *pdata);
308 308
309#include <mach/spi.h> 309#include <linux/platform_data/spi-imx.h>
310struct imx_spi_imx_data { 310struct imx_spi_imx_data {
311 const char *devid; 311 const char *devid;
312 int id; 312 int id;
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 40a8c178f10d..000000000000
--- 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/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index d8b65b51f2a9..f79f78a1c0ed 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 9761e003bde2..000000000000
--- 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/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index dbced61d9fda..ee9b1f9215df 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/ssi-fiq-ksym.c b/arch/arm/plat-mxc/ssi-fiq-ksym.c
index b5fad454da78..792090f9a032 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 8397a2dd19f2..a8b93c5f29b5 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 1996c3e3b8fe..3da78cfc5a94 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-omap/Makefile b/arch/arm/plat-omap/Makefile
index a017e994e006..dacaee009a4e 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := common.o sram.o clock.o dma.o mux.o fb.o counter_32k.o 6obj-y := common.o sram.o clock.o dma.o fb.o counter_32k.o
7obj-m := 7obj-m :=
8obj-n := 8obj-n :=
9obj- := 9obj- :=
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index e5778ed689d8..111315a69354 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -18,7 +18,7 @@
18 18
19#include <plat/common.h> 19#include <plat/common.h>
20#include <plat/vram.h> 20#include <plat/vram.h>
21#include <plat/dsp.h> 21#include <linux/platform_data/dsp-omap.h>
22#include <plat/dma.h> 22#include <plat/dma.h>
23 23
24#include <plat/omap-secure.h> 24#include <plat/omap-secure.h>
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 40bc06a7ac43..6013831a043e 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -32,7 +32,6 @@
32#include <linux/clk.h> 32#include <linux/clk.h>
33 33
34#include <mach/irqs.h> 34#include <mach/irqs.h>
35#include <plat/mux.h>
36#include <plat/i2c.h> 35#include <plat/i2c.h>
37#include <plat/omap-pm.h> 36#include <plat/omap-pm.h>
38#include <plat/omap_device.h> 37#include <plat/omap_device.h>
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index a531149823bb..b2eac60b6904 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -21,8 +21,6 @@
21#include <linux/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/*
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 27bcc2441195..106f50665804 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;
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 09e14ce3ec57..b3349f7b1a2c 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -630,6 +630,7 @@ int omap_hwmod_softreset(struct omap_hwmod *oh);
630 630
631int omap_hwmod_count_resources(struct omap_hwmod *oh); 631int omap_hwmod_count_resources(struct omap_hwmod *oh);
632int 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);
633int 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,
634 const char *name, struct resource *res); 635 const char *name, struct resource *res);
635 636
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 1eb4dc326979..000000000000
--- 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/mux.c b/arch/arm/plat-omap/mux.c
deleted file mode 100644
index fd0d3aad00ef..000000000000
--- 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 = &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_device.c b/arch/arm/plat-omap/omap_device.c
index 5b6974269107..cee85a55bd82 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -365,6 +365,14 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
365 goto odbfd_exit1; 365 goto odbfd_exit1;
366 } 366 }
367 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
368 if (of_get_property(node, "ti,no_idle_on_suspend", NULL)) 376 if (of_get_property(node, "ti,no_idle_on_suspend", NULL))
369 omap_device_disable_idle_on_suspend(pdev); 377 omap_device_disable_idle_on_suspend(pdev);
370 378
@@ -380,17 +388,21 @@ static int _omap_device_notifier_call(struct notifier_block *nb,
380 unsigned long event, void *dev) 388 unsigned long event, void *dev)
381{ 389{
382 struct platform_device *pdev = to_platform_device(dev); 390 struct platform_device *pdev = to_platform_device(dev);
391 struct omap_device *od;
383 392
384 switch (event) { 393 switch (event) {
385 case BUS_NOTIFY_ADD_DEVICE:
386 if (pdev->dev.of_node)
387 omap_device_build_from_dt(pdev);
388 break;
389
390 case BUS_NOTIFY_DEL_DEVICE: 394 case BUS_NOTIFY_DEL_DEVICE:
391 if (pdev->archdata.od) 395 if (pdev->archdata.od)
392 omap_device_delete(pdev->archdata.od); 396 omap_device_delete(pdev->archdata.od);
393 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;
394 } 406 }
395 407
396 return NOTIFY_DONE; 408 return NOTIFY_DONE;
@@ -481,6 +493,33 @@ static int omap_device_fill_resources(struct omap_device *od,
481} 493}
482 494
483/** 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/**
484 * omap_device_alloc - allocate an omap_device 523 * omap_device_alloc - allocate an omap_device
485 * @pdev: platform_device that will be included in this omap_device 524 * @pdev: platform_device that will be included in this omap_device
486 * @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
@@ -519,24 +558,44 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
519 od->hwmods = hwmods; 558 od->hwmods = hwmods;
520 od->pdev = pdev; 559 od->pdev = pdev;
521 560
561 res_count = omap_device_count_resources(od);
522 /* 562 /*
523 * HACK: Ideally the resources from DT should match, and hwmod 563 * DT Boot:
524 * should just add the missing ones. Since the name is not 564 * OF framework will construct the resource structure (currently
525 * 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.
526 */ 576 */
527 if (pdev->num_resources && pdev->resource) 577 if (res_count > pdev->num_resources) {
528 dev_warn(&pdev->dev, "%s(): resources already allocated %d\n", 578 /* Allocate resources memory to account for new resources */
529 __func__, pdev->num_resources);
530
531 res_count = omap_device_count_resources(od);
532 if (res_count > 0) {
533 dev_dbg(&pdev->dev, "%s(): resources allocated from hwmod %d\n",
534 __func__, res_count);
535 res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL); 579 res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
536 if (!res) 580 if (!res)
537 goto oda_exit3; 581 goto oda_exit3;
538 582
539 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 }
540 599
541 ret = platform_device_add_resources(pdev, res, res_count); 600 ret = platform_device_add_resources(pdev, res, res_count);
542 kfree(res); 601 kfree(res);
@@ -747,6 +806,10 @@ static int _od_suspend_noirq(struct device *dev)
747 struct omap_device *od = to_omap_device(pdev); 806 struct omap_device *od = to_omap_device(pdev);
748 int ret; 807 int ret;
749 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
750 ret = pm_generic_suspend_noirq(dev); 813 ret = pm_generic_suspend_noirq(dev);
751 814
752 if (!ret && !pm_runtime_status_suspended(dev)) { 815 if (!ret && !pm_runtime_status_suspended(dev)) {
@@ -1175,3 +1238,41 @@ static int __init omap_device_init(void)
1175 return 0; 1238 return 0;
1176} 1239}
1177core_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-orion/Makefile b/arch/arm/plat-orion/Makefile
index c20ce0f5ce33..a82cecb84948 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 367ca89ac403..a7b8060c293a 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 b8b747a9d360..b8a688cad4c2 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 dfda74fae6f2..c29ee7ea200b 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 fd556f77562c..ec63e4a627d0 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/common.h b/arch/arm/plat-orion/include/plat/common.h
index ae2377ef63e5..6bbc3fe5f58e 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/mpp.h b/arch/arm/plat-orion/include/plat/mpp.h
index 723adce99f41..254552fee889 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/gpio.h b/arch/arm/plat-orion/include/plat/orion-gpio.h
index 81c6fc8a7b28..614dcac9dc52 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/time.h b/arch/arm/plat-orion/include/plat/time.h
index 4d5f1f6e18df..07527e417c62 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 d751964def4c..1867944415ca 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 3b1e17bd3d17..e686fe76a96b 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 1ed8d1397fcf..0f4fa863dd55 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-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index fc49f3dabd76..b151d4932661 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,24 @@
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 <linux/platform_data/hwmon-s3c.h>
56#include <plat/iic.h> 55#include <linux/platform_data/i2c-s3c2410.h>
57#include <plat/keypad.h> 56#include <plat/keypad.h>
58#include <plat/mci.h> 57#include <linux/platform_data/mmc-s3cmci.h>
59#include <plat/nand.h> 58#include <linux/platform_data/mtd-nand-s3c2410.h>
60#include <plat/sdhci.h> 59#include <plat/sdhci.h>
61#include <plat/ts.h> 60#include <linux/platform_data/touchscreen-s3c2410.h>
62#include <plat/udc.h> 61#include <linux/platform_data/usb-s3c2410_udc.h>
63#include <plat/usb-control.h> 62#include <linux/platform_data/usb-ohci-s3c2410.h>
64#include <plat/usb-phy.h> 63#include <plat/usb-phy.h>
65#include <plat/regs-iic.h> 64#include <plat/regs-iic.h>
66#include <plat/regs-serial.h> 65#include <plat/regs-serial.h>
67#include <plat/regs-spi.h> 66#include <plat/regs-spi.h>
68#include <plat/s3c64xx-spi.h> 67#include <linux/platform_data/spi-s3c64xx.h>
69 68
70static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); 69static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);
71 70
@@ -1132,7 +1131,7 @@ static struct resource s5p_pmu_resource[] = {
1132 1131
1133static struct platform_device s5p_device_pmu = { 1132static struct platform_device s5p_device_pmu = {
1134 .name = "arm-pmu", 1133 .name = "arm-pmu",
1135 .id = ARM_PMU_DEVICE_CPU, 1134 .id = -1,
1136 .num_resources = ARRAY_SIZE(s5p_pmu_resource), 1135 .num_resources = ARRAY_SIZE(s5p_pmu_resource),
1137 .resource = s5p_pmu_resource, 1136 .resource = s5p_pmu_resource,
1138}; 1137};
diff --git a/arch/arm/plat-samsung/include/plat/gpio-fns.h b/arch/arm/plat-samsung/include/plat/gpio-fns.h
index bab139201761..d1ecef0e38e0 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/s5p-irq-gpioint.c b/arch/arm/plat-samsung/s5p-irq-gpioint.c
index f9431fe5b06e..23557d30e44c 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-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h
deleted file mode 100644
index 40a8c178f10d..000000000000
--- a/arch/arm/plat-spear/include/plat/gpio.h
+++ /dev/null
@@ -1 +0,0 @@
1/* empty */
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile
index 272769a8a7d6..74cfd94cbf80 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/include/plat/platsmp.h b/arch/arm/plat-versatile/include/plat/platsmp.h
new file mode 100644
index 000000000000..50fb830192e0
--- /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/platsmp.c b/arch/arm/plat-versatile/platsmp.c
index d7c5c171f5aa..04ca4937d8ca 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 2997e56ce0dd..7bc7948c5432 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -158,7 +158,6 @@ edb9315a MACH_EDB9315A EDB9315A 772
158stargate2 MACH_STARGATE2 STARGATE2 774 158stargate2 MACH_STARGATE2 STARGATE2 774
159intelmote2 MACH_INTELMOTE2 INTELMOTE2 775 159intelmote2 MACH_INTELMOTE2 INTELMOTE2 775
160trizeps4 MACH_TRIZEPS4 TRIZEPS4 776 160trizeps4 MACH_TRIZEPS4 TRIZEPS4 776
161pnx4008 MACH_PNX4008 PNX4008 782
162cpuat91 MACH_CPUAT91 CPUAT91 787 161cpuat91 MACH_CPUAT91 CPUAT91 787
163iq81340sc MACH_IQ81340SC IQ81340SC 799 162iq81340sc MACH_IQ81340SC IQ81340SC 799
164iq81340mc MACH_IQ81340MC IQ81340MC 801 163iq81340mc MACH_IQ81340MC IQ81340MC 801
diff --git a/drivers/Kconfig b/drivers/Kconfig
index ece958d3762e..36d3daa19a74 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -152,4 +152,6 @@ source "drivers/vme/Kconfig"
152 152
153source "drivers/pwm/Kconfig" 153source "drivers/pwm/Kconfig"
154 154
155source "drivers/irqchip/Kconfig"
156
155endmenu 157endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index 5b421840c48d..8c30e73cd94c 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -5,6 +5,8 @@
5# Rewritten to use lists instead of if-statements. 5# Rewritten to use lists instead of if-statements.
6# 6#
7 7
8obj-y += irqchip/
9
8# GPIO must come after pinctrl as gpios may need to mux pins etc 10# GPIO must come after pinctrl as gpios may need to mux pins etc
9obj-y += pinctrl/ 11obj-y += pinctrl/
10obj-y += gpio/ 12obj-y += gpio/
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index 6ef2e3741f76..e056406d6a11 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -43,7 +43,7 @@
43#include <linux/dmaengine.h> 43#include <linux/dmaengine.h>
44#include <linux/ktime.h> 44#include <linux/ktime.h>
45 45
46#include <mach/dma.h> 46#include <linux/platform_data/dma-ep93xx.h>
47#include <mach/platform.h> 47#include <mach/platform.h>
48 48
49#define DRV_NAME "ep93xx-ide" 49#define DRV_NAME "ep93xx-ide"
diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c
index 0bb0fb7b26bc..4b8ba559fe24 100644
--- a/drivers/ata/pata_pxa.c
+++ b/drivers/ata/pata_pxa.c
@@ -32,7 +32,7 @@
32#include <scsi/scsi_host.h> 32#include <scsi/scsi_host.h>
33 33
34#include <mach/pxa2xx-regs.h> 34#include <mach/pxa2xx-regs.h>
35#include <mach/pata_pxa.h> 35#include <linux/platform_data/ata-pxa.h>
36#include <mach/dma.h> 36#include <mach/dma.h>
37 37
38#define DRV_NAME "pata_pxa" 38#define DRV_NAME "pata_pxa"
diff --git a/drivers/ata/pata_samsung_cf.c b/drivers/ata/pata_samsung_cf.c
index 1b372c297195..63ffb002ec67 100644
--- a/drivers/ata/pata_samsung_cf.c
+++ b/drivers/ata/pata_samsung_cf.c
@@ -23,7 +23,7 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25 25
26#include <plat/ata.h> 26#include <linux/platform_data/ata-samsung_cf.h>
27#include <plat/regs-ata.h> 27#include <plat/regs-ata.h>
28 28
29#define DRV_NAME "pata_samsung_cf" 29#define DRV_NAME "pata_samsung_cf"
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 7f0b5ca78516..bace9e98f75d 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -40,4 +40,17 @@ config COMMON_CLK_WM831X
40 Supports the clocking subsystem of the WM831x/2x series of 40 Supports the clocking subsystem of the WM831x/2x series of
41 PMICs from Wolfson Microlectronics. 41 PMICs from Wolfson Microlectronics.
42 42
43config COMMON_CLK_VERSATILE
44 bool "Clock driver for ARM Reference designs"
45 depends on ARCH_INTEGRATOR || ARCH_REALVIEW
46 ---help---
47 Supports clocking on ARM Reference designs Integrator/AP,
48 Integrator/CP, RealView PB1176, EB, PB11MP and PBX.
49
50config COMMON_CLK_MAX77686
51 tristate "Clock driver for Maxim 77686 MFD"
52 depends on MFD_MAX77686
53 ---help---
54 This driver supports Maxim 77686 crystal oscillator clock.
55
43endmenu 56endmenu
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index 5869ea387054..9184b5e19edf 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -3,13 +3,21 @@ obj-$(CONFIG_CLKDEV_LOOKUP) += clkdev.o
3obj-$(CONFIG_COMMON_CLK) += clk.o clk-fixed-rate.o clk-gate.o \ 3obj-$(CONFIG_COMMON_CLK) += clk.o clk-fixed-rate.o clk-gate.o \
4 clk-mux.o clk-divider.o clk-fixed-factor.o 4 clk-mux.o clk-divider.o clk-fixed-factor.o
5# SoCs specific 5# SoCs specific
6obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835.o
6obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o 7obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o
7obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o 8obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o
8obj-$(CONFIG_ARCH_MXS) += mxs/ 9obj-$(CONFIG_ARCH_MXS) += mxs/
9obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ 10obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/
10obj-$(CONFIG_PLAT_SPEAR) += spear/ 11obj-$(CONFIG_PLAT_SPEAR) += spear/
11obj-$(CONFIG_ARCH_U300) += clk-u300.o 12obj-$(CONFIG_ARCH_U300) += clk-u300.o
12obj-$(CONFIG_ARCH_INTEGRATOR) += versatile/ 13obj-$(CONFIG_COMMON_CLK_VERSATILE) += versatile/
14obj-$(CONFIG_ARCH_PRIMA2) += clk-prima2.o
15ifeq ($(CONFIG_COMMON_CLK), y)
16obj-$(CONFIG_ARCH_MMP) += mmp/
17endif
18obj-$(CONFIG_MACH_LOONGSON1) += clk-ls1x.o
19obj-$(CONFIG_ARCH_U8500) += ux500/
13 20
14# Chip specific 21# Chip specific
15obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o 22obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
23obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o
diff --git a/drivers/clk/clk-bcm2835.c b/drivers/clk/clk-bcm2835.c
new file mode 100644
index 000000000000..67ad16b20b81
--- /dev/null
+++ b/drivers/clk/clk-bcm2835.c
@@ -0,0 +1,59 @@
1/*
2 * Copyright (C) 2010 Broadcom
3 * Copyright (C) 2012 Stephen Warren
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#include <linux/clk-provider.h>
21#include <linux/clkdev.h>
22#include <linux/clk/bcm2835.h>
23
24/*
25 * These are fixed clocks. They're probably not all root clocks and it may
26 * be possible to turn them on and off but until this is mapped out better
27 * it's the only way they can be used.
28 */
29void __init bcm2835_init_clocks(void)
30{
31 struct clk *clk;
32 int ret;
33
34 clk = clk_register_fixed_rate(NULL, "sys_pclk", NULL, CLK_IS_ROOT,
35 250000000);
36 if (!clk)
37 pr_err("sys_pclk not registered\n");
38
39 clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT,
40 126000000);
41 if (!clk)
42 pr_err("apb_pclk not registered\n");
43
44 clk = clk_register_fixed_rate(NULL, "uart0_pclk", NULL, CLK_IS_ROOT,
45 3000000);
46 if (!clk)
47 pr_err("uart0_pclk not registered\n");
48 ret = clk_register_clkdev(clk, NULL, "20201000.uart");
49 if (ret)
50 pr_err("uart0_pclk alias not registered\n");
51
52 clk = clk_register_fixed_rate(NULL, "uart1_pclk", NULL, CLK_IS_ROOT,
53 125000000);
54 if (!clk)
55 pr_err("uart1_pclk not registered\n");
56 ret = clk_register_clkdev(clk, NULL, "20215000.uart");
57 if (ret)
58 pr_err("uart0_pclk alias not registered\n");
59}
diff --git a/drivers/clk/clk-ls1x.c b/drivers/clk/clk-ls1x.c
new file mode 100644
index 000000000000..f20b750235f6
--- /dev/null
+++ b/drivers/clk/clk-ls1x.c
@@ -0,0 +1,111 @@
1/*
2 * Copyright (c) 2012 Zhang, Keguang <keguang.zhang@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#include <linux/clkdev.h>
11#include <linux/clk-provider.h>
12#include <linux/io.h>
13#include <linux/slab.h>
14#include <linux/err.h>
15
16#include <loongson1.h>
17
18#define OSC 33
19
20static DEFINE_SPINLOCK(_lock);
21
22static int ls1x_pll_clk_enable(struct clk_hw *hw)
23{
24 return 0;
25}
26
27static void ls1x_pll_clk_disable(struct clk_hw *hw)
28{
29}
30
31static unsigned long ls1x_pll_recalc_rate(struct clk_hw *hw,
32 unsigned long parent_rate)
33{
34 u32 pll, rate;
35
36 pll = __raw_readl(LS1X_CLK_PLL_FREQ);
37 rate = ((12 + (pll & 0x3f)) * 1000000) +
38 ((((pll >> 8) & 0x3ff) * 1000000) >> 10);
39 rate *= OSC;
40 rate >>= 1;
41
42 return rate;
43}
44
45static const struct clk_ops ls1x_pll_clk_ops = {
46 .enable = ls1x_pll_clk_enable,
47 .disable = ls1x_pll_clk_disable,
48 .recalc_rate = ls1x_pll_recalc_rate,
49};
50
51static struct clk * __init clk_register_pll(struct device *dev,
52 const char *name, const char *parent_name, unsigned long flags)
53{
54 struct clk_hw *hw;
55 struct clk *clk;
56 struct clk_init_data init;
57
58 /* allocate the divider */
59 hw = kzalloc(sizeof(struct clk_hw), GFP_KERNEL);
60 if (!hw) {
61 pr_err("%s: could not allocate clk_hw\n", __func__);
62 return ERR_PTR(-ENOMEM);
63 }
64
65 init.name = name;
66 init.ops = &ls1x_pll_clk_ops;
67 init.flags = flags | CLK_IS_BASIC;
68 init.parent_names = (parent_name ? &parent_name : NULL);
69 init.num_parents = (parent_name ? 1 : 0);
70 hw->init = &init;
71
72 /* register the clock */
73 clk = clk_register(dev, hw);
74
75 if (IS_ERR(clk))
76 kfree(hw);
77
78 return clk;
79}
80
81void __init ls1x_clk_init(void)
82{
83 struct clk *clk;
84
85 clk = clk_register_pll(NULL, "pll_clk", NULL, CLK_IS_ROOT);
86 clk_prepare_enable(clk);
87
88 clk = clk_register_divider(NULL, "cpu_clk", "pll_clk",
89 CLK_SET_RATE_PARENT, LS1X_CLK_PLL_DIV, DIV_CPU_SHIFT,
90 DIV_CPU_WIDTH, CLK_DIVIDER_ONE_BASED, &_lock);
91 clk_prepare_enable(clk);
92 clk_register_clkdev(clk, "cpu", NULL);
93
94 clk = clk_register_divider(NULL, "dc_clk", "pll_clk",
95 CLK_SET_RATE_PARENT, LS1X_CLK_PLL_DIV, DIV_DC_SHIFT,
96 DIV_DC_WIDTH, CLK_DIVIDER_ONE_BASED, &_lock);
97 clk_prepare_enable(clk);
98 clk_register_clkdev(clk, "dc", NULL);
99
100 clk = clk_register_divider(NULL, "ahb_clk", "pll_clk",
101 CLK_SET_RATE_PARENT, LS1X_CLK_PLL_DIV, DIV_DDR_SHIFT,
102 DIV_DDR_WIDTH, CLK_DIVIDER_ONE_BASED, &_lock);
103 clk_prepare_enable(clk);
104 clk_register_clkdev(clk, "ahb", NULL);
105 clk_register_clkdev(clk, "stmmaceth", NULL);
106
107 clk = clk_register_fixed_factor(NULL, "apb_clk", "ahb_clk", 0, 1, 2);
108 clk_prepare_enable(clk);
109 clk_register_clkdev(clk, "apb", NULL);
110 clk_register_clkdev(clk, "serial8250", NULL);
111}
diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
new file mode 100644
index 000000000000..ac5f5434cb9a
--- /dev/null
+++ b/drivers/clk/clk-max77686.c
@@ -0,0 +1,244 @@
1/*
2 * clk-max77686.c - Clock driver for Maxim 77686
3 *
4 * Copyright (C) 2012 Samsung Electornics
5 * Jonghwa Lee <jonghwa3.lee@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * 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#include <linux/kernel.h>
24#include <linux/slab.h>
25#include <linux/err.h>
26#include <linux/platform_device.h>
27#include <linux/mfd/max77686.h>
28#include <linux/mfd/max77686-private.h>
29#include <linux/clk-provider.h>
30#include <linux/mutex.h>
31#include <linux/clkdev.h>
32
33enum {
34 MAX77686_CLK_AP = 0,
35 MAX77686_CLK_CP,
36 MAX77686_CLK_PMIC,
37 MAX77686_CLKS_NUM,
38};
39
40struct max77686_clk {
41 struct max77686_dev *iodev;
42 u32 mask;
43 struct clk_hw hw;
44 struct clk_lookup *lookup;
45};
46
47static struct max77686_clk *get_max77686_clk(struct clk_hw *hw)
48{
49 return container_of(hw, struct max77686_clk, hw);
50}
51
52static int max77686_clk_prepare(struct clk_hw *hw)
53{
54 struct max77686_clk *max77686;
55 int ret;
56
57 max77686 = get_max77686_clk(hw);
58 if (!max77686)
59 return -ENOMEM;
60
61 ret = regmap_update_bits(max77686->iodev->regmap,
62 MAX77686_REG_32KHZ, max77686->mask, max77686->mask);
63
64 return ret;
65}
66
67static void max77686_clk_unprepare(struct clk_hw *hw)
68{
69 struct max77686_clk *max77686;
70
71 max77686 = get_max77686_clk(hw);
72 if (!max77686)
73 return;
74
75 regmap_update_bits(max77686->iodev->regmap,
76 MAX77686_REG_32KHZ, max77686->mask, ~max77686->mask);
77}
78
79static int max77686_clk_is_enabled(struct clk_hw *hw)
80{
81 struct max77686_clk *max77686;
82 int ret;
83 u32 val;
84
85 max77686 = get_max77686_clk(hw);
86 if (!max77686)
87 return -ENOMEM;
88
89 ret = regmap_read(max77686->iodev->regmap,
90 MAX77686_REG_32KHZ, &val);
91
92 if (ret < 0)
93 return -EINVAL;
94
95 return val & max77686->mask;
96}
97
98static struct clk_ops max77686_clk_ops = {
99 .prepare = max77686_clk_prepare,
100 .unprepare = max77686_clk_unprepare,
101 .is_enabled = max77686_clk_is_enabled,
102};
103
104static struct clk_init_data max77686_clks_init[MAX77686_CLKS_NUM] = {
105 [MAX77686_CLK_AP] = {
106 .name = "32khz_ap",
107 .ops = &max77686_clk_ops,
108 .flags = CLK_IS_ROOT,
109 },
110 [MAX77686_CLK_CP] = {
111 .name = "32khz_cp",
112 .ops = &max77686_clk_ops,
113 .flags = CLK_IS_ROOT,
114 },
115 [MAX77686_CLK_PMIC] = {
116 .name = "32khz_pmic",
117 .ops = &max77686_clk_ops,
118 .flags = CLK_IS_ROOT,
119 },
120};
121
122static int max77686_clk_register(struct device *dev,
123 struct max77686_clk *max77686)
124{
125 struct clk *clk;
126 struct clk_hw *hw = &max77686->hw;
127
128 clk = clk_register(dev, hw);
129
130 if (IS_ERR(clk))
131 return -ENOMEM;
132
133 max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup),
134 GFP_KERNEL);
135 if (IS_ERR(max77686->lookup))
136 return -ENOMEM;
137
138 max77686->lookup->con_id = hw->init->name;
139 max77686->lookup->clk = clk;
140
141 clkdev_add(max77686->lookup);
142
143 return 0;
144}
145
146static __devinit int max77686_clk_probe(struct platform_device *pdev)
147{
148 struct max77686_dev *iodev = dev_get_drvdata(pdev->dev.parent);
149 struct max77686_clk **max77686_clks;
150 int i, ret;
151
152 max77686_clks = devm_kzalloc(&pdev->dev, sizeof(struct max77686_clk *)
153 * MAX77686_CLKS_NUM, GFP_KERNEL);
154 if (IS_ERR(max77686_clks))
155 return -ENOMEM;
156
157 for (i = 0; i < MAX77686_CLKS_NUM; i++) {
158 max77686_clks[i] = devm_kzalloc(&pdev->dev,
159 sizeof(struct max77686_clk), GFP_KERNEL);
160 if (IS_ERR(max77686_clks[i]))
161 return -ENOMEM;
162 }
163
164 for (i = 0; i < MAX77686_CLKS_NUM; i++) {
165 max77686_clks[i]->iodev = iodev;
166 max77686_clks[i]->mask = 1 << i;
167 max77686_clks[i]->hw.init = &max77686_clks_init[i];
168
169 ret = max77686_clk_register(&pdev->dev, max77686_clks[i]);
170 if (ret) {
171 switch (i) {
172 case MAX77686_CLK_AP:
173 dev_err(&pdev->dev, "Fail to register CLK_AP\n");
174 goto err_clk_ap;
175 break;
176 case MAX77686_CLK_CP:
177 dev_err(&pdev->dev, "Fail to register CLK_CP\n");
178 goto err_clk_cp;
179 break;
180 case MAX77686_CLK_PMIC:
181 dev_err(&pdev->dev, "Fail to register CLK_PMIC\n");
182 goto err_clk_pmic;
183 }
184 }
185 }
186
187 platform_set_drvdata(pdev, max77686_clks);
188
189 goto out;
190
191err_clk_pmic:
192 clkdev_drop(max77686_clks[MAX77686_CLK_CP]->lookup);
193 kfree(max77686_clks[MAX77686_CLK_CP]->hw.clk);
194err_clk_cp:
195 clkdev_drop(max77686_clks[MAX77686_CLK_AP]->lookup);
196 kfree(max77686_clks[MAX77686_CLK_AP]->hw.clk);
197err_clk_ap:
198out:
199 return ret;
200}
201
202static int __devexit max77686_clk_remove(struct platform_device *pdev)
203{
204 struct max77686_clk **max77686_clks = platform_get_drvdata(pdev);
205 int i;
206
207 for (i = 0; i < MAX77686_CLKS_NUM; i++) {
208 clkdev_drop(max77686_clks[i]->lookup);
209 kfree(max77686_clks[i]->hw.clk);
210 }
211 return 0;
212}
213
214static const struct platform_device_id max77686_clk_id[] = {
215 { "max77686-clk", 0},
216 { },
217};
218MODULE_DEVICE_TABLE(platform, max77686_clk_id);
219
220static struct platform_driver max77686_clk_driver = {
221 .driver = {
222 .name = "max77686-clk",
223 .owner = THIS_MODULE,
224 },
225 .probe = max77686_clk_probe,
226 .remove = __devexit_p(max77686_clk_remove),
227 .id_table = max77686_clk_id,
228};
229
230static int __init max77686_clk_init(void)
231{
232 return platform_driver_register(&max77686_clk_driver);
233}
234subsys_initcall(max77686_clk_init);
235
236static void __init max77686_clk_cleanup(void)
237{
238 platform_driver_unregister(&max77686_clk_driver);
239}
240module_exit(max77686_clk_cleanup);
241
242MODULE_DESCRIPTION("MAXIM 77686 Clock Driver");
243MODULE_AUTHOR("Jonghwa Lee <jonghwa3.lee@samsung.com>");
244MODULE_LICENSE("GPL");
diff --git a/drivers/clk/clk-prima2.c b/drivers/clk/clk-prima2.c
new file mode 100644
index 000000000000..517874fa6858
--- /dev/null
+++ b/drivers/clk/clk-prima2.c
@@ -0,0 +1,1171 @@
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/io.h>
12#include <linux/clk.h>
13#include <linux/clkdev.h>
14#include <linux/clk-provider.h>
15#include <linux/of_address.h>
16#include <linux/syscore_ops.h>
17
18#define SIRFSOC_CLKC_CLK_EN0 0x0000
19#define SIRFSOC_CLKC_CLK_EN1 0x0004
20#define SIRFSOC_CLKC_REF_CFG 0x0014
21#define SIRFSOC_CLKC_CPU_CFG 0x0018
22#define SIRFSOC_CLKC_MEM_CFG 0x001c
23#define SIRFSOC_CLKC_SYS_CFG 0x0020
24#define SIRFSOC_CLKC_IO_CFG 0x0024
25#define SIRFSOC_CLKC_DSP_CFG 0x0028
26#define SIRFSOC_CLKC_GFX_CFG 0x002c
27#define SIRFSOC_CLKC_MM_CFG 0x0030
28#define SIRFSOC_CLKC_LCD_CFG 0x0034
29#define SIRFSOC_CLKC_MMC_CFG 0x0038
30#define SIRFSOC_CLKC_PLL1_CFG0 0x0040
31#define SIRFSOC_CLKC_PLL2_CFG0 0x0044
32#define SIRFSOC_CLKC_PLL3_CFG0 0x0048
33#define SIRFSOC_CLKC_PLL1_CFG1 0x004c
34#define SIRFSOC_CLKC_PLL2_CFG1 0x0050
35#define SIRFSOC_CLKC_PLL3_CFG1 0x0054
36#define SIRFSOC_CLKC_PLL1_CFG2 0x0058
37#define SIRFSOC_CLKC_PLL2_CFG2 0x005c
38#define SIRFSOC_CLKC_PLL3_CFG2 0x0060
39#define SIRFSOC_USBPHY_PLL_CTRL 0x0008
40#define SIRFSOC_USBPHY_PLL_POWERDOWN BIT(1)
41#define SIRFSOC_USBPHY_PLL_BYPASS BIT(2)
42#define SIRFSOC_USBPHY_PLL_LOCK BIT(3)
43
44static void *sirfsoc_clk_vbase, *sirfsoc_rsc_vbase;
45
46#define KHZ 1000
47#define MHZ (KHZ * KHZ)
48
49/*
50 * SiRFprimaII clock controller
51 * - 2 oscillators: osc-26MHz, rtc-32.768KHz
52 * - 3 standard configurable plls: pll1, pll2 & pll3
53 * - 2 exclusive plls: usb phy pll and sata phy pll
54 * - 8 clock domains: cpu/cpudiv, mem/memdiv, sys/io, dsp, graphic, multimedia,
55 * display and sdphy.
56 * Each clock domain can select its own clock source from five clock sources,
57 * X_XIN, X_XINW, PLL1, PLL2 and PLL3. The domain clock is used as the source
58 * clock of the group clock.
59 * - dsp domain: gps, mf
60 * - io domain: dmac, nand, audio, uart, i2c, spi, usp, pwm, pulse
61 * - sys domain: security
62 */
63
64struct clk_pll {
65 struct clk_hw hw;
66 unsigned short regofs; /* register offset */
67};
68
69#define to_pllclk(_hw) container_of(_hw, struct clk_pll, hw)
70
71struct clk_dmn {
72 struct clk_hw hw;
73 signed char enable_bit; /* enable bit: 0 ~ 63 */
74 unsigned short regofs; /* register offset */
75};
76
77#define to_dmnclk(_hw) container_of(_hw, struct clk_dmn, hw)
78
79struct clk_std {
80 struct clk_hw hw;
81 signed char enable_bit; /* enable bit: 0 ~ 63 */
82};
83
84#define to_stdclk(_hw) container_of(_hw, struct clk_std, hw)
85
86static int std_clk_is_enabled(struct clk_hw *hw);
87static int std_clk_enable(struct clk_hw *hw);
88static void std_clk_disable(struct clk_hw *hw);
89
90static inline unsigned long clkc_readl(unsigned reg)
91{
92 return readl(sirfsoc_clk_vbase + reg);
93}
94
95static inline void clkc_writel(u32 val, unsigned reg)
96{
97 writel(val, sirfsoc_clk_vbase + reg);
98}
99
100/*
101 * std pll
102 */
103
104static unsigned long pll_clk_recalc_rate(struct clk_hw *hw,
105 unsigned long parent_rate)
106{
107 unsigned long fin = parent_rate;
108 struct clk_pll *clk = to_pllclk(hw);
109 u32 regcfg2 = clk->regofs + SIRFSOC_CLKC_PLL1_CFG2 -
110 SIRFSOC_CLKC_PLL1_CFG0;
111
112 if (clkc_readl(regcfg2) & BIT(2)) {
113 /* pll bypass mode */
114 return fin;
115 } else {
116 /* fout = fin * nf / nr / od */
117 u32 cfg0 = clkc_readl(clk->regofs);
118 u32 nf = (cfg0 & (BIT(13) - 1)) + 1;
119 u32 nr = ((cfg0 >> 13) & (BIT(6) - 1)) + 1;
120 u32 od = ((cfg0 >> 19) & (BIT(4) - 1)) + 1;
121 WARN_ON(fin % MHZ);
122 return fin / MHZ * nf / nr / od * MHZ;
123 }
124}
125
126static long pll_clk_round_rate(struct clk_hw *hw, unsigned long rate,
127 unsigned long *parent_rate)
128{
129 unsigned long fin, nf, nr, od;
130
131 /*
132 * fout = fin * nf / (nr * od);
133 * set od = 1, nr = fin/MHz, so fout = nf * MHz
134 */
135 rate = rate - rate % MHZ;
136
137 nf = rate / MHZ;
138 if (nf > BIT(13))
139 nf = BIT(13);
140 if (nf < 1)
141 nf = 1;
142
143 fin = *parent_rate;
144
145 nr = fin / MHZ;
146 if (nr > BIT(6))
147 nr = BIT(6);
148 od = 1;
149
150 return fin * nf / (nr * od);
151}
152
153static int pll_clk_set_rate(struct clk_hw *hw, unsigned long rate,
154 unsigned long parent_rate)
155{
156 struct clk_pll *clk = to_pllclk(hw);
157 unsigned long fin, nf, nr, od, reg;
158
159 /*
160 * fout = fin * nf / (nr * od);
161 * set od = 1, nr = fin/MHz, so fout = nf * MHz
162 */
163
164 nf = rate / MHZ;
165 if (unlikely((rate % MHZ) || nf > BIT(13) || nf < 1))
166 return -EINVAL;
167
168 fin = parent_rate;
169 BUG_ON(fin < MHZ);
170
171 nr = fin / MHZ;
172 BUG_ON((fin % MHZ) || nr > BIT(6));
173
174 od = 1;
175
176 reg = (nf - 1) | ((nr - 1) << 13) | ((od - 1) << 19);
177 clkc_writel(reg, clk->regofs);
178
179 reg = clk->regofs + SIRFSOC_CLKC_PLL1_CFG1 - SIRFSOC_CLKC_PLL1_CFG0;
180 clkc_writel((nf >> 1) - 1, reg);
181
182 reg = clk->regofs + SIRFSOC_CLKC_PLL1_CFG2 - SIRFSOC_CLKC_PLL1_CFG0;
183 while (!(clkc_readl(reg) & BIT(6)))
184 cpu_relax();
185
186 return 0;
187}
188
189static struct clk_ops std_pll_ops = {
190 .recalc_rate = pll_clk_recalc_rate,
191 .round_rate = pll_clk_round_rate,
192 .set_rate = pll_clk_set_rate,
193};
194
195static const char *pll_clk_parents[] = {
196 "osc",
197};
198
199static struct clk_init_data clk_pll1_init = {
200 .name = "pll1",
201 .ops = &std_pll_ops,
202 .parent_names = pll_clk_parents,
203 .num_parents = ARRAY_SIZE(pll_clk_parents),
204};
205
206static struct clk_init_data clk_pll2_init = {
207 .name = "pll2",
208 .ops = &std_pll_ops,
209 .parent_names = pll_clk_parents,
210 .num_parents = ARRAY_SIZE(pll_clk_parents),
211};
212
213static struct clk_init_data clk_pll3_init = {
214 .name = "pll3",
215 .ops = &std_pll_ops,
216 .parent_names = pll_clk_parents,
217 .num_parents = ARRAY_SIZE(pll_clk_parents),
218};
219
220static struct clk_pll clk_pll1 = {
221 .regofs = SIRFSOC_CLKC_PLL1_CFG0,
222 .hw = {
223 .init = &clk_pll1_init,
224 },
225};
226
227static struct clk_pll clk_pll2 = {
228 .regofs = SIRFSOC_CLKC_PLL2_CFG0,
229 .hw = {
230 .init = &clk_pll2_init,
231 },
232};
233
234static struct clk_pll clk_pll3 = {
235 .regofs = SIRFSOC_CLKC_PLL3_CFG0,
236 .hw = {
237 .init = &clk_pll3_init,
238 },
239};
240
241/*
242 * usb uses specified pll
243 */
244
245static int usb_pll_clk_enable(struct clk_hw *hw)
246{
247 u32 reg = readl(sirfsoc_rsc_vbase + SIRFSOC_USBPHY_PLL_CTRL);
248 reg &= ~(SIRFSOC_USBPHY_PLL_POWERDOWN | SIRFSOC_USBPHY_PLL_BYPASS);
249 writel(reg, sirfsoc_rsc_vbase + SIRFSOC_USBPHY_PLL_CTRL);
250 while (!(readl(sirfsoc_rsc_vbase + SIRFSOC_USBPHY_PLL_CTRL) &
251 SIRFSOC_USBPHY_PLL_LOCK))
252 cpu_relax();
253
254 return 0;
255}
256
257static void usb_pll_clk_disable(struct clk_hw *clk)
258{
259 u32 reg = readl(sirfsoc_rsc_vbase + SIRFSOC_USBPHY_PLL_CTRL);
260 reg |= (SIRFSOC_USBPHY_PLL_POWERDOWN | SIRFSOC_USBPHY_PLL_BYPASS);
261 writel(reg, sirfsoc_rsc_vbase + SIRFSOC_USBPHY_PLL_CTRL);
262}
263
264static unsigned long usb_pll_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
265{
266 u32 reg = readl(sirfsoc_rsc_vbase + SIRFSOC_USBPHY_PLL_CTRL);
267 return (reg & SIRFSOC_USBPHY_PLL_BYPASS) ? parent_rate : 48*MHZ;
268}
269
270static struct clk_ops usb_pll_ops = {
271 .enable = usb_pll_clk_enable,
272 .disable = usb_pll_clk_disable,
273 .recalc_rate = usb_pll_clk_recalc_rate,
274};
275
276static struct clk_init_data clk_usb_pll_init = {
277 .name = "usb_pll",
278 .ops = &usb_pll_ops,
279 .parent_names = pll_clk_parents,
280 .num_parents = ARRAY_SIZE(pll_clk_parents),
281};
282
283static struct clk_hw usb_pll_clk_hw = {
284 .init = &clk_usb_pll_init,
285};
286
287/*
288 * clock domains - cpu, mem, sys/io, dsp, gfx
289 */
290
291static const char *dmn_clk_parents[] = {
292 "rtc",
293 "osc",
294 "pll1",
295 "pll2",
296 "pll3",
297};
298
299static u8 dmn_clk_get_parent(struct clk_hw *hw)
300{
301 struct clk_dmn *clk = to_dmnclk(hw);
302 u32 cfg = clkc_readl(clk->regofs);
303
304 /* parent of io domain can only be pll3 */
305 if (strcmp(hw->init->name, "io") == 0)
306 return 4;
307
308 WARN_ON((cfg & (BIT(3) - 1)) > 4);
309
310 return cfg & (BIT(3) - 1);
311}
312
313static int dmn_clk_set_parent(struct clk_hw *hw, u8 parent)
314{
315 struct clk_dmn *clk = to_dmnclk(hw);
316 u32 cfg = clkc_readl(clk->regofs);
317
318 /* parent of io domain can only be pll3 */
319 if (strcmp(hw->init->name, "io") == 0)
320 return -EINVAL;
321
322 cfg &= ~(BIT(3) - 1);
323 clkc_writel(cfg | parent, clk->regofs);
324 /* BIT(3) - switching status: 1 - busy, 0 - done */
325 while (clkc_readl(clk->regofs) & BIT(3))
326 cpu_relax();
327
328 return 0;
329}
330
331static unsigned long dmn_clk_recalc_rate(struct clk_hw *hw,
332 unsigned long parent_rate)
333
334{
335 unsigned long fin = parent_rate;
336 struct clk_dmn *clk = to_dmnclk(hw);
337
338 u32 cfg = clkc_readl(clk->regofs);
339
340 if (cfg & BIT(24)) {
341 /* fcd bypass mode */
342 return fin;
343 } else {
344 /*
345 * wait count: bit[19:16], hold count: bit[23:20]
346 */
347 u32 wait = (cfg >> 16) & (BIT(4) - 1);
348 u32 hold = (cfg >> 20) & (BIT(4) - 1);
349
350 return fin / (wait + hold + 2);
351 }
352}
353
354static long dmn_clk_round_rate(struct clk_hw *hw, unsigned long rate,
355 unsigned long *parent_rate)
356{
357 unsigned long fin;
358 unsigned ratio, wait, hold;
359 unsigned bits = (strcmp(hw->init->name, "mem") == 0) ? 3 : 4;
360
361 fin = *parent_rate;
362 ratio = fin / rate;
363
364 if (ratio < 2)
365 ratio = 2;
366 if (ratio > BIT(bits + 1))
367 ratio = BIT(bits + 1);
368
369 wait = (ratio >> 1) - 1;
370 hold = ratio - wait - 2;
371
372 return fin / (wait + hold + 2);
373}
374
375static int dmn_clk_set_rate(struct clk_hw *hw, unsigned long rate,
376 unsigned long parent_rate)
377{
378 struct clk_dmn *clk = to_dmnclk(hw);
379 unsigned long fin;
380 unsigned ratio, wait, hold, reg;
381 unsigned bits = (strcmp(hw->init->name, "mem") == 0) ? 3 : 4;
382
383 fin = parent_rate;
384 ratio = fin / rate;
385
386 if (unlikely(ratio < 2 || ratio > BIT(bits + 1)))
387 return -EINVAL;
388
389 WARN_ON(fin % rate);
390
391 wait = (ratio >> 1) - 1;
392 hold = ratio - wait - 2;
393
394 reg = clkc_readl(clk->regofs);
395 reg &= ~(((BIT(bits) - 1) << 16) | ((BIT(bits) - 1) << 20));
396 reg |= (wait << 16) | (hold << 20) | BIT(25);
397 clkc_writel(reg, clk->regofs);
398
399 /* waiting FCD been effective */
400 while (clkc_readl(clk->regofs) & BIT(25))
401 cpu_relax();
402
403 return 0;
404}
405
406static struct clk_ops msi_ops = {
407 .set_rate = dmn_clk_set_rate,
408 .round_rate = dmn_clk_round_rate,
409 .recalc_rate = dmn_clk_recalc_rate,
410 .set_parent = dmn_clk_set_parent,
411 .get_parent = dmn_clk_get_parent,
412};
413
414static struct clk_init_data clk_mem_init = {
415 .name = "mem",
416 .ops = &msi_ops,
417 .parent_names = dmn_clk_parents,
418 .num_parents = ARRAY_SIZE(dmn_clk_parents),
419};
420
421static struct clk_dmn clk_mem = {
422 .regofs = SIRFSOC_CLKC_MEM_CFG,
423 .hw = {
424 .init = &clk_mem_init,
425 },
426};
427
428static struct clk_init_data clk_sys_init = {
429 .name = "sys",
430 .ops = &msi_ops,
431 .parent_names = dmn_clk_parents,
432 .num_parents = ARRAY_SIZE(dmn_clk_parents),
433 .flags = CLK_SET_RATE_GATE,
434};
435
436static struct clk_dmn clk_sys = {
437 .regofs = SIRFSOC_CLKC_SYS_CFG,
438 .hw = {
439 .init = &clk_sys_init,
440 },
441};
442
443static struct clk_init_data clk_io_init = {
444 .name = "io",
445 .ops = &msi_ops,
446 .parent_names = dmn_clk_parents,
447 .num_parents = ARRAY_SIZE(dmn_clk_parents),
448};
449
450static struct clk_dmn clk_io = {
451 .regofs = SIRFSOC_CLKC_IO_CFG,
452 .hw = {
453 .init = &clk_io_init,
454 },
455};
456
457static struct clk_ops cpu_ops = {
458 .set_parent = dmn_clk_set_parent,
459 .get_parent = dmn_clk_get_parent,
460};
461
462static struct clk_init_data clk_cpu_init = {
463 .name = "cpu",
464 .ops = &cpu_ops,
465 .parent_names = dmn_clk_parents,
466 .num_parents = ARRAY_SIZE(dmn_clk_parents),
467 .flags = CLK_SET_RATE_PARENT,
468};
469
470static struct clk_dmn clk_cpu = {
471 .regofs = SIRFSOC_CLKC_CPU_CFG,
472 .hw = {
473 .init = &clk_cpu_init,
474 },
475};
476
477static struct clk_ops dmn_ops = {
478 .is_enabled = std_clk_is_enabled,
479 .enable = std_clk_enable,
480 .disable = std_clk_disable,
481 .set_rate = dmn_clk_set_rate,
482 .round_rate = dmn_clk_round_rate,
483 .recalc_rate = dmn_clk_recalc_rate,
484 .set_parent = dmn_clk_set_parent,
485 .get_parent = dmn_clk_get_parent,
486};
487
488/* dsp, gfx, mm, lcd and vpp domain */
489
490static struct clk_init_data clk_dsp_init = {
491 .name = "dsp",
492 .ops = &dmn_ops,
493 .parent_names = dmn_clk_parents,
494 .num_parents = ARRAY_SIZE(dmn_clk_parents),
495};
496
497static struct clk_dmn clk_dsp = {
498 .regofs = SIRFSOC_CLKC_DSP_CFG,
499 .enable_bit = 0,
500 .hw = {
501 .init = &clk_dsp_init,
502 },
503};
504
505static struct clk_init_data clk_gfx_init = {
506 .name = "gfx",
507 .ops = &dmn_ops,
508 .parent_names = dmn_clk_parents,
509 .num_parents = ARRAY_SIZE(dmn_clk_parents),
510};
511
512static struct clk_dmn clk_gfx = {
513 .regofs = SIRFSOC_CLKC_GFX_CFG,
514 .enable_bit = 8,
515 .hw = {
516 .init = &clk_gfx_init,
517 },
518};
519
520static struct clk_init_data clk_mm_init = {
521 .name = "mm",
522 .ops = &dmn_ops,
523 .parent_names = dmn_clk_parents,
524 .num_parents = ARRAY_SIZE(dmn_clk_parents),
525};
526
527static struct clk_dmn clk_mm = {
528 .regofs = SIRFSOC_CLKC_MM_CFG,
529 .enable_bit = 9,
530 .hw = {
531 .init = &clk_mm_init,
532 },
533};
534
535static struct clk_init_data clk_lcd_init = {
536 .name = "lcd",
537 .ops = &dmn_ops,
538 .parent_names = dmn_clk_parents,
539 .num_parents = ARRAY_SIZE(dmn_clk_parents),
540};
541
542static struct clk_dmn clk_lcd = {
543 .regofs = SIRFSOC_CLKC_LCD_CFG,
544 .enable_bit = 10,
545 .hw = {
546 .init = &clk_lcd_init,
547 },
548};
549
550static struct clk_init_data clk_vpp_init = {
551 .name = "vpp",
552 .ops = &dmn_ops,
553 .parent_names = dmn_clk_parents,
554 .num_parents = ARRAY_SIZE(dmn_clk_parents),
555};
556
557static struct clk_dmn clk_vpp = {
558 .regofs = SIRFSOC_CLKC_LCD_CFG,
559 .enable_bit = 11,
560 .hw = {
561 .init = &clk_vpp_init,
562 },
563};
564
565static struct clk_init_data clk_mmc01_init = {
566 .name = "mmc01",
567 .ops = &dmn_ops,
568 .parent_names = dmn_clk_parents,
569 .num_parents = ARRAY_SIZE(dmn_clk_parents),
570};
571
572static struct clk_dmn clk_mmc01 = {
573 .regofs = SIRFSOC_CLKC_MMC_CFG,
574 .enable_bit = 59,
575 .hw = {
576 .init = &clk_mmc01_init,
577 },
578};
579
580static struct clk_init_data clk_mmc23_init = {
581 .name = "mmc23",
582 .ops = &dmn_ops,
583 .parent_names = dmn_clk_parents,
584 .num_parents = ARRAY_SIZE(dmn_clk_parents),
585};
586
587static struct clk_dmn clk_mmc23 = {
588 .regofs = SIRFSOC_CLKC_MMC_CFG,
589 .enable_bit = 60,
590 .hw = {
591 .init = &clk_mmc23_init,
592 },
593};
594
595static struct clk_init_data clk_mmc45_init = {
596 .name = "mmc45",
597 .ops = &dmn_ops,
598 .parent_names = dmn_clk_parents,
599 .num_parents = ARRAY_SIZE(dmn_clk_parents),
600};
601
602static struct clk_dmn clk_mmc45 = {
603 .regofs = SIRFSOC_CLKC_MMC_CFG,
604 .enable_bit = 61,
605 .hw = {
606 .init = &clk_mmc45_init,
607 },
608};
609
610/*
611 * peripheral controllers in io domain
612 */
613
614static int std_clk_is_enabled(struct clk_hw *hw)
615{
616 u32 reg;
617 int bit;
618 struct clk_std *clk = to_stdclk(hw);
619
620 bit = clk->enable_bit % 32;
621 reg = clk->enable_bit / 32;
622 reg = SIRFSOC_CLKC_CLK_EN0 + reg * sizeof(reg);
623
624 return !!(clkc_readl(reg) & BIT(bit));
625}
626
627static int std_clk_enable(struct clk_hw *hw)
628{
629 u32 val, reg;
630 int bit;
631 struct clk_std *clk = to_stdclk(hw);
632
633 BUG_ON(clk->enable_bit < 0 || clk->enable_bit > 63);
634
635 bit = clk->enable_bit % 32;
636 reg = clk->enable_bit / 32;
637 reg = SIRFSOC_CLKC_CLK_EN0 + reg * sizeof(reg);
638
639 val = clkc_readl(reg) | BIT(bit);
640 clkc_writel(val, reg);
641 return 0;
642}
643
644static void std_clk_disable(struct clk_hw *hw)
645{
646 u32 val, reg;
647 int bit;
648 struct clk_std *clk = to_stdclk(hw);
649
650 BUG_ON(clk->enable_bit < 0 || clk->enable_bit > 63);
651
652 bit = clk->enable_bit % 32;
653 reg = clk->enable_bit / 32;
654 reg = SIRFSOC_CLKC_CLK_EN0 + reg * sizeof(reg);
655
656 val = clkc_readl(reg) & ~BIT(bit);
657 clkc_writel(val, reg);
658}
659
660static const char *std_clk_io_parents[] = {
661 "io",
662};
663
664static struct clk_ops ios_ops = {
665 .is_enabled = std_clk_is_enabled,
666 .enable = std_clk_enable,
667 .disable = std_clk_disable,
668};
669
670static struct clk_init_data clk_dmac0_init = {
671 .name = "dmac0",
672 .ops = &ios_ops,
673 .parent_names = std_clk_io_parents,
674 .num_parents = ARRAY_SIZE(std_clk_io_parents),
675};
676
677static struct clk_std clk_dmac0 = {
678 .enable_bit = 32,
679 .hw = {
680 .init = &clk_dmac0_init,
681 },
682};
683
684static struct clk_init_data clk_dmac1_init = {
685 .name = "dmac1",
686 .ops = &ios_ops,
687 .parent_names = std_clk_io_parents,
688 .num_parents = ARRAY_SIZE(std_clk_io_parents),
689};
690
691static struct clk_std clk_dmac1 = {
692 .enable_bit = 33,
693 .hw = {
694 .init = &clk_dmac1_init,
695 },
696};
697
698static struct clk_init_data clk_nand_init = {
699 .name = "nand",
700 .ops = &ios_ops,
701 .parent_names = std_clk_io_parents,
702 .num_parents = ARRAY_SIZE(std_clk_io_parents),
703};
704
705static struct clk_std clk_nand = {
706 .enable_bit = 34,
707 .hw = {
708 .init = &clk_nand_init,
709 },
710};
711
712static struct clk_init_data clk_audio_init = {
713 .name = "audio",
714 .ops = &ios_ops,
715 .parent_names = std_clk_io_parents,
716 .num_parents = ARRAY_SIZE(std_clk_io_parents),
717};
718
719static struct clk_std clk_audio = {
720 .enable_bit = 35,
721 .hw = {
722 .init = &clk_audio_init,
723 },
724};
725
726static struct clk_init_data clk_uart0_init = {
727 .name = "uart0",
728 .ops = &ios_ops,
729 .parent_names = std_clk_io_parents,
730 .num_parents = ARRAY_SIZE(std_clk_io_parents),
731};
732
733static struct clk_std clk_uart0 = {
734 .enable_bit = 36,
735 .hw = {
736 .init = &clk_uart0_init,
737 },
738};
739
740static struct clk_init_data clk_uart1_init = {
741 .name = "uart1",
742 .ops = &ios_ops,
743 .parent_names = std_clk_io_parents,
744 .num_parents = ARRAY_SIZE(std_clk_io_parents),
745};
746
747static struct clk_std clk_uart1 = {
748 .enable_bit = 37,
749 .hw = {
750 .init = &clk_uart1_init,
751 },
752};
753
754static struct clk_init_data clk_uart2_init = {
755 .name = "uart2",
756 .ops = &ios_ops,
757 .parent_names = std_clk_io_parents,
758 .num_parents = ARRAY_SIZE(std_clk_io_parents),
759};
760
761static struct clk_std clk_uart2 = {
762 .enable_bit = 38,
763 .hw = {
764 .init = &clk_uart2_init,
765 },
766};
767
768static struct clk_init_data clk_usp0_init = {
769 .name = "usp0",
770 .ops = &ios_ops,
771 .parent_names = std_clk_io_parents,
772 .num_parents = ARRAY_SIZE(std_clk_io_parents),
773};
774
775static struct clk_std clk_usp0 = {
776 .enable_bit = 39,
777 .hw = {
778 .init = &clk_usp0_init,
779 },
780};
781
782static struct clk_init_data clk_usp1_init = {
783 .name = "usp1",
784 .ops = &ios_ops,
785 .parent_names = std_clk_io_parents,
786 .num_parents = ARRAY_SIZE(std_clk_io_parents),
787};
788
789static struct clk_std clk_usp1 = {
790 .enable_bit = 40,
791 .hw = {
792 .init = &clk_usp1_init,
793 },
794};
795
796static struct clk_init_data clk_usp2_init = {
797 .name = "usp2",
798 .ops = &ios_ops,
799 .parent_names = std_clk_io_parents,
800 .num_parents = ARRAY_SIZE(std_clk_io_parents),
801};
802
803static struct clk_std clk_usp2 = {
804 .enable_bit = 41,
805 .hw = {
806 .init = &clk_usp2_init,
807 },
808};
809
810static struct clk_init_data clk_vip_init = {
811 .name = "vip",
812 .ops = &ios_ops,
813 .parent_names = std_clk_io_parents,
814 .num_parents = ARRAY_SIZE(std_clk_io_parents),
815};
816
817static struct clk_std clk_vip = {
818 .enable_bit = 42,
819 .hw = {
820 .init = &clk_vip_init,
821 },
822};
823
824static struct clk_init_data clk_spi0_init = {
825 .name = "spi0",
826 .ops = &ios_ops,
827 .parent_names = std_clk_io_parents,
828 .num_parents = ARRAY_SIZE(std_clk_io_parents),
829};
830
831static struct clk_std clk_spi0 = {
832 .enable_bit = 43,
833 .hw = {
834 .init = &clk_spi0_init,
835 },
836};
837
838static struct clk_init_data clk_spi1_init = {
839 .name = "spi1",
840 .ops = &ios_ops,
841 .parent_names = std_clk_io_parents,
842 .num_parents = ARRAY_SIZE(std_clk_io_parents),
843};
844
845static struct clk_std clk_spi1 = {
846 .enable_bit = 44,
847 .hw = {
848 .init = &clk_spi1_init,
849 },
850};
851
852static struct clk_init_data clk_tsc_init = {
853 .name = "tsc",
854 .ops = &ios_ops,
855 .parent_names = std_clk_io_parents,
856 .num_parents = ARRAY_SIZE(std_clk_io_parents),
857};
858
859static struct clk_std clk_tsc = {
860 .enable_bit = 45,
861 .hw = {
862 .init = &clk_tsc_init,
863 },
864};
865
866static struct clk_init_data clk_i2c0_init = {
867 .name = "i2c0",
868 .ops = &ios_ops,
869 .parent_names = std_clk_io_parents,
870 .num_parents = ARRAY_SIZE(std_clk_io_parents),
871};
872
873static struct clk_std clk_i2c0 = {
874 .enable_bit = 46,
875 .hw = {
876 .init = &clk_i2c0_init,
877 },
878};
879
880static struct clk_init_data clk_i2c1_init = {
881 .name = "i2c1",
882 .ops = &ios_ops,
883 .parent_names = std_clk_io_parents,
884 .num_parents = ARRAY_SIZE(std_clk_io_parents),
885};
886
887static struct clk_std clk_i2c1 = {
888 .enable_bit = 47,
889 .hw = {
890 .init = &clk_i2c1_init,
891 },
892};
893
894static struct clk_init_data clk_pwmc_init = {
895 .name = "pwmc",
896 .ops = &ios_ops,
897 .parent_names = std_clk_io_parents,
898 .num_parents = ARRAY_SIZE(std_clk_io_parents),
899};
900
901static struct clk_std clk_pwmc = {
902 .enable_bit = 48,
903 .hw = {
904 .init = &clk_pwmc_init,
905 },
906};
907
908static struct clk_init_data clk_efuse_init = {
909 .name = "efuse",
910 .ops = &ios_ops,
911 .parent_names = std_clk_io_parents,
912 .num_parents = ARRAY_SIZE(std_clk_io_parents),
913};
914
915static struct clk_std clk_efuse = {
916 .enable_bit = 49,
917 .hw = {
918 .init = &clk_efuse_init,
919 },
920};
921
922static struct clk_init_data clk_pulse_init = {
923 .name = "pulse",
924 .ops = &ios_ops,
925 .parent_names = std_clk_io_parents,
926 .num_parents = ARRAY_SIZE(std_clk_io_parents),
927};
928
929static struct clk_std clk_pulse = {
930 .enable_bit = 50,
931 .hw = {
932 .init = &clk_pulse_init,
933 },
934};
935
936static const char *std_clk_dsp_parents[] = {
937 "dsp",
938};
939
940static struct clk_init_data clk_gps_init = {
941 .name = "gps",
942 .ops = &ios_ops,
943 .parent_names = std_clk_dsp_parents,
944 .num_parents = ARRAY_SIZE(std_clk_dsp_parents),
945};
946
947static struct clk_std clk_gps = {
948 .enable_bit = 1,
949 .hw = {
950 .init = &clk_gps_init,
951 },
952};
953
954static struct clk_init_data clk_mf_init = {
955 .name = "mf",
956 .ops = &ios_ops,
957 .parent_names = std_clk_io_parents,
958 .num_parents = ARRAY_SIZE(std_clk_io_parents),
959};
960
961static struct clk_std clk_mf = {
962 .enable_bit = 2,
963 .hw = {
964 .init = &clk_mf_init,
965 },
966};
967
968static const char *std_clk_sys_parents[] = {
969 "sys",
970};
971
972static struct clk_init_data clk_security_init = {
973 .name = "mf",
974 .ops = &ios_ops,
975 .parent_names = std_clk_sys_parents,
976 .num_parents = ARRAY_SIZE(std_clk_sys_parents),
977};
978
979static struct clk_std clk_security = {
980 .enable_bit = 19,
981 .hw = {
982 .init = &clk_security_init,
983 },
984};
985
986static const char *std_clk_usb_parents[] = {
987 "usb_pll",
988};
989
990static struct clk_init_data clk_usb0_init = {
991 .name = "usb0",
992 .ops = &ios_ops,
993 .parent_names = std_clk_usb_parents,
994 .num_parents = ARRAY_SIZE(std_clk_usb_parents),
995};
996
997static struct clk_std clk_usb0 = {
998 .enable_bit = 16,
999 .hw = {
1000 .init = &clk_usb0_init,
1001 },
1002};
1003
1004static struct clk_init_data clk_usb1_init = {
1005 .name = "usb1",
1006 .ops = &ios_ops,
1007 .parent_names = std_clk_usb_parents,
1008 .num_parents = ARRAY_SIZE(std_clk_usb_parents),
1009};
1010
1011static struct clk_std clk_usb1 = {
1012 .enable_bit = 17,
1013 .hw = {
1014 .init = &clk_usb1_init,
1015 },
1016};
1017
1018static struct of_device_id clkc_ids[] = {
1019 { .compatible = "sirf,prima2-clkc" },
1020 {},
1021};
1022
1023static struct of_device_id rsc_ids[] = {
1024 { .compatible = "sirf,prima2-rsc" },
1025 {},
1026};
1027
1028void __init sirfsoc_of_clk_init(void)
1029{
1030 struct clk *clk;
1031 struct device_node *np;
1032
1033 np = of_find_matching_node(NULL, clkc_ids);
1034 if (!np)
1035 panic("unable to find compatible clkc node in dtb\n");
1036
1037 sirfsoc_clk_vbase = of_iomap(np, 0);
1038 if (!sirfsoc_clk_vbase)
1039 panic("unable to map clkc registers\n");
1040
1041 of_node_put(np);
1042
1043 np = of_find_matching_node(NULL, rsc_ids);
1044 if (!np)
1045 panic("unable to find compatible rsc node in dtb\n");
1046
1047 sirfsoc_rsc_vbase = of_iomap(np, 0);
1048 if (!sirfsoc_rsc_vbase)
1049 panic("unable to map rsc registers\n");
1050
1051 of_node_put(np);
1052
1053
1054 /* These are always available (RTC and 26MHz OSC)*/
1055 clk = clk_register_fixed_rate(NULL, "rtc", NULL,
1056 CLK_IS_ROOT, 32768);
1057 BUG_ON(!clk);
1058 clk = clk_register_fixed_rate(NULL, "osc", NULL,
1059 CLK_IS_ROOT, 26000000);
1060 BUG_ON(!clk);
1061
1062 clk = clk_register(NULL, &clk_pll1.hw);
1063 BUG_ON(!clk);
1064 clk = clk_register(NULL, &clk_pll2.hw);
1065 BUG_ON(!clk);
1066 clk = clk_register(NULL, &clk_pll3.hw);
1067 BUG_ON(!clk);
1068 clk = clk_register(NULL, &clk_mem.hw);
1069 BUG_ON(!clk);
1070 clk = clk_register(NULL, &clk_sys.hw);
1071 BUG_ON(!clk);
1072 clk = clk_register(NULL, &clk_security.hw);
1073 BUG_ON(!clk);
1074 clk_register_clkdev(clk, NULL, "b8030000.security");
1075 clk = clk_register(NULL, &clk_dsp.hw);
1076 BUG_ON(!clk);
1077 clk = clk_register(NULL, &clk_gps.hw);
1078 BUG_ON(!clk);
1079 clk_register_clkdev(clk, NULL, "a8010000.gps");
1080 clk = clk_register(NULL, &clk_mf.hw);
1081 BUG_ON(!clk);
1082 clk = clk_register(NULL, &clk_io.hw);
1083 BUG_ON(!clk);
1084 clk_register_clkdev(clk, NULL, "io");
1085 clk = clk_register(NULL, &clk_cpu.hw);
1086 BUG_ON(!clk);
1087 clk_register_clkdev(clk, NULL, "cpu");
1088 clk = clk_register(NULL, &clk_uart0.hw);
1089 BUG_ON(!clk);
1090 clk_register_clkdev(clk, NULL, "b0050000.uart");
1091 clk = clk_register(NULL, &clk_uart1.hw);
1092 BUG_ON(!clk);
1093 clk_register_clkdev(clk, NULL, "b0060000.uart");
1094 clk = clk_register(NULL, &clk_uart2.hw);
1095 BUG_ON(!clk);
1096 clk_register_clkdev(clk, NULL, "b0070000.uart");
1097 clk = clk_register(NULL, &clk_tsc.hw);
1098 BUG_ON(!clk);
1099 clk_register_clkdev(clk, NULL, "b0110000.tsc");
1100 clk = clk_register(NULL, &clk_i2c0.hw);
1101 BUG_ON(!clk);
1102 clk_register_clkdev(clk, NULL, "b00e0000.i2c");
1103 clk = clk_register(NULL, &clk_i2c1.hw);
1104 BUG_ON(!clk);
1105 clk_register_clkdev(clk, NULL, "b00f0000.i2c");
1106 clk = clk_register(NULL, &clk_spi0.hw);
1107 BUG_ON(!clk);
1108 clk_register_clkdev(clk, NULL, "b00d0000.spi");
1109 clk = clk_register(NULL, &clk_spi1.hw);
1110 BUG_ON(!clk);
1111 clk_register_clkdev(clk, NULL, "b0170000.spi");
1112 clk = clk_register(NULL, &clk_pwmc.hw);
1113 BUG_ON(!clk);
1114 clk_register_clkdev(clk, NULL, "b0130000.pwm");
1115 clk = clk_register(NULL, &clk_efuse.hw);
1116 BUG_ON(!clk);
1117 clk_register_clkdev(clk, NULL, "b0140000.efusesys");
1118 clk = clk_register(NULL, &clk_pulse.hw);
1119 BUG_ON(!clk);
1120 clk_register_clkdev(clk, NULL, "b0150000.pulsec");
1121 clk = clk_register(NULL, &clk_dmac0.hw);
1122 BUG_ON(!clk);
1123 clk_register_clkdev(clk, NULL, "b00b0000.dma-controller");
1124 clk = clk_register(NULL, &clk_dmac1.hw);
1125 BUG_ON(!clk);
1126 clk_register_clkdev(clk, NULL, "b0160000.dma-controller");
1127 clk = clk_register(NULL, &clk_nand.hw);
1128 BUG_ON(!clk);
1129 clk_register_clkdev(clk, NULL, "b0030000.nand");
1130 clk = clk_register(NULL, &clk_audio.hw);
1131 BUG_ON(!clk);
1132 clk_register_clkdev(clk, NULL, "b0040000.audio");
1133 clk = clk_register(NULL, &clk_usp0.hw);
1134 BUG_ON(!clk);
1135 clk_register_clkdev(clk, NULL, "b0080000.usp");
1136 clk = clk_register(NULL, &clk_usp1.hw);
1137 BUG_ON(!clk);
1138 clk_register_clkdev(clk, NULL, "b0090000.usp");
1139 clk = clk_register(NULL, &clk_usp2.hw);
1140 BUG_ON(!clk);
1141 clk_register_clkdev(clk, NULL, "b00a0000.usp");
1142 clk = clk_register(NULL, &clk_vip.hw);
1143 BUG_ON(!clk);
1144 clk_register_clkdev(clk, NULL, "b00c0000.vip");
1145 clk = clk_register(NULL, &clk_gfx.hw);
1146 BUG_ON(!clk);
1147 clk_register_clkdev(clk, NULL, "98000000.graphics");
1148 clk = clk_register(NULL, &clk_mm.hw);
1149 BUG_ON(!clk);
1150 clk_register_clkdev(clk, NULL, "a0000000.multimedia");
1151 clk = clk_register(NULL, &clk_lcd.hw);
1152 BUG_ON(!clk);
1153 clk_register_clkdev(clk, NULL, "90010000.display");
1154 clk = clk_register(NULL, &clk_vpp.hw);
1155 BUG_ON(!clk);
1156 clk_register_clkdev(clk, NULL, "90020000.vpp");
1157 clk = clk_register(NULL, &clk_mmc01.hw);
1158 BUG_ON(!clk);
1159 clk = clk_register(NULL, &clk_mmc23.hw);
1160 BUG_ON(!clk);
1161 clk = clk_register(NULL, &clk_mmc45.hw);
1162 BUG_ON(!clk);
1163 clk = clk_register(NULL, &usb_pll_clk_hw);
1164 BUG_ON(!clk);
1165 clk = clk_register(NULL, &clk_usb0.hw);
1166 BUG_ON(!clk);
1167 clk_register_clkdev(clk, NULL, "b00e0000.usb");
1168 clk = clk_register(NULL, &clk_usb1.hw);
1169 BUG_ON(!clk);
1170 clk_register_clkdev(clk, NULL, "b00f0000.usb");
1171}
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index efdfd009c270..56e4495ebeb1 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -558,25 +558,6 @@ int clk_enable(struct clk *clk)
558EXPORT_SYMBOL_GPL(clk_enable); 558EXPORT_SYMBOL_GPL(clk_enable);
559 559
560/** 560/**
561 * clk_get_rate - return the rate of clk
562 * @clk: the clk whose rate is being returned
563 *
564 * Simply returns the cached rate of the clk. Does not query the hardware. If
565 * clk is NULL then returns 0.
566 */
567unsigned long clk_get_rate(struct clk *clk)
568{
569 unsigned long rate;
570
571 mutex_lock(&prepare_lock);
572 rate = __clk_get_rate(clk);
573 mutex_unlock(&prepare_lock);
574
575 return rate;
576}
577EXPORT_SYMBOL_GPL(clk_get_rate);
578
579/**
580 * __clk_round_rate - round the given rate for a clk 561 * __clk_round_rate - round the given rate for a clk
581 * @clk: round the rate of this clock 562 * @clk: round the rate of this clock
582 * 563 *
@@ -702,6 +683,30 @@ static void __clk_recalc_rates(struct clk *clk, unsigned long msg)
702} 683}
703 684
704/** 685/**
686 * clk_get_rate - return the rate of clk
687 * @clk: the clk whose rate is being returned
688 *
689 * Simply returns the cached rate of the clk, unless CLK_GET_RATE_NOCACHE flag
690 * is set, which means a recalc_rate will be issued.
691 * If clk is NULL then returns 0.
692 */
693unsigned long clk_get_rate(struct clk *clk)
694{
695 unsigned long rate;
696
697 mutex_lock(&prepare_lock);
698
699 if (clk && (clk->flags & CLK_GET_RATE_NOCACHE))
700 __clk_recalc_rates(clk, 0);
701
702 rate = __clk_get_rate(clk);
703 mutex_unlock(&prepare_lock);
704
705 return rate;
706}
707EXPORT_SYMBOL_GPL(clk_get_rate);
708
709/**
705 * __clk_speculate_rates 710 * __clk_speculate_rates
706 * @clk: first clk in the subtree 711 * @clk: first clk in the subtree
707 * @parent_rate: the "future" rate of clk's parent 712 * @parent_rate: the "future" rate of clk's parent
@@ -1582,6 +1587,20 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
1582} 1587}
1583EXPORT_SYMBOL_GPL(of_clk_src_simple_get); 1588EXPORT_SYMBOL_GPL(of_clk_src_simple_get);
1584 1589
1590struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data)
1591{
1592 struct clk_onecell_data *clk_data = data;
1593 unsigned int idx = clkspec->args[0];
1594
1595 if (idx >= clk_data->clk_num) {
1596 pr_err("%s: invalid clock index %d\n", __func__, idx);
1597 return ERR_PTR(-EINVAL);
1598 }
1599
1600 return clk_data->clks[idx];
1601}
1602EXPORT_SYMBOL_GPL(of_clk_src_onecell_get);
1603
1585/** 1604/**
1586 * of_clk_add_provider() - Register a clock provider for a node 1605 * of_clk_add_provider() - Register a clock provider for a node
1587 * @np: Device node pointer associated with clock provider 1606 * @np: Device node pointer associated with clock provider
diff --git a/drivers/clk/mmp/Makefile b/drivers/clk/mmp/Makefile
new file mode 100644
index 000000000000..392d78044ce3
--- /dev/null
+++ b/drivers/clk/mmp/Makefile
@@ -0,0 +1,9 @@
1#
2# Makefile for mmp specific clk
3#
4
5obj-y += clk-apbc.o clk-apmu.o clk-frac.o
6
7obj-$(CONFIG_CPU_PXA168) += clk-pxa168.o
8obj-$(CONFIG_CPU_PXA910) += clk-pxa910.o
9obj-$(CONFIG_CPU_MMP2) += clk-mmp2.o
diff --git a/drivers/clk/mmp/clk-apbc.c b/drivers/clk/mmp/clk-apbc.c
new file mode 100644
index 000000000000..d14120eaa71f
--- /dev/null
+++ b/drivers/clk/mmp/clk-apbc.c
@@ -0,0 +1,152 @@
1/*
2 * mmp APB clock operation source file
3 *
4 * Copyright (C) 2012 Marvell
5 * Chao Xie <xiechao.mail@gmail.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/kernel.h>
13#include <linux/clk.h>
14#include <linux/io.h>
15#include <linux/err.h>
16#include <linux/delay.h>
17#include <linux/slab.h>
18
19#include "clk.h"
20
21/* Common APB clock register bit definitions */
22#define APBC_APBCLK (1 << 0) /* APB Bus Clock Enable */
23#define APBC_FNCLK (1 << 1) /* Functional Clock Enable */
24#define APBC_RST (1 << 2) /* Reset Generation */
25#define APBC_POWER (1 << 7) /* Reset Generation */
26
27#define to_clk_apbc(hw) container_of(hw, struct clk_apbc, hw)
28struct clk_apbc {
29 struct clk_hw hw;
30 void __iomem *base;
31 unsigned int delay;
32 unsigned int flags;
33 spinlock_t *lock;
34};
35
36static int clk_apbc_prepare(struct clk_hw *hw)
37{
38 struct clk_apbc *apbc = to_clk_apbc(hw);
39 unsigned int data;
40 unsigned long flags = 0;
41
42 /*
43 * It may share same register as MUX clock,
44 * and it will impact FNCLK enable. Spinlock is needed
45 */
46 if (apbc->lock)
47 spin_lock_irqsave(apbc->lock, flags);
48
49 data = readl_relaxed(apbc->base);
50 if (apbc->flags & APBC_POWER_CTRL)
51 data |= APBC_POWER;
52 data |= APBC_FNCLK;
53 writel_relaxed(data, apbc->base);
54
55 if (apbc->lock)
56 spin_unlock_irqrestore(apbc->lock, flags);
57
58 udelay(apbc->delay);
59
60 if (apbc->lock)
61 spin_lock_irqsave(apbc->lock, flags);
62
63 data = readl_relaxed(apbc->base);
64 data |= APBC_APBCLK;
65 writel_relaxed(data, apbc->base);
66
67 if (apbc->lock)
68 spin_unlock_irqrestore(apbc->lock, flags);
69
70 udelay(apbc->delay);
71
72 if (!(apbc->flags & APBC_NO_BUS_CTRL)) {
73 if (apbc->lock)
74 spin_lock_irqsave(apbc->lock, flags);
75
76 data = readl_relaxed(apbc->base);
77 data &= ~APBC_RST;
78 writel_relaxed(data, apbc->base);
79
80 if (apbc->lock)
81 spin_unlock_irqrestore(apbc->lock, flags);
82 }
83
84 return 0;
85}
86
87static void clk_apbc_unprepare(struct clk_hw *hw)
88{
89 struct clk_apbc *apbc = to_clk_apbc(hw);
90 unsigned long data;
91 unsigned long flags = 0;
92
93 if (apbc->lock)
94 spin_lock_irqsave(apbc->lock, flags);
95
96 data = readl_relaxed(apbc->base);
97 if (apbc->flags & APBC_POWER_CTRL)
98 data &= ~APBC_POWER;
99 data &= ~APBC_FNCLK;
100 writel_relaxed(data, apbc->base);
101
102 if (apbc->lock)
103 spin_unlock_irqrestore(apbc->lock, flags);
104
105 udelay(10);
106
107 if (apbc->lock)
108 spin_lock_irqsave(apbc->lock, flags);
109
110 data = readl_relaxed(apbc->base);
111 data &= ~APBC_APBCLK;
112 writel_relaxed(data, apbc->base);
113
114 if (apbc->lock)
115 spin_unlock_irqrestore(apbc->lock, flags);
116}
117
118struct clk_ops clk_apbc_ops = {
119 .prepare = clk_apbc_prepare,
120 .unprepare = clk_apbc_unprepare,
121};
122
123struct clk *mmp_clk_register_apbc(const char *name, const char *parent_name,
124 void __iomem *base, unsigned int delay,
125 unsigned int apbc_flags, spinlock_t *lock)
126{
127 struct clk_apbc *apbc;
128 struct clk *clk;
129 struct clk_init_data init;
130
131 apbc = kzalloc(sizeof(*apbc), GFP_KERNEL);
132 if (!apbc)
133 return NULL;
134
135 init.name = name;
136 init.ops = &clk_apbc_ops;
137 init.flags = CLK_SET_RATE_PARENT;
138 init.parent_names = (parent_name ? &parent_name : NULL);
139 init.num_parents = (parent_name ? 1 : 0);
140
141 apbc->base = base;
142 apbc->delay = delay;
143 apbc->flags = apbc_flags;
144 apbc->lock = lock;
145 apbc->hw.init = &init;
146
147 clk = clk_register(NULL, &apbc->hw);
148 if (IS_ERR(clk))
149 kfree(apbc);
150
151 return clk;
152}
diff --git a/drivers/clk/mmp/clk-apmu.c b/drivers/clk/mmp/clk-apmu.c
new file mode 100644
index 000000000000..abe182b2377f
--- /dev/null
+++ b/drivers/clk/mmp/clk-apmu.c
@@ -0,0 +1,97 @@
1/*
2 * mmp AXI peripharal clock operation source file
3 *
4 * Copyright (C) 2012 Marvell
5 * Chao Xie <xiechao.mail@gmail.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/kernel.h>
13#include <linux/clk.h>
14#include <linux/io.h>
15#include <linux/err.h>
16#include <linux/delay.h>
17#include <linux/slab.h>
18
19#include "clk.h"
20
21#define to_clk_apmu(clk) (container_of(clk, struct clk_apmu, clk))
22struct clk_apmu {
23 struct clk_hw hw;
24 void __iomem *base;
25 u32 rst_mask;
26 u32 enable_mask;
27 spinlock_t *lock;
28};
29
30static int clk_apmu_enable(struct clk_hw *hw)
31{
32 struct clk_apmu *apmu = to_clk_apmu(hw);
33 unsigned long data;
34 unsigned long flags = 0;
35
36 if (apmu->lock)
37 spin_lock_irqsave(apmu->lock, flags);
38
39 data = readl_relaxed(apmu->base) | apmu->enable_mask;
40 writel_relaxed(data, apmu->base);
41
42 if (apmu->lock)
43 spin_unlock_irqrestore(apmu->lock, flags);
44
45 return 0;
46}
47
48static void clk_apmu_disable(struct clk_hw *hw)
49{
50 struct clk_apmu *apmu = to_clk_apmu(hw);
51 unsigned long data;
52 unsigned long flags = 0;
53
54 if (apmu->lock)
55 spin_lock_irqsave(apmu->lock, flags);
56
57 data = readl_relaxed(apmu->base) & ~apmu->enable_mask;
58 writel_relaxed(data, apmu->base);
59
60 if (apmu->lock)
61 spin_unlock_irqrestore(apmu->lock, flags);
62}
63
64struct clk_ops clk_apmu_ops = {
65 .enable = clk_apmu_enable,
66 .disable = clk_apmu_disable,
67};
68
69struct clk *mmp_clk_register_apmu(const char *name, const char *parent_name,
70 void __iomem *base, u32 enable_mask, spinlock_t *lock)
71{
72 struct clk_apmu *apmu;
73 struct clk *clk;
74 struct clk_init_data init;
75
76 apmu = kzalloc(sizeof(*apmu), GFP_KERNEL);
77 if (!apmu)
78 return NULL;
79
80 init.name = name;
81 init.ops = &clk_apmu_ops;
82 init.flags = CLK_SET_RATE_PARENT;
83 init.parent_names = (parent_name ? &parent_name : NULL);
84 init.num_parents = (parent_name ? 1 : 0);
85
86 apmu->base = base;
87 apmu->enable_mask = enable_mask;
88 apmu->lock = lock;
89 apmu->hw.init = &init;
90
91 clk = clk_register(NULL, &apmu->hw);
92
93 if (IS_ERR(clk))
94 kfree(apmu);
95
96 return clk;
97}
diff --git a/drivers/clk/mmp/clk-frac.c b/drivers/clk/mmp/clk-frac.c
new file mode 100644
index 000000000000..80c1dd15d15c
--- /dev/null
+++ b/drivers/clk/mmp/clk-frac.c
@@ -0,0 +1,153 @@
1/*
2 * mmp factor clock operation source file
3 *
4 * Copyright (C) 2012 Marvell
5 * Chao Xie <xiechao.mail@gmail.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/clk-provider.h>
13#include <linux/slab.h>
14#include <linux/io.h>
15#include <linux/err.h>
16
17#include "clk.h"
18/*
19 * It is M/N clock
20 *
21 * Fout from synthesizer can be given from two equations:
22 * numerator/denominator = Fin / (Fout * factor)
23 */
24
25#define to_clk_factor(hw) container_of(hw, struct clk_factor, hw)
26struct clk_factor {
27 struct clk_hw hw;
28 void __iomem *base;
29 struct clk_factor_masks *masks;
30 struct clk_factor_tbl *ftbl;
31 unsigned int ftbl_cnt;
32};
33
34static long clk_factor_round_rate(struct clk_hw *hw, unsigned long drate,
35 unsigned long *prate)
36{
37 struct clk_factor *factor = to_clk_factor(hw);
38 unsigned long rate = 0, prev_rate;
39 int i;
40
41 for (i = 0; i < factor->ftbl_cnt; i++) {
42 prev_rate = rate;
43 rate = (((*prate / 10000) * factor->ftbl[i].num) /
44 (factor->ftbl[i].den * factor->masks->factor)) * 10000;
45 if (rate > drate)
46 break;
47 }
48 if (i == 0)
49 return rate;
50 else
51 return prev_rate;
52}
53
54static unsigned long clk_factor_recalc_rate(struct clk_hw *hw,
55 unsigned long parent_rate)
56{
57 struct clk_factor *factor = to_clk_factor(hw);
58 struct clk_factor_masks *masks = factor->masks;
59 unsigned int val, num, den;
60
61 val = readl_relaxed(factor->base);
62
63 /* calculate numerator */
64 num = (val >> masks->num_shift) & masks->num_mask;
65
66 /* calculate denominator */
67 den = (val >> masks->den_shift) & masks->num_mask;
68
69 if (!den)
70 return 0;
71
72 return (((parent_rate / 10000) * den) /
73 (num * factor->masks->factor)) * 10000;
74}
75
76/* Configures new clock rate*/
77static int clk_factor_set_rate(struct clk_hw *hw, unsigned long drate,
78 unsigned long prate)
79{
80 struct clk_factor *factor = to_clk_factor(hw);
81 struct clk_factor_masks *masks = factor->masks;
82 int i;
83 unsigned long val;
84 unsigned long prev_rate, rate = 0;
85
86 for (i = 0; i < factor->ftbl_cnt; i++) {
87 prev_rate = rate;
88 rate = (((prate / 10000) * factor->ftbl[i].num) /
89 (factor->ftbl[i].den * factor->masks->factor)) * 10000;
90 if (rate > drate)
91 break;
92 }
93 if (i > 0)
94 i--;
95
96 val = readl_relaxed(factor->base);
97
98 val &= ~(masks->num_mask << masks->num_shift);
99 val |= (factor->ftbl[i].num & masks->num_mask) << masks->num_shift;
100
101 val &= ~(masks->den_mask << masks->den_shift);
102 val |= (factor->ftbl[i].den & masks->den_mask) << masks->den_shift;
103
104 writel_relaxed(val, factor->base);
105
106 return 0;
107}
108
109static struct clk_ops clk_factor_ops = {
110 .recalc_rate = clk_factor_recalc_rate,
111 .round_rate = clk_factor_round_rate,
112 .set_rate = clk_factor_set_rate,
113};
114
115struct clk *mmp_clk_register_factor(const char *name, const char *parent_name,
116 unsigned long flags, void __iomem *base,
117 struct clk_factor_masks *masks, struct clk_factor_tbl *ftbl,
118 unsigned int ftbl_cnt)
119{
120 struct clk_factor *factor;
121 struct clk_init_data init;
122 struct clk *clk;
123
124 if (!masks) {
125 pr_err("%s: must pass a clk_factor_mask\n", __func__);
126 return ERR_PTR(-EINVAL);
127 }
128
129 factor = kzalloc(sizeof(*factor), GFP_KERNEL);
130 if (!factor) {
131 pr_err("%s: could not allocate factor clk\n", __func__);
132 return ERR_PTR(-ENOMEM);
133 }
134
135 /* struct clk_aux assignments */
136 factor->base = base;
137 factor->masks = masks;
138 factor->ftbl = ftbl;
139 factor->ftbl_cnt = ftbl_cnt;
140 factor->hw.init = &init;
141
142 init.name = name;
143 init.ops = &clk_factor_ops;
144 init.flags = flags;
145 init.parent_names = &parent_name;
146 init.num_parents = 1;
147
148 clk = clk_register(NULL, &factor->hw);
149 if (IS_ERR_OR_NULL(clk))
150 kfree(factor);
151
152 return clk;
153}
diff --git a/drivers/clk/mmp/clk-mmp2.c b/drivers/clk/mmp/clk-mmp2.c
new file mode 100644
index 000000000000..ade435820c7e
--- /dev/null
+++ b/drivers/clk/mmp/clk-mmp2.c
@@ -0,0 +1,449 @@
1/*
2 * mmp2 clock framework source file
3 *
4 * Copyright (C) 2012 Marvell
5 * Chao Xie <xiechao.mail@gmail.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/spinlock.h>
15#include <linux/io.h>
16#include <linux/delay.h>
17#include <linux/err.h>
18
19#include <mach/addr-map.h>
20
21#include "clk.h"
22
23#define APBC_RTC 0x0
24#define APBC_TWSI0 0x4
25#define APBC_TWSI1 0x8
26#define APBC_TWSI2 0xc
27#define APBC_TWSI3 0x10
28#define APBC_TWSI4 0x7c
29#define APBC_TWSI5 0x80
30#define APBC_KPC 0x18
31#define APBC_UART0 0x2c
32#define APBC_UART1 0x30
33#define APBC_UART2 0x34
34#define APBC_UART3 0x88
35#define APBC_GPIO 0x38
36#define APBC_PWM0 0x3c
37#define APBC_PWM1 0x40
38#define APBC_PWM2 0x44
39#define APBC_PWM3 0x48
40#define APBC_SSP0 0x50
41#define APBC_SSP1 0x54
42#define APBC_SSP2 0x58
43#define APBC_SSP3 0x5c
44#define APMU_SDH0 0x54
45#define APMU_SDH1 0x58
46#define APMU_SDH2 0xe8
47#define APMU_SDH3 0xec
48#define APMU_USB 0x5c
49#define APMU_DISP0 0x4c
50#define APMU_DISP1 0x110
51#define APMU_CCIC0 0x50
52#define APMU_CCIC1 0xf4
53#define MPMU_UART_PLL 0x14
54
55static DEFINE_SPINLOCK(clk_lock);
56
57static struct clk_factor_masks uart_factor_masks = {
58 .factor = 2,
59 .num_mask = 0x1fff,
60 .den_mask = 0x1fff,
61 .num_shift = 16,
62 .den_shift = 0,
63};
64
65static struct clk_factor_tbl uart_factor_tbl[] = {
66 {.num = 14634, .den = 2165}, /*14.745MHZ */
67 {.num = 3521, .den = 689}, /*19.23MHZ */
68 {.num = 9679, .den = 5728}, /*58.9824MHZ */
69 {.num = 15850, .den = 9451}, /*59.429MHZ */
70};
71
72static const char *uart_parent[] = {"uart_pll", "vctcxo"};
73static const char *ssp_parent[] = {"vctcxo_4", "vctcxo_2", "vctcxo", "pll1_16"};
74static const char *sdh_parent[] = {"pll1_4", "pll2", "usb_pll", "pll1"};
75static const char *disp_parent[] = {"pll1", "pll1_16", "pll2", "vctcxo"};
76static const char *ccic_parent[] = {"pll1_2", "pll1_16", "vctcxo"};
77
78void __init mmp2_clk_init(void)
79{
80 struct clk *clk;
81 struct clk *vctcxo;
82 void __iomem *mpmu_base;
83 void __iomem *apmu_base;
84 void __iomem *apbc_base;
85
86 mpmu_base = ioremap(APB_PHYS_BASE + 0x50000, SZ_4K);
87 if (mpmu_base == NULL) {
88 pr_err("error to ioremap MPMU base\n");
89 return;
90 }
91
92 apmu_base = ioremap(AXI_PHYS_BASE + 0x82800, SZ_4K);
93 if (apmu_base == NULL) {
94 pr_err("error to ioremap APMU base\n");
95 return;
96 }
97
98 apbc_base = ioremap(APB_PHYS_BASE + 0x15000, SZ_4K);
99 if (apbc_base == NULL) {
100 pr_err("error to ioremap APBC base\n");
101 return;
102 }
103
104 clk = clk_register_fixed_rate(NULL, "clk32", NULL, CLK_IS_ROOT, 3200);
105 clk_register_clkdev(clk, "clk32", NULL);
106
107 vctcxo = clk_register_fixed_rate(NULL, "vctcxo", NULL, CLK_IS_ROOT,
108 26000000);
109 clk_register_clkdev(vctcxo, "vctcxo", NULL);
110
111 clk = clk_register_fixed_rate(NULL, "pll1", NULL, CLK_IS_ROOT,
112 800000000);
113 clk_register_clkdev(clk, "pll1", NULL);
114
115 clk = clk_register_fixed_rate(NULL, "usb_pll", NULL, CLK_IS_ROOT,
116 480000000);
117 clk_register_clkdev(clk, "usb_pll", NULL);
118
119 clk = clk_register_fixed_rate(NULL, "pll2", NULL, CLK_IS_ROOT,
120 960000000);
121 clk_register_clkdev(clk, "pll2", NULL);
122
123 clk = clk_register_fixed_factor(NULL, "pll1_2", "pll1",
124 CLK_SET_RATE_PARENT, 1, 2);
125 clk_register_clkdev(clk, "pll1_2", NULL);
126
127 clk = clk_register_fixed_factor(NULL, "pll1_4", "pll1_2",
128 CLK_SET_RATE_PARENT, 1, 2);
129 clk_register_clkdev(clk, "pll1_4", NULL);
130
131 clk = clk_register_fixed_factor(NULL, "pll1_8", "pll1_4",
132 CLK_SET_RATE_PARENT, 1, 2);
133 clk_register_clkdev(clk, "pll1_8", NULL);
134
135 clk = clk_register_fixed_factor(NULL, "pll1_16", "pll1_8",
136 CLK_SET_RATE_PARENT, 1, 2);
137 clk_register_clkdev(clk, "pll1_16", NULL);
138
139 clk = clk_register_fixed_factor(NULL, "pll1_20", "pll1_4",
140 CLK_SET_RATE_PARENT, 1, 5);
141 clk_register_clkdev(clk, "pll1_20", NULL);
142
143 clk = clk_register_fixed_factor(NULL, "pll1_3", "pll1",
144 CLK_SET_RATE_PARENT, 1, 3);
145 clk_register_clkdev(clk, "pll1_3", NULL);
146
147 clk = clk_register_fixed_factor(NULL, "pll1_6", "pll1_3",
148 CLK_SET_RATE_PARENT, 1, 2);
149 clk_register_clkdev(clk, "pll1_6", NULL);
150
151 clk = clk_register_fixed_factor(NULL, "pll1_12", "pll1_6",
152 CLK_SET_RATE_PARENT, 1, 2);
153 clk_register_clkdev(clk, "pll1_12", NULL);
154
155 clk = clk_register_fixed_factor(NULL, "pll2_2", "pll2",
156 CLK_SET_RATE_PARENT, 1, 2);
157 clk_register_clkdev(clk, "pll2_2", NULL);
158
159 clk = clk_register_fixed_factor(NULL, "pll2_4", "pll2_2",
160 CLK_SET_RATE_PARENT, 1, 2);
161 clk_register_clkdev(clk, "pll2_4", NULL);
162
163 clk = clk_register_fixed_factor(NULL, "pll2_8", "pll2_4",
164 CLK_SET_RATE_PARENT, 1, 2);
165 clk_register_clkdev(clk, "pll2_8", NULL);
166
167 clk = clk_register_fixed_factor(NULL, "pll2_16", "pll2_8",
168 CLK_SET_RATE_PARENT, 1, 2);
169 clk_register_clkdev(clk, "pll2_16", NULL);
170
171 clk = clk_register_fixed_factor(NULL, "pll2_3", "pll2",
172 CLK_SET_RATE_PARENT, 1, 3);
173 clk_register_clkdev(clk, "pll2_3", NULL);
174
175 clk = clk_register_fixed_factor(NULL, "pll2_6", "pll2_3",
176 CLK_SET_RATE_PARENT, 1, 2);
177 clk_register_clkdev(clk, "pll2_6", NULL);
178
179 clk = clk_register_fixed_factor(NULL, "pll2_12", "pll2_6",
180 CLK_SET_RATE_PARENT, 1, 2);
181 clk_register_clkdev(clk, "pll2_12", NULL);
182
183 clk = clk_register_fixed_factor(NULL, "vctcxo_2", "vctcxo",
184 CLK_SET_RATE_PARENT, 1, 2);
185 clk_register_clkdev(clk, "vctcxo_2", NULL);
186
187 clk = clk_register_fixed_factor(NULL, "vctcxo_4", "vctcxo_2",
188 CLK_SET_RATE_PARENT, 1, 2);
189 clk_register_clkdev(clk, "vctcxo_4", NULL);
190
191 clk = mmp_clk_register_factor("uart_pll", "pll1_4", 0,
192 mpmu_base + MPMU_UART_PLL,
193 &uart_factor_masks, uart_factor_tbl,
194 ARRAY_SIZE(uart_factor_tbl));
195 clk_set_rate(clk, 14745600);
196 clk_register_clkdev(clk, "uart_pll", NULL);
197
198 clk = mmp_clk_register_apbc("twsi0", "vctcxo",
199 apbc_base + APBC_TWSI0, 10, 0, &clk_lock);
200 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.0");
201
202 clk = mmp_clk_register_apbc("twsi1", "vctcxo",
203 apbc_base + APBC_TWSI1, 10, 0, &clk_lock);
204 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.1");
205
206 clk = mmp_clk_register_apbc("twsi2", "vctcxo",
207 apbc_base + APBC_TWSI2, 10, 0, &clk_lock);
208 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.2");
209
210 clk = mmp_clk_register_apbc("twsi3", "vctcxo",
211 apbc_base + APBC_TWSI3, 10, 0, &clk_lock);
212 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.3");
213
214 clk = mmp_clk_register_apbc("twsi4", "vctcxo",
215 apbc_base + APBC_TWSI4, 10, 0, &clk_lock);
216 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.4");
217
218 clk = mmp_clk_register_apbc("twsi5", "vctcxo",
219 apbc_base + APBC_TWSI5, 10, 0, &clk_lock);
220 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.5");
221
222 clk = mmp_clk_register_apbc("gpio", "vctcxo",
223 apbc_base + APBC_GPIO, 10, 0, &clk_lock);
224 clk_register_clkdev(clk, NULL, "pxa-gpio");
225
226 clk = mmp_clk_register_apbc("kpc", "clk32",
227 apbc_base + APBC_KPC, 10, 0, &clk_lock);
228 clk_register_clkdev(clk, NULL, "pxa27x-keypad");
229
230 clk = mmp_clk_register_apbc("rtc", "clk32",
231 apbc_base + APBC_RTC, 10, 0, &clk_lock);
232 clk_register_clkdev(clk, NULL, "mmp-rtc");
233
234 clk = mmp_clk_register_apbc("pwm0", "vctcxo",
235 apbc_base + APBC_PWM0, 10, 0, &clk_lock);
236 clk_register_clkdev(clk, NULL, "mmp2-pwm.0");
237
238 clk = mmp_clk_register_apbc("pwm1", "vctcxo",
239 apbc_base + APBC_PWM1, 10, 0, &clk_lock);
240 clk_register_clkdev(clk, NULL, "mmp2-pwm.1");
241
242 clk = mmp_clk_register_apbc("pwm2", "vctcxo",
243 apbc_base + APBC_PWM2, 10, 0, &clk_lock);
244 clk_register_clkdev(clk, NULL, "mmp2-pwm.2");
245
246 clk = mmp_clk_register_apbc("pwm3", "vctcxo",
247 apbc_base + APBC_PWM3, 10, 0, &clk_lock);
248 clk_register_clkdev(clk, NULL, "mmp2-pwm.3");
249
250 clk = clk_register_mux(NULL, "uart0_mux", uart_parent,
251 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
252 apbc_base + APBC_UART0, 4, 3, 0, &clk_lock);
253 clk_set_parent(clk, vctcxo);
254 clk_register_clkdev(clk, "uart_mux.0", NULL);
255
256 clk = mmp_clk_register_apbc("uart0", "uart0_mux",
257 apbc_base + APBC_UART0, 10, 0, &clk_lock);
258 clk_register_clkdev(clk, NULL, "pxa2xx-uart.0");
259
260 clk = clk_register_mux(NULL, "uart1_mux", uart_parent,
261 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
262 apbc_base + APBC_UART1, 4, 3, 0, &clk_lock);
263 clk_set_parent(clk, vctcxo);
264 clk_register_clkdev(clk, "uart_mux.1", NULL);
265
266 clk = mmp_clk_register_apbc("uart1", "uart1_mux",
267 apbc_base + APBC_UART1, 10, 0, &clk_lock);
268 clk_register_clkdev(clk, NULL, "pxa2xx-uart.1");
269
270 clk = clk_register_mux(NULL, "uart2_mux", uart_parent,
271 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
272 apbc_base + APBC_UART2, 4, 3, 0, &clk_lock);
273 clk_set_parent(clk, vctcxo);
274 clk_register_clkdev(clk, "uart_mux.2", NULL);
275
276 clk = mmp_clk_register_apbc("uart2", "uart2_mux",
277 apbc_base + APBC_UART2, 10, 0, &clk_lock);
278 clk_register_clkdev(clk, NULL, "pxa2xx-uart.2");
279
280 clk = clk_register_mux(NULL, "uart3_mux", uart_parent,
281 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
282 apbc_base + APBC_UART3, 4, 3, 0, &clk_lock);
283 clk_set_parent(clk, vctcxo);
284 clk_register_clkdev(clk, "uart_mux.3", NULL);
285
286 clk = mmp_clk_register_apbc("uart3", "uart3_mux",
287 apbc_base + APBC_UART3, 10, 0, &clk_lock);
288 clk_register_clkdev(clk, NULL, "pxa2xx-uart.3");
289
290 clk = clk_register_mux(NULL, "ssp0_mux", ssp_parent,
291 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
292 apbc_base + APBC_SSP0, 4, 3, 0, &clk_lock);
293 clk_register_clkdev(clk, "uart_mux.0", NULL);
294
295 clk = mmp_clk_register_apbc("ssp0", "ssp0_mux",
296 apbc_base + APBC_SSP0, 10, 0, &clk_lock);
297 clk_register_clkdev(clk, NULL, "mmp-ssp.0");
298
299 clk = clk_register_mux(NULL, "ssp1_mux", ssp_parent,
300 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
301 apbc_base + APBC_SSP1, 4, 3, 0, &clk_lock);
302 clk_register_clkdev(clk, "ssp_mux.1", NULL);
303
304 clk = mmp_clk_register_apbc("ssp1", "ssp1_mux",
305 apbc_base + APBC_SSP1, 10, 0, &clk_lock);
306 clk_register_clkdev(clk, NULL, "mmp-ssp.1");
307
308 clk = clk_register_mux(NULL, "ssp2_mux", ssp_parent,
309 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
310 apbc_base + APBC_SSP2, 4, 3, 0, &clk_lock);
311 clk_register_clkdev(clk, "ssp_mux.2", NULL);
312
313 clk = mmp_clk_register_apbc("ssp2", "ssp2_mux",
314 apbc_base + APBC_SSP2, 10, 0, &clk_lock);
315 clk_register_clkdev(clk, NULL, "mmp-ssp.2");
316
317 clk = clk_register_mux(NULL, "ssp3_mux", ssp_parent,
318 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
319 apbc_base + APBC_SSP3, 4, 3, 0, &clk_lock);
320 clk_register_clkdev(clk, "ssp_mux.3", NULL);
321
322 clk = mmp_clk_register_apbc("ssp3", "ssp3_mux",
323 apbc_base + APBC_SSP3, 10, 0, &clk_lock);
324 clk_register_clkdev(clk, NULL, "mmp-ssp.3");
325
326 clk = clk_register_mux(NULL, "sdh_mux", sdh_parent,
327 ARRAY_SIZE(sdh_parent), CLK_SET_RATE_PARENT,
328 apmu_base + APMU_SDH0, 8, 2, 0, &clk_lock);
329 clk_register_clkdev(clk, "sdh_mux", NULL);
330
331 clk = clk_register_divider(NULL, "sdh_div", "sdh_mux",
332 CLK_SET_RATE_PARENT, apmu_base + APMU_SDH0,
333 10, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
334 clk_register_clkdev(clk, "sdh_div", NULL);
335
336 clk = mmp_clk_register_apmu("sdh0", "sdh_div", apmu_base + APMU_SDH0,
337 0x1b, &clk_lock);
338 clk_register_clkdev(clk, NULL, "sdhci-pxav3.0");
339
340 clk = mmp_clk_register_apmu("sdh1", "sdh_div", apmu_base + APMU_SDH1,
341 0x1b, &clk_lock);
342 clk_register_clkdev(clk, NULL, "sdhci-pxav3.1");
343
344 clk = mmp_clk_register_apmu("sdh2", "sdh_div", apmu_base + APMU_SDH2,
345 0x1b, &clk_lock);
346 clk_register_clkdev(clk, NULL, "sdhci-pxav3.2");
347
348 clk = mmp_clk_register_apmu("sdh3", "sdh_div", apmu_base + APMU_SDH3,
349 0x1b, &clk_lock);
350 clk_register_clkdev(clk, NULL, "sdhci-pxav3.3");
351
352 clk = mmp_clk_register_apmu("usb", "usb_pll", apmu_base + APMU_USB,
353 0x9, &clk_lock);
354 clk_register_clkdev(clk, "usb_clk", NULL);
355
356 clk = clk_register_mux(NULL, "disp0_mux", disp_parent,
357 ARRAY_SIZE(disp_parent), CLK_SET_RATE_PARENT,
358 apmu_base + APMU_DISP0, 6, 2, 0, &clk_lock);
359 clk_register_clkdev(clk, "disp_mux.0", NULL);
360
361 clk = clk_register_divider(NULL, "disp0_div", "disp0_mux",
362 CLK_SET_RATE_PARENT, apmu_base + APMU_DISP0,
363 8, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
364 clk_register_clkdev(clk, "disp_div.0", NULL);
365
366 clk = mmp_clk_register_apmu("disp0", "disp0_div",
367 apmu_base + APMU_DISP0, 0x1b, &clk_lock);
368 clk_register_clkdev(clk, NULL, "mmp-disp.0");
369
370 clk = clk_register_divider(NULL, "disp0_sphy_div", "disp0_mux", 0,
371 apmu_base + APMU_DISP0, 15, 5, 0, &clk_lock);
372 clk_register_clkdev(clk, "disp_sphy_div.0", NULL);
373
374 clk = mmp_clk_register_apmu("disp0_sphy", "disp0_sphy_div",
375 apmu_base + APMU_DISP0, 0x1024, &clk_lock);
376 clk_register_clkdev(clk, "disp_sphy.0", NULL);
377
378 clk = clk_register_mux(NULL, "disp1_mux", disp_parent,
379 ARRAY_SIZE(disp_parent), CLK_SET_RATE_PARENT,
380 apmu_base + APMU_DISP1, 6, 2, 0, &clk_lock);
381 clk_register_clkdev(clk, "disp_mux.1", NULL);
382
383 clk = clk_register_divider(NULL, "disp1_div", "disp1_mux",
384 CLK_SET_RATE_PARENT, apmu_base + APMU_DISP1,
385 8, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
386 clk_register_clkdev(clk, "disp_div.1", NULL);
387
388 clk = mmp_clk_register_apmu("disp1", "disp1_div",
389 apmu_base + APMU_DISP1, 0x1b, &clk_lock);
390 clk_register_clkdev(clk, NULL, "mmp-disp.1");
391
392 clk = mmp_clk_register_apmu("ccic_arbiter", "vctcxo",
393 apmu_base + APMU_CCIC0, 0x1800, &clk_lock);
394 clk_register_clkdev(clk, "ccic_arbiter", NULL);
395
396 clk = clk_register_mux(NULL, "ccic0_mux", ccic_parent,
397 ARRAY_SIZE(ccic_parent), CLK_SET_RATE_PARENT,
398 apmu_base + APMU_CCIC0, 6, 2, 0, &clk_lock);
399 clk_register_clkdev(clk, "ccic_mux.0", NULL);
400
401 clk = clk_register_divider(NULL, "ccic0_div", "ccic0_mux",
402 CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC0,
403 17, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
404 clk_register_clkdev(clk, "ccic_div.0", NULL);
405
406 clk = mmp_clk_register_apmu("ccic0", "ccic0_div",
407 apmu_base + APMU_CCIC0, 0x1b, &clk_lock);
408 clk_register_clkdev(clk, "fnclk", "mmp-ccic.0");
409
410 clk = mmp_clk_register_apmu("ccic0_phy", "ccic0_div",
411 apmu_base + APMU_CCIC0, 0x24, &clk_lock);
412 clk_register_clkdev(clk, "phyclk", "mmp-ccic.0");
413
414 clk = clk_register_divider(NULL, "ccic0_sphy_div", "ccic0_div",
415 CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC0,
416 10, 5, 0, &clk_lock);
417 clk_register_clkdev(clk, "sphyclk_div", "mmp-ccic.0");
418
419 clk = mmp_clk_register_apmu("ccic0_sphy", "ccic0_sphy_div",
420 apmu_base + APMU_CCIC0, 0x300, &clk_lock);
421 clk_register_clkdev(clk, "sphyclk", "mmp-ccic.0");
422
423 clk = clk_register_mux(NULL, "ccic1_mux", ccic_parent,
424 ARRAY_SIZE(ccic_parent), CLK_SET_RATE_PARENT,
425 apmu_base + APMU_CCIC1, 6, 2, 0, &clk_lock);
426 clk_register_clkdev(clk, "ccic_mux.1", NULL);
427
428 clk = clk_register_divider(NULL, "ccic1_div", "ccic1_mux",
429 CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC1,
430 16, 4, CLK_DIVIDER_ONE_BASED, &clk_lock);
431 clk_register_clkdev(clk, "ccic_div.1", NULL);
432
433 clk = mmp_clk_register_apmu("ccic1", "ccic1_div",
434 apmu_base + APMU_CCIC1, 0x1b, &clk_lock);
435 clk_register_clkdev(clk, "fnclk", "mmp-ccic.1");
436
437 clk = mmp_clk_register_apmu("ccic1_phy", "ccic1_div",
438 apmu_base + APMU_CCIC1, 0x24, &clk_lock);
439 clk_register_clkdev(clk, "phyclk", "mmp-ccic.1");
440
441 clk = clk_register_divider(NULL, "ccic1_sphy_div", "ccic1_div",
442 CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC1,
443 10, 5, 0, &clk_lock);
444 clk_register_clkdev(clk, "sphyclk_div", "mmp-ccic.1");
445
446 clk = mmp_clk_register_apmu("ccic1_sphy", "ccic1_sphy_div",
447 apmu_base + APMU_CCIC1, 0x300, &clk_lock);
448 clk_register_clkdev(clk, "sphyclk", "mmp-ccic.1");
449}
diff --git a/drivers/clk/mmp/clk-pxa168.c b/drivers/clk/mmp/clk-pxa168.c
new file mode 100644
index 000000000000..e8d036c12cbf
--- /dev/null
+++ b/drivers/clk/mmp/clk-pxa168.c
@@ -0,0 +1,346 @@
1/*
2 * pxa168 clock framework source file
3 *
4 * Copyright (C) 2012 Marvell
5 * Chao Xie <xiechao.mail@gmail.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/spinlock.h>
15#include <linux/io.h>
16#include <linux/delay.h>
17#include <linux/err.h>
18
19#include <mach/addr-map.h>
20
21#include "clk.h"
22
23#define APBC_RTC 0x28
24#define APBC_TWSI0 0x2c
25#define APBC_KPC 0x30
26#define APBC_UART0 0x0
27#define APBC_UART1 0x4
28#define APBC_GPIO 0x8
29#define APBC_PWM0 0xc
30#define APBC_PWM1 0x10
31#define APBC_PWM2 0x14
32#define APBC_PWM3 0x18
33#define APBC_SSP0 0x81c
34#define APBC_SSP1 0x820
35#define APBC_SSP2 0x84c
36#define APBC_SSP3 0x858
37#define APBC_SSP4 0x85c
38#define APBC_TWSI1 0x6c
39#define APBC_UART2 0x70
40#define APMU_SDH0 0x54
41#define APMU_SDH1 0x58
42#define APMU_USB 0x5c
43#define APMU_DISP0 0x4c
44#define APMU_CCIC0 0x50
45#define APMU_DFC 0x60
46#define MPMU_UART_PLL 0x14
47
48static DEFINE_SPINLOCK(clk_lock);
49
50static struct clk_factor_masks uart_factor_masks = {
51 .factor = 2,
52 .num_mask = 0x1fff,
53 .den_mask = 0x1fff,
54 .num_shift = 16,
55 .den_shift = 0,
56};
57
58static struct clk_factor_tbl uart_factor_tbl[] = {
59 {.num = 8125, .den = 1536}, /*14.745MHZ */
60};
61
62static const char *uart_parent[] = {"pll1_3_16", "uart_pll"};
63static const char *ssp_parent[] = {"pll1_96", "pll1_48", "pll1_24", "pll1_12"};
64static const char *sdh_parent[] = {"pll1_12", "pll1_13"};
65static const char *disp_parent[] = {"pll1_2", "pll1_12"};
66static const char *ccic_parent[] = {"pll1_2", "pll1_12"};
67static const char *ccic_phy_parent[] = {"pll1_6", "pll1_12"};
68
69void __init pxa168_clk_init(void)
70{
71 struct clk *clk;
72 struct clk *uart_pll;
73 void __iomem *mpmu_base;
74 void __iomem *apmu_base;
75 void __iomem *apbc_base;
76
77 mpmu_base = ioremap(APB_PHYS_BASE + 0x50000, SZ_4K);
78 if (mpmu_base == NULL) {
79 pr_err("error to ioremap MPMU base\n");
80 return;
81 }
82
83 apmu_base = ioremap(AXI_PHYS_BASE + 0x82800, SZ_4K);
84 if (apmu_base == NULL) {
85 pr_err("error to ioremap APMU base\n");
86 return;
87 }
88
89 apbc_base = ioremap(APB_PHYS_BASE + 0x15000, SZ_4K);
90 if (apbc_base == NULL) {
91 pr_err("error to ioremap APBC base\n");
92 return;
93 }
94
95 clk = clk_register_fixed_rate(NULL, "clk32", NULL, CLK_IS_ROOT, 3200);
96 clk_register_clkdev(clk, "clk32", NULL);
97
98 clk = clk_register_fixed_rate(NULL, "vctcxo", NULL, CLK_IS_ROOT,
99 26000000);
100 clk_register_clkdev(clk, "vctcxo", NULL);
101
102 clk = clk_register_fixed_rate(NULL, "pll1", NULL, CLK_IS_ROOT,
103 624000000);
104 clk_register_clkdev(clk, "pll1", NULL);
105
106 clk = clk_register_fixed_factor(NULL, "pll1_2", "pll1",
107 CLK_SET_RATE_PARENT, 1, 2);
108 clk_register_clkdev(clk, "pll1_2", NULL);
109
110 clk = clk_register_fixed_factor(NULL, "pll1_4", "pll1_2",
111 CLK_SET_RATE_PARENT, 1, 2);
112 clk_register_clkdev(clk, "pll1_4", NULL);
113
114 clk = clk_register_fixed_factor(NULL, "pll1_8", "pll1_4",
115 CLK_SET_RATE_PARENT, 1, 2);
116 clk_register_clkdev(clk, "pll1_8", NULL);
117
118 clk = clk_register_fixed_factor(NULL, "pll1_16", "pll1_8",
119 CLK_SET_RATE_PARENT, 1, 2);
120 clk_register_clkdev(clk, "pll1_16", NULL);
121
122 clk = clk_register_fixed_factor(NULL, "pll1_6", "pll1_2",
123 CLK_SET_RATE_PARENT, 1, 3);
124 clk_register_clkdev(clk, "pll1_6", NULL);
125
126 clk = clk_register_fixed_factor(NULL, "pll1_12", "pll1_6",
127 CLK_SET_RATE_PARENT, 1, 2);
128 clk_register_clkdev(clk, "pll1_12", NULL);
129
130 clk = clk_register_fixed_factor(NULL, "pll1_24", "pll1_12",
131 CLK_SET_RATE_PARENT, 1, 2);
132 clk_register_clkdev(clk, "pll1_24", NULL);
133
134 clk = clk_register_fixed_factor(NULL, "pll1_48", "pll1_24",
135 CLK_SET_RATE_PARENT, 1, 2);
136 clk_register_clkdev(clk, "pll1_48", NULL);
137
138 clk = clk_register_fixed_factor(NULL, "pll1_96", "pll1_48",
139 CLK_SET_RATE_PARENT, 1, 2);
140 clk_register_clkdev(clk, "pll1_96", NULL);
141
142 clk = clk_register_fixed_factor(NULL, "pll1_13", "pll1",
143 CLK_SET_RATE_PARENT, 1, 13);
144 clk_register_clkdev(clk, "pll1_13", NULL);
145
146 clk = clk_register_fixed_factor(NULL, "pll1_13_1_5", "pll1",
147 CLK_SET_RATE_PARENT, 2, 3);
148 clk_register_clkdev(clk, "pll1_13_1_5", NULL);
149
150 clk = clk_register_fixed_factor(NULL, "pll1_2_1_5", "pll1",
151 CLK_SET_RATE_PARENT, 2, 3);
152 clk_register_clkdev(clk, "pll1_2_1_5", NULL);
153
154 clk = clk_register_fixed_factor(NULL, "pll1_3_16", "pll1",
155 CLK_SET_RATE_PARENT, 3, 16);
156 clk_register_clkdev(clk, "pll1_3_16", NULL);
157
158 uart_pll = mmp_clk_register_factor("uart_pll", "pll1_4", 0,
159 mpmu_base + MPMU_UART_PLL,
160 &uart_factor_masks, uart_factor_tbl,
161 ARRAY_SIZE(uart_factor_tbl));
162 clk_set_rate(uart_pll, 14745600);
163 clk_register_clkdev(uart_pll, "uart_pll", NULL);
164
165 clk = mmp_clk_register_apbc("twsi0", "pll1_13_1_5",
166 apbc_base + APBC_TWSI0, 10, 0, &clk_lock);
167 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.0");
168
169 clk = mmp_clk_register_apbc("twsi1", "pll1_13_1_5",
170 apbc_base + APBC_TWSI1, 10, 0, &clk_lock);
171 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.1");
172
173 clk = mmp_clk_register_apbc("gpio", "vctcxo",
174 apbc_base + APBC_GPIO, 10, 0, &clk_lock);
175 clk_register_clkdev(clk, NULL, "pxa-gpio");
176
177 clk = mmp_clk_register_apbc("kpc", "clk32",
178 apbc_base + APBC_KPC, 10, 0, &clk_lock);
179 clk_register_clkdev(clk, NULL, "pxa27x-keypad");
180
181 clk = mmp_clk_register_apbc("rtc", "clk32",
182 apbc_base + APBC_RTC, 10, 0, &clk_lock);
183 clk_register_clkdev(clk, NULL, "sa1100-rtc");
184
185 clk = mmp_clk_register_apbc("pwm0", "pll1_48",
186 apbc_base + APBC_PWM0, 10, 0, &clk_lock);
187 clk_register_clkdev(clk, NULL, "pxa168-pwm.0");
188
189 clk = mmp_clk_register_apbc("pwm1", "pll1_48",
190 apbc_base + APBC_PWM1, 10, 0, &clk_lock);
191 clk_register_clkdev(clk, NULL, "pxa168-pwm.1");
192
193 clk = mmp_clk_register_apbc("pwm2", "pll1_48",
194 apbc_base + APBC_PWM2, 10, 0, &clk_lock);
195 clk_register_clkdev(clk, NULL, "pxa168-pwm.2");
196
197 clk = mmp_clk_register_apbc("pwm3", "pll1_48",
198 apbc_base + APBC_PWM3, 10, 0, &clk_lock);
199 clk_register_clkdev(clk, NULL, "pxa168-pwm.3");
200
201 clk = clk_register_mux(NULL, "uart0_mux", uart_parent,
202 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
203 apbc_base + APBC_UART0, 4, 3, 0, &clk_lock);
204 clk_set_parent(clk, uart_pll);
205 clk_register_clkdev(clk, "uart_mux.0", NULL);
206
207 clk = mmp_clk_register_apbc("uart0", "uart0_mux",
208 apbc_base + APBC_UART0, 10, 0, &clk_lock);
209 clk_register_clkdev(clk, NULL, "pxa2xx-uart.0");
210
211 clk = clk_register_mux(NULL, "uart1_mux", uart_parent,
212 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
213 apbc_base + APBC_UART1, 4, 3, 0, &clk_lock);
214 clk_set_parent(clk, uart_pll);
215 clk_register_clkdev(clk, "uart_mux.1", NULL);
216
217 clk = mmp_clk_register_apbc("uart1", "uart1_mux",
218 apbc_base + APBC_UART1, 10, 0, &clk_lock);
219 clk_register_clkdev(clk, NULL, "pxa2xx-uart.1");
220
221 clk = clk_register_mux(NULL, "uart2_mux", uart_parent,
222 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
223 apbc_base + APBC_UART2, 4, 3, 0, &clk_lock);
224 clk_set_parent(clk, uart_pll);
225 clk_register_clkdev(clk, "uart_mux.2", NULL);
226
227 clk = mmp_clk_register_apbc("uart2", "uart2_mux",
228 apbc_base + APBC_UART2, 10, 0, &clk_lock);
229 clk_register_clkdev(clk, NULL, "pxa2xx-uart.2");
230
231 clk = clk_register_mux(NULL, "ssp0_mux", ssp_parent,
232 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
233 apbc_base + APBC_SSP0, 4, 3, 0, &clk_lock);
234 clk_register_clkdev(clk, "uart_mux.0", NULL);
235
236 clk = mmp_clk_register_apbc("ssp0", "ssp0_mux", apbc_base + APBC_SSP0,
237 10, 0, &clk_lock);
238 clk_register_clkdev(clk, NULL, "mmp-ssp.0");
239
240 clk = clk_register_mux(NULL, "ssp1_mux", ssp_parent,
241 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
242 apbc_base + APBC_SSP1, 4, 3, 0, &clk_lock);
243 clk_register_clkdev(clk, "ssp_mux.1", NULL);
244
245 clk = mmp_clk_register_apbc("ssp1", "ssp1_mux", apbc_base + APBC_SSP1,
246 10, 0, &clk_lock);
247 clk_register_clkdev(clk, NULL, "mmp-ssp.1");
248
249 clk = clk_register_mux(NULL, "ssp2_mux", ssp_parent,
250 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
251 apbc_base + APBC_SSP2, 4, 3, 0, &clk_lock);
252 clk_register_clkdev(clk, "ssp_mux.2", NULL);
253
254 clk = mmp_clk_register_apbc("ssp2", "ssp1_mux", apbc_base + APBC_SSP2,
255 10, 0, &clk_lock);
256 clk_register_clkdev(clk, NULL, "mmp-ssp.2");
257
258 clk = clk_register_mux(NULL, "ssp3_mux", ssp_parent,
259 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
260 apbc_base + APBC_SSP3, 4, 3, 0, &clk_lock);
261 clk_register_clkdev(clk, "ssp_mux.3", NULL);
262
263 clk = mmp_clk_register_apbc("ssp3", "ssp1_mux", apbc_base + APBC_SSP3,
264 10, 0, &clk_lock);
265 clk_register_clkdev(clk, NULL, "mmp-ssp.3");
266
267 clk = clk_register_mux(NULL, "ssp4_mux", ssp_parent,
268 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
269 apbc_base + APBC_SSP4, 4, 3, 0, &clk_lock);
270 clk_register_clkdev(clk, "ssp_mux.4", NULL);
271
272 clk = mmp_clk_register_apbc("ssp4", "ssp1_mux", apbc_base + APBC_SSP4,
273 10, 0, &clk_lock);
274 clk_register_clkdev(clk, NULL, "mmp-ssp.4");
275
276 clk = mmp_clk_register_apmu("dfc", "pll1_4", apmu_base + APMU_DFC,
277 0x19b, &clk_lock);
278 clk_register_clkdev(clk, NULL, "pxa3xx-nand.0");
279
280 clk = clk_register_mux(NULL, "sdh0_mux", sdh_parent,
281 ARRAY_SIZE(sdh_parent), CLK_SET_RATE_PARENT,
282 apmu_base + APMU_SDH0, 6, 1, 0, &clk_lock);
283 clk_register_clkdev(clk, "sdh0_mux", NULL);
284
285 clk = mmp_clk_register_apmu("sdh0", "sdh_mux", apmu_base + APMU_SDH0,
286 0x1b, &clk_lock);
287 clk_register_clkdev(clk, NULL, "sdhci-pxa.0");
288
289 clk = clk_register_mux(NULL, "sdh1_mux", sdh_parent,
290 ARRAY_SIZE(sdh_parent), CLK_SET_RATE_PARENT,
291 apmu_base + APMU_SDH1, 6, 1, 0, &clk_lock);
292 clk_register_clkdev(clk, "sdh1_mux", NULL);
293
294 clk = mmp_clk_register_apmu("sdh1", "sdh1_mux", apmu_base + APMU_SDH1,
295 0x1b, &clk_lock);
296 clk_register_clkdev(clk, NULL, "sdhci-pxa.1");
297
298 clk = mmp_clk_register_apmu("usb", "usb_pll", apmu_base + APMU_USB,
299 0x9, &clk_lock);
300 clk_register_clkdev(clk, "usb_clk", NULL);
301
302 clk = mmp_clk_register_apmu("sph", "usb_pll", apmu_base + APMU_USB,
303 0x12, &clk_lock);
304 clk_register_clkdev(clk, "sph_clk", NULL);
305
306 clk = clk_register_mux(NULL, "disp0_mux", disp_parent,
307 ARRAY_SIZE(disp_parent), CLK_SET_RATE_PARENT,
308 apmu_base + APMU_DISP0, 6, 1, 0, &clk_lock);
309 clk_register_clkdev(clk, "disp_mux.0", NULL);
310
311 clk = mmp_clk_register_apmu("disp0", "disp0_mux",
312 apmu_base + APMU_DISP0, 0x1b, &clk_lock);
313 clk_register_clkdev(clk, "fnclk", "mmp-disp.0");
314
315 clk = mmp_clk_register_apmu("disp0_hclk", "disp0_mux",
316 apmu_base + APMU_DISP0, 0x24, &clk_lock);
317 clk_register_clkdev(clk, "hclk", "mmp-disp.0");
318
319 clk = clk_register_mux(NULL, "ccic0_mux", ccic_parent,
320 ARRAY_SIZE(ccic_parent), CLK_SET_RATE_PARENT,
321 apmu_base + APMU_CCIC0, 6, 1, 0, &clk_lock);
322 clk_register_clkdev(clk, "ccic_mux.0", NULL);
323
324 clk = mmp_clk_register_apmu("ccic0", "ccic0_mux",
325 apmu_base + APMU_CCIC0, 0x1b, &clk_lock);
326 clk_register_clkdev(clk, "fnclk", "mmp-ccic.0");
327
328 clk = clk_register_mux(NULL, "ccic0_phy_mux", ccic_phy_parent,
329 ARRAY_SIZE(ccic_phy_parent),
330 CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC0,
331 7, 1, 0, &clk_lock);
332 clk_register_clkdev(clk, "ccic_phy_mux.0", NULL);
333
334 clk = mmp_clk_register_apmu("ccic0_phy", "ccic0_phy_mux",
335 apmu_base + APMU_CCIC0, 0x24, &clk_lock);
336 clk_register_clkdev(clk, "phyclk", "mmp-ccic.0");
337
338 clk = clk_register_divider(NULL, "ccic0_sphy_div", "ccic0_mux",
339 CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC0,
340 10, 5, 0, &clk_lock);
341 clk_register_clkdev(clk, "sphyclk_div", NULL);
342
343 clk = mmp_clk_register_apmu("ccic0_sphy", "ccic0_sphy_div",
344 apmu_base + APMU_CCIC0, 0x300, &clk_lock);
345 clk_register_clkdev(clk, "sphyclk", "mmp-ccic.0");
346}
diff --git a/drivers/clk/mmp/clk-pxa910.c b/drivers/clk/mmp/clk-pxa910.c
new file mode 100644
index 000000000000..7048c31d6e7e
--- /dev/null
+++ b/drivers/clk/mmp/clk-pxa910.c
@@ -0,0 +1,320 @@
1/*
2 * pxa910 clock framework source file
3 *
4 * Copyright (C) 2012 Marvell
5 * Chao Xie <xiechao.mail@gmail.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/spinlock.h>
15#include <linux/io.h>
16#include <linux/delay.h>
17#include <linux/err.h>
18
19#include <mach/addr-map.h>
20
21#include "clk.h"
22
23#define APBC_RTC 0x28
24#define APBC_TWSI0 0x2c
25#define APBC_KPC 0x18
26#define APBC_UART0 0x0
27#define APBC_UART1 0x4
28#define APBC_GPIO 0x8
29#define APBC_PWM0 0xc
30#define APBC_PWM1 0x10
31#define APBC_PWM2 0x14
32#define APBC_PWM3 0x18
33#define APBC_SSP0 0x1c
34#define APBC_SSP1 0x20
35#define APBC_SSP2 0x4c
36#define APBCP_TWSI1 0x28
37#define APBCP_UART2 0x1c
38#define APMU_SDH0 0x54
39#define APMU_SDH1 0x58
40#define APMU_USB 0x5c
41#define APMU_DISP0 0x4c
42#define APMU_CCIC0 0x50
43#define APMU_DFC 0x60
44#define MPMU_UART_PLL 0x14
45
46static DEFINE_SPINLOCK(clk_lock);
47
48static struct clk_factor_masks uart_factor_masks = {
49 .factor = 2,
50 .num_mask = 0x1fff,
51 .den_mask = 0x1fff,
52 .num_shift = 16,
53 .den_shift = 0,
54};
55
56static struct clk_factor_tbl uart_factor_tbl[] = {
57 {.num = 8125, .den = 1536}, /*14.745MHZ */
58};
59
60static const char *uart_parent[] = {"pll1_3_16", "uart_pll"};
61static const char *ssp_parent[] = {"pll1_96", "pll1_48", "pll1_24", "pll1_12"};
62static const char *sdh_parent[] = {"pll1_12", "pll1_13"};
63static const char *disp_parent[] = {"pll1_2", "pll1_12"};
64static const char *ccic_parent[] = {"pll1_2", "pll1_12"};
65static const char *ccic_phy_parent[] = {"pll1_6", "pll1_12"};
66
67void __init pxa910_clk_init(void)
68{
69 struct clk *clk;
70 struct clk *uart_pll;
71 void __iomem *mpmu_base;
72 void __iomem *apmu_base;
73 void __iomem *apbcp_base;
74 void __iomem *apbc_base;
75
76 mpmu_base = ioremap(APB_PHYS_BASE + 0x50000, SZ_4K);
77 if (mpmu_base == NULL) {
78 pr_err("error to ioremap MPMU base\n");
79 return;
80 }
81
82 apmu_base = ioremap(AXI_PHYS_BASE + 0x82800, SZ_4K);
83 if (apmu_base == NULL) {
84 pr_err("error to ioremap APMU base\n");
85 return;
86 }
87
88 apbcp_base = ioremap(APB_PHYS_BASE + 0x3b000, SZ_4K);
89 if (apbcp_base == NULL) {
90 pr_err("error to ioremap APBC extension base\n");
91 return;
92 }
93
94 apbc_base = ioremap(APB_PHYS_BASE + 0x15000, SZ_4K);
95 if (apbc_base == NULL) {
96 pr_err("error to ioremap APBC base\n");
97 return;
98 }
99
100 clk = clk_register_fixed_rate(NULL, "clk32", NULL, CLK_IS_ROOT, 3200);
101 clk_register_clkdev(clk, "clk32", NULL);
102
103 clk = clk_register_fixed_rate(NULL, "vctcxo", NULL, CLK_IS_ROOT,
104 26000000);
105 clk_register_clkdev(clk, "vctcxo", NULL);
106
107 clk = clk_register_fixed_rate(NULL, "pll1", NULL, CLK_IS_ROOT,
108 624000000);
109 clk_register_clkdev(clk, "pll1", NULL);
110
111 clk = clk_register_fixed_factor(NULL, "pll1_2", "pll1",
112 CLK_SET_RATE_PARENT, 1, 2);
113 clk_register_clkdev(clk, "pll1_2", NULL);
114
115 clk = clk_register_fixed_factor(NULL, "pll1_4", "pll1_2",
116 CLK_SET_RATE_PARENT, 1, 2);
117 clk_register_clkdev(clk, "pll1_4", NULL);
118
119 clk = clk_register_fixed_factor(NULL, "pll1_8", "pll1_4",
120 CLK_SET_RATE_PARENT, 1, 2);
121 clk_register_clkdev(clk, "pll1_8", NULL);
122
123 clk = clk_register_fixed_factor(NULL, "pll1_16", "pll1_8",
124 CLK_SET_RATE_PARENT, 1, 2);
125 clk_register_clkdev(clk, "pll1_16", NULL);
126
127 clk = clk_register_fixed_factor(NULL, "pll1_6", "pll1_2",
128 CLK_SET_RATE_PARENT, 1, 3);
129 clk_register_clkdev(clk, "pll1_6", NULL);
130
131 clk = clk_register_fixed_factor(NULL, "pll1_12", "pll1_6",
132 CLK_SET_RATE_PARENT, 1, 2);
133 clk_register_clkdev(clk, "pll1_12", NULL);
134
135 clk = clk_register_fixed_factor(NULL, "pll1_24", "pll1_12",
136 CLK_SET_RATE_PARENT, 1, 2);
137 clk_register_clkdev(clk, "pll1_24", NULL);
138
139 clk = clk_register_fixed_factor(NULL, "pll1_48", "pll1_24",
140 CLK_SET_RATE_PARENT, 1, 2);
141 clk_register_clkdev(clk, "pll1_48", NULL);
142
143 clk = clk_register_fixed_factor(NULL, "pll1_96", "pll1_48",
144 CLK_SET_RATE_PARENT, 1, 2);
145 clk_register_clkdev(clk, "pll1_96", NULL);
146
147 clk = clk_register_fixed_factor(NULL, "pll1_13", "pll1",
148 CLK_SET_RATE_PARENT, 1, 13);
149 clk_register_clkdev(clk, "pll1_13", NULL);
150
151 clk = clk_register_fixed_factor(NULL, "pll1_13_1_5", "pll1",
152 CLK_SET_RATE_PARENT, 2, 3);
153 clk_register_clkdev(clk, "pll1_13_1_5", NULL);
154
155 clk = clk_register_fixed_factor(NULL, "pll1_2_1_5", "pll1",
156 CLK_SET_RATE_PARENT, 2, 3);
157 clk_register_clkdev(clk, "pll1_2_1_5", NULL);
158
159 clk = clk_register_fixed_factor(NULL, "pll1_3_16", "pll1",
160 CLK_SET_RATE_PARENT, 3, 16);
161 clk_register_clkdev(clk, "pll1_3_16", NULL);
162
163 uart_pll = mmp_clk_register_factor("uart_pll", "pll1_4", 0,
164 mpmu_base + MPMU_UART_PLL,
165 &uart_factor_masks, uart_factor_tbl,
166 ARRAY_SIZE(uart_factor_tbl));
167 clk_set_rate(uart_pll, 14745600);
168 clk_register_clkdev(uart_pll, "uart_pll", NULL);
169
170 clk = mmp_clk_register_apbc("twsi0", "pll1_13_1_5",
171 apbc_base + APBC_TWSI0, 10, 0, &clk_lock);
172 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.0");
173
174 clk = mmp_clk_register_apbc("twsi1", "pll1_13_1_5",
175 apbcp_base + APBCP_TWSI1, 10, 0, &clk_lock);
176 clk_register_clkdev(clk, NULL, "pxa2xx-i2c.1");
177
178 clk = mmp_clk_register_apbc("gpio", "vctcxo",
179 apbc_base + APBC_GPIO, 10, 0, &clk_lock);
180 clk_register_clkdev(clk, NULL, "pxa-gpio");
181
182 clk = mmp_clk_register_apbc("kpc", "clk32",
183 apbc_base + APBC_KPC, 10, 0, &clk_lock);
184 clk_register_clkdev(clk, NULL, "pxa27x-keypad");
185
186 clk = mmp_clk_register_apbc("rtc", "clk32",
187 apbc_base + APBC_RTC, 10, 0, &clk_lock);
188 clk_register_clkdev(clk, NULL, "sa1100-rtc");
189
190 clk = mmp_clk_register_apbc("pwm0", "pll1_48",
191 apbc_base + APBC_PWM0, 10, 0, &clk_lock);
192 clk_register_clkdev(clk, NULL, "pxa910-pwm.0");
193
194 clk = mmp_clk_register_apbc("pwm1", "pll1_48",
195 apbc_base + APBC_PWM1, 10, 0, &clk_lock);
196 clk_register_clkdev(clk, NULL, "pxa910-pwm.1");
197
198 clk = mmp_clk_register_apbc("pwm2", "pll1_48",
199 apbc_base + APBC_PWM2, 10, 0, &clk_lock);
200 clk_register_clkdev(clk, NULL, "pxa910-pwm.2");
201
202 clk = mmp_clk_register_apbc("pwm3", "pll1_48",
203 apbc_base + APBC_PWM3, 10, 0, &clk_lock);
204 clk_register_clkdev(clk, NULL, "pxa910-pwm.3");
205
206 clk = clk_register_mux(NULL, "uart0_mux", uart_parent,
207 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
208 apbc_base + APBC_UART0, 4, 3, 0, &clk_lock);
209 clk_set_parent(clk, uart_pll);
210 clk_register_clkdev(clk, "uart_mux.0", NULL);
211
212 clk = mmp_clk_register_apbc("uart0", "uart0_mux",
213 apbc_base + APBC_UART0, 10, 0, &clk_lock);
214 clk_register_clkdev(clk, NULL, "pxa2xx-uart.0");
215
216 clk = clk_register_mux(NULL, "uart1_mux", uart_parent,
217 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
218 apbc_base + APBC_UART1, 4, 3, 0, &clk_lock);
219 clk_set_parent(clk, uart_pll);
220 clk_register_clkdev(clk, "uart_mux.1", NULL);
221
222 clk = mmp_clk_register_apbc("uart1", "uart1_mux",
223 apbc_base + APBC_UART1, 10, 0, &clk_lock);
224 clk_register_clkdev(clk, NULL, "pxa2xx-uart.1");
225
226 clk = clk_register_mux(NULL, "uart2_mux", uart_parent,
227 ARRAY_SIZE(uart_parent), CLK_SET_RATE_PARENT,
228 apbcp_base + APBCP_UART2, 4, 3, 0, &clk_lock);
229 clk_set_parent(clk, uart_pll);
230 clk_register_clkdev(clk, "uart_mux.2", NULL);
231
232 clk = mmp_clk_register_apbc("uart2", "uart2_mux",
233 apbcp_base + APBCP_UART2, 10, 0, &clk_lock);
234 clk_register_clkdev(clk, NULL, "pxa2xx-uart.2");
235
236 clk = clk_register_mux(NULL, "ssp0_mux", ssp_parent,
237 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
238 apbc_base + APBC_SSP0, 4, 3, 0, &clk_lock);
239 clk_register_clkdev(clk, "uart_mux.0", NULL);
240
241 clk = mmp_clk_register_apbc("ssp0", "ssp0_mux",
242 apbc_base + APBC_SSP0, 10, 0, &clk_lock);
243 clk_register_clkdev(clk, NULL, "mmp-ssp.0");
244
245 clk = clk_register_mux(NULL, "ssp1_mux", ssp_parent,
246 ARRAY_SIZE(ssp_parent), CLK_SET_RATE_PARENT,
247 apbc_base + APBC_SSP1, 4, 3, 0, &clk_lock);
248 clk_register_clkdev(clk, "ssp_mux.1", NULL);
249
250 clk = mmp_clk_register_apbc("ssp1", "ssp1_mux",
251 apbc_base + APBC_SSP1, 10, 0, &clk_lock);
252 clk_register_clkdev(clk, NULL, "mmp-ssp.1");
253
254 clk = mmp_clk_register_apmu("dfc", "pll1_4",
255 apmu_base + APMU_DFC, 0x19b, &clk_lock);
256 clk_register_clkdev(clk, NULL, "pxa3xx-nand.0");
257
258 clk = clk_register_mux(NULL, "sdh0_mux", sdh_parent,
259 ARRAY_SIZE(sdh_parent), CLK_SET_RATE_PARENT,
260 apmu_base + APMU_SDH0, 6, 1, 0, &clk_lock);
261 clk_register_clkdev(clk, "sdh0_mux", NULL);
262
263 clk = mmp_clk_register_apmu("sdh0", "sdh_mux",
264 apmu_base + APMU_SDH0, 0x1b, &clk_lock);
265 clk_register_clkdev(clk, NULL, "sdhci-pxa.0");
266
267 clk = clk_register_mux(NULL, "sdh1_mux", sdh_parent,
268 ARRAY_SIZE(sdh_parent), CLK_SET_RATE_PARENT,
269 apmu_base + APMU_SDH1, 6, 1, 0, &clk_lock);
270 clk_register_clkdev(clk, "sdh1_mux", NULL);
271
272 clk = mmp_clk_register_apmu("sdh1", "sdh1_mux",
273 apmu_base + APMU_SDH1, 0x1b, &clk_lock);
274 clk_register_clkdev(clk, NULL, "sdhci-pxa.1");
275
276 clk = mmp_clk_register_apmu("usb", "usb_pll",
277 apmu_base + APMU_USB, 0x9, &clk_lock);
278 clk_register_clkdev(clk, "usb_clk", NULL);
279
280 clk = mmp_clk_register_apmu("sph", "usb_pll",
281 apmu_base + APMU_USB, 0x12, &clk_lock);
282 clk_register_clkdev(clk, "sph_clk", NULL);
283
284 clk = clk_register_mux(NULL, "disp0_mux", disp_parent,
285 ARRAY_SIZE(disp_parent), CLK_SET_RATE_PARENT,
286 apmu_base + APMU_DISP0, 6, 1, 0, &clk_lock);
287 clk_register_clkdev(clk, "disp_mux.0", NULL);
288
289 clk = mmp_clk_register_apmu("disp0", "disp0_mux",
290 apmu_base + APMU_DISP0, 0x1b, &clk_lock);
291 clk_register_clkdev(clk, NULL, "mmp-disp.0");
292
293 clk = clk_register_mux(NULL, "ccic0_mux", ccic_parent,
294 ARRAY_SIZE(ccic_parent), CLK_SET_RATE_PARENT,
295 apmu_base + APMU_CCIC0, 6, 1, 0, &clk_lock);
296 clk_register_clkdev(clk, "ccic_mux.0", NULL);
297
298 clk = mmp_clk_register_apmu("ccic0", "ccic0_mux",
299 apmu_base + APMU_CCIC0, 0x1b, &clk_lock);
300 clk_register_clkdev(clk, "fnclk", "mmp-ccic.0");
301
302 clk = clk_register_mux(NULL, "ccic0_phy_mux", ccic_phy_parent,
303 ARRAY_SIZE(ccic_phy_parent),
304 CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC0,
305 7, 1, 0, &clk_lock);
306 clk_register_clkdev(clk, "ccic_phy_mux.0", NULL);
307
308 clk = mmp_clk_register_apmu("ccic0_phy", "ccic0_phy_mux",
309 apmu_base + APMU_CCIC0, 0x24, &clk_lock);
310 clk_register_clkdev(clk, "phyclk", "mmp-ccic.0");
311
312 clk = clk_register_divider(NULL, "ccic0_sphy_div", "ccic0_mux",
313 CLK_SET_RATE_PARENT, apmu_base + APMU_CCIC0,
314 10, 5, 0, &clk_lock);
315 clk_register_clkdev(clk, "sphyclk_div", NULL);
316
317 clk = mmp_clk_register_apmu("ccic0_sphy", "ccic0_sphy_div",
318 apmu_base + APMU_CCIC0, 0x300, &clk_lock);
319 clk_register_clkdev(clk, "sphyclk", "mmp-ccic.0");
320}
diff --git a/drivers/clk/mmp/clk.h b/drivers/clk/mmp/clk.h
new file mode 100644
index 000000000000..ab86dd4a416a
--- /dev/null
+++ b/drivers/clk/mmp/clk.h
@@ -0,0 +1,35 @@
1#ifndef __MACH_MMP_CLK_H
2#define __MACH_MMP_CLK_H
3
4#include <linux/clk-provider.h>
5#include <linux/clkdev.h>
6
7#define APBC_NO_BUS_CTRL BIT(0)
8#define APBC_POWER_CTRL BIT(1)
9
10struct clk_factor_masks {
11 unsigned int factor;
12 unsigned int num_mask;
13 unsigned int den_mask;
14 unsigned int num_shift;
15 unsigned int den_shift;
16};
17
18struct clk_factor_tbl {
19 unsigned int num;
20 unsigned int den;
21};
22
23extern struct clk *mmp_clk_register_pll2(const char *name,
24 const char *parent_name, unsigned long flags);
25extern struct clk *mmp_clk_register_apbc(const char *name,
26 const char *parent_name, void __iomem *base,
27 unsigned int delay, unsigned int apbc_flags, spinlock_t *lock);
28extern struct clk *mmp_clk_register_apmu(const char *name,
29 const char *parent_name, void __iomem *base, u32 enable_mask,
30 spinlock_t *lock);
31extern struct clk *mmp_clk_register_factor(const char *name,
32 const char *parent_name, unsigned long flags,
33 void __iomem *base, struct clk_factor_masks *masks,
34 struct clk_factor_tbl *ftbl, unsigned int ftbl_cnt);
35#endif
diff --git a/drivers/clk/mxs/clk-imx23.c b/drivers/clk/mxs/clk-imx23.c
index 844043ad0fe4..9f6d15546cbe 100644
--- a/drivers/clk/mxs/clk-imx23.c
+++ b/drivers/clk/mxs/clk-imx23.c
@@ -14,6 +14,7 @@
14#include <linux/err.h> 14#include <linux/err.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/of.h>
17#include <mach/common.h> 18#include <mach/common.h>
18#include <mach/mx23.h> 19#include <mach/mx23.h>
19#include "clk.h" 20#include "clk.h"
@@ -71,44 +72,6 @@ static void __init clk_misc_init(void)
71 __mxs_setl(30 << BP_FRAC_IOFRAC, FRAC); 72 __mxs_setl(30 << BP_FRAC_IOFRAC, FRAC);
72} 73}
73 74
74static struct clk_lookup uart_lookups[] = {
75 { .dev_id = "duart", },
76 { .dev_id = "mxs-auart.0", },
77 { .dev_id = "mxs-auart.1", },
78 { .dev_id = "8006c000.serial", },
79 { .dev_id = "8006e000.serial", },
80 { .dev_id = "80070000.serial", },
81};
82
83static struct clk_lookup hbus_lookups[] = {
84 { .dev_id = "imx23-dma-apbh", },
85 { .dev_id = "80004000.dma-apbh", },
86};
87
88static struct clk_lookup xbus_lookups[] = {
89 { .dev_id = "duart", .con_id = "apb_pclk"},
90 { .dev_id = "80070000.serial", .con_id = "apb_pclk"},
91 { .dev_id = "imx23-dma-apbx", },
92 { .dev_id = "80024000.dma-apbx", },
93};
94
95static struct clk_lookup ssp_lookups[] = {
96 { .dev_id = "imx23-mmc.0", },
97 { .dev_id = "imx23-mmc.1", },
98 { .dev_id = "80010000.ssp", },
99 { .dev_id = "80034000.ssp", },
100};
101
102static struct clk_lookup lcdif_lookups[] = {
103 { .dev_id = "imx23-fb", },
104 { .dev_id = "80030000.lcdif", },
105};
106
107static struct clk_lookup gpmi_lookups[] = {
108 { .dev_id = "imx23-gpmi-nand", },
109 { .dev_id = "8000c000.gpmi-nand", },
110};
111
112static const char *sel_pll[] __initconst = { "pll", "ref_xtal", }; 75static const char *sel_pll[] __initconst = { "pll", "ref_xtal", };
113static const char *sel_cpu[] __initconst = { "ref_cpu", "ref_xtal", }; 76static const char *sel_cpu[] __initconst = { "ref_cpu", "ref_xtal", };
114static const char *sel_pix[] __initconst = { "ref_pix", "ref_xtal", }; 77static const char *sel_pix[] __initconst = { "ref_pix", "ref_xtal", };
@@ -127,6 +90,7 @@ enum imx23_clk {
127}; 90};
128 91
129static struct clk *clks[clk_max]; 92static struct clk *clks[clk_max];
93static struct clk_onecell_data clk_data;
130 94
131static enum imx23_clk clks_init_on[] __initdata = { 95static enum imx23_clk clks_init_on[] __initdata = {
132 cpu, hbus, xbus, emi, uart, 96 cpu, hbus, xbus, emi, uart,
@@ -134,6 +98,7 @@ static enum imx23_clk clks_init_on[] __initdata = {
134 98
135int __init mx23_clocks_init(void) 99int __init mx23_clocks_init(void)
136{ 100{
101 struct device_node *np;
137 int i; 102 int i;
138 103
139 clk_misc_init(); 104 clk_misc_init();
@@ -188,14 +153,14 @@ int __init mx23_clocks_init(void)
188 return PTR_ERR(clks[i]); 153 return PTR_ERR(clks[i]);
189 } 154 }
190 155
156 np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl");
157 if (np) {
158 clk_data.clks = clks;
159 clk_data.clk_num = ARRAY_SIZE(clks);
160 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
161 }
162
191 clk_register_clkdev(clks[clk32k], NULL, "timrot"); 163 clk_register_clkdev(clks[clk32k], NULL, "timrot");
192 clk_register_clkdev(clks[pwm], NULL, "80064000.pwm");
193 clk_register_clkdevs(clks[hbus], hbus_lookups, ARRAY_SIZE(hbus_lookups));
194 clk_register_clkdevs(clks[xbus], xbus_lookups, ARRAY_SIZE(xbus_lookups));
195 clk_register_clkdevs(clks[uart], uart_lookups, ARRAY_SIZE(uart_lookups));
196 clk_register_clkdevs(clks[ssp], ssp_lookups, ARRAY_SIZE(ssp_lookups));
197 clk_register_clkdevs(clks[gpmi], gpmi_lookups, ARRAY_SIZE(gpmi_lookups));
198 clk_register_clkdevs(clks[lcdif], lcdif_lookups, ARRAY_SIZE(lcdif_lookups));
199 164
200 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 165 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
201 clk_prepare_enable(clks[clks_init_on[i]]); 166 clk_prepare_enable(clks[clks_init_on[i]]);
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c
index e3aab67b3eb7..613e76f3758e 100644
--- a/drivers/clk/mxs/clk-imx28.c
+++ b/drivers/clk/mxs/clk-imx28.c
@@ -14,6 +14,7 @@
14#include <linux/err.h> 14#include <linux/err.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/of.h>
17#include <mach/common.h> 18#include <mach/common.h>
18#include <mach/mx28.h> 19#include <mach/mx28.h>
19#include "clk.h" 20#include "clk.h"
@@ -120,90 +121,6 @@ static void __init clk_misc_init(void)
120 writel_relaxed(val, FRAC0); 121 writel_relaxed(val, FRAC0);
121} 122}
122 123
123static struct clk_lookup uart_lookups[] = {
124 { .dev_id = "duart", },
125 { .dev_id = "mxs-auart.0", },
126 { .dev_id = "mxs-auart.1", },
127 { .dev_id = "mxs-auart.2", },
128 { .dev_id = "mxs-auart.3", },
129 { .dev_id = "mxs-auart.4", },
130 { .dev_id = "8006a000.serial", },
131 { .dev_id = "8006c000.serial", },
132 { .dev_id = "8006e000.serial", },
133 { .dev_id = "80070000.serial", },
134 { .dev_id = "80072000.serial", },
135 { .dev_id = "80074000.serial", },
136};
137
138static struct clk_lookup hbus_lookups[] = {
139 { .dev_id = "imx28-dma-apbh", },
140 { .dev_id = "80004000.dma-apbh", },
141};
142
143static struct clk_lookup xbus_lookups[] = {
144 { .dev_id = "duart", .con_id = "apb_pclk"},
145 { .dev_id = "80074000.serial", .con_id = "apb_pclk"},
146 { .dev_id = "imx28-dma-apbx", },
147 { .dev_id = "80024000.dma-apbx", },
148};
149
150static struct clk_lookup ssp0_lookups[] = {
151 { .dev_id = "imx28-mmc.0", },
152 { .dev_id = "80010000.ssp", },
153};
154
155static struct clk_lookup ssp1_lookups[] = {
156 { .dev_id = "imx28-mmc.1", },
157 { .dev_id = "80012000.ssp", },
158};
159
160static struct clk_lookup ssp2_lookups[] = {
161 { .dev_id = "imx28-mmc.2", },
162 { .dev_id = "80014000.ssp", },
163};
164
165static struct clk_lookup ssp3_lookups[] = {
166 { .dev_id = "imx28-mmc.3", },
167 { .dev_id = "80016000.ssp", },
168};
169
170static struct clk_lookup lcdif_lookups[] = {
171 { .dev_id = "imx28-fb", },
172 { .dev_id = "80030000.lcdif", },
173};
174
175static struct clk_lookup gpmi_lookups[] = {
176 { .dev_id = "imx28-gpmi-nand", },
177 { .dev_id = "8000c000.gpmi-nand", },
178};
179
180static struct clk_lookup fec_lookups[] = {
181 { .dev_id = "imx28-fec.0", },
182 { .dev_id = "imx28-fec.1", },
183 { .dev_id = "800f0000.ethernet", },
184 { .dev_id = "800f4000.ethernet", },
185};
186
187static struct clk_lookup can0_lookups[] = {
188 { .dev_id = "flexcan.0", },
189 { .dev_id = "80032000.can", },
190};
191
192static struct clk_lookup can1_lookups[] = {
193 { .dev_id = "flexcan.1", },
194 { .dev_id = "80034000.can", },
195};
196
197static struct clk_lookup saif0_lookups[] = {
198 { .dev_id = "mxs-saif.0", },
199 { .dev_id = "80042000.saif", },
200};
201
202static struct clk_lookup saif1_lookups[] = {
203 { .dev_id = "mxs-saif.1", },
204 { .dev_id = "80046000.saif", },
205};
206
207static const char *sel_cpu[] __initconst = { "ref_cpu", "ref_xtal", }; 124static const char *sel_cpu[] __initconst = { "ref_cpu", "ref_xtal", };
208static const char *sel_io0[] __initconst = { "ref_io0", "ref_xtal", }; 125static const char *sel_io0[] __initconst = { "ref_io0", "ref_xtal", };
209static const char *sel_io1[] __initconst = { "ref_io1", "ref_xtal", }; 126static const char *sel_io1[] __initconst = { "ref_io1", "ref_xtal", };
@@ -228,6 +145,7 @@ enum imx28_clk {
228}; 145};
229 146
230static struct clk *clks[clk_max]; 147static struct clk *clks[clk_max];
148static struct clk_onecell_data clk_data;
231 149
232static enum imx28_clk clks_init_on[] __initdata = { 150static enum imx28_clk clks_init_on[] __initdata = {
233 cpu, hbus, xbus, emi, uart, 151 cpu, hbus, xbus, emi, uart,
@@ -235,6 +153,7 @@ static enum imx28_clk clks_init_on[] __initdata = {
235 153
236int __init mx28_clocks_init(void) 154int __init mx28_clocks_init(void)
237{ 155{
156 struct device_node *np;
238 int i; 157 int i;
239 158
240 clk_misc_init(); 159 clk_misc_init();
@@ -312,27 +231,15 @@ int __init mx28_clocks_init(void)
312 return PTR_ERR(clks[i]); 231 return PTR_ERR(clks[i]);
313 } 232 }
314 233
234 np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl");
235 if (np) {
236 clk_data.clks = clks;
237 clk_data.clk_num = ARRAY_SIZE(clks);
238 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
239 }
240
315 clk_register_clkdev(clks[clk32k], NULL, "timrot"); 241 clk_register_clkdev(clks[clk32k], NULL, "timrot");
316 clk_register_clkdev(clks[enet_out], NULL, "enet_out"); 242 clk_register_clkdev(clks[enet_out], NULL, "enet_out");
317 clk_register_clkdev(clks[pwm], NULL, "80064000.pwm");
318 clk_register_clkdevs(clks[hbus], hbus_lookups, ARRAY_SIZE(hbus_lookups));
319 clk_register_clkdevs(clks[xbus], xbus_lookups, ARRAY_SIZE(xbus_lookups));
320 clk_register_clkdevs(clks[uart], uart_lookups, ARRAY_SIZE(uart_lookups));
321 clk_register_clkdevs(clks[ssp0], ssp0_lookups, ARRAY_SIZE(ssp0_lookups));
322 clk_register_clkdevs(clks[ssp1], ssp1_lookups, ARRAY_SIZE(ssp1_lookups));
323 clk_register_clkdevs(clks[ssp2], ssp2_lookups, ARRAY_SIZE(ssp2_lookups));
324 clk_register_clkdevs(clks[ssp3], ssp3_lookups, ARRAY_SIZE(ssp3_lookups));
325 clk_register_clkdevs(clks[gpmi], gpmi_lookups, ARRAY_SIZE(gpmi_lookups));
326 clk_register_clkdevs(clks[saif0], saif0_lookups, ARRAY_SIZE(saif0_lookups));
327 clk_register_clkdevs(clks[saif1], saif1_lookups, ARRAY_SIZE(saif1_lookups));
328 clk_register_clkdevs(clks[lcdif], lcdif_lookups, ARRAY_SIZE(lcdif_lookups));
329 clk_register_clkdevs(clks[fec], fec_lookups, ARRAY_SIZE(fec_lookups));
330 clk_register_clkdevs(clks[can0], can0_lookups, ARRAY_SIZE(can0_lookups));
331 clk_register_clkdevs(clks[can1], can1_lookups, ARRAY_SIZE(can1_lookups));
332 clk_register_clkdev(clks[usb0_pwr], NULL, "8007c000.usbphy");
333 clk_register_clkdev(clks[usb1_pwr], NULL, "8007e000.usbphy");
334 clk_register_clkdev(clks[usb0], NULL, "80080000.usb");
335 clk_register_clkdev(clks[usb1], NULL, "80090000.usb");
336 243
337 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 244 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
338 clk_prepare_enable(clks[clks_init_on[i]]); 245 clk_prepare_enable(clks[clks_init_on[i]]);
diff --git a/drivers/clk/ux500/Makefile b/drivers/clk/ux500/Makefile
new file mode 100644
index 000000000000..858fbfe66281
--- /dev/null
+++ b/drivers/clk/ux500/Makefile
@@ -0,0 +1,12 @@
1#
2# Makefile for ux500 clocks
3#
4
5# Clock types
6obj-y += clk-prcc.o
7obj-y += clk-prcmu.o
8
9# Clock definitions
10obj-y += u8500_clk.o
11obj-y += u9540_clk.o
12obj-y += u8540_clk.o
diff --git a/drivers/clk/ux500/clk-prcc.c b/drivers/clk/ux500/clk-prcc.c
new file mode 100644
index 000000000000..7eee7f768355
--- /dev/null
+++ b/drivers/clk/ux500/clk-prcc.c
@@ -0,0 +1,164 @@
1/*
2 * PRCC clock implementation for ux500 platform.
3 *
4 * Copyright (C) 2012 ST-Ericsson SA
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#include <linux/clk-provider.h>
11#include <linux/clk-private.h>
12#include <linux/slab.h>
13#include <linux/io.h>
14#include <linux/err.h>
15#include <linux/types.h>
16#include <mach/hardware.h>
17
18#include "clk.h"
19
20#define PRCC_PCKEN 0x000
21#define PRCC_PCKDIS 0x004
22#define PRCC_KCKEN 0x008
23#define PRCC_KCKDIS 0x00C
24#define PRCC_PCKSR 0x010
25#define PRCC_KCKSR 0x014
26
27#define to_clk_prcc(_hw) container_of(_hw, struct clk_prcc, hw)
28
29struct clk_prcc {
30 struct clk_hw hw;
31 void __iomem *base;
32 u32 cg_sel;
33 int is_enabled;
34};
35
36/* PRCC clock operations. */
37
38static int clk_prcc_pclk_enable(struct clk_hw *hw)
39{
40 struct clk_prcc *clk = to_clk_prcc(hw);
41
42 writel(clk->cg_sel, (clk->base + PRCC_PCKEN));
43 while (!(readl(clk->base + PRCC_PCKSR) & clk->cg_sel))
44 cpu_relax();
45
46 clk->is_enabled = 1;
47 return 0;
48}
49
50static void clk_prcc_pclk_disable(struct clk_hw *hw)
51{
52 struct clk_prcc *clk = to_clk_prcc(hw);
53
54 writel(clk->cg_sel, (clk->base + PRCC_PCKDIS));
55 clk->is_enabled = 0;
56}
57
58static int clk_prcc_kclk_enable(struct clk_hw *hw)
59{
60 struct clk_prcc *clk = to_clk_prcc(hw);
61
62 writel(clk->cg_sel, (clk->base + PRCC_KCKEN));
63 while (!(readl(clk->base + PRCC_KCKSR) & clk->cg_sel))
64 cpu_relax();
65
66 clk->is_enabled = 1;
67 return 0;
68}
69
70static void clk_prcc_kclk_disable(struct clk_hw *hw)
71{
72 struct clk_prcc *clk = to_clk_prcc(hw);
73
74 writel(clk->cg_sel, (clk->base + PRCC_KCKDIS));
75 clk->is_enabled = 0;
76}
77
78static int clk_prcc_is_enabled(struct clk_hw *hw)
79{
80 struct clk_prcc *clk = to_clk_prcc(hw);
81 return clk->is_enabled;
82}
83
84static struct clk_ops clk_prcc_pclk_ops = {
85 .enable = clk_prcc_pclk_enable,
86 .disable = clk_prcc_pclk_disable,
87 .is_enabled = clk_prcc_is_enabled,
88};
89
90static struct clk_ops clk_prcc_kclk_ops = {
91 .enable = clk_prcc_kclk_enable,
92 .disable = clk_prcc_kclk_disable,
93 .is_enabled = clk_prcc_is_enabled,
94};
95
96static struct clk *clk_reg_prcc(const char *name,
97 const char *parent_name,
98 resource_size_t phy_base,
99 u32 cg_sel,
100 unsigned long flags,
101 struct clk_ops *clk_prcc_ops)
102{
103 struct clk_prcc *clk;
104 struct clk_init_data clk_prcc_init;
105 struct clk *clk_reg;
106
107 if (!name) {
108 pr_err("clk_prcc: %s invalid arguments passed\n", __func__);
109 return ERR_PTR(-EINVAL);
110 }
111
112 clk = kzalloc(sizeof(struct clk_prcc), GFP_KERNEL);
113 if (!clk) {
114 pr_err("clk_prcc: %s could not allocate clk\n", __func__);
115 return ERR_PTR(-ENOMEM);
116 }
117
118 clk->base = ioremap(phy_base, SZ_4K);
119 if (!clk->base)
120 goto free_clk;
121
122 clk->cg_sel = cg_sel;
123 clk->is_enabled = 1;
124
125 clk_prcc_init.name = name;
126 clk_prcc_init.ops = clk_prcc_ops;
127 clk_prcc_init.flags = flags;
128 clk_prcc_init.parent_names = (parent_name ? &parent_name : NULL);
129 clk_prcc_init.num_parents = (parent_name ? 1 : 0);
130 clk->hw.init = &clk_prcc_init;
131
132 clk_reg = clk_register(NULL, &clk->hw);
133 if (IS_ERR_OR_NULL(clk_reg))
134 goto unmap_clk;
135
136 return clk_reg;
137
138unmap_clk:
139 iounmap(clk->base);
140free_clk:
141 kfree(clk);
142 pr_err("clk_prcc: %s failed to register clk\n", __func__);
143 return ERR_PTR(-ENOMEM);
144}
145
146struct clk *clk_reg_prcc_pclk(const char *name,
147 const char *parent_name,
148 resource_size_t phy_base,
149 u32 cg_sel,
150 unsigned long flags)
151{
152 return clk_reg_prcc(name, parent_name, phy_base, cg_sel, flags,
153 &clk_prcc_pclk_ops);
154}
155
156struct clk *clk_reg_prcc_kclk(const char *name,
157 const char *parent_name,
158 resource_size_t phy_base,
159 u32 cg_sel,
160 unsigned long flags)
161{
162 return clk_reg_prcc(name, parent_name, phy_base, cg_sel, flags,
163 &clk_prcc_kclk_ops);
164}
diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c
new file mode 100644
index 000000000000..930cdfeb47ab
--- /dev/null
+++ b/drivers/clk/ux500/clk-prcmu.c
@@ -0,0 +1,252 @@
1/*
2 * PRCMU clock implementation for ux500 platform.
3 *
4 * Copyright (C) 2012 ST-Ericsson SA
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#include <linux/clk-provider.h>
11#include <linux/clk-private.h>
12#include <linux/mfd/dbx500-prcmu.h>
13#include <linux/slab.h>
14#include <linux/io.h>
15#include <linux/err.h>
16#include "clk.h"
17
18#define to_clk_prcmu(_hw) container_of(_hw, struct clk_prcmu, hw)
19
20struct clk_prcmu {
21 struct clk_hw hw;
22 u8 cg_sel;
23 int is_enabled;
24};
25
26/* PRCMU clock operations. */
27
28static int clk_prcmu_prepare(struct clk_hw *hw)
29{
30 struct clk_prcmu *clk = to_clk_prcmu(hw);
31 return prcmu_request_clock(clk->cg_sel, true);
32}
33
34static void clk_prcmu_unprepare(struct clk_hw *hw)
35{
36 struct clk_prcmu *clk = to_clk_prcmu(hw);
37 if (prcmu_request_clock(clk->cg_sel, false))
38 pr_err("clk_prcmu: %s failed to disable %s.\n", __func__,
39 hw->init->name);
40}
41
42static int clk_prcmu_enable(struct clk_hw *hw)
43{
44 struct clk_prcmu *clk = to_clk_prcmu(hw);
45 clk->is_enabled = 1;
46 return 0;
47}
48
49static void clk_prcmu_disable(struct clk_hw *hw)
50{
51 struct clk_prcmu *clk = to_clk_prcmu(hw);
52 clk->is_enabled = 0;
53}
54
55static int clk_prcmu_is_enabled(struct clk_hw *hw)
56{
57 struct clk_prcmu *clk = to_clk_prcmu(hw);
58 return clk->is_enabled;
59}
60
61static unsigned long clk_prcmu_recalc_rate(struct clk_hw *hw,
62 unsigned long parent_rate)
63{
64 struct clk_prcmu *clk = to_clk_prcmu(hw);
65 return prcmu_clock_rate(clk->cg_sel);
66}
67
68static long clk_prcmu_round_rate(struct clk_hw *hw, unsigned long rate,
69 unsigned long *parent_rate)
70{
71 struct clk_prcmu *clk = to_clk_prcmu(hw);
72 return prcmu_round_clock_rate(clk->cg_sel, rate);
73}
74
75static int clk_prcmu_set_rate(struct clk_hw *hw, unsigned long rate,
76 unsigned long parent_rate)
77{
78 struct clk_prcmu *clk = to_clk_prcmu(hw);
79 return prcmu_set_clock_rate(clk->cg_sel, rate);
80}
81
82static int request_ape_opp100(bool enable)
83{
84 static int reqs;
85 int err = 0;
86
87 if (enable) {
88 if (!reqs)
89 err = prcmu_qos_add_requirement(PRCMU_QOS_APE_OPP,
90 "clock", 100);
91 if (!err)
92 reqs++;
93 } else {
94 reqs--;
95 if (!reqs)
96 prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP,
97 "clock");
98 }
99 return err;
100}
101
102static int clk_prcmu_opp_prepare(struct clk_hw *hw)
103{
104 int err;
105 struct clk_prcmu *clk = to_clk_prcmu(hw);
106
107 err = request_ape_opp100(true);
108 if (err) {
109 pr_err("clk_prcmu: %s failed to request APE OPP100 for %s.\n",
110 __func__, hw->init->name);
111 return err;
112 }
113
114 err = prcmu_request_clock(clk->cg_sel, true);
115 if (err)
116 request_ape_opp100(false);
117
118 return err;
119}
120
121static void clk_prcmu_opp_unprepare(struct clk_hw *hw)
122{
123 struct clk_prcmu *clk = to_clk_prcmu(hw);
124
125 if (prcmu_request_clock(clk->cg_sel, false))
126 goto out_error;
127 if (request_ape_opp100(false))
128 goto out_error;
129 return;
130
131out_error:
132 pr_err("clk_prcmu: %s failed to disable %s.\n", __func__,
133 hw->init->name);
134}
135
136static struct clk_ops clk_prcmu_scalable_ops = {
137 .prepare = clk_prcmu_prepare,
138 .unprepare = clk_prcmu_unprepare,
139 .enable = clk_prcmu_enable,
140 .disable = clk_prcmu_disable,
141 .is_enabled = clk_prcmu_is_enabled,
142 .recalc_rate = clk_prcmu_recalc_rate,
143 .round_rate = clk_prcmu_round_rate,
144 .set_rate = clk_prcmu_set_rate,
145};
146
147static struct clk_ops clk_prcmu_gate_ops = {
148 .prepare = clk_prcmu_prepare,
149 .unprepare = clk_prcmu_unprepare,
150 .enable = clk_prcmu_enable,
151 .disable = clk_prcmu_disable,
152 .is_enabled = clk_prcmu_is_enabled,
153 .recalc_rate = clk_prcmu_recalc_rate,
154};
155
156static struct clk_ops clk_prcmu_rate_ops = {
157 .is_enabled = clk_prcmu_is_enabled,
158 .recalc_rate = clk_prcmu_recalc_rate,
159};
160
161static struct clk_ops clk_prcmu_opp_gate_ops = {
162 .prepare = clk_prcmu_opp_prepare,
163 .unprepare = clk_prcmu_opp_unprepare,
164 .enable = clk_prcmu_enable,
165 .disable = clk_prcmu_disable,
166 .is_enabled = clk_prcmu_is_enabled,
167 .recalc_rate = clk_prcmu_recalc_rate,
168};
169
170static struct clk *clk_reg_prcmu(const char *name,
171 const char *parent_name,
172 u8 cg_sel,
173 unsigned long rate,
174 unsigned long flags,
175 struct clk_ops *clk_prcmu_ops)
176{
177 struct clk_prcmu *clk;
178 struct clk_init_data clk_prcmu_init;
179 struct clk *clk_reg;
180
181 if (!name) {
182 pr_err("clk_prcmu: %s invalid arguments passed\n", __func__);
183 return ERR_PTR(-EINVAL);
184 }
185
186 clk = kzalloc(sizeof(struct clk_prcmu), GFP_KERNEL);
187 if (!clk) {
188 pr_err("clk_prcmu: %s could not allocate clk\n", __func__);
189 return ERR_PTR(-ENOMEM);
190 }
191
192 clk->cg_sel = cg_sel;
193 clk->is_enabled = 1;
194 /* "rate" can be used for changing the initial frequency */
195 if (rate)
196 prcmu_set_clock_rate(cg_sel, rate);
197
198 clk_prcmu_init.name = name;
199 clk_prcmu_init.ops = clk_prcmu_ops;
200 clk_prcmu_init.flags = flags;
201 clk_prcmu_init.parent_names = (parent_name ? &parent_name : NULL);
202 clk_prcmu_init.num_parents = (parent_name ? 1 : 0);
203 clk->hw.init = &clk_prcmu_init;
204
205 clk_reg = clk_register(NULL, &clk->hw);
206 if (IS_ERR_OR_NULL(clk_reg))
207 goto free_clk;
208
209 return clk_reg;
210
211free_clk:
212 kfree(clk);
213 pr_err("clk_prcmu: %s failed to register clk\n", __func__);
214 return ERR_PTR(-ENOMEM);
215}
216
217struct clk *clk_reg_prcmu_scalable(const char *name,
218 const char *parent_name,
219 u8 cg_sel,
220 unsigned long rate,
221 unsigned long flags)
222{
223 return clk_reg_prcmu(name, parent_name, cg_sel, rate, flags,
224 &clk_prcmu_scalable_ops);
225}
226
227struct clk *clk_reg_prcmu_gate(const char *name,
228 const char *parent_name,
229 u8 cg_sel,
230 unsigned long flags)
231{
232 return clk_reg_prcmu(name, parent_name, cg_sel, 0, flags,
233 &clk_prcmu_gate_ops);
234}
235
236struct clk *clk_reg_prcmu_rate(const char *name,
237 const char *parent_name,
238 u8 cg_sel,
239 unsigned long flags)
240{
241 return clk_reg_prcmu(name, parent_name, cg_sel, 0, flags,
242 &clk_prcmu_rate_ops);
243}
244
245struct clk *clk_reg_prcmu_opp_gate(const char *name,
246 const char *parent_name,
247 u8 cg_sel,
248 unsigned long flags)
249{
250 return clk_reg_prcmu(name, parent_name, cg_sel, 0, flags,
251 &clk_prcmu_opp_gate_ops);
252}
diff --git a/drivers/clk/ux500/clk.h b/drivers/clk/ux500/clk.h
new file mode 100644
index 000000000000..836d7d16751e
--- /dev/null
+++ b/drivers/clk/ux500/clk.h
@@ -0,0 +1,48 @@
1/*
2 * Clocks for ux500 platforms
3 *
4 * Copyright (C) 2012 ST-Ericsson SA
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#ifndef __UX500_CLK_H
11#define __UX500_CLK_H
12
13#include <linux/clk.h>
14
15struct clk *clk_reg_prcc_pclk(const char *name,
16 const char *parent_name,
17 unsigned int phy_base,
18 u32 cg_sel,
19 unsigned long flags);
20
21struct clk *clk_reg_prcc_kclk(const char *name,
22 const char *parent_name,
23 unsigned int phy_base,
24 u32 cg_sel,
25 unsigned long flags);
26
27struct clk *clk_reg_prcmu_scalable(const char *name,
28 const char *parent_name,
29 u8 cg_sel,
30 unsigned long rate,
31 unsigned long flags);
32
33struct clk *clk_reg_prcmu_gate(const char *name,
34 const char *parent_name,
35 u8 cg_sel,
36 unsigned long flags);
37
38struct clk *clk_reg_prcmu_rate(const char *name,
39 const char *parent_name,
40 u8 cg_sel,
41 unsigned long flags);
42
43struct clk *clk_reg_prcmu_opp_gate(const char *name,
44 const char *parent_name,
45 u8 cg_sel,
46 unsigned long flags);
47
48#endif /* __UX500_CLK_H */
diff --git a/drivers/clk/ux500/u8500_clk.c b/drivers/clk/ux500/u8500_clk.c
new file mode 100644
index 000000000000..ca4a25ed844c
--- /dev/null
+++ b/drivers/clk/ux500/u8500_clk.c
@@ -0,0 +1,477 @@
1/*
2 * Clock definitions for u8500 platform.
3 *
4 * Copyright (C) 2012 ST-Ericsson SA
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#include <linux/clk.h>
11#include <linux/clkdev.h>
12#include <linux/clk-provider.h>
13#include <linux/mfd/dbx500-prcmu.h>
14#include <linux/platform_data/clk-ux500.h>
15
16#include "clk.h"
17
18void u8500_clk_init(void)
19{
20 struct prcmu_fw_version *fw_version;
21 const char *sgaclk_parent = NULL;
22 struct clk *clk;
23
24 /* Clock sources */
25 clk = clk_reg_prcmu_gate("soc0_pll", NULL, PRCMU_PLLSOC0,
26 CLK_IS_ROOT|CLK_IGNORE_UNUSED);
27 clk_register_clkdev(clk, "soc0_pll", NULL);
28
29 clk = clk_reg_prcmu_gate("soc1_pll", NULL, PRCMU_PLLSOC1,
30 CLK_IS_ROOT|CLK_IGNORE_UNUSED);
31 clk_register_clkdev(clk, "soc1_pll", NULL);
32
33 clk = clk_reg_prcmu_gate("ddr_pll", NULL, PRCMU_PLLDDR,
34 CLK_IS_ROOT|CLK_IGNORE_UNUSED);
35 clk_register_clkdev(clk, "ddr_pll", NULL);
36
37 /* FIXME: Add sys, ulp and int clocks here. */
38
39 clk = clk_register_fixed_rate(NULL, "rtc32k", "NULL",
40 CLK_IS_ROOT|CLK_IGNORE_UNUSED,
41 32768);
42 clk_register_clkdev(clk, "clk32k", NULL);
43 clk_register_clkdev(clk, NULL, "rtc-pl031");
44
45 /* PRCMU clocks */
46 fw_version = prcmu_get_fw_version();
47 if (fw_version != NULL) {
48 switch (fw_version->project) {
49 case PRCMU_FW_PROJECT_U8500_C2:
50 case PRCMU_FW_PROJECT_U8520:
51 case PRCMU_FW_PROJECT_U8420:
52 sgaclk_parent = "soc0_pll";
53 break;
54 default:
55 break;
56 }
57 }
58
59 if (sgaclk_parent)
60 clk = clk_reg_prcmu_gate("sgclk", sgaclk_parent,
61 PRCMU_SGACLK, 0);
62 else
63 clk = clk_reg_prcmu_gate("sgclk", NULL,
64 PRCMU_SGACLK, CLK_IS_ROOT);
65 clk_register_clkdev(clk, NULL, "mali");
66
67 clk = clk_reg_prcmu_gate("uartclk", NULL, PRCMU_UARTCLK, CLK_IS_ROOT);
68 clk_register_clkdev(clk, NULL, "UART");
69
70 clk = clk_reg_prcmu_gate("msp02clk", NULL, PRCMU_MSP02CLK, CLK_IS_ROOT);
71 clk_register_clkdev(clk, NULL, "MSP02");
72
73 clk = clk_reg_prcmu_gate("msp1clk", NULL, PRCMU_MSP1CLK, CLK_IS_ROOT);
74 clk_register_clkdev(clk, NULL, "MSP1");
75
76 clk = clk_reg_prcmu_gate("i2cclk", NULL, PRCMU_I2CCLK, CLK_IS_ROOT);
77 clk_register_clkdev(clk, NULL, "I2C");
78
79 clk = clk_reg_prcmu_gate("slimclk", NULL, PRCMU_SLIMCLK, CLK_IS_ROOT);
80 clk_register_clkdev(clk, NULL, "slim");
81
82 clk = clk_reg_prcmu_gate("per1clk", NULL, PRCMU_PER1CLK, CLK_IS_ROOT);
83 clk_register_clkdev(clk, NULL, "PERIPH1");
84
85 clk = clk_reg_prcmu_gate("per2clk", NULL, PRCMU_PER2CLK, CLK_IS_ROOT);
86 clk_register_clkdev(clk, NULL, "PERIPH2");
87
88 clk = clk_reg_prcmu_gate("per3clk", NULL, PRCMU_PER3CLK, CLK_IS_ROOT);
89 clk_register_clkdev(clk, NULL, "PERIPH3");
90
91 clk = clk_reg_prcmu_gate("per5clk", NULL, PRCMU_PER5CLK, CLK_IS_ROOT);
92 clk_register_clkdev(clk, NULL, "PERIPH5");
93
94 clk = clk_reg_prcmu_gate("per6clk", NULL, PRCMU_PER6CLK, CLK_IS_ROOT);
95 clk_register_clkdev(clk, NULL, "PERIPH6");
96
97 clk = clk_reg_prcmu_gate("per7clk", NULL, PRCMU_PER7CLK, CLK_IS_ROOT);
98 clk_register_clkdev(clk, NULL, "PERIPH7");
99
100 clk = clk_reg_prcmu_scalable("lcdclk", NULL, PRCMU_LCDCLK, 0,
101 CLK_IS_ROOT|CLK_SET_RATE_GATE);
102 clk_register_clkdev(clk, NULL, "lcd");
103 clk_register_clkdev(clk, "lcd", "mcde");
104
105 clk = clk_reg_prcmu_opp_gate("bmlclk", NULL, PRCMU_BMLCLK, CLK_IS_ROOT);
106 clk_register_clkdev(clk, NULL, "bml");
107
108 clk = clk_reg_prcmu_scalable("hsitxclk", NULL, PRCMU_HSITXCLK, 0,
109 CLK_IS_ROOT|CLK_SET_RATE_GATE);
110
111 clk = clk_reg_prcmu_scalable("hsirxclk", NULL, PRCMU_HSIRXCLK, 0,
112 CLK_IS_ROOT|CLK_SET_RATE_GATE);
113
114 clk = clk_reg_prcmu_scalable("hdmiclk", NULL, PRCMU_HDMICLK, 0,
115 CLK_IS_ROOT|CLK_SET_RATE_GATE);
116 clk_register_clkdev(clk, NULL, "hdmi");
117 clk_register_clkdev(clk, "hdmi", "mcde");
118
119 clk = clk_reg_prcmu_gate("apeatclk", NULL, PRCMU_APEATCLK, CLK_IS_ROOT);
120 clk_register_clkdev(clk, NULL, "apeat");
121
122 clk = clk_reg_prcmu_gate("apetraceclk", NULL, PRCMU_APETRACECLK,
123 CLK_IS_ROOT);
124 clk_register_clkdev(clk, NULL, "apetrace");
125
126 clk = clk_reg_prcmu_gate("mcdeclk", NULL, PRCMU_MCDECLK, CLK_IS_ROOT);
127 clk_register_clkdev(clk, NULL, "mcde");
128 clk_register_clkdev(clk, "mcde", "mcde");
129 clk_register_clkdev(clk, "dsisys", "dsilink.0");
130 clk_register_clkdev(clk, "dsisys", "dsilink.1");
131 clk_register_clkdev(clk, "dsisys", "dsilink.2");
132
133 clk = clk_reg_prcmu_opp_gate("ipi2cclk", NULL, PRCMU_IPI2CCLK,
134 CLK_IS_ROOT);
135 clk_register_clkdev(clk, NULL, "ipi2");
136
137 clk = clk_reg_prcmu_gate("dsialtclk", NULL, PRCMU_DSIALTCLK,
138 CLK_IS_ROOT);
139 clk_register_clkdev(clk, NULL, "dsialt");
140
141 clk = clk_reg_prcmu_gate("dmaclk", NULL, PRCMU_DMACLK, CLK_IS_ROOT);
142 clk_register_clkdev(clk, NULL, "dma40.0");
143
144 clk = clk_reg_prcmu_gate("b2r2clk", NULL, PRCMU_B2R2CLK, CLK_IS_ROOT);
145 clk_register_clkdev(clk, NULL, "b2r2");
146 clk_register_clkdev(clk, NULL, "b2r2_core");
147 clk_register_clkdev(clk, NULL, "U8500-B2R2.0");
148
149 clk = clk_reg_prcmu_scalable("tvclk", NULL, PRCMU_TVCLK, 0,
150 CLK_IS_ROOT|CLK_SET_RATE_GATE);
151 clk_register_clkdev(clk, NULL, "tv");
152 clk_register_clkdev(clk, "tv", "mcde");
153
154 clk = clk_reg_prcmu_gate("sspclk", NULL, PRCMU_SSPCLK, CLK_IS_ROOT);
155 clk_register_clkdev(clk, NULL, "SSP");
156
157 clk = clk_reg_prcmu_gate("rngclk", NULL, PRCMU_RNGCLK, CLK_IS_ROOT);
158 clk_register_clkdev(clk, NULL, "rngclk");
159
160 clk = clk_reg_prcmu_gate("uiccclk", NULL, PRCMU_UICCCLK, CLK_IS_ROOT);
161 clk_register_clkdev(clk, NULL, "uicc");
162
163 /*
164 * FIXME: The MTU clocks might need some kind of "parent muxed join"
165 * and these have no K-clocks. For now, we ignore the missing
166 * connection to the corresponding P-clocks, p6_mtu0_clk and
167 * p6_mtu1_clk. Instead timclk is used which is the valid parent.
168 */
169 clk = clk_reg_prcmu_gate("timclk", NULL, PRCMU_TIMCLK, CLK_IS_ROOT);
170 clk_register_clkdev(clk, NULL, "mtu0");
171 clk_register_clkdev(clk, NULL, "mtu1");
172
173 clk = clk_reg_prcmu_gate("sdmmcclk", NULL, PRCMU_SDMMCCLK, CLK_IS_ROOT);
174 clk_register_clkdev(clk, NULL, "sdmmc");
175
176
177 clk = clk_reg_prcmu_scalable("dsi_pll", "hdmiclk",
178 PRCMU_PLLDSI, 0, CLK_SET_RATE_GATE);
179 clk_register_clkdev(clk, "dsihs2", "mcde");
180 clk_register_clkdev(clk, "dsihs2", "dsilink.2");
181
182
183 clk = clk_reg_prcmu_scalable("dsi0clk", "dsi_pll",
184 PRCMU_DSI0CLK, 0, CLK_SET_RATE_GATE);
185 clk_register_clkdev(clk, "dsihs0", "mcde");
186 clk_register_clkdev(clk, "dsihs0", "dsilink.0");
187
188 clk = clk_reg_prcmu_scalable("dsi1clk", "dsi_pll",
189 PRCMU_DSI1CLK, 0, CLK_SET_RATE_GATE);
190 clk_register_clkdev(clk, "dsihs1", "mcde");
191 clk_register_clkdev(clk, "dsihs1", "dsilink.1");
192
193 clk = clk_reg_prcmu_scalable("dsi0escclk", "tvclk",
194 PRCMU_DSI0ESCCLK, 0, CLK_SET_RATE_GATE);
195 clk_register_clkdev(clk, "dsilp0", "dsilink.0");
196 clk_register_clkdev(clk, "dsilp0", "mcde");
197
198 clk = clk_reg_prcmu_scalable("dsi1escclk", "tvclk",
199 PRCMU_DSI1ESCCLK, 0, CLK_SET_RATE_GATE);
200 clk_register_clkdev(clk, "dsilp1", "dsilink.1");
201 clk_register_clkdev(clk, "dsilp1", "mcde");
202
203 clk = clk_reg_prcmu_scalable("dsi2escclk", "tvclk",
204 PRCMU_DSI2ESCCLK, 0, CLK_SET_RATE_GATE);
205 clk_register_clkdev(clk, "dsilp2", "dsilink.2");
206 clk_register_clkdev(clk, "dsilp2", "mcde");
207
208 clk = clk_reg_prcmu_rate("smp_twd", NULL, PRCMU_ARMSS,
209 CLK_IS_ROOT|CLK_GET_RATE_NOCACHE|
210 CLK_IGNORE_UNUSED);
211 clk_register_clkdev(clk, NULL, "smp_twd");
212
213 /*
214 * FIXME: Add special handled PRCMU clocks here:
215 * 1. clk_arm, use PRCMU_ARMCLK.
216 * 2. clkout0yuv, use PRCMU as parent + need regulator + pinctrl.
217 * 3. ab9540_clkout1yuv, see clkout0yuv
218 */
219
220 /* PRCC P-clocks */
221 clk = clk_reg_prcc_pclk("p1_pclk0", "per1clk", U8500_CLKRST1_BASE,
222 BIT(0), 0);
223 clk_register_clkdev(clk, "apb_pclk", "uart0");
224
225 clk = clk_reg_prcc_pclk("p1_pclk1", "per1clk", U8500_CLKRST1_BASE,
226 BIT(1), 0);
227 clk_register_clkdev(clk, "apb_pclk", "uart1");
228
229 clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", U8500_CLKRST1_BASE,
230 BIT(2), 0);
231 clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", U8500_CLKRST1_BASE,
232 BIT(3), 0);
233 clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", U8500_CLKRST1_BASE,
234 BIT(4), 0);
235
236 clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", U8500_CLKRST1_BASE,
237 BIT(5), 0);
238 clk_register_clkdev(clk, "apb_pclk", "sdi0");
239
240 clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", U8500_CLKRST1_BASE,
241 BIT(6), 0);
242
243 clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", U8500_CLKRST1_BASE,
244 BIT(7), 0);
245 clk_register_clkdev(clk, NULL, "spi3");
246
247 clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", U8500_CLKRST1_BASE,
248 BIT(8), 0);
249
250 clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", U8500_CLKRST1_BASE,
251 BIT(9), 0);
252 clk_register_clkdev(clk, NULL, "gpio.0");
253 clk_register_clkdev(clk, NULL, "gpio.1");
254 clk_register_clkdev(clk, NULL, "gpioblock0");
255
256 clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", U8500_CLKRST1_BASE,
257 BIT(10), 0);
258 clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", U8500_CLKRST1_BASE,
259 BIT(11), 0);
260
261 clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", U8500_CLKRST2_BASE,
262 BIT(0), 0);
263
264 clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", U8500_CLKRST2_BASE,
265 BIT(1), 0);
266 clk_register_clkdev(clk, NULL, "spi2");
267
268 clk = clk_reg_prcc_pclk("p2_pclk2", "per2clk", U8500_CLKRST2_BASE,
269 BIT(2), 0);
270 clk_register_clkdev(clk, NULL, "spi1");
271
272 clk = clk_reg_prcc_pclk("p2_pclk3", "per2clk", U8500_CLKRST2_BASE,
273 BIT(3), 0);
274 clk_register_clkdev(clk, NULL, "pwl");
275
276 clk = clk_reg_prcc_pclk("p2_pclk4", "per2clk", U8500_CLKRST2_BASE,
277 BIT(4), 0);
278 clk_register_clkdev(clk, "apb_pclk", "sdi4");
279
280 clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", U8500_CLKRST2_BASE,
281 BIT(5), 0);
282
283 clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", U8500_CLKRST2_BASE,
284 BIT(6), 0);
285 clk_register_clkdev(clk, "apb_pclk", "sdi1");
286
287
288 clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", U8500_CLKRST2_BASE,
289 BIT(7), 0);
290 clk_register_clkdev(clk, "apb_pclk", "sdi3");
291
292 clk = clk_reg_prcc_pclk("p2_pclk8", "per2clk", U8500_CLKRST2_BASE,
293 BIT(8), 0);
294 clk_register_clkdev(clk, NULL, "spi0");
295
296 clk = clk_reg_prcc_pclk("p2_pclk9", "per2clk", U8500_CLKRST2_BASE,
297 BIT(9), 0);
298 clk_register_clkdev(clk, "hsir_hclk", "ste_hsi.0");
299
300 clk = clk_reg_prcc_pclk("p2_pclk10", "per2clk", U8500_CLKRST2_BASE,
301 BIT(10), 0);
302 clk_register_clkdev(clk, "hsit_hclk", "ste_hsi.0");
303
304 clk = clk_reg_prcc_pclk("p2_pclk11", "per2clk", U8500_CLKRST2_BASE,
305 BIT(11), 0);
306 clk_register_clkdev(clk, NULL, "gpio.6");
307 clk_register_clkdev(clk, NULL, "gpio.7");
308 clk_register_clkdev(clk, NULL, "gpioblock1");
309
310 clk = clk_reg_prcc_pclk("p2_pclk12", "per2clk", U8500_CLKRST2_BASE,
311 BIT(11), 0);
312
313 clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", U8500_CLKRST3_BASE,
314 BIT(0), 0);
315 clk_register_clkdev(clk, NULL, "fsmc");
316
317 clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", U8500_CLKRST3_BASE,
318 BIT(1), 0);
319 clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", U8500_CLKRST3_BASE,
320 BIT(2), 0);
321 clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", U8500_CLKRST3_BASE,
322 BIT(3), 0);
323
324 clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", U8500_CLKRST3_BASE,
325 BIT(4), 0);
326 clk_register_clkdev(clk, "apb_pclk", "sdi2");
327
328 clk = clk_reg_prcc_pclk("p3_pclk5", "per3clk", U8500_CLKRST3_BASE,
329 BIT(5), 0);
330
331 clk = clk_reg_prcc_pclk("p3_pclk6", "per3clk", U8500_CLKRST3_BASE,
332 BIT(6), 0);
333 clk_register_clkdev(clk, "apb_pclk", "uart2");
334
335 clk = clk_reg_prcc_pclk("p3_pclk7", "per3clk", U8500_CLKRST3_BASE,
336 BIT(7), 0);
337 clk_register_clkdev(clk, "apb_pclk", "sdi5");
338
339 clk = clk_reg_prcc_pclk("p3_pclk8", "per3clk", U8500_CLKRST3_BASE,
340 BIT(8), 0);
341 clk_register_clkdev(clk, NULL, "gpio.2");
342 clk_register_clkdev(clk, NULL, "gpio.3");
343 clk_register_clkdev(clk, NULL, "gpio.4");
344 clk_register_clkdev(clk, NULL, "gpio.5");
345 clk_register_clkdev(clk, NULL, "gpioblock2");
346
347 clk = clk_reg_prcc_pclk("p5_pclk0", "per5clk", U8500_CLKRST5_BASE,
348 BIT(0), 0);
349 clk_register_clkdev(clk, "usb", "musb-ux500.0");
350
351 clk = clk_reg_prcc_pclk("p5_pclk1", "per5clk", U8500_CLKRST5_BASE,
352 BIT(1), 0);
353 clk_register_clkdev(clk, NULL, "gpio.8");
354 clk_register_clkdev(clk, NULL, "gpioblock3");
355
356 clk = clk_reg_prcc_pclk("p6_pclk0", "per6clk", U8500_CLKRST6_BASE,
357 BIT(0), 0);
358
359 clk = clk_reg_prcc_pclk("p6_pclk1", "per6clk", U8500_CLKRST6_BASE,
360 BIT(1), 0);
361 clk_register_clkdev(clk, NULL, "cryp0");
362 clk_register_clkdev(clk, NULL, "cryp1");
363
364 clk = clk_reg_prcc_pclk("p6_pclk2", "per6clk", U8500_CLKRST6_BASE,
365 BIT(2), 0);
366 clk_register_clkdev(clk, NULL, "hash0");
367
368 clk = clk_reg_prcc_pclk("p6_pclk3", "per6clk", U8500_CLKRST6_BASE,
369 BIT(3), 0);
370 clk_register_clkdev(clk, NULL, "pka");
371
372 clk = clk_reg_prcc_pclk("p6_pclk4", "per6clk", U8500_CLKRST6_BASE,
373 BIT(4), 0);
374 clk_register_clkdev(clk, NULL, "hash1");
375
376 clk = clk_reg_prcc_pclk("p6_pclk5", "per6clk", U8500_CLKRST6_BASE,
377 BIT(5), 0);
378 clk_register_clkdev(clk, NULL, "cfgreg");
379
380 clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", U8500_CLKRST6_BASE,
381 BIT(6), 0);
382 clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", U8500_CLKRST6_BASE,
383 BIT(7), 0);
384
385 /* PRCC K-clocks
386 *
387 * FIXME: Some drivers requires PERPIH[n| to be automatically enabled
388 * by enabling just the K-clock, even if it is not a valid parent to
389 * the K-clock. Until drivers get fixed we might need some kind of
390 * "parent muxed join".
391 */
392
393 /* Periph1 */
394 clk = clk_reg_prcc_kclk("p1_uart0_kclk", "uartclk",
395 U8500_CLKRST1_BASE, BIT(0), CLK_SET_RATE_GATE);
396 clk_register_clkdev(clk, NULL, "uart0");
397
398 clk = clk_reg_prcc_kclk("p1_uart1_kclk", "uartclk",
399 U8500_CLKRST1_BASE, BIT(1), CLK_SET_RATE_GATE);
400 clk_register_clkdev(clk, NULL, "uart1");
401
402 clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk",
403 U8500_CLKRST1_BASE, BIT(2), CLK_SET_RATE_GATE);
404 clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk",
405 U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE);
406 clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk",
407 U8500_CLKRST1_BASE, BIT(4), CLK_SET_RATE_GATE);
408
409 clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmcclk",
410 U8500_CLKRST1_BASE, BIT(5), CLK_SET_RATE_GATE);
411 clk_register_clkdev(clk, NULL, "sdi0");
412
413 clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk",
414 U8500_CLKRST1_BASE, BIT(6), CLK_SET_RATE_GATE);
415 clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk",
416 U8500_CLKRST1_BASE, BIT(3), CLK_SET_RATE_GATE);
417 /* FIXME: Redefinition of BIT(3). */
418 clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk",
419 U8500_CLKRST1_BASE, BIT(9), CLK_SET_RATE_GATE);
420 clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk",
421 U8500_CLKRST1_BASE, BIT(10), CLK_SET_RATE_GATE);
422
423 /* Periph2 */
424 clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk",
425 U8500_CLKRST2_BASE, BIT(0), CLK_SET_RATE_GATE);
426
427 clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk",
428 U8500_CLKRST2_BASE, BIT(2), CLK_SET_RATE_GATE);
429 clk_register_clkdev(clk, NULL, "sdi4");
430
431 clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk",
432 U8500_CLKRST2_BASE, BIT(3), CLK_SET_RATE_GATE);
433
434 clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmcclk",
435 U8500_CLKRST2_BASE, BIT(4), CLK_SET_RATE_GATE);
436 clk_register_clkdev(clk, NULL, "sdi1");
437
438 clk = clk_reg_prcc_kclk("p2_sdi3_kclk", "sdmmcclk",
439 U8500_CLKRST2_BASE, BIT(5), CLK_SET_RATE_GATE);
440 clk_register_clkdev(clk, NULL, "sdi3");
441
442 /* Note that rate is received from parent. */
443 clk = clk_reg_prcc_kclk("p2_ssirx_kclk", "hsirxclk",
444 U8500_CLKRST2_BASE, BIT(6),
445 CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT);
446 clk = clk_reg_prcc_kclk("p2_ssitx_kclk", "hsitxclk",
447 U8500_CLKRST2_BASE, BIT(7),
448 CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT);
449
450 /* Periph3 */
451 clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk",
452 U8500_CLKRST3_BASE, BIT(1), CLK_SET_RATE_GATE);
453 clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk",
454 U8500_CLKRST3_BASE, BIT(2), CLK_SET_RATE_GATE);
455 clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk",
456 U8500_CLKRST3_BASE, BIT(3), CLK_SET_RATE_GATE);
457
458 clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk",
459 U8500_CLKRST3_BASE, BIT(4), CLK_SET_RATE_GATE);
460 clk_register_clkdev(clk, NULL, "sdi2");
461
462 clk = clk_reg_prcc_kclk("p3_ske_kclk", "rtc32k",
463 U8500_CLKRST3_BASE, BIT(5), CLK_SET_RATE_GATE);
464
465 clk = clk_reg_prcc_kclk("p3_uart2_kclk", "uartclk",
466 U8500_CLKRST3_BASE, BIT(6), CLK_SET_RATE_GATE);
467 clk_register_clkdev(clk, NULL, "uart2");
468
469 clk = clk_reg_prcc_kclk("p3_sdi5_kclk", "sdmmcclk",
470 U8500_CLKRST3_BASE, BIT(7), CLK_SET_RATE_GATE);
471 clk_register_clkdev(clk, NULL, "sdi5");
472
473 /* Periph6 */
474 clk = clk_reg_prcc_kclk("p3_rng_kclk", "rngclk",
475 U8500_CLKRST6_BASE, BIT(0), CLK_SET_RATE_GATE);
476
477}
diff --git a/drivers/clk/ux500/u8540_clk.c b/drivers/clk/ux500/u8540_clk.c
new file mode 100644
index 000000000000..10adfd2ead21
--- /dev/null
+++ b/drivers/clk/ux500/u8540_clk.c
@@ -0,0 +1,21 @@
1/*
2 * Clock definitions for u8540 platform.
3 *
4 * Copyright (C) 2012 ST-Ericsson SA
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#include <linux/clk.h>
11#include <linux/clkdev.h>
12#include <linux/clk-provider.h>
13#include <linux/mfd/dbx500-prcmu.h>
14#include <linux/platform_data/clk-ux500.h>
15
16#include "clk.h"
17
18void u8540_clk_init(void)
19{
20 /* register clocks here */
21}
diff --git a/drivers/clk/ux500/u9540_clk.c b/drivers/clk/ux500/u9540_clk.c
new file mode 100644
index 000000000000..dbc0191e16c8
--- /dev/null
+++ b/drivers/clk/ux500/u9540_clk.c
@@ -0,0 +1,21 @@
1/*
2 * Clock definitions for u9540 platform.
3 *
4 * Copyright (C) 2012 ST-Ericsson SA
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#include <linux/clk.h>
11#include <linux/clkdev.h>
12#include <linux/clk-provider.h>
13#include <linux/mfd/dbx500-prcmu.h>
14#include <linux/platform_data/clk-ux500.h>
15
16#include "clk.h"
17
18void u9540_clk_init(void)
19{
20 /* register clocks here */
21}
diff --git a/drivers/clk/versatile/Makefile b/drivers/clk/versatile/Makefile
index 50cf6a2ee693..c0a0f6478798 100644
--- a/drivers/clk/versatile/Makefile
+++ b/drivers/clk/versatile/Makefile
@@ -1,3 +1,4 @@
1# Makefile for Versatile-specific clocks 1# Makefile for Versatile-specific clocks
2obj-$(CONFIG_ICST) += clk-icst.o 2obj-$(CONFIG_ICST) += clk-icst.o
3obj-$(CONFIG_ARCH_INTEGRATOR) += clk-integrator.o 3obj-$(CONFIG_ARCH_INTEGRATOR) += clk-integrator.o
4obj-$(CONFIG_ARCH_REALVIEW) += clk-realview.o
diff --git a/drivers/clk/versatile/clk-realview.c b/drivers/clk/versatile/clk-realview.c
new file mode 100644
index 000000000000..e21a99cef378
--- /dev/null
+++ b/drivers/clk/versatile/clk-realview.c
@@ -0,0 +1,114 @@
1#include <linux/clk.h>
2#include <linux/clkdev.h>
3#include <linux/err.h>
4#include <linux/io.h>
5#include <linux/clk-provider.h>
6
7#include <mach/hardware.h>
8#include <mach/platform.h>
9
10#include "clk-icst.h"
11
12/*
13 * Implementation of the ARM RealView clock trees.
14 */
15
16static void __iomem *sys_lock;
17static void __iomem *sys_vcoreg;
18
19/**
20 * realview_oscvco_get() - get ICST OSC settings for the RealView
21 */
22static struct icst_vco realview_oscvco_get(void)
23{
24 u32 val;
25 struct icst_vco vco;
26
27 val = readl(sys_vcoreg);
28 vco.v = val & 0x1ff;
29 vco.r = (val >> 9) & 0x7f;
30 vco.s = (val >> 16) & 03;
31 return vco;
32}
33
34static void realview_oscvco_set(struct icst_vco vco)
35{
36 u32 val;
37
38 val = readl(sys_vcoreg) & ~0x7ffff;
39 val |= vco.v | (vco.r << 9) | (vco.s << 16);
40
41 /* This magic unlocks the CM VCO so it can be controlled */
42 writel(0xa05f, sys_lock);
43 writel(val, sys_vcoreg);
44 /* This locks the CM again */
45 writel(0, sys_lock);
46}
47
48static const struct icst_params realview_oscvco_params = {
49 .ref = 24000000,
50 .vco_max = ICST307_VCO_MAX,
51 .vco_min = ICST307_VCO_MIN,
52 .vd_min = 4 + 8,
53 .vd_max = 511 + 8,
54 .rd_min = 1 + 2,
55 .rd_max = 127 + 2,
56 .s2div = icst307_s2div,
57 .idx2s = icst307_idx2s,
58};
59
60static const struct clk_icst_desc __initdata realview_icst_desc = {
61 .params = &realview_oscvco_params,
62 .getvco = realview_oscvco_get,
63 .setvco = realview_oscvco_set,
64};
65
66/*
67 * realview_clk_init() - set up the RealView clock tree
68 */
69void __init realview_clk_init(void __iomem *sysbase, bool is_pb1176)
70{
71 struct clk *clk;
72
73 sys_lock = sysbase + REALVIEW_SYS_LOCK_OFFSET;
74 if (is_pb1176)
75 sys_vcoreg = sysbase + REALVIEW_SYS_OSC0_OFFSET;
76 else
77 sys_vcoreg = sysbase + REALVIEW_SYS_OSC4_OFFSET;
78
79
80 /* APB clock dummy */
81 clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0);
82 clk_register_clkdev(clk, "apb_pclk", NULL);
83
84 /* 24 MHz clock */
85 clk = clk_register_fixed_rate(NULL, "clk24mhz", NULL, CLK_IS_ROOT,
86 24000000);
87 clk_register_clkdev(clk, NULL, "dev:uart0");
88 clk_register_clkdev(clk, NULL, "dev:uart1");
89 clk_register_clkdev(clk, NULL, "dev:uart2");
90 clk_register_clkdev(clk, NULL, "fpga:kmi0");
91 clk_register_clkdev(clk, NULL, "fpga:kmi1");
92 clk_register_clkdev(clk, NULL, "fpga:mmc0");
93 clk_register_clkdev(clk, NULL, "dev:ssp0");
94 if (is_pb1176) {
95 /*
96 * UART3 is on the dev chip in PB1176
97 * UART4 only exists in PB1176
98 */
99 clk_register_clkdev(clk, NULL, "dev:uart3");
100 clk_register_clkdev(clk, NULL, "dev:uart4");
101 } else
102 clk_register_clkdev(clk, NULL, "fpga:uart3");
103
104
105 /* 1 MHz clock */
106 clk = clk_register_fixed_rate(NULL, "clk1mhz", NULL, CLK_IS_ROOT,
107 1000000);
108 clk_register_clkdev(clk, NULL, "sp804");
109
110 /* ICST VCO clock */
111 clk = icst_clk_register(NULL, &realview_icst_desc);
112 clk_register_clkdev(clk, NULL, "dev:clcd");
113 clk_register_clkdev(clk, NULL, "issp:clcd");
114}
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index b65d0c56ab35..d496a55f6bb0 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -13,3 +13,4 @@ obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o
13obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o 13obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o
14obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o 14obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o
15obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o 15obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o
16obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o
diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c
new file mode 100644
index 000000000000..bc19f12c20ce
--- /dev/null
+++ b/drivers/clocksource/bcm2835_timer.c
@@ -0,0 +1,161 @@
1/*
2 * Copyright 2012 Simon Arlott
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#include <linux/bcm2835_timer.h>
20#include <linux/bitops.h>
21#include <linux/clockchips.h>
22#include <linux/clocksource.h>
23#include <linux/interrupt.h>
24#include <linux/irqreturn.h>
25#include <linux/kernel.h>
26#include <linux/module.h>
27#include <linux/of_address.h>
28#include <linux/of_irq.h>
29#include <linux/of_platform.h>
30#include <linux/slab.h>
31#include <linux/string.h>
32
33#include <asm/sched_clock.h>
34#include <asm/irq.h>
35
36#define REG_CONTROL 0x00
37#define REG_COUNTER_LO 0x04
38#define REG_COUNTER_HI 0x08
39#define REG_COMPARE(n) (0x0c + (n) * 4)
40#define MAX_TIMER 3
41#define DEFAULT_TIMER 3
42
43struct bcm2835_timer {
44 void __iomem *control;
45 void __iomem *compare;
46 int match_mask;
47 struct clock_event_device evt;
48 struct irqaction act;
49};
50
51static void __iomem *system_clock __read_mostly;
52
53static u32 notrace bcm2835_sched_read(void)
54{
55 return readl_relaxed(system_clock);
56}
57
58static void bcm2835_time_set_mode(enum clock_event_mode mode,
59 struct clock_event_device *evt_dev)
60{
61 switch (mode) {
62 case CLOCK_EVT_MODE_ONESHOT:
63 case CLOCK_EVT_MODE_UNUSED:
64 case CLOCK_EVT_MODE_SHUTDOWN:
65 case CLOCK_EVT_MODE_RESUME:
66 break;
67 default:
68 WARN(1, "%s: unhandled event mode %d\n", __func__, mode);
69 break;
70 }
71}
72
73static int bcm2835_time_set_next_event(unsigned long event,
74 struct clock_event_device *evt_dev)
75{
76 struct bcm2835_timer *timer = container_of(evt_dev,
77 struct bcm2835_timer, evt);
78 writel_relaxed(readl_relaxed(system_clock) + event,
79 timer->compare);
80 return 0;
81}
82
83static irqreturn_t bcm2835_time_interrupt(int irq, void *dev_id)
84{
85 struct bcm2835_timer *timer = dev_id;
86 void (*event_handler)(struct clock_event_device *);
87 if (readl_relaxed(timer->control) & timer->match_mask) {
88 writel_relaxed(timer->match_mask, timer->control);
89
90 event_handler = ACCESS_ONCE(timer->evt.event_handler);
91 if (event_handler)
92 event_handler(&timer->evt);
93 return IRQ_HANDLED;
94 } else {
95 return IRQ_NONE;
96 }
97}
98
99static struct of_device_id bcm2835_time_match[] __initconst = {
100 { .compatible = "brcm,bcm2835-system-timer" },
101 {}
102};
103
104static void __init bcm2835_time_init(void)
105{
106 struct device_node *node;
107 void __iomem *base;
108 u32 freq;
109 int irq;
110 struct bcm2835_timer *timer;
111
112 node = of_find_matching_node(NULL, bcm2835_time_match);
113 if (!node)
114 panic("No bcm2835 timer node");
115
116 base = of_iomap(node, 0);
117 if (!base)
118 panic("Can't remap registers");
119
120 if (of_property_read_u32(node, "clock-frequency", &freq))
121 panic("Can't read clock-frequency");
122
123 system_clock = base + REG_COUNTER_LO;
124 setup_sched_clock(bcm2835_sched_read, 32, freq);
125
126 clocksource_mmio_init(base + REG_COUNTER_LO, node->name,
127 freq, 300, 32, clocksource_mmio_readl_up);
128
129 irq = irq_of_parse_and_map(node, DEFAULT_TIMER);
130 if (irq <= 0)
131 panic("Can't parse IRQ");
132
133 timer = kzalloc(sizeof(*timer), GFP_KERNEL);
134 if (!timer)
135 panic("Can't allocate timer struct\n");
136
137 timer->control = base + REG_CONTROL;
138 timer->compare = base + REG_COMPARE(DEFAULT_TIMER);
139 timer->match_mask = BIT(DEFAULT_TIMER);
140 timer->evt.name = node->name;
141 timer->evt.rating = 300;
142 timer->evt.features = CLOCK_EVT_FEAT_ONESHOT;
143 timer->evt.set_mode = bcm2835_time_set_mode;
144 timer->evt.set_next_event = bcm2835_time_set_next_event;
145 timer->evt.cpumask = cpumask_of(0);
146 timer->act.name = node->name;
147 timer->act.flags = IRQF_TIMER | IRQF_SHARED;
148 timer->act.dev_id = timer;
149 timer->act.handler = bcm2835_time_interrupt;
150
151 if (setup_irq(irq, &timer->act))
152 panic("Can't set up timer IRQ\n");
153
154 clockevents_config_and_register(&timer->evt, freq, 0xf, 0xffffffff);
155
156 pr_info("bcm2835: system timer (irq = %d)\n", irq);
157}
158
159struct sys_timer bcm2835_timer = {
160 .init = bcm2835_time_init,
161};
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
index 21c1a87032b7..24ccae453e79 100644
--- a/drivers/crypto/mv_cesa.c
+++ b/drivers/crypto/mv_cesa.c
@@ -19,6 +19,9 @@
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <crypto/internal/hash.h> 20#include <crypto/internal/hash.h>
21#include <crypto/sha.h> 21#include <crypto/sha.h>
22#include <linux/of.h>
23#include <linux/of_platform.h>
24#include <linux/of_irq.h>
22 25
23#include "mv_cesa.h" 26#include "mv_cesa.h"
24 27
@@ -1062,7 +1065,10 @@ static int mv_probe(struct platform_device *pdev)
1062 goto err_unmap_reg; 1065 goto err_unmap_reg;
1063 } 1066 }
1064 1067
1065 irq = platform_get_irq(pdev, 0); 1068 if (pdev->dev.of_node)
1069 irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
1070 else
1071 irq = platform_get_irq(pdev, 0);
1066 if (irq < 0 || irq == NO_IRQ) { 1072 if (irq < 0 || irq == NO_IRQ) {
1067 ret = irq; 1073 ret = irq;
1068 goto err_unmap_sram; 1074 goto err_unmap_sram;
@@ -1170,12 +1176,19 @@ static int mv_remove(struct platform_device *pdev)
1170 return 0; 1176 return 0;
1171} 1177}
1172 1178
1179static const struct of_device_id mv_cesa_of_match_table[] = {
1180 { .compatible = "marvell,orion-crypto", },
1181 {}
1182};
1183MODULE_DEVICE_TABLE(of, mv_cesa_of_match_table);
1184
1173static struct platform_driver marvell_crypto = { 1185static struct platform_driver marvell_crypto = {
1174 .probe = mv_probe, 1186 .probe = mv_probe,
1175 .remove = mv_remove, 1187 .remove = __devexit_p(mv_remove),
1176 .driver = { 1188 .driver = {
1177 .owner = THIS_MODULE, 1189 .owner = THIS_MODULE,
1178 .name = "mv_crypto", 1190 .name = "mv_crypto",
1191 .of_match_table = of_match_ptr(mv_cesa_of_match_table),
1179 }, 1192 },
1180}; 1193};
1181MODULE_ALIAS("platform:mv_crypto"); 1194MODULE_ALIAS("platform:mv_crypto");
diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c
index 1c307e1b840c..ef17e3871c71 100644
--- a/drivers/crypto/ux500/cryp/cryp_core.c
+++ b/drivers/crypto/ux500/cryp/cryp_core.c
@@ -32,7 +32,7 @@
32 32
33#include <plat/ste_dma40.h> 33#include <plat/ste_dma40.h>
34 34
35#include <mach/crypto-ux500.h> 35#include <linux/platform_data/crypto-ux500.h>
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37 37
38#include "cryp_p.h" 38#include "cryp_p.h"
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
index 08d5032cb564..08765072a2b3 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -31,7 +31,7 @@
31#include <crypto/scatterwalk.h> 31#include <crypto/scatterwalk.h>
32#include <crypto/algapi.h> 32#include <crypto/algapi.h>
33 33
34#include <mach/crypto-ux500.h> 34#include <linux/platform_data/crypto-ux500.h>
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36 36
37#include "hash_alg.h" 37#include "hash_alg.h"
diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
index 8a6c8e8b2940..116e4adffb08 100644
--- a/drivers/dma/at_hdmac_regs.h
+++ b/drivers/dma/at_hdmac_regs.h
@@ -11,7 +11,7 @@
11#ifndef AT_HDMAC_REGS_H 11#ifndef AT_HDMAC_REGS_H
12#define AT_HDMAC_REGS_H 12#define AT_HDMAC_REGS_H
13 13
14#include <mach/at_hdmac.h> 14#include <linux/platform_data/dma-atmel.h>
15 15
16#define AT_DMA_MAX_NR_CHANNELS 8 16#define AT_DMA_MAX_NR_CHANNELS 8
17 17
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c
index c64917ec313d..4aeaea77f72e 100644
--- a/drivers/dma/ep93xx_dma.c
+++ b/drivers/dma/ep93xx_dma.c
@@ -26,7 +26,7 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28 28
29#include <mach/dma.h> 29#include <linux/platform_data/dma-ep93xx.h>
30 30
31#include "dmaengine.h" 31#include "dmaengine.h"
32 32
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 5084975d793c..b90aaec4ccc4 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -28,7 +28,7 @@
28#include <linux/module.h> 28#include <linux/module.h>
29 29
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <mach/dma.h> 31#include <linux/platform_data/dma-imx.h>
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33 33
34#include "dmaengine.h" 34#include "dmaengine.h"
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 1dc2a4ad0026..1b781d6ac425 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -38,8 +38,8 @@
38#include <linux/of_device.h> 38#include <linux/of_device.h>
39 39
40#include <asm/irq.h> 40#include <asm/irq.h>
41#include <mach/sdma.h> 41#include <linux/platform_data/dma-imx-sdma.h>
42#include <mach/dma.h> 42#include <linux/platform_data/dma-imx.h>
43#include <mach/hardware.h> 43#include <mach/hardware.h>
44 44
45#include "dmaengine.h" 45#include "dmaengine.h"
diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 8a15cf2163dc..07fa48688ba9 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -19,7 +19,7 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/device.h> 20#include <linux/device.h>
21#include <mach/regs-icu.h> 21#include <mach/regs-icu.h>
22#include <mach/sram.h> 22#include <linux/platform_data/dma-mmp_tdma.h>
23 23
24#include "dmaengine.h" 24#include "dmaengine.h"
25 25
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 0b12e68bf79c..e362e2b80efb 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -26,7 +26,7 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/memory.h> 27#include <linux/memory.h>
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <plat/mv_xor.h> 29#include <linux/platform_data/dma-mv_xor.h>
30 30
31#include "dmaengine.h" 31#include "dmaengine.h"
32#include "mv_xor.h" 32#include "mv_xor.h"
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index ba7926f5c099..66a59510887f 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -150,6 +150,12 @@ config GPIO_MSM_V2
150 Qualcomm MSM chips. Most of the pins on the MSM can be 150 Qualcomm MSM chips. Most of the pins on the MSM can be
151 selected for GPIO, and are controlled by this driver. 151 selected for GPIO, and are controlled by this driver.
152 152
153config GPIO_MVEBU
154 def_bool y
155 depends on ARCH_MVEBU
156 select GPIO_GENERIC
157 select GENERIC_IRQ_CHIP
158
153config GPIO_MXC 159config GPIO_MXC
154 def_bool y 160 def_bool y
155 depends on ARCH_MXC 161 depends on ARCH_MXC
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 153caceeb053..1a33e6716e10 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -41,6 +41,7 @@ obj-$(CONFIG_GPIO_MPC8XXX) += gpio-mpc8xxx.o
41obj-$(CONFIG_GPIO_MSIC) += gpio-msic.o 41obj-$(CONFIG_GPIO_MSIC) += gpio-msic.o
42obj-$(CONFIG_GPIO_MSM_V1) += gpio-msm-v1.o 42obj-$(CONFIG_GPIO_MSM_V1) += gpio-msm-v1.o
43obj-$(CONFIG_GPIO_MSM_V2) += gpio-msm-v2.o 43obj-$(CONFIG_GPIO_MSM_V2) += gpio-msm-v2.o
44obj-$(CONFIG_GPIO_MVEBU) += gpio-mvebu.o
44obj-$(CONFIG_GPIO_MXC) += gpio-mxc.o 45obj-$(CONFIG_GPIO_MXC) += gpio-mxc.o
45obj-$(CONFIG_GPIO_MXS) += gpio-mxs.o 46obj-$(CONFIG_GPIO_MXS) += gpio-mxs.o
46obj-$(CONFIG_ARCH_OMAP) += gpio-omap.o 47obj-$(CONFIG_ARCH_OMAP) += gpio-omap.o
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
new file mode 100644
index 000000000000..902af437eaf2
--- /dev/null
+++ b/drivers/gpio/gpio-mvebu.c
@@ -0,0 +1,679 @@
1/*
2 * GPIO driver for Marvell SoCs
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 * Andrew Lunn <andrew@lunn.ch>
8 * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
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 * This driver is a fairly straightforward GPIO driver for the
15 * complete family of Marvell EBU SoC platforms (Orion, Dove,
16 * Kirkwood, Discovery, Armada 370/XP). The only complexity of this
17 * driver is the different register layout that exists between the
18 * non-SMP platforms (Orion, Dove, Kirkwood, Armada 370) and the SMP
19 * platforms (MV78200 from the Discovery family and the Armada
20 * XP). Therefore, this driver handles three variants of the GPIO
21 * block:
22 * - the basic variant, called "orion-gpio", with the simplest
23 * register set. Used on Orion, Dove, Kirkwoord, Armada 370 and
24 * non-SMP Discovery systems
25 * - the mv78200 variant for MV78200 Discovery systems. This variant
26 * turns the edge mask and level mask registers into CPU0 edge
27 * mask/level mask registers, and adds CPU1 edge mask/level mask
28 * registers.
29 * - the armadaxp variant for Armada XP systems. This variant keeps
30 * the normal cause/edge mask/level mask registers when the global
31 * interrupts are used, but adds per-CPU cause/edge mask/level mask
32 * registers n a separate memory area for the per-CPU GPIO
33 * interrupts.
34 */
35
36#include <linux/module.h>
37#include <linux/gpio.h>
38#include <linux/irq.h>
39#include <linux/slab.h>
40#include <linux/irqdomain.h>
41#include <linux/io.h>
42#include <linux/of_irq.h>
43#include <linux/of_device.h>
44#include <linux/platform_device.h>
45#include <linux/pinctrl/consumer.h>
46
47/*
48 * GPIO unit register offsets.
49 */
50#define GPIO_OUT_OFF 0x0000
51#define GPIO_IO_CONF_OFF 0x0004
52#define GPIO_BLINK_EN_OFF 0x0008
53#define GPIO_IN_POL_OFF 0x000c
54#define GPIO_DATA_IN_OFF 0x0010
55#define GPIO_EDGE_CAUSE_OFF 0x0014
56#define GPIO_EDGE_MASK_OFF 0x0018
57#define GPIO_LEVEL_MASK_OFF 0x001c
58
59/* The MV78200 has per-CPU registers for edge mask and level mask */
60#define GPIO_EDGE_MASK_MV78200_OFF(cpu) ((cpu) ? 0x30 : 0x18)
61#define GPIO_LEVEL_MASK_MV78200_OFF(cpu) ((cpu) ? 0x34 : 0x1C)
62
63/* The Armada XP has per-CPU registers for interrupt cause, interrupt
64 * mask and interrupt level mask. Those are relative to the
65 * percpu_membase. */
66#define GPIO_EDGE_CAUSE_ARMADAXP_OFF(cpu) ((cpu) * 0x4)
67#define GPIO_EDGE_MASK_ARMADAXP_OFF(cpu) (0x10 + (cpu) * 0x4)
68#define GPIO_LEVEL_MASK_ARMADAXP_OFF(cpu) (0x20 + (cpu) * 0x4)
69
70#define MVEBU_GPIO_SOC_VARIANT_ORION 0x1
71#define MVEBU_GPIO_SOC_VARIANT_MV78200 0x2
72#define MVEBU_GPIO_SOC_VARIANT_ARMADAXP 0x3
73
74#define MVEBU_MAX_GPIO_PER_BANK 32
75
76struct mvebu_gpio_chip {
77 struct gpio_chip chip;
78 spinlock_t lock;
79 void __iomem *membase;
80 void __iomem *percpu_membase;
81 unsigned int irqbase;
82 struct irq_domain *domain;
83 int soc_variant;
84};
85
86/*
87 * Functions returning addresses of individual registers for a given
88 * GPIO controller.
89 */
90static inline void __iomem *mvebu_gpioreg_out(struct mvebu_gpio_chip *mvchip)
91{
92 return mvchip->membase + GPIO_OUT_OFF;
93}
94
95static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip)
96{
97 return mvchip->membase + GPIO_IO_CONF_OFF;
98}
99
100static inline void __iomem *mvebu_gpioreg_in_pol(struct mvebu_gpio_chip *mvchip)
101{
102 return mvchip->membase + GPIO_IN_POL_OFF;
103}
104
105static inline void __iomem *mvebu_gpioreg_data_in(struct mvebu_gpio_chip *mvchip)
106{
107 return mvchip->membase + GPIO_DATA_IN_OFF;
108}
109
110static inline void __iomem *mvebu_gpioreg_edge_cause(struct mvebu_gpio_chip *mvchip)
111{
112 int cpu;
113
114 switch(mvchip->soc_variant) {
115 case MVEBU_GPIO_SOC_VARIANT_ORION:
116 case MVEBU_GPIO_SOC_VARIANT_MV78200:
117 return mvchip->membase + GPIO_EDGE_CAUSE_OFF;
118 case MVEBU_GPIO_SOC_VARIANT_ARMADAXP:
119 cpu = smp_processor_id();
120 return mvchip->percpu_membase + GPIO_EDGE_CAUSE_ARMADAXP_OFF(cpu);
121 default:
122 BUG();
123 }
124}
125
126static inline void __iomem *mvebu_gpioreg_edge_mask(struct mvebu_gpio_chip *mvchip)
127{
128 int cpu;
129
130 switch(mvchip->soc_variant) {
131 case MVEBU_GPIO_SOC_VARIANT_ORION:
132 return mvchip->membase + GPIO_EDGE_MASK_OFF;
133 case MVEBU_GPIO_SOC_VARIANT_MV78200:
134 cpu = smp_processor_id();
135 return mvchip->membase + GPIO_EDGE_MASK_MV78200_OFF(cpu);
136 case MVEBU_GPIO_SOC_VARIANT_ARMADAXP:
137 cpu = smp_processor_id();
138 return mvchip->percpu_membase + GPIO_EDGE_MASK_ARMADAXP_OFF(cpu);
139 default:
140 BUG();
141 }
142}
143
144static void __iomem *mvebu_gpioreg_level_mask(struct mvebu_gpio_chip *mvchip)
145{
146 int cpu;
147
148 switch(mvchip->soc_variant) {
149 case MVEBU_GPIO_SOC_VARIANT_ORION:
150 return mvchip->membase + GPIO_LEVEL_MASK_OFF;
151 case MVEBU_GPIO_SOC_VARIANT_MV78200:
152 cpu = smp_processor_id();
153 return mvchip->membase + GPIO_LEVEL_MASK_MV78200_OFF(cpu);
154 case MVEBU_GPIO_SOC_VARIANT_ARMADAXP:
155 cpu = smp_processor_id();
156 return mvchip->percpu_membase + GPIO_LEVEL_MASK_ARMADAXP_OFF(cpu);
157 default:
158 BUG();
159 }
160}
161
162/*
163 * Functions implementing the gpio_chip methods
164 */
165
166int mvebu_gpio_request(struct gpio_chip *chip, unsigned pin)
167{
168 return pinctrl_request_gpio(chip->base + pin);
169}
170
171void mvebu_gpio_free(struct gpio_chip *chip, unsigned pin)
172{
173 pinctrl_free_gpio(chip->base + pin);
174}
175
176static void mvebu_gpio_set(struct gpio_chip *chip, unsigned pin, int value)
177{
178 struct mvebu_gpio_chip *mvchip =
179 container_of(chip, struct mvebu_gpio_chip, chip);
180 unsigned long flags;
181 u32 u;
182
183 spin_lock_irqsave(&mvchip->lock, flags);
184 u = readl_relaxed(mvebu_gpioreg_out(mvchip));
185 if (value)
186 u |= 1 << pin;
187 else
188 u &= ~(1 << pin);
189 writel_relaxed(u, mvebu_gpioreg_out(mvchip));
190 spin_unlock_irqrestore(&mvchip->lock, flags);
191}
192
193static int mvebu_gpio_get(struct gpio_chip *chip, unsigned pin)
194{
195 struct mvebu_gpio_chip *mvchip =
196 container_of(chip, struct mvebu_gpio_chip, chip);
197 u32 u;
198
199 if (readl_relaxed(mvebu_gpioreg_io_conf(mvchip)) & (1 << pin)) {
200 u = readl_relaxed(mvebu_gpioreg_data_in(mvchip)) ^
201 readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
202 } else {
203 u = readl_relaxed(mvebu_gpioreg_out(mvchip));
204 }
205
206 return (u >> pin) & 1;
207}
208
209static int mvebu_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
210{
211 struct mvebu_gpio_chip *mvchip =
212 container_of(chip, struct mvebu_gpio_chip, chip);
213 unsigned long flags;
214 int ret;
215 u32 u;
216
217 /* Check with the pinctrl driver whether this pin is usable as
218 * an input GPIO */
219 ret = pinctrl_gpio_direction_input(chip->base + pin);
220 if (ret)
221 return ret;
222
223 spin_lock_irqsave(&mvchip->lock, flags);
224 u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip));
225 u |= 1 << pin;
226 writel_relaxed(u, mvebu_gpioreg_io_conf(mvchip));
227 spin_unlock_irqrestore(&mvchip->lock, flags);
228
229 return 0;
230}
231
232static int mvebu_gpio_direction_output(struct gpio_chip *chip, unsigned pin,
233 int value)
234{
235 struct mvebu_gpio_chip *mvchip =
236 container_of(chip, struct mvebu_gpio_chip, chip);
237 unsigned long flags;
238 int ret;
239 u32 u;
240
241 /* Check with the pinctrl driver whether this pin is usable as
242 * an output GPIO */
243 ret = pinctrl_gpio_direction_output(chip->base + pin);
244 if (ret)
245 return ret;
246
247 spin_lock_irqsave(&mvchip->lock, flags);
248 u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip));
249 u &= ~(1 << pin);
250 writel_relaxed(u, mvebu_gpioreg_io_conf(mvchip));
251 spin_unlock_irqrestore(&mvchip->lock, flags);
252
253 return 0;
254}
255
256static int mvebu_gpio_to_irq(struct gpio_chip *chip, unsigned pin)
257{
258 struct mvebu_gpio_chip *mvchip =
259 container_of(chip, struct mvebu_gpio_chip, chip);
260 return irq_create_mapping(mvchip->domain, pin);
261}
262
263/*
264 * Functions implementing the irq_chip methods
265 */
266static void mvebu_gpio_irq_ack(struct irq_data *d)
267{
268 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
269 struct mvebu_gpio_chip *mvchip = gc->private;
270 u32 mask = ~(1 << (d->irq - gc->irq_base));
271
272 irq_gc_lock(gc);
273 writel_relaxed(mask, mvebu_gpioreg_edge_cause(mvchip));
274 irq_gc_unlock(gc);
275}
276
277static void mvebu_gpio_edge_irq_mask(struct irq_data *d)
278{
279 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
280 struct mvebu_gpio_chip *mvchip = gc->private;
281 u32 mask = 1 << (d->irq - gc->irq_base);
282
283 irq_gc_lock(gc);
284 gc->mask_cache &= ~mask;
285 writel_relaxed(gc->mask_cache, mvebu_gpioreg_edge_mask(mvchip));
286 irq_gc_unlock(gc);
287}
288
289static void mvebu_gpio_edge_irq_unmask(struct irq_data *d)
290{
291 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
292 struct mvebu_gpio_chip *mvchip = gc->private;
293 u32 mask = 1 << (d->irq - gc->irq_base);
294
295 irq_gc_lock(gc);
296 gc->mask_cache |= mask;
297 writel_relaxed(gc->mask_cache, mvebu_gpioreg_edge_mask(mvchip));
298 irq_gc_unlock(gc);
299}
300
301static void mvebu_gpio_level_irq_mask(struct irq_data *d)
302{
303 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
304 struct mvebu_gpio_chip *mvchip = gc->private;
305 u32 mask = 1 << (d->irq - gc->irq_base);
306
307 irq_gc_lock(gc);
308 gc->mask_cache &= ~mask;
309 writel_relaxed(gc->mask_cache, mvebu_gpioreg_level_mask(mvchip));
310 irq_gc_unlock(gc);
311}
312
313static void mvebu_gpio_level_irq_unmask(struct irq_data *d)
314{
315 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
316 struct mvebu_gpio_chip *mvchip = gc->private;
317 u32 mask = 1 << (d->irq - gc->irq_base);
318
319 irq_gc_lock(gc);
320 gc->mask_cache |= mask;
321 writel_relaxed(gc->mask_cache, mvebu_gpioreg_level_mask(mvchip));
322 irq_gc_unlock(gc);
323}
324
325/*****************************************************************************
326 * MVEBU GPIO IRQ
327 *
328 * GPIO_IN_POL register controls whether GPIO_DATA_IN will hold the same
329 * value of the line or the opposite value.
330 *
331 * Level IRQ handlers: DATA_IN is used directly as cause register.
332 * Interrupt are masked by LEVEL_MASK registers.
333 * Edge IRQ handlers: Change in DATA_IN are latched in EDGE_CAUSE.
334 * Interrupt are masked by EDGE_MASK registers.
335 * Both-edge handlers: Similar to regular Edge handlers, but also swaps
336 * the polarity to catch the next line transaction.
337 * This is a race condition that might not perfectly
338 * work on some use cases.
339 *
340 * Every eight GPIO lines are grouped (OR'ed) before going up to main
341 * cause register.
342 *
343 * EDGE cause mask
344 * data-in /--------| |-----| |----\
345 * -----| |----- ---- to main cause reg
346 * X \----------------| |----/
347 * polarity LEVEL mask
348 *
349 ****************************************************************************/
350
351static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
352{
353 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
354 struct irq_chip_type *ct = irq_data_get_chip_type(d);
355 struct mvebu_gpio_chip *mvchip = gc->private;
356 int pin;
357 u32 u;
358
359 pin = d->hwirq;
360
361 u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip)) & (1 << pin);
362 if (!u) {
363 return -EINVAL;
364 }
365
366 type &= IRQ_TYPE_SENSE_MASK;
367 if (type == IRQ_TYPE_NONE)
368 return -EINVAL;
369
370 /* Check if we need to change chip and handler */
371 if (!(ct->type & type))
372 if (irq_setup_alt_chip(d, type))
373 return -EINVAL;
374
375 /*
376 * Configure interrupt polarity.
377 */
378 switch(type) {
379 case IRQ_TYPE_EDGE_RISING:
380 case IRQ_TYPE_LEVEL_HIGH:
381 u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
382 u &= ~(1 << pin);
383 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
384 case IRQ_TYPE_EDGE_FALLING:
385 case IRQ_TYPE_LEVEL_LOW:
386 u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
387 u |= 1 << pin;
388 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
389 case IRQ_TYPE_EDGE_BOTH: {
390 u32 v;
391
392 v = readl_relaxed(mvebu_gpioreg_in_pol(mvchip)) ^
393 readl_relaxed(mvebu_gpioreg_data_in(mvchip));
394
395 /*
396 * set initial polarity based on current input level
397 */
398 u = readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
399 if (v & (1 << pin))
400 u |= 1 << pin; /* falling */
401 else
402 u &= ~(1 << pin); /* rising */
403 writel_relaxed(u, mvebu_gpioreg_in_pol(mvchip));
404 }
405 }
406 return 0;
407}
408
409static void mvebu_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
410{
411 struct mvebu_gpio_chip *mvchip = irq_get_handler_data(irq);
412 u32 cause, type;
413 int i;
414
415 if (mvchip == NULL)
416 return;
417
418 cause = readl_relaxed(mvebu_gpioreg_data_in(mvchip)) &
419 readl_relaxed(mvebu_gpioreg_level_mask(mvchip));
420 cause |= readl_relaxed(mvebu_gpioreg_edge_cause(mvchip)) &
421 readl_relaxed(mvebu_gpioreg_edge_mask(mvchip));
422
423 for (i = 0; i < mvchip->chip.ngpio; i++) {
424 int irq;
425
426 irq = mvchip->irqbase + i;
427
428 if (!(cause & (1 << i)))
429 continue;
430
431 type = irqd_get_trigger_type(irq_get_irq_data(irq));
432 if ((type & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
433 /* Swap polarity (race with GPIO line) */
434 u32 polarity;
435
436 polarity = readl_relaxed(mvebu_gpioreg_in_pol(mvchip));
437 polarity ^= 1 << i;
438 writel_relaxed(polarity, mvebu_gpioreg_in_pol(mvchip));
439 }
440 generic_handle_irq(irq);
441 }
442}
443
444static struct platform_device_id mvebu_gpio_ids[] = {
445 {
446 .name = "orion-gpio",
447 }, {
448 .name = "mv78200-gpio",
449 }, {
450 .name = "armadaxp-gpio",
451 }, {
452 /* sentinel */
453 },
454};
455MODULE_DEVICE_TABLE(platform, mvebu_gpio_ids);
456
457static struct of_device_id mvebu_gpio_of_match[] __devinitdata = {
458 {
459 .compatible = "marvell,orion-gpio",
460 .data = (void*) MVEBU_GPIO_SOC_VARIANT_ORION,
461 },
462 {
463 .compatible = "marvell,mv78200-gpio",
464 .data = (void*) MVEBU_GPIO_SOC_VARIANT_MV78200,
465 },
466 {
467 .compatible = "marvell,armadaxp-gpio",
468 .data = (void*) MVEBU_GPIO_SOC_VARIANT_ARMADAXP,
469 },
470 {
471 /* sentinel */
472 },
473};
474MODULE_DEVICE_TABLE(of, mvebu_gpio_of_match);
475
476static int __devinit mvebu_gpio_probe(struct platform_device *pdev)
477{
478 struct mvebu_gpio_chip *mvchip;
479 const struct of_device_id *match;
480 struct device_node *np = pdev->dev.of_node;
481 struct resource *res;
482 struct irq_chip_generic *gc;
483 struct irq_chip_type *ct;
484 unsigned int ngpios;
485 int soc_variant;
486 int i, cpu, id;
487
488 match = of_match_device(mvebu_gpio_of_match, &pdev->dev);
489 if (match)
490 soc_variant = (int) match->data;
491 else
492 soc_variant = MVEBU_GPIO_SOC_VARIANT_ORION;
493
494 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
495 if (! res) {
496 dev_err(&pdev->dev, "Cannot get memory resource\n");
497 return -ENODEV;
498 }
499
500 mvchip = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_gpio_chip), GFP_KERNEL);
501 if (! mvchip){
502 dev_err(&pdev->dev, "Cannot allocate memory\n");
503 return -ENOMEM;
504 }
505
506 if (of_property_read_u32(pdev->dev.of_node, "ngpios", &ngpios)) {
507 dev_err(&pdev->dev, "Missing ngpios OF property\n");
508 return -ENODEV;
509 }
510
511 id = of_alias_get_id(pdev->dev.of_node, "gpio");
512 if (id < 0) {
513 dev_err(&pdev->dev, "Couldn't get OF id\n");
514 return id;
515 }
516
517 mvchip->soc_variant = soc_variant;
518 mvchip->chip.label = dev_name(&pdev->dev);
519 mvchip->chip.dev = &pdev->dev;
520 mvchip->chip.request = mvebu_gpio_request;
521 mvchip->chip.direction_input = mvebu_gpio_direction_input;
522 mvchip->chip.get = mvebu_gpio_get;
523 mvchip->chip.direction_output = mvebu_gpio_direction_output;
524 mvchip->chip.set = mvebu_gpio_set;
525 mvchip->chip.to_irq = mvebu_gpio_to_irq;
526 mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK;
527 mvchip->chip.ngpio = ngpios;
528 mvchip->chip.can_sleep = 0;
529#ifdef CONFIG_OF
530 mvchip->chip.of_node = np;
531#endif
532
533 spin_lock_init(&mvchip->lock);
534 mvchip->membase = devm_request_and_ioremap(&pdev->dev, res);
535 if (! mvchip->membase) {
536 dev_err(&pdev->dev, "Cannot ioremap\n");
537 kfree(mvchip->chip.label);
538 return -ENOMEM;
539 }
540
541 /* The Armada XP has a second range of registers for the
542 * per-CPU registers */
543 if (soc_variant == MVEBU_GPIO_SOC_VARIANT_ARMADAXP) {
544 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
545 if (! res) {
546 dev_err(&pdev->dev, "Cannot get memory resource\n");
547 kfree(mvchip->chip.label);
548 return -ENODEV;
549 }
550
551 mvchip->percpu_membase = devm_request_and_ioremap(&pdev->dev, res);
552 if (! mvchip->percpu_membase) {
553 dev_err(&pdev->dev, "Cannot ioremap\n");
554 kfree(mvchip->chip.label);
555 return -ENOMEM;
556 }
557 }
558
559 /*
560 * Mask and clear GPIO interrupts.
561 */
562 switch(soc_variant) {
563 case MVEBU_GPIO_SOC_VARIANT_ORION:
564 writel_relaxed(0, mvchip->membase + GPIO_EDGE_CAUSE_OFF);
565 writel_relaxed(0, mvchip->membase + GPIO_EDGE_MASK_OFF);
566 writel_relaxed(0, mvchip->membase + GPIO_LEVEL_MASK_OFF);
567 break;
568 case MVEBU_GPIO_SOC_VARIANT_MV78200:
569 writel_relaxed(0, mvchip->membase + GPIO_EDGE_CAUSE_OFF);
570 for (cpu = 0; cpu < 2; cpu++) {
571 writel_relaxed(0, mvchip->membase +
572 GPIO_EDGE_MASK_MV78200_OFF(cpu));
573 writel_relaxed(0, mvchip->membase +
574 GPIO_LEVEL_MASK_MV78200_OFF(cpu));
575 }
576 break;
577 case MVEBU_GPIO_SOC_VARIANT_ARMADAXP:
578 writel_relaxed(0, mvchip->membase + GPIO_EDGE_CAUSE_OFF);
579 writel_relaxed(0, mvchip->membase + GPIO_EDGE_MASK_OFF);
580 writel_relaxed(0, mvchip->membase + GPIO_LEVEL_MASK_OFF);
581 for (cpu = 0; cpu < 4; cpu++) {
582 writel_relaxed(0, mvchip->percpu_membase +
583 GPIO_EDGE_CAUSE_ARMADAXP_OFF(cpu));
584 writel_relaxed(0, mvchip->percpu_membase +
585 GPIO_EDGE_MASK_ARMADAXP_OFF(cpu));
586 writel_relaxed(0, mvchip->percpu_membase +
587 GPIO_LEVEL_MASK_ARMADAXP_OFF(cpu));
588 }
589 break;
590 default:
591 BUG();
592 }
593
594 gpiochip_add(&mvchip->chip);
595
596 /* Some gpio controllers do not provide irq support */
597 if (!of_irq_count(np))
598 return 0;
599
600 /* Setup the interrupt handlers. Each chip can have up to 4
601 * interrupt handlers, with each handler dealing with 8 GPIO
602 * pins. */
603 for (i = 0; i < 4; i++) {
604 int irq;
605 irq = platform_get_irq(pdev, i);
606 if (irq < 0)
607 continue;
608 irq_set_handler_data(irq, mvchip);
609 irq_set_chained_handler(irq, mvebu_gpio_irq_handler);
610 }
611
612 mvchip->irqbase = irq_alloc_descs(-1, 0, ngpios, -1);
613 if (mvchip->irqbase < 0) {
614 dev_err(&pdev->dev, "no irqs\n");
615 kfree(mvchip->chip.label);
616 return -ENOMEM;
617 }
618
619 gc = irq_alloc_generic_chip("mvebu_gpio_irq", 2, mvchip->irqbase,
620 mvchip->membase, handle_level_irq);
621 if (! gc) {
622 dev_err(&pdev->dev, "Cannot allocate generic irq_chip\n");
623 kfree(mvchip->chip.label);
624 return -ENOMEM;
625 }
626
627 gc->private = mvchip;
628 ct = &gc->chip_types[0];
629 ct->type = IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW;
630 ct->chip.irq_mask = mvebu_gpio_level_irq_mask;
631 ct->chip.irq_unmask = mvebu_gpio_level_irq_unmask;
632 ct->chip.irq_set_type = mvebu_gpio_irq_set_type;
633 ct->chip.name = mvchip->chip.label;
634
635 ct = &gc->chip_types[1];
636 ct->type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
637 ct->chip.irq_ack = mvebu_gpio_irq_ack;
638 ct->chip.irq_mask = mvebu_gpio_edge_irq_mask;
639 ct->chip.irq_unmask = mvebu_gpio_edge_irq_unmask;
640 ct->chip.irq_set_type = mvebu_gpio_irq_set_type;
641 ct->handler = handle_edge_irq;
642 ct->chip.name = mvchip->chip.label;
643
644 irq_setup_generic_chip(gc, IRQ_MSK(ngpios), IRQ_GC_INIT_MASK_CACHE,
645 IRQ_NOREQUEST, IRQ_LEVEL | IRQ_NOPROBE);
646
647 /* Setup irq domain on top of the generic chip. */
648 mvchip->domain = irq_domain_add_legacy(np, mvchip->chip.ngpio,
649 mvchip->irqbase, 0,
650 &irq_domain_simple_ops,
651 mvchip);
652 if (!mvchip->domain) {
653 dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n",
654 mvchip->chip.label);
655 irq_remove_generic_chip(gc, IRQ_MSK(ngpios), IRQ_NOREQUEST,
656 IRQ_LEVEL | IRQ_NOPROBE);
657 kfree(gc);
658 kfree(mvchip->chip.label);
659 return -ENODEV;
660 }
661
662 return 0;
663}
664
665static struct platform_driver mvebu_gpio_driver = {
666 .driver = {
667 .name = "mvebu-gpio",
668 .owner = THIS_MODULE,
669 .of_match_table = mvebu_gpio_of_match,
670 },
671 .probe = mvebu_gpio_probe,
672 .id_table = mvebu_gpio_ids,
673};
674
675static int __init mvebu_gpio_init(void)
676{
677 return platform_driver_register(&mvebu_gpio_driver);
678}
679postcore_initcall(mvebu_gpio_init);
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 9cac88a65f78..9528779ca463 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -26,6 +26,8 @@
26#include <linux/syscore_ops.h> 26#include <linux/syscore_ops.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28 28
29#include <asm/mach/irq.h>
30
29#include <mach/irqs.h> 31#include <mach/irqs.h>
30 32
31/* 33/*
@@ -59,6 +61,7 @@
59#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) 61#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
60 62
61int pxa_last_gpio; 63int pxa_last_gpio;
64static int irq_base;
62 65
63#ifdef CONFIG_OF 66#ifdef CONFIG_OF
64static struct irq_domain *domain; 67static struct irq_domain *domain;
@@ -167,63 +170,14 @@ static inline int __gpio_is_occupied(unsigned gpio)
167 return ret; 170 return ret;
168} 171}
169 172
170#ifdef CONFIG_ARCH_PXA
171static inline int __pxa_gpio_to_irq(int gpio)
172{
173 if (gpio_is_pxa_type(gpio_type))
174 return PXA_GPIO_TO_IRQ(gpio);
175 return -1;
176}
177
178static inline int __pxa_irq_to_gpio(int irq)
179{
180 if (gpio_is_pxa_type(gpio_type))
181 return irq - PXA_GPIO_TO_IRQ(0);
182 return -1;
183}
184#else
185static inline int __pxa_gpio_to_irq(int gpio) { return -1; }
186static inline int __pxa_irq_to_gpio(int irq) { return -1; }
187#endif
188
189#ifdef CONFIG_ARCH_MMP
190static inline int __mmp_gpio_to_irq(int gpio)
191{
192 if (gpio_is_mmp_type(gpio_type))
193 return MMP_GPIO_TO_IRQ(gpio);
194 return -1;
195}
196
197static inline int __mmp_irq_to_gpio(int irq)
198{
199 if (gpio_is_mmp_type(gpio_type))
200 return irq - MMP_GPIO_TO_IRQ(0);
201 return -1;
202}
203#else
204static inline int __mmp_gpio_to_irq(int gpio) { return -1; }
205static inline int __mmp_irq_to_gpio(int irq) { return -1; }
206#endif
207
208static int pxa_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 173static int pxa_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
209{ 174{
210 int gpio, ret; 175 return chip->base + offset + irq_base;
211
212 gpio = chip->base + offset;
213 ret = __pxa_gpio_to_irq(gpio);
214 if (ret >= 0)
215 return ret;
216 return __mmp_gpio_to_irq(gpio);
217} 176}
218 177
219int pxa_irq_to_gpio(int irq) 178int pxa_irq_to_gpio(int irq)
220{ 179{
221 int ret; 180 return irq - irq_base;
222
223 ret = __pxa_irq_to_gpio(irq);
224 if (ret >= 0)
225 return ret;
226 return __mmp_irq_to_gpio(irq);
227} 181}
228 182
229static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 183static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
@@ -403,6 +357,9 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
403 struct pxa_gpio_chip *c; 357 struct pxa_gpio_chip *c;
404 int loop, gpio, gpio_base, n; 358 int loop, gpio, gpio_base, n;
405 unsigned long gedr; 359 unsigned long gedr;
360 struct irq_chip *chip = irq_desc_get_chip(desc);
361
362 chained_irq_enter(chip, desc);
406 363
407 do { 364 do {
408 loop = 0; 365 loop = 0;
@@ -422,6 +379,8 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
422 } 379 }
423 } 380 }
424 } while (loop); 381 } while (loop);
382
383 chained_irq_exit(chip, desc);
425} 384}
426 385
427static void pxa_ack_muxed_gpio(struct irq_data *d) 386static void pxa_ack_muxed_gpio(struct irq_data *d)
@@ -535,7 +494,7 @@ const struct irq_domain_ops pxa_irq_domain_ops = {
535 494
536static int __devinit pxa_gpio_probe_dt(struct platform_device *pdev) 495static int __devinit pxa_gpio_probe_dt(struct platform_device *pdev)
537{ 496{
538 int ret, nr_banks, nr_gpios, irq_base; 497 int ret, nr_banks, nr_gpios;
539 struct device_node *prev, *next, *np = pdev->dev.of_node; 498 struct device_node *prev, *next, *np = pdev->dev.of_node;
540 const struct of_device_id *of_id = 499 const struct of_device_id *of_id =
541 of_match_device(pxa_gpio_dt_ids, &pdev->dev); 500 of_match_device(pxa_gpio_dt_ids, &pdev->dev);
@@ -590,10 +549,20 @@ static int __devinit pxa_gpio_probe(struct platform_device *pdev)
590 int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; 549 int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0;
591 550
592 ret = pxa_gpio_probe_dt(pdev); 551 ret = pxa_gpio_probe_dt(pdev);
593 if (ret < 0) 552 if (ret < 0) {
594 pxa_last_gpio = pxa_gpio_nums(); 553 pxa_last_gpio = pxa_gpio_nums();
595 else 554#ifdef CONFIG_ARCH_PXA
555 if (gpio_is_pxa_type(gpio_type))
556 irq_base = PXA_GPIO_TO_IRQ(0);
557#endif
558#ifdef CONFIG_ARCH_MMP
559 if (gpio_is_mmp_type(gpio_type))
560 irq_base = MMP_GPIO_TO_IRQ(0);
561#endif
562 } else {
596 use_of = 1; 563 use_of = 1;
564 }
565
597 if (!pxa_last_gpio) 566 if (!pxa_last_gpio)
598 return -EINVAL; 567 return -EINVAL;
599 568
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index ba126cc04073..8af4b06e80f7 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -938,6 +938,67 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
938 s3c_gpiolib_track(chip); 938 s3c_gpiolib_track(chip);
939} 939}
940 940
941#if defined(CONFIG_PLAT_S3C24XX) && defined(CONFIG_OF)
942static int s3c24xx_gpio_xlate(struct gpio_chip *gc,
943 const struct of_phandle_args *gpiospec, u32 *flags)
944{
945 unsigned int pin;
946
947 if (WARN_ON(gc->of_gpio_n_cells < 3))
948 return -EINVAL;
949
950 if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
951 return -EINVAL;
952
953 if (gpiospec->args[0] > gc->ngpio)
954 return -EINVAL;
955
956 pin = gc->base + gpiospec->args[0];
957
958 if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(gpiospec->args[1])))
959 pr_warn("gpio_xlate: failed to set pin function\n");
960 if (s3c_gpio_setpull(pin, gpiospec->args[2] & 0xffff))
961 pr_warn("gpio_xlate: failed to set pin pull up/down\n");
962
963 if (flags)
964 *flags = gpiospec->args[2] >> 16;
965
966 return gpiospec->args[0];
967}
968
969static const struct of_device_id s3c24xx_gpio_dt_match[] __initdata = {
970 { .compatible = "samsung,s3c24xx-gpio", },
971 {}
972};
973
974static __init void s3c24xx_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip,
975 u64 base, u64 offset)
976{
977 struct gpio_chip *gc = &chip->chip;
978 u64 address;
979
980 if (!of_have_populated_dt())
981 return;
982
983 address = chip->base ? base + ((u32)chip->base & 0xfff) : base + offset;
984 gc->of_node = of_find_matching_node_by_address(NULL,
985 s3c24xx_gpio_dt_match, address);
986 if (!gc->of_node) {
987 pr_info("gpio: device tree node not found for gpio controller"
988 " with base address %08llx\n", address);
989 return;
990 }
991 gc->of_gpio_n_cells = 3;
992 gc->of_xlate = s3c24xx_gpio_xlate;
993}
994#else
995static __init void s3c24xx_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip,
996 u64 base, u64 offset)
997{
998 return;
999}
1000#endif /* defined(CONFIG_PLAT_S3C24XX) && defined(CONFIG_OF) */
1001
941static void __init s3c24xx_gpiolib_add_chips(struct samsung_gpio_chip *chip, 1002static void __init s3c24xx_gpiolib_add_chips(struct samsung_gpio_chip *chip,
942 int nr_chips, void __iomem *base) 1003 int nr_chips, void __iomem *base)
943{ 1004{
@@ -962,6 +1023,8 @@ static void __init s3c24xx_gpiolib_add_chips(struct samsung_gpio_chip *chip,
962 gc->direction_output = samsung_gpiolib_2bit_output; 1023 gc->direction_output = samsung_gpiolib_2bit_output;
963 1024
964 samsung_gpiolib_add(chip); 1025 samsung_gpiolib_add(chip);
1026
1027 s3c24xx_gpiolib_attach_ofnode(chip, S3C24XX_PA_GPIO, i * 0x10);
965 } 1028 }
966} 1029}
967 1030
@@ -3131,46 +3194,6 @@ samsung_gpio_pull_t s3c_gpio_getpull(unsigned int pin)
3131} 3194}
3132EXPORT_SYMBOL(s3c_gpio_getpull); 3195EXPORT_SYMBOL(s3c_gpio_getpull);
3133 3196
3134/* gpiolib wrappers until these are totally eliminated */
3135
3136void s3c2410_gpio_pullup(unsigned int pin, unsigned int to)
3137{
3138 int ret;
3139
3140 WARN_ON(to); /* should be none of these left */
3141
3142 if (!to) {
3143 /* if pull is enabled, try first with up, and if that
3144 * fails, try using down */
3145
3146 ret = s3c_gpio_setpull(pin, S3C_GPIO_PULL_UP);
3147 if (ret)
3148 s3c_gpio_setpull(pin, S3C_GPIO_PULL_DOWN);
3149 } else {
3150 s3c_gpio_setpull(pin, S3C_GPIO_PULL_NONE);
3151 }
3152}
3153EXPORT_SYMBOL(s3c2410_gpio_pullup);
3154
3155void s3c2410_gpio_setpin(unsigned int pin, unsigned int to)
3156{
3157 /* do this via gpiolib until all users removed */
3158
3159 gpio_request(pin, "temporary");
3160 gpio_set_value(pin, to);
3161 gpio_free(pin);
3162}
3163EXPORT_SYMBOL(s3c2410_gpio_setpin);
3164
3165unsigned int s3c2410_gpio_getpin(unsigned int pin)
3166{
3167 struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin);
3168 unsigned long offs = pin - chip->chip.base;
3169
3170 return __raw_readl(chip->base + 0x04) & (1 << offs);
3171}
3172EXPORT_SYMBOL(s3c2410_gpio_getpin);
3173
3174#ifdef CONFIG_S5P_GPIO_DRVSTR 3197#ifdef CONFIG_S5P_GPIO_DRVSTR
3175s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin) 3198s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin)
3176{ 3199{
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index dc5184d57892..d982593d7563 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -30,9 +30,6 @@
30 30
31#include <asm/mach/irq.h> 31#include <asm/mach/irq.h>
32 32
33#include <mach/iomap.h>
34#include <mach/suspend.h>
35
36#define GPIO_BANK(x) ((x) >> 5) 33#define GPIO_BANK(x) ((x) >> 5)
37#define GPIO_PORT(x) (((x) >> 3) & 0x3) 34#define GPIO_PORT(x) (((x) >> 3) & 0x3)
38#define GPIO_BIT(x) ((x) & 0x7) 35#define GPIO_BIT(x) ((x) & 0x7)
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index f030880bc9bb..c5f8ca233e1f 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -396,6 +396,29 @@ static int __devinit gpio_twl4030_debounce(u32 debounce, u8 mmc_cd)
396 396
397static int gpio_twl4030_remove(struct platform_device *pdev); 397static int gpio_twl4030_remove(struct platform_device *pdev);
398 398
399static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev)
400{
401 struct twl4030_gpio_platform_data *omap_twl_info;
402
403 omap_twl_info = devm_kzalloc(dev, sizeof(*omap_twl_info), GFP_KERNEL);
404 if (!omap_twl_info)
405 return NULL;
406
407 omap_twl_info->use_leds = of_property_read_bool(dev->of_node,
408 "ti,use-leds");
409
410 of_property_read_u32(dev->of_node, "ti,debounce",
411 &omap_twl_info->debounce);
412 of_property_read_u32(dev->of_node, "ti,mmc-cd",
413 (u32 *)&omap_twl_info->mmc_cd);
414 of_property_read_u32(dev->of_node, "ti,pullups",
415 &omap_twl_info->pullups);
416 of_property_read_u32(dev->of_node, "ti,pulldowns",
417 &omap_twl_info->pulldowns);
418
419 return omap_twl_info;
420}
421
399static int __devinit gpio_twl4030_probe(struct platform_device *pdev) 422static int __devinit gpio_twl4030_probe(struct platform_device *pdev)
400{ 423{
401 struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data; 424 struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data;
@@ -428,33 +451,37 @@ no_irqs:
428 twl_gpiochip.ngpio = TWL4030_GPIO_MAX; 451 twl_gpiochip.ngpio = TWL4030_GPIO_MAX;
429 twl_gpiochip.dev = &pdev->dev; 452 twl_gpiochip.dev = &pdev->dev;
430 453
431 if (pdata) { 454 if (node)
432 /* 455 pdata = of_gpio_twl4030(&pdev->dev);
433 * NOTE: boards may waste power if they don't set pullups 456
434 * and pulldowns correctly ... default for non-ULPI pins is 457 if (pdata == NULL) {
435 * pulldown, and some other pins may have external pullups 458 dev_err(&pdev->dev, "Platform data is missing\n");
436 * or pulldowns. Careful! 459 return -ENXIO;
437 */
438 ret = gpio_twl4030_pulls(pdata->pullups, pdata->pulldowns);
439 if (ret)
440 dev_dbg(&pdev->dev, "pullups %.05x %.05x --> %d\n",
441 pdata->pullups, pdata->pulldowns,
442 ret);
443
444 ret = gpio_twl4030_debounce(pdata->debounce, pdata->mmc_cd);
445 if (ret)
446 dev_dbg(&pdev->dev, "debounce %.03x %.01x --> %d\n",
447 pdata->debounce, pdata->mmc_cd,
448 ret);
449
450 /*
451 * NOTE: we assume VIBRA_CTL.VIBRA_EN, in MODULE_AUDIO_VOICE,
452 * is (still) clear if use_leds is set.
453 */
454 if (pdata->use_leds)
455 twl_gpiochip.ngpio += 2;
456 } 460 }
457 461
462 /*
463 * NOTE: boards may waste power if they don't set pullups
464 * and pulldowns correctly ... default for non-ULPI pins is
465 * pulldown, and some other pins may have external pullups
466 * or pulldowns. Careful!
467 */
468 ret = gpio_twl4030_pulls(pdata->pullups, pdata->pulldowns);
469 if (ret)
470 dev_dbg(&pdev->dev, "pullups %.05x %.05x --> %d\n",
471 pdata->pullups, pdata->pulldowns, ret);
472
473 ret = gpio_twl4030_debounce(pdata->debounce, pdata->mmc_cd);
474 if (ret)
475 dev_dbg(&pdev->dev, "debounce %.03x %.01x --> %d\n",
476 pdata->debounce, pdata->mmc_cd, ret);
477
478 /*
479 * NOTE: we assume VIBRA_CTL.VIBRA_EN, in MODULE_AUDIO_VOICE,
480 * is (still) clear if use_leds is set.
481 */
482 if (pdata->use_leds)
483 twl_gpiochip.ngpio += 2;
484
458 ret = gpiochip_add(&twl_gpiochip); 485 ret = gpiochip_add(&twl_gpiochip);
459 if (ret < 0) { 486 if (ret < 0) {
460 dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret); 487 dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret);
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 2f4b01bda87c..36509ae32083 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -31,6 +31,8 @@
31#include <linux/hwmon.h> 31#include <linux/hwmon.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/gpio-fan.h> 33#include <linux/gpio-fan.h>
34#include <linux/of_platform.h>
35#include <linux/of_gpio.h>
34 36
35struct gpio_fan_data { 37struct gpio_fan_data {
36 struct platform_device *pdev; 38 struct platform_device *pdev;
@@ -400,14 +402,131 @@ static ssize_t show_name(struct device *dev,
400 402
401static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); 403static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
402 404
405
406#ifdef CONFIG_OF_GPIO
407/*
408 * Translate OpenFirmware node properties into platform_data
409 */
410static int gpio_fan_get_of_pdata(struct device *dev,
411 struct gpio_fan_platform_data *pdata)
412{
413 struct device_node *node;
414 struct gpio_fan_speed *speed;
415 unsigned *ctrl;
416 unsigned i;
417 u32 u;
418 struct property *prop;
419 const __be32 *p;
420
421 node = dev->of_node;
422
423 /* Fill GPIO pin array */
424 pdata->num_ctrl = of_gpio_count(node);
425 if (!pdata->num_ctrl) {
426 dev_err(dev, "gpios DT property empty / missing");
427 return -ENODEV;
428 }
429 ctrl = devm_kzalloc(dev, pdata->num_ctrl * sizeof(unsigned),
430 GFP_KERNEL);
431 if (!ctrl)
432 return -ENOMEM;
433 for (i = 0; i < pdata->num_ctrl; i++) {
434 int val;
435
436 val = of_get_gpio(node, i);
437 if (val < 0)
438 return val;
439 ctrl[i] = val;
440 }
441 pdata->ctrl = ctrl;
442
443 /* Get number of RPM/ctrl_val pairs in speed map */
444 prop = of_find_property(node, "gpio-fan,speed-map", &i);
445 if (!prop) {
446 dev_err(dev, "gpio-fan,speed-map DT property missing");
447 return -ENODEV;
448 }
449 i = i / sizeof(u32);
450 if (i == 0 || i & 1) {
451 dev_err(dev, "gpio-fan,speed-map contains zero/odd number of entries");
452 return -ENODEV;
453 }
454 pdata->num_speed = i / 2;
455
456 /*
457 * Populate speed map
458 * Speed map is in the form <RPM ctrl_val RPM ctrl_val ...>
459 * this needs splitting into pairs to create gpio_fan_speed structs
460 */
461 speed = devm_kzalloc(dev,
462 pdata->num_speed * sizeof(struct gpio_fan_speed),
463 GFP_KERNEL);
464 if (!speed)
465 return -ENOMEM;
466 p = NULL;
467 for (i = 0; i < pdata->num_speed; i++) {
468 p = of_prop_next_u32(prop, p, &u);
469 if (!p)
470 return -ENODEV;
471 speed[i].rpm = u;
472 p = of_prop_next_u32(prop, p, &u);
473 if (!p)
474 return -ENODEV;
475 speed[i].ctrl_val = u;
476 }
477 pdata->speed = speed;
478
479 /* Alarm GPIO if one exists */
480 if (of_gpio_named_count(node, "alarm-gpios")) {
481 struct gpio_fan_alarm *alarm;
482 int val;
483 enum of_gpio_flags flags;
484
485 alarm = devm_kzalloc(dev, sizeof(struct gpio_fan_alarm),
486 GFP_KERNEL);
487 if (!alarm)
488 return -ENOMEM;
489
490 val = of_get_named_gpio_flags(node, "alarm-gpios", 0, &flags);
491 if (val < 0)
492 return val;
493 alarm->gpio = val;
494 alarm->active_low = flags & OF_GPIO_ACTIVE_LOW;
495
496 pdata->alarm = alarm;
497 }
498
499 return 0;
500}
501
502static struct of_device_id of_gpio_fan_match[] __devinitdata = {
503 { .compatible = "gpio-fan", },
504 {},
505};
506#endif /* CONFIG_OF_GPIO */
507
403static int __devinit gpio_fan_probe(struct platform_device *pdev) 508static int __devinit gpio_fan_probe(struct platform_device *pdev)
404{ 509{
405 int err; 510 int err;
406 struct gpio_fan_data *fan_data; 511 struct gpio_fan_data *fan_data;
407 struct gpio_fan_platform_data *pdata = pdev->dev.platform_data; 512 struct gpio_fan_platform_data *pdata = pdev->dev.platform_data;
408 513
514#ifdef CONFIG_OF_GPIO
515 if (!pdata) {
516 pdata = devm_kzalloc(&pdev->dev,
517 sizeof(struct gpio_fan_platform_data),
518 GFP_KERNEL);
519 if (!pdata)
520 return -ENOMEM;
521
522 err = gpio_fan_get_of_pdata(&pdev->dev, pdata);
523 if (err)
524 return err;
525 }
526#else /* CONFIG_OF_GPIO */
409 if (!pdata) 527 if (!pdata)
410 return -EINVAL; 528 return -EINVAL;
529#endif /* CONFIG_OF_GPIO */
411 530
412 fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data), 531 fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
413 GFP_KERNEL); 532 GFP_KERNEL);
@@ -511,6 +630,7 @@ static struct platform_driver gpio_fan_driver = {
511 .driver = { 630 .driver = {
512 .name = "gpio-fan", 631 .name = "gpio-fan",
513 .pm = GPIO_FAN_PM, 632 .pm = GPIO_FAN_PM,
633 .of_match_table = of_match_ptr(of_gpio_fan_match),
514 }, 634 },
515}; 635};
516 636
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
index b7975f858cff..fe11b95670bd 100644
--- a/drivers/hwmon/s3c-hwmon.c
+++ b/drivers/hwmon/s3c-hwmon.c
@@ -34,7 +34,7 @@
34#include <linux/hwmon-sysfs.h> 34#include <linux/hwmon-sysfs.h>
35 35
36#include <plat/adc.h> 36#include <plat/adc.h>
37#include <plat/hwmon.h> 37#include <linux/platform_data/hwmon-s3c.h>
38 38
39struct s3c_hwmon_attr { 39struct s3c_hwmon_attr {
40 struct sensor_device_attribute in; 40 struct sensor_device_attribute in;
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 970a1612e795..42d9fdd63de0 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -551,7 +551,7 @@ config I2C_PMCMSP
551 551
552config I2C_PNX 552config I2C_PNX
553 tristate "I2C bus support for Philips PNX and NXP LPC targets" 553 tristate "I2C bus support for Philips PNX and NXP LPC targets"
554 depends on ARCH_PNX4008 || ARCH_LPC32XX 554 depends on ARCH_LPC32XX
555 help 555 help
556 This driver supports the Philips IP3204 I2C IP block master and/or 556 This driver supports the Philips IP3204 I2C IP block master and/or
557 slave controller 557 slave controller
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 79b4bcb3b85c..79a2542d8c41 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -40,7 +40,7 @@
40#include <linux/gpio.h> 40#include <linux/gpio.h>
41 41
42#include <mach/hardware.h> 42#include <mach/hardware.h>
43#include <mach/i2c.h> 43#include <linux/platform_data/i2c-davinci.h>
44 44
45/* ----- global defines ----------------------------------------------- */ 45/* ----- global defines ----------------------------------------------- */
46 46
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 0722f869465c..b7907ba7448a 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -54,7 +54,7 @@
54#include <linux/pinctrl/consumer.h> 54#include <linux/pinctrl/consumer.h>
55 55
56#include <mach/hardware.h> 56#include <mach/hardware.h>
57#include <mach/i2c.h> 57#include <linux/platform_data/i2c-imx.h>
58 58
59/** Defines ******************************************************************** 59/** Defines ********************************************************************
60*******************************************************************************/ 60*******************************************************************************/
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index 93f147a96b62..2f99613fd677 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -4,13 +4,13 @@
4/* Copyright (C) 2003 Peter Milne, D-TACQ Solutions Ltd 4/* Copyright (C) 2003 Peter Milne, D-TACQ Solutions Ltd
5 * <Peter dot Milne at D hyphen TACQ dot com> 5 * <Peter dot Milne at D hyphen TACQ dot com>
6 * 6 *
7 * With acknowledgements to i2c-algo-ibm_ocp.c by 7 * With acknowledgements to i2c-algo-ibm_ocp.c by
8 * Ian DaSilva, MontaVista Software, Inc. idasilva@mvista.com 8 * Ian DaSilva, MontaVista Software, Inc. idasilva@mvista.com
9 * 9 *
10 * And i2c-algo-pcf.c, which was created by Simon G. Vogl and Hans Berglund: 10 * And i2c-algo-pcf.c, which was created by Simon G. Vogl and Hans Berglund:
11 * 11 *
12 * Copyright (C) 1995-1997 Simon G. Vogl, 1998-2000 Hans Berglund 12 * Copyright (C) 1995-1997 Simon G. Vogl, 1998-2000 Hans Berglund
13 * 13 *
14 * And which acknowledged Kyösti Mälkki <kmalkki@cc.hut.fi>, 14 * And which acknowledged Kyösti Mälkki <kmalkki@cc.hut.fi>,
15 * Frodo Looijaard <frodol@dds.nl>, Martin Bailey<mbailey@littlefeet-inc.com> 15 * Frodo Looijaard <frodol@dds.nl>, Martin Bailey<mbailey@littlefeet-inc.com>
16 * 16 *
@@ -39,14 +39,15 @@
39#include <linux/platform_device.h> 39#include <linux/platform_device.h>
40#include <linux/i2c.h> 40#include <linux/i2c.h>
41#include <linux/io.h> 41#include <linux/io.h>
42#include <linux/gpio.h>
42 43
43#include "i2c-iop3xx.h" 44#include "i2c-iop3xx.h"
44 45
45/* global unit counter */ 46/* global unit counter */
46static int i2c_id; 47static int i2c_id;
47 48
48static inline unsigned char 49static inline unsigned char
49iic_cook_addr(struct i2c_msg *msg) 50iic_cook_addr(struct i2c_msg *msg)
50{ 51{
51 unsigned char addr; 52 unsigned char addr;
52 53
@@ -55,38 +56,38 @@ iic_cook_addr(struct i2c_msg *msg)
55 if (msg->flags & I2C_M_RD) 56 if (msg->flags & I2C_M_RD)
56 addr |= 1; 57 addr |= 1;
57 58
58 return addr; 59 return addr;
59} 60}
60 61
61static void 62static void
62iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap) 63iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap)
63{ 64{
64 /* Follows devman 9.3 */ 65 /* Follows devman 9.3 */
65 __raw_writel(IOP3XX_ICR_UNIT_RESET, iop3xx_adap->ioaddr + CR_OFFSET); 66 __raw_writel(IOP3XX_ICR_UNIT_RESET, iop3xx_adap->ioaddr + CR_OFFSET);
66 __raw_writel(IOP3XX_ISR_CLEARBITS, iop3xx_adap->ioaddr + SR_OFFSET); 67 __raw_writel(IOP3XX_ISR_CLEARBITS, iop3xx_adap->ioaddr + SR_OFFSET);
67 __raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET); 68 __raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET);
68} 69}
69 70
70static void 71static void
71iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) 72iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap)
72{ 73{
73 u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE; 74 u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE;
74 75
75 /* 76 /*
76 * Every time unit enable is asserted, GPOD needs to be cleared 77 * Every time unit enable is asserted, GPOD needs to be cleared
77 * on IOP3XX to avoid data corruption on the bus. 78 * on IOP3XX to avoid data corruption on the bus.
78 */ 79 */
79#if defined(CONFIG_ARCH_IOP32X) || defined(CONFIG_ARCH_IOP33X) 80#if defined(CONFIG_ARCH_IOP32X) || defined(CONFIG_ARCH_IOP33X)
80 if (iop3xx_adap->id == 0) { 81 if (iop3xx_adap->id == 0) {
81 gpio_line_set(IOP3XX_GPIO_LINE(7), GPIO_LOW); 82 gpio_set_value(7, 0);
82 gpio_line_set(IOP3XX_GPIO_LINE(6), GPIO_LOW); 83 gpio_set_value(6, 0);
83 } else { 84 } else {
84 gpio_line_set(IOP3XX_GPIO_LINE(5), GPIO_LOW); 85 gpio_set_value(5, 0);
85 gpio_line_set(IOP3XX_GPIO_LINE(4), GPIO_LOW); 86 gpio_set_value(4, 0);
86 } 87 }
87#endif 88#endif
88 /* NB SR bits not same position as CR IE bits :-( */ 89 /* NB SR bits not same position as CR IE bits :-( */
89 iop3xx_adap->SR_enabled = 90 iop3xx_adap->SR_enabled =
90 IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD | 91 IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD |
91 IOP3XX_ISR_RXFULL | IOP3XX_ISR_TXEMPTY; 92 IOP3XX_ISR_RXFULL | IOP3XX_ISR_TXEMPTY;
92 93
@@ -96,23 +97,23 @@ iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap)
96 __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); 97 __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET);
97} 98}
98 99
99static void 100static void
100iop3xx_i2c_transaction_cleanup(struct i2c_algo_iop3xx_data *iop3xx_adap) 101iop3xx_i2c_transaction_cleanup(struct i2c_algo_iop3xx_data *iop3xx_adap)
101{ 102{
102 unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); 103 unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET);
103 104
104 cr &= ~(IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE | 105 cr &= ~(IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE |
105 IOP3XX_ICR_MSTOP | IOP3XX_ICR_SCLEN); 106 IOP3XX_ICR_MSTOP | IOP3XX_ICR_SCLEN);
106 107
107 __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET); 108 __raw_writel(cr, iop3xx_adap->ioaddr + CR_OFFSET);
108} 109}
109 110
110/* 111/*
111 * NB: the handler has to clear the source of the interrupt! 112 * NB: the handler has to clear the source of the interrupt!
112 * Then it passes the SR flags of interest to BH via adap data 113 * Then it passes the SR flags of interest to BH via adap data
113 */ 114 */
114static irqreturn_t 115static irqreturn_t
115iop3xx_i2c_irq_handler(int this_irq, void *dev_id) 116iop3xx_i2c_irq_handler(int this_irq, void *dev_id)
116{ 117{
117 struct i2c_algo_iop3xx_data *iop3xx_adap = dev_id; 118 struct i2c_algo_iop3xx_data *iop3xx_adap = dev_id;
118 u32 sr = __raw_readl(iop3xx_adap->ioaddr + SR_OFFSET); 119 u32 sr = __raw_readl(iop3xx_adap->ioaddr + SR_OFFSET);
@@ -126,7 +127,7 @@ iop3xx_i2c_irq_handler(int this_irq, void *dev_id)
126} 127}
127 128
128/* check all error conditions, clear them , report most important */ 129/* check all error conditions, clear them , report most important */
129static int 130static int
130iop3xx_i2c_error(u32 sr) 131iop3xx_i2c_error(u32 sr)
131{ 132{
132 int rc = 0; 133 int rc = 0;
@@ -135,12 +136,12 @@ iop3xx_i2c_error(u32 sr)
135 if ( !rc ) rc = -I2C_ERR_BERR; 136 if ( !rc ) rc = -I2C_ERR_BERR;
136 } 137 }
137 if ((sr & IOP3XX_ISR_ALD)) { 138 if ((sr & IOP3XX_ISR_ALD)) {
138 if ( !rc ) rc = -I2C_ERR_ALD; 139 if ( !rc ) rc = -I2C_ERR_ALD;
139 } 140 }
140 return rc; 141 return rc;
141} 142}
142 143
143static inline u32 144static inline u32
144iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap) 145iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap)
145{ 146{
146 unsigned long flags; 147 unsigned long flags;
@@ -161,8 +162,8 @@ iop3xx_i2c_get_srstat(struct i2c_algo_iop3xx_data *iop3xx_adap)
161typedef int (* compare_func)(unsigned test, unsigned mask); 162typedef int (* compare_func)(unsigned test, unsigned mask);
162/* returns 1 on correct comparison */ 163/* returns 1 on correct comparison */
163 164
164static int 165static int
165iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap, 166iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap,
166 unsigned flags, unsigned* status, 167 unsigned flags, unsigned* status,
167 compare_func compare) 168 compare_func compare)
168{ 169{
@@ -192,47 +193,47 @@ iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap,
192} 193}
193 194
194/* 195/*
195 * Concrete compare_funcs 196 * Concrete compare_funcs
196 */ 197 */
197static int 198static int
198all_bits_clear(unsigned test, unsigned mask) 199all_bits_clear(unsigned test, unsigned mask)
199{ 200{
200 return (test & mask) == 0; 201 return (test & mask) == 0;
201} 202}
202 203
203static int 204static int
204any_bits_set(unsigned test, unsigned mask) 205any_bits_set(unsigned test, unsigned mask)
205{ 206{
206 return (test & mask) != 0; 207 return (test & mask) != 0;
207} 208}
208 209
209static int 210static int
210iop3xx_i2c_wait_tx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) 211iop3xx_i2c_wait_tx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status)
211{ 212{
212 return iop3xx_i2c_wait_event( 213 return iop3xx_i2c_wait_event(
213 iop3xx_adap, 214 iop3xx_adap,
214 IOP3XX_ISR_TXEMPTY | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, 215 IOP3XX_ISR_TXEMPTY | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD,
215 status, any_bits_set); 216 status, any_bits_set);
216} 217}
217 218
218static int 219static int
219iop3xx_i2c_wait_rx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) 220iop3xx_i2c_wait_rx_done(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status)
220{ 221{
221 return iop3xx_i2c_wait_event( 222 return iop3xx_i2c_wait_event(
222 iop3xx_adap, 223 iop3xx_adap,
223 IOP3XX_ISR_RXFULL | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD, 224 IOP3XX_ISR_RXFULL | IOP3XX_ISR_ALD | IOP3XX_ISR_BERRD,
224 status, any_bits_set); 225 status, any_bits_set);
225} 226}
226 227
227static int 228static int
228iop3xx_i2c_wait_idle(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status) 229iop3xx_i2c_wait_idle(struct i2c_algo_iop3xx_data *iop3xx_adap, int *status)
229{ 230{
230 return iop3xx_i2c_wait_event( 231 return iop3xx_i2c_wait_event(
231 iop3xx_adap, IOP3XX_ISR_UNITBUSY, status, all_bits_clear); 232 iop3xx_adap, IOP3XX_ISR_UNITBUSY, status, all_bits_clear);
232} 233}
233 234
234static int 235static int
235iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap, 236iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap,
236 struct i2c_msg* msg) 237 struct i2c_msg* msg)
237{ 238{
238 unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); 239 unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET);
@@ -247,7 +248,7 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap,
247 } 248 }
248 249
249 __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET); 250 __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET);
250 251
251 cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK); 252 cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK);
252 cr |= IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE; 253 cr |= IOP3XX_ICR_MSTART | IOP3XX_ICR_TBYTE;
253 254
@@ -257,8 +258,8 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap,
257 return rc; 258 return rc;
258} 259}
259 260
260static int 261static int
261iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte, 262iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte,
262 int stop) 263 int stop)
263{ 264{
264 unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); 265 unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET);
@@ -277,10 +278,10 @@ iop3xx_i2c_write_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char byte,
277 rc = iop3xx_i2c_wait_tx_done(iop3xx_adap, &status); 278 rc = iop3xx_i2c_wait_tx_done(iop3xx_adap, &status);
278 279
279 return rc; 280 return rc;
280} 281}
281 282
282static int 283static int
283iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte, 284iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte,
284 int stop) 285 int stop)
285{ 286{
286 unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET); 287 unsigned long cr = __raw_readl(iop3xx_adap->ioaddr + CR_OFFSET);
@@ -304,19 +305,19 @@ iop3xx_i2c_read_byte(struct i2c_algo_iop3xx_data *iop3xx_adap, char* byte,
304 return rc; 305 return rc;
305} 306}
306 307
307static int 308static int
308iop3xx_i2c_writebytes(struct i2c_adapter *i2c_adap, const char *buf, int count) 309iop3xx_i2c_writebytes(struct i2c_adapter *i2c_adap, const char *buf, int count)
309{ 310{
310 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; 311 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
311 int ii; 312 int ii;
312 int rc = 0; 313 int rc = 0;
313 314
314 for (ii = 0; rc == 0 && ii != count; ++ii) 315 for (ii = 0; rc == 0 && ii != count; ++ii)
315 rc = iop3xx_i2c_write_byte(iop3xx_adap, buf[ii], ii==count-1); 316 rc = iop3xx_i2c_write_byte(iop3xx_adap, buf[ii], ii==count-1);
316 return rc; 317 return rc;
317} 318}
318 319
319static int 320static int
320iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) 321iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count)
321{ 322{
322 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; 323 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
@@ -325,7 +326,7 @@ iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count)
325 326
326 for (ii = 0; rc == 0 && ii != count; ++ii) 327 for (ii = 0; rc == 0 && ii != count; ++ii)
327 rc = iop3xx_i2c_read_byte(iop3xx_adap, &buf[ii], ii==count-1); 328 rc = iop3xx_i2c_read_byte(iop3xx_adap, &buf[ii], ii==count-1);
328 329
329 return rc; 330 return rc;
330} 331}
331 332
@@ -336,8 +337,8 @@ iop3xx_i2c_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count)
336 * Each transfer (i.e. a read or a write) is separated by a repeated start 337 * Each transfer (i.e. a read or a write) is separated by a repeated start
337 * condition. 338 * condition.
338 */ 339 */
339static int 340static int
340iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg) 341iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg)
341{ 342{
342 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; 343 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
343 int rc; 344 int rc;
@@ -357,8 +358,8 @@ iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg* pmsg)
357/* 358/*
358 * master_xfer() - main read/write entry 359 * master_xfer() - main read/write entry
359 */ 360 */
360static int 361static int
361iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, 362iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
362 int num) 363 int num)
363{ 364{
364 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data; 365 struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
@@ -375,14 +376,14 @@ iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
375 } 376 }
376 377
377 iop3xx_i2c_transaction_cleanup(iop3xx_adap); 378 iop3xx_i2c_transaction_cleanup(iop3xx_adap);
378 379
379 if(ret) 380 if(ret)
380 return ret; 381 return ret;
381 382
382 return im; 383 return im;
383} 384}
384 385
385static u32 386static u32
386iop3xx_i2c_func(struct i2c_adapter *adap) 387iop3xx_i2c_func(struct i2c_adapter *adap)
387{ 388{
388 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; 389 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
@@ -393,11 +394,11 @@ static const struct i2c_algorithm iop3xx_i2c_algo = {
393 .functionality = iop3xx_i2c_func, 394 .functionality = iop3xx_i2c_func,
394}; 395};
395 396
396static int 397static int
397iop3xx_i2c_remove(struct platform_device *pdev) 398iop3xx_i2c_remove(struct platform_device *pdev)
398{ 399{
399 struct i2c_adapter *padapter = platform_get_drvdata(pdev); 400 struct i2c_adapter *padapter = platform_get_drvdata(pdev);
400 struct i2c_algo_iop3xx_data *adapter_data = 401 struct i2c_algo_iop3xx_data *adapter_data =
401 (struct i2c_algo_iop3xx_data *)padapter->algo_data; 402 (struct i2c_algo_iop3xx_data *)padapter->algo_data;
402 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 403 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
403 unsigned long cr = __raw_readl(adapter_data->ioaddr + CR_OFFSET); 404 unsigned long cr = __raw_readl(adapter_data->ioaddr + CR_OFFSET);
@@ -419,7 +420,7 @@ iop3xx_i2c_remove(struct platform_device *pdev)
419 return 0; 420 return 0;
420} 421}
421 422
422static int 423static int
423iop3xx_i2c_probe(struct platform_device *pdev) 424iop3xx_i2c_probe(struct platform_device *pdev)
424{ 425{
425 struct resource *res; 426 struct resource *res;
diff --git a/drivers/i2c/busses/i2c-nuc900.c b/drivers/i2c/busses/i2c-nuc900.c
index a26dfb8cd586..f41502ef3f55 100644
--- a/drivers/i2c/busses/i2c-nuc900.c
+++ b/drivers/i2c/busses/i2c-nuc900.c
@@ -29,7 +29,7 @@
29#include <linux/io.h> 29#include <linux/io.h>
30 30
31#include <mach/mfp.h> 31#include <mach/mfp.h>
32#include <mach/i2c.h> 32#include <linux/platform_data/i2c-nuc900.h>
33 33
34/* nuc900 i2c registers offset */ 34/* nuc900 i2c registers offset */
35 35
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 5ae3b0236bd3..4d07dea9bca9 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -42,7 +42,7 @@
42#include <asm/irq.h> 42#include <asm/irq.h>
43 43
44#include <plat/regs-iic.h> 44#include <plat/regs-iic.h>
45#include <plat/iic.h> 45#include <linux/platform_data/i2c-s3c2410.h>
46 46
47/* Treat S3C2410 as baseline hardware, anything else is supported via quirks */ 47/* Treat S3C2410 as baseline hardware, anything else is supported via quirks */
48#define QUIRK_S3C2440 (1 << 0) 48#define QUIRK_S3C2440 (1 << 0)
diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c
index 9d82b3aeff5e..d5bacbb479b0 100644
--- a/drivers/input/keyboard/davinci_keyscan.c
+++ b/drivers/input/keyboard/davinci_keyscan.c
@@ -36,7 +36,7 @@
36 36
37#include <mach/hardware.h> 37#include <mach/hardware.h>
38#include <mach/irqs.h> 38#include <mach/irqs.h>
39#include <mach/keyscan.h> 39#include <linux/platform_data/keyscan-davinci.h>
40 40
41/* Key scan registers */ 41/* Key scan registers */
42#define DAVINCI_KEYSCAN_KEYCTRL 0x0000 42#define DAVINCI_KEYSCAN_KEYCTRL 0x0000
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index c46fc8185469..7363402de8d4 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -29,7 +29,7 @@
29#include <linux/slab.h> 29#include <linux/slab.h>
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/ep93xx_keypad.h> 32#include <linux/platform_data/keypad-ep93xx.h>
33 33
34/* 34/*
35 * Keypad Interface Register offsets 35 * Keypad Interface Register offsets
diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index a880e7414202..49f5fa64e0b1 100644
--- a/drivers/input/keyboard/nomadik-ske-keypad.c
+++ b/drivers/input/keyboard/nomadik-ske-keypad.c
@@ -20,7 +20,7 @@
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/module.h> 21#include <linux/module.h>
22 22
23#include <plat/ske.h> 23#include <linux/platform_data/keypad-nomadik-ske.h>
24 24
25/* SKE_CR bits */ 25/* SKE_CR bits */
26#define SKE_KPMLT (0x1 << 6) 26#define SKE_KPMLT (0x1 << 6)
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 2bda5f0b9c6e..6d6b1427ae12 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -37,7 +37,7 @@
37#include <linux/slab.h> 37#include <linux/slab.h>
38#include <linux/gpio.h> 38#include <linux/gpio.h>
39#include <linux/platform_data/gpio-omap.h> 39#include <linux/platform_data/gpio-omap.h>
40#include <plat/keypad.h> 40#include <linux/platform_data/keypad-omap.h>
41 41
42#undef NEW_BOARD_LEARNING_MODE 42#undef NEW_BOARD_LEARNING_MODE
43 43
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 7f7b72464a37..803ff6fe021e 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -32,7 +32,7 @@
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33 33
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/* 36/*
37 * Keypad Controller registers 37 * Keypad Controller registers
38 */ 38 */
diff --git a/drivers/input/keyboard/pxa930_rotary.c b/drivers/input/keyboard/pxa930_rotary.c
index d7f1134b789e..41488f9add20 100644
--- a/drivers/input/keyboard/pxa930_rotary.c
+++ b/drivers/input/keyboard/pxa930_rotary.c
@@ -15,7 +15,7 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17 17
18#include <mach/pxa930_rotary.h> 18#include <linux/platform_data/keyboard-pxa930_rotary.h>
19 19
20#define SBCR (0x04) 20#define SBCR (0x04)
21#define ERCR (0x0c) 21#define ERCR (0x0c)
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index 72ef01be3360..c7ca97f44bfb 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -24,7 +24,7 @@
24#include <linux/pm_wakeup.h> 24#include <linux/pm_wakeup.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/types.h> 26#include <linux/types.h>
27#include <plat/keyboard.h> 27#include <linux/platform_data/keyboard-spear.h>
28 28
29/* Keyboard Registers */ 29/* Keyboard Registers */
30#define MODE_CTL_REG 0x00 30#define MODE_CTL_REG 0x00
diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c
index 085ede4d972d..e0f6cd1ad0fd 100644
--- a/drivers/input/keyboard/w90p910_keypad.c
+++ b/drivers/input/keyboard/w90p910_keypad.c
@@ -21,7 +21,7 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/slab.h> 22#include <linux/slab.h>
23 23
24#include <mach/w90p910_keypad.h> 24#include <linux/platform_data/keypad-w90p910.h>
25 25
26/* Keypad Interface Control Registers */ 26/* Keypad Interface Control Registers */
27#define KPI_CONF 0x00 27#define KPI_CONF 0x00
diff --git a/drivers/input/mouse/pxa930_trkball.c b/drivers/input/mouse/pxa930_trkball.c
index a9e4bfdf31f4..4fe055f2c536 100644
--- a/drivers/input/mouse/pxa930_trkball.c
+++ b/drivers/input/mouse/pxa930_trkball.c
@@ -20,7 +20,7 @@
20#include <linux/slab.h> 20#include <linux/slab.h>
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/pxa930_trkball.h> 23#include <linux/platform_data/mouse-pxa930_trkball.h>
24 24
25/* Trackball Controller Register Definitions */ 25/* Trackball Controller Register Definitions */
26#define TBCR (0x000C) 26#define TBCR (0x000C)
diff --git a/drivers/input/mouse/rpcmouse.c b/drivers/input/mouse/rpcmouse.c
index 272deddc8db6..21c60fea5d31 100644
--- a/drivers/input/mouse/rpcmouse.c
+++ b/drivers/input/mouse/rpcmouse.c
@@ -42,7 +42,7 @@ static irqreturn_t rpcmouse_irq(int irq, void *dev_id)
42 42
43 x = (short) iomd_readl(IOMD_MOUSEX); 43 x = (short) iomd_readl(IOMD_MOUSEX);
44 y = (short) iomd_readl(IOMD_MOUSEY); 44 y = (short) iomd_readl(IOMD_MOUSEY);
45 b = (short) (__raw_readl(0xe0310000) ^ 0x70); 45 b = (short) (__raw_readl(IOMEM(0xe0310000)) ^ 0x70);
46 46
47 dx = x - rpcmouse_lastx; 47 dx = x - rpcmouse_lastx;
48 dy = y - rpcmouse_lasty; 48 dy = y - rpcmouse_lasty;
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index f5fbdf94de3b..45887e31242a 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -27,7 +27,7 @@
27#include <linux/module.h> 27#include <linux/module.h>
28 28
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <plat/board-ams-delta.h> 30#include <mach/board-ams-delta.h>
31 31
32#include <mach/ams-delta-fiq.h> 32#include <mach/ams-delta-fiq.h>
33 33
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index bf1a06400067..df9e816d55e4 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -37,7 +37,7 @@
37 37
38#include <plat/adc.h> 38#include <plat/adc.h>
39#include <plat/regs-adc.h> 39#include <plat/regs-adc.h>
40#include <plat/ts.h> 40#include <linux/platform_data/touchscreen-s3c2410.h>
41 41
42#define TSC_SLEEP (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0)) 42#define TSC_SLEEP (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0))
43 43
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/drivers/irqchip/Kconfig
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
new file mode 100644
index 000000000000..054321db4350
--- /dev/null
+++ b/drivers/irqchip/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o
diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c
new file mode 100644
index 000000000000..dc670ccc6978
--- /dev/null
+++ b/drivers/irqchip/irq-bcm2835.c
@@ -0,0 +1,223 @@
1/*
2 * Copyright 2010 Broadcom
3 * Copyright 2012 Simon Arlott, Chris Boot, Stephen Warren
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 * Quirk 1: Shortcut interrupts don't set the bank 1/2 register pending bits
16 *
17 * If an interrupt fires on bank 1 that isn't in the shortcuts list, bit 8
18 * on bank 0 is set to signify that an interrupt in bank 1 has fired, and
19 * to look in the bank 1 status register for more information.
20 *
21 * If an interrupt fires on bank 1 that _is_ in the shortcuts list, its
22 * shortcut bit in bank 0 is set as well as its interrupt bit in the bank 1
23 * status register, but bank 0 bit 8 is _not_ set.
24 *
25 * Quirk 2: You can't mask the register 1/2 pending interrupts
26 *
27 * In a proper cascaded interrupt controller, the interrupt lines with
28 * cascaded interrupt controllers on them are just normal interrupt lines.
29 * You can mask the interrupts and get on with things. With this controller
30 * you can't do that.
31 *
32 * Quirk 3: The shortcut interrupts can't be (un)masked in bank 0
33 *
34 * Those interrupts that have shortcuts can only be masked/unmasked in
35 * their respective banks' enable/disable registers. Doing so in the bank 0
36 * enable/disable registers has no effect.
37 *
38 * The FIQ control register:
39 * Bits 0-6: IRQ (index in order of interrupts from banks 1, 2, then 0)
40 * Bit 7: Enable FIQ generation
41 * Bits 8+: Unused
42 *
43 * An interrupt must be disabled before configuring it for FIQ generation
44 * otherwise both handlers will fire at the same time!
45 */
46
47#include <linux/io.h>
48#include <linux/slab.h>
49#include <linux/of_address.h>
50#include <linux/of_irq.h>
51#include <linux/irqdomain.h>
52#include <linux/irqchip/bcm2835.h>
53
54#include <asm/exception.h>
55
56/* Put the bank and irq (32 bits) into the hwirq */
57#define MAKE_HWIRQ(b, n) ((b << 5) | (n))
58#define HWIRQ_BANK(i) (i >> 5)
59#define HWIRQ_BIT(i) BIT(i & 0x1f)
60
61#define NR_IRQS_BANK0 8
62#define BANK0_HWIRQ_MASK 0xff
63/* Shortcuts can't be disabled so any unknown new ones need to be masked */
64#define SHORTCUT1_MASK 0x00007c00
65#define SHORTCUT2_MASK 0x001f8000
66#define SHORTCUT_SHIFT 10
67#define BANK1_HWIRQ BIT(8)
68#define BANK2_HWIRQ BIT(9)
69#define BANK0_VALID_MASK (BANK0_HWIRQ_MASK | BANK1_HWIRQ | BANK2_HWIRQ \
70 | SHORTCUT1_MASK | SHORTCUT2_MASK)
71
72#define REG_FIQ_CONTROL 0x0c
73
74#define NR_BANKS 3
75#define IRQS_PER_BANK 32
76
77static int reg_pending[] __initconst = { 0x00, 0x04, 0x08 };
78static int reg_enable[] __initconst = { 0x18, 0x10, 0x14 };
79static int reg_disable[] __initconst = { 0x24, 0x1c, 0x20 };
80static int bank_irqs[] __initconst = { 8, 32, 32 };
81
82static const int shortcuts[] = {
83 7, 9, 10, 18, 19, /* Bank 1 */
84 21, 22, 23, 24, 25, 30 /* Bank 2 */
85};
86
87struct armctrl_ic {
88 void __iomem *base;
89 void __iomem *pending[NR_BANKS];
90 void __iomem *enable[NR_BANKS];
91 void __iomem *disable[NR_BANKS];
92 struct irq_domain *domain;
93};
94
95static struct armctrl_ic intc __read_mostly;
96
97static void armctrl_mask_irq(struct irq_data *d)
98{
99 writel_relaxed(HWIRQ_BIT(d->hwirq), intc.disable[HWIRQ_BANK(d->hwirq)]);
100}
101
102static void armctrl_unmask_irq(struct irq_data *d)
103{
104 writel_relaxed(HWIRQ_BIT(d->hwirq), intc.enable[HWIRQ_BANK(d->hwirq)]);
105}
106
107static struct irq_chip armctrl_chip = {
108 .name = "ARMCTRL-level",
109 .irq_mask = armctrl_mask_irq,
110 .irq_unmask = armctrl_unmask_irq
111};
112
113static int armctrl_xlate(struct irq_domain *d, struct device_node *ctrlr,
114 const u32 *intspec, unsigned int intsize,
115 unsigned long *out_hwirq, unsigned int *out_type)
116{
117 if (WARN_ON(intsize != 2))
118 return -EINVAL;
119
120 if (WARN_ON(intspec[0] >= NR_BANKS))
121 return -EINVAL;
122
123 if (WARN_ON(intspec[1] >= IRQS_PER_BANK))
124 return -EINVAL;
125
126 if (WARN_ON(intspec[0] == 0 && intspec[1] >= NR_IRQS_BANK0))
127 return -EINVAL;
128
129 *out_hwirq = MAKE_HWIRQ(intspec[0], intspec[1]);
130 *out_type = IRQ_TYPE_NONE;
131 return 0;
132}
133
134static struct irq_domain_ops armctrl_ops = {
135 .xlate = armctrl_xlate
136};
137
138static int __init armctrl_of_init(struct device_node *node,
139 struct device_node *parent)
140{
141 void __iomem *base;
142 int irq, b, i;
143
144 base = of_iomap(node, 0);
145 if (!base)
146 panic("%s: unable to map IC registers\n",
147 node->full_name);
148
149 intc.domain = irq_domain_add_linear(node, MAKE_HWIRQ(NR_BANKS, 0),
150 &armctrl_ops, NULL);
151 if (!intc.domain)
152 panic("%s: unable to create IRQ domain\n", node->full_name);
153
154 for (b = 0; b < NR_BANKS; b++) {
155 intc.pending[b] = base + reg_pending[b];
156 intc.enable[b] = base + reg_enable[b];
157 intc.disable[b] = base + reg_disable[b];
158
159 for (i = 0; i < bank_irqs[b]; i++) {
160 irq = irq_create_mapping(intc.domain, MAKE_HWIRQ(b, i));
161 BUG_ON(irq <= 0);
162 irq_set_chip_and_handler(irq, &armctrl_chip,
163 handle_level_irq);
164 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
165 }
166 }
167 return 0;
168}
169
170static struct of_device_id irq_of_match[] __initconst = {
171 { .compatible = "brcm,bcm2835-armctrl-ic", .data = armctrl_of_init }
172};
173
174void __init bcm2835_init_irq(void)
175{
176 of_irq_init(irq_of_match);
177}
178
179/*
180 * Handle each interrupt across the entire interrupt controller. This reads the
181 * status register before handling each interrupt, which is necessary given that
182 * handle_IRQ may briefly re-enable interrupts for soft IRQ handling.
183 */
184
185static void armctrl_handle_bank(int bank, struct pt_regs *regs)
186{
187 u32 stat, irq;
188
189 while ((stat = readl_relaxed(intc.pending[bank]))) {
190 irq = MAKE_HWIRQ(bank, ffs(stat) - 1);
191 handle_IRQ(irq_linear_revmap(intc.domain, irq), regs);
192 }
193}
194
195static void armctrl_handle_shortcut(int bank, struct pt_regs *regs,
196 u32 stat)
197{
198 u32 irq = MAKE_HWIRQ(bank, shortcuts[ffs(stat >> SHORTCUT_SHIFT) - 1]);
199 handle_IRQ(irq_linear_revmap(intc.domain, irq), regs);
200}
201
202asmlinkage void __exception_irq_entry bcm2835_handle_irq(
203 struct pt_regs *regs)
204{
205 u32 stat, irq;
206
207 while ((stat = readl_relaxed(intc.pending[0]) & BANK0_VALID_MASK)) {
208 if (stat & BANK0_HWIRQ_MASK) {
209 irq = MAKE_HWIRQ(0, ffs(stat & BANK0_HWIRQ_MASK) - 1);
210 handle_IRQ(irq_linear_revmap(intc.domain, irq), regs);
211 } else if (stat & SHORTCUT1_MASK) {
212 armctrl_handle_shortcut(1, regs, stat & SHORTCUT1_MASK);
213 } else if (stat & SHORTCUT2_MASK) {
214 armctrl_handle_shortcut(2, regs, stat & SHORTCUT2_MASK);
215 } else if (stat & BANK1_HWIRQ) {
216 armctrl_handle_bank(1, regs);
217 } else if (stat & BANK2_HWIRQ) {
218 armctrl_handle_bank(2, regs);
219 } else {
220 BUG();
221 }
222 }
223}
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index e37618e363cf..461bbf9b33fa 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -28,7 +28,7 @@
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/leds.h> 30#include <linux/leds.h>
31#include <mach/leds-netxbig.h> 31#include <linux/platform_data/leds-kirkwood-netxbig.h>
32 32
33/* 33/*
34 * GPIO extension bus. 34 * GPIO extension bus.
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c
index 10528dafb043..d176ec83f5d9 100644
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@ -29,7 +29,7 @@
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/leds.h> 30#include <linux/leds.h>
31#include <linux/module.h> 31#include <linux/module.h>
32#include <mach/leds-ns2.h> 32#include <linux/platform_data/leds-kirkwood-ns2.h>
33 33
34/* 34/*
35 * The Network Space v2 dual-GPIO LED is wired to a CPLD and can blink in 35 * The Network Space v2 dual-GPIO LED is wired to a CPLD and can blink in
diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index 942f0ea18178..e1a0df63a37f 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -21,7 +21,7 @@
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/regs-gpio.h> 23#include <mach/regs-gpio.h>
24#include <mach/leds-gpio.h> 24#include <linux/platform_data/leds-s3c24xx.h>
25 25
26/* our context */ 26/* our context */
27 27
diff --git a/drivers/media/video/davinci/vpbe_venc.c b/drivers/media/video/davinci/vpbe_venc.c
index b21ecc8d134d..0302669622d6 100644
--- a/drivers/media/video/davinci/vpbe_venc.c
+++ b/drivers/media/video/davinci/vpbe_venc.c
@@ -27,7 +27,7 @@
27 27
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/mux.h> 29#include <mach/mux.h>
30#include <mach/i2c.h> 30#include <linux/platform_data/i2c-davinci.h>
31 31
32#include <linux/io.h> 32#include <linux/io.h>
33 33
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index 560a65aa7038..bbe70991d30b 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -44,7 +44,7 @@
44#include <mach/dma-mx1-mx2.h> 44#include <mach/dma-mx1-mx2.h>
45#include <mach/hardware.h> 45#include <mach/hardware.h>
46#include <mach/irqs.h> 46#include <mach/irqs.h>
47#include <mach/mx1_camera.h> 47#include <linux/platform_data/camera-mx1.h>
48 48
49/* 49/*
50 * CSI registers 50 * CSI registers
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index ac175406e582..965427f279a5 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -40,7 +40,7 @@
40 40
41#include <linux/videodev2.h> 41#include <linux/videodev2.h>
42 42
43#include <mach/mx2_cam.h> 43#include <linux/platform_data/camera-mx2.h>
44#include <mach/hardware.h> 44#include <mach/hardware.h>
45 45
46#include <asm/dma.h> 46#include <asm/dma.h>
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index af2297dd49c8..1481b0d419da 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -25,8 +25,8 @@
25#include <media/soc_mediabus.h> 25#include <media/soc_mediabus.h>
26 26
27#include <mach/ipu.h> 27#include <mach/ipu.h>
28#include <mach/mx3_camera.h> 28#include <linux/platform_data/camera-mx3.h>
29#include <mach/dma.h> 29#include <linux/platform_data/dma-imx.h>
30 30
31#define MX3_CAM_DRV_NAME "mx3-camera" 31#define MX3_CAM_DRV_NAME "mx3-camera"
32 32
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 9c21e01f2c24..1e3776d08dac 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -37,7 +37,7 @@
37#include <linux/videodev2.h> 37#include <linux/videodev2.h>
38 38
39#include <mach/dma.h> 39#include <mach/dma.h>
40#include <mach/camera.h> 40#include <linux/platform_data/camera-pxa.h>
41 41
42#define PXA_CAM_VERSION "0.0.6" 42#define PXA_CAM_VERSION "0.0.6"
43#define PXA_CAM_DRV_NAME "pxa27x-camera" 43#define PXA_CAM_DRV_NAME "pxa27x-camera"
diff --git a/drivers/media/video/s5p-fimc/mipi-csis.c b/drivers/media/video/s5p-fimc/mipi-csis.c
index 2f73d9e3d0b7..5e898432883a 100644
--- a/drivers/media/video/s5p-fimc/mipi-csis.c
+++ b/drivers/media/video/s5p-fimc/mipi-csis.c
@@ -26,7 +26,7 @@
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/videodev2.h> 27#include <linux/videodev2.h>
28#include <media/v4l2-subdev.h> 28#include <media/v4l2-subdev.h>
29#include <plat/mipi_csis.h> 29#include <linux/platform_data/mipi-csis.h>
30#include "mipi-csis.h" 30#include "mipi-csis.h"
31 31
32static int debug; 32static int debug;
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 0e63cdd9b52a..6b67edbdbd01 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -418,6 +418,9 @@ static struct {
418 418
419static atomic_t ac_wake_req_state = ATOMIC_INIT(0); 419static atomic_t ac_wake_req_state = ATOMIC_INIT(0);
420 420
421/* Functions definition */
422static void compute_armss_rate(void);
423
421/* Spinlocks */ 424/* Spinlocks */
422static DEFINE_SPINLOCK(prcmu_lock); 425static DEFINE_SPINLOCK(prcmu_lock);
423static DEFINE_SPINLOCK(clkout_lock); 426static DEFINE_SPINLOCK(clkout_lock);
@@ -517,6 +520,7 @@ static struct dsiescclk dsiescclk[3] = {
517 } 520 }
518}; 521};
519 522
523
520/* 524/*
521* Used by MCDE to setup all necessary PRCMU registers 525* Used by MCDE to setup all necessary PRCMU registers
522*/ 526*/
@@ -1013,6 +1017,7 @@ int db8500_prcmu_set_arm_opp(u8 opp)
1013 (mb1_transfer.ack.arm_opp != opp)) 1017 (mb1_transfer.ack.arm_opp != opp))
1014 r = -EIO; 1018 r = -EIO;
1015 1019
1020 compute_armss_rate();
1016 mutex_unlock(&mb1_transfer.lock); 1021 mutex_unlock(&mb1_transfer.lock);
1017 1022
1018 return r; 1023 return r;
@@ -1612,6 +1617,7 @@ static unsigned long pll_rate(void __iomem *reg, unsigned long src_rate,
1612 if ((branch == PLL_FIX) || ((branch == PLL_DIV) && 1617 if ((branch == PLL_FIX) || ((branch == PLL_DIV) &&
1613 (val & PRCM_PLL_FREQ_DIV2EN) && 1618 (val & PRCM_PLL_FREQ_DIV2EN) &&
1614 ((reg == PRCM_PLLSOC0_FREQ) || 1619 ((reg == PRCM_PLLSOC0_FREQ) ||
1620 (reg == PRCM_PLLARM_FREQ) ||
1615 (reg == PRCM_PLLDDR_FREQ)))) 1621 (reg == PRCM_PLLDDR_FREQ))))
1616 div *= 2; 1622 div *= 2;
1617 1623
@@ -1661,6 +1667,39 @@ static unsigned long clock_rate(u8 clock)
1661 else 1667 else
1662 return 0; 1668 return 0;
1663} 1669}
1670static unsigned long latest_armss_rate;
1671static unsigned long armss_rate(void)
1672{
1673 return latest_armss_rate;
1674}
1675
1676static void compute_armss_rate(void)
1677{
1678 u32 r;
1679 unsigned long rate;
1680
1681 r = readl(PRCM_ARM_CHGCLKREQ);
1682
1683 if (r & PRCM_ARM_CHGCLKREQ_PRCM_ARM_CHGCLKREQ) {
1684 /* External ARMCLKFIX clock */
1685
1686 rate = pll_rate(PRCM_PLLDDR_FREQ, ROOT_CLOCK_RATE, PLL_FIX);
1687
1688 /* Check PRCM_ARM_CHGCLKREQ divider */
1689 if (!(r & PRCM_ARM_CHGCLKREQ_PRCM_ARM_DIVSEL))
1690 rate /= 2;
1691
1692 /* Check PRCM_ARMCLKFIX_MGT divider */
1693 r = readl(PRCM_ARMCLKFIX_MGT);
1694 r &= PRCM_CLK_MGT_CLKPLLDIV_MASK;
1695 rate /= r;
1696
1697 } else {/* ARM PLL */
1698 rate = pll_rate(PRCM_PLLARM_FREQ, ROOT_CLOCK_RATE, PLL_DIV);
1699 }
1700
1701 latest_armss_rate = rate;
1702}
1664 1703
1665static unsigned long dsiclk_rate(u8 n) 1704static unsigned long dsiclk_rate(u8 n)
1666{ 1705{
@@ -1707,6 +1746,8 @@ unsigned long prcmu_clock_rate(u8 clock)
1707 return pll_rate(PRCM_PLLSOC0_FREQ, ROOT_CLOCK_RATE, PLL_RAW); 1746 return pll_rate(PRCM_PLLSOC0_FREQ, ROOT_CLOCK_RATE, PLL_RAW);
1708 else if (clock == PRCMU_PLLSOC1) 1747 else if (clock == PRCMU_PLLSOC1)
1709 return pll_rate(PRCM_PLLSOC1_FREQ, ROOT_CLOCK_RATE, PLL_RAW); 1748 return pll_rate(PRCM_PLLSOC1_FREQ, ROOT_CLOCK_RATE, PLL_RAW);
1749 else if (clock == PRCMU_ARMSS)
1750 return armss_rate();
1710 else if (clock == PRCMU_PLLDDR) 1751 else if (clock == PRCMU_PLLDDR)
1711 return pll_rate(PRCM_PLLDDR_FREQ, ROOT_CLOCK_RATE, PLL_RAW); 1752 return pll_rate(PRCM_PLLDDR_FREQ, ROOT_CLOCK_RATE, PLL_RAW);
1712 else if (clock == PRCMU_PLLDSI) 1753 else if (clock == PRCMU_PLLDSI)
@@ -2693,6 +2734,7 @@ void __init db8500_prcmu_early_init(void)
2693 handle_simple_irq); 2734 handle_simple_irq);
2694 set_irq_flags(irq, IRQF_VALID); 2735 set_irq_flags(irq, IRQF_VALID);
2695 } 2736 }
2737 compute_armss_rate();
2696} 2738}
2697 2739
2698static void __init init_prcm_registers(void) 2740static void __init init_prcm_registers(void)
diff --git a/drivers/mfd/dbx500-prcmu-regs.h b/drivers/mfd/dbx500-prcmu-regs.h
index 23108a6e3167..79c76ebdba52 100644
--- a/drivers/mfd/dbx500-prcmu-regs.h
+++ b/drivers/mfd/dbx500-prcmu-regs.h
@@ -61,7 +61,8 @@
61#define PRCM_PLLARM_LOCKP_PRCM_PLLARM_LOCKP3 0x2 61#define PRCM_PLLARM_LOCKP_PRCM_PLLARM_LOCKP3 0x2
62 62
63#define PRCM_ARM_CHGCLKREQ (_PRCMU_BASE + 0x114) 63#define PRCM_ARM_CHGCLKREQ (_PRCMU_BASE + 0x114)
64#define PRCM_ARM_CHGCLKREQ_PRCM_ARM_CHGCLKREQ 0x1 64#define PRCM_ARM_CHGCLKREQ_PRCM_ARM_CHGCLKREQ BIT(0)
65#define PRCM_ARM_CHGCLKREQ_PRCM_ARM_DIVSEL BIT(16)
65 66
66#define PRCM_PLLARM_ENABLE (_PRCMU_BASE + 0x98) 67#define PRCM_PLLARM_ENABLE (_PRCMU_BASE + 0x98)
67#define PRCM_PLLARM_ENABLE_PRCM_PLLARM_ENABLE 0x1 68#define PRCM_PLLARM_ENABLE_PRCM_PLLARM_ENABLE 0x1
@@ -140,6 +141,7 @@
140/* PRCMU clock/PLL/reset registers */ 141/* PRCMU clock/PLL/reset registers */
141#define PRCM_PLLSOC0_FREQ (_PRCMU_BASE + 0x080) 142#define PRCM_PLLSOC0_FREQ (_PRCMU_BASE + 0x080)
142#define PRCM_PLLSOC1_FREQ (_PRCMU_BASE + 0x084) 143#define PRCM_PLLSOC1_FREQ (_PRCMU_BASE + 0x084)
144#define PRCM_PLLARM_FREQ (_PRCMU_BASE + 0x088)
143#define PRCM_PLLDDR_FREQ (_PRCMU_BASE + 0x08C) 145#define PRCM_PLLDDR_FREQ (_PRCMU_BASE + 0x08C)
144#define PRCM_PLL_FREQ_D_SHIFT 0 146#define PRCM_PLL_FREQ_D_SHIFT 0
145#define PRCM_PLL_FREQ_D_MASK BITS(0, 7) 147#define PRCM_PLL_FREQ_D_MASK BITS(0, 7)
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c
index c54e244ca0cf..f99d6299ec24 100644
--- a/drivers/mfd/mcp-sa11x0.c
+++ b/drivers/mfd/mcp-sa11x0.c
@@ -24,7 +24,7 @@
24 24
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <mach/mcp.h> 27#include <linux/platform_data/mfd-mcp-sa11x0.h>
28 28
29#define DRIVER_NAME "sa11x0-mcp" 29#define DRIVER_NAME "sa11x0-mcp"
30 30
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 5f58370ccf55..345960ca2fd8 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -25,6 +25,7 @@
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/regmap.h> 26#include <linux/regmap.h>
27#include <linux/regulator/of_regulator.h> 27#include <linux/regulator/of_regulator.h>
28#include <linux/regulator/machine.h>
28 29
29#include <linux/mfd/core.h> 30#include <linux/mfd/core.h>
30#include <linux/mfd/tps6586x.h> 31#include <linux/mfd/tps6586x.h>
@@ -346,6 +347,7 @@ failed:
346 347
347#ifdef CONFIG_OF 348#ifdef CONFIG_OF
348static struct of_regulator_match tps6586x_matches[] = { 349static struct of_regulator_match tps6586x_matches[] = {
350 { .name = "sys", .driver_data = (void *)TPS6586X_ID_SYS },
349 { .name = "sm0", .driver_data = (void *)TPS6586X_ID_SM_0 }, 351 { .name = "sm0", .driver_data = (void *)TPS6586X_ID_SM_0 },
350 { .name = "sm1", .driver_data = (void *)TPS6586X_ID_SM_1 }, 352 { .name = "sm1", .driver_data = (void *)TPS6586X_ID_SM_1 },
351 { .name = "sm2", .driver_data = (void *)TPS6586X_ID_SM_2 }, 353 { .name = "sm2", .driver_data = (void *)TPS6586X_ID_SM_2 },
@@ -369,6 +371,7 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
369 struct tps6586x_platform_data *pdata; 371 struct tps6586x_platform_data *pdata;
370 struct tps6586x_subdev_info *devs; 372 struct tps6586x_subdev_info *devs;
371 struct device_node *regs; 373 struct device_node *regs;
374 const char *sys_rail_name = NULL;
372 unsigned int count; 375 unsigned int count;
373 unsigned int i, j; 376 unsigned int i, j;
374 int err; 377 int err;
@@ -391,12 +394,22 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
391 return NULL; 394 return NULL;
392 395
393 for (i = 0, j = 0; i < num && j < count; i++) { 396 for (i = 0, j = 0; i < num && j < count; i++) {
397 struct regulator_init_data *reg_idata;
398
394 if (!tps6586x_matches[i].init_data) 399 if (!tps6586x_matches[i].init_data)
395 continue; 400 continue;
396 401
402 reg_idata = tps6586x_matches[i].init_data;
397 devs[j].name = "tps6586x-regulator"; 403 devs[j].name = "tps6586x-regulator";
398 devs[j].platform_data = tps6586x_matches[i].init_data; 404 devs[j].platform_data = tps6586x_matches[i].init_data;
399 devs[j].id = (int)tps6586x_matches[i].driver_data; 405 devs[j].id = (int)tps6586x_matches[i].driver_data;
406 if (devs[j].id == TPS6586X_ID_SYS)
407 sys_rail_name = reg_idata->constraints.name;
408
409 if ((devs[j].id == TPS6586X_ID_LDO_5) ||
410 (devs[j].id == TPS6586X_ID_LDO_RTC))
411 reg_idata->supply_regulator = sys_rail_name;
412
400 devs[j].of_node = tps6586x_matches[i].of_node; 413 devs[j].of_node = tps6586x_matches[i].of_node;
401 j++; 414 j++;
402 } 415 }
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 7cf6c624bf73..3dfd3473269d 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -33,7 +33,7 @@
33#include <linux/dma-mapping.h> 33#include <linux/dma-mapping.h>
34#include <linux/mmc/mmc.h> 34#include <linux/mmc/mmc.h>
35 35
36#include <mach/mmc.h> 36#include <linux/platform_data/mmc-davinci.h>
37#include <mach/edma.h> 37#include <mach/edma.h>
38 38
39/* 39/*
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 1d14cda95e56..7c0af0e80047 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -42,7 +42,7 @@
42#include <asm/div64.h> 42#include <asm/div64.h>
43#include <asm/sizes.h> 43#include <asm/sizes.h>
44 44
45#include <mach/mmc.h> 45#include <linux/platform_data/mmc-msm_sdcc.h>
46#include <mach/msm_iomap.h> 46#include <mach/msm_iomap.h>
47#include <mach/dma.h> 47#include <mach/dma.h>
48#include <mach/clk.h> 48#include <mach/clk.h>
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index a61cb5fca22d..de4c20b3936c 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -25,7 +25,7 @@
25 25
26#include <asm/sizes.h> 26#include <asm/sizes.h>
27#include <asm/unaligned.h> 27#include <asm/unaligned.h>
28#include <plat/mvsdio.h> 28#include <linux/platform_data/mmc-mvsdio.h>
29 29
30#include "mvsdio.h" 30#include "mvsdio.h"
31 31
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 28ed52d58f7f..7b1161de01d6 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -38,9 +38,9 @@
38#include <asm/dma.h> 38#include <asm/dma.h>
39#include <asm/irq.h> 39#include <asm/irq.h>
40#include <asm/sizes.h> 40#include <asm/sizes.h>
41#include <mach/mmc.h> 41#include <linux/platform_data/mmc-mxcmmc.h>
42 42
43#include <mach/dma.h> 43#include <linux/platform_data/dma-imx.h>
44#include <mach/hardware.h> 44#include <mach/hardware.h>
45 45
46#define DRIVER_NAME "mxc-mmc" 46#define DRIVER_NAME "mxc-mmc"
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 87c0293a1eef..c6259a829544 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -36,7 +36,6 @@
36#include <plat/mmc.h> 36#include <plat/mmc.h>
37#include <asm/gpio.h> 37#include <asm/gpio.h>
38#include <plat/dma.h> 38#include <plat/dma.h>
39#include <plat/mux.h>
40#include <plat/fpga.h> 39#include <plat/fpga.h>
41 40
42#define OMAP_MMC_REG_CMD 0x00 41#define OMAP_MMC_REG_CMD 0x00
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index cb2dc0e75ba7..ca3915dac03d 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -35,7 +35,7 @@
35 35
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37#include <mach/dma.h> 37#include <mach/dma.h>
38#include <mach/mmc.h> 38#include <linux/platform_data/mmc-pxamci.h>
39 39
40#include "pxamci.h" 40#include "pxamci.h"
41 41
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index bd5a5cce122c..4638ddab97b8 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -27,7 +27,7 @@
27 27
28#include <mach/regs-sdi.h> 28#include <mach/regs-sdi.h>
29 29
30#include <plat/mci.h> 30#include <linux/platform_data/mmc-s3cmci.h>
31 31
32#include "s3cmci.h" 32#include "s3cmci.h"
33 33
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index e23f8134591c..c4c504c4802b 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -25,7 +25,7 @@
25#include <linux/of_device.h> 25#include <linux/of_device.h>
26#include <linux/of_gpio.h> 26#include <linux/of_gpio.h>
27#include <linux/pinctrl/consumer.h> 27#include <linux/pinctrl/consumer.h>
28#include <mach/esdhc.h> 28#include <linux/platform_data/mmc-esdhc-imx.h>
29#include "sdhci-pltfm.h" 29#include "sdhci-pltfm.h"
30#include "sdhci-esdhc.h" 30#include "sdhci-esdhc.h"
31 31
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 0810ccc23d7e..d43e7462941f 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -28,7 +28,7 @@
28#include <asm/gpio.h> 28#include <asm/gpio.h>
29 29
30#include <mach/gpio-tegra.h> 30#include <mach/gpio-tegra.h>
31#include <mach/sdhci.h> 31#include <linux/platform_data/mmc-sdhci-tegra.h>
32 32
33#include "sdhci-pltfm.h" 33#include "sdhci-pltfm.h"
34 34
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 78a524b49357..a7040af08536 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -29,7 +29,7 @@
29#include <asm/io.h> 29#include <asm/io.h>
30#include <asm/sizes.h> 30#include <asm/sizes.h>
31 31
32#include <plat/board-ams-delta.h> 32#include <mach/board-ams-delta.h>
33 33
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35 35
diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c
index c855e7cd337b..d0d1bd4d0e7d 100644
--- a/drivers/mtd/nand/bcm_umi_nand.c
+++ b/drivers/mtd/nand/bcm_umi_nand.c
@@ -249,20 +249,20 @@ static int nand_dev_ready(struct mtd_info *mtd)
249int bcm_umi_nand_inithw(void) 249int bcm_umi_nand_inithw(void)
250{ 250{
251 /* Configure nand timing parameters */ 251 /* Configure nand timing parameters */
252 REG_UMI_NAND_TCR &= ~0x7ffff; 252 writel(readl(&REG_UMI_NAND_TCR) & ~0x7ffff, &REG_UMI_NAND_TCR);
253 REG_UMI_NAND_TCR |= HW_CFG_NAND_TCR; 253 writel(readl(&REG_UMI_NAND_TCR) | HW_CFG_NAND_TCR, &REG_UMI_NAND_TCR);
254 254
255#if !defined(CONFIG_MTD_NAND_BCM_UMI_HWCS) 255#if !defined(CONFIG_MTD_NAND_BCM_UMI_HWCS)
256 /* enable software control of CS */ 256 /* enable software control of CS */
257 REG_UMI_NAND_TCR |= REG_UMI_NAND_TCR_CS_SWCTRL; 257 writel(readl(&REG_UMI_NAND_TCR) | REG_UMI_NAND_TCR_CS_SWCTRL, &REG_UMI_NAND_TCR);
258#endif 258#endif
259 259
260 /* keep NAND chip select asserted */ 260 /* keep NAND chip select asserted */
261 REG_UMI_NAND_RCSR |= REG_UMI_NAND_RCSR_CS_ASSERTED; 261 writel(readl(&REG_UMI_NAND_RCSR) | REG_UMI_NAND_RCSR_CS_ASSERTED, &REG_UMI_NAND_RCSR);
262 262
263 REG_UMI_NAND_TCR &= ~REG_UMI_NAND_TCR_WORD16; 263 writel(readl(&REG_UMI_NAND_TCR) & ~REG_UMI_NAND_TCR_WORD16, &REG_UMI_NAND_TCR);
264 /* enable writes to flash */ 264 /* enable writes to flash */
265 REG_UMI_MMD_ICR |= REG_UMI_MMD_ICR_FLASH_WP; 265 writel(readl(&REG_UMI_MMD_ICR) | REG_UMI_MMD_ICR_FLASH_WP, &REG_UMI_MMD_ICR);
266 266
267 writel(NAND_CMD_RESET, bcm_umi_io_base + REG_NAND_CMD_OFFSET); 267 writel(NAND_CMD_RESET, bcm_umi_io_base + REG_NAND_CMD_OFFSET);
268 nand_bcm_umi_wait_till_ready(); 268 nand_bcm_umi_wait_till_ready();
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index d94b03c207af..f1deb1ee2c95 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -34,8 +34,8 @@
34#include <linux/mtd/partitions.h> 34#include <linux/mtd/partitions.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36 36
37#include <mach/nand.h> 37#include <linux/platform_data/mtd-davinci.h>
38#include <mach/aemif.h> 38#include <linux/platform_data/mtd-davinci-aemif.h>
39 39
40/* 40/*
41 * This is a device driver for the NAND flash controller found on the 41 * This is a device driver for the NAND flash controller found on the
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 6acc790c2fbb..5683604967d7 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -36,7 +36,7 @@
36#include <linux/of_mtd.h> 36#include <linux/of_mtd.h>
37 37
38#include <asm/mach/flash.h> 38#include <asm/mach/flash.h>
39#include <mach/mxc_nand.h> 39#include <linux/platform_data/mtd-mxc_nand.h>
40#include <mach/hardware.h> 40#include <mach/hardware.h>
41 41
42#define DRIVER_NAME "mxc_nand" 42#define DRIVER_NAME "mxc_nand"
diff --git a/drivers/mtd/nand/nand_bcm_umi.h b/drivers/mtd/nand/nand_bcm_umi.h
index 198b304d6f72..d90186684db8 100644
--- a/drivers/mtd/nand/nand_bcm_umi.h
+++ b/drivers/mtd/nand/nand_bcm_umi.h
@@ -17,7 +17,7 @@
17/* ---- Include Files ---------------------------------------------------- */ 17/* ---- Include Files ---------------------------------------------------- */
18#include <mach/reg_umi.h> 18#include <mach/reg_umi.h>
19#include <mach/reg_nand.h> 19#include <mach/reg_nand.h>
20#include <cfg_global.h> 20#include <mach/cfg_global.h>
21 21
22/* ---- Constants and Types ---------------------------------------------- */ 22/* ---- Constants and Types ---------------------------------------------- */
23#if (CFG_GLOBAL_CHIP_FAMILY == CFG_GLOBAL_CHIP_FAMILY_BCMRING) 23#if (CFG_GLOBAL_CHIP_FAMILY == CFG_GLOBAL_CHIP_FAMILY_BCMRING)
@@ -48,7 +48,7 @@ int nand_bcm_umi_bch_correct_page(uint8_t *datap, uint8_t *readEccData,
48/* Check in device is ready */ 48/* Check in device is ready */
49static inline int nand_bcm_umi_dev_ready(void) 49static inline int nand_bcm_umi_dev_ready(void)
50{ 50{
51 return REG_UMI_NAND_RCSR & REG_UMI_NAND_RCSR_RDY; 51 return readl(&REG_UMI_NAND_RCSR) & REG_UMI_NAND_RCSR_RDY;
52} 52}
53 53
54/* Wait until device is ready */ 54/* Wait until device is ready */
@@ -62,10 +62,11 @@ static inline void nand_bcm_umi_wait_till_ready(void)
62static inline void nand_bcm_umi_hamming_enable_hwecc(void) 62static inline void nand_bcm_umi_hamming_enable_hwecc(void)
63{ 63{
64 /* disable and reset ECC, 512 byte page */ 64 /* disable and reset ECC, 512 byte page */
65 REG_UMI_NAND_ECC_CSR &= ~(REG_UMI_NAND_ECC_CSR_ECC_ENABLE | 65 writel(readl(&REG_UMI_NAND_ECC_CSR) & ~(REG_UMI_NAND_ECC_CSR_ECC_ENABLE |
66 REG_UMI_NAND_ECC_CSR_256BYTE); 66 REG_UMI_NAND_ECC_CSR_256BYTE), &REG_UMI_NAND_ECC_CSR);
67 /* enable ECC */ 67 /* enable ECC */
68 REG_UMI_NAND_ECC_CSR |= REG_UMI_NAND_ECC_CSR_ECC_ENABLE; 68 writel(readl(&REG_UMI_NAND_ECC_CSR) | REG_UMI_NAND_ECC_CSR_ECC_ENABLE,
69 &REG_UMI_NAND_ECC_CSR);
69} 70}
70 71
71#if NAND_ECC_BCH 72#if NAND_ECC_BCH
@@ -76,18 +77,18 @@ static inline void nand_bcm_umi_hamming_enable_hwecc(void)
76static inline void nand_bcm_umi_bch_enable_read_hwecc(void) 77static inline void nand_bcm_umi_bch_enable_read_hwecc(void)
77{ 78{
78 /* disable and reset ECC */ 79 /* disable and reset ECC */
79 REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID; 80 writel(REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID, &REG_UMI_BCH_CTRL_STATUS);
80 /* Turn on ECC */ 81 /* Turn on ECC */
81 REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN; 82 writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN, &REG_UMI_BCH_CTRL_STATUS);
82} 83}
83 84
84/* Enable BCH Write ECC */ 85/* Enable BCH Write ECC */
85static inline void nand_bcm_umi_bch_enable_write_hwecc(void) 86static inline void nand_bcm_umi_bch_enable_write_hwecc(void)
86{ 87{
87 /* disable and reset ECC */ 88 /* disable and reset ECC */
88 REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID; 89 writel(REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID, &REG_UMI_BCH_CTRL_STATUS);
89 /* Turn on ECC */ 90 /* Turn on ECC */
90 REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_WR_EN; 91 writel(REG_UMI_BCH_CTRL_STATUS_ECC_WR_EN, &REG_UMI_BCH_CTRL_STATUS);
91} 92}
92 93
93/* Config number of BCH ECC bytes */ 94/* Config number of BCH ECC bytes */
@@ -99,9 +100,9 @@ static inline void nand_bcm_umi_bch_config_ecc(uint8_t numEccBytes)
99 uint32_t numBits = numEccBytes * 8; 100 uint32_t numBits = numEccBytes * 8;
100 101
101 /* disable and reset ECC */ 102 /* disable and reset ECC */
102 REG_UMI_BCH_CTRL_STATUS = 103 writel(REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID |
103 REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID | 104 REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID,
104 REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID; 105 &REG_UMI_BCH_CTRL_STATUS);
105 106
106 /* Every correctible bit requires 13 ECC bits */ 107 /* Every correctible bit requires 13 ECC bits */
107 tValue = (uint32_t) (numBits / ECC_BITS_PER_CORRECTABLE_BIT); 108 tValue = (uint32_t) (numBits / ECC_BITS_PER_CORRECTABLE_BIT);
@@ -113,23 +114,21 @@ static inline void nand_bcm_umi_bch_config_ecc(uint8_t numEccBytes)
113 kValue = nValue - (tValue * ECC_BITS_PER_CORRECTABLE_BIT); 114 kValue = nValue - (tValue * ECC_BITS_PER_CORRECTABLE_BIT);
114 115
115 /* Write the settings */ 116 /* Write the settings */
116 REG_UMI_BCH_N = nValue; 117 writel(nValue, &REG_UMI_BCH_N);
117 REG_UMI_BCH_T = tValue; 118 writel(tValue, &REG_UMI_BCH_T);
118 REG_UMI_BCH_K = kValue; 119 writel(kValue, &REG_UMI_BCH_K);
119} 120}
120 121
121/* Pause during ECC read calculation to skip bytes in OOB */ 122/* Pause during ECC read calculation to skip bytes in OOB */
122static inline void nand_bcm_umi_bch_pause_read_ecc_calc(void) 123static inline void nand_bcm_umi_bch_pause_read_ecc_calc(void)
123{ 124{
124 REG_UMI_BCH_CTRL_STATUS = 125 writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN | REG_UMI_BCH_CTRL_STATUS_PAUSE_ECC_DEC, &REG_UMI_BCH_CTRL_STATUS);
125 REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN |
126 REG_UMI_BCH_CTRL_STATUS_PAUSE_ECC_DEC;
127} 126}
128 127
129/* Resume during ECC read calculation after skipping bytes in OOB */ 128/* Resume during ECC read calculation after skipping bytes in OOB */
130static inline void nand_bcm_umi_bch_resume_read_ecc_calc(void) 129static inline void nand_bcm_umi_bch_resume_read_ecc_calc(void)
131{ 130{
132 REG_UMI_BCH_CTRL_STATUS = REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN; 131 writel(REG_UMI_BCH_CTRL_STATUS_ECC_RD_EN, &REG_UMI_BCH_CTRL_STATUS);
133} 132}
134 133
135/* Poll read ECC calc to check when hardware completes */ 134/* Poll read ECC calc to check when hardware completes */
@@ -139,7 +138,7 @@ static inline uint32_t nand_bcm_umi_bch_poll_read_ecc_calc(void)
139 138
140 do { 139 do {
141 /* wait for ECC to be valid */ 140 /* wait for ECC to be valid */
142 regVal = REG_UMI_BCH_CTRL_STATUS; 141 regVal = readl(&REG_UMI_BCH_CTRL_STATUS);
143 } while ((regVal & REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID) == 0); 142 } while ((regVal & REG_UMI_BCH_CTRL_STATUS_RD_ECC_VALID) == 0);
144 143
145 return regVal; 144 return regVal;
@@ -149,7 +148,7 @@ static inline uint32_t nand_bcm_umi_bch_poll_read_ecc_calc(void)
149static inline void nand_bcm_umi_bch_poll_write_ecc_calc(void) 148static inline void nand_bcm_umi_bch_poll_write_ecc_calc(void)
150{ 149{
151 /* wait for ECC to be valid */ 150 /* wait for ECC to be valid */
152 while ((REG_UMI_BCH_CTRL_STATUS & REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID) 151 while ((readl(&REG_UMI_BCH_CTRL_STATUS) & REG_UMI_BCH_CTRL_STATUS_WR_ECC_VALID)
153 == 0) 152 == 0)
154 ; 153 ;
155} 154}
@@ -170,9 +169,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,
170 if (pageSize != NAND_DATA_ACCESS_SIZE) { 169 if (pageSize != NAND_DATA_ACCESS_SIZE) {
171 /* skip BI */ 170 /* skip BI */
172#if defined(__KERNEL__) && !defined(STANDALONE) 171#if defined(__KERNEL__) && !defined(STANDALONE)
173 *oobp++ = REG_NAND_DATA8; 172 *oobp++ = readb(&REG_NAND_DATA8);
174#else 173#else
175 REG_NAND_DATA8; 174 readb(&REG_NAND_DATA8);
176#endif 175#endif
177 numToRead--; 176 numToRead--;
178 } 177 }
@@ -180,9 +179,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,
180 while (numToRead > numEccBytes) { 179 while (numToRead > numEccBytes) {
181 /* skip free oob region */ 180 /* skip free oob region */
182#if defined(__KERNEL__) && !defined(STANDALONE) 181#if defined(__KERNEL__) && !defined(STANDALONE)
183 *oobp++ = REG_NAND_DATA8; 182 *oobp++ = readb(&REG_NAND_DATA8);
184#else 183#else
185 REG_NAND_DATA8; 184 readb(&REG_NAND_DATA8);
186#endif 185#endif
187 numToRead--; 186 numToRead--;
188 } 187 }
@@ -193,11 +192,11 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,
193 192
194 while (numToRead > 11) { 193 while (numToRead > 11) {
195#if defined(__KERNEL__) && !defined(STANDALONE) 194#if defined(__KERNEL__) && !defined(STANDALONE)
196 *oobp = REG_NAND_DATA8; 195 *oobp = readb(&REG_NAND_DATA8);
197 eccCalc[eccPos++] = *oobp; 196 eccCalc[eccPos++] = *oobp;
198 oobp++; 197 oobp++;
199#else 198#else
200 eccCalc[eccPos++] = REG_NAND_DATA8; 199 eccCalc[eccPos++] = readb(&REG_NAND_DATA8);
201#endif 200#endif
202 numToRead--; 201 numToRead--;
203 } 202 }
@@ -207,9 +206,9 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,
207 if (numToRead == 11) { 206 if (numToRead == 11) {
208 /* read BI */ 207 /* read BI */
209#if defined(__KERNEL__) && !defined(STANDALONE) 208#if defined(__KERNEL__) && !defined(STANDALONE)
210 *oobp++ = REG_NAND_DATA8; 209 *oobp++ = readb(&REG_NAND_DATA8);
211#else 210#else
212 REG_NAND_DATA8; 211 readb(&REG_NAND_DATA8);
213#endif 212#endif
214 numToRead--; 213 numToRead--;
215 } 214 }
@@ -219,11 +218,11 @@ static inline void nand_bcm_umi_bch_read_oobEcc(uint32_t pageSize,
219 nand_bcm_umi_bch_resume_read_ecc_calc(); 218 nand_bcm_umi_bch_resume_read_ecc_calc();
220 while (numToRead) { 219 while (numToRead) {
221#if defined(__KERNEL__) && !defined(STANDALONE) 220#if defined(__KERNEL__) && !defined(STANDALONE)
222 *oobp = REG_NAND_DATA8; 221 *oobp = readb(&REG_NAND_DATA8);
223 eccCalc[eccPos++] = *oobp; 222 eccCalc[eccPos++] = *oobp;
224 oobp++; 223 oobp++;
225#else 224#else
226 eccCalc[eccPos++] = REG_NAND_DATA8; 225 eccCalc[eccPos++] = readb(&REG_NAND_DATA8);
227#endif 226#endif
228 numToRead--; 227 numToRead--;
229 } 228 }
@@ -255,7 +254,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,
255 if (pageSize == NAND_DATA_ACCESS_SIZE) { 254 if (pageSize == NAND_DATA_ACCESS_SIZE) {
256 /* Now fill in the ECC bytes */ 255 /* Now fill in the ECC bytes */
257 if (numEccBytes >= 13) 256 if (numEccBytes >= 13)
258 eccVal = REG_UMI_BCH_WR_ECC_3; 257 eccVal = readl(&REG_UMI_BCH_WR_ECC_3);
259 258
260 /* Usually we skip CM in oob[0,1] */ 259 /* Usually we skip CM in oob[0,1] */
261 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[0], 260 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[0],
@@ -268,7 +267,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,
268 eccVal & 0xff); /* ECC 12 */ 267 eccVal & 0xff); /* ECC 12 */
269 268
270 if (numEccBytes >= 9) 269 if (numEccBytes >= 9)
271 eccVal = REG_UMI_BCH_WR_ECC_2; 270 eccVal = readl(&REG_UMI_BCH_WR_ECC_2);
272 271
273 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[3], 272 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[3],
274 (eccVal >> 24) & 0xff); /* ECC11 */ 273 (eccVal >> 24) & 0xff); /* ECC11 */
@@ -281,7 +280,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,
281 280
282 /* Now fill in the ECC bytes */ 281 /* Now fill in the ECC bytes */
283 if (numEccBytes >= 13) 282 if (numEccBytes >= 13)
284 eccVal = REG_UMI_BCH_WR_ECC_3; 283 eccVal = readl(&REG_UMI_BCH_WR_ECC_3);
285 284
286 /* Usually skip CM in oob[1,2] */ 285 /* Usually skip CM in oob[1,2] */
287 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[1], 286 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 15, &oobp[1],
@@ -294,7 +293,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,
294 eccVal & 0xff); /* ECC12 */ 293 eccVal & 0xff); /* ECC12 */
295 294
296 if (numEccBytes >= 9) 295 if (numEccBytes >= 9)
297 eccVal = REG_UMI_BCH_WR_ECC_2; 296 eccVal = readl(&REG_UMI_BCH_WR_ECC_2);
298 297
299 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[4], 298 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 12, &oobp[4],
300 (eccVal >> 24) & 0xff); /* ECC11 */ 299 (eccVal >> 24) & 0xff); /* ECC11 */
@@ -309,7 +308,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,
309 eccVal & 0xff); /* ECC8 */ 308 eccVal & 0xff); /* ECC8 */
310 309
311 if (numEccBytes >= 5) 310 if (numEccBytes >= 5)
312 eccVal = REG_UMI_BCH_WR_ECC_1; 311 eccVal = readl(&REG_UMI_BCH_WR_ECC_1);
313 312
314 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 8, &oobp[8], 313 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 8, &oobp[8],
315 (eccVal >> 24) & 0xff); /* ECC7 */ 314 (eccVal >> 24) & 0xff); /* ECC7 */
@@ -321,7 +320,7 @@ static inline void nand_bcm_umi_bch_write_oobEcc(uint32_t pageSize,
321 eccVal & 0xff); /* ECC4 */ 320 eccVal & 0xff); /* ECC4 */
322 321
323 if (numEccBytes >= 1) 322 if (numEccBytes >= 1)
324 eccVal = REG_UMI_BCH_WR_ECC_0; 323 eccVal = readl(&REG_UMI_BCH_WR_ECC_0);
325 324
326 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 4, &oobp[12], 325 NAND_BCM_UMI_ECC_WRITE(numEccBytes, 4, &oobp[12],
327 (eccVal >> 24) & 0xff); /* ECC3 */ 326 (eccVal >> 24) & 0xff); /* ECC3 */
diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index a86aa812ca13..9ee0c4edfacf 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -31,7 +31,7 @@
31#include <linux/mtd/partitions.h> 31#include <linux/mtd/partitions.h>
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/slab.h> 33#include <linux/slab.h>
34#include <mach/nand.h> 34#include <linux/platform_data/mtd-nomadik-nand.h>
35#include <mach/fsmc.h> 35#include <mach/fsmc.h>
36 36
37#include <mtd/mtd-abi.h> 37#include <mtd/mtd-abi.h>
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 27293e328517..fc8111278d12 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -29,7 +29,7 @@
29 29
30#include <plat/dma.h> 30#include <plat/dma.h>
31#include <plat/gpmc.h> 31#include <plat/gpmc.h>
32#include <plat/nand.h> 32#include <linux/platform_data/mtd-nand-omap2.h>
33 33
34#define DRIVER_NAME "omap2-nand" 34#define DRIVER_NAME "omap2-nand"
35#define OMAP_NAND_TIMEOUT_MS 5000 35#define OMAP_NAND_TIMEOUT_MS 5000
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index fc5a868c436e..131b58a133f1 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -22,7 +22,7 @@
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/sizes.h> 23#include <asm/sizes.h>
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <plat/orion_nand.h> 25#include <linux/platform_data/mtd-orion_nand.h>
26 26
27static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) 27static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
28{ 28{
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 252aaefcacfa..c45227173efd 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -22,9 +22,11 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/of.h>
26#include <linux/of_device.h>
25 27
26#include <mach/dma.h> 28#include <mach/dma.h>
27#include <plat/pxa3xx_nand.h> 29#include <linux/platform_data/mtd-nand-pxa3xx.h>
28 30
29#define CHIP_DELAY_TIMEOUT (2 * HZ/10) 31#define CHIP_DELAY_TIMEOUT (2 * HZ/10)
30#define NAND_STOP_DELAY (2 * HZ/50) 32#define NAND_STOP_DELAY (2 * HZ/50)
@@ -1032,7 +1034,7 @@ static int alloc_nand_resource(struct platform_device *pdev)
1032 struct pxa3xx_nand_platform_data *pdata; 1034 struct pxa3xx_nand_platform_data *pdata;
1033 struct pxa3xx_nand_info *info; 1035 struct pxa3xx_nand_info *info;
1034 struct pxa3xx_nand_host *host; 1036 struct pxa3xx_nand_host *host;
1035 struct nand_chip *chip; 1037 struct nand_chip *chip = NULL;
1036 struct mtd_info *mtd; 1038 struct mtd_info *mtd;
1037 struct resource *r; 1039 struct resource *r;
1038 int ret, irq, cs; 1040 int ret, irq, cs;
@@ -1081,21 +1083,31 @@ static int alloc_nand_resource(struct platform_device *pdev)
1081 } 1083 }
1082 clk_enable(info->clk); 1084 clk_enable(info->clk);
1083 1085
1084 r = platform_get_resource(pdev, IORESOURCE_DMA, 0); 1086 /*
1085 if (r == NULL) { 1087 * This is a dirty hack to make this driver work from devicetree
1086 dev_err(&pdev->dev, "no resource defined for data DMA\n"); 1088 * bindings. It can be removed once we have a prober DMA controller
1087 ret = -ENXIO; 1089 * framework for DT.
1088 goto fail_put_clk; 1090 */
1089 } 1091 if (pdev->dev.of_node && cpu_is_pxa3xx()) {
1090 info->drcmr_dat = r->start; 1092 info->drcmr_dat = 97;
1093 info->drcmr_cmd = 99;
1094 } else {
1095 r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
1096 if (r == NULL) {
1097 dev_err(&pdev->dev, "no resource defined for data DMA\n");
1098 ret = -ENXIO;
1099 goto fail_put_clk;
1100 }
1101 info->drcmr_dat = r->start;
1091 1102
1092 r = platform_get_resource(pdev, IORESOURCE_DMA, 1); 1103 r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
1093 if (r == NULL) { 1104 if (r == NULL) {
1094 dev_err(&pdev->dev, "no resource defined for command DMA\n"); 1105 dev_err(&pdev->dev, "no resource defined for command DMA\n");
1095 ret = -ENXIO; 1106 ret = -ENXIO;
1096 goto fail_put_clk; 1107 goto fail_put_clk;
1108 }
1109 info->drcmr_cmd = r->start;
1097 } 1110 }
1098 info->drcmr_cmd = r->start;
1099 1111
1100 irq = platform_get_irq(pdev, 0); 1112 irq = platform_get_irq(pdev, 0);
1101 if (irq < 0) { 1113 if (irq < 0) {
@@ -1200,12 +1212,55 @@ static int pxa3xx_nand_remove(struct platform_device *pdev)
1200 return 0; 1212 return 0;
1201} 1213}
1202 1214
1215#ifdef CONFIG_OF
1216static struct of_device_id pxa3xx_nand_dt_ids[] = {
1217 { .compatible = "marvell,pxa3xx-nand" },
1218 {}
1219};
1220MODULE_DEVICE_TABLE(of, i2c_pxa_dt_ids);
1221
1222static int pxa3xx_nand_probe_dt(struct platform_device *pdev)
1223{
1224 struct pxa3xx_nand_platform_data *pdata;
1225 struct device_node *np = pdev->dev.of_node;
1226 const struct of_device_id *of_id =
1227 of_match_device(pxa3xx_nand_dt_ids, &pdev->dev);
1228
1229 if (!of_id)
1230 return 0;
1231
1232 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
1233 if (!pdata)
1234 return -ENOMEM;
1235
1236 if (of_get_property(np, "marvell,nand-enable-arbiter", NULL))
1237 pdata->enable_arbiter = 1;
1238 if (of_get_property(np, "marvell,nand-keep-config", NULL))
1239 pdata->keep_config = 1;
1240 of_property_read_u32(np, "num-cs", &pdata->num_cs);
1241
1242 pdev->dev.platform_data = pdata;
1243
1244 return 0;
1245}
1246#else
1247static inline int pxa3xx_nand_probe_dt(struct platform_device *pdev)
1248{
1249 return 0;
1250}
1251#endif
1252
1203static int pxa3xx_nand_probe(struct platform_device *pdev) 1253static int pxa3xx_nand_probe(struct platform_device *pdev)
1204{ 1254{
1205 struct pxa3xx_nand_platform_data *pdata; 1255 struct pxa3xx_nand_platform_data *pdata;
1256 struct mtd_part_parser_data ppdata = {};
1206 struct pxa3xx_nand_info *info; 1257 struct pxa3xx_nand_info *info;
1207 int ret, cs, probe_success; 1258 int ret, cs, probe_success;
1208 1259
1260 ret = pxa3xx_nand_probe_dt(pdev);
1261 if (ret)
1262 return ret;
1263
1209 pdata = pdev->dev.platform_data; 1264 pdata = pdev->dev.platform_data;
1210 if (!pdata) { 1265 if (!pdata) {
1211 dev_err(&pdev->dev, "no platform data defined\n"); 1266 dev_err(&pdev->dev, "no platform data defined\n");
@@ -1229,8 +1284,9 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
1229 continue; 1284 continue;
1230 } 1285 }
1231 1286
1287 ppdata.of_node = pdev->dev.of_node;
1232 ret = mtd_device_parse_register(info->host[cs]->mtd, NULL, 1288 ret = mtd_device_parse_register(info->host[cs]->mtd, NULL,
1233 NULL, pdata->parts[cs], 1289 &ppdata, pdata->parts[cs],
1234 pdata->nr_parts[cs]); 1290 pdata->nr_parts[cs]);
1235 if (!ret) 1291 if (!ret)
1236 probe_success = 1; 1292 probe_success = 1;
@@ -1306,6 +1362,7 @@ static int pxa3xx_nand_resume(struct platform_device *pdev)
1306static struct platform_driver pxa3xx_nand_driver = { 1362static struct platform_driver pxa3xx_nand_driver = {
1307 .driver = { 1363 .driver = {
1308 .name = "pxa3xx-nand", 1364 .name = "pxa3xx-nand",
1365 .of_match_table = of_match_ptr(pxa3xx_nand_dt_ids),
1309 }, 1366 },
1310 .probe = pxa3xx_nand_probe, 1367 .probe = pxa3xx_nand_probe,
1311 .remove = pxa3xx_nand_remove, 1368 .remove = pxa3xx_nand_remove,
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 91121f33f743..d8040619ad8d 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -46,7 +46,7 @@
46#include <asm/io.h> 46#include <asm/io.h>
47 47
48#include <plat/regs-nand.h> 48#include <plat/regs-nand.h>
49#include <plat/nand.h> 49#include <linux/platform_data/mtd-nand-s3c2410.h>
50 50
51#ifdef CONFIG_MTD_NAND_S3C2410_HWECC 51#ifdef CONFIG_MTD_NAND_S3C2410_HWECC
52static int hardware_ecc = 1; 52static int hardware_ecc = 1;
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 9d49b1f4ff53..1961be985171 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -39,7 +39,7 @@
39 39
40#include <asm/mach/flash.h> 40#include <asm/mach/flash.h>
41#include <plat/gpmc.h> 41#include <plat/gpmc.h>
42#include <plat/onenand.h> 42#include <linux/platform_data/mtd-onenand-omap2.h>
43#include <asm/gpio.h> 43#include <asm/gpio.h>
44 44
45#include <plat/dma.h> 45#include <plat/dma.h>
diff --git a/drivers/net/ethernet/netx-eth.c b/drivers/net/ethernet/netx-eth.c
index 9d11ab7521bc..63e7af44366f 100644
--- a/drivers/net/ethernet/netx-eth.c
+++ b/drivers/net/ethernet/netx-eth.c
@@ -34,7 +34,7 @@
34#include <mach/netx-regs.h> 34#include <mach/netx-regs.h>
35#include <mach/pfifo.h> 35#include <mach/pfifo.h>
36#include <mach/xc.h> 36#include <mach/xc.h>
37#include <mach/eth.h> 37#include <linux/platform_data/eth-netx.h>
38 38
39/* XC Fifo Offsets */ 39/* XC Fifo Offsets */
40#define EMPTY_PTR_FIFO(xcno) (0 + ((xcno) << 3)) /* Index of the empty pointer FIFO */ 40#define EMPTY_PTR_FIFO(xcno) (0 + ((xcno) << 3)) /* Index of the empty pointer FIFO */
diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c
index df808ac8cb65..6a40dd03a32f 100644
--- a/drivers/net/ethernet/seeq/ether3.c
+++ b/drivers/net/ethernet/seeq/ether3.c
@@ -99,13 +99,13 @@ typedef enum {
99 * The SEEQ8005 doesn't like us writing to its registers 99 * The SEEQ8005 doesn't like us writing to its registers
100 * too quickly. 100 * too quickly.
101 */ 101 */
102static inline void ether3_outb(int v, const void __iomem *r) 102static inline void ether3_outb(int v, void __iomem *r)
103{ 103{
104 writeb(v, r); 104 writeb(v, r);
105 udelay(1); 105 udelay(1);
106} 106}
107 107
108static inline void ether3_outw(int v, const void __iomem *r) 108static inline void ether3_outw(int v, void __iomem *r)
109{ 109{
110 writew(v, r); 110 writew(v, r);
111 udelay(1); 111 udelay(1);
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index 8d5476707912..002a442bf73f 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -28,9 +28,9 @@
28#include <net/irda/irda_device.h> 28#include <net/irda/irda_device.h>
29 29
30#include <mach/dma.h> 30#include <mach/dma.h>
31#include <mach/irda.h> 31#include <linux/platform_data/irda-pxaficp.h>
32#include <mach/regs-uart.h>
33#include <mach/regs-ost.h> 32#include <mach/regs-ost.h>
33#include <mach/regs-uart.h>
34 34
35#define FICP __REG(0x40800000) /* Start of FICP area */ 35#define FICP __REG(0x40800000) /* Start of FICP area */
36#define ICCR0 __REG(0x40800000) /* ICP Control Register 0 */ 36#define ICCR0 __REG(0x40800000) /* ICP Control Register 0 */
@@ -112,6 +112,9 @@ struct pxa_irda {
112 int txdma; 112 int txdma;
113 int rxdma; 113 int rxdma;
114 114
115 int uart_irq;
116 int icp_irq;
117
115 struct irlap_cb *irlap; 118 struct irlap_cb *irlap;
116 struct qos_info qos; 119 struct qos_info qos;
117 120
@@ -672,19 +675,19 @@ static int pxa_irda_start(struct net_device *dev)
672 675
673 si->speed = 9600; 676 si->speed = 9600;
674 677
675 err = request_irq(IRQ_STUART, pxa_irda_sir_irq, 0, dev->name, dev); 678 err = request_irq(si->uart_irq, pxa_irda_sir_irq, 0, dev->name, dev);
676 if (err) 679 if (err)
677 goto err_irq1; 680 goto err_irq1;
678 681
679 err = request_irq(IRQ_ICP, pxa_irda_fir_irq, 0, dev->name, dev); 682 err = request_irq(si->icp_irq, pxa_irda_fir_irq, 0, dev->name, dev);
680 if (err) 683 if (err)
681 goto err_irq2; 684 goto err_irq2;
682 685
683 /* 686 /*
684 * The interrupt must remain disabled for now. 687 * The interrupt must remain disabled for now.
685 */ 688 */
686 disable_irq(IRQ_STUART); 689 disable_irq(si->uart_irq);
687 disable_irq(IRQ_ICP); 690 disable_irq(si->icp_irq);
688 691
689 err = -EBUSY; 692 err = -EBUSY;
690 si->rxdma = pxa_request_dma("FICP_RX",DMA_PRIO_LOW, pxa_irda_fir_dma_rx_irq, dev); 693 si->rxdma = pxa_request_dma("FICP_RX",DMA_PRIO_LOW, pxa_irda_fir_dma_rx_irq, dev);
@@ -720,8 +723,8 @@ static int pxa_irda_start(struct net_device *dev)
720 /* 723 /*
721 * Now enable the interrupt and start the queue 724 * Now enable the interrupt and start the queue
722 */ 725 */
723 enable_irq(IRQ_STUART); 726 enable_irq(si->uart_irq);
724 enable_irq(IRQ_ICP); 727 enable_irq(si->icp_irq);
725 netif_start_queue(dev); 728 netif_start_queue(dev);
726 729
727 printk(KERN_DEBUG "pxa_ir: irda driver opened\n"); 730 printk(KERN_DEBUG "pxa_ir: irda driver opened\n");
@@ -738,9 +741,9 @@ err_dma_rx_buff:
738err_tx_dma: 741err_tx_dma:
739 pxa_free_dma(si->rxdma); 742 pxa_free_dma(si->rxdma);
740err_rx_dma: 743err_rx_dma:
741 free_irq(IRQ_ICP, dev); 744 free_irq(si->icp_irq, dev);
742err_irq2: 745err_irq2:
743 free_irq(IRQ_STUART, dev); 746 free_irq(si->uart_irq, dev);
744err_irq1: 747err_irq1:
745 748
746 return err; 749 return err;
@@ -760,8 +763,8 @@ static int pxa_irda_stop(struct net_device *dev)
760 si->irlap = NULL; 763 si->irlap = NULL;
761 } 764 }
762 765
763 free_irq(IRQ_STUART, dev); 766 free_irq(si->uart_irq, dev);
764 free_irq(IRQ_ICP, dev); 767 free_irq(si->icp_irq, dev);
765 768
766 pxa_free_dma(si->rxdma); 769 pxa_free_dma(si->rxdma);
767 pxa_free_dma(si->txdma); 770 pxa_free_dma(si->txdma);
@@ -851,6 +854,9 @@ static int pxa_irda_probe(struct platform_device *pdev)
851 si->dev = &pdev->dev; 854 si->dev = &pdev->dev;
852 si->pdata = pdev->dev.platform_data; 855 si->pdata = pdev->dev.platform_data;
853 856
857 si->uart_irq = platform_get_irq(pdev, 0);
858 si->icp_irq = platform_get_irq(pdev, 1);
859
854 si->sir_clk = clk_get(&pdev->dev, "UARTCLK"); 860 si->sir_clk = clk_get(&pdev->dev, "UARTCLK");
855 si->fir_clk = clk_get(&pdev->dev, "FICPCLK"); 861 si->fir_clk = clk_get(&pdev->dev, "FICPCLK");
856 if (IS_ERR(si->sir_clk) || IS_ERR(si->fir_clk)) { 862 if (IS_ERR(si->sir_clk) || IS_ERR(si->fir_clk)) {
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 0ad06a3bd562..fa74efe82206 100644
--- a/drivers/pcmcia/omap_cf.c
+++ b/drivers/pcmcia/omap_cf.c
@@ -24,7 +24,7 @@
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/sizes.h> 25#include <asm/sizes.h>
26 26
27#include <plat/mux.h> 27#include <mach/mux.h>
28#include <plat/tc.h> 28#include <plat/tc.h>
29 29
30 30
diff --git a/drivers/pcmcia/pxa2xx_viper.c b/drivers/pcmcia/pxa2xx_viper.c
index cb0c37ec7f24..a76f495953ab 100644
--- a/drivers/pcmcia/pxa2xx_viper.c
+++ b/drivers/pcmcia/pxa2xx_viper.c
@@ -25,7 +25,7 @@
25 25
26#include <asm/irq.h> 26#include <asm/irq.h>
27 27
28#include <mach/arcom-pcmcia.h> 28#include <linux/platform_data/pcmcia-pxa2xx_viper.h>
29 29
30#include "soc_common.h" 30#include "soc_common.h"
31#include "pxa2xx_base.h" 31#include "pxa2xx_base.h"
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 54e3588bef62..a75414496369 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -145,6 +145,28 @@ config PINCTRL_COH901
145 COH 901 335 and COH 901 571/3. They contain 3, 5 or 7 145 COH 901 335 and COH 901 571/3. They contain 3, 5 or 7
146 ports of 8 GPIO pins each. 146 ports of 8 GPIO pins each.
147 147
148config PINCTRL_MVEBU
149 bool
150 depends on ARCH_MVEBU
151 select PINMUX
152 select PINCONF
153
154config PINCTRL_DOVE
155 bool
156 select PINCTRL_MVEBU
157
158config PINCTRL_KIRKWOOD
159 bool
160 select PINCTRL_MVEBU
161
162config PINCTRL_ARMADA_370
163 bool
164 select PINCTRL_MVEBU
165
166config PINCTRL_ARMADA_XP
167 bool
168 select PINCTRL_MVEBU
169
148source "drivers/pinctrl/spear/Kconfig" 170source "drivers/pinctrl/spear/Kconfig"
149 171
150endmenu 172endmenu
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index f40b1f81ff2c..f2ea0504efc7 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -29,5 +29,10 @@ obj-$(CONFIG_PINCTRL_TEGRA20) += pinctrl-tegra20.o
29obj-$(CONFIG_PINCTRL_TEGRA30) += pinctrl-tegra30.o 29obj-$(CONFIG_PINCTRL_TEGRA30) += pinctrl-tegra30.o
30obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o 30obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o
31obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o 31obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o
32obj-$(CONFIG_PINCTRL_MVEBU) += pinctrl-mvebu.o
33obj-$(CONFIG_PINCTRL_DOVE) += pinctrl-dove.o
34obj-$(CONFIG_PINCTRL_KIRKWOOD) += pinctrl-kirkwood.o
35obj-$(CONFIG_PINCTRL_ARMADA_370) += pinctrl-armada-370.o
36obj-$(CONFIG_PINCTRL_ARMADA_XP) += pinctrl-armada-xp.o
32 37
33obj-$(CONFIG_PLAT_SPEAR) += spear/ 38obj-$(CONFIG_PLAT_SPEAR) += spear/
diff --git a/drivers/pinctrl/pinctrl-armada-370.c b/drivers/pinctrl/pinctrl-armada-370.c
new file mode 100644
index 000000000000..c907647de6ad
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-armada-370.c
@@ -0,0 +1,421 @@
1/*
2 * Marvell Armada 370 pinctrl driver based on mvebu pinctrl core
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.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
14#include <linux/err.h>
15#include <linux/init.h>
16#include <linux/io.h>
17#include <linux/module.h>
18#include <linux/platform_device.h>
19#include <linux/clk.h>
20#include <linux/of.h>
21#include <linux/of_device.h>
22#include <linux/pinctrl/pinctrl.h>
23
24#include "pinctrl-mvebu.h"
25
26static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
27 MPP_MODE(0,
28 MPP_FUNCTION(0x0, "gpio", NULL),
29 MPP_FUNCTION(0x1, "uart0", "rxd")),
30 MPP_MODE(1,
31 MPP_FUNCTION(0x0, "gpo", NULL),
32 MPP_FUNCTION(0x1, "uart0", "txd")),
33 MPP_MODE(2,
34 MPP_FUNCTION(0x0, "gpio", NULL),
35 MPP_FUNCTION(0x1, "i2c0", "sck"),
36 MPP_FUNCTION(0x2, "uart0", "txd")),
37 MPP_MODE(3,
38 MPP_FUNCTION(0x0, "gpio", NULL),
39 MPP_FUNCTION(0x1, "i2c0", "sda"),
40 MPP_FUNCTION(0x2, "uart0", "rxd")),
41 MPP_MODE(4,
42 MPP_FUNCTION(0x0, "gpio", NULL),
43 MPP_FUNCTION(0x1, "cpu_pd", "vdd")),
44 MPP_MODE(5,
45 MPP_FUNCTION(0x0, "gpo", NULL),
46 MPP_FUNCTION(0x1, "ge0", "txclko"),
47 MPP_FUNCTION(0x2, "uart1", "txd"),
48 MPP_FUNCTION(0x4, "spi1", "clk"),
49 MPP_FUNCTION(0x5, "audio", "mclk")),
50 MPP_MODE(6,
51 MPP_FUNCTION(0x0, "gpio", NULL),
52 MPP_FUNCTION(0x1, "ge0", "txd0"),
53 MPP_FUNCTION(0x2, "sata0", "prsnt"),
54 MPP_FUNCTION(0x4, "tdm", "rst"),
55 MPP_FUNCTION(0x5, "audio", "sdo")),
56 MPP_MODE(7,
57 MPP_FUNCTION(0x0, "gpo", NULL),
58 MPP_FUNCTION(0x1, "ge0", "txd1"),
59 MPP_FUNCTION(0x4, "tdm", "tdx"),
60 MPP_FUNCTION(0x5, "audio", "lrclk")),
61 MPP_MODE(8,
62 MPP_FUNCTION(0x0, "gpio", NULL),
63 MPP_FUNCTION(0x1, "ge0", "txd2"),
64 MPP_FUNCTION(0x2, "uart0", "rts"),
65 MPP_FUNCTION(0x4, "tdm", "drx"),
66 MPP_FUNCTION(0x5, "audio", "bclk")),
67 MPP_MODE(9,
68 MPP_FUNCTION(0x0, "gpo", NULL),
69 MPP_FUNCTION(0x1, "ge0", "txd3"),
70 MPP_FUNCTION(0x2, "uart1", "txd"),
71 MPP_FUNCTION(0x3, "sd0", "clk"),
72 MPP_FUNCTION(0x5, "audio", "spdifo")),
73 MPP_MODE(10,
74 MPP_FUNCTION(0x0, "gpio", NULL),
75 MPP_FUNCTION(0x1, "ge0", "txctl"),
76 MPP_FUNCTION(0x2, "uart0", "cts"),
77 MPP_FUNCTION(0x4, "tdm", "fsync"),
78 MPP_FUNCTION(0x5, "audio", "sdi")),
79 MPP_MODE(11,
80 MPP_FUNCTION(0x0, "gpio", NULL),
81 MPP_FUNCTION(0x1, "ge0", "rxd0"),
82 MPP_FUNCTION(0x2, "uart1", "rxd"),
83 MPP_FUNCTION(0x3, "sd0", "cmd"),
84 MPP_FUNCTION(0x4, "spi0", "cs1"),
85 MPP_FUNCTION(0x5, "sata1", "prsnt"),
86 MPP_FUNCTION(0x6, "spi1", "cs1")),
87 MPP_MODE(12,
88 MPP_FUNCTION(0x0, "gpio", NULL),
89 MPP_FUNCTION(0x1, "ge0", "rxd1"),
90 MPP_FUNCTION(0x2, "i2c1", "sda"),
91 MPP_FUNCTION(0x3, "sd0", "d0"),
92 MPP_FUNCTION(0x4, "spi1", "cs0"),
93 MPP_FUNCTION(0x5, "audio", "spdifi")),
94 MPP_MODE(13,
95 MPP_FUNCTION(0x0, "gpio", NULL),
96 MPP_FUNCTION(0x1, "ge0", "rxd2"),
97 MPP_FUNCTION(0x2, "i2c1", "sck"),
98 MPP_FUNCTION(0x3, "sd0", "d1"),
99 MPP_FUNCTION(0x4, "tdm", "pclk"),
100 MPP_FUNCTION(0x5, "audio", "rmclk")),
101 MPP_MODE(14,
102 MPP_FUNCTION(0x0, "gpio", NULL),
103 MPP_FUNCTION(0x1, "ge0", "rxd3"),
104 MPP_FUNCTION(0x2, "pcie", "clkreq0"),
105 MPP_FUNCTION(0x3, "sd0", "d2"),
106 MPP_FUNCTION(0x4, "spi1", "mosi"),
107 MPP_FUNCTION(0x5, "spi0", "cs2")),
108 MPP_MODE(15,
109 MPP_FUNCTION(0x0, "gpio", NULL),
110 MPP_FUNCTION(0x1, "ge0", "rxctl"),
111 MPP_FUNCTION(0x2, "pcie", "clkreq1"),
112 MPP_FUNCTION(0x3, "sd0", "d3"),
113 MPP_FUNCTION(0x4, "spi1", "miso"),
114 MPP_FUNCTION(0x5, "spi0", "cs3")),
115 MPP_MODE(16,
116 MPP_FUNCTION(0x0, "gpio", NULL),
117 MPP_FUNCTION(0x1, "ge0", "rxclk"),
118 MPP_FUNCTION(0x2, "uart1", "rxd"),
119 MPP_FUNCTION(0x4, "tdm", "int"),
120 MPP_FUNCTION(0x5, "audio", "extclk")),
121 MPP_MODE(17,
122 MPP_FUNCTION(0x0, "gpo", NULL),
123 MPP_FUNCTION(0x1, "ge", "mdc")),
124 MPP_MODE(18,
125 MPP_FUNCTION(0x0, "gpio", NULL),
126 MPP_FUNCTION(0x1, "ge", "mdio")),
127 MPP_MODE(19,
128 MPP_FUNCTION(0x0, "gpio", NULL),
129 MPP_FUNCTION(0x1, "ge0", "txclk"),
130 MPP_FUNCTION(0x2, "ge1", "txclkout"),
131 MPP_FUNCTION(0x4, "tdm", "pclk")),
132 MPP_MODE(20,
133 MPP_FUNCTION(0x0, "gpo", NULL),
134 MPP_FUNCTION(0x1, "ge0", "txd4"),
135 MPP_FUNCTION(0x2, "ge1", "txd0")),
136 MPP_MODE(21,
137 MPP_FUNCTION(0x0, "gpo", NULL),
138 MPP_FUNCTION(0x1, "ge0", "txd5"),
139 MPP_FUNCTION(0x2, "ge1", "txd1"),
140 MPP_FUNCTION(0x4, "uart1", "txd")),
141 MPP_MODE(22,
142 MPP_FUNCTION(0x0, "gpo", NULL),
143 MPP_FUNCTION(0x1, "ge0", "txd6"),
144 MPP_FUNCTION(0x2, "ge1", "txd2"),
145 MPP_FUNCTION(0x4, "uart0", "rts")),
146 MPP_MODE(23,
147 MPP_FUNCTION(0x0, "gpo", NULL),
148 MPP_FUNCTION(0x1, "ge0", "txd7"),
149 MPP_FUNCTION(0x2, "ge1", "txd3"),
150 MPP_FUNCTION(0x4, "spi1", "mosi")),
151 MPP_MODE(24,
152 MPP_FUNCTION(0x0, "gpio", NULL),
153 MPP_FUNCTION(0x1, "ge0", "col"),
154 MPP_FUNCTION(0x2, "ge1", "txctl"),
155 MPP_FUNCTION(0x4, "spi1", "cs0")),
156 MPP_MODE(25,
157 MPP_FUNCTION(0x0, "gpio", NULL),
158 MPP_FUNCTION(0x1, "ge0", "rxerr"),
159 MPP_FUNCTION(0x2, "ge1", "rxd0"),
160 MPP_FUNCTION(0x4, "uart1", "rxd")),
161 MPP_MODE(26,
162 MPP_FUNCTION(0x0, "gpio", NULL),
163 MPP_FUNCTION(0x1, "ge0", "crs"),
164 MPP_FUNCTION(0x2, "ge1", "rxd1"),
165 MPP_FUNCTION(0x4, "spi1", "miso")),
166 MPP_MODE(27,
167 MPP_FUNCTION(0x0, "gpio", NULL),
168 MPP_FUNCTION(0x1, "ge0", "rxd4"),
169 MPP_FUNCTION(0x2, "ge1", "rxd2"),
170 MPP_FUNCTION(0x4, "uart0", "cts")),
171 MPP_MODE(28,
172 MPP_FUNCTION(0x0, "gpio", NULL),
173 MPP_FUNCTION(0x1, "ge0", "rxd5"),
174 MPP_FUNCTION(0x2, "ge1", "rxd3")),
175 MPP_MODE(29,
176 MPP_FUNCTION(0x0, "gpio", NULL),
177 MPP_FUNCTION(0x1, "ge0", "rxd6"),
178 MPP_FUNCTION(0x2, "ge1", "rxctl"),
179 MPP_FUNCTION(0x4, "i2c1", "sda")),
180 MPP_MODE(30,
181 MPP_FUNCTION(0x0, "gpio", NULL),
182 MPP_FUNCTION(0x1, "ge0", "rxd7"),
183 MPP_FUNCTION(0x2, "ge1", "rxclk"),
184 MPP_FUNCTION(0x4, "i2c1", "sck")),
185 MPP_MODE(31,
186 MPP_FUNCTION(0x0, "gpio", NULL),
187 MPP_FUNCTION(0x3, "tclk", NULL),
188 MPP_FUNCTION(0x4, "ge0", "txerr")),
189 MPP_MODE(32,
190 MPP_FUNCTION(0x0, "gpio", NULL),
191 MPP_FUNCTION(0x1, "spi0", "cs0")),
192 MPP_MODE(33,
193 MPP_FUNCTION(0x0, "gpio", NULL),
194 MPP_FUNCTION(0x1, "dev", "bootcs"),
195 MPP_FUNCTION(0x2, "spi0", "cs0")),
196 MPP_MODE(34,
197 MPP_FUNCTION(0x0, "gpo", NULL),
198 MPP_FUNCTION(0x1, "dev", "wen0"),
199 MPP_FUNCTION(0x2, "spi0", "mosi")),
200 MPP_MODE(35,
201 MPP_FUNCTION(0x0, "gpo", NULL),
202 MPP_FUNCTION(0x1, "dev", "oen"),
203 MPP_FUNCTION(0x2, "spi0", "sck")),
204 MPP_MODE(36,
205 MPP_FUNCTION(0x0, "gpo", NULL),
206 MPP_FUNCTION(0x1, "dev", "a1"),
207 MPP_FUNCTION(0x2, "spi0", "miso")),
208 MPP_MODE(37,
209 MPP_FUNCTION(0x0, "gpo", NULL),
210 MPP_FUNCTION(0x1, "dev", "a0"),
211 MPP_FUNCTION(0x2, "sata0", "prsnt")),
212 MPP_MODE(38,
213 MPP_FUNCTION(0x0, "gpio", NULL),
214 MPP_FUNCTION(0x1, "dev", "ready"),
215 MPP_FUNCTION(0x2, "uart1", "cts"),
216 MPP_FUNCTION(0x3, "uart0", "cts")),
217 MPP_MODE(39,
218 MPP_FUNCTION(0x0, "gpo", NULL),
219 MPP_FUNCTION(0x1, "dev", "ad0"),
220 MPP_FUNCTION(0x2, "audio", "spdifo")),
221 MPP_MODE(40,
222 MPP_FUNCTION(0x0, "gpio", NULL),
223 MPP_FUNCTION(0x1, "dev", "ad1"),
224 MPP_FUNCTION(0x2, "uart1", "rts"),
225 MPP_FUNCTION(0x3, "uart0", "rts")),
226 MPP_MODE(41,
227 MPP_FUNCTION(0x0, "gpio", NULL),
228 MPP_FUNCTION(0x1, "dev", "ad2"),
229 MPP_FUNCTION(0x2, "uart1", "rxd")),
230 MPP_MODE(42,
231 MPP_FUNCTION(0x0, "gpo", NULL),
232 MPP_FUNCTION(0x1, "dev", "ad3"),
233 MPP_FUNCTION(0x2, "uart1", "txd")),
234 MPP_MODE(43,
235 MPP_FUNCTION(0x0, "gpo", NULL),
236 MPP_FUNCTION(0x1, "dev", "ad4"),
237 MPP_FUNCTION(0x2, "audio", "bclk")),
238 MPP_MODE(44,
239 MPP_FUNCTION(0x0, "gpo", NULL),
240 MPP_FUNCTION(0x1, "dev", "ad5"),
241 MPP_FUNCTION(0x2, "audio", "mclk")),
242 MPP_MODE(45,
243 MPP_FUNCTION(0x0, "gpo", NULL),
244 MPP_FUNCTION(0x1, "dev", "ad6"),
245 MPP_FUNCTION(0x2, "audio", "lrclk")),
246 MPP_MODE(46,
247 MPP_FUNCTION(0x0, "gpo", NULL),
248 MPP_FUNCTION(0x1, "dev", "ad7"),
249 MPP_FUNCTION(0x2, "audio", "sdo")),
250 MPP_MODE(47,
251 MPP_FUNCTION(0x0, "gpo", NULL),
252 MPP_FUNCTION(0x1, "dev", "ad8"),
253 MPP_FUNCTION(0x3, "sd0", "clk"),
254 MPP_FUNCTION(0x5, "audio", "spdifo")),
255 MPP_MODE(48,
256 MPP_FUNCTION(0x0, "gpio", NULL),
257 MPP_FUNCTION(0x1, "dev", "ad9"),
258 MPP_FUNCTION(0x2, "uart0", "rts"),
259 MPP_FUNCTION(0x3, "sd0", "cmd"),
260 MPP_FUNCTION(0x4, "sata1", "prsnt"),
261 MPP_FUNCTION(0x5, "spi0", "cs1")),
262 MPP_MODE(49,
263 MPP_FUNCTION(0x0, "gpio", NULL),
264 MPP_FUNCTION(0x1, "dev", "ad10"),
265 MPP_FUNCTION(0x2, "pcie", "clkreq1"),
266 MPP_FUNCTION(0x3, "sd0", "d0"),
267 MPP_FUNCTION(0x4, "spi1", "cs0"),
268 MPP_FUNCTION(0x5, "audio", "spdifi")),
269 MPP_MODE(50,
270 MPP_FUNCTION(0x0, "gpio", NULL),
271 MPP_FUNCTION(0x1, "dev", "ad11"),
272 MPP_FUNCTION(0x2, "uart0", "cts"),
273 MPP_FUNCTION(0x3, "sd0", "d1"),
274 MPP_FUNCTION(0x4, "spi1", "miso"),
275 MPP_FUNCTION(0x5, "audio", "rmclk")),
276 MPP_MODE(51,
277 MPP_FUNCTION(0x0, "gpio", NULL),
278 MPP_FUNCTION(0x1, "dev", "ad12"),
279 MPP_FUNCTION(0x2, "i2c1", "sda"),
280 MPP_FUNCTION(0x3, "sd0", "d2"),
281 MPP_FUNCTION(0x4, "spi1", "mosi")),
282 MPP_MODE(52,
283 MPP_FUNCTION(0x0, "gpio", NULL),
284 MPP_FUNCTION(0x1, "dev", "ad13"),
285 MPP_FUNCTION(0x2, "i2c1", "sck"),
286 MPP_FUNCTION(0x3, "sd0", "d3"),
287 MPP_FUNCTION(0x4, "spi1", "sck")),
288 MPP_MODE(53,
289 MPP_FUNCTION(0x0, "gpio", NULL),
290 MPP_FUNCTION(0x1, "dev", "ad14"),
291 MPP_FUNCTION(0x2, "sd0", "clk"),
292 MPP_FUNCTION(0x3, "tdm", "pclk"),
293 MPP_FUNCTION(0x4, "spi0", "cs2"),
294 MPP_FUNCTION(0x5, "pcie", "clkreq1")),
295 MPP_MODE(54,
296 MPP_FUNCTION(0x0, "gpo", NULL),
297 MPP_FUNCTION(0x1, "dev", "ad15"),
298 MPP_FUNCTION(0x3, "tdm", "dtx")),
299 MPP_MODE(55,
300 MPP_FUNCTION(0x0, "gpio", NULL),
301 MPP_FUNCTION(0x1, "dev", "cs1"),
302 MPP_FUNCTION(0x2, "uart1", "txd"),
303 MPP_FUNCTION(0x3, "tdm", "rst"),
304 MPP_FUNCTION(0x4, "sata1", "prsnt"),
305 MPP_FUNCTION(0x5, "sata0", "prsnt")),
306 MPP_MODE(56,
307 MPP_FUNCTION(0x0, "gpio", NULL),
308 MPP_FUNCTION(0x1, "dev", "cs2"),
309 MPP_FUNCTION(0x2, "uart1", "cts"),
310 MPP_FUNCTION(0x3, "uart0", "cts"),
311 MPP_FUNCTION(0x4, "spi0", "cs3"),
312 MPP_FUNCTION(0x5, "pcie", "clkreq0"),
313 MPP_FUNCTION(0x6, "spi1", "cs1")),
314 MPP_MODE(57,
315 MPP_FUNCTION(0x0, "gpio", NULL),
316 MPP_FUNCTION(0x1, "dev", "cs3"),
317 MPP_FUNCTION(0x2, "uart1", "rxd"),
318 MPP_FUNCTION(0x3, "tdm", "fsync"),
319 MPP_FUNCTION(0x4, "sata0", "prsnt"),
320 MPP_FUNCTION(0x5, "audio", "sdo")),
321 MPP_MODE(58,
322 MPP_FUNCTION(0x0, "gpio", NULL),
323 MPP_FUNCTION(0x1, "dev", "cs0"),
324 MPP_FUNCTION(0x2, "uart1", "rts"),
325 MPP_FUNCTION(0x3, "tdm", "int"),
326 MPP_FUNCTION(0x5, "audio", "extclk"),
327 MPP_FUNCTION(0x6, "uart0", "rts")),
328 MPP_MODE(59,
329 MPP_FUNCTION(0x0, "gpo", NULL),
330 MPP_FUNCTION(0x1, "dev", "ale0"),
331 MPP_FUNCTION(0x2, "uart1", "rts"),
332 MPP_FUNCTION(0x3, "uart0", "rts"),
333 MPP_FUNCTION(0x5, "audio", "bclk")),
334 MPP_MODE(60,
335 MPP_FUNCTION(0x0, "gpio", NULL),
336 MPP_FUNCTION(0x1, "dev", "ale1"),
337 MPP_FUNCTION(0x2, "uart1", "rxd"),
338 MPP_FUNCTION(0x3, "sata0", "prsnt"),
339 MPP_FUNCTION(0x4, "pcie", "rst-out"),
340 MPP_FUNCTION(0x5, "audio", "sdi")),
341 MPP_MODE(61,
342 MPP_FUNCTION(0x0, "gpo", NULL),
343 MPP_FUNCTION(0x1, "dev", "wen1"),
344 MPP_FUNCTION(0x2, "uart1", "txd"),
345 MPP_FUNCTION(0x5, "audio", "rclk")),
346 MPP_MODE(62,
347 MPP_FUNCTION(0x0, "gpio", NULL),
348 MPP_FUNCTION(0x1, "dev", "a2"),
349 MPP_FUNCTION(0x2, "uart1", "cts"),
350 MPP_FUNCTION(0x3, "tdm", "drx"),
351 MPP_FUNCTION(0x4, "pcie", "clkreq0"),
352 MPP_FUNCTION(0x5, "audio", "mclk"),
353 MPP_FUNCTION(0x6, "uart0", "cts")),
354 MPP_MODE(63,
355 MPP_FUNCTION(0x0, "gpo", NULL),
356 MPP_FUNCTION(0x1, "spi0", "sck"),
357 MPP_FUNCTION(0x2, "tclk", NULL)),
358 MPP_MODE(64,
359 MPP_FUNCTION(0x0, "gpio", NULL),
360 MPP_FUNCTION(0x1, "spi0", "miso"),
361 MPP_FUNCTION(0x2, "spi0-1", "cs1")),
362 MPP_MODE(65,
363 MPP_FUNCTION(0x0, "gpio", NULL),
364 MPP_FUNCTION(0x1, "spi0", "mosi"),
365 MPP_FUNCTION(0x2, "spi0-1", "cs2")),
366};
367
368static struct mvebu_pinctrl_soc_info armada_370_pinctrl_info;
369
370static struct of_device_id armada_370_pinctrl_of_match[] __devinitdata = {
371 { .compatible = "marvell,mv88f6710-pinctrl" },
372 { },
373};
374
375static struct mvebu_mpp_ctrl mv88f6710_mpp_controls[] = {
376 MPP_REG_CTRL(0, 65),
377};
378
379static struct pinctrl_gpio_range mv88f6710_mpp_gpio_ranges[] = {
380 MPP_GPIO_RANGE(0, 0, 0, 32),
381 MPP_GPIO_RANGE(1, 32, 32, 32),
382 MPP_GPIO_RANGE(2, 64, 64, 2),
383};
384
385static int __devinit armada_370_pinctrl_probe(struct platform_device *pdev)
386{
387 struct mvebu_pinctrl_soc_info *soc = &armada_370_pinctrl_info;
388
389 soc->variant = 0; /* no variants for Armada 370 */
390 soc->controls = mv88f6710_mpp_controls;
391 soc->ncontrols = ARRAY_SIZE(mv88f6710_mpp_controls);
392 soc->modes = mv88f6710_mpp_modes;
393 soc->nmodes = ARRAY_SIZE(mv88f6710_mpp_modes);
394 soc->gpioranges = mv88f6710_mpp_gpio_ranges;
395 soc->ngpioranges = ARRAY_SIZE(mv88f6710_mpp_gpio_ranges);
396
397 pdev->dev.platform_data = soc;
398
399 return mvebu_pinctrl_probe(pdev);
400}
401
402static int __devexit armada_370_pinctrl_remove(struct platform_device *pdev)
403{
404 return mvebu_pinctrl_remove(pdev);
405}
406
407static struct platform_driver armada_370_pinctrl_driver = {
408 .driver = {
409 .name = "armada-370-pinctrl",
410 .owner = THIS_MODULE,
411 .of_match_table = of_match_ptr(armada_370_pinctrl_of_match),
412 },
413 .probe = armada_370_pinctrl_probe,
414 .remove = __devexit_p(armada_370_pinctrl_remove),
415};
416
417module_platform_driver(armada_370_pinctrl_driver);
418
419MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
420MODULE_DESCRIPTION("Marvell Armada 370 pinctrl driver");
421MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/pinctrl-armada-xp.c b/drivers/pinctrl/pinctrl-armada-xp.c
new file mode 100644
index 000000000000..40bd52a46b4e
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-armada-xp.c
@@ -0,0 +1,468 @@
1/*
2 * Marvell Armada XP pinctrl driver based on mvebu pinctrl core
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.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 file supports the three variants of Armada XP SoCs that are
14 * available: mv78230, mv78260 and mv78460. From a pin muxing
15 * perspective, the mv78230 has 49 MPP pins. The mv78260 and mv78460
16 * both have 67 MPP pins (more GPIOs and address lines for the memory
17 * bus mainly). The only difference between the mv78260 and the
18 * mv78460 in terms of pin muxing is the addition of two functions on
19 * pins 43 and 56 to access the VDD of the CPU2 and 3 (mv78260 has two
20 * cores, mv78460 has four cores).
21 */
22
23#include <linux/err.h>
24#include <linux/init.h>
25#include <linux/io.h>
26#include <linux/module.h>
27#include <linux/platform_device.h>
28#include <linux/clk.h>
29#include <linux/of.h>
30#include <linux/of_device.h>
31#include <linux/pinctrl/pinctrl.h>
32#include <linux/bitops.h>
33
34#include "pinctrl-mvebu.h"
35
36enum armada_xp_variant {
37 V_MV78230 = BIT(0),
38 V_MV78260 = BIT(1),
39 V_MV78460 = BIT(2),
40 V_MV78230_PLUS = (V_MV78230 | V_MV78260 | V_MV78460),
41 V_MV78260_PLUS = (V_MV78260 | V_MV78460),
42};
43
44static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
45 MPP_MODE(0,
46 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
47 MPP_VAR_FUNCTION(0x1, "ge0", "txclko", V_MV78230_PLUS),
48 MPP_VAR_FUNCTION(0x4, "lcd", "d0", V_MV78230_PLUS)),
49 MPP_MODE(1,
50 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
51 MPP_VAR_FUNCTION(0x1, "ge0", "txd0", V_MV78230_PLUS),
52 MPP_VAR_FUNCTION(0x4, "lcd", "d1", V_MV78230_PLUS)),
53 MPP_MODE(2,
54 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
55 MPP_VAR_FUNCTION(0x1, "ge0", "txd1", V_MV78230_PLUS),
56 MPP_VAR_FUNCTION(0x4, "lcd", "d2", V_MV78230_PLUS)),
57 MPP_MODE(3,
58 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
59 MPP_VAR_FUNCTION(0x1, "ge0", "txd2", V_MV78230_PLUS),
60 MPP_VAR_FUNCTION(0x4, "lcd", "d3", V_MV78230_PLUS)),
61 MPP_MODE(4,
62 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
63 MPP_VAR_FUNCTION(0x1, "ge0", "txd3", V_MV78230_PLUS),
64 MPP_VAR_FUNCTION(0x4, "lcd", "d4", V_MV78230_PLUS)),
65 MPP_MODE(5,
66 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
67 MPP_VAR_FUNCTION(0x1, "ge0", "txctl", V_MV78230_PLUS),
68 MPP_VAR_FUNCTION(0x4, "lcd", "d5", V_MV78230_PLUS)),
69 MPP_MODE(6,
70 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
71 MPP_VAR_FUNCTION(0x1, "ge0", "rxd0", V_MV78230_PLUS),
72 MPP_VAR_FUNCTION(0x4, "lcd", "d6", V_MV78230_PLUS)),
73 MPP_MODE(7,
74 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
75 MPP_VAR_FUNCTION(0x1, "ge0", "rxd1", V_MV78230_PLUS),
76 MPP_VAR_FUNCTION(0x4, "lcd", "d7", V_MV78230_PLUS)),
77 MPP_MODE(8,
78 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
79 MPP_VAR_FUNCTION(0x1, "ge0", "rxd2", V_MV78230_PLUS),
80 MPP_VAR_FUNCTION(0x4, "lcd", "d8", V_MV78230_PLUS)),
81 MPP_MODE(9,
82 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
83 MPP_VAR_FUNCTION(0x1, "ge0", "rxd3", V_MV78230_PLUS),
84 MPP_VAR_FUNCTION(0x4, "lcd", "d9", V_MV78230_PLUS)),
85 MPP_MODE(10,
86 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
87 MPP_VAR_FUNCTION(0x1, "ge0", "rxctl", V_MV78230_PLUS),
88 MPP_VAR_FUNCTION(0x4, "lcd", "d10", V_MV78230_PLUS)),
89 MPP_MODE(11,
90 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
91 MPP_VAR_FUNCTION(0x1, "ge0", "rxclk", V_MV78230_PLUS),
92 MPP_VAR_FUNCTION(0x4, "lcd", "d11", V_MV78230_PLUS)),
93 MPP_MODE(12,
94 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
95 MPP_VAR_FUNCTION(0x1, "ge0", "txd4", V_MV78230_PLUS),
96 MPP_VAR_FUNCTION(0x2, "ge1", "clkout", V_MV78230_PLUS),
97 MPP_VAR_FUNCTION(0x4, "lcd", "d12", V_MV78230_PLUS)),
98 MPP_MODE(13,
99 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
100 MPP_VAR_FUNCTION(0x1, "ge0", "txd5", V_MV78230_PLUS),
101 MPP_VAR_FUNCTION(0x2, "ge1", "txd0", V_MV78230_PLUS),
102 MPP_VAR_FUNCTION(0x4, "lcd", "d13", V_MV78230_PLUS)),
103 MPP_MODE(14,
104 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
105 MPP_VAR_FUNCTION(0x1, "ge0", "txd6", V_MV78230_PLUS),
106 MPP_VAR_FUNCTION(0x2, "ge1", "txd1", V_MV78230_PLUS),
107 MPP_VAR_FUNCTION(0x4, "lcd", "d14", V_MV78230_PLUS)),
108 MPP_MODE(15,
109 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
110 MPP_VAR_FUNCTION(0x1, "ge0", "txd7", V_MV78230_PLUS),
111 MPP_VAR_FUNCTION(0x2, "ge1", "txd2", V_MV78230_PLUS),
112 MPP_VAR_FUNCTION(0x4, "lcd", "d15", V_MV78230_PLUS)),
113 MPP_MODE(16,
114 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
115 MPP_VAR_FUNCTION(0x1, "ge0", "txclk", V_MV78230_PLUS),
116 MPP_VAR_FUNCTION(0x2, "ge1", "txd3", V_MV78230_PLUS),
117 MPP_VAR_FUNCTION(0x4, "lcd", "d16", V_MV78230_PLUS)),
118 MPP_MODE(17,
119 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
120 MPP_VAR_FUNCTION(0x1, "ge0", "col", V_MV78230_PLUS),
121 MPP_VAR_FUNCTION(0x2, "ge1", "txctl", V_MV78230_PLUS),
122 MPP_VAR_FUNCTION(0x4, "lcd", "d17", V_MV78230_PLUS)),
123 MPP_MODE(18,
124 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
125 MPP_VAR_FUNCTION(0x1, "ge0", "rxerr", V_MV78230_PLUS),
126 MPP_VAR_FUNCTION(0x2, "ge1", "rxd0", V_MV78230_PLUS),
127 MPP_VAR_FUNCTION(0x3, "ptp", "trig", V_MV78230_PLUS),
128 MPP_VAR_FUNCTION(0x4, "lcd", "d18", V_MV78230_PLUS)),
129 MPP_MODE(19,
130 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
131 MPP_VAR_FUNCTION(0x1, "ge0", "crs", V_MV78230_PLUS),
132 MPP_VAR_FUNCTION(0x2, "ge1", "rxd1", V_MV78230_PLUS),
133 MPP_VAR_FUNCTION(0x3, "ptp", "evreq", V_MV78230_PLUS),
134 MPP_VAR_FUNCTION(0x4, "lcd", "d19", V_MV78230_PLUS)),
135 MPP_MODE(20,
136 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
137 MPP_VAR_FUNCTION(0x1, "ge0", "rxd4", V_MV78230_PLUS),
138 MPP_VAR_FUNCTION(0x2, "ge1", "rxd2", V_MV78230_PLUS),
139 MPP_VAR_FUNCTION(0x3, "ptp", "clk", V_MV78230_PLUS),
140 MPP_VAR_FUNCTION(0x4, "lcd", "d20", V_MV78230_PLUS)),
141 MPP_MODE(21,
142 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
143 MPP_VAR_FUNCTION(0x1, "ge0", "rxd5", V_MV78230_PLUS),
144 MPP_VAR_FUNCTION(0x2, "ge1", "rxd3", V_MV78230_PLUS),
145 MPP_VAR_FUNCTION(0x3, "mem", "bat", V_MV78230_PLUS),
146 MPP_VAR_FUNCTION(0x4, "lcd", "d21", V_MV78230_PLUS)),
147 MPP_MODE(22,
148 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
149 MPP_VAR_FUNCTION(0x1, "ge0", "rxd6", V_MV78230_PLUS),
150 MPP_VAR_FUNCTION(0x2, "ge1", "rxctl", V_MV78230_PLUS),
151 MPP_VAR_FUNCTION(0x3, "sata0", "prsnt", V_MV78230_PLUS),
152 MPP_VAR_FUNCTION(0x4, "lcd", "d22", V_MV78230_PLUS)),
153 MPP_MODE(23,
154 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
155 MPP_VAR_FUNCTION(0x1, "ge0", "rxd7", V_MV78230_PLUS),
156 MPP_VAR_FUNCTION(0x2, "ge1", "rxclk", V_MV78230_PLUS),
157 MPP_VAR_FUNCTION(0x3, "sata1", "prsnt", V_MV78230_PLUS),
158 MPP_VAR_FUNCTION(0x4, "lcd", "d23", V_MV78230_PLUS)),
159 MPP_MODE(24,
160 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
161 MPP_VAR_FUNCTION(0x1, "sata1", "prsnt", V_MV78230_PLUS),
162 MPP_VAR_FUNCTION(0x2, "nf", "bootcs-re", V_MV78230_PLUS),
163 MPP_VAR_FUNCTION(0x3, "tdm", "rst", V_MV78230_PLUS),
164 MPP_VAR_FUNCTION(0x4, "lcd", "hsync", V_MV78230_PLUS)),
165 MPP_MODE(25,
166 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
167 MPP_VAR_FUNCTION(0x1, "sata0", "prsnt", V_MV78230_PLUS),
168 MPP_VAR_FUNCTION(0x2, "nf", "bootcs-we", V_MV78230_PLUS),
169 MPP_VAR_FUNCTION(0x3, "tdm", "pclk", V_MV78230_PLUS),
170 MPP_VAR_FUNCTION(0x4, "lcd", "vsync", V_MV78230_PLUS)),
171 MPP_MODE(26,
172 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
173 MPP_VAR_FUNCTION(0x3, "tdm", "fsync", V_MV78230_PLUS),
174 MPP_VAR_FUNCTION(0x4, "lcd", "clk", V_MV78230_PLUS),
175 MPP_VAR_FUNCTION(0x5, "vdd", "cpu1-pd", V_MV78230_PLUS)),
176 MPP_MODE(27,
177 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
178 MPP_VAR_FUNCTION(0x1, "ptp", "trig", V_MV78230_PLUS),
179 MPP_VAR_FUNCTION(0x3, "tdm", "dtx", V_MV78230_PLUS),
180 MPP_VAR_FUNCTION(0x4, "lcd", "e", V_MV78230_PLUS)),
181 MPP_MODE(28,
182 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
183 MPP_VAR_FUNCTION(0x1, "ptp", "evreq", V_MV78230_PLUS),
184 MPP_VAR_FUNCTION(0x3, "tdm", "drx", V_MV78230_PLUS),
185 MPP_VAR_FUNCTION(0x4, "lcd", "pwm", V_MV78230_PLUS)),
186 MPP_MODE(29,
187 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
188 MPP_VAR_FUNCTION(0x1, "ptp", "clk", V_MV78230_PLUS),
189 MPP_VAR_FUNCTION(0x3, "tdm", "int0", V_MV78230_PLUS),
190 MPP_VAR_FUNCTION(0x4, "lcd", "ref-clk", V_MV78230_PLUS),
191 MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)),
192 MPP_MODE(30,
193 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
194 MPP_VAR_FUNCTION(0x1, "sd0", "clk", V_MV78230_PLUS),
195 MPP_VAR_FUNCTION(0x3, "tdm", "int1", V_MV78230_PLUS)),
196 MPP_MODE(31,
197 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
198 MPP_VAR_FUNCTION(0x1, "sd0", "cmd", V_MV78230_PLUS),
199 MPP_VAR_FUNCTION(0x3, "tdm", "int2", V_MV78230_PLUS),
200 MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)),
201 MPP_MODE(32,
202 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
203 MPP_VAR_FUNCTION(0x1, "sd0", "d0", V_MV78230_PLUS),
204 MPP_VAR_FUNCTION(0x3, "tdm", "int3", V_MV78230_PLUS),
205 MPP_VAR_FUNCTION(0x5, "vdd", "cpu1-pd", V_MV78230_PLUS)),
206 MPP_MODE(33,
207 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
208 MPP_VAR_FUNCTION(0x1, "sd0", "d1", V_MV78230_PLUS),
209 MPP_VAR_FUNCTION(0x3, "tdm", "int4", V_MV78230_PLUS),
210 MPP_VAR_FUNCTION(0x4, "mem", "bat", V_MV78230_PLUS)),
211 MPP_MODE(34,
212 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
213 MPP_VAR_FUNCTION(0x1, "sd0", "d2", V_MV78230_PLUS),
214 MPP_VAR_FUNCTION(0x2, "sata0", "prsnt", V_MV78230_PLUS),
215 MPP_VAR_FUNCTION(0x3, "tdm", "int5", V_MV78230_PLUS)),
216 MPP_MODE(35,
217 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
218 MPP_VAR_FUNCTION(0x1, "sd0", "d3", V_MV78230_PLUS),
219 MPP_VAR_FUNCTION(0x2, "sata1", "prsnt", V_MV78230_PLUS),
220 MPP_VAR_FUNCTION(0x3, "tdm", "int6", V_MV78230_PLUS)),
221 MPP_MODE(36,
222 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
223 MPP_VAR_FUNCTION(0x1, "spi", "mosi", V_MV78230_PLUS)),
224 MPP_MODE(37,
225 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
226 MPP_VAR_FUNCTION(0x1, "spi", "miso", V_MV78230_PLUS)),
227 MPP_MODE(38,
228 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
229 MPP_VAR_FUNCTION(0x1, "spi", "sck", V_MV78230_PLUS)),
230 MPP_MODE(39,
231 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
232 MPP_VAR_FUNCTION(0x1, "spi", "cs0", V_MV78230_PLUS)),
233 MPP_MODE(40,
234 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
235 MPP_VAR_FUNCTION(0x1, "spi", "cs1", V_MV78230_PLUS),
236 MPP_VAR_FUNCTION(0x2, "uart2", "cts", V_MV78230_PLUS),
237 MPP_VAR_FUNCTION(0x3, "vdd", "cpu1-pd", V_MV78230_PLUS),
238 MPP_VAR_FUNCTION(0x4, "lcd", "vga-hsync", V_MV78230_PLUS),
239 MPP_VAR_FUNCTION(0x5, "pcie", "clkreq0", V_MV78230_PLUS)),
240 MPP_MODE(41,
241 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
242 MPP_VAR_FUNCTION(0x1, "spi", "cs2", V_MV78230_PLUS),
243 MPP_VAR_FUNCTION(0x2, "uart2", "rts", V_MV78230_PLUS),
244 MPP_VAR_FUNCTION(0x3, "sata1", "prsnt", V_MV78230_PLUS),
245 MPP_VAR_FUNCTION(0x4, "lcd", "vga-vsync", V_MV78230_PLUS),
246 MPP_VAR_FUNCTION(0x5, "pcie", "clkreq1", V_MV78230_PLUS)),
247 MPP_MODE(42,
248 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
249 MPP_VAR_FUNCTION(0x1, "uart2", "rxd", V_MV78230_PLUS),
250 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V_MV78230_PLUS),
251 MPP_VAR_FUNCTION(0x3, "tdm", "int7", V_MV78230_PLUS),
252 MPP_VAR_FUNCTION(0x4, "tdm-1", "timer", V_MV78230_PLUS),
253 MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)),
254 MPP_MODE(43,
255 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
256 MPP_VAR_FUNCTION(0x1, "uart2", "txd", V_MV78230_PLUS),
257 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V_MV78230_PLUS),
258 MPP_VAR_FUNCTION(0x3, "spi", "cs3", V_MV78230_PLUS),
259 MPP_VAR_FUNCTION(0x4, "pcie", "rstout", V_MV78230_PLUS),
260 MPP_VAR_FUNCTION(0x5, "vdd", "cpu2-3-pd", V_MV78460)),
261 MPP_MODE(44,
262 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
263 MPP_VAR_FUNCTION(0x1, "uart2", "cts", V_MV78230_PLUS),
264 MPP_VAR_FUNCTION(0x2, "uart3", "rxd", V_MV78230_PLUS),
265 MPP_VAR_FUNCTION(0x3, "spi", "cs4", V_MV78230_PLUS),
266 MPP_VAR_FUNCTION(0x4, "mem", "bat", V_MV78230_PLUS),
267 MPP_VAR_FUNCTION(0x5, "pcie", "clkreq2", V_MV78230_PLUS)),
268 MPP_MODE(45,
269 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
270 MPP_VAR_FUNCTION(0x1, "uart2", "rts", V_MV78230_PLUS),
271 MPP_VAR_FUNCTION(0x2, "uart3", "txd", V_MV78230_PLUS),
272 MPP_VAR_FUNCTION(0x3, "spi", "cs5", V_MV78230_PLUS),
273 MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V_MV78230_PLUS)),
274 MPP_MODE(46,
275 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
276 MPP_VAR_FUNCTION(0x1, "uart3", "rts", V_MV78230_PLUS),
277 MPP_VAR_FUNCTION(0x2, "uart1", "rts", V_MV78230_PLUS),
278 MPP_VAR_FUNCTION(0x3, "spi", "cs6", V_MV78230_PLUS),
279 MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V_MV78230_PLUS)),
280 MPP_MODE(47,
281 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
282 MPP_VAR_FUNCTION(0x1, "uart3", "cts", V_MV78230_PLUS),
283 MPP_VAR_FUNCTION(0x2, "uart1", "cts", V_MV78230_PLUS),
284 MPP_VAR_FUNCTION(0x3, "spi", "cs7", V_MV78230_PLUS),
285 MPP_VAR_FUNCTION(0x4, "ref", "clkout", V_MV78230_PLUS),
286 MPP_VAR_FUNCTION(0x5, "pcie", "clkreq3", V_MV78230_PLUS)),
287 MPP_MODE(48,
288 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
289 MPP_VAR_FUNCTION(0x1, "tclk", NULL, V_MV78230_PLUS),
290 MPP_VAR_FUNCTION(0x2, "dev", "burst/last", V_MV78230_PLUS)),
291 MPP_MODE(49,
292 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
293 MPP_VAR_FUNCTION(0x1, "dev", "we3", V_MV78260_PLUS)),
294 MPP_MODE(50,
295 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
296 MPP_VAR_FUNCTION(0x1, "dev", "we2", V_MV78260_PLUS)),
297 MPP_MODE(51,
298 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
299 MPP_VAR_FUNCTION(0x1, "dev", "ad16", V_MV78260_PLUS)),
300 MPP_MODE(52,
301 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
302 MPP_VAR_FUNCTION(0x1, "dev", "ad17", V_MV78260_PLUS)),
303 MPP_MODE(53,
304 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
305 MPP_VAR_FUNCTION(0x1, "dev", "ad18", V_MV78260_PLUS)),
306 MPP_MODE(54,
307 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
308 MPP_VAR_FUNCTION(0x1, "dev", "ad19", V_MV78260_PLUS)),
309 MPP_MODE(55,
310 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
311 MPP_VAR_FUNCTION(0x1, "dev", "ad20", V_MV78260_PLUS),
312 MPP_VAR_FUNCTION(0x2, "vdd", "cpu0-pd", V_MV78260_PLUS)),
313 MPP_MODE(56,
314 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
315 MPP_VAR_FUNCTION(0x1, "dev", "ad21", V_MV78260_PLUS),
316 MPP_VAR_FUNCTION(0x2, "vdd", "cpu1-pd", V_MV78260_PLUS)),
317 MPP_MODE(57,
318 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
319 MPP_VAR_FUNCTION(0x1, "dev", "ad22", V_MV78260_PLUS),
320 MPP_VAR_FUNCTION(0x2, "vdd", "cpu2-3-pd", V_MV78460)),
321 MPP_MODE(58,
322 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
323 MPP_VAR_FUNCTION(0x1, "dev", "ad23", V_MV78260_PLUS)),
324 MPP_MODE(59,
325 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
326 MPP_VAR_FUNCTION(0x1, "dev", "ad24", V_MV78260_PLUS)),
327 MPP_MODE(60,
328 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
329 MPP_VAR_FUNCTION(0x1, "dev", "ad25", V_MV78260_PLUS)),
330 MPP_MODE(61,
331 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
332 MPP_VAR_FUNCTION(0x1, "dev", "ad26", V_MV78260_PLUS)),
333 MPP_MODE(62,
334 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
335 MPP_VAR_FUNCTION(0x1, "dev", "ad27", V_MV78260_PLUS)),
336 MPP_MODE(63,
337 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
338 MPP_VAR_FUNCTION(0x1, "dev", "ad28", V_MV78260_PLUS)),
339 MPP_MODE(64,
340 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
341 MPP_VAR_FUNCTION(0x1, "dev", "ad29", V_MV78260_PLUS)),
342 MPP_MODE(65,
343 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
344 MPP_VAR_FUNCTION(0x1, "dev", "ad30", V_MV78260_PLUS)),
345 MPP_MODE(66,
346 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
347 MPP_VAR_FUNCTION(0x1, "dev", "ad31", V_MV78260_PLUS)),
348};
349
350static struct mvebu_pinctrl_soc_info armada_xp_pinctrl_info;
351
352static struct of_device_id armada_xp_pinctrl_of_match[] __devinitdata = {
353 {
354 .compatible = "marvell,mv78230-pinctrl",
355 .data = (void *) V_MV78230,
356 },
357 {
358 .compatible = "marvell,mv78260-pinctrl",
359 .data = (void *) V_MV78260,
360 },
361 {
362 .compatible = "marvell,mv78460-pinctrl",
363 .data = (void *) V_MV78460,
364 },
365 { },
366};
367
368static struct mvebu_mpp_ctrl mv78230_mpp_controls[] = {
369 MPP_REG_CTRL(0, 48),
370};
371
372static struct pinctrl_gpio_range mv78230_mpp_gpio_ranges[] = {
373 MPP_GPIO_RANGE(0, 0, 0, 32),
374 MPP_GPIO_RANGE(1, 32, 32, 17),
375};
376
377static struct mvebu_mpp_ctrl mv78260_mpp_controls[] = {
378 MPP_REG_CTRL(0, 66),
379};
380
381static struct pinctrl_gpio_range mv78260_mpp_gpio_ranges[] = {
382 MPP_GPIO_RANGE(0, 0, 0, 32),
383 MPP_GPIO_RANGE(1, 32, 32, 32),
384 MPP_GPIO_RANGE(2, 64, 64, 3),
385};
386
387static struct mvebu_mpp_ctrl mv78460_mpp_controls[] = {
388 MPP_REG_CTRL(0, 66),
389};
390
391static struct pinctrl_gpio_range mv78460_mpp_gpio_ranges[] = {
392 MPP_GPIO_RANGE(0, 0, 0, 32),
393 MPP_GPIO_RANGE(1, 32, 32, 32),
394 MPP_GPIO_RANGE(2, 64, 64, 3),
395};
396
397static int __devinit armada_xp_pinctrl_probe(struct platform_device *pdev)
398{
399 struct mvebu_pinctrl_soc_info *soc = &armada_xp_pinctrl_info;
400 const struct of_device_id *match =
401 of_match_device(armada_xp_pinctrl_of_match, &pdev->dev);
402
403 if (!match)
404 return -ENODEV;
405
406 soc->variant = (unsigned) match->data & 0xff;
407
408 switch (soc->variant) {
409 case V_MV78230:
410 soc->controls = mv78230_mpp_controls;
411 soc->ncontrols = ARRAY_SIZE(mv78230_mpp_controls);
412 soc->modes = armada_xp_mpp_modes;
413 /* We don't necessarily want the full list of the
414 * armada_xp_mpp_modes, but only the first 'n' ones
415 * that are available on this SoC */
416 soc->nmodes = mv78230_mpp_controls[0].npins;
417 soc->gpioranges = mv78230_mpp_gpio_ranges;
418 soc->ngpioranges = ARRAY_SIZE(mv78230_mpp_gpio_ranges);
419 break;
420 case V_MV78260:
421 soc->controls = mv78260_mpp_controls;
422 soc->ncontrols = ARRAY_SIZE(mv78260_mpp_controls);
423 soc->modes = armada_xp_mpp_modes;
424 /* We don't necessarily want the full list of the
425 * armada_xp_mpp_modes, but only the first 'n' ones
426 * that are available on this SoC */
427 soc->nmodes = mv78260_mpp_controls[0].npins;
428 soc->gpioranges = mv78260_mpp_gpio_ranges;
429 soc->ngpioranges = ARRAY_SIZE(mv78260_mpp_gpio_ranges);
430 break;
431 case V_MV78460:
432 soc->controls = mv78460_mpp_controls;
433 soc->ncontrols = ARRAY_SIZE(mv78460_mpp_controls);
434 soc->modes = armada_xp_mpp_modes;
435 /* We don't necessarily want the full list of the
436 * armada_xp_mpp_modes, but only the first 'n' ones
437 * that are available on this SoC */
438 soc->nmodes = mv78460_mpp_controls[0].npins;
439 soc->gpioranges = mv78460_mpp_gpio_ranges;
440 soc->ngpioranges = ARRAY_SIZE(mv78460_mpp_gpio_ranges);
441 break;
442 }
443
444 pdev->dev.platform_data = soc;
445
446 return mvebu_pinctrl_probe(pdev);
447}
448
449static int __devexit armada_xp_pinctrl_remove(struct platform_device *pdev)
450{
451 return mvebu_pinctrl_remove(pdev);
452}
453
454static struct platform_driver armada_xp_pinctrl_driver = {
455 .driver = {
456 .name = "armada-xp-pinctrl",
457 .owner = THIS_MODULE,
458 .of_match_table = of_match_ptr(armada_xp_pinctrl_of_match),
459 },
460 .probe = armada_xp_pinctrl_probe,
461 .remove = __devexit_p(armada_xp_pinctrl_remove),
462};
463
464module_platform_driver(armada_xp_pinctrl_driver);
465
466MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
467MODULE_DESCRIPTION("Marvell Armada XP pinctrl driver");
468MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index cc0f00d73d15..b446c9641212 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -1,11 +1,8 @@
1/* 1/*
2 * U300 GPIO module. 2 * U300 GPIO module.
3 * 3 *
4 * Copyright (C) 2007-2011 ST-Ericsson AB 4 * Copyright (C) 2007-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 * This can driver either of the two basic GPIO cores
7 * available in the U300 platforms:
8 * COH 901 335 - Used in DB3150 (U300 1.0) and DB3200 (U330 1.0)
9 * COH 901 571/3 - Used in DB3210 (U365 2.0) and DB3350 (U335 1.0) 6 * COH 901 571/3 - Used in DB3210 (U365 2.0) and DB3350 (U335 1.0)
10 * Author: Linus Walleij <linus.walleij@linaro.org> 7 * Author: Linus Walleij <linus.walleij@linaro.org>
11 * Author: Jonas Aaberg <jonas.aberg@stericsson.com> 8 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
@@ -24,19 +21,22 @@
24#include <linux/slab.h> 21#include <linux/slab.h>
25#include <linux/pinctrl/consumer.h> 22#include <linux/pinctrl/consumer.h>
26#include <linux/pinctrl/pinconf-generic.h> 23#include <linux/pinctrl/pinconf-generic.h>
27#include <mach/gpio-u300.h> 24#include <linux/platform_data/pinctrl-coh901.h>
28#include "pinctrl-coh901.h" 25#include "pinctrl-coh901.h"
29 26
27#define U300_GPIO_PORT_STRIDE (0x30)
30/* 28/*
31 * Register definitions for COH 901 335 variant 29 * Control Register 32bit (R/W)
30 * bit 15-9 (mask 0x0000FE00) contains the number of cores. 8*cores
31 * gives the number of GPIO pins.
32 * bit 8-2 (mask 0x000001FC) contains the core version ID.
32 */ 33 */
33#define U300_335_PORT_STRIDE (0x1C) 34#define U300_GPIO_CR (0x00)
34/* Port X Pin Data Register 32bit, this is both input and output (R/W) */ 35#define U300_GPIO_CR_SYNC_SEL_ENABLE (0x00000002UL)
35#define U300_335_PXPDIR (0x00) 36#define U300_GPIO_CR_BLOCK_CLKRQ_ENABLE (0x00000001UL)
36#define U300_335_PXPDOR (0x00) 37#define U300_GPIO_PXPDIR (0x04)
37/* Port X Pin Config Register 32bit (R/W) */ 38#define U300_GPIO_PXPDOR (0x08)
38#define U300_335_PXPCR (0x04) 39#define U300_GPIO_PXPCR (0x0C)
39/* This register layout is the same in both blocks */
40#define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL) 40#define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK (0x0000FFFFUL)
41#define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL) 41#define U300_GPIO_PXPCR_PIN_MODE_MASK (0x00000003UL)
42#define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL) 42#define U300_GPIO_PXPCR_PIN_MODE_SHIFT (0x00000002UL)
@@ -44,53 +44,17 @@
44#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL) 44#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL (0x00000001UL)
45#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL) 45#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN (0x00000002UL)
46#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL) 46#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE (0x00000003UL)
47/* Port X Interrupt Event Register 32bit (R/W) */ 47#define U300_GPIO_PXPER (0x10)
48#define U300_335_PXIEV (0x08) 48#define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL)
49/* Port X Interrupt Enable Register 32bit (R/W) */ 49#define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL)
50#define U300_335_PXIEN (0x0C) 50#define U300_GPIO_PXIEV (0x14)
51/* Port X Interrupt Force Register 32bit (R/W) */ 51#define U300_GPIO_PXIEN (0x18)
52#define U300_335_PXIFR (0x10) 52#define U300_GPIO_PXIFR (0x1C)
53/* Port X Interrupt Config Register 32bit (R/W) */ 53#define U300_GPIO_PXICR (0x20)
54#define U300_335_PXICR (0x14)
55/* This register layout is the same in both blocks */
56#define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL) 54#define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK (0x000000FFUL)
57#define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL) 55#define U300_GPIO_PXICR_IRQ_CONFIG_MASK (0x00000001UL)
58#define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL) 56#define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE (0x00000000UL)
59#define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL) 57#define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE (0x00000001UL)
60/* Port X Pull-up Enable Register 32bit (R/W) */
61#define U300_335_PXPER (0x18)
62/* This register layout is the same in both blocks */
63#define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK (0x000000FFUL)
64#define U300_GPIO_PXPER_PULL_UP_DISABLE (0x00000001UL)
65/* Control Register 32bit (R/W) */
66#define U300_335_CR (0x54)
67#define U300_335_CR_BLOCK_CLOCK_ENABLE (0x00000001UL)
68
69/*
70 * Register definitions for COH 901 571 / 3 variant
71 */
72#define U300_571_PORT_STRIDE (0x30)
73/*
74 * Control Register 32bit (R/W)
75 * bit 15-9 (mask 0x0000FE00) contains the number of cores. 8*cores
76 * gives the number of GPIO pins.
77 * bit 8-2 (mask 0x000001FC) contains the core version ID.
78 */
79#define U300_571_CR (0x00)
80#define U300_571_CR_SYNC_SEL_ENABLE (0x00000002UL)
81#define U300_571_CR_BLOCK_CLKRQ_ENABLE (0x00000001UL)
82/*
83 * These registers have the same layout and function as the corresponding
84 * COH 901 335 registers, just at different offset.
85 */
86#define U300_571_PXPDIR (0x04)
87#define U300_571_PXPDOR (0x08)
88#define U300_571_PXPCR (0x0C)
89#define U300_571_PXPER (0x10)
90#define U300_571_PXIEV (0x14)
91#define U300_571_PXIEN (0x18)
92#define U300_571_PXIFR (0x1C)
93#define U300_571_PXICR (0x20)
94 58
95/* 8 bits per port, no version has more than 7 ports */ 59/* 8 bits per port, no version has more than 7 ports */
96#define U300_GPIO_PINS_PER_PORT 8 60#define U300_GPIO_PINS_PER_PORT 8
@@ -149,8 +113,6 @@ struct u300_gpio_confdata {
149 113
150/* BS335 has seven ports of 8 bits each = GPIO pins 0..55 */ 114/* BS335 has seven ports of 8 bits each = GPIO pins 0..55 */
151#define BS335_GPIO_NUM_PORTS 7 115#define BS335_GPIO_NUM_PORTS 7
152/* BS365 has five ports of 8 bits each = GPIO pins 0..39 */
153#define BS365_GPIO_NUM_PORTS 5
154 116
155#define U300_FLOATING_INPUT { \ 117#define U300_FLOATING_INPUT { \
156 .bias_mode = PIN_CONFIG_BIAS_HIGH_IMPEDANCE, \ 118 .bias_mode = PIN_CONFIG_BIAS_HIGH_IMPEDANCE, \
@@ -172,7 +134,6 @@ struct u300_gpio_confdata {
172 .outval = 1, \ 134 .outval = 1, \
173} 135}
174 136
175
176/* Initial configuration */ 137/* Initial configuration */
177static const struct __initconst u300_gpio_confdata 138static const struct __initconst u300_gpio_confdata
178bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = { 139bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
@@ -255,66 +216,6 @@ bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
255 } 216 }
256}; 217};
257 218
258static const struct __initconst u300_gpio_confdata
259bs365_gpio_config[BS365_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
260 /* Port 0, pins 0-7 */
261 {
262 U300_FLOATING_INPUT,
263 U300_OUTPUT_LOW,
264 U300_FLOATING_INPUT,
265 U300_OUTPUT_LOW,
266 U300_OUTPUT_LOW,
267 U300_OUTPUT_LOW,
268 U300_PULL_UP_INPUT,
269 U300_FLOATING_INPUT,
270 },
271 /* Port 1, pins 0-7 */
272 {
273 U300_OUTPUT_LOW,
274 U300_FLOATING_INPUT,
275 U300_OUTPUT_LOW,
276 U300_FLOATING_INPUT,
277 U300_FLOATING_INPUT,
278 U300_OUTPUT_HIGH,
279 U300_OUTPUT_LOW,
280 U300_OUTPUT_LOW,
281 },
282 /* Port 2, pins 0-7 */
283 {
284 U300_FLOATING_INPUT,
285 U300_PULL_UP_INPUT,
286 U300_OUTPUT_LOW,
287 U300_OUTPUT_LOW,
288 U300_PULL_UP_INPUT,
289 U300_PULL_UP_INPUT,
290 U300_PULL_UP_INPUT,
291 U300_PULL_UP_INPUT,
292 },
293 /* Port 3, pins 0-7 */
294 {
295 U300_PULL_UP_INPUT,
296 U300_PULL_UP_INPUT,
297 U300_PULL_UP_INPUT,
298 U300_PULL_UP_INPUT,
299 U300_PULL_UP_INPUT,
300 U300_PULL_UP_INPUT,
301 U300_PULL_UP_INPUT,
302 U300_PULL_UP_INPUT,
303 },
304 /* Port 4, pins 0-7 */
305 {
306 U300_PULL_UP_INPUT,
307 U300_PULL_UP_INPUT,
308 U300_PULL_UP_INPUT,
309 U300_PULL_UP_INPUT,
310 /* These 4 pins doesn't exist on DB3210 */
311 U300_OUTPUT_LOW,
312 U300_OUTPUT_LOW,
313 U300_OUTPUT_LOW,
314 U300_OUTPUT_LOW,
315 }
316};
317
318/** 219/**
319 * to_u300_gpio() - get the pointer to u300_gpio 220 * to_u300_gpio() - get the pointer to u300_gpio
320 * @chip: the gpio chip member of the structure u300_gpio 221 * @chip: the gpio chip member of the structure u300_gpio
@@ -716,13 +617,7 @@ static void __init u300_gpio_init_coh901571(struct u300_gpio *gpio,
716 const struct u300_gpio_confdata *conf; 617 const struct u300_gpio_confdata *conf;
717 int offset = (i*8) + j; 618 int offset = (i*8) + j;
718 619
719 if (plat->variant == U300_GPIO_COH901571_3_BS335) 620 conf = &bs335_gpio_config[i][j];
720 conf = &bs335_gpio_config[i][j];
721 else if (plat->variant == U300_GPIO_COH901571_3_BS365)
722 conf = &bs365_gpio_config[i][j];
723 else
724 break;
725
726 u300_gpio_init_pin(gpio, offset, conf); 621 u300_gpio_init_pin(gpio, offset, conf);
727 } 622 }
728 } 623 }
@@ -796,50 +691,27 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
796 goto err_no_ioremap; 691 goto err_no_ioremap;
797 } 692 }
798 693
799 if (plat->variant == U300_GPIO_COH901335) { 694 dev_info(gpio->dev,
800 dev_info(gpio->dev, 695 "initializing GPIO Controller COH 901 571/3\n");
801 "initializing GPIO Controller COH 901 335\n"); 696 gpio->stride = U300_GPIO_PORT_STRIDE;
802 gpio->stride = U300_335_PORT_STRIDE; 697 gpio->pcr = U300_GPIO_PXPCR;
803 gpio->pcr = U300_335_PXPCR; 698 gpio->dor = U300_GPIO_PXPDOR;
804 gpio->dor = U300_335_PXPDOR; 699 gpio->dir = U300_GPIO_PXPDIR;
805 gpio->dir = U300_335_PXPDIR; 700 gpio->per = U300_GPIO_PXPER;
806 gpio->per = U300_335_PXPER; 701 gpio->icr = U300_GPIO_PXICR;
807 gpio->icr = U300_335_PXICR; 702 gpio->ien = U300_GPIO_PXIEN;
808 gpio->ien = U300_335_PXIEN; 703 gpio->iev = U300_GPIO_PXIEV;
809 gpio->iev = U300_335_PXIEV; 704 ifr = U300_GPIO_PXIFR;
810 ifr = U300_335_PXIFR; 705
811 706 val = readl(gpio->base + U300_GPIO_CR);
812 /* Turn on the GPIO block */ 707 dev_info(gpio->dev, "COH901571/3 block version: %d, " \
813 writel(U300_335_CR_BLOCK_CLOCK_ENABLE, 708 "number of cores: %d totalling %d pins\n",
814 gpio->base + U300_335_CR); 709 ((val & 0x000001FC) >> 2),
815 } else if (plat->variant == U300_GPIO_COH901571_3_BS335 || 710 ((val & 0x0000FE00) >> 9),
816 plat->variant == U300_GPIO_COH901571_3_BS365) { 711 ((val & 0x0000FE00) >> 9) * 8);
817 dev_info(gpio->dev, 712 writel(U300_GPIO_CR_BLOCK_CLKRQ_ENABLE,
818 "initializing GPIO Controller COH 901 571/3\n"); 713 gpio->base + U300_GPIO_CR);
819 gpio->stride = U300_571_PORT_STRIDE; 714 u300_gpio_init_coh901571(gpio, plat);
820 gpio->pcr = U300_571_PXPCR;
821 gpio->dor = U300_571_PXPDOR;
822 gpio->dir = U300_571_PXPDIR;
823 gpio->per = U300_571_PXPER;
824 gpio->icr = U300_571_PXICR;
825 gpio->ien = U300_571_PXIEN;
826 gpio->iev = U300_571_PXIEV;
827 ifr = U300_571_PXIFR;
828
829 val = readl(gpio->base + U300_571_CR);
830 dev_info(gpio->dev, "COH901571/3 block version: %d, " \
831 "number of cores: %d totalling %d pins\n",
832 ((val & 0x000001FC) >> 2),
833 ((val & 0x0000FE00) >> 9),
834 ((val & 0x0000FE00) >> 9) * 8);
835 writel(U300_571_CR_BLOCK_CLKRQ_ENABLE,
836 gpio->base + U300_571_CR);
837 u300_gpio_init_coh901571(gpio, plat);
838 } else {
839 dev_err(gpio->dev, "unknown block variant\n");
840 err = -ENODEV;
841 goto err_unknown_variant;
842 }
843 715
844 /* Add each port with its IRQ separately */ 716 /* Add each port with its IRQ separately */
845 INIT_LIST_HEAD(&gpio->port_list); 717 INIT_LIST_HEAD(&gpio->port_list);
@@ -906,7 +778,6 @@ err_no_pinctrl:
906err_no_chip: 778err_no_chip:
907err_no_port: 779err_no_port:
908 u300_gpio_free_ports(gpio); 780 u300_gpio_free_ports(gpio);
909err_unknown_variant:
910 iounmap(gpio->base); 781 iounmap(gpio->base);
911err_no_ioremap: 782err_no_ioremap:
912 release_mem_region(gpio->memres->start, resource_size(gpio->memres)); 783 release_mem_region(gpio->memres->start, resource_size(gpio->memres));
@@ -923,16 +794,11 @@ err_no_clk:
923 794
924static int __exit u300_gpio_remove(struct platform_device *pdev) 795static int __exit u300_gpio_remove(struct platform_device *pdev)
925{ 796{
926 struct u300_gpio_platform *plat = dev_get_platdata(&pdev->dev);
927 struct u300_gpio *gpio = platform_get_drvdata(pdev); 797 struct u300_gpio *gpio = platform_get_drvdata(pdev);
928 int err; 798 int err;
929 799
930 /* Turn off the GPIO block */ 800 /* Turn off the GPIO block */
931 if (plat->variant == U300_GPIO_COH901335) 801 writel(0x00000000U, gpio->base + U300_GPIO_CR);
932 writel(0x00000000U, gpio->base + U300_335_CR);
933 if (plat->variant == U300_GPIO_COH901571_3_BS335 ||
934 plat->variant == U300_GPIO_COH901571_3_BS365)
935 writel(0x00000000U, gpio->base + U300_571_CR);
936 802
937 err = gpiochip_remove(&gpio->chip); 803 err = gpiochip_remove(&gpio->chip);
938 if (err < 0) { 804 if (err < 0) {
diff --git a/drivers/pinctrl/pinctrl-dove.c b/drivers/pinctrl/pinctrl-dove.c
new file mode 100644
index 000000000000..ffe74b27d66d
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-dove.c
@@ -0,0 +1,620 @@
1/*
2 * Marvell Dove pinctrl driver based on mvebu pinctrl core
3 *
4 * Author: Sebastian Hesselbarth <sebastian.hesselbarth@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
12#include <linux/err.h>
13#include <linux/init.h>
14#include <linux/io.h>
15#include <linux/module.h>
16#include <linux/bitops.h>
17#include <linux/platform_device.h>
18#include <linux/clk.h>
19#include <linux/of.h>
20#include <linux/of_device.h>
21#include <linux/pinctrl/pinctrl.h>
22
23#include "pinctrl-mvebu.h"
24
25#define DOVE_SB_REGS_VIRT_BASE 0xfde00000
26#define DOVE_MPP_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0200)
27#define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10)
28#define DOVE_AU0_AC97_SEL BIT(16)
29#define DOVE_GLOBAL_CONFIG_1 (DOVE_SB_REGS_VIRT_BASE | 0xe802C)
30#define DOVE_TWSI_ENABLE_OPTION1 BIT(7)
31#define DOVE_GLOBAL_CONFIG_2 (DOVE_SB_REGS_VIRT_BASE | 0xe8030)
32#define DOVE_TWSI_ENABLE_OPTION2 BIT(20)
33#define DOVE_TWSI_ENABLE_OPTION3 BIT(21)
34#define DOVE_TWSI_OPTION3_GPIO BIT(22)
35#define DOVE_SSP_CTRL_STATUS_1 (DOVE_SB_REGS_VIRT_BASE | 0xe8034)
36#define DOVE_SSP_ON_AU1 BIT(0)
37#define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c)
38#define DOVE_AU1_SPDIFO_GPIO_EN BIT(1)
39#define DOVE_NAND_GPIO_EN BIT(0)
40#define DOVE_GPIO_LO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400)
41#define DOVE_MPP_CTRL4_VIRT_BASE (DOVE_GPIO_LO_VIRT_BASE + 0x40)
42#define DOVE_SPI_GPIO_SEL BIT(5)
43#define DOVE_UART1_GPIO_SEL BIT(4)
44#define DOVE_AU1_GPIO_SEL BIT(3)
45#define DOVE_CAM_GPIO_SEL BIT(2)
46#define DOVE_SD1_GPIO_SEL BIT(1)
47#define DOVE_SD0_GPIO_SEL BIT(0)
48
49#define MPPS_PER_REG 8
50#define MPP_BITS 4
51#define MPP_MASK 0xf
52
53#define CONFIG_PMU BIT(4)
54
55static int dove_pmu_mpp_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
56 unsigned long *config)
57{
58 unsigned off = (ctrl->pid / MPPS_PER_REG) * MPP_BITS;
59 unsigned shift = (ctrl->pid % MPPS_PER_REG) * MPP_BITS;
60 unsigned long pmu = readl(DOVE_PMU_MPP_GENERAL_CTRL);
61 unsigned long mpp = readl(DOVE_MPP_VIRT_BASE + off);
62
63 if (pmu & (1 << ctrl->pid))
64 *config = CONFIG_PMU;
65 else
66 *config = (mpp >> shift) & MPP_MASK;
67 return 0;
68}
69
70static int dove_pmu_mpp_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
71 unsigned long config)
72{
73 unsigned off = (ctrl->pid / MPPS_PER_REG) * MPP_BITS;
74 unsigned shift = (ctrl->pid % MPPS_PER_REG) * MPP_BITS;
75 unsigned long pmu = readl(DOVE_PMU_MPP_GENERAL_CTRL);
76 unsigned long mpp = readl(DOVE_MPP_VIRT_BASE + off);
77
78 if (config == CONFIG_PMU)
79 writel(pmu | (1 << ctrl->pid), DOVE_PMU_MPP_GENERAL_CTRL);
80 else {
81 writel(pmu & ~(1 << ctrl->pid), DOVE_PMU_MPP_GENERAL_CTRL);
82 mpp &= ~(MPP_MASK << shift);
83 mpp |= config << shift;
84 writel(mpp, DOVE_MPP_VIRT_BASE + off);
85 }
86 return 0;
87}
88
89static int dove_mpp4_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
90 unsigned long *config)
91{
92 unsigned long mpp4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
93 unsigned long mask;
94
95 switch (ctrl->pid) {
96 case 24: /* mpp_camera */
97 mask = DOVE_CAM_GPIO_SEL;
98 break;
99 case 40: /* mpp_sdio0 */
100 mask = DOVE_SD0_GPIO_SEL;
101 break;
102 case 46: /* mpp_sdio1 */
103 mask = DOVE_SD1_GPIO_SEL;
104 break;
105 case 58: /* mpp_spi0 */
106 mask = DOVE_SPI_GPIO_SEL;
107 break;
108 case 62: /* mpp_uart1 */
109 mask = DOVE_UART1_GPIO_SEL;
110 break;
111 default:
112 return -EINVAL;
113 }
114
115 *config = ((mpp4 & mask) != 0);
116
117 return 0;
118}
119
120static int dove_mpp4_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
121 unsigned long config)
122{
123 unsigned long mpp4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
124 unsigned long mask;
125
126 switch (ctrl->pid) {
127 case 24: /* mpp_camera */
128 mask = DOVE_CAM_GPIO_SEL;
129 break;
130 case 40: /* mpp_sdio0 */
131 mask = DOVE_SD0_GPIO_SEL;
132 break;
133 case 46: /* mpp_sdio1 */
134 mask = DOVE_SD1_GPIO_SEL;
135 break;
136 case 58: /* mpp_spi0 */
137 mask = DOVE_SPI_GPIO_SEL;
138 break;
139 case 62: /* mpp_uart1 */
140 mask = DOVE_UART1_GPIO_SEL;
141 break;
142 default:
143 return -EINVAL;
144 }
145
146 mpp4 &= ~mask;
147 if (config)
148 mpp4 |= mask;
149
150 writel(mpp4, DOVE_MPP_CTRL4_VIRT_BASE);
151
152 return 0;
153}
154
155static int dove_nand_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
156 unsigned long *config)
157{
158 unsigned long gmpp = readl(DOVE_MPP_GENERAL_VIRT_BASE);
159
160 *config = ((gmpp & DOVE_NAND_GPIO_EN) != 0);
161
162 return 0;
163}
164
165static int dove_nand_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
166 unsigned long config)
167{
168 unsigned long gmpp = readl(DOVE_MPP_GENERAL_VIRT_BASE);
169
170 gmpp &= ~DOVE_NAND_GPIO_EN;
171 if (config)
172 gmpp |= DOVE_NAND_GPIO_EN;
173
174 writel(gmpp, DOVE_MPP_GENERAL_VIRT_BASE);
175
176 return 0;
177}
178
179static int dove_audio0_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
180 unsigned long *config)
181{
182 unsigned long pmu = readl(DOVE_PMU_MPP_GENERAL_CTRL);
183
184 *config = ((pmu & DOVE_AU0_AC97_SEL) != 0);
185
186 return 0;
187}
188
189static int dove_audio0_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
190 unsigned long config)
191{
192 unsigned long pmu = readl(DOVE_PMU_MPP_GENERAL_CTRL);
193
194 pmu &= ~DOVE_AU0_AC97_SEL;
195 if (config)
196 pmu |= DOVE_AU0_AC97_SEL;
197 writel(pmu, DOVE_PMU_MPP_GENERAL_CTRL);
198
199 return 0;
200}
201
202static int dove_audio1_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
203 unsigned long *config)
204{
205 unsigned long mpp4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
206 unsigned long sspc1 = readl(DOVE_SSP_CTRL_STATUS_1);
207 unsigned long gmpp = readl(DOVE_MPP_GENERAL_VIRT_BASE);
208 unsigned long gcfg2 = readl(DOVE_GLOBAL_CONFIG_2);
209
210 *config = 0;
211 if (mpp4 & DOVE_AU1_GPIO_SEL)
212 *config |= BIT(3);
213 if (sspc1 & DOVE_SSP_ON_AU1)
214 *config |= BIT(2);
215 if (gmpp & DOVE_AU1_SPDIFO_GPIO_EN)
216 *config |= BIT(1);
217 if (gcfg2 & DOVE_TWSI_OPTION3_GPIO)
218 *config |= BIT(0);
219
220 /* SSP/TWSI only if I2S1 not set*/
221 if ((*config & BIT(3)) == 0)
222 *config &= ~(BIT(2) | BIT(0));
223 /* TWSI only if SPDIFO not set*/
224 if ((*config & BIT(1)) == 0)
225 *config &= ~BIT(0);
226 return 0;
227}
228
229static int dove_audio1_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
230 unsigned long config)
231{
232 unsigned long mpp4 = readl(DOVE_MPP_CTRL4_VIRT_BASE);
233 unsigned long sspc1 = readl(DOVE_SSP_CTRL_STATUS_1);
234 unsigned long gmpp = readl(DOVE_MPP_GENERAL_VIRT_BASE);
235 unsigned long gcfg2 = readl(DOVE_GLOBAL_CONFIG_2);
236
237 if (config & BIT(0))
238 gcfg2 |= DOVE_TWSI_OPTION3_GPIO;
239 if (config & BIT(1))
240 gmpp |= DOVE_AU1_SPDIFO_GPIO_EN;
241 if (config & BIT(2))
242 sspc1 |= DOVE_SSP_ON_AU1;
243 if (config & BIT(3))
244 mpp4 |= DOVE_AU1_GPIO_SEL;
245
246 writel(mpp4, DOVE_MPP_CTRL4_VIRT_BASE);
247 writel(sspc1, DOVE_SSP_CTRL_STATUS_1);
248 writel(gmpp, DOVE_MPP_GENERAL_VIRT_BASE);
249 writel(gcfg2, DOVE_GLOBAL_CONFIG_2);
250
251 return 0;
252}
253
254/* mpp[52:57] gpio pins depend heavily on current config;
255 * gpio_req does not try to mux in gpio capabilities to not
256 * break other functions. If you require all mpps as gpio
257 * enforce gpio setting by pinctrl mapping.
258 */
259static int dove_audio1_ctrl_gpio_req(struct mvebu_mpp_ctrl *ctrl, u8 pid)
260{
261 unsigned long config;
262
263 dove_audio1_ctrl_get(ctrl, &config);
264
265 switch (config) {
266 case 0x02: /* i2s1 : gpio[56:57] */
267 case 0x0e: /* ssp : gpio[56:57] */
268 if (pid >= 56)
269 return 0;
270 return -ENOTSUPP;
271 case 0x08: /* spdifo : gpio[52:55] */
272 case 0x0b: /* twsi : gpio[52:55] */
273 if (pid <= 55)
274 return 0;
275 return -ENOTSUPP;
276 case 0x0a: /* all gpio */
277 return 0;
278 /* 0x00 : i2s1/spdifo : no gpio */
279 /* 0x0c : ssp/spdifo : no gpio */
280 /* 0x0f : ssp/twsi : no gpio */
281 }
282 return -ENOTSUPP;
283}
284
285/* mpp[52:57] has gpio pins capable of in and out */
286static int dove_audio1_ctrl_gpio_dir(struct mvebu_mpp_ctrl *ctrl, u8 pid,
287 bool input)
288{
289 if (pid < 52 || pid > 57)
290 return -ENOTSUPP;
291 return 0;
292}
293
294static int dove_twsi_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
295 unsigned long *config)
296{
297 unsigned long gcfg1 = readl(DOVE_GLOBAL_CONFIG_1);
298 unsigned long gcfg2 = readl(DOVE_GLOBAL_CONFIG_2);
299
300 *config = 0;
301 if (gcfg1 & DOVE_TWSI_ENABLE_OPTION1)
302 *config = 1;
303 else if (gcfg2 & DOVE_TWSI_ENABLE_OPTION2)
304 *config = 2;
305 else if (gcfg2 & DOVE_TWSI_ENABLE_OPTION3)
306 *config = 3;
307
308 return 0;
309}
310
311static int dove_twsi_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
312 unsigned long config)
313{
314 unsigned long gcfg1 = readl(DOVE_GLOBAL_CONFIG_1);
315 unsigned long gcfg2 = readl(DOVE_GLOBAL_CONFIG_2);
316
317 gcfg1 &= ~DOVE_TWSI_ENABLE_OPTION1;
318 gcfg2 &= ~(DOVE_TWSI_ENABLE_OPTION2 | DOVE_TWSI_ENABLE_OPTION2);
319
320 switch (config) {
321 case 1:
322 gcfg1 |= DOVE_TWSI_ENABLE_OPTION1;
323 break;
324 case 2:
325 gcfg2 |= DOVE_TWSI_ENABLE_OPTION2;
326 break;
327 case 3:
328 gcfg2 |= DOVE_TWSI_ENABLE_OPTION3;
329 break;
330 }
331
332 writel(gcfg1, DOVE_GLOBAL_CONFIG_1);
333 writel(gcfg2, DOVE_GLOBAL_CONFIG_2);
334
335 return 0;
336}
337
338static struct mvebu_mpp_ctrl dove_mpp_controls[] = {
339 MPP_FUNC_CTRL(0, 0, "mpp0", dove_pmu_mpp_ctrl),
340 MPP_FUNC_CTRL(1, 1, "mpp1", dove_pmu_mpp_ctrl),
341 MPP_FUNC_CTRL(2, 2, "mpp2", dove_pmu_mpp_ctrl),
342 MPP_FUNC_CTRL(3, 3, "mpp3", dove_pmu_mpp_ctrl),
343 MPP_FUNC_CTRL(4, 4, "mpp4", dove_pmu_mpp_ctrl),
344 MPP_FUNC_CTRL(5, 5, "mpp5", dove_pmu_mpp_ctrl),
345 MPP_FUNC_CTRL(6, 6, "mpp6", dove_pmu_mpp_ctrl),
346 MPP_FUNC_CTRL(7, 7, "mpp7", dove_pmu_mpp_ctrl),
347 MPP_FUNC_CTRL(8, 8, "mpp8", dove_pmu_mpp_ctrl),
348 MPP_FUNC_CTRL(9, 9, "mpp9", dove_pmu_mpp_ctrl),
349 MPP_FUNC_CTRL(10, 10, "mpp10", dove_pmu_mpp_ctrl),
350 MPP_FUNC_CTRL(11, 11, "mpp11", dove_pmu_mpp_ctrl),
351 MPP_FUNC_CTRL(12, 12, "mpp12", dove_pmu_mpp_ctrl),
352 MPP_FUNC_CTRL(13, 13, "mpp13", dove_pmu_mpp_ctrl),
353 MPP_FUNC_CTRL(14, 14, "mpp14", dove_pmu_mpp_ctrl),
354 MPP_FUNC_CTRL(15, 15, "mpp15", dove_pmu_mpp_ctrl),
355 MPP_REG_CTRL(16, 23),
356 MPP_FUNC_CTRL(24, 39, "mpp_camera", dove_mpp4_ctrl),
357 MPP_FUNC_CTRL(40, 45, "mpp_sdio0", dove_mpp4_ctrl),
358 MPP_FUNC_CTRL(46, 51, "mpp_sdio1", dove_mpp4_ctrl),
359 MPP_FUNC_GPIO_CTRL(52, 57, "mpp_audio1", dove_audio1_ctrl),
360 MPP_FUNC_CTRL(58, 61, "mpp_spi0", dove_mpp4_ctrl),
361 MPP_FUNC_CTRL(62, 63, "mpp_uart1", dove_mpp4_ctrl),
362 MPP_FUNC_CTRL(64, 71, "mpp_nand", dove_nand_ctrl),
363 MPP_FUNC_CTRL(72, 72, "audio0", dove_audio0_ctrl),
364 MPP_FUNC_CTRL(73, 73, "twsi", dove_twsi_ctrl),
365};
366
367static struct mvebu_mpp_mode dove_mpp_modes[] = {
368 MPP_MODE(0,
369 MPP_FUNCTION(0x00, "gpio", NULL),
370 MPP_FUNCTION(0x02, "uart2", "rts"),
371 MPP_FUNCTION(0x03, "sdio0", "cd"),
372 MPP_FUNCTION(0x0f, "lcd0", "pwm"),
373 MPP_FUNCTION(0x10, "pmu", NULL)),
374 MPP_MODE(1,
375 MPP_FUNCTION(0x00, "gpio", NULL),
376 MPP_FUNCTION(0x02, "uart2", "cts"),
377 MPP_FUNCTION(0x03, "sdio0", "wp"),
378 MPP_FUNCTION(0x0f, "lcd1", "pwm"),
379 MPP_FUNCTION(0x10, "pmu", NULL)),
380 MPP_MODE(2,
381 MPP_FUNCTION(0x00, "gpio", NULL),
382 MPP_FUNCTION(0x01, "sata", "prsnt"),
383 MPP_FUNCTION(0x02, "uart2", "txd"),
384 MPP_FUNCTION(0x03, "sdio0", "buspwr"),
385 MPP_FUNCTION(0x04, "uart1", "rts"),
386 MPP_FUNCTION(0x10, "pmu", NULL)),
387 MPP_MODE(3,
388 MPP_FUNCTION(0x00, "gpio", NULL),
389 MPP_FUNCTION(0x01, "sata", "act"),
390 MPP_FUNCTION(0x02, "uart2", "rxd"),
391 MPP_FUNCTION(0x03, "sdio0", "ledctrl"),
392 MPP_FUNCTION(0x04, "uart1", "cts"),
393 MPP_FUNCTION(0x0f, "lcd-spi", "cs1"),
394 MPP_FUNCTION(0x10, "pmu", NULL)),
395 MPP_MODE(4,
396 MPP_FUNCTION(0x00, "gpio", NULL),
397 MPP_FUNCTION(0x02, "uart3", "rts"),
398 MPP_FUNCTION(0x03, "sdio1", "cd"),
399 MPP_FUNCTION(0x04, "spi1", "miso"),
400 MPP_FUNCTION(0x10, "pmu", NULL)),
401 MPP_MODE(5,
402 MPP_FUNCTION(0x00, "gpio", NULL),
403 MPP_FUNCTION(0x02, "uart3", "cts"),
404 MPP_FUNCTION(0x03, "sdio1", "wp"),
405 MPP_FUNCTION(0x04, "spi1", "cs"),
406 MPP_FUNCTION(0x10, "pmu", NULL)),
407 MPP_MODE(6,
408 MPP_FUNCTION(0x00, "gpio", NULL),
409 MPP_FUNCTION(0x02, "uart3", "txd"),
410 MPP_FUNCTION(0x03, "sdio1", "buspwr"),
411 MPP_FUNCTION(0x04, "spi1", "mosi"),
412 MPP_FUNCTION(0x10, "pmu", NULL)),
413 MPP_MODE(7,
414 MPP_FUNCTION(0x00, "gpio", NULL),
415 MPP_FUNCTION(0x02, "uart3", "rxd"),
416 MPP_FUNCTION(0x03, "sdio1", "ledctrl"),
417 MPP_FUNCTION(0x04, "spi1", "sck"),
418 MPP_FUNCTION(0x10, "pmu", NULL)),
419 MPP_MODE(8,
420 MPP_FUNCTION(0x00, "gpio", NULL),
421 MPP_FUNCTION(0x01, "watchdog", "rstout"),
422 MPP_FUNCTION(0x10, "pmu", NULL)),
423 MPP_MODE(9,
424 MPP_FUNCTION(0x00, "gpio", NULL),
425 MPP_FUNCTION(0x05, "pex1", "clkreq"),
426 MPP_FUNCTION(0x10, "pmu", NULL)),
427 MPP_MODE(10,
428 MPP_FUNCTION(0x00, "gpio", NULL),
429 MPP_FUNCTION(0x05, "ssp", "sclk"),
430 MPP_FUNCTION(0x10, "pmu", NULL)),
431 MPP_MODE(11,
432 MPP_FUNCTION(0x00, "gpio", NULL),
433 MPP_FUNCTION(0x01, "sata", "prsnt"),
434 MPP_FUNCTION(0x02, "sata-1", "act"),
435 MPP_FUNCTION(0x03, "sdio0", "ledctrl"),
436 MPP_FUNCTION(0x04, "sdio1", "ledctrl"),
437 MPP_FUNCTION(0x05, "pex0", "clkreq"),
438 MPP_FUNCTION(0x10, "pmu", NULL)),
439 MPP_MODE(12,
440 MPP_FUNCTION(0x00, "gpio", NULL),
441 MPP_FUNCTION(0x01, "sata", "act"),
442 MPP_FUNCTION(0x02, "uart2", "rts"),
443 MPP_FUNCTION(0x03, "audio0", "extclk"),
444 MPP_FUNCTION(0x04, "sdio1", "cd"),
445 MPP_FUNCTION(0x10, "pmu", NULL)),
446 MPP_MODE(13,
447 MPP_FUNCTION(0x00, "gpio", NULL),
448 MPP_FUNCTION(0x02, "uart2", "cts"),
449 MPP_FUNCTION(0x03, "audio1", "extclk"),
450 MPP_FUNCTION(0x04, "sdio1", "wp"),
451 MPP_FUNCTION(0x05, "ssp", "extclk"),
452 MPP_FUNCTION(0x10, "pmu", NULL)),
453 MPP_MODE(14,
454 MPP_FUNCTION(0x00, "gpio", NULL),
455 MPP_FUNCTION(0x02, "uart2", "txd"),
456 MPP_FUNCTION(0x04, "sdio1", "buspwr"),
457 MPP_FUNCTION(0x05, "ssp", "rxd"),
458 MPP_FUNCTION(0x10, "pmu", NULL)),
459 MPP_MODE(15,
460 MPP_FUNCTION(0x00, "gpio", NULL),
461 MPP_FUNCTION(0x02, "uart2", "rxd"),
462 MPP_FUNCTION(0x04, "sdio1", "ledctrl"),
463 MPP_FUNCTION(0x05, "ssp", "sfrm"),
464 MPP_FUNCTION(0x10, "pmu", NULL)),
465 MPP_MODE(16,
466 MPP_FUNCTION(0x00, "gpio", NULL),
467 MPP_FUNCTION(0x02, "uart3", "rts"),
468 MPP_FUNCTION(0x03, "sdio0", "cd"),
469 MPP_FUNCTION(0x04, "lcd-spi", "cs1"),
470 MPP_FUNCTION(0x05, "ac97", "sdi1")),
471 MPP_MODE(17,
472 MPP_FUNCTION(0x00, "gpio", NULL),
473 MPP_FUNCTION(0x01, "ac97-1", "sysclko"),
474 MPP_FUNCTION(0x02, "uart3", "cts"),
475 MPP_FUNCTION(0x03, "sdio0", "wp"),
476 MPP_FUNCTION(0x04, "twsi", "sda"),
477 MPP_FUNCTION(0x05, "ac97", "sdi2")),
478 MPP_MODE(18,
479 MPP_FUNCTION(0x00, "gpio", NULL),
480 MPP_FUNCTION(0x02, "uart3", "txd"),
481 MPP_FUNCTION(0x03, "sdio0", "buspwr"),
482 MPP_FUNCTION(0x04, "lcd0", "pwm"),
483 MPP_FUNCTION(0x05, "ac97", "sdi3")),
484 MPP_MODE(19,
485 MPP_FUNCTION(0x00, "gpio", NULL),
486 MPP_FUNCTION(0x02, "uart3", "rxd"),
487 MPP_FUNCTION(0x03, "sdio0", "ledctrl"),
488 MPP_FUNCTION(0x04, "twsi", "sck")),
489 MPP_MODE(20,
490 MPP_FUNCTION(0x00, "gpio", NULL),
491 MPP_FUNCTION(0x01, "ac97", "sysclko"),
492 MPP_FUNCTION(0x02, "lcd-spi", "miso"),
493 MPP_FUNCTION(0x03, "sdio1", "cd"),
494 MPP_FUNCTION(0x05, "sdio0", "cd"),
495 MPP_FUNCTION(0x06, "spi1", "miso")),
496 MPP_MODE(21,
497 MPP_FUNCTION(0x00, "gpio", NULL),
498 MPP_FUNCTION(0x01, "uart1", "rts"),
499 MPP_FUNCTION(0x02, "lcd-spi", "cs0"),
500 MPP_FUNCTION(0x03, "sdio1", "wp"),
501 MPP_FUNCTION(0x04, "ssp", "sfrm"),
502 MPP_FUNCTION(0x05, "sdio0", "wp"),
503 MPP_FUNCTION(0x06, "spi1", "cs")),
504 MPP_MODE(22,
505 MPP_FUNCTION(0x00, "gpio", NULL),
506 MPP_FUNCTION(0x01, "uart1", "cts"),
507 MPP_FUNCTION(0x02, "lcd-spi", "mosi"),
508 MPP_FUNCTION(0x03, "sdio1", "buspwr"),
509 MPP_FUNCTION(0x04, "ssp", "txd"),
510 MPP_FUNCTION(0x05, "sdio0", "buspwr"),
511 MPP_FUNCTION(0x06, "spi1", "mosi")),
512 MPP_MODE(23,
513 MPP_FUNCTION(0x00, "gpio", NULL),
514 MPP_FUNCTION(0x02, "lcd-spi", "sck"),
515 MPP_FUNCTION(0x03, "sdio1", "ledctrl"),
516 MPP_FUNCTION(0x04, "ssp", "sclk"),
517 MPP_FUNCTION(0x05, "sdio0", "ledctrl"),
518 MPP_FUNCTION(0x06, "spi1", "sck")),
519 MPP_MODE(24,
520 MPP_FUNCTION(0x00, "camera", NULL),
521 MPP_FUNCTION(0x01, "gpio", NULL)),
522 MPP_MODE(40,
523 MPP_FUNCTION(0x00, "sdio0", NULL),
524 MPP_FUNCTION(0x01, "gpio", NULL)),
525 MPP_MODE(46,
526 MPP_FUNCTION(0x00, "sdio1", NULL),
527 MPP_FUNCTION(0x01, "gpio", NULL)),
528 MPP_MODE(52,
529 MPP_FUNCTION(0x00, "i2s1/spdifo", NULL),
530 MPP_FUNCTION(0x02, "i2s1", NULL),
531 MPP_FUNCTION(0x08, "spdifo", NULL),
532 MPP_FUNCTION(0x0a, "gpio", NULL),
533 MPP_FUNCTION(0x0b, "twsi", NULL),
534 MPP_FUNCTION(0x0c, "ssp/spdifo", NULL),
535 MPP_FUNCTION(0x0e, "ssp", NULL),
536 MPP_FUNCTION(0x0f, "ssp/twsi", NULL)),
537 MPP_MODE(58,
538 MPP_FUNCTION(0x00, "spi0", NULL),
539 MPP_FUNCTION(0x01, "gpio", NULL)),
540 MPP_MODE(62,
541 MPP_FUNCTION(0x00, "uart1", NULL),
542 MPP_FUNCTION(0x01, "gpio", NULL)),
543 MPP_MODE(64,
544 MPP_FUNCTION(0x00, "nand", NULL),
545 MPP_FUNCTION(0x01, "gpo", NULL)),
546 MPP_MODE(72,
547 MPP_FUNCTION(0x00, "i2s", NULL),
548 MPP_FUNCTION(0x01, "ac97", NULL)),
549 MPP_MODE(73,
550 MPP_FUNCTION(0x00, "twsi-none", NULL),
551 MPP_FUNCTION(0x01, "twsi-opt1", NULL),
552 MPP_FUNCTION(0x02, "twsi-opt2", NULL),
553 MPP_FUNCTION(0x03, "twsi-opt3", NULL)),
554};
555
556static struct pinctrl_gpio_range dove_mpp_gpio_ranges[] = {
557 MPP_GPIO_RANGE(0, 0, 0, 32),
558 MPP_GPIO_RANGE(1, 32, 32, 32),
559 MPP_GPIO_RANGE(2, 64, 64, 8),
560};
561
562static struct mvebu_pinctrl_soc_info dove_pinctrl_info = {
563 .controls = dove_mpp_controls,
564 .ncontrols = ARRAY_SIZE(dove_mpp_controls),
565 .modes = dove_mpp_modes,
566 .nmodes = ARRAY_SIZE(dove_mpp_modes),
567 .gpioranges = dove_mpp_gpio_ranges,
568 .ngpioranges = ARRAY_SIZE(dove_mpp_gpio_ranges),
569 .variant = 0,
570};
571
572static struct clk *clk;
573
574static struct of_device_id dove_pinctrl_of_match[] __devinitdata = {
575 { .compatible = "marvell,dove-pinctrl", .data = &dove_pinctrl_info },
576 { }
577};
578
579static int __devinit dove_pinctrl_probe(struct platform_device *pdev)
580{
581 const struct of_device_id *match =
582 of_match_device(dove_pinctrl_of_match, &pdev->dev);
583 pdev->dev.platform_data = match->data;
584
585 /*
586 * General MPP Configuration Register is part of pdma registers.
587 * grab clk to make sure it is ticking.
588 */
589 clk = devm_clk_get(&pdev->dev, NULL);
590 if (!IS_ERR(clk))
591 clk_prepare_enable(clk);
592
593 return mvebu_pinctrl_probe(pdev);
594}
595
596static int __devexit dove_pinctrl_remove(struct platform_device *pdev)
597{
598 int ret;
599
600 ret = mvebu_pinctrl_remove(pdev);
601 if (!IS_ERR(clk))
602 clk_disable_unprepare(clk);
603 return ret;
604}
605
606static struct platform_driver dove_pinctrl_driver = {
607 .driver = {
608 .name = "dove-pinctrl",
609 .owner = THIS_MODULE,
610 .of_match_table = of_match_ptr(dove_pinctrl_of_match),
611 },
612 .probe = dove_pinctrl_probe,
613 .remove = __devexit_p(dove_pinctrl_remove),
614};
615
616module_platform_driver(dove_pinctrl_driver);
617
618MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
619MODULE_DESCRIPTION("Marvell Dove pinctrl driver");
620MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/pinctrl-kirkwood.c b/drivers/pinctrl/pinctrl-kirkwood.c
new file mode 100644
index 000000000000..9a74ef674a0e
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-kirkwood.c
@@ -0,0 +1,472 @@
1/*
2 * Marvell Kirkwood pinctrl driver based on mvebu pinctrl core
3 *
4 * Author: Sebastian Hesselbarth <sebastian.hesselbarth@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
12#include <linux/err.h>
13#include <linux/init.h>
14#include <linux/io.h>
15#include <linux/module.h>
16#include <linux/platform_device.h>
17#include <linux/clk.h>
18#include <linux/of.h>
19#include <linux/of_device.h>
20#include <linux/pinctrl/pinctrl.h>
21
22#include "pinctrl-mvebu.h"
23
24#define V(f6180, f6190, f6192, f6281, f6282) \
25 ((f6180 << 0) | (f6190 << 1) | (f6192 << 2) | \
26 (f6281 << 3) | (f6282 << 4))
27
28enum kirkwood_variant {
29 VARIANT_MV88F6180 = V(1, 0, 0, 0, 0),
30 VARIANT_MV88F6190 = V(0, 1, 0, 0, 0),
31 VARIANT_MV88F6192 = V(0, 0, 1, 0, 0),
32 VARIANT_MV88F6281 = V(0, 0, 0, 1, 0),
33 VARIANT_MV88F6282 = V(0, 0, 0, 0, 1),
34};
35
36static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
37 MPP_MODE(0,
38 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
39 MPP_VAR_FUNCTION(0x1, "nand", "io2", V(1, 1, 1, 1, 1)),
40 MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1))),
41 MPP_MODE(1,
42 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)),
43 MPP_VAR_FUNCTION(0x1, "nand", "io3", V(1, 1, 1, 1, 1)),
44 MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1))),
45 MPP_MODE(2,
46 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)),
47 MPP_VAR_FUNCTION(0x1, "nand", "io4", V(1, 1, 1, 1, 1)),
48 MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1))),
49 MPP_MODE(3,
50 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)),
51 MPP_VAR_FUNCTION(0x1, "nand", "io5", V(1, 1, 1, 1, 1)),
52 MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1))),
53 MPP_MODE(4,
54 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
55 MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1)),
56 MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1)),
57 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1)),
58 MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1)),
59 MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0))),
60 MPP_MODE(5,
61 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)),
62 MPP_VAR_FUNCTION(0x1, "nand", "io7", V(1, 1, 1, 1, 1)),
63 MPP_VAR_FUNCTION(0x2, "uart0", "txd", V(1, 1, 1, 1, 1)),
64 MPP_VAR_FUNCTION(0x4, "ptp", "trig", V(1, 1, 1, 1, 0)),
65 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1)),
66 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1))),
67 MPP_MODE(6,
68 MPP_VAR_FUNCTION(0x0, "sysrst", "out", V(1, 1, 1, 1, 1)),
69 MPP_VAR_FUNCTION(0x1, "spi", "mosi", V(1, 1, 1, 1, 1)),
70 MPP_VAR_FUNCTION(0x2, "ptp", "trig", V(1, 1, 1, 1, 0))),
71 MPP_MODE(7,
72 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)),
73 MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0)),
74 MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1)),
75 MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0)),
76 MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1))),
77 MPP_MODE(8,
78 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
79 MPP_VAR_FUNCTION(0x1, "twsi0", "sda", V(1, 1, 1, 1, 1)),
80 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1)),
81 MPP_VAR_FUNCTION(0x3, "uart1", "rts", V(1, 1, 1, 1, 1)),
82 MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr", V(0, 1, 1, 1, 1)),
83 MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1)),
84 MPP_VAR_FUNCTION(0xc, "ptp", "clk", V(1, 1, 1, 1, 0)),
85 MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1))),
86 MPP_MODE(9,
87 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
88 MPP_VAR_FUNCTION(0x1, "twsi0", "sck", V(1, 1, 1, 1, 1)),
89 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1)),
90 MPP_VAR_FUNCTION(0x3, "uart1", "cts", V(1, 1, 1, 1, 1)),
91 MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1)),
92 MPP_VAR_FUNCTION(0xc, "ptp", "evreq", V(1, 1, 1, 1, 0)),
93 MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1))),
94 MPP_MODE(10,
95 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)),
96 MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1)),
97 MPP_VAR_FUNCTION(0X3, "uart0", "txd", V(1, 1, 1, 1, 1)),
98 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1)),
99 MPP_VAR_FUNCTION(0xc, "ptp", "trig", V(1, 1, 1, 1, 0))),
100 MPP_MODE(11,
101 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
102 MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1)),
103 MPP_VAR_FUNCTION(0x3, "uart0", "rxd", V(1, 1, 1, 1, 1)),
104 MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq", V(1, 1, 1, 1, 0)),
105 MPP_VAR_FUNCTION(0xc, "ptp-2", "trig", V(1, 1, 1, 1, 0)),
106 MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0)),
107 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1))),
108 MPP_MODE(12,
109 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 0, 1)),
110 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0)),
111 MPP_VAR_FUNCTION(0x1, "sdio", "clk", V(1, 1, 1, 1, 1)),
112 MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1)),
113 MPP_VAR_FUNCTION(0xb, "spi", "mosi", V(0, 0, 0, 0, 1)),
114 MPP_VAR_FUNCTION(0xd, "twsi1", "sda", V(0, 0, 0, 0, 1))),
115 MPP_MODE(13,
116 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
117 MPP_VAR_FUNCTION(0x1, "sdio", "cmd", V(1, 1, 1, 1, 1)),
118 MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1)),
119 MPP_VAR_FUNCTION(0xa, "audio", "rmclk", V(0, 0, 0, 0, 1)),
120 MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1))),
121 MPP_MODE(14,
122 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
123 MPP_VAR_FUNCTION(0x1, "sdio", "d0", V(1, 1, 1, 1, 1)),
124 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1)),
125 MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V(0, 0, 1, 1, 1)),
126 MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1)),
127 MPP_VAR_FUNCTION(0xb, "audio-1", "sdi", V(0, 0, 0, 0, 1)),
128 MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1))),
129 MPP_MODE(15,
130 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
131 MPP_VAR_FUNCTION(0x1, "sdio", "d1", V(1, 1, 1, 1, 1)),
132 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1)),
133 MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1)),
134 MPP_VAR_FUNCTION(0x4, "sata0", "act", V(0, 1, 1, 1, 1)),
135 MPP_VAR_FUNCTION(0xb, "spi", "cs", V(0, 0, 0, 0, 1))),
136 MPP_MODE(16,
137 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
138 MPP_VAR_FUNCTION(0x1, "sdio", "d2", V(1, 1, 1, 1, 1)),
139 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1)),
140 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1)),
141 MPP_VAR_FUNCTION(0x4, "sata1", "act", V(0, 0, 1, 1, 1)),
142 MPP_VAR_FUNCTION(0xb, "lcd", "extclk", V(0, 0, 0, 0, 1)),
143 MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1))),
144 MPP_MODE(17,
145 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
146 MPP_VAR_FUNCTION(0x1, "sdio", "d3", V(1, 1, 1, 1, 1)),
147 MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V(0, 1, 1, 1, 1)),
148 MPP_VAR_FUNCTION(0xa, "sata1", "act", V(0, 0, 0, 0, 1)),
149 MPP_VAR_FUNCTION(0xd, "twsi1", "sck", V(0, 0, 0, 0, 1))),
150 MPP_MODE(18,
151 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)),
152 MPP_VAR_FUNCTION(0x1, "nand", "io0", V(1, 1, 1, 1, 1)),
153 MPP_VAR_FUNCTION(0x2, "pex", "clkreq", V(0, 0, 0, 0, 1))),
154 MPP_MODE(19,
155 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)),
156 MPP_VAR_FUNCTION(0x1, "nand", "io1", V(1, 1, 1, 1, 1))),
157 MPP_MODE(20,
158 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
159 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 1, 1, 1)),
160 MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1)),
161 MPP_VAR_FUNCTION(0x3, "ge1", "txd0", V(0, 1, 1, 1, 1)),
162 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1)),
163 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1)),
164 MPP_VAR_FUNCTION(0xb, "lcd", "d0", V(0, 0, 0, 0, 1)),
165 MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(1, 0, 0, 0, 0))),
166 MPP_MODE(21,
167 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
168 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 1, 1, 1)),
169 MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 1, 1, 1)),
170 MPP_VAR_FUNCTION(0x3, "ge1", "txd1", V(0, 1, 1, 1, 1)),
171 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 0, 0)),
172 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1)),
173 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1)),
174 MPP_VAR_FUNCTION(0xb, "lcd", "d1", V(0, 0, 0, 0, 1))),
175 MPP_MODE(22,
176 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
177 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 1, 1, 1)),
178 MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 1, 1, 1)),
179 MPP_VAR_FUNCTION(0x3, "ge1", "txd2", V(0, 1, 1, 1, 1)),
180 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 0, 0)),
181 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 1, 1, 1)),
182 MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1)),
183 MPP_VAR_FUNCTION(0xb, "lcd", "d2", V(0, 0, 0, 0, 1))),
184 MPP_MODE(23,
185 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
186 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 1, 1, 1)),
187 MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 1, 1, 1)),
188 MPP_VAR_FUNCTION(0x3, "ge1", "txd3", V(0, 1, 1, 1, 1)),
189 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(1, 0, 0, 0, 0)),
190 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 1, 1, 1)),
191 MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1)),
192 MPP_VAR_FUNCTION(0xb, "lcd", "d3", V(0, 0, 0, 0, 1))),
193 MPP_MODE(24,
194 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
195 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 1, 1, 1)),
196 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 1, 1, 1)),
197 MPP_VAR_FUNCTION(0x3, "ge1", "rxd0", V(0, 1, 1, 1, 1)),
198 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(1, 0, 0, 0, 0)),
199 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 1, 1, 1)),
200 MPP_VAR_FUNCTION(0xb, "lcd", "d4", V(0, 0, 0, 0, 1))),
201 MPP_MODE(25,
202 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
203 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 1, 1, 1)),
204 MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 1, 1, 1)),
205 MPP_VAR_FUNCTION(0x3, "ge1", "rxd1", V(0, 1, 1, 1, 1)),
206 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(1, 0, 0, 0, 0)),
207 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 1, 1, 1)),
208 MPP_VAR_FUNCTION(0xb, "lcd", "d5", V(0, 0, 0, 0, 1))),
209 MPP_MODE(26,
210 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
211 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 1, 1, 1)),
212 MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1)),
213 MPP_VAR_FUNCTION(0x3, "ge1", "rxd2", V(0, 1, 1, 1, 1)),
214 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(1, 0, 0, 0, 0)),
215 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 1, 1, 1)),
216 MPP_VAR_FUNCTION(0xb, "lcd", "d6", V(0, 0, 0, 0, 1))),
217 MPP_MODE(27,
218 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
219 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 1, 1, 1)),
220 MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1)),
221 MPP_VAR_FUNCTION(0x3, "ge1", "rxd3", V(0, 1, 1, 1, 1)),
222 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(1, 0, 0, 0, 0)),
223 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 1, 1, 1)),
224 MPP_VAR_FUNCTION(0xb, "lcd", "d7", V(0, 0, 0, 0, 1))),
225 MPP_MODE(28,
226 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
227 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 1, 1, 1)),
228 MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 1, 1, 1)),
229 MPP_VAR_FUNCTION(0x3, "ge1", "col", V(0, 1, 1, 1, 1)),
230 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(1, 0, 0, 0, 0)),
231 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1)),
232 MPP_VAR_FUNCTION(0xb, "lcd", "d8", V(0, 0, 0, 0, 1))),
233 MPP_MODE(29,
234 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
235 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 1, 1, 1)),
236 MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 1, 1, 1)),
237 MPP_VAR_FUNCTION(0x3, "ge1", "txclk", V(0, 1, 1, 1, 1)),
238 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 0, 0)),
239 MPP_VAR_FUNCTION(0xb, "lcd", "d9", V(0, 0, 0, 0, 1))),
240 MPP_MODE(30,
241 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)),
242 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 1, 1, 1)),
243 MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 1, 1, 1)),
244 MPP_VAR_FUNCTION(0x3, "ge1", "rxctl", V(0, 1, 1, 1, 1)),
245 MPP_VAR_FUNCTION(0xb, "lcd", "d10", V(0, 0, 0, 0, 1))),
246 MPP_MODE(31,
247 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)),
248 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 1, 1, 1)),
249 MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 1, 1, 1)),
250 MPP_VAR_FUNCTION(0x3, "ge1", "rxclk", V(0, 1, 1, 1, 1)),
251 MPP_VAR_FUNCTION(0xb, "lcd", "d11", V(0, 0, 0, 0, 1))),
252 MPP_MODE(32,
253 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)),
254 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 1, 1, 1)),
255 MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 1, 1, 1)),
256 MPP_VAR_FUNCTION(0x3, "ge1", "txclko", V(0, 1, 1, 1, 1)),
257 MPP_VAR_FUNCTION(0xb, "lcd", "d12", V(0, 0, 0, 0, 1))),
258 MPP_MODE(33,
259 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 1, 1, 1, 1)),
260 MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 1, 1, 1)),
261 MPP_VAR_FUNCTION(0x3, "ge1", "txctl", V(0, 1, 1, 1, 1)),
262 MPP_VAR_FUNCTION(0xb, "lcd", "d13", V(0, 0, 0, 0, 1))),
263 MPP_MODE(34,
264 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)),
265 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 1, 1, 1)),
266 MPP_VAR_FUNCTION(0x3, "ge1", "txen", V(0, 1, 1, 1, 1)),
267 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 0, 1, 1)),
268 MPP_VAR_FUNCTION(0xb, "lcd", "d14", V(0, 0, 0, 0, 1))),
269 MPP_MODE(35,
270 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)),
271 MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1)),
272 MPP_VAR_FUNCTION(0x3, "ge1", "rxerr", V(0, 1, 1, 1, 1)),
273 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1)),
274 MPP_VAR_FUNCTION(0xb, "lcd", "d15", V(0, 0, 0, 0, 1)),
275 MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(0, 1, 1, 1, 1))),
276 MPP_MODE(36,
277 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
278 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 0, 1, 1)),
279 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 0, 1, 1)),
280 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 1, 1)),
281 MPP_VAR_FUNCTION(0xb, "twsi1", "sda", V(0, 0, 0, 0, 1))),
282 MPP_MODE(37,
283 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
284 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 0, 1, 1)),
285 MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 0, 1, 1)),
286 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 1, 1)),
287 MPP_VAR_FUNCTION(0xb, "twsi1", "sck", V(0, 0, 0, 0, 1))),
288 MPP_MODE(38,
289 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
290 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 0, 1, 1)),
291 MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 0, 1, 1)),
292 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 0, 1, 1)),
293 MPP_VAR_FUNCTION(0xb, "lcd", "d18", V(0, 0, 0, 0, 1))),
294 MPP_MODE(39,
295 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
296 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 0, 1, 1)),
297 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 0, 1, 1)),
298 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 0, 1, 1)),
299 MPP_VAR_FUNCTION(0xb, "lcd", "d19", V(0, 0, 0, 0, 1))),
300 MPP_MODE(40,
301 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
302 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 0, 1, 1)),
303 MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 0, 1, 1)),
304 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 0, 1, 1)),
305 MPP_VAR_FUNCTION(0xb, "lcd", "d20", V(0, 0, 0, 0, 1))),
306 MPP_MODE(41,
307 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
308 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 0, 1, 1)),
309 MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1)),
310 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 0, 1, 1)),
311 MPP_VAR_FUNCTION(0xb, "lcd", "d21", V(0, 0, 0, 0, 1))),
312 MPP_MODE(42,
313 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
314 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 0, 1, 1)),
315 MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1)),
316 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 0, 1, 1)),
317 MPP_VAR_FUNCTION(0xb, "lcd", "d22", V(0, 0, 0, 0, 1))),
318 MPP_MODE(43,
319 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
320 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 0, 1, 1)),
321 MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 0, 1, 1)),
322 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 0, 1, 1)),
323 MPP_VAR_FUNCTION(0xb, "lcd", "d23", V(0, 0, 0, 0, 1))),
324 MPP_MODE(44,
325 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
326 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 0, 1, 1)),
327 MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 0, 1, 1)),
328 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 1, 1)),
329 MPP_VAR_FUNCTION(0xb, "lcd", "clk", V(0, 0, 0, 0, 1))),
330 MPP_MODE(45,
331 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
332 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 1)),
333 MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 0, 1, 1)),
334 MPP_VAR_FUNCTION(0xb, "lcd", "e", V(0, 0, 0, 0, 1))),
335 MPP_MODE(46,
336 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
337 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 0, 1, 1)),
338 MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 0, 1, 1)),
339 MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1))),
340 MPP_MODE(47,
341 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
342 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 0, 1, 1)),
343 MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 0, 1, 1)),
344 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1))),
345 MPP_MODE(48,
346 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)),
347 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 0, 1, 1)),
348 MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 0, 1, 1)),
349 MPP_VAR_FUNCTION(0xb, "lcd", "d16", V(0, 0, 0, 0, 1))),
350 MPP_MODE(49,
351 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0)),
352 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 0, 0, 0, 1)),
353 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 0)),
354 MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 0, 1, 1)),
355 MPP_VAR_FUNCTION(0x5, "ptp", "clk", V(0, 0, 0, 1, 0)),
356 MPP_VAR_FUNCTION(0xa, "pex", "clkreq", V(0, 0, 0, 0, 1)),
357 MPP_VAR_FUNCTION(0xb, "lcd", "d17", V(0, 0, 0, 0, 1))),
358};
359
360static struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
361 MPP_REG_CTRL(0, 29),
362};
363
364static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
365 MPP_GPIO_RANGE(0, 0, 0, 30),
366};
367
368static struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
369 MPP_REG_CTRL(0, 35),
370};
371
372static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
373 MPP_GPIO_RANGE(0, 0, 0, 32),
374 MPP_GPIO_RANGE(1, 32, 32, 4),
375};
376
377static struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
378 MPP_REG_CTRL(0, 49),
379};
380
381static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
382 MPP_GPIO_RANGE(0, 0, 0, 32),
383 MPP_GPIO_RANGE(1, 32, 32, 18),
384};
385
386static struct mvebu_pinctrl_soc_info mv88f6180_info = {
387 .variant = VARIANT_MV88F6180,
388 .controls = mv88f6180_mpp_controls,
389 .ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls),
390 .modes = mv88f6xxx_mpp_modes,
391 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
392 .gpioranges = mv88f6180_gpio_ranges,
393 .ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges),
394};
395
396static struct mvebu_pinctrl_soc_info mv88f6190_info = {
397 .variant = VARIANT_MV88F6190,
398 .controls = mv88f619x_mpp_controls,
399 .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
400 .modes = mv88f6xxx_mpp_modes,
401 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
402 .gpioranges = mv88f619x_gpio_ranges,
403 .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
404};
405
406static struct mvebu_pinctrl_soc_info mv88f6192_info = {
407 .variant = VARIANT_MV88F6192,
408 .controls = mv88f619x_mpp_controls,
409 .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
410 .modes = mv88f6xxx_mpp_modes,
411 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
412 .gpioranges = mv88f619x_gpio_ranges,
413 .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
414};
415
416static struct mvebu_pinctrl_soc_info mv88f6281_info = {
417 .variant = VARIANT_MV88F6281,
418 .controls = mv88f628x_mpp_controls,
419 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
420 .modes = mv88f6xxx_mpp_modes,
421 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
422 .gpioranges = mv88f628x_gpio_ranges,
423 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
424};
425
426static struct mvebu_pinctrl_soc_info mv88f6282_info = {
427 .variant = VARIANT_MV88F6282,
428 .controls = mv88f628x_mpp_controls,
429 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
430 .modes = mv88f6xxx_mpp_modes,
431 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
432 .gpioranges = mv88f628x_gpio_ranges,
433 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
434};
435
436static struct of_device_id kirkwood_pinctrl_of_match[] __devinitdata = {
437 { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
438 { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
439 { .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
440 { .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
441 { .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
442 { }
443};
444
445static int __devinit kirkwood_pinctrl_probe(struct platform_device *pdev)
446{
447 const struct of_device_id *match =
448 of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
449 pdev->dev.platform_data = match->data;
450 return mvebu_pinctrl_probe(pdev);
451}
452
453static int __devexit kirkwood_pinctrl_remove(struct platform_device *pdev)
454{
455 return mvebu_pinctrl_remove(pdev);
456}
457
458static struct platform_driver kirkwood_pinctrl_driver = {
459 .driver = {
460 .name = "kirkwood-pinctrl",
461 .owner = THIS_MODULE,
462 .of_match_table = of_match_ptr(kirkwood_pinctrl_of_match),
463 },
464 .probe = kirkwood_pinctrl_probe,
465 .remove = __devexit_p(kirkwood_pinctrl_remove),
466};
467
468module_platform_driver(kirkwood_pinctrl_driver);
469
470MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
471MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver");
472MODULE_LICENSE("GPL v2");
diff --git a/drivers/pinctrl/pinctrl-mvebu.c b/drivers/pinctrl/pinctrl-mvebu.c
new file mode 100644
index 000000000000..8e6266c6249a
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-mvebu.c
@@ -0,0 +1,754 @@
1/*
2 * Marvell MVEBU pinctrl core driver
3 *
4 * Authors: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
5 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#include <linux/platform_device.h>
14#include <linux/module.h>
15#include <linux/slab.h>
16#include <linux/io.h>
17#include <linux/of.h>
18#include <linux/of_address.h>
19#include <linux/of_platform.h>
20#include <linux/err.h>
21#include <linux/gpio.h>
22#include <linux/pinctrl/machine.h>
23#include <linux/pinctrl/pinconf.h>
24#include <linux/pinctrl/pinctrl.h>
25#include <linux/pinctrl/pinmux.h>
26
27#include "core.h"
28#include "pinctrl-mvebu.h"
29
30#define MPPS_PER_REG 8
31#define MPP_BITS 4
32#define MPP_MASK 0xf
33
34struct mvebu_pinctrl_function {
35 const char *name;
36 const char **groups;
37 unsigned num_groups;
38};
39
40struct mvebu_pinctrl_group {
41 const char *name;
42 struct mvebu_mpp_ctrl *ctrl;
43 struct mvebu_mpp_ctrl_setting *settings;
44 unsigned num_settings;
45 unsigned gid;
46 unsigned *pins;
47 unsigned npins;
48};
49
50struct mvebu_pinctrl {
51 struct device *dev;
52 struct pinctrl_dev *pctldev;
53 struct pinctrl_desc desc;
54 void __iomem *base;
55 struct mvebu_pinctrl_group *groups;
56 unsigned num_groups;
57 struct mvebu_pinctrl_function *functions;
58 unsigned num_functions;
59 u8 variant;
60};
61
62static struct mvebu_pinctrl_group *mvebu_pinctrl_find_group_by_pid(
63 struct mvebu_pinctrl *pctl, unsigned pid)
64{
65 unsigned n;
66 for (n = 0; n < pctl->num_groups; n++) {
67 if (pid >= pctl->groups[n].pins[0] &&
68 pid < pctl->groups[n].pins[0] +
69 pctl->groups[n].npins)
70 return &pctl->groups[n];
71 }
72 return NULL;
73}
74
75static struct mvebu_pinctrl_group *mvebu_pinctrl_find_group_by_name(
76 struct mvebu_pinctrl *pctl, const char *name)
77{
78 unsigned n;
79 for (n = 0; n < pctl->num_groups; n++) {
80 if (strcmp(name, pctl->groups[n].name) == 0)
81 return &pctl->groups[n];
82 }
83 return NULL;
84}
85
86static struct mvebu_mpp_ctrl_setting *mvebu_pinctrl_find_setting_by_val(
87 struct mvebu_pinctrl *pctl, struct mvebu_pinctrl_group *grp,
88 unsigned long config)
89{
90 unsigned n;
91 for (n = 0; n < grp->num_settings; n++) {
92 if (config == grp->settings[n].val) {
93 if (!pctl->variant || (pctl->variant &
94 grp->settings[n].variant))
95 return &grp->settings[n];
96 }
97 }
98 return NULL;
99}
100
101static struct mvebu_mpp_ctrl_setting *mvebu_pinctrl_find_setting_by_name(
102 struct mvebu_pinctrl *pctl, struct mvebu_pinctrl_group *grp,
103 const char *name)
104{
105 unsigned n;
106 for (n = 0; n < grp->num_settings; n++) {
107 if (strcmp(name, grp->settings[n].name) == 0) {
108 if (!pctl->variant || (pctl->variant &
109 grp->settings[n].variant))
110 return &grp->settings[n];
111 }
112 }
113 return NULL;
114}
115
116static struct mvebu_mpp_ctrl_setting *mvebu_pinctrl_find_gpio_setting(
117 struct mvebu_pinctrl *pctl, struct mvebu_pinctrl_group *grp)
118{
119 unsigned n;
120 for (n = 0; n < grp->num_settings; n++) {
121 if (grp->settings[n].flags &
122 (MVEBU_SETTING_GPO | MVEBU_SETTING_GPI)) {
123 if (!pctl->variant || (pctl->variant &
124 grp->settings[n].variant))
125 return &grp->settings[n];
126 }
127 }
128 return NULL;
129}
130
131static struct mvebu_pinctrl_function *mvebu_pinctrl_find_function_by_name(
132 struct mvebu_pinctrl *pctl, const char *name)
133{
134 unsigned n;
135 for (n = 0; n < pctl->num_functions; n++) {
136 if (strcmp(name, pctl->functions[n].name) == 0)
137 return &pctl->functions[n];
138 }
139 return NULL;
140}
141
142/*
143 * Common mpp pin configuration registers on MVEBU are
144 * registers of eight 4-bit values for each mpp setting.
145 * Register offset and bit mask are calculated accordingly below.
146 */
147static int mvebu_common_mpp_get(struct mvebu_pinctrl *pctl,
148 struct mvebu_pinctrl_group *grp,
149 unsigned long *config)
150{
151 unsigned pin = grp->gid;
152 unsigned off = (pin / MPPS_PER_REG) * MPP_BITS;
153 unsigned shift = (pin % MPPS_PER_REG) * MPP_BITS;
154
155 *config = readl(pctl->base + off);
156 *config >>= shift;
157 *config &= MPP_MASK;
158
159 return 0;
160}
161
162static int mvebu_common_mpp_set(struct mvebu_pinctrl *pctl,
163 struct mvebu_pinctrl_group *grp,
164 unsigned long config)
165{
166 unsigned pin = grp->gid;
167 unsigned off = (pin / MPPS_PER_REG) * MPP_BITS;
168 unsigned shift = (pin % MPPS_PER_REG) * MPP_BITS;
169 unsigned long reg;
170
171 reg = readl(pctl->base + off);
172 reg &= ~(MPP_MASK << shift);
173 reg |= (config << shift);
174 writel(reg, pctl->base + off);
175
176 return 0;
177}
178
179static int mvebu_pinconf_group_get(struct pinctrl_dev *pctldev,
180 unsigned gid, unsigned long *config)
181{
182 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
183 struct mvebu_pinctrl_group *grp = &pctl->groups[gid];
184
185 if (!grp->ctrl)
186 return -EINVAL;
187
188 if (grp->ctrl->mpp_get)
189 return grp->ctrl->mpp_get(grp->ctrl, config);
190
191 return mvebu_common_mpp_get(pctl, grp, config);
192}
193
194static int mvebu_pinconf_group_set(struct pinctrl_dev *pctldev,
195 unsigned gid, unsigned long config)
196{
197 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
198 struct mvebu_pinctrl_group *grp = &pctl->groups[gid];
199
200 if (!grp->ctrl)
201 return -EINVAL;
202
203 if (grp->ctrl->mpp_set)
204 return grp->ctrl->mpp_set(grp->ctrl, config);
205
206 return mvebu_common_mpp_set(pctl, grp, config);
207}
208
209static void mvebu_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
210 struct seq_file *s, unsigned gid)
211{
212 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
213 struct mvebu_pinctrl_group *grp = &pctl->groups[gid];
214 struct mvebu_mpp_ctrl_setting *curr;
215 unsigned long config;
216 unsigned n;
217
218 if (mvebu_pinconf_group_get(pctldev, gid, &config))
219 return;
220
221 curr = mvebu_pinctrl_find_setting_by_val(pctl, grp, config);
222
223 if (curr) {
224 seq_printf(s, "current: %s", curr->name);
225 if (curr->subname)
226 seq_printf(s, "(%s)", curr->subname);
227 if (curr->flags & (MVEBU_SETTING_GPO | MVEBU_SETTING_GPI)) {
228 seq_printf(s, "(");
229 if (curr->flags & MVEBU_SETTING_GPI)
230 seq_printf(s, "i");
231 if (curr->flags & MVEBU_SETTING_GPO)
232 seq_printf(s, "o");
233 seq_printf(s, ")");
234 }
235 } else
236 seq_printf(s, "current: UNKNOWN");
237
238 if (grp->num_settings > 1) {
239 seq_printf(s, ", available = [");
240 for (n = 0; n < grp->num_settings; n++) {
241 if (curr == &grp->settings[n])
242 continue;
243
244 /* skip unsupported settings for this variant */
245 if (pctl->variant &&
246 !(pctl->variant & grp->settings[n].variant))
247 continue;
248
249 seq_printf(s, " %s", grp->settings[n].name);
250 if (grp->settings[n].subname)
251 seq_printf(s, "(%s)", grp->settings[n].subname);
252 if (grp->settings[n].flags &
253 (MVEBU_SETTING_GPO | MVEBU_SETTING_GPI)) {
254 seq_printf(s, "(");
255 if (grp->settings[n].flags & MVEBU_SETTING_GPI)
256 seq_printf(s, "i");
257 if (grp->settings[n].flags & MVEBU_SETTING_GPO)
258 seq_printf(s, "o");
259 seq_printf(s, ")");
260 }
261 }
262 seq_printf(s, " ]");
263 }
264 return;
265}
266
267static struct pinconf_ops mvebu_pinconf_ops = {
268 .pin_config_group_get = mvebu_pinconf_group_get,
269 .pin_config_group_set = mvebu_pinconf_group_set,
270 .pin_config_group_dbg_show = mvebu_pinconf_group_dbg_show,
271};
272
273static int mvebu_pinmux_get_funcs_count(struct pinctrl_dev *pctldev)
274{
275 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
276
277 return pctl->num_functions;
278}
279
280static const char *mvebu_pinmux_get_func_name(struct pinctrl_dev *pctldev,
281 unsigned fid)
282{
283 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
284
285 return pctl->functions[fid].name;
286}
287
288static int mvebu_pinmux_get_groups(struct pinctrl_dev *pctldev, unsigned fid,
289 const char * const **groups,
290 unsigned * const num_groups)
291{
292 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
293
294 *groups = pctl->functions[fid].groups;
295 *num_groups = pctl->functions[fid].num_groups;
296 return 0;
297}
298
299static int mvebu_pinmux_enable(struct pinctrl_dev *pctldev, unsigned fid,
300 unsigned gid)
301{
302 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
303 struct mvebu_pinctrl_function *func = &pctl->functions[fid];
304 struct mvebu_pinctrl_group *grp = &pctl->groups[gid];
305 struct mvebu_mpp_ctrl_setting *setting;
306 int ret;
307
308 setting = mvebu_pinctrl_find_setting_by_name(pctl, grp,
309 func->name);
310 if (!setting) {
311 dev_err(pctl->dev,
312 "unable to find setting %s in group %s\n",
313 func->name, func->groups[gid]);
314 return -EINVAL;
315 }
316
317 ret = mvebu_pinconf_group_set(pctldev, grp->gid, setting->val);
318 if (ret) {
319 dev_err(pctl->dev, "cannot set group %s to %s\n",
320 func->groups[gid], func->name);
321 return ret;
322 }
323
324 return 0;
325}
326
327static int mvebu_pinmux_gpio_request_enable(struct pinctrl_dev *pctldev,
328 struct pinctrl_gpio_range *range, unsigned offset)
329{
330 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
331 struct mvebu_pinctrl_group *grp;
332 struct mvebu_mpp_ctrl_setting *setting;
333
334 grp = mvebu_pinctrl_find_group_by_pid(pctl, offset);
335 if (!grp)
336 return -EINVAL;
337
338 if (grp->ctrl->mpp_gpio_req)
339 return grp->ctrl->mpp_gpio_req(grp->ctrl, offset);
340
341 setting = mvebu_pinctrl_find_gpio_setting(pctl, grp);
342 if (!setting)
343 return -ENOTSUPP;
344
345 return mvebu_pinconf_group_set(pctldev, grp->gid, setting->val);
346}
347
348static int mvebu_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
349 struct pinctrl_gpio_range *range, unsigned offset, bool input)
350{
351 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
352 struct mvebu_pinctrl_group *grp;
353 struct mvebu_mpp_ctrl_setting *setting;
354
355 grp = mvebu_pinctrl_find_group_by_pid(pctl, offset);
356 if (!grp)
357 return -EINVAL;
358
359 if (grp->ctrl->mpp_gpio_dir)
360 return grp->ctrl->mpp_gpio_dir(grp->ctrl, offset, input);
361
362 setting = mvebu_pinctrl_find_gpio_setting(pctl, grp);
363 if (!setting)
364 return -ENOTSUPP;
365
366 if ((input && (setting->flags & MVEBU_SETTING_GPI)) ||
367 (!input && (setting->flags & MVEBU_SETTING_GPO)))
368 return 0;
369
370 return -ENOTSUPP;
371}
372
373static struct pinmux_ops mvebu_pinmux_ops = {
374 .get_functions_count = mvebu_pinmux_get_funcs_count,
375 .get_function_name = mvebu_pinmux_get_func_name,
376 .get_function_groups = mvebu_pinmux_get_groups,
377 .gpio_request_enable = mvebu_pinmux_gpio_request_enable,
378 .gpio_set_direction = mvebu_pinmux_gpio_set_direction,
379 .enable = mvebu_pinmux_enable,
380};
381
382static int mvebu_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
383{
384 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
385 return pctl->num_groups;
386}
387
388static const char *mvebu_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
389 unsigned gid)
390{
391 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
392 return pctl->groups[gid].name;
393}
394
395static int mvebu_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
396 unsigned gid, const unsigned **pins,
397 unsigned *num_pins)
398{
399 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
400 *pins = pctl->groups[gid].pins;
401 *num_pins = pctl->groups[gid].npins;
402 return 0;
403}
404
405static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
406 struct device_node *np,
407 struct pinctrl_map **map,
408 unsigned *num_maps)
409{
410 struct mvebu_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
411 struct property *prop;
412 const char *function;
413 const char *group;
414 int ret, nmaps, n;
415
416 *map = NULL;
417 *num_maps = 0;
418
419 ret = of_property_read_string(np, "marvell,function", &function);
420 if (ret) {
421 dev_err(pctl->dev,
422 "missing marvell,function in node %s\n", np->name);
423 return 0;
424 }
425
426 nmaps = of_property_count_strings(np, "marvell,pins");
427 if (nmaps < 0) {
428 dev_err(pctl->dev,
429 "missing marvell,pins in node %s\n", np->name);
430 return 0;
431 }
432
433 *map = kmalloc(nmaps * sizeof(struct pinctrl_map), GFP_KERNEL);
434 if (map == NULL) {
435 dev_err(pctl->dev,
436 "cannot allocate pinctrl_map memory for %s\n",
437 np->name);
438 return -ENOMEM;
439 }
440
441 n = 0;
442 of_property_for_each_string(np, "marvell,pins", prop, group) {
443 struct mvebu_pinctrl_group *grp =
444 mvebu_pinctrl_find_group_by_name(pctl, group);
445
446 if (!grp) {
447 dev_err(pctl->dev, "unknown pin %s", group);
448 continue;
449 }
450
451 if (!mvebu_pinctrl_find_setting_by_name(pctl, grp, function)) {
452 dev_err(pctl->dev, "unsupported function %s on pin %s",
453 function, group);
454 continue;
455 }
456
457 (*map)[n].type = PIN_MAP_TYPE_MUX_GROUP;
458 (*map)[n].data.mux.group = group;
459 (*map)[n].data.mux.function = function;
460 n++;
461 }
462
463 *num_maps = nmaps;
464
465 return 0;
466}
467
468static void mvebu_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
469 struct pinctrl_map *map, unsigned num_maps)
470{
471 kfree(map);
472}
473
474static struct pinctrl_ops mvebu_pinctrl_ops = {
475 .get_groups_count = mvebu_pinctrl_get_groups_count,
476 .get_group_name = mvebu_pinctrl_get_group_name,
477 .get_group_pins = mvebu_pinctrl_get_group_pins,
478 .dt_node_to_map = mvebu_pinctrl_dt_node_to_map,
479 .dt_free_map = mvebu_pinctrl_dt_free_map,
480};
481
482static int __devinit _add_function(struct mvebu_pinctrl_function *funcs,
483 const char *name)
484{
485 while (funcs->num_groups) {
486 /* function already there */
487 if (strcmp(funcs->name, name) == 0) {
488 funcs->num_groups++;
489 return -EEXIST;
490 }
491 funcs++;
492 }
493 funcs->name = name;
494 funcs->num_groups = 1;
495 return 0;
496}
497
498static int __devinit mvebu_pinctrl_build_functions(struct platform_device *pdev,
499 struct mvebu_pinctrl *pctl)
500{
501 struct mvebu_pinctrl_function *funcs;
502 int num = 0;
503 int n, s;
504
505 /* we allocate functions for number of pins and hope
506 * there are less unique functions than pins available */
507 funcs = devm_kzalloc(&pdev->dev, pctl->desc.npins *
508 sizeof(struct mvebu_pinctrl_function), GFP_KERNEL);
509 if (!funcs)
510 return -ENOMEM;
511
512 for (n = 0; n < pctl->num_groups; n++) {
513 struct mvebu_pinctrl_group *grp = &pctl->groups[n];
514 for (s = 0; s < grp->num_settings; s++) {
515 /* skip unsupported settings on this variant */
516 if (pctl->variant &&
517 !(pctl->variant & grp->settings[s].variant))
518 continue;
519
520 /* check for unique functions and count groups */
521 if (_add_function(funcs, grp->settings[s].name))
522 continue;
523
524 num++;
525 }
526 }
527
528 /* with the number of unique functions and it's groups known,
529 reallocate functions and assign group names */
530 funcs = krealloc(funcs, num * sizeof(struct mvebu_pinctrl_function),
531 GFP_KERNEL);
532 if (!funcs)
533 return -ENOMEM;
534
535 pctl->num_functions = num;
536 pctl->functions = funcs;
537
538 for (n = 0; n < pctl->num_groups; n++) {
539 struct mvebu_pinctrl_group *grp = &pctl->groups[n];
540 for (s = 0; s < grp->num_settings; s++) {
541 struct mvebu_pinctrl_function *f;
542 const char **groups;
543
544 /* skip unsupported settings on this variant */
545 if (pctl->variant &&
546 !(pctl->variant & grp->settings[s].variant))
547 continue;
548
549 f = mvebu_pinctrl_find_function_by_name(pctl,
550 grp->settings[s].name);
551
552 /* allocate group name array if not done already */
553 if (!f->groups) {
554 f->groups = devm_kzalloc(&pdev->dev,
555 f->num_groups * sizeof(char *),
556 GFP_KERNEL);
557 if (!f->groups)
558 return -ENOMEM;
559 }
560
561 /* find next free group name and assign current name */
562 groups = f->groups;
563 while (*groups)
564 groups++;
565 *groups = grp->name;
566 }
567 }
568
569 return 0;
570}
571
572int __devinit mvebu_pinctrl_probe(struct platform_device *pdev)
573{
574 struct mvebu_pinctrl_soc_info *soc = dev_get_platdata(&pdev->dev);
575 struct device_node *np = pdev->dev.of_node;
576 struct mvebu_pinctrl *pctl;
577 void __iomem *base;
578 struct pinctrl_pin_desc *pdesc;
579 unsigned gid, n, k;
580 int ret;
581
582 if (!soc || !soc->controls || !soc->modes) {
583 dev_err(&pdev->dev, "wrong pinctrl soc info\n");
584 return -EINVAL;
585 }
586
587 base = of_iomap(np, 0);
588 if (!base) {
589 dev_err(&pdev->dev, "unable to get base address\n");
590 return -ENODEV;
591 }
592
593 pctl = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_pinctrl),
594 GFP_KERNEL);
595 if (!pctl) {
596 dev_err(&pdev->dev, "unable to alloc driver\n");
597 return -ENOMEM;
598 }
599
600 pctl->desc.name = dev_name(&pdev->dev);
601 pctl->desc.owner = THIS_MODULE;
602 pctl->desc.pctlops = &mvebu_pinctrl_ops;
603 pctl->desc.pmxops = &mvebu_pinmux_ops;
604 pctl->desc.confops = &mvebu_pinconf_ops;
605 pctl->variant = soc->variant;
606 pctl->base = base;
607 pctl->dev = &pdev->dev;
608 platform_set_drvdata(pdev, pctl);
609
610 /* count controls and create names for mvebu generic
611 register controls; also does sanity checks */
612 pctl->num_groups = 0;
613 pctl->desc.npins = 0;
614 for (n = 0; n < soc->ncontrols; n++) {
615 struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
616 char *names;
617
618 pctl->desc.npins += ctrl->npins;
619 /* initial control pins */
620 for (k = 0; k < ctrl->npins; k++)
621 ctrl->pins[k] = ctrl->pid + k;
622
623 /* special soc specific control */
624 if (ctrl->mpp_get || ctrl->mpp_set) {
625 if (!ctrl->name || !ctrl->mpp_set || !ctrl->mpp_set) {
626 dev_err(&pdev->dev, "wrong soc control info\n");
627 return -EINVAL;
628 }
629 pctl->num_groups += 1;
630 continue;
631 }
632
633 /* generic mvebu register control */
634 names = devm_kzalloc(&pdev->dev, ctrl->npins * 8, GFP_KERNEL);
635 if (!names) {
636 dev_err(&pdev->dev, "failed to alloc mpp names\n");
637 return -ENOMEM;
638 }
639 for (k = 0; k < ctrl->npins; k++)
640 sprintf(names + 8*k, "mpp%d", ctrl->pid+k);
641 ctrl->name = names;
642 pctl->num_groups += ctrl->npins;
643 }
644
645 pdesc = devm_kzalloc(&pdev->dev, pctl->desc.npins *
646 sizeof(struct pinctrl_pin_desc), GFP_KERNEL);
647 if (!pdesc) {
648 dev_err(&pdev->dev, "failed to alloc pinctrl pins\n");
649 return -ENOMEM;
650 }
651
652 for (n = 0; n < pctl->desc.npins; n++)
653 pdesc[n].number = n;
654 pctl->desc.pins = pdesc;
655
656 pctl->groups = devm_kzalloc(&pdev->dev, pctl->num_groups *
657 sizeof(struct mvebu_pinctrl_group), GFP_KERNEL);
658 if (!pctl->groups) {
659 dev_err(&pdev->dev, "failed to alloc pinctrl groups\n");
660 return -ENOMEM;
661 }
662
663 /* assign mpp controls to groups */
664 gid = 0;
665 for (n = 0; n < soc->ncontrols; n++) {
666 struct mvebu_mpp_ctrl *ctrl = &soc->controls[n];
667 pctl->groups[gid].gid = gid;
668 pctl->groups[gid].ctrl = ctrl;
669 pctl->groups[gid].name = ctrl->name;
670 pctl->groups[gid].pins = ctrl->pins;
671 pctl->groups[gid].npins = ctrl->npins;
672
673 /* generic mvebu register control maps to a number of groups */
674 if (!ctrl->mpp_get && !ctrl->mpp_set) {
675 pctl->groups[gid].npins = 1;
676
677 for (k = 1; k < ctrl->npins; k++) {
678 gid++;
679 pctl->groups[gid].gid = gid;
680 pctl->groups[gid].ctrl = ctrl;
681 pctl->groups[gid].name = &ctrl->name[8*k];
682 pctl->groups[gid].pins = &ctrl->pins[k];
683 pctl->groups[gid].npins = 1;
684 }
685 }
686 gid++;
687 }
688
689 /* assign mpp modes to groups */
690 for (n = 0; n < soc->nmodes; n++) {
691 struct mvebu_mpp_mode *mode = &soc->modes[n];
692 struct mvebu_pinctrl_group *grp =
693 mvebu_pinctrl_find_group_by_pid(pctl, mode->pid);
694 unsigned num_settings;
695
696 if (!grp) {
697 dev_warn(&pdev->dev, "unknown pinctrl group %d\n",
698 mode->pid);
699 continue;
700 }
701
702 for (num_settings = 0; ;) {
703 struct mvebu_mpp_ctrl_setting *set =
704 &mode->settings[num_settings];
705
706 if (!set->name)
707 break;
708 num_settings++;
709
710 /* skip unsupported settings for this variant */
711 if (pctl->variant && !(pctl->variant & set->variant))
712 continue;
713
714 /* find gpio/gpo/gpi settings */
715 if (strcmp(set->name, "gpio") == 0)
716 set->flags = MVEBU_SETTING_GPI |
717 MVEBU_SETTING_GPO;
718 else if (strcmp(set->name, "gpo") == 0)
719 set->flags = MVEBU_SETTING_GPO;
720 else if (strcmp(set->name, "gpi") == 0)
721 set->flags = MVEBU_SETTING_GPI;
722 }
723
724 grp->settings = mode->settings;
725 grp->num_settings = num_settings;
726 }
727
728 ret = mvebu_pinctrl_build_functions(pdev, pctl);
729 if (ret) {
730 dev_err(&pdev->dev, "unable to build functions\n");
731 return ret;
732 }
733
734 pctl->pctldev = pinctrl_register(&pctl->desc, &pdev->dev, pctl);
735 if (!pctl->pctldev) {
736 dev_err(&pdev->dev, "unable to register pinctrl driver\n");
737 return -EINVAL;
738 }
739
740 dev_info(&pdev->dev, "registered pinctrl driver\n");
741
742 /* register gpio ranges */
743 for (n = 0; n < soc->ngpioranges; n++)
744 pinctrl_add_gpio_range(pctl->pctldev, &soc->gpioranges[n]);
745
746 return 0;
747}
748
749int __devexit mvebu_pinctrl_remove(struct platform_device *pdev)
750{
751 struct mvebu_pinctrl *pctl = platform_get_drvdata(pdev);
752 pinctrl_unregister(pctl->pctldev);
753 return 0;
754}
diff --git a/drivers/pinctrl/pinctrl-mvebu.h b/drivers/pinctrl/pinctrl-mvebu.h
new file mode 100644
index 000000000000..90bd3beee860
--- /dev/null
+++ b/drivers/pinctrl/pinctrl-mvebu.h
@@ -0,0 +1,192 @@
1/*
2 * Marvell MVEBU pinctrl driver
3 *
4 * Authors: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
5 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef __PINCTRL_MVEBU_H__
14#define __PINCTRL_MVEBU_H__
15
16/**
17 * struct mvebu_mpp_ctrl - describe a mpp control
18 * @name: name of the control group
19 * @pid: first pin id handled by this control
20 * @npins: number of pins controlled by this control
21 * @mpp_get: (optional) special function to get mpp setting
22 * @mpp_set: (optional) special function to set mpp setting
23 * @mpp_gpio_req: (optional) special function to request gpio
24 * @mpp_gpio_dir: (optional) special function to set gpio direction
25 *
26 * A mpp_ctrl describes a muxable unit, e.g. pin, group of pins, or
27 * internal function, inside the SoC. Each muxable unit can be switched
28 * between two or more different settings, e.g. assign mpp pin 13 to
29 * uart1 or sata.
30 *
31 * If optional mpp_get/_set functions are set these are used to get/set
32 * a specific mode. Otherwise it is assumed that the mpp control is based
33 * on 4-bit groups in subsequent registers. The optional mpp_gpio_req/_dir
34 * functions can be used to allow pin settings with varying gpio pins.
35 */
36struct mvebu_mpp_ctrl {
37 const char *name;
38 u8 pid;
39 u8 npins;
40 unsigned *pins;
41 int (*mpp_get)(struct mvebu_mpp_ctrl *ctrl, unsigned long *config);
42 int (*mpp_set)(struct mvebu_mpp_ctrl *ctrl, unsigned long config);
43 int (*mpp_gpio_req)(struct mvebu_mpp_ctrl *ctrl, u8 pid);
44 int (*mpp_gpio_dir)(struct mvebu_mpp_ctrl *ctrl, u8 pid, bool input);
45};
46
47/**
48 * struct mvebu_mpp_ctrl_setting - describe a mpp ctrl setting
49 * @val: ctrl setting value
50 * @name: ctrl setting name, e.g. uart2, spi0 - unique per mpp_mode
51 * @subname: (optional) additional ctrl setting name, e.g. rts, cts
52 * @variant: (optional) variant identifier mask
53 * @flags: (private) flags to store gpi/gpo/gpio capabilities
54 *
55 * A ctrl_setting describes a specific internal mux function that a mpp pin
56 * can be switched to. The value (val) will be written in the corresponding
57 * register for common mpp pin configuration registers on MVEBU. SoC specific
58 * mpp_get/_set function may use val to distinguish between different settings.
59 *
60 * The name will be used to switch to this setting in DT description, e.g.
61 * marvell,function = "uart2". subname is only for debugging purposes.
62 *
63 * If name is one of "gpi", "gpo", "gpio" gpio capabilities are
64 * parsed during initialization and stored in flags.
65 *
66 * The variant can be used to combine different revisions of one SoC to a
67 * common pinctrl driver. It is matched (AND) with variant of soc_info to
68 * determine if a setting is available on the current SoC revision.
69 */
70struct mvebu_mpp_ctrl_setting {
71 u8 val;
72 const char *name;
73 const char *subname;
74 u8 variant;
75 u8 flags;
76#define MVEBU_SETTING_GPO (1 << 0)
77#define MVEBU_SETTING_GPI (1 << 1)
78};
79
80/**
81 * struct mvebu_mpp_mode - link ctrl and settings
82 * @pid: first pin id handled by this mode
83 * @settings: list of settings available for this mode
84 *
85 * A mode connects all available settings with the corresponding mpp_ctrl
86 * given by pid.
87 */
88struct mvebu_mpp_mode {
89 u8 pid;
90 struct mvebu_mpp_ctrl_setting *settings;
91};
92
93/**
94 * struct mvebu_pinctrl_soc_info - SoC specific info passed to pinctrl-mvebu
95 * @variant: variant mask of soc_info
96 * @controls: list of available mvebu_mpp_ctrls
97 * @ncontrols: number of available mvebu_mpp_ctrls
98 * @modes: list of available mvebu_mpp_modes
99 * @nmodes: number of available mvebu_mpp_modes
100 * @gpioranges: list of pinctrl_gpio_ranges
101 * @ngpioranges: number of available pinctrl_gpio_ranges
102 *
103 * This struct describes all pinctrl related information for a specific SoC.
104 * If variant is unequal 0 it will be matched (AND) with variant of each
105 * setting and allows to distinguish between different revisions of one SoC.
106 */
107struct mvebu_pinctrl_soc_info {
108 u8 variant;
109 struct mvebu_mpp_ctrl *controls;
110 int ncontrols;
111 struct mvebu_mpp_mode *modes;
112 int nmodes;
113 struct pinctrl_gpio_range *gpioranges;
114 int ngpioranges;
115};
116
117#define MPP_REG_CTRL(_idl, _idh) \
118 { \
119 .name = NULL, \
120 .pid = _idl, \
121 .npins = _idh - _idl + 1, \
122 .pins = (unsigned[_idh - _idl + 1]) { }, \
123 .mpp_get = NULL, \
124 .mpp_set = NULL, \
125 .mpp_gpio_req = NULL, \
126 .mpp_gpio_dir = NULL, \
127 }
128
129#define MPP_FUNC_CTRL(_idl, _idh, _name, _func) \
130 { \
131 .name = _name, \
132 .pid = _idl, \
133 .npins = _idh - _idl + 1, \
134 .pins = (unsigned[_idh - _idl + 1]) { }, \
135 .mpp_get = _func ## _get, \
136 .mpp_set = _func ## _set, \
137 .mpp_gpio_req = NULL, \
138 .mpp_gpio_dir = NULL, \
139 }
140
141#define MPP_FUNC_GPIO_CTRL(_idl, _idh, _name, _func) \
142 { \
143 .name = _name, \
144 .pid = _idl, \
145 .npins = _idh - _idl + 1, \
146 .pins = (unsigned[_idh - _idl + 1]) { }, \
147 .mpp_get = _func ## _get, \
148 .mpp_set = _func ## _set, \
149 .mpp_gpio_req = _func ## _gpio_req, \
150 .mpp_gpio_dir = _func ## _gpio_dir, \
151 }
152
153#define _MPP_VAR_FUNCTION(_val, _name, _subname, _mask) \
154 { \
155 .val = _val, \
156 .name = _name, \
157 .subname = _subname, \
158 .variant = _mask, \
159 .flags = 0, \
160 }
161
162#if defined(CONFIG_DEBUG_FS)
163#define MPP_VAR_FUNCTION(_val, _name, _subname, _mask) \
164 _MPP_VAR_FUNCTION(_val, _name, _subname, _mask)
165#else
166#define MPP_VAR_FUNCTION(_val, _name, _subname, _mask) \
167 _MPP_VAR_FUNCTION(_val, _name, NULL, _mask)
168#endif
169
170#define MPP_FUNCTION(_val, _name, _subname) \
171 MPP_VAR_FUNCTION(_val, _name, _subname, (u8)-1)
172
173#define MPP_MODE(_id, ...) \
174 { \
175 .pid = _id, \
176 .settings = (struct mvebu_mpp_ctrl_setting[]){ \
177 __VA_ARGS__, { } }, \
178 }
179
180#define MPP_GPIO_RANGE(_id, _pinbase, _gpiobase, _npins) \
181 { \
182 .name = "mvebu-gpio", \
183 .id = _id, \
184 .pin_base = _pinbase, \
185 .base = _gpiobase, \
186 .npins = _npins, \
187 }
188
189int mvebu_pinctrl_probe(struct platform_device *pdev);
190int mvebu_pinctrl_remove(struct platform_device *pdev);
191
192#endif
diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index 7fca6ce5952b..304360cd213e 100644
--- a/drivers/pinctrl/pinctrl-sirf.c
+++ b/drivers/pinctrl/pinctrl-sirf.c
@@ -17,6 +17,7 @@
17#include <linux/pinctrl/pinctrl.h> 17#include <linux/pinctrl/pinctrl.h>
18#include <linux/pinctrl/pinmux.h> 18#include <linux/pinctrl/pinmux.h>
19#include <linux/pinctrl/consumer.h> 19#include <linux/pinctrl/consumer.h>
20#include <linux/pinctrl/machine.h>
20#include <linux/of.h> 21#include <linux/of.h>
21#include <linux/of_address.h> 22#include <linux/of_address.h>
22#include <linux/of_device.h> 23#include <linux/of_device.h>
@@ -916,11 +917,66 @@ static void sirfsoc_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s
916 seq_printf(s, " " DRIVER_NAME); 917 seq_printf(s, " " DRIVER_NAME);
917} 918}
918 919
920static int sirfsoc_dt_node_to_map(struct pinctrl_dev *pctldev,
921 struct device_node *np_config,
922 struct pinctrl_map **map, unsigned *num_maps)
923{
924 struct sirfsoc_pmx *spmx = pinctrl_dev_get_drvdata(pctldev);
925 struct device_node *np;
926 struct property *prop;
927 const char *function, *group;
928 int ret, index = 0, count = 0;
929
930 /* calculate number of maps required */
931 for_each_child_of_node(np_config, np) {
932 ret = of_property_read_string(np, "sirf,function", &function);
933 if (ret < 0)
934 return ret;
935
936 ret = of_property_count_strings(np, "sirf,pins");
937 if (ret < 0)
938 return ret;
939
940 count += ret;
941 }
942
943 if (!count) {
944 dev_err(spmx->dev, "No child nodes passed via DT\n");
945 return -ENODEV;
946 }
947
948 *map = kzalloc(sizeof(**map) * count, GFP_KERNEL);
949 if (!*map)
950 return -ENOMEM;
951
952 for_each_child_of_node(np_config, np) {
953 of_property_read_string(np, "sirf,function", &function);
954 of_property_for_each_string(np, "sirf,pins", prop, group) {
955 (*map)[index].type = PIN_MAP_TYPE_MUX_GROUP;
956 (*map)[index].data.mux.group = group;
957 (*map)[index].data.mux.function = function;
958 index++;
959 }
960 }
961
962 *num_maps = count;
963
964 return 0;
965}
966
967static void sirfsoc_dt_free_map(struct pinctrl_dev *pctldev,
968 struct pinctrl_map *map, unsigned num_maps)
969{
970 kfree(map);
971}
972
919static struct pinctrl_ops sirfsoc_pctrl_ops = { 973static struct pinctrl_ops sirfsoc_pctrl_ops = {
920 .get_groups_count = sirfsoc_get_groups_count, 974 .get_groups_count = sirfsoc_get_groups_count,
921 .get_group_name = sirfsoc_get_group_name, 975 .get_group_name = sirfsoc_get_group_name,
922 .get_group_pins = sirfsoc_get_group_pins, 976 .get_group_pins = sirfsoc_get_group_pins,
923 .pin_dbg_show = sirfsoc_pin_dbg_show, 977 .pin_dbg_show = sirfsoc_pin_dbg_show,
978 .dt_node_to_map = sirfsoc_dt_node_to_map,
979 .dt_free_map = sirfsoc_dt_free_map,
924}; 980};
925 981
926struct sirfsoc_pmx_func { 982struct sirfsoc_pmx_func {
@@ -1221,7 +1277,7 @@ out_no_gpio_remap:
1221} 1277}
1222 1278
1223static const struct of_device_id pinmux_ids[] __devinitconst = { 1279static const struct of_device_id pinmux_ids[] __devinitconst = {
1224 { .compatible = "sirf,prima2-gpio-pinmux" }, 1280 { .compatible = "sirf,prima2-pinctrl" },
1225 {} 1281 {}
1226}; 1282};
1227 1283
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index 19241fc30050..82125269b667 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -162,6 +162,9 @@ static struct regulator_ops tps6586x_regulator_ops = {
162 .disable = tps6586x_regulator_disable, 162 .disable = tps6586x_regulator_disable,
163}; 163};
164 164
165static struct regulator_ops tps6586x_sys_regulator_ops = {
166};
167
165static const unsigned int tps6586x_ldo0_voltages[] = { 168static const unsigned int tps6586x_ldo0_voltages[] = {
166 1200000, 1500000, 1800000, 2500000, 2700000, 2850000, 3100000, 3300000, 169 1200000, 1500000, 1800000, 2500000, 2700000, 2850000, 3100000, 3300000,
167}; 170};
@@ -230,15 +233,28 @@ static const unsigned int tps6586x_dvm_voltages[] = {
230 TPS6586X_REGULATOR_DVM_GOREG(goreg, gobit) \ 233 TPS6586X_REGULATOR_DVM_GOREG(goreg, gobit) \
231} 234}
232 235
236#define TPS6586X_SYS_REGULATOR() \
237{ \
238 .desc = { \
239 .supply_name = "sys", \
240 .name = "REG-SYS", \
241 .ops = &tps6586x_sys_regulator_ops, \
242 .type = REGULATOR_VOLTAGE, \
243 .id = TPS6586X_ID_SYS, \
244 .owner = THIS_MODULE, \
245 }, \
246}
247
233static struct tps6586x_regulator tps6586x_regulator[] = { 248static struct tps6586x_regulator tps6586x_regulator[] = {
249 TPS6586X_SYS_REGULATOR(),
234 TPS6586X_LDO(LDO_0, "vinldo01", ldo0, SUPPLYV1, 5, 3, ENC, 0, END, 0), 250 TPS6586X_LDO(LDO_0, "vinldo01", ldo0, SUPPLYV1, 5, 3, ENC, 0, END, 0),
235 TPS6586X_LDO(LDO_3, "vinldo23", ldo, SUPPLYV4, 0, 3, ENC, 2, END, 2), 251 TPS6586X_LDO(LDO_3, "vinldo23", ldo, SUPPLYV4, 0, 3, ENC, 2, END, 2),
236 TPS6586X_LDO(LDO_5, NULL, ldo, SUPPLYV6, 0, 3, ENE, 6, ENE, 6), 252 TPS6586X_LDO(LDO_5, "REG-SYS", ldo, SUPPLYV6, 0, 3, ENE, 6, ENE, 6),
237 TPS6586X_LDO(LDO_6, "vinldo678", ldo, SUPPLYV3, 0, 3, ENC, 4, END, 4), 253 TPS6586X_LDO(LDO_6, "vinldo678", ldo, SUPPLYV3, 0, 3, ENC, 4, END, 4),
238 TPS6586X_LDO(LDO_7, "vinldo678", ldo, SUPPLYV3, 3, 3, ENC, 5, END, 5), 254 TPS6586X_LDO(LDO_7, "vinldo678", ldo, SUPPLYV3, 3, 3, ENC, 5, END, 5),
239 TPS6586X_LDO(LDO_8, "vinldo678", ldo, SUPPLYV2, 5, 3, ENC, 6, END, 6), 255 TPS6586X_LDO(LDO_8, "vinldo678", ldo, SUPPLYV2, 5, 3, ENC, 6, END, 6),
240 TPS6586X_LDO(LDO_9, "vinldo9", ldo, SUPPLYV6, 3, 3, ENE, 7, ENE, 7), 256 TPS6586X_LDO(LDO_9, "vinldo9", ldo, SUPPLYV6, 3, 3, ENE, 7, ENE, 7),
241 TPS6586X_LDO(LDO_RTC, NULL, ldo, SUPPLYV4, 3, 3, V4, 7, V4, 7), 257 TPS6586X_LDO(LDO_RTC, "REG-SYS", ldo, SUPPLYV4, 3, 3, V4, 7, V4, 7),
242 TPS6586X_LDO(LDO_1, "vinldo01", dvm, SUPPLYV1, 0, 5, ENC, 1, END, 1), 258 TPS6586X_LDO(LDO_1, "vinldo01", dvm, SUPPLYV1, 0, 5, ENC, 1, END, 1),
243 TPS6586X_LDO(SM_2, "vin-sm2", sm2, SUPPLYV2, 0, 5, ENC, 7, END, 7), 259 TPS6586X_LDO(SM_2, "vin-sm2", sm2, SUPPLYV2, 0, 5, ENC, 7, END, 7),
244 260
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index a1f7ac1f8cf6..b54504ee61f1 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -29,7 +29,7 @@
29#include <linux/remoteproc.h> 29#include <linux/remoteproc.h>
30 30
31#include <plat/mailbox.h> 31#include <plat/mailbox.h>
32#include <plat/remoteproc.h> 32#include <linux/platform_data/remoteproc-omap.h>
33 33
34#include "omap_remoteproc.h" 34#include "omap_remoteproc.h"
35#include "remoteproc_internal.h" 35#include "remoteproc_internal.h"
diff --git a/drivers/rtc/rtc-pxa.c b/drivers/rtc/rtc-pxa.c
index 0075c8fd93d8..f771b2ee4b18 100644
--- a/drivers/rtc/rtc-pxa.c
+++ b/drivers/rtc/rtc-pxa.c
@@ -27,6 +27,8 @@
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/of.h>
31#include <linux/of_device.h>
30 32
31#include <mach/hardware.h> 33#include <mach/hardware.h>
32 34
@@ -396,6 +398,14 @@ static int __exit pxa_rtc_remove(struct platform_device *pdev)
396 return 0; 398 return 0;
397} 399}
398 400
401#ifdef CONFIG_OF
402static struct of_device_id pxa_rtc_dt_ids[] = {
403 { .compatible = "marvell,pxa-rtc" },
404 {}
405};
406MODULE_DEVICE_TABLE(of, pxa_rtc_dt_ids);
407#endif
408
399#ifdef CONFIG_PM 409#ifdef CONFIG_PM
400static int pxa_rtc_suspend(struct device *dev) 410static int pxa_rtc_suspend(struct device *dev)
401{ 411{
@@ -425,6 +435,7 @@ static struct platform_driver pxa_rtc_driver = {
425 .remove = __exit_p(pxa_rtc_remove), 435 .remove = __exit_p(pxa_rtc_remove),
426 .driver = { 436 .driver = {
427 .name = "pxa-rtc", 437 .name = "pxa-rtc",
438 .of_match_table = of_match_ptr(pxa_rtc_dt_ids),
428#ifdef CONFIG_PM 439#ifdef CONFIG_PM
429 .pm = &pxa_rtc_pm_ops, 440 .pm = &pxa_rtc_pm_ops,
430#endif 441#endif
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index edfd12b48c28..968d08358d20 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -273,7 +273,7 @@ static void eesoxscsi_buffer_out(void *buf, int length, void __iomem *base)
273{ 273{
274 const void __iomem *reg_fas = base + EESOX_FAS216_OFFSET; 274 const void __iomem *reg_fas = base + EESOX_FAS216_OFFSET;
275 const void __iomem *reg_dmastat = base + EESOX_DMASTAT; 275 const void __iomem *reg_dmastat = base + EESOX_DMASTAT;
276 const void __iomem *reg_dmadata = base + EESOX_DMADATA; 276 void __iomem *reg_dmadata = base + EESOX_DMADATA;
277 277
278 do { 278 do {
279 unsigned int status; 279 unsigned int status;
diff --git a/drivers/sh/pfc/gpio.c b/drivers/sh/pfc/gpio.c
index 62bca98474a9..038fa071382a 100644
--- a/drivers/sh/pfc/gpio.c
+++ b/drivers/sh/pfc/gpio.c
@@ -17,6 +17,7 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/pinctrl/consumer.h> 19#include <linux/pinctrl/consumer.h>
20#include <linux/sh_pfc.h>
20 21
21struct sh_pfc_chip { 22struct sh_pfc_chip {
22 struct sh_pfc *pfc; 23 struct sh_pfc *pfc;
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 5f84b5563c2d..2d198a01a410 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -366,7 +366,7 @@ config SPI_STMP3XXX
366 366
367config SPI_TEGRA 367config SPI_TEGRA
368 tristate "Nvidia Tegra SPI controller" 368 tristate "Nvidia Tegra SPI controller"
369 depends on ARCH_TEGRA && (TEGRA_SYSTEM_DMA || TEGRA20_APB_DMA) 369 depends on ARCH_TEGRA && TEGRA20_APB_DMA
370 help 370 help
371 SPI driver for NVidia Tegra SoCs 371 SPI driver for NVidia Tegra SoCs
372 372
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 9b2901feaf78..3afe2f4f5b8e 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -30,7 +30,7 @@
30#include <linux/spi/spi_bitbang.h> 30#include <linux/spi/spi_bitbang.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32 32
33#include <mach/spi.h> 33#include <linux/platform_data/spi-davinci.h>
34#include <mach/edma.h> 34#include <mach/edma.h>
35 35
36#define SPI_NO_RESOURCE ((resource_size_t)-1) 36#define SPI_NO_RESOURCE ((resource_size_t)-1)
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index f97f1d248800..3a219599612a 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -31,8 +31,8 @@
31#include <linux/scatterlist.h> 31#include <linux/scatterlist.h>
32#include <linux/spi/spi.h> 32#include <linux/spi/spi.h>
33 33
34#include <mach/dma.h> 34#include <linux/platform_data/dma-ep93xx.h>
35#include <mach/ep93xx_spi.h> 35#include <linux/platform_data/spi-ep93xx.h>
36 36
37#define SSPCR0 0x0000 37#define SSPCR0 0x0000
38#define SSPCR0_MODE_SHIFT 6 38#define SSPCR0_MODE_SHIFT 6
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index e834ff8c0188..63e7fc9801cd 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -39,7 +39,7 @@
39#include <linux/of_gpio.h> 39#include <linux/of_gpio.h>
40#include <linux/pinctrl/consumer.h> 40#include <linux/pinctrl/consumer.h>
41 41
42#include <mach/spi.h> 42#include <linux/platform_data/spi-imx.h>
43 43
44#define DRIVER_NAME "spi_imx" 44#define DRIVER_NAME "spi_imx"
45 45
diff --git a/drivers/spi/spi-nuc900.c b/drivers/spi/spi-nuc900.c
index dae8be229c5d..a6eca6ffdabe 100644
--- a/drivers/spi/spi-nuc900.c
+++ b/drivers/spi/spi-nuc900.c
@@ -26,7 +26,7 @@
26#include <linux/spi/spi.h> 26#include <linux/spi/spi.h>
27#include <linux/spi/spi_bitbang.h> 27#include <linux/spi/spi_bitbang.h>
28 28
29#include <mach/nuc900_spi.h> 29#include <linux/platform_data/spi-nuc900.h>
30 30
31/* usi registers offset */ 31/* usi registers offset */
32#define USI_CNT 0x00 32#define USI_CNT 0x00
diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c
index a3996a1c6345..0a94d9dc9c31 100644
--- a/drivers/spi/spi-omap-uwire.c
+++ b/drivers/spi/spi-omap-uwire.c
@@ -52,7 +52,7 @@
52#include <asm/io.h> 52#include <asm/io.h>
53#include <asm/mach-types.h> 53#include <asm/mach-types.h>
54 54
55#include <plat/mux.h> 55#include <mach/mux.h>
56 56
57#include <mach/omap7xx.h> /* OMAP7XX_IO_CONF registers */ 57#include <mach/omap7xx.h> /* OMAP7XX_IO_CONF registers */
58 58
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index b5d6994c8ba3..d3d62f1e894c 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -41,7 +41,7 @@
41 41
42#include <linux/spi/spi.h> 42#include <linux/spi/spi.h>
43 43
44#include <plat/mcspi.h> 44#include <linux/platform_data/spi-omap2-mcspi.h>
45 45
46#define OMAP2_MCSPI_MAX_FREQ 48000000 46#define OMAP2_MCSPI_MAX_FREQ 48000000
47#define SPI_AUTOSUSPEND_TIMEOUT 2000 47#define SPI_AUTOSUSPEND_TIMEOUT 2000
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index d1c8441f638c..0e2a02228d5e 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -32,7 +32,7 @@
32#include <linux/of_gpio.h> 32#include <linux/of_gpio.h>
33 33
34#include <mach/dma.h> 34#include <mach/dma.h>
35#include <plat/s3c64xx-spi.h> 35#include <linux/platform_data/spi-s3c64xx.h>
36 36
37#define MAX_SPI_PORTS 3 37#define MAX_SPI_PORTS 3
38 38
diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c
index ef52c1c6f5c5..488d9b6e9cbe 100644
--- a/drivers/spi/spi-tegra.c
+++ b/drivers/spi/spi-tegra.c
@@ -164,23 +164,15 @@ struct spi_tegra_data {
164 * for the generic case. 164 * for the generic case.
165 */ 165 */
166 int dma_req_len; 166 int dma_req_len;
167#if defined(CONFIG_TEGRA_SYSTEM_DMA)
168 struct tegra_dma_req rx_dma_req;
169 struct tegra_dma_channel *rx_dma;
170#else
171 struct dma_chan *rx_dma; 167 struct dma_chan *rx_dma;
172 struct dma_slave_config sconfig; 168 struct dma_slave_config sconfig;
173 struct dma_async_tx_descriptor *rx_dma_desc; 169 struct dma_async_tx_descriptor *rx_dma_desc;
174 dma_cookie_t rx_cookie; 170 dma_cookie_t rx_cookie;
175#endif
176 u32 *rx_bb; 171 u32 *rx_bb;
177 dma_addr_t rx_bb_phys; 172 dma_addr_t rx_bb_phys;
178}; 173};
179 174
180#if !defined(CONFIG_TEGRA_SYSTEM_DMA)
181static void tegra_spi_rx_dma_complete(void *args); 175static void tegra_spi_rx_dma_complete(void *args);
182#endif
183
184static inline unsigned long spi_tegra_readl(struct spi_tegra_data *tspi, 176static inline unsigned long spi_tegra_readl(struct spi_tegra_data *tspi,
185 unsigned long reg) 177 unsigned long reg)
186{ 178{
@@ -204,10 +196,6 @@ static void spi_tegra_go(struct spi_tegra_data *tspi)
204 val &= ~SLINK_DMA_BLOCK_SIZE(~0) & ~SLINK_DMA_EN; 196 val &= ~SLINK_DMA_BLOCK_SIZE(~0) & ~SLINK_DMA_EN;
205 val |= SLINK_DMA_BLOCK_SIZE(tspi->dma_req_len / 4 - 1); 197 val |= SLINK_DMA_BLOCK_SIZE(tspi->dma_req_len / 4 - 1);
206 spi_tegra_writel(tspi, val, SLINK_DMA_CTL); 198 spi_tegra_writel(tspi, val, SLINK_DMA_CTL);
207#if defined(CONFIG_TEGRA_SYSTEM_DMA)
208 tspi->rx_dma_req.size = tspi->dma_req_len;
209 tegra_dma_enqueue_req(tspi->rx_dma, &tspi->rx_dma_req);
210#else
211 tspi->rx_dma_desc = dmaengine_prep_slave_single(tspi->rx_dma, 199 tspi->rx_dma_desc = dmaengine_prep_slave_single(tspi->rx_dma,
212 tspi->rx_bb_phys, tspi->dma_req_len, 200 tspi->rx_bb_phys, tspi->dma_req_len,
213 DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT); 201 DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT);
@@ -219,7 +207,6 @@ static void spi_tegra_go(struct spi_tegra_data *tspi)
219 tspi->rx_dma_desc->callback_param = tspi; 207 tspi->rx_dma_desc->callback_param = tspi;
220 tspi->rx_cookie = dmaengine_submit(tspi->rx_dma_desc); 208 tspi->rx_cookie = dmaengine_submit(tspi->rx_dma_desc);
221 dma_async_issue_pending(tspi->rx_dma); 209 dma_async_issue_pending(tspi->rx_dma);
222#endif
223 210
224 val |= SLINK_DMA_EN; 211 val |= SLINK_DMA_EN;
225 spi_tegra_writel(tspi, val, SLINK_DMA_CTL); 212 spi_tegra_writel(tspi, val, SLINK_DMA_CTL);
@@ -405,19 +392,12 @@ static void handle_spi_rx_dma_complete(struct spi_tegra_data *tspi)
405 392
406 spin_unlock_irqrestore(&tspi->lock, flags); 393 spin_unlock_irqrestore(&tspi->lock, flags);
407} 394}
408#if defined(CONFIG_TEGRA_SYSTEM_DMA) 395
409static void tegra_spi_rx_dma_complete(struct tegra_dma_req *req)
410{
411 struct spi_tegra_data *tspi = req->dev;
412 handle_spi_rx_dma_complete(tspi);
413}
414#else
415static void tegra_spi_rx_dma_complete(void *args) 396static void tegra_spi_rx_dma_complete(void *args)
416{ 397{
417 struct spi_tegra_data *tspi = args; 398 struct spi_tegra_data *tspi = args;
418 handle_spi_rx_dma_complete(tspi); 399 handle_spi_rx_dma_complete(tspi);
419} 400}
420#endif
421 401
422static int spi_tegra_setup(struct spi_device *spi) 402static int spi_tegra_setup(struct spi_device *spi)
423{ 403{
@@ -509,9 +489,7 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev)
509 struct spi_tegra_data *tspi; 489 struct spi_tegra_data *tspi;
510 struct resource *r; 490 struct resource *r;
511 int ret; 491 int ret;
512#if !defined(CONFIG_TEGRA_SYSTEM_DMA)
513 dma_cap_mask_t mask; 492 dma_cap_mask_t mask;
514#endif
515 493
516 master = spi_alloc_master(&pdev->dev, sizeof *tspi); 494 master = spi_alloc_master(&pdev->dev, sizeof *tspi);
517 if (master == NULL) { 495 if (master == NULL) {
@@ -563,14 +541,6 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev)
563 541
564 INIT_LIST_HEAD(&tspi->queue); 542 INIT_LIST_HEAD(&tspi->queue);
565 543
566#if defined(CONFIG_TEGRA_SYSTEM_DMA)
567 tspi->rx_dma = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT);
568 if (!tspi->rx_dma) {
569 dev_err(&pdev->dev, "can not allocate rx dma channel\n");
570 ret = -ENODEV;
571 goto err3;
572 }
573#else
574 dma_cap_zero(mask); 544 dma_cap_zero(mask);
575 dma_cap_set(DMA_SLAVE, mask); 545 dma_cap_set(DMA_SLAVE, mask);
576 tspi->rx_dma = dma_request_channel(mask, NULL, NULL); 546 tspi->rx_dma = dma_request_channel(mask, NULL, NULL);
@@ -580,8 +550,6 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev)
580 goto err3; 550 goto err3;
581 } 551 }
582 552
583#endif
584
585 tspi->rx_bb = dma_alloc_coherent(&pdev->dev, sizeof(u32) * BB_LEN, 553 tspi->rx_bb = dma_alloc_coherent(&pdev->dev, sizeof(u32) * BB_LEN,
586 &tspi->rx_bb_phys, GFP_KERNEL); 554 &tspi->rx_bb_phys, GFP_KERNEL);
587 if (!tspi->rx_bb) { 555 if (!tspi->rx_bb) {
@@ -590,17 +558,6 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev)
590 goto err4; 558 goto err4;
591 } 559 }
592 560
593#if defined(CONFIG_TEGRA_SYSTEM_DMA)
594 tspi->rx_dma_req.complete = tegra_spi_rx_dma_complete;
595 tspi->rx_dma_req.to_memory = 1;
596 tspi->rx_dma_req.dest_addr = tspi->rx_bb_phys;
597 tspi->rx_dma_req.dest_bus_width = 32;
598 tspi->rx_dma_req.source_addr = tspi->phys + SLINK_RX_FIFO;
599 tspi->rx_dma_req.source_bus_width = 32;
600 tspi->rx_dma_req.source_wrap = 4;
601 tspi->rx_dma_req.req_sel = spi_tegra_req_sels[pdev->id];
602 tspi->rx_dma_req.dev = tspi;
603#else
604 /* Dmaengine Dma slave config */ 561 /* Dmaengine Dma slave config */
605 tspi->sconfig.src_addr = tspi->phys + SLINK_RX_FIFO; 562 tspi->sconfig.src_addr = tspi->phys + SLINK_RX_FIFO;
606 tspi->sconfig.dst_addr = tspi->phys + SLINK_RX_FIFO; 563 tspi->sconfig.dst_addr = tspi->phys + SLINK_RX_FIFO;
@@ -616,7 +573,6 @@ static int __devinit spi_tegra_probe(struct platform_device *pdev)
616 ret); 573 ret);
617 goto err4; 574 goto err4;
618 } 575 }
619#endif
620 576
621 master->dev.of_node = pdev->dev.of_node; 577 master->dev.of_node = pdev->dev.of_node;
622 ret = spi_register_master(master); 578 ret = spi_register_master(master);
@@ -630,11 +586,7 @@ err5:
630 dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN, 586 dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN,
631 tspi->rx_bb, tspi->rx_bb_phys); 587 tspi->rx_bb, tspi->rx_bb_phys);
632err4: 588err4:
633#if defined(CONFIG_TEGRA_SYSTEM_DMA)
634 tegra_dma_free_channel(tspi->rx_dma);
635#else
636 dma_release_channel(tspi->rx_dma); 589 dma_release_channel(tspi->rx_dma);
637#endif
638err3: 590err3:
639 clk_put(tspi->clk); 591 clk_put(tspi->clk);
640err2: 592err2:
@@ -656,12 +608,7 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev)
656 tspi = spi_master_get_devdata(master); 608 tspi = spi_master_get_devdata(master);
657 609
658 spi_unregister_master(master); 610 spi_unregister_master(master);
659#if defined(CONFIG_TEGRA_SYSTEM_DMA)
660 tegra_dma_free_channel(tspi->rx_dma);
661#else
662 dma_release_channel(tspi->rx_dma); 611 dma_release_channel(tspi->rx_dma);
663#endif
664
665 dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN, 612 dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN,
666 tspi->rx_bb, tspi->rx_bb_phys); 613 tspi->rx_bb, tspi->rx_bb_phys);
667 614
diff --git a/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c b/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c
index a272e488e5b9..47439c3f7258 100644
--- a/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c
+++ b/drivers/staging/ste_rmi4/board-mop500-u8500uib-rmi4.c
@@ -5,7 +5,6 @@
5#include <linux/i2c.h> 5#include <linux/i2c.h>
6#include <linux/gpio.h> 6#include <linux/gpio.h>
7#include <linux/interrupt.h> 7#include <linux/interrupt.h>
8#include <mach/gpio.h>
9#include <mach/irqs.h> 8#include <mach/irqs.h>
10#include "synaptics_i2c_rmi4.h" 9#include "synaptics_i2c_rmi4.h"
11 10
diff --git a/drivers/staging/tidspbridge/core/dsp-clock.c b/drivers/staging/tidspbridge/core/dsp-clock.c
index c7df34e6b60b..7d056bd1eaad 100644
--- a/drivers/staging/tidspbridge/core/dsp-clock.c
+++ b/drivers/staging/tidspbridge/core/dsp-clock.c
@@ -21,7 +21,7 @@
21/* ----------------------------------- Host OS */ 21/* ----------------------------------- Host OS */
22#include <dspbridge/host_os.h> 22#include <dspbridge/host_os.h>
23#include <plat/dmtimer.h> 23#include <plat/dmtimer.h>
24#include <plat/mcbsp.h> 24#include <linux/platform_data/asoc-ti-mcbsp.h>
25 25
26/* ----------------------------------- DSP/BIOS Bridge */ 26/* ----------------------------------- DSP/BIOS Bridge */
27#include <dspbridge/dbdefs.h> 27#include <dspbridge/dbdefs.h>
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c
index f9609ce2c163..7bf55c40944e 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -16,7 +16,7 @@
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 */ 17 */
18 18
19#include <plat/dsp.h> 19#include <linux/platform_data/dsp-omap.h>
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22/* ----------------------------------- Host OS */ 22/* ----------------------------------- Host OS */
diff --git a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
index 16a4aafa86ae..55675b7b9b66 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430_pwr.c
@@ -19,7 +19,7 @@
19/* ----------------------------------- Host OS */ 19/* ----------------------------------- Host OS */
20#include <dspbridge/host_os.h> 20#include <dspbridge/host_os.h>
21 21
22#include <plat/dsp.h> 22#include <linux/platform_data/dsp-omap.h>
23 23
24/* ----------------------------------- DSP/BIOS Bridge */ 24/* ----------------------------------- DSP/BIOS Bridge */
25#include <dspbridge/dbdefs.h> 25#include <dspbridge/dbdefs.h>
diff --git a/drivers/staging/tidspbridge/core/tiomap_io.c b/drivers/staging/tidspbridge/core/tiomap_io.c
index 7fda10c36862..f53ed98d18c1 100644
--- a/drivers/staging/tidspbridge/core/tiomap_io.c
+++ b/drivers/staging/tidspbridge/core/tiomap_io.c
@@ -16,7 +16,7 @@
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 */ 17 */
18 18
19#include <plat/dsp.h> 19#include <linux/platform_data/dsp-omap.h>
20 20
21/* ----------------------------------- DSP/BIOS Bridge */ 21/* ----------------------------------- DSP/BIOS Bridge */
22#include <dspbridge/dbdefs.h> 22#include <dspbridge/dbdefs.h>
diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c
index 3cac01492063..49c9b662392f 100644
--- a/drivers/staging/tidspbridge/rmgr/drv_interface.c
+++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c
@@ -16,7 +16,7 @@
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 */ 17 */
18 18
19#include <plat/dsp.h> 19#include <linux/platform_data/dsp-omap.h>
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 5952b25c288e..2a093a42512f 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -51,7 +51,7 @@
51 51
52#include <asm/io.h> 52#include <asm/io.h>
53#include <asm/irq.h> 53#include <asm/irq.h>
54#include <mach/imx-uart.h> 54#include <linux/platform_data/serial-imx.h>
55 55
56/* Register definitions */ 56/* Register definitions */
57#define URXD0 0x0 /* Receiver Register */ 57#define URXD0 0x0 /* Receiver Register */
diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c
index 7c13639c597e..9bd004f9da89 100644
--- a/drivers/tty/serial/serial_ks8695.c
+++ b/drivers/tty/serial/serial_ks8695.c
@@ -548,8 +548,8 @@ static struct uart_ops ks8695uart_pops = {
548 548
549static struct uart_port ks8695uart_ports[SERIAL_KS8695_NR] = { 549static struct uart_port ks8695uart_ports[SERIAL_KS8695_NR] = {
550 { 550 {
551 .membase = (void *) KS8695_UART_VA, 551 .membase = KS8695_UART_VA,
552 .mapbase = KS8695_UART_VA, 552 .mapbase = KS8695_UART_PA,
553 .iotype = SERIAL_IO_MEM, 553 .iotype = SERIAL_IO_MEM,
554 .irq = KS8695_IRQ_UART_TX, 554 .irq = KS8695_IRQ_UART_TX,
555 .uartclk = KS8695_CLOCK_RATE * 16, 555 .uartclk = KS8695_CLOCK_RATE * 16,
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 7065df6036ca..7de2285d9fa9 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -13,7 +13,6 @@ config USB_ARCH_HAS_OHCI
13 default y if PXA3xx 13 default y if PXA3xx
14 default y if ARCH_EP93XX 14 default y if ARCH_EP93XX
15 default y if ARCH_AT91 15 default y if ARCH_AT91
16 default y if ARCH_PNX4008
17 default y if MFD_TC6393XB 16 default y if MFD_TC6393XB
18 default y if ARCH_W90X900 17 default y if ARCH_W90X900
19 default y if ARCH_DAVINCI_DA8XX 18 default y if ARCH_DAVINCI_DA8XX
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index dc5334856afe..a0eb85794fd4 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -35,7 +35,7 @@
35#include <linux/usb/ch9.h> 35#include <linux/usb/ch9.h>
36#include <linux/usb/gadget.h> 36#include <linux/usb/gadget.h>
37 37
38#include <mach/usb.h> 38#include <linux/platform_data/usb-imx_udc.h>
39#include <mach/hardware.h> 39#include <mach/hardware.h>
40 40
41#include "imx_udc.h" 41#include "imx_udc.h"
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 644b4305cb99..7a8713cda945 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -2508,7 +2508,7 @@ static int __init pxa_udc_probe(struct platform_device *pdev)
2508 IRQF_SHARED, driver_name, udc); 2508 IRQF_SHARED, driver_name, udc);
2509 if (retval != 0) { 2509 if (retval != 0) {
2510 dev_err(udc->dev, "%s: can't get irq %i, err %d\n", 2510 dev_err(udc->dev, "%s: can't get irq %i, err %d\n",
2511 driver_name, IRQ_USB, retval); 2511 driver_name, udc->irq, retval);
2512 goto err_irq; 2512 goto err_irq;
2513 } 2513 }
2514 retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget); 2514 retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index f2e51f50e528..f006045fc44c 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -43,7 +43,7 @@
43#include <mach/hardware.h> 43#include <mach/hardware.h>
44 44
45#include <plat/regs-udc.h> 45#include <plat/regs-udc.h>
46#include <plat/udc.h> 46#include <linux/platform_data/usb-s3c2410_udc.h>
47 47
48 48
49#include "s3c2410_udc.h" 49#include "s3c2410_udc.h"
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 075d2eca8108..276add2358a1 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -292,7 +292,7 @@ config USB_OHCI_HCD
292 depends on USB && USB_ARCH_HAS_OHCI 292 depends on USB && USB_ARCH_HAS_OHCI
293 select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 293 select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3
294 select USB_OTG_UTILS if ARCH_OMAP 294 select USB_OTG_UTILS if ARCH_OMAP
295 select USB_ISP1301 if ARCH_LPC32XX || ARCH_PNX4008 295 select USB_ISP1301 if ARCH_LPC32XX
296 ---help--- 296 ---help---
297 The Open Host Controller Interface (OHCI) is a standard for accessing 297 The Open Host Controller Interface (OHCI) is a standard for accessing
298 USB 1.1 host controller hardware. It does more in hardware than Intel's 298 USB 1.1 host controller hardware. It does more in hardware than Intel's
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index 34201372c85f..a6e2ea4ef8fd 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -25,7 +25,7 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26 26
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/mxc_ehci.h> 28#include <linux/platform_data/usb-ehci-mxc.h>
29 29
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31 31
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 8892d3642cef..8e7eca62f169 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -13,7 +13,7 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/mbus.h> 14#include <linux/mbus.h>
15#include <linux/clk.h> 15#include <linux/clk.h>
16#include <plat/ehci-orion.h> 16#include <linux/platform_data/usb-ehci-orion.h>
17 17
18#define rdl(off) __raw_readl(hcd->regs + (off)) 18#define rdl(off) __raw_readl(hcd->regs + (off))
19#define wrl(off, val) __raw_writel((val), hcd->regs + (off)) 19#define wrl(off, val) __raw_writel((val), hcd->regs + (off))
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 9d8f1dd57cb3..dfb14c7a61e2 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -16,7 +16,7 @@
16#include <linux/of.h> 16#include <linux/of.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/of_gpio.h> 18#include <linux/of_gpio.h>
19#include <plat/ehci.h> 19#include <linux/platform_data/usb-ehci-s5p.h>
20#include <plat/usb-phy.h> 20#include <plat/usb-phy.h>
21 21
22#define EHCI_INSNREG00(base) (base + 0x90) 22#define EHCI_INSNREG00(base) (base + 0x90)
diff --git a/drivers/usb/host/imx21-hcd.h b/drivers/usb/host/imx21-hcd.h
index 87b29fd971b4..c005770a73e9 100644
--- a/drivers/usb/host/imx21-hcd.h
+++ b/drivers/usb/host/imx21-hcd.h
@@ -24,7 +24,7 @@
24#ifndef __LINUX_IMX21_HCD_H__ 24#ifndef __LINUX_IMX21_HCD_H__
25#define __LINUX_IMX21_HCD_H__ 25#define __LINUX_IMX21_HCD_H__
26 26
27#include <mach/mx21-usbhost.h> 27#include <linux/platform_data/usb-mx2.h>
28 28
29#define NUM_ISO_ETDS 2 29#define NUM_ISO_ETDS 2
30#define USB_NUM_ETD 32 30#define USB_NUM_ETD 32
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index 269b1e0f7691..0b815a856811 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -17,7 +17,7 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18 18
19#include <mach/da8xx.h> 19#include <mach/da8xx.h>
20#include <mach/usb.h> 20#include <linux/platform_data/usb-davinci.h>
21 21
22#ifndef CONFIG_ARCH_DAVINCI_DA8XX 22#ifndef CONFIG_ARCH_DAVINCI_DA8XX
23#error "This file is DA8xx bus glue. Define CONFIG_ARCH_DAVINCI_DA8XX." 23#error "This file is DA8xx bus glue. Define CONFIG_ARCH_DAVINCI_DA8XX."
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index fc3091bd2379..20a50081f922 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -14,7 +14,7 @@
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <mach/ohci.h> 17#include <linux/platform_data/usb-exynos.h>
18#include <plat/usb-phy.h> 18#include <plat/usb-phy.h>
19 19
20struct exynos_ohci_hcd { 20struct exynos_ohci_hcd {
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 2b1e8d84c873..6780010e9c3c 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1049,7 +1049,7 @@ MODULE_LICENSE ("GPL");
1049#define PLATFORM_DRIVER ohci_hcd_at91_driver 1049#define PLATFORM_DRIVER ohci_hcd_at91_driver
1050#endif 1050#endif
1051 1051
1052#if defined(CONFIG_ARCH_PNX4008) || defined(CONFIG_ARCH_LPC32XX) 1052#ifdef CONFIG_ARCH_LPC32XX
1053#include "ohci-nxp.c" 1053#include "ohci-nxp.c"
1054#define PLATFORM_DRIVER usb_hcd_nxp_driver 1054#define PLATFORM_DRIVER usb_hcd_nxp_driver
1055#endif 1055#endif
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
index a446386bf779..119966603d8d 100644
--- a/drivers/usb/host/ohci-nxp.c
+++ b/drivers/usb/host/ohci-nxp.c
@@ -2,7 +2,6 @@
2 * driver for NXP USB Host devices 2 * driver for NXP USB Host devices
3 * 3 *
4 * Currently supported OHCI host devices: 4 * Currently supported OHCI host devices:
5 * - Philips PNX4008
6 * - NXP LPC32xx 5 * - NXP LPC32xx
7 * 6 *
8 * Authors: Dmitry Chigirev <source@mvista.com> 7 * Authors: Dmitry Chigirev <source@mvista.com>
@@ -66,38 +65,6 @@ static struct clk *usb_pll_clk;
66static struct clk *usb_dev_clk; 65static struct clk *usb_dev_clk;
67static struct clk *usb_otg_clk; 66static struct clk *usb_otg_clk;
68 67
69static void isp1301_configure_pnx4008(void)
70{
71 /* PNX4008 only supports DAT_SE0 USB mode */
72 /* PNX4008 R2A requires setting the MAX603 to output 3.6V */
73 /* Power up externel charge-pump */
74
75 i2c_smbus_write_byte_data(isp1301_i2c_client,
76 ISP1301_I2C_MODE_CONTROL_1, MC1_DAT_SE0 | MC1_SPEED_REG);
77 i2c_smbus_write_byte_data(isp1301_i2c_client,
78 ISP1301_I2C_MODE_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR,
79 ~(MC1_DAT_SE0 | MC1_SPEED_REG));
80 i2c_smbus_write_byte_data(isp1301_i2c_client,
81 ISP1301_I2C_MODE_CONTROL_2,
82 MC2_BI_DI | MC2_PSW_EN | MC2_SPD_SUSP_CTRL);
83 i2c_smbus_write_byte_data(isp1301_i2c_client,
84 ISP1301_I2C_MODE_CONTROL_2 | ISP1301_I2C_REG_CLEAR_ADDR,
85 ~(MC2_BI_DI | MC2_PSW_EN | MC2_SPD_SUSP_CTRL));
86 i2c_smbus_write_byte_data(isp1301_i2c_client,
87 ISP1301_I2C_OTG_CONTROL_1, OTG1_DM_PULLDOWN | OTG1_DP_PULLDOWN);
88 i2c_smbus_write_byte_data(isp1301_i2c_client,
89 ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR,
90 ~(OTG1_DM_PULLDOWN | OTG1_DP_PULLDOWN));
91 i2c_smbus_write_byte_data(isp1301_i2c_client,
92 ISP1301_I2C_INTERRUPT_LATCH | ISP1301_I2C_REG_CLEAR_ADDR, 0xFF);
93 i2c_smbus_write_byte_data(isp1301_i2c_client,
94 ISP1301_I2C_INTERRUPT_FALLING | ISP1301_I2C_REG_CLEAR_ADDR,
95 0xFF);
96 i2c_smbus_write_byte_data(isp1301_i2c_client,
97 ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR,
98 0xFF);
99}
100
101static void isp1301_configure_lpc32xx(void) 68static void isp1301_configure_lpc32xx(void)
102{ 69{
103 /* LPC32XX only supports DAT_SE0 USB mode */ 70 /* LPC32XX only supports DAT_SE0 USB mode */
@@ -149,10 +116,7 @@ static void isp1301_configure_lpc32xx(void)
149 116
150static void isp1301_configure(void) 117static void isp1301_configure(void)
151{ 118{
152 if (machine_is_pnx4008()) 119 isp1301_configure_lpc32xx();
153 isp1301_configure_pnx4008();
154 else
155 isp1301_configure_lpc32xx();
156} 120}
157 121
158static inline void isp1301_vbus_on(void) 122static inline void isp1301_vbus_on(void)
@@ -241,47 +205,6 @@ static const struct hc_driver ohci_nxp_hc_driver = {
241 .start_port_reset = ohci_start_port_reset, 205 .start_port_reset = ohci_start_port_reset,
242}; 206};
243 207
244static void nxp_set_usb_bits(void)
245{
246 if (machine_is_pnx4008()) {
247 start_int_set_falling_edge(SE_USB_OTG_ATX_INT_N);
248 start_int_ack(SE_USB_OTG_ATX_INT_N);
249 start_int_umask(SE_USB_OTG_ATX_INT_N);
250
251 start_int_set_rising_edge(SE_USB_OTG_TIMER_INT);
252 start_int_ack(SE_USB_OTG_TIMER_INT);
253 start_int_umask(SE_USB_OTG_TIMER_INT);
254
255 start_int_set_rising_edge(SE_USB_I2C_INT);
256 start_int_ack(SE_USB_I2C_INT);
257 start_int_umask(SE_USB_I2C_INT);
258
259 start_int_set_rising_edge(SE_USB_INT);
260 start_int_ack(SE_USB_INT);
261 start_int_umask(SE_USB_INT);
262
263 start_int_set_rising_edge(SE_USB_NEED_CLK_INT);
264 start_int_ack(SE_USB_NEED_CLK_INT);
265 start_int_umask(SE_USB_NEED_CLK_INT);
266
267 start_int_set_rising_edge(SE_USB_AHB_NEED_CLK_INT);
268 start_int_ack(SE_USB_AHB_NEED_CLK_INT);
269 start_int_umask(SE_USB_AHB_NEED_CLK_INT);
270 }
271}
272
273static void nxp_unset_usb_bits(void)
274{
275 if (machine_is_pnx4008()) {
276 start_int_mask(SE_USB_OTG_ATX_INT_N);
277 start_int_mask(SE_USB_OTG_TIMER_INT);
278 start_int_mask(SE_USB_I2C_INT);
279 start_int_mask(SE_USB_INT);
280 start_int_mask(SE_USB_NEED_CLK_INT);
281 start_int_mask(SE_USB_AHB_NEED_CLK_INT);
282 }
283}
284
285static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev) 208static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev)
286{ 209{
287 struct usb_hcd *hcd = 0; 210 struct usb_hcd *hcd = 0;
@@ -376,9 +299,6 @@ static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev)
376 goto out8; 299 goto out8;
377 } 300 }
378 301
379 /* Set all USB bits in the Start Enable register */
380 nxp_set_usb_bits();
381
382 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 302 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
383 if (!res) { 303 if (!res) {
384 dev_err(&pdev->dev, "Failed to get MEM resource\n"); 304 dev_err(&pdev->dev, "Failed to get MEM resource\n");
@@ -413,7 +333,6 @@ static int __devinit usb_hcd_nxp_probe(struct platform_device *pdev)
413 333
414 nxp_stop_hc(); 334 nxp_stop_hc();
415out8: 335out8:
416 nxp_unset_usb_bits();
417 usb_put_hcd(hcd); 336 usb_put_hcd(hcd);
418out7: 337out7:
419 clk_disable(usb_otg_clk); 338 clk_disable(usb_otg_clk);
@@ -441,7 +360,6 @@ static int usb_hcd_nxp_remove(struct platform_device *pdev)
441 nxp_stop_hc(); 360 nxp_stop_hc();
442 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 361 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
443 usb_put_hcd(hcd); 362 usb_put_hcd(hcd);
444 nxp_unset_usb_bits();
445 clk_disable(usb_pll_clk); 363 clk_disable(usb_pll_clk);
446 clk_put(usb_pll_clk); 364 clk_put(usb_pll_clk);
447 clk_disable(usb_dev_clk); 365 clk_disable(usb_dev_clk);
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index f8b2d91851f7..4531d03503c3 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -24,7 +24,7 @@
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/mach-types.h> 25#include <asm/mach-types.h>
26 26
27#include <plat/mux.h> 27#include <mach/mux.h>
28#include <plat/fpga.h> 28#include <plat/fpga.h>
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index e1a3cc6d28dc..955c410d59b6 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -24,8 +24,8 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/ohci.h> 27#include <linux/platform_data/usb-ohci-pxa27x.h>
28#include <mach/pxa3xx-u2d.h> 28#include <linux/platform_data/usb-pxa3xx-ulpi.h>
29 29
30/* 30/*
31 * UHC: USB Host Controller (OHCI-like) register definitions 31 * UHC: USB Host Controller (OHCI-like) register definitions
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index 664c869eb096..0d2309ca471e 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <plat/usb-control.h> 24#include <linux/platform_data/usb-ohci-s3c2410.h>
25 25
26#define valid_port(idx) ((idx) == 1 || (idx) == 2) 26#define valid_port(idx) ((idx) == 1 || (idx) == 2)
27 27
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 0f9fcec4e1d3..15a262754150 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -35,7 +35,7 @@
35#include <linux/dma-mapping.h> 35#include <linux/dma-mapping.h>
36 36
37#include <mach/da8xx.h> 37#include <mach/da8xx.h>
38#include <mach/usb.h> 38#include <linux/platform_data/usb-davinci.h>
39 39
40#include "musb_core.h" 40#include "musb_core.h"
41 41
diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c
index b67b4bc596c1..89f0709f8935 100644
--- a/drivers/usb/musb/tusb6010_omap.c
+++ b/drivers/usb/musb/tusb6010_omap.c
@@ -17,7 +17,6 @@
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <plat/dma.h> 19#include <plat/dma.h>
20#include <plat/mux.h>
21 20
22#include "musb_core.h" 21#include "musb_core.h"
23#include "tusb6010.h" 22#include "tusb6010.h"
diff --git a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
index d05c7fbbb703..f82246d2fd16 100644
--- a/drivers/usb/musb/ux500_dma.c
+++ b/drivers/usb/musb/ux500_dma.c
@@ -30,7 +30,7 @@
30#include <linux/dma-mapping.h> 30#include <linux/dma-mapping.h>
31#include <linux/dmaengine.h> 31#include <linux/dmaengine.h>
32#include <linux/pfn.h> 32#include <linux/pfn.h>
33#include <mach/usb.h> 33#include <linux/platform_data/usb-musb-ux500.h>
34#include "musb_core.h" 34#include "musb_core.h"
35 35
36struct ux500_dma_channel { 36struct ux500_dma_channel {
diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c
index 7a88667742b6..81f1f9a0be8f 100644
--- a/drivers/usb/otg/isp1301_omap.c
+++ b/drivers/usb/otg/isp1301_omap.c
@@ -36,7 +36,7 @@
36#include <asm/irq.h> 36#include <asm/irq.h>
37#include <asm/mach-types.h> 37#include <asm/mach-types.h>
38 38
39#include <plat/mux.h> 39#include <mach/mux.h>
40 40
41#include <mach/usb.h> 41#include <mach/usb.h>
42 42
diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c
index 92257ef19403..9a046a4c98f5 100644
--- a/drivers/video/backlight/omap1_bl.c
+++ b/drivers/video/backlight/omap1_bl.c
@@ -30,7 +30,7 @@
30#include <linux/platform_data/omap1_bl.h> 30#include <linux/platform_data/omap1_bl.h>
31 31
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <plat/mux.h> 33#include <mach/mux.h>
34 34
35#define OMAPBL_MAX_INTENSITY 0xff 35#define OMAPBL_MAX_INTENSITY 0xff
36 36
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index 7ae9d53f2bf1..113d43a16f54 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -131,7 +131,7 @@
131#define UPPER_MARGIN 32 131#define UPPER_MARGIN 32
132#define LOWER_MARGIN 32 132#define LOWER_MARGIN 32
133 133
134static resource_size_t da8xx_fb_reg_base; 134static void __iomem *da8xx_fb_reg_base;
135static struct resource *lcdc_regs; 135static struct resource *lcdc_regs;
136static unsigned int lcd_revision; 136static unsigned int lcd_revision;
137static irq_handler_t lcdc_irq_handler; 137static irq_handler_t lcdc_irq_handler;
@@ -951,7 +951,7 @@ static int __devexit fb_remove(struct platform_device *dev)
951 clk_disable(par->lcdc_clk); 951 clk_disable(par->lcdc_clk);
952 clk_put(par->lcdc_clk); 952 clk_put(par->lcdc_clk);
953 framebuffer_release(info); 953 framebuffer_release(info);
954 iounmap((void __iomem *)da8xx_fb_reg_base); 954 iounmap(da8xx_fb_reg_base);
955 release_mem_region(lcdc_regs->start, resource_size(lcdc_regs)); 955 release_mem_region(lcdc_regs->start, resource_size(lcdc_regs));
956 956
957 } 957 }
@@ -1171,7 +1171,7 @@ static int __devinit fb_probe(struct platform_device *device)
1171 if (!lcdc_regs) 1171 if (!lcdc_regs)
1172 return -EBUSY; 1172 return -EBUSY;
1173 1173
1174 da8xx_fb_reg_base = (resource_size_t)ioremap(lcdc_regs->start, len); 1174 da8xx_fb_reg_base = ioremap(lcdc_regs->start, len);
1175 if (!da8xx_fb_reg_base) { 1175 if (!da8xx_fb_reg_base) {
1176 ret = -EBUSY; 1176 ret = -EBUSY;
1177 goto err_request_mem; 1177 goto err_request_mem;
@@ -1392,7 +1392,7 @@ err_clk_put:
1392 clk_put(fb_clk); 1392 clk_put(fb_clk);
1393 1393
1394err_ioremap: 1394err_ioremap:
1395 iounmap((void __iomem *)da8xx_fb_reg_base); 1395 iounmap(da8xx_fb_reg_base);
1396 1396
1397err_request_mem: 1397err_request_mem:
1398 release_mem_region(lcdc_regs->start, len); 1398 release_mem_region(lcdc_regs->start, len);
diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c
index 345d96230978..f2c092da84b0 100644
--- a/drivers/video/ep93xx-fb.c
+++ b/drivers/video/ep93xx-fb.c
@@ -24,7 +24,7 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/fb.h> 25#include <linux/fb.h>
26 26
27#include <mach/fb.h> 27#include <linux/platform_data/video-ep93xx.h>
28 28
29/* Vertical Frame Timing Registers */ 29/* Vertical Frame Timing Registers */
30#define EP93XXFB_VLINES_TOTAL 0x0000 /* SW locked */ 30#define EP93XXFB_VLINES_TOTAL 0x0000 /* SW locked */
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index caad3689b4e6..53ffdfc82a75 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -32,7 +32,7 @@
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/math64.h> 33#include <linux/math64.h>
34 34
35#include <mach/imxfb.h> 35#include <linux/platform_data/video-imxfb.h>
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37 37
38/* 38/*
diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
index b061d709bc44..bf73f0480061 100644
--- a/drivers/video/msm/mddi.c
+++ b/drivers/video/msm/mddi.c
@@ -29,7 +29,7 @@
29#include <mach/msm_iomap.h> 29#include <mach/msm_iomap.h>
30#include <mach/irqs.h> 30#include <mach/irqs.h>
31#include <mach/board.h> 31#include <mach/board.h>
32#include <mach/msm_fb.h> 32#include <linux/platform_data/video-msm_fb.h>
33#include "mddi_hw.h" 33#include "mddi_hw.h"
34 34
35#define FLAG_DISABLE_HIBERNATION 0x0001 35#define FLAG_DISABLE_HIBERNATION 0x0001
diff --git a/drivers/video/msm/mddi_client_dummy.c b/drivers/video/msm/mddi_client_dummy.c
index d2a091cebe2c..f1b0dfcc9717 100644
--- a/drivers/video/msm/mddi_client_dummy.c
+++ b/drivers/video/msm/mddi_client_dummy.c
@@ -20,7 +20,7 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22 22
23#include <mach/msm_fb.h> 23#include <linux/platform_data/video-msm_fb.h>
24 24
25struct panel_info { 25struct panel_info {
26 struct platform_device pdev; 26 struct platform_device pdev;
diff --git a/drivers/video/msm/mddi_client_nt35399.c b/drivers/video/msm/mddi_client_nt35399.c
index 7fcd67e132bf..d7a5bf84fb2a 100644
--- a/drivers/video/msm/mddi_client_nt35399.c
+++ b/drivers/video/msm/mddi_client_nt35399.c
@@ -22,7 +22,7 @@
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <mach/msm_fb.h> 25#include <linux/platform_data/video-msm_fb.h>
26 26
27static DECLARE_WAIT_QUEUE_HEAD(nt35399_vsync_wait); 27static DECLARE_WAIT_QUEUE_HEAD(nt35399_vsync_wait);
28 28
diff --git a/drivers/video/msm/mddi_client_toshiba.c b/drivers/video/msm/mddi_client_toshiba.c
index 053eb6877330..061d7dfebbf3 100644
--- a/drivers/video/msm/mddi_client_toshiba.c
+++ b/drivers/video/msm/mddi_client_toshiba.c
@@ -22,7 +22,7 @@
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <mach/msm_fb.h> 25#include <linux/platform_data/video-msm_fb.h>
26 26
27 27
28#define LCD_CONTROL_BLOCK_BASE 0x110000 28#define LCD_CONTROL_BLOCK_BASE 0x110000
diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c
index cb2ddf164c98..d1f881e8030e 100644
--- a/drivers/video/msm/mdp.c
+++ b/drivers/video/msm/mdp.c
@@ -26,7 +26,7 @@
26#include <linux/slab.h> 26#include <linux/slab.h>
27 27
28#include <mach/msm_iomap.h> 28#include <mach/msm_iomap.h>
29#include <mach/msm_fb.h> 29#include <linux/platform_data/video-msm_fb.h>
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/export.h> 31#include <linux/export.h>
32 32
diff --git a/drivers/video/msm/mdp_hw.h b/drivers/video/msm/mdp_hw.h
index d80477415caa..a0bacf581b32 100644
--- a/drivers/video/msm/mdp_hw.h
+++ b/drivers/video/msm/mdp_hw.h
@@ -16,7 +16,7 @@
16#define _MDP_HW_H_ 16#define _MDP_HW_H_
17 17
18#include <mach/msm_iomap.h> 18#include <mach/msm_iomap.h>
19#include <mach/msm_fb.h> 19#include <linux/platform_data/video-msm_fb.h>
20 20
21struct mdp_info { 21struct mdp_info {
22 struct mdp_device mdp_dev; 22 struct mdp_device mdp_dev;
diff --git a/drivers/video/msm/mdp_ppp.c b/drivers/video/msm/mdp_ppp.c
index 2b6564e8bfea..be6079cdfbb6 100644
--- a/drivers/video/msm/mdp_ppp.c
+++ b/drivers/video/msm/mdp_ppp.c
@@ -16,7 +16,7 @@
16#include <linux/file.h> 16#include <linux/file.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/msm_mdp.h> 18#include <linux/msm_mdp.h>
19#include <mach/msm_fb.h> 19#include <linux/platform_data/video-msm_fb.h>
20 20
21#include "mdp_hw.h" 21#include "mdp_hw.h"
22#include "mdp_scale_tables.h" 22#include "mdp_scale_tables.h"
diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c
index c6e3b4fcdd68..ec08a9ec377d 100644
--- a/drivers/video/msm/msm_fb.c
+++ b/drivers/video/msm/msm_fb.c
@@ -25,7 +25,7 @@
25#include <linux/msm_mdp.h> 25#include <linux/msm_mdp.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/uaccess.h> 27#include <linux/uaccess.h>
28#include <mach/msm_fb.h> 28#include <linux/platform_data/video-msm_fb.h>
29#include <mach/board.h> 29#include <mach/board.h>
30#include <linux/workqueue.h> 30#include <linux/workqueue.h>
31#include <linux/clk.h> 31#include <linux/clk.h>
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index c89f8a8d36d2..d7381088a180 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -27,10 +27,10 @@
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/mutex.h> 28#include <linux/mutex.h>
29 29
30#include <mach/dma.h> 30#include <linux/platform_data/dma-imx.h>
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/ipu.h> 32#include <mach/ipu.h>
33#include <mach/mx3fb.h> 33#include <linux/platform_data/video-mx3fb.h>
34 34
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
index e10f551ade21..93387555337e 100644
--- a/drivers/video/nuc900fb.c
+++ b/drivers/video/nuc900fb.c
@@ -38,7 +38,7 @@
38#include <mach/map.h> 38#include <mach/map.h>
39#include <mach/regs-clock.h> 39#include <mach/regs-clock.h>
40#include <mach/regs-ldm.h> 40#include <mach/regs-ldm.h>
41#include <mach/fb.h> 41#include <linux/platform_data/video-nuc900fb.h>
42 42
43#include "nuc900fb.h" 43#include "nuc900fb.h"
44 44
diff --git a/drivers/video/nuc900fb.h b/drivers/video/nuc900fb.h
index bc7c9300f276..9a1ca6dbb6b2 100644
--- a/drivers/video/nuc900fb.h
+++ b/drivers/video/nuc900fb.h
@@ -16,7 +16,7 @@
16#define __NUC900FB_H 16#define __NUC900FB_H
17 17
18#include <mach/map.h> 18#include <mach/map.h>
19#include <mach/fb.h> 19#include <linux/platform_data/video-nuc900fb.h>
20 20
21enum nuc900_lcddrv_type { 21enum nuc900_lcddrv_type {
22 LCDDRV_NUC910, 22 LCDDRV_NUC910,
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c
index d3a311327227..ed4cad87fbcd 100644
--- a/drivers/video/omap/lcd_ams_delta.c
+++ b/drivers/video/omap/lcd_ams_delta.c
@@ -27,8 +27,7 @@
27#include <linux/lcd.h> 27#include <linux/lcd.h>
28#include <linux/gpio.h> 28#include <linux/gpio.h>
29 29
30#include <plat/board-ams-delta.h> 30#include <mach/board-ams-delta.h>
31#include <mach/hardware.h>
32 31
33#include "omapfb.h" 32#include "omapfb.h"
34 33
diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c
index e3880c4a0bb1..b739600c51ac 100644
--- a/drivers/video/omap/lcd_mipid.c
+++ b/drivers/video/omap/lcd_mipid.c
@@ -25,7 +25,7 @@
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/module.h> 26#include <linux/module.h>
27 27
28#include <plat/lcd_mipid.h> 28#include <linux/platform_data/lcd-mipid.h>
29 29
30#include "omapfb.h" 30#include "omapfb.h"
31 31
diff --git a/drivers/video/omap/lcd_osk.c b/drivers/video/omap/lcd_osk.c
index 5914220dfa9c..3aa62da89195 100644
--- a/drivers/video/omap/lcd_osk.c
+++ b/drivers/video/omap/lcd_osk.c
@@ -24,7 +24,7 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25 25
26#include <asm/gpio.h> 26#include <asm/gpio.h>
27#include <plat/mux.h> 27#include <mach/mux.h>
28#include "omapfb.h" 28#include "omapfb.h"
29 29
30static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev) 30static int osk_panel_init(struct lcd_panel *panel, struct omapfb_device *fbdev)
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 3f902557690e..4fa2ad43fd97 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -61,7 +61,7 @@
61#include <asm/irq.h> 61#include <asm/irq.h>
62#include <asm/div64.h> 62#include <asm/div64.h>
63#include <mach/bitfield.h> 63#include <mach/bitfield.h>
64#include <mach/pxafb.h> 64#include <linux/platform_data/video-pxafb.h>
65 65
66/* 66/*
67 * Complain if VAR is out of range. 67 * Complain if VAR is out of range.
diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index 2a5fe6ede845..66a74f9073fb 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -30,7 +30,7 @@
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/wait.h> 31#include <linux/wait.h>
32 32
33#include <mach/vt8500fb.h> 33#include <linux/platform_data/video-vt8500lcdfb.h>
34 34
35#include "vt8500lcdfb.h" 35#include "vt8500lcdfb.h"
36#include "wmt_ge_rops.h" 36#include "wmt_ge_rops.h"
diff --git a/drivers/video/wm8505fb.c b/drivers/video/wm8505fb.c
index c8703bd61b74..ffeff4838120 100644
--- a/drivers/video/wm8505fb.c
+++ b/drivers/video/wm8505fb.c
@@ -29,7 +29,7 @@
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/wait.h> 30#include <linux/wait.h>
31 31
32#include <mach/vt8500fb.h> 32#include <linux/platform_data/video-vt8500lcdfb.h>
33 33
34#include "wm8505fb_regs.h" 34#include "wm8505fb_regs.h"
35#include "wmt_ge_rops.h" 35#include "wmt_ge_rops.h"
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 53d75719078e..ad1bb9382a96 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -237,12 +237,12 @@ config OMAP_WATCHDOG
237 here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. 237 here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer.
238 238
239config PNX4008_WATCHDOG 239config PNX4008_WATCHDOG
240 tristate "PNX4008 and LPC32XX Watchdog" 240 tristate "LPC32XX Watchdog"
241 depends on ARCH_PNX4008 || ARCH_LPC32XX 241 depends on ARCH_LPC32XX
242 select WATCHDOG_CORE 242 select WATCHDOG_CORE
243 help 243 help
244 Say Y here if to include support for the watchdog timer 244 Say Y here if to include support for the watchdog timer
245 in the PNX4008 or LPC32XX processor. 245 in the LPC32XX processor.
246 This driver can be built as a module by choosing M. The module 246 This driver can be built as a module by choosing M. The module
247 will be called pnx4008_wdt. 247 will be called pnx4008_wdt.
248 248
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c
index 59e75d9a6b7f..c1a4d3bf581d 100644
--- a/drivers/watchdog/ks8695_wdt.c
+++ b/drivers/watchdog/ks8695_wdt.c
@@ -24,7 +24,19 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/uaccess.h> 25#include <linux/uaccess.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/regs-timer.h> 27
28#define KS8695_TMR_OFFSET (0xF0000 + 0xE400)
29#define KS8695_TMR_VA (KS8695_IO_VA + KS8695_TMR_OFFSET)
30
31/*
32 * Timer registers
33 */
34#define KS8695_TMCON (0x00) /* Timer Control Register */
35#define KS8695_T0TC (0x08) /* Timer 0 Timeout Count Register */
36#define TMCON_T0EN (1 << 0) /* Timer 0 Enable */
37
38/* Timer0 Timeout Counter Register */
39#define T0TC_WATCHDOG (0xff) /* Enable watchdog mode */
28 40
29#define WDT_DEFAULT_TIME 5 /* seconds */ 41#define WDT_DEFAULT_TIME 5 /* seconds */
30#define WDT_MAX_TIME 171 /* seconds */ 42#define WDT_MAX_TIME 171 /* seconds */
diff --git a/arch/arm/mach-picoxcell/include/mach/hardware.h b/include/linux/bcm2835_timer.h
index 70ff58192ec9..25680fe0903c 100644
--- a/arch/arm/mach-picoxcell/include/mach/hardware.h
+++ b/include/linux/bcm2835_timer.h
@@ -1,7 +1,5 @@
1/* 1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles 2 * Copyright 2012 Simon Arlott
3 *
4 * This file contains the hardware definitions of the picoXcell SoC devices.
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -13,9 +11,12 @@
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 12 * GNU General Public License for more details.
15 */ 13 */
16#ifndef __ASM_ARCH_HARDWARE_H
17#define __ASM_ARCH_HARDWARE_H
18 14
19#include <mach/picoxcell_soc.h> 15#ifndef __BCM2835_TIMER_H
16#define __BCM2835_TIMER_H
17
18#include <asm/mach/time.h>
19
20extern struct sys_timer bcm2835_timer;
20 21
21#endif 22#endif
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 77335fac943e..c12731582920 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -26,6 +26,7 @@
26#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */ 26#define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
27#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */ 27#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
28#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ 28#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
29#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
29 30
30struct clk_hw; 31struct clk_hw;
31 32
@@ -360,6 +361,11 @@ int of_clk_add_provider(struct device_node *np,
360void of_clk_del_provider(struct device_node *np); 361void of_clk_del_provider(struct device_node *np);
361struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, 362struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
362 void *data); 363 void *data);
364struct clk_onecell_data {
365 struct clk **clks;
366 unsigned int clk_num;
367};
368struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
363const char *of_clk_get_parent_name(struct device_node *np, int index); 369const char *of_clk_get_parent_name(struct device_node *np, int index);
364void of_clk_init(const struct of_device_id *matches); 370void of_clk_init(const struct of_device_id *matches);
365 371
diff --git a/arch/arm/mach-socfpga/include/mach/timex.h b/include/linux/clk/bcm2835.h
index 43df4354e461..aa937f6c17da 100644
--- a/arch/arm/mach-socfpga/include/mach/timex.h
+++ b/include/linux/clk/bcm2835.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2003 ARM Limited 2 * Copyright (C) 2010 Broadcom
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -16,4 +16,9 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#define CLOCK_TICK_RATE (50000000 / 16) 19#ifndef __LINUX_CLK_BCM2835_H_
20#define __LINUX_CLK_BCM2835_H_
21
22void __init bcm2835_init_clocks(void);
23
24#endif
diff --git a/arch/arm/mach-versatile/include/mach/io.h b/include/linux/irqchip/bcm2835.h
index 0406513be7d8..48a859bc9dca 100644
--- a/arch/arm/mach-versatile/include/mach/io.h
+++ b/include/linux/irqchip/bcm2835.h
@@ -1,7 +1,5 @@
1/* 1/*
2 * arch/arm/mach-versatile/include/mach/io.h 2 * Copyright (C) 2010 Broadcom
3 *
4 * Copyright (C) 2003 ARM Limited
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -17,11 +15,15 @@
17 * along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 17 */
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22 18
23#define PCIO_BASE 0xeb000000ul 19#ifndef __LINUX_IRQCHIP_BCM2835_H_
20#define __LINUX_IRQCHIP_BCM2835_H_
21
22#include <asm/exception.h>
23
24extern void bcm2835_init_irq(void);
24 25
25#define __io(a) ((a) + PCIO_BASE) 26extern asmlinkage void __exception_irq_entry bcm2835_handle_irq(
27 struct pt_regs *regs);
26 28
27#endif 29#endif
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index 5b90e94399e1..c410d99bd667 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -136,6 +136,7 @@ enum prcmu_clock {
136 PRCMU_TIMCLK, 136 PRCMU_TIMCLK,
137 PRCMU_PLLSOC0, 137 PRCMU_PLLSOC0,
138 PRCMU_PLLSOC1, 138 PRCMU_PLLSOC1,
139 PRCMU_ARMSS,
139 PRCMU_PLLDDR, 140 PRCMU_PLLDDR,
140 PRCMU_PLLDSI, 141 PRCMU_PLLDSI,
141 PRCMU_DSI0CLK, 142 PRCMU_DSI0CLK,
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index f350fd0ba1df..94514710a03f 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -14,6 +14,7 @@
14#define TPS6586X_SLEW_RATE_MASK 0x07 14#define TPS6586X_SLEW_RATE_MASK 0x07
15 15
16enum { 16enum {
17 TPS6586X_ID_SYS,
17 TPS6586X_ID_SM_0, 18 TPS6586X_ID_SM_0,
18 TPS6586X_ID_SM_1, 19 TPS6586X_ID_SM_1,
19 TPS6586X_ID_SM_2, 20 TPS6586X_ID_SM_2,
diff --git a/arch/arm/plat-mxc/include/mach/ssi.h b/include/linux/platform_data/asoc-imx-ssi.h
index 63f3c2804239..63f3c2804239 100644
--- a/arch/arm/plat-mxc/include/mach/ssi.h
+++ b/include/linux/platform_data/asoc-imx-ssi.h
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/include/linux/platform_data/asoc-kirkwood.h
index d6a55bd2e578..d6a55bd2e578 100644
--- a/arch/arm/plat-orion/include/plat/audio.h
+++ b/include/linux/platform_data/asoc-kirkwood.h
diff --git a/arch/arm/mach-pxa/include/mach/palmasoc.h b/include/linux/platform_data/asoc-palm27x.h
index 58afb30d5298..58afb30d5298 100644
--- a/arch/arm/mach-pxa/include/mach/palmasoc.h
+++ b/include/linux/platform_data/asoc-palm27x.h
diff --git a/arch/arm/plat-samsung/include/plat/audio.h b/include/linux/platform_data/asoc-s3c.h
index aa9875f77c40..aa9875f77c40 100644
--- a/arch/arm/plat-samsung/include/plat/audio.h
+++ b/include/linux/platform_data/asoc-s3c.h
diff --git a/arch/arm/plat-samsung/include/plat/audio-simtec.h b/include/linux/platform_data/asoc-s3c24xx_simtec.h
index 376af5286a3e..376af5286a3e 100644
--- a/arch/arm/plat-samsung/include/plat/audio-simtec.h
+++ b/include/linux/platform_data/asoc-s3c24xx_simtec.h
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h
index 18814127809a..18814127809a 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/include/linux/platform_data/asoc-ti-mcbsp.h
diff --git a/arch/arm/mach-pxa/include/mach/pata_pxa.h b/include/linux/platform_data/ata-pxa.h
index 6cf7df1d5830..6cf7df1d5830 100644
--- a/arch/arm/mach-pxa/include/mach/pata_pxa.h
+++ b/include/linux/platform_data/ata-pxa.h
diff --git a/arch/arm/plat-samsung/include/plat/ata.h b/include/linux/platform_data/ata-samsung_cf.h
index 2a3855a8372a..2a3855a8372a 100644
--- a/arch/arm/plat-samsung/include/plat/ata.h
+++ b/include/linux/platform_data/ata-samsung_cf.h
diff --git a/include/linux/platform_data/atmel-aes.h b/include/linux/platform_data/atmel-aes.h
index e7a1949bad26..ab68082fbcb0 100644
--- a/include/linux/platform_data/atmel-aes.h
+++ b/include/linux/platform_data/atmel-aes.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_ATMEL_AES_H 1#ifndef __LINUX_ATMEL_AES_H
2#define __LINUX_ATMEL_AES_H 2#define __LINUX_ATMEL_AES_H
3 3
4#include <mach/at_hdmac.h> 4#include <linux/platform_data/dma-atmel.h>
5 5
6/** 6/**
7 * struct aes_dma_data - DMA data for AES 7 * struct aes_dma_data - DMA data for AES
diff --git a/arch/arm/plat-mxc/include/mach/mx1_camera.h b/include/linux/platform_data/camera-mx1.h
index 4fd6c70314b4..4fd6c70314b4 100644
--- a/arch/arm/plat-mxc/include/mach/mx1_camera.h
+++ b/include/linux/platform_data/camera-mx1.h
diff --git a/arch/arm/plat-mxc/include/mach/mx2_cam.h b/include/linux/platform_data/camera-mx2.h
index 3c080a32dbf5..7ded6f1f74bc 100644
--- a/arch/arm/plat-mxc/include/mach/mx2_cam.h
+++ b/include/linux/platform_data/camera-mx2.h
@@ -23,7 +23,6 @@
23#ifndef __MACH_MX2_CAM_H_ 23#ifndef __MACH_MX2_CAM_H_
24#define __MACH_MX2_CAM_H_ 24#define __MACH_MX2_CAM_H_
25 25
26#define MX2_CAMERA_SWAP16 (1 << 0)
27#define MX2_CAMERA_EXT_VSYNC (1 << 1) 26#define MX2_CAMERA_EXT_VSYNC (1 << 1)
28#define MX2_CAMERA_CCIR (1 << 2) 27#define MX2_CAMERA_CCIR (1 << 2)
29#define MX2_CAMERA_CCIR_INTERLACE (1 << 3) 28#define MX2_CAMERA_CCIR_INTERLACE (1 << 3)
@@ -31,7 +30,6 @@
31#define MX2_CAMERA_GATED_CLOCK (1 << 5) 30#define MX2_CAMERA_GATED_CLOCK (1 << 5)
32#define MX2_CAMERA_INV_DATA (1 << 6) 31#define MX2_CAMERA_INV_DATA (1 << 6)
33#define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7) 32#define MX2_CAMERA_PCLK_SAMPLE_RISING (1 << 7)
34#define MX2_CAMERA_PACK_DIR_MSB (1 << 8)
35 33
36/** 34/**
37 * struct mx2_camera_platform_data - optional platform data for mx2_camera 35 * struct mx2_camera_platform_data - optional platform data for mx2_camera
diff --git a/arch/arm/plat-mxc/include/mach/mx3_camera.h b/include/linux/platform_data/camera-mx3.h
index f226ee3777e1..f226ee3777e1 100644
--- a/arch/arm/plat-mxc/include/mach/mx3_camera.h
+++ b/include/linux/platform_data/camera-mx3.h
diff --git a/arch/arm/mach-pxa/include/mach/camera.h b/include/linux/platform_data/camera-pxa.h
index 6709b1cd7c77..6709b1cd7c77 100644
--- a/arch/arm/mach-pxa/include/mach/camera.h
+++ b/include/linux/platform_data/camera-pxa.h
diff --git a/include/linux/platform_data/clk-realview.h b/include/linux/platform_data/clk-realview.h
new file mode 100644
index 000000000000..2e426a7dbc51
--- /dev/null
+++ b/include/linux/platform_data/clk-realview.h
@@ -0,0 +1 @@
void realview_clk_init(void __iomem *sysbase, bool is_pb1176);
diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h
new file mode 100644
index 000000000000..3af0da1f3be5
--- /dev/null
+++ b/include/linux/platform_data/clk-ux500.h
@@ -0,0 +1,17 @@
1/*
2 * Clock definitions for ux500 platforms
3 *
4 * Copyright (C) 2012 ST-Ericsson SA
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 *
7 * License terms: GNU General Public License (GPL) version 2
8 */
9
10#ifndef __CLK_UX500_H
11#define __CLK_UX500_H
12
13void u8500_clk_init(void);
14void u9540_clk_init(void);
15void u8540_clk_init(void);
16
17#endif /* __CLK_UX500_H */
diff --git a/arch/arm/mach-ux500/include/mach/crypto-ux500.h b/include/linux/platform_data/crypto-ux500.h
index 5b2d0817e26a..5b2d0817e26a 100644
--- a/arch/arm/mach-ux500/include/mach/crypto-ux500.h
+++ b/include/linux/platform_data/crypto-ux500.h
diff --git a/arch/arm/mach-at91/include/mach/at_hdmac.h b/include/linux/platform_data/dma-atmel.h
index cab0997be3de..cab0997be3de 100644
--- a/arch/arm/mach-at91/include/mach/at_hdmac.h
+++ b/include/linux/platform_data/dma-atmel.h
diff --git a/arch/arm/mach-ep93xx/include/mach/dma.h b/include/linux/platform_data/dma-ep93xx.h
index e82c642fa53c..e82c642fa53c 100644
--- a/arch/arm/mach-ep93xx/include/mach/dma.h
+++ b/include/linux/platform_data/dma-ep93xx.h
diff --git a/arch/arm/plat-mxc/include/mach/sdma.h b/include/linux/platform_data/dma-imx-sdma.h
index 3a3942823c20..3a3942823c20 100644
--- a/arch/arm/plat-mxc/include/mach/sdma.h
+++ b/include/linux/platform_data/dma-imx-sdma.h
diff --git a/arch/arm/plat-mxc/include/mach/dma.h b/include/linux/platform_data/dma-imx.h
index 1b9080385b46..1b9080385b46 100644
--- a/arch/arm/plat-mxc/include/mach/dma.h
+++ b/include/linux/platform_data/dma-imx.h
diff --git a/arch/arm/mach-mmp/include/mach/sram.h b/include/linux/platform_data/dma-mmp_tdma.h
index 239e0fc1bb1f..239e0fc1bb1f 100644
--- a/arch/arm/mach-mmp/include/mach/sram.h
+++ b/include/linux/platform_data/dma-mmp_tdma.h
diff --git a/arch/arm/plat-orion/include/plat/mv_xor.h b/include/linux/platform_data/dma-mv_xor.h
index 2ba1f7d76eef..2ba1f7d76eef 100644
--- a/arch/arm/plat-orion/include/plat/mv_xor.h
+++ b/include/linux/platform_data/dma-mv_xor.h
diff --git a/arch/arm/plat-omap/include/plat/dsp.h b/include/linux/platform_data/dsp-omap.h
index 5927709b1908..5927709b1908 100644
--- a/arch/arm/plat-omap/include/plat/dsp.h
+++ b/include/linux/platform_data/dsp-omap.h
diff --git a/arch/arm/mach-netx/include/mach/eth.h b/include/linux/platform_data/eth-netx.h
index 88af1ac28ead..88af1ac28ead 100644
--- a/arch/arm/mach-netx/include/mach/eth.h
+++ b/include/linux/platform_data/eth-netx.h
diff --git a/arch/arm/plat-samsung/include/plat/hwmon.h b/include/linux/platform_data/hwmon-s3c.h
index c167e4429bc7..c167e4429bc7 100644
--- a/arch/arm/plat-samsung/include/plat/hwmon.h
+++ b/include/linux/platform_data/hwmon-s3c.h
diff --git a/arch/arm/mach-davinci/include/mach/i2c.h b/include/linux/platform_data/i2c-davinci.h
index 2312d197dfb7..2312d197dfb7 100644
--- a/arch/arm/mach-davinci/include/mach/i2c.h
+++ b/include/linux/platform_data/i2c-davinci.h
diff --git a/arch/arm/plat-mxc/include/mach/i2c.h b/include/linux/platform_data/i2c-imx.h
index 8289d915e615..8289d915e615 100644
--- a/arch/arm/plat-mxc/include/mach/i2c.h
+++ b/include/linux/platform_data/i2c-imx.h
diff --git a/arch/arm/mach-w90x900/include/mach/i2c.h b/include/linux/platform_data/i2c-nuc900.h
index 9ffb12d06e91..9ffb12d06e91 100644
--- a/arch/arm/mach-w90x900/include/mach/i2c.h
+++ b/include/linux/platform_data/i2c-nuc900.h
diff --git a/arch/arm/plat-samsung/include/plat/iic.h b/include/linux/platform_data/i2c-s3c2410.h
index 51d52e767a19..51d52e767a19 100644
--- a/arch/arm/plat-samsung/include/plat/iic.h
+++ b/include/linux/platform_data/i2c-s3c2410.h
diff --git a/arch/arm/mach-pxa/include/mach/irda.h b/include/linux/platform_data/irda-pxaficp.h
index 3cd41f77dda4..3cd41f77dda4 100644
--- a/arch/arm/mach-pxa/include/mach/irda.h
+++ b/include/linux/platform_data/irda-pxaficp.h
diff --git a/arch/arm/mach-pxa/include/mach/pxa930_rotary.h b/include/linux/platform_data/keyboard-pxa930_rotary.h
index 053587caffdd..053587caffdd 100644
--- a/arch/arm/mach-pxa/include/mach/pxa930_rotary.h
+++ b/include/linux/platform_data/keyboard-pxa930_rotary.h
diff --git a/arch/arm/plat-spear/include/plat/keyboard.h b/include/linux/platform_data/keyboard-spear.h
index 9248e3a7e333..9248e3a7e333 100644
--- a/arch/arm/plat-spear/include/plat/keyboard.h
+++ b/include/linux/platform_data/keyboard-spear.h
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h b/include/linux/platform_data/keypad-ep93xx.h
index 1e2f4e97f428..1e2f4e97f428 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h
+++ b/include/linux/platform_data/keypad-ep93xx.h
diff --git a/arch/arm/plat-nomadik/include/plat/ske.h b/include/linux/platform_data/keypad-nomadik-ske.h
index 31382fbc07dc..31382fbc07dc 100644
--- a/arch/arm/plat-nomadik/include/plat/ske.h
+++ b/include/linux/platform_data/keypad-nomadik-ske.h
diff --git a/arch/arm/plat-omap/include/plat/keypad.h b/include/linux/platform_data/keypad-omap.h
index a6b21eddb212..a6b21eddb212 100644
--- a/arch/arm/plat-omap/include/plat/keypad.h
+++ b/include/linux/platform_data/keypad-omap.h
diff --git a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h b/include/linux/platform_data/keypad-pxa27x.h
index 5ce8d5e6ea51..5ce8d5e6ea51 100644
--- a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
+++ b/include/linux/platform_data/keypad-pxa27x.h
diff --git a/arch/arm/mach-w90x900/include/mach/w90p910_keypad.h b/include/linux/platform_data/keypad-w90p910.h
index 556778e8ddaa..556778e8ddaa 100644
--- a/arch/arm/mach-w90x900/include/mach/w90p910_keypad.h
+++ b/include/linux/platform_data/keypad-w90p910.h
diff --git a/arch/arm/mach-davinci/include/mach/keyscan.h b/include/linux/platform_data/keyscan-davinci.h
index 7a560e05bda8..7a560e05bda8 100644
--- a/arch/arm/mach-davinci/include/mach/keyscan.h
+++ b/include/linux/platform_data/keyscan-davinci.h
diff --git a/arch/arm/plat-omap/include/plat/lcd_mipid.h b/include/linux/platform_data/lcd-mipid.h
index 8e52c6572281..8e52c6572281 100644
--- a/arch/arm/plat-omap/include/plat/lcd_mipid.h
+++ b/include/linux/platform_data/lcd-mipid.h
diff --git a/arch/arm/mach-kirkwood/include/mach/leds-netxbig.h b/include/linux/platform_data/leds-kirkwood-netxbig.h
index 24b536ebdf13..24b536ebdf13 100644
--- a/arch/arm/mach-kirkwood/include/mach/leds-netxbig.h
+++ b/include/linux/platform_data/leds-kirkwood-netxbig.h
diff --git a/arch/arm/mach-kirkwood/include/mach/leds-ns2.h b/include/linux/platform_data/leds-kirkwood-ns2.h
index e21272e5f668..e21272e5f668 100644
--- a/arch/arm/mach-kirkwood/include/mach/leds-ns2.h
+++ b/include/linux/platform_data/leds-kirkwood-ns2.h
diff --git a/arch/arm/mach-s3c24xx/include/mach/leds-gpio.h b/include/linux/platform_data/leds-s3c24xx.h
index d8a7672519b6..d8a7672519b6 100644
--- a/arch/arm/mach-s3c24xx/include/mach/leds-gpio.h
+++ b/include/linux/platform_data/leds-s3c24xx.h
diff --git a/arch/arm/mach-sa1100/include/mach/mcp.h b/include/linux/platform_data/mfd-mcp-sa11x0.h
index 4b2860ae3828..4b2860ae3828 100644
--- a/arch/arm/mach-sa1100/include/mach/mcp.h
+++ b/include/linux/platform_data/mfd-mcp-sa11x0.h
diff --git a/arch/arm/plat-samsung/include/plat/mipi_csis.h b/include/linux/platform_data/mipi-csis.h
index c45b1e8d4c2e..c45b1e8d4c2e 100644
--- a/arch/arm/plat-samsung/include/plat/mipi_csis.h
+++ b/include/linux/platform_data/mipi-csis.h
diff --git a/arch/arm/mach-davinci/include/mach/mmc.h b/include/linux/platform_data/mmc-davinci.h
index 5ba6b22ce338..5ba6b22ce338 100644
--- a/arch/arm/mach-davinci/include/mach/mmc.h
+++ b/include/linux/platform_data/mmc-davinci.h
diff --git a/arch/arm/plat-mxc/include/mach/esdhc.h b/include/linux/platform_data/mmc-esdhc-imx.h
index aaf97481f413..aaf97481f413 100644
--- a/arch/arm/plat-mxc/include/mach/esdhc.h
+++ b/include/linux/platform_data/mmc-esdhc-imx.h
diff --git a/arch/arm/mach-msm/include/mach/mmc.h b/include/linux/platform_data/mmc-msm_sdcc.h
index ffcd9e3a6a7e..ffcd9e3a6a7e 100644
--- a/arch/arm/mach-msm/include/mach/mmc.h
+++ b/include/linux/platform_data/mmc-msm_sdcc.h
diff --git a/arch/arm/plat-orion/include/plat/mvsdio.h b/include/linux/platform_data/mmc-mvsdio.h
index 1190efedcb94..1190efedcb94 100644
--- a/arch/arm/plat-orion/include/plat/mvsdio.h
+++ b/include/linux/platform_data/mmc-mvsdio.h
diff --git a/arch/arm/plat-mxc/include/mach/mmc.h b/include/linux/platform_data/mmc-mxcmmc.h
index 29115f405af9..29115f405af9 100644
--- a/arch/arm/plat-mxc/include/mach/mmc.h
+++ b/include/linux/platform_data/mmc-mxcmmc.h
diff --git a/arch/arm/mach-pxa/include/mach/mmc.h b/include/linux/platform_data/mmc-pxamci.h
index 9eb515bb799d..9eb515bb799d 100644
--- a/arch/arm/mach-pxa/include/mach/mmc.h
+++ b/include/linux/platform_data/mmc-pxamci.h
diff --git a/arch/arm/plat-samsung/include/plat/mci.h b/include/linux/platform_data/mmc-s3cmci.h
index c42d31711944..c42d31711944 100644
--- a/arch/arm/plat-samsung/include/plat/mci.h
+++ b/include/linux/platform_data/mmc-s3cmci.h
diff --git a/arch/arm/mach-tegra/include/mach/sdhci.h b/include/linux/platform_data/mmc-sdhci-tegra.h
index 4231bc7b8652..8f8430697686 100644
--- a/arch/arm/mach-tegra/include/mach/sdhci.h
+++ b/include/linux/platform_data/mmc-sdhci-tegra.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * include/asm-arm/arch-tegra/include/mach/sdhci.h
3 *
4 * Copyright (C) 2009 Palm, Inc. 2 * Copyright (C) 2009 Palm, Inc.
5 * Author: Yvonne Yip <y@palm.com> 3 * Author: Yvonne Yip <y@palm.com>
6 * 4 *
@@ -14,8 +12,8 @@
14 * GNU General Public License for more details. 12 * GNU General Public License for more details.
15 * 13 *
16 */ 14 */
17#ifndef __ASM_ARM_ARCH_TEGRA_SDHCI_H 15#ifndef __PLATFORM_DATA_TEGRA_SDHCI_H
18#define __ASM_ARM_ARCH_TEGRA_SDHCI_H 16#define __PLATFORM_DATA_TEGRA_SDHCI_H
19 17
20#include <linux/mmc/host.h> 18#include <linux/mmc/host.h>
21 19
diff --git a/arch/arm/mach-pxa/include/mach/pxa930_trkball.h b/include/linux/platform_data/mouse-pxa930_trkball.h
index 5e0789bc4729..5e0789bc4729 100644
--- a/arch/arm/mach-pxa/include/mach/pxa930_trkball.h
+++ b/include/linux/platform_data/mouse-pxa930_trkball.h
diff --git a/arch/arm/mach-davinci/include/mach/aemif.h b/include/linux/platform_data/mtd-davinci-aemif.h
index 05b293443097..05b293443097 100644
--- a/arch/arm/mach-davinci/include/mach/aemif.h
+++ b/include/linux/platform_data/mtd-davinci-aemif.h
diff --git a/arch/arm/mach-davinci/include/mach/nand.h b/include/linux/platform_data/mtd-davinci.h
index 1cf555aef896..1cf555aef896 100644
--- a/arch/arm/mach-davinci/include/mach/nand.h
+++ b/include/linux/platform_data/mtd-davinci.h
diff --git a/arch/arm/plat-mxc/include/mach/mxc_nand.h b/include/linux/platform_data/mtd-mxc_nand.h
index 6bb96ef1600b..6bb96ef1600b 100644
--- a/arch/arm/plat-mxc/include/mach/mxc_nand.h
+++ b/include/linux/platform_data/mtd-mxc_nand.h
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/include/linux/platform_data/mtd-nand-omap2.h
index 1a68c1e5fe53..1a68c1e5fe53 100644
--- a/arch/arm/plat-omap/include/plat/nand.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
diff --git a/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h b/include/linux/platform_data/mtd-nand-pxa3xx.h
index c42f39f20195..c42f39f20195 100644
--- a/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
+++ b/include/linux/platform_data/mtd-nand-pxa3xx.h
diff --git a/arch/arm/plat-samsung/include/plat/nand.h b/include/linux/platform_data/mtd-nand-s3c2410.h
index b64115fa93a4..b64115fa93a4 100644
--- a/arch/arm/plat-samsung/include/plat/nand.h
+++ b/include/linux/platform_data/mtd-nand-s3c2410.h
diff --git a/arch/arm/mach-nomadik/include/mach/nand.h b/include/linux/platform_data/mtd-nomadik-nand.h
index c3c8254c22a5..c3c8254c22a5 100644
--- a/arch/arm/mach-nomadik/include/mach/nand.h
+++ b/include/linux/platform_data/mtd-nomadik-nand.h
diff --git a/arch/arm/plat-omap/include/plat/onenand.h b/include/linux/platform_data/mtd-onenand-omap2.h
index 2858667d2e4f..2858667d2e4f 100644
--- a/arch/arm/plat-omap/include/plat/onenand.h
+++ b/include/linux/platform_data/mtd-onenand-omap2.h
diff --git a/arch/arm/plat-orion/include/plat/orion_nand.h b/include/linux/platform_data/mtd-orion_nand.h
index 9f3c180834d1..9f3c180834d1 100644
--- a/arch/arm/plat-orion/include/plat/orion_nand.h
+++ b/include/linux/platform_data/mtd-orion_nand.h
diff --git a/arch/arm/mach-pxa/include/mach/arcom-pcmcia.h b/include/linux/platform_data/pcmcia-pxa2xx_viper.h
index d428be4db44c..d428be4db44c 100644
--- a/arch/arm/mach-pxa/include/mach/arcom-pcmcia.h
+++ b/include/linux/platform_data/pcmcia-pxa2xx_viper.h
diff --git a/arch/arm/mach-u300/include/mach/gpio-u300.h b/include/linux/platform_data/pinctrl-coh901.h
index e81400c1753a..30dea251b835 100644
--- a/arch/arm/mach-u300/include/mach/gpio-u300.h
+++ b/include/linux/platform_data/pinctrl-coh901.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2011 ST-Ericsson AB 2 * Copyright (C) 2007-2012 ST-Ericsson AB
3 * License terms: GNU General Public License (GPL) version 2 3 * License terms: GNU General Public License (GPL) version 2
4 * GPIO block resgister definitions and inline macros for 4 * GPIO block resgister definitions and inline macros for
5 * U300 GPIO COH 901 335 or COH 901 571/3 5 * U300 GPIO COH 901 335 or COH 901 571/3
@@ -10,24 +10,13 @@
10#define __MACH_U300_GPIO_U300_H 10#define __MACH_U300_GPIO_U300_H
11 11
12/** 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 13 * struct u300_gpio_platform - U300 GPIO platform data
23 * @variant: IP block variant
24 * @ports: number of GPIO block ports 14 * @ports: number of GPIO block ports
25 * @gpio_base: first GPIO number for this block (use a free range) 15 * @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) 16 * @gpio_irq_base: first GPIO IRQ number for this block (use a free range)
27 * @pinctrl_device: pin control device to spawn as child 17 * @pinctrl_device: pin control device to spawn as child
28 */ 18 */
29struct u300_gpio_platform { 19struct u300_gpio_platform {
30 enum u300_gpio_variant variant;
31 u8 ports; 20 u8 ports;
32 int gpio_base; 21 int gpio_base;
33 int gpio_irq_base; 22 int gpio_irq_base;
diff --git a/arch/arm/plat-omap/include/plat/remoteproc.h b/include/linux/platform_data/remoteproc-omap.h
index b10eac89e2e9..b10eac89e2e9 100644
--- a/arch/arm/plat-omap/include/plat/remoteproc.h
+++ b/include/linux/platform_data/remoteproc-omap.h
diff --git a/arch/arm/plat-mxc/include/mach/imx-uart.h b/include/linux/platform_data/serial-imx.h
index 4adec9b154dd..4adec9b154dd 100644
--- a/arch/arm/plat-mxc/include/mach/imx-uart.h
+++ b/include/linux/platform_data/serial-imx.h
diff --git a/arch/arm/mach-davinci/include/mach/spi.h b/include/linux/platform_data/spi-davinci.h
index 7af305b37868..7af305b37868 100644
--- a/arch/arm/mach-davinci/include/mach/spi.h
+++ b/include/linux/platform_data/spi-davinci.h
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h b/include/linux/platform_data/spi-ep93xx.h
index 9bb63ac13f04..9bb63ac13f04 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h
+++ b/include/linux/platform_data/spi-ep93xx.h
diff --git a/arch/arm/plat-mxc/include/mach/spi.h b/include/linux/platform_data/spi-imx.h
index 08be445e8eb8..08be445e8eb8 100644
--- a/arch/arm/plat-mxc/include/mach/spi.h
+++ b/include/linux/platform_data/spi-imx.h
diff --git a/arch/arm/mach-w90x900/include/mach/nuc900_spi.h b/include/linux/platform_data/spi-nuc900.h
index 2c4e0c128501..2c4e0c128501 100644
--- a/arch/arm/mach-w90x900/include/mach/nuc900_spi.h
+++ b/include/linux/platform_data/spi-nuc900.h
diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h
index a357eb26bd25..a357eb26bd25 100644
--- a/arch/arm/plat-omap/include/plat/mcspi.h
+++ b/include/linux/platform_data/spi-omap2-mcspi.h
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/include/linux/platform_data/spi-s3c64xx.h
index ceba18d23a5a..ceba18d23a5a 100644
--- a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
+++ b/include/linux/platform_data/spi-s3c64xx.h
diff --git a/arch/arm/plat-samsung/include/plat/ts.h b/include/linux/platform_data/touchscreen-s3c2410.h
index 26fdb22e0fc2..26fdb22e0fc2 100644
--- a/arch/arm/plat-samsung/include/plat/ts.h
+++ b/include/linux/platform_data/touchscreen-s3c2410.h
diff --git a/arch/arm/mach-davinci/include/mach/usb.h b/include/linux/platform_data/usb-davinci.h
index e0bc4abe69c2..e0bc4abe69c2 100644
--- a/arch/arm/mach-davinci/include/mach/usb.h
+++ b/include/linux/platform_data/usb-davinci.h
diff --git a/arch/arm/plat-mxc/include/mach/mxc_ehci.h b/include/linux/platform_data/usb-ehci-mxc.h
index 7eb9d1329671..7eb9d1329671 100644
--- a/arch/arm/plat-mxc/include/mach/mxc_ehci.h
+++ b/include/linux/platform_data/usb-ehci-mxc.h
diff --git a/arch/arm/plat-orion/include/plat/ehci-orion.h b/include/linux/platform_data/usb-ehci-orion.h
index 6fc78e430420..6fc78e430420 100644
--- a/arch/arm/plat-orion/include/plat/ehci-orion.h
+++ b/include/linux/platform_data/usb-ehci-orion.h
diff --git a/arch/arm/plat-samsung/include/plat/ehci.h b/include/linux/platform_data/usb-ehci-s5p.h
index 5f28cae18582..5f28cae18582 100644
--- a/arch/arm/plat-samsung/include/plat/ehci.h
+++ b/include/linux/platform_data/usb-ehci-s5p.h
diff --git a/arch/arm/mach-exynos/include/mach/ohci.h b/include/linux/platform_data/usb-exynos.h
index c256c595be5e..c256c595be5e 100644
--- a/arch/arm/mach-exynos/include/mach/ohci.h
+++ b/include/linux/platform_data/usb-exynos.h
diff --git a/arch/arm/plat-mxc/include/mach/usb.h b/include/linux/platform_data/usb-imx_udc.h
index be273371f34a..be273371f34a 100644
--- a/arch/arm/plat-mxc/include/mach/usb.h
+++ b/include/linux/platform_data/usb-imx_udc.h
diff --git a/arch/arm/mach-ux500/include/mach/usb.h b/include/linux/platform_data/usb-musb-ux500.h
index 4c1cc50a595a..4c1cc50a595a 100644
--- a/arch/arm/mach-ux500/include/mach/usb.h
+++ b/include/linux/platform_data/usb-musb-ux500.h
diff --git a/arch/arm/plat-mxc/include/mach/mx21-usbhost.h b/include/linux/platform_data/usb-mx2.h
index 22d0b596262c..22d0b596262c 100644
--- a/arch/arm/plat-mxc/include/mach/mx21-usbhost.h
+++ b/include/linux/platform_data/usb-mx2.h
diff --git a/arch/arm/mach-pxa/include/mach/ohci.h b/include/linux/platform_data/usb-ohci-pxa27x.h
index 95b6e2a6e514..95b6e2a6e514 100644
--- a/arch/arm/mach-pxa/include/mach/ohci.h
+++ b/include/linux/platform_data/usb-ohci-pxa27x.h
diff --git a/arch/arm/plat-samsung/include/plat/usb-control.h b/include/linux/platform_data/usb-ohci-s3c2410.h
index 7fa1fbefc3f2..7fa1fbefc3f2 100644
--- a/arch/arm/plat-samsung/include/plat/usb-control.h
+++ b/include/linux/platform_data/usb-ohci-s3c2410.h
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h b/include/linux/platform_data/usb-pxa3xx-ulpi.h
index 9d82cb65ea56..9d82cb65ea56 100644
--- a/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h
+++ b/include/linux/platform_data/usb-pxa3xx-ulpi.h
diff --git a/arch/arm/plat-samsung/include/plat/udc.h b/include/linux/platform_data/usb-s3c2410_udc.h
index de8e2288a509..de8e2288a509 100644
--- a/arch/arm/plat-samsung/include/plat/udc.h
+++ b/include/linux/platform_data/usb-s3c2410_udc.h
diff --git a/arch/arm/mach-ep93xx/include/mach/fb.h b/include/linux/platform_data/video-ep93xx.h
index d5ae11d7c453..d5ae11d7c453 100644
--- a/arch/arm/mach-ep93xx/include/mach/fb.h
+++ b/include/linux/platform_data/video-ep93xx.h
diff --git a/arch/arm/plat-mxc/include/mach/imxfb.h b/include/linux/platform_data/video-imxfb.h
index 9de8f062ad5d..9de8f062ad5d 100644
--- a/arch/arm/plat-mxc/include/mach/imxfb.h
+++ b/include/linux/platform_data/video-imxfb.h
diff --git a/arch/arm/mach-msm/include/mach/msm_fb.h b/include/linux/platform_data/video-msm_fb.h
index 1f4fc81b3d8f..1f4fc81b3d8f 100644
--- a/arch/arm/mach-msm/include/mach/msm_fb.h
+++ b/include/linux/platform_data/video-msm_fb.h
diff --git a/arch/arm/plat-mxc/include/mach/mx3fb.h b/include/linux/platform_data/video-mx3fb.h
index fdbe60001542..fdbe60001542 100644
--- a/arch/arm/plat-mxc/include/mach/mx3fb.h
+++ b/include/linux/platform_data/video-mx3fb.h
diff --git a/arch/arm/mach-w90x900/include/mach/fb.h b/include/linux/platform_data/video-nuc900fb.h
index cec5ece765ed..cec5ece765ed 100644
--- a/arch/arm/mach-w90x900/include/mach/fb.h
+++ b/include/linux/platform_data/video-nuc900fb.h
diff --git a/arch/arm/mach-pxa/include/mach/pxafb.h b/include/linux/platform_data/video-pxafb.h
index 486b4c519ae2..486b4c519ae2 100644
--- a/arch/arm/mach-pxa/include/mach/pxafb.h
+++ b/include/linux/platform_data/video-pxafb.h
diff --git a/arch/arm/mach-vt8500/include/mach/vt8500fb.h b/include/linux/platform_data/video-vt8500lcdfb.h
index 7f399c370fe0..7f399c370fe0 100644
--- a/arch/arm/mach-vt8500/include/mach/vt8500fb.h
+++ b/include/linux/platform_data/video-vt8500lcdfb.h
diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/include/linux/platform_data/voltage-omap.h
index 5be4d5def427..5be4d5def427 100644
--- a/arch/arm/plat-omap/include/plat/voltage.h
+++ b/include/linux/platform_data/voltage-omap.h
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
index 3101e62a1213..4a496ebc7d73 100644
--- a/include/linux/power/smartreflex.h
+++ b/include/linux/power/smartreflex.h
@@ -23,7 +23,7 @@
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <plat/voltage.h> 26#include <linux/platform_data/voltage-omap.h>
27 27
28/* 28/*
29 * Different Smartreflex IPs version. The v1 is the 65nm version used in 29 * Different Smartreflex IPs version. The v1 is the 65nm version used in
diff --git a/sound/soc/ep93xx/ep93xx-ac97.c b/sound/soc/ep93xx/ep93xx-ac97.c
index bdffab33e160..c3521653cfd3 100644
--- a/sound/soc/ep93xx/ep93xx-ac97.c
+++ b/sound/soc/ep93xx/ep93xx-ac97.c
@@ -21,7 +21,7 @@
21#include <sound/ac97_codec.h> 21#include <sound/ac97_codec.h>
22#include <sound/soc.h> 22#include <sound/soc.h>
23 23
24#include <mach/dma.h> 24#include <linux/platform_data/dma-ep93xx.h>
25#include "ep93xx-pcm.h" 25#include "ep93xx-pcm.h"
26 26
27/* 27/*
diff --git a/sound/soc/ep93xx/ep93xx-i2s.c b/sound/soc/ep93xx/ep93xx-i2s.c
index 8df8f6dc474f..ac4a7515e7be 100644
--- a/sound/soc/ep93xx/ep93xx-i2s.c
+++ b/sound/soc/ep93xx/ep93xx-i2s.c
@@ -28,7 +28,7 @@
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/ep93xx-regs.h> 30#include <mach/ep93xx-regs.h>
31#include <mach/dma.h> 31#include <linux/platform_data/dma-ep93xx.h>
32 32
33#include "ep93xx-pcm.h" 33#include "ep93xx-pcm.h"
34 34
diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c
index 4eea98b42bc8..665d9c94cc17 100644
--- a/sound/soc/ep93xx/ep93xx-pcm.c
+++ b/sound/soc/ep93xx/ep93xx-pcm.c
@@ -25,7 +25,7 @@
25#include <sound/soc.h> 25#include <sound/soc.h>
26#include <sound/dmaengine_pcm.h> 26#include <sound/dmaengine_pcm.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#include <mach/ep93xx-regs.h> 30#include <mach/ep93xx-regs.h>
31 31
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
index 48f9d886f020..89a7755b6f56 100644
--- a/sound/soc/fsl/imx-pcm-dma.c
+++ b/sound/soc/fsl/imx-pcm-dma.c
@@ -30,7 +30,7 @@
30#include <sound/soc.h> 30#include <sound/soc.h>
31#include <sound/dmaengine_pcm.h> 31#include <sound/dmaengine_pcm.h>
32 32
33#include <mach/dma.h> 33#include <linux/platform_data/dma-imx.h>
34 34
35#include "imx-pcm.h" 35#include "imx-pcm.h"
36 36
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index ee27ba3933bd..22c6130957ba 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -30,7 +30,7 @@
30#include <asm/fiq.h> 30#include <asm/fiq.h>
31 31
32#include <mach/irqs.h> 32#include <mach/irqs.h>
33#include <mach/ssi.h> 33#include <linux/platform_data/asoc-imx-ssi.h>
34 34
35#include "imx-ssi.h" 35#include "imx-ssi.h"
36 36
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 81d7728cf67f..e6a17baca1ee 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -47,7 +47,7 @@
47#include <sound/pcm_params.h> 47#include <sound/pcm_params.h>
48#include <sound/soc.h> 48#include <sound/soc.h>
49 49
50#include <mach/ssi.h> 50#include <linux/platform_data/asoc-imx-ssi.h>
51#include <mach/hardware.h> 51#include <mach/hardware.h>
52 52
53#include "imx-ssi.h" 53#include "imx-ssi.h"
diff --git a/sound/soc/fsl/imx-ssi.h b/sound/soc/fsl/imx-ssi.h
index 5744e86ca878..dc114bdedce5 100644
--- a/sound/soc/fsl/imx-ssi.h
+++ b/sound/soc/fsl/imx-ssi.h
@@ -186,7 +186,7 @@
186#define DRV_NAME "imx-ssi" 186#define DRV_NAME "imx-ssi"
187 187
188#include <linux/dmaengine.h> 188#include <linux/dmaengine.h>
189#include <mach/dma.h> 189#include <linux/platform_data/dma-imx.h>
190#include "imx-pcm.h" 190#include "imx-pcm.h"
191 191
192struct imx_ssi { 192struct imx_ssi {
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index 7646dd7f30cb..542538d10ab7 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -21,7 +21,7 @@
21#include <sound/pcm.h> 21#include <sound/pcm.h>
22#include <sound/pcm_params.h> 22#include <sound/pcm_params.h>
23#include <sound/soc.h> 23#include <sound/soc.h>
24#include <plat/audio.h> 24#include <linux/platform_data/asoc-kirkwood.h>
25#include "kirkwood.h" 25#include "kirkwood.h"
26 26
27#define DRV_NAME "kirkwood-i2s" 27#define DRV_NAME "kirkwood-i2s"
diff --git a/sound/soc/kirkwood/kirkwood-openrd.c b/sound/soc/kirkwood/kirkwood-openrd.c
index 80bd59c33be4..c28540aeea25 100644
--- a/sound/soc/kirkwood/kirkwood-openrd.c
+++ b/sound/soc/kirkwood/kirkwood-openrd.c
@@ -17,7 +17,7 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <sound/soc.h> 18#include <sound/soc.h>
19#include <mach/kirkwood.h> 19#include <mach/kirkwood.h>
20#include <plat/audio.h> 20#include <linux/platform_data/asoc-kirkwood.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include "../codecs/cs42l51.h" 22#include "../codecs/cs42l51.h"
23 23
diff --git a/sound/soc/kirkwood/kirkwood-t5325.c b/sound/soc/kirkwood/kirkwood-t5325.c
index f8983635f7ef..c67bbc574987 100644
--- a/sound/soc/kirkwood/kirkwood-t5325.c
+++ b/sound/soc/kirkwood/kirkwood-t5325.c
@@ -16,7 +16,7 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <sound/soc.h> 17#include <sound/soc.h>
18#include <mach/kirkwood.h> 18#include <mach/kirkwood.h>
19#include <plat/audio.h> 19#include <linux/platform_data/asoc-kirkwood.h>
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include "../codecs/alc5623.h" 21#include "../codecs/alc5623.h"
22 22
diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
index df65f98211ec..a52e87d28b6e 100644
--- a/sound/soc/omap/am3517evm.c
+++ b/sound/soc/omap/am3517evm.c
@@ -27,7 +27,7 @@
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/gpio.h> 29#include <mach/gpio.h>
30#include <plat/mcbsp.h> 30#include <linux/platform_data/asoc-ti-mcbsp.h>
31 31
32#include "omap-mcbsp.h" 32#include "omap-mcbsp.h"
33#include "omap-pcm.h" 33#include "omap-pcm.h"
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 7d4fa8ed6699..dc0ee7626626 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -32,8 +32,8 @@
32 32
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34 34
35#include <plat/board-ams-delta.h> 35#include <mach/board-ams-delta.h>
36#include <plat/mcbsp.h> 36#include <linux/platform_data/asoc-ti-mcbsp.h>
37 37
38#include "omap-mcbsp.h" 38#include "omap-mcbsp.h"
39#include "omap-pcm.h" 39#include "omap-pcm.h"
diff --git a/sound/soc/omap/igep0020.c b/sound/soc/omap/igep0020.c
index e8357819175b..5ed871676ed0 100644
--- a/sound/soc/omap/igep0020.c
+++ b/sound/soc/omap/igep0020.c
@@ -29,7 +29,7 @@
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32#include <plat/mcbsp.h> 32#include <linux/platform_data/asoc-ti-mcbsp.h>
33 33
34#include "omap-mcbsp.h" 34#include "omap-mcbsp.h"
35#include "omap-pcm.h" 35#include "omap-pcm.h"
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index f18e48847323..a681a9a8b846 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -25,7 +25,7 @@
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27 27
28#include <plat/mcbsp.h> 28#include <linux/platform_data/asoc-ti-mcbsp.h>
29 29
30#include <plat/cpu.h> 30#include <plat/cpu.h>
31 31
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index abac4b690750..521bfc3d2b2b 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -32,7 +32,7 @@
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <linux/gpio.h> 33#include <linux/gpio.h>
34#include <linux/module.h> 34#include <linux/module.h>
35#include <plat/mcbsp.h> 35#include <linux/platform_data/asoc-ti-mcbsp.h>
36 36
37#include "omap-mcbsp.h" 37#include "omap-mcbsp.h"
38#include "omap-pcm.h" 38#include "omap-pcm.h"
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index d0ee71d6cc23..1b18627763ce 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -34,7 +34,7 @@
34 34
35#include <plat/cpu.h> 35#include <plat/cpu.h>
36#include <plat/dma.h> 36#include <plat/dma.h>
37#include <plat/mcbsp.h> 37#include <linux/platform_data/asoc-ti-mcbsp.h>
38#include "mcbsp.h" 38#include "mcbsp.h"
39#include "omap-mcbsp.h" 39#include "omap-mcbsp.h"
40#include "omap-pcm.h" 40#include "omap-pcm.h"
diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c
index 2830dfd05661..e263188841b6 100644
--- a/sound/soc/omap/omap3beagle.c
+++ b/sound/soc/omap/omap3beagle.c
@@ -29,7 +29,7 @@
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32#include <plat/mcbsp.h> 32#include <linux/platform_data/asoc-ti-mcbsp.h>
33 33
34#include "omap-mcbsp.h" 34#include "omap-mcbsp.h"
35#include "omap-pcm.h" 35#include "omap-pcm.h"
diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c
index 3d468c9179d7..d632bfbb6983 100644
--- a/sound/soc/omap/omap3evm.c
+++ b/sound/soc/omap/omap3evm.c
@@ -27,7 +27,7 @@
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/gpio.h> 29#include <mach/gpio.h>
30#include <plat/mcbsp.h> 30#include <linux/platform_data/asoc-ti-mcbsp.h>
31 31
32#include "omap-mcbsp.h" 32#include "omap-mcbsp.h"
33#include "omap-pcm.h" 33#include "omap-pcm.h"
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index 4c3a0978578a..43d950a79ff9 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -31,7 +31,7 @@
31#include <sound/soc.h> 31#include <sound/soc.h>
32 32
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <plat/mcbsp.h> 34#include <linux/platform_data/asoc-ti-mcbsp.h>
35 35
36#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
37#include "omap-pcm.h" 37#include "omap-pcm.h"
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index b1a9d64cbc56..3960e8df9c76 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -31,7 +31,7 @@
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/module.h> 33#include <linux/module.h>
34#include <plat/mcbsp.h> 34#include <linux/platform_data/asoc-ti-mcbsp.h>
35 35
36#include "omap-mcbsp.h" 36#include "omap-mcbsp.h"
37#include "omap-pcm.h" 37#include "omap-pcm.h"
diff --git a/sound/soc/omap/overo.c b/sound/soc/omap/overo.c
index 6ac3e0c3c282..502bce299885 100644
--- a/sound/soc/omap/overo.c
+++ b/sound/soc/omap/overo.c
@@ -29,7 +29,7 @@
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32#include <plat/mcbsp.h> 32#include <linux/platform_data/asoc-ti-mcbsp.h>
33 33
34#include "omap-mcbsp.h" 34#include "omap-mcbsp.h"
35#include "omap-pcm.h" 35#include "omap-pcm.h"
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index 2712dd232b6d..d921ddbe3ecb 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -31,7 +31,7 @@
31#include <sound/jack.h> 31#include <sound/jack.h>
32#include <sound/pcm.h> 32#include <sound/pcm.h>
33#include <sound/soc.h> 33#include <sound/soc.h>
34#include <plat/mcbsp.h> 34#include <linux/platform_data/asoc-ti-mcbsp.h>
35#include "../codecs/tpa6130a2.h" 35#include "../codecs/tpa6130a2.h"
36 36
37#include <asm/mach-types.h> 37#include <asm/mach-types.h>
diff --git a/sound/soc/omap/sdp3430.c b/sound/soc/omap/sdp3430.c
index 78e14198aa11..597cae769cea 100644
--- a/sound/soc/omap/sdp3430.c
+++ b/sound/soc/omap/sdp3430.c
@@ -33,8 +33,8 @@
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <plat/mcbsp.h>
37#include <linux/platform_data/gpio-omap.h> 36#include <linux/platform_data/gpio-omap.h>
37#include <linux/platform_data/asoc-ti-mcbsp.h>
38 38
39/* Register descriptions for twl4030 codec part */ 39/* Register descriptions for twl4030 codec part */
40#include <linux/mfd/twl4030-audio.h> 40#include <linux/mfd/twl4030-audio.h>
diff --git a/sound/soc/omap/zoom2.c b/sound/soc/omap/zoom2.c
index 920e0d9e03db..23de2b21d696 100644
--- a/sound/soc/omap/zoom2.c
+++ b/sound/soc/omap/zoom2.c
@@ -29,7 +29,7 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/gpio.h> 30#include <mach/gpio.h>
31#include <mach/board-zoom.h> 31#include <mach/board-zoom.h>
32#include <plat/mcbsp.h> 32#include <linux/platform_data/asoc-ti-mcbsp.h>
33 33
34/* Register descriptions for twl4030 codec part */ 34/* Register descriptions for twl4030 codec part */
35#include <linux/mfd/twl4030-audio.h> 35#include <linux/mfd/twl4030-audio.h>
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
index db24bc685bd3..aa3da91907c6 100644
--- a/sound/soc/pxa/palm27x.c
+++ b/sound/soc/pxa/palm27x.c
@@ -25,7 +25,7 @@
25 25
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <mach/audio.h> 27#include <mach/audio.h>
28#include <mach/palmasoc.h> 28#include <linux/platform_data/asoc-palm27x.h>
29 29
30#include "../codecs/wm9712.h" 30#include "../codecs/wm9712.h"
31#include "pxa2xx-ac97.h" 31#include "pxa2xx-ac97.h"
diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c
index 3d04c1fa6781..14fbcd30cae5 100644
--- a/sound/soc/samsung/ac97.c
+++ b/sound/soc/samsung/ac97.c
@@ -21,7 +21,7 @@
21 21
22#include <mach/dma.h> 22#include <mach/dma.h>
23#include <plat/regs-ac97.h> 23#include <plat/regs-ac97.h>
24#include <plat/audio.h> 24#include <linux/platform_data/asoc-s3c.h>
25 25
26#include "dma.h" 26#include "dma.h"
27 27
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 6ac7b8281a02..40b00a13dcd1 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -20,7 +20,7 @@
20#include <sound/soc.h> 20#include <sound/soc.h>
21#include <sound/pcm_params.h> 21#include <sound/pcm_params.h>
22 22
23#include <plat/audio.h> 23#include <linux/platform_data/asoc-s3c.h>
24 24
25#include "dma.h" 25#include "dma.h"
26#include "idma.h" 26#include "idma.h"
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 89b064650f14..c86081992dfd 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -19,7 +19,7 @@
19#include <sound/soc.h> 19#include <sound/soc.h>
20#include <sound/pcm_params.h> 20#include <sound/pcm_params.h>
21 21
22#include <plat/audio.h> 22#include <linux/platform_data/asoc-s3c.h>
23#include <mach/dma.h> 23#include <mach/dma.h>
24 24
25#include "dma.h" 25#include "dma.h"
diff --git a/sound/soc/samsung/s3c24xx_simtec.c b/sound/soc/samsung/s3c24xx_simtec.c
index 656d5afe4ca9..335a7d8a4a8d 100644
--- a/sound/soc/samsung/s3c24xx_simtec.c
+++ b/sound/soc/samsung/s3c24xx_simtec.c
@@ -13,7 +13,7 @@
13 13
14#include <sound/soc.h> 14#include <sound/soc.h>
15 15
16#include <plat/audio-simtec.h> 16#include <linux/platform_data/asoc-s3c24xx_simtec.h>
17 17
18#include "s3c24xx-i2s.h" 18#include "s3c24xx-i2s.h"
19#include "s3c24xx_simtec.h" 19#include "s3c24xx_simtec.h"
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index a5a56a120345..bc24c7af02b2 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -17,7 +17,7 @@
17#include <sound/soc.h> 17#include <sound/soc.h>
18#include <sound/pcm_params.h> 18#include <sound/pcm_params.h>
19 19
20#include <plat/audio.h> 20#include <linux/platform_data/asoc-s3c.h>
21#include <mach/dma.h> 21#include <mach/dma.h>
22 22
23#include "dma.h" 23#include "dma.h"
diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig
index 02bcd308c189..19e5fe7cc403 100644
--- a/sound/soc/tegra/Kconfig
+++ b/sound/soc/tegra/Kconfig
@@ -1,6 +1,6 @@
1config SND_SOC_TEGRA 1config SND_SOC_TEGRA
2 tristate "SoC Audio for the Tegra System-on-Chip" 2 tristate "SoC Audio for the Tegra System-on-Chip"
3 depends on ARCH_TEGRA && (TEGRA_SYSTEM_DMA || TEGRA20_APB_DMA) 3 depends on ARCH_TEGRA && TEGRA20_APB_DMA
4 select REGMAP_MMIO 4 select REGMAP_MMIO
5 select SND_SOC_DMAENGINE_PCM if TEGRA20_APB_DMA 5 select SND_SOC_DMAENGINE_PCM if TEGRA20_APB_DMA
6 help 6 help
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index 8d6900c1ee47..e18733963cb4 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -57,237 +57,6 @@ static const struct snd_pcm_hardware tegra_pcm_hardware = {
57 .fifo_size = 4, 57 .fifo_size = 4,
58}; 58};
59 59
60#if defined(CONFIG_TEGRA_SYSTEM_DMA)
61static void tegra_pcm_queue_dma(struct tegra_runtime_data *prtd)
62{
63 struct snd_pcm_substream *substream = prtd->substream;
64 struct snd_dma_buffer *buf = &substream->dma_buffer;
65 struct tegra_dma_req *dma_req;
66 unsigned long addr;
67
68 dma_req = &prtd->dma_req[prtd->dma_req_idx];
69 prtd->dma_req_idx = 1 - prtd->dma_req_idx;
70
71 addr = buf->addr + prtd->dma_pos;
72 prtd->dma_pos += dma_req->size;
73 if (prtd->dma_pos >= prtd->dma_pos_end)
74 prtd->dma_pos = 0;
75
76 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
77 dma_req->source_addr = addr;
78 else
79 dma_req->dest_addr = addr;
80
81 tegra_dma_enqueue_req(prtd->dma_chan, dma_req);
82}
83
84static void dma_complete_callback(struct tegra_dma_req *req)
85{
86 struct tegra_runtime_data *prtd = (struct tegra_runtime_data *)req->dev;
87 struct snd_pcm_substream *substream = prtd->substream;
88 struct snd_pcm_runtime *runtime = substream->runtime;
89
90 spin_lock(&prtd->lock);
91
92 if (!prtd->running) {
93 spin_unlock(&prtd->lock);
94 return;
95 }
96
97 if (++prtd->period_index >= runtime->periods)
98 prtd->period_index = 0;
99
100 tegra_pcm_queue_dma(prtd);
101
102 spin_unlock(&prtd->lock);
103
104 snd_pcm_period_elapsed(substream);
105}
106
107static void setup_dma_tx_request(struct tegra_dma_req *req,
108 struct tegra_pcm_dma_params * dmap)
109{
110 req->complete = dma_complete_callback;
111 req->to_memory = false;
112 req->dest_addr = dmap->addr;
113 req->dest_wrap = dmap->wrap;
114 req->source_bus_width = 32;
115 req->source_wrap = 0;
116 req->dest_bus_width = dmap->width;
117 req->req_sel = dmap->req_sel;
118}
119
120static void setup_dma_rx_request(struct tegra_dma_req *req,
121 struct tegra_pcm_dma_params * dmap)
122{
123 req->complete = dma_complete_callback;
124 req->to_memory = true;
125 req->source_addr = dmap->addr;
126 req->dest_wrap = 0;
127 req->source_bus_width = dmap->width;
128 req->source_wrap = dmap->wrap;
129 req->dest_bus_width = 32;
130 req->req_sel = dmap->req_sel;
131}
132
133static int tegra_pcm_open(struct snd_pcm_substream *substream)
134{
135 struct snd_pcm_runtime *runtime = substream->runtime;
136 struct tegra_runtime_data *prtd;
137 struct snd_soc_pcm_runtime *rtd = substream->private_data;
138 struct tegra_pcm_dma_params * dmap;
139 int ret = 0;
140
141 prtd = kzalloc(sizeof(struct tegra_runtime_data), GFP_KERNEL);
142 if (prtd == NULL)
143 return -ENOMEM;
144
145 runtime->private_data = prtd;
146 prtd->substream = substream;
147
148 spin_lock_init(&prtd->lock);
149
150 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
151 dmap = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
152 setup_dma_tx_request(&prtd->dma_req[0], dmap);
153 setup_dma_tx_request(&prtd->dma_req[1], dmap);
154 } else {
155 dmap = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
156 setup_dma_rx_request(&prtd->dma_req[0], dmap);
157 setup_dma_rx_request(&prtd->dma_req[1], dmap);
158 }
159
160 prtd->dma_req[0].dev = prtd;
161 prtd->dma_req[1].dev = prtd;
162
163 prtd->dma_chan = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT);
164 if (prtd->dma_chan == NULL) {
165 ret = -ENOMEM;
166 goto err;
167 }
168
169 /* Set HW params now that initialization is complete */
170 snd_soc_set_runtime_hwparams(substream, &tegra_pcm_hardware);
171
172 /* Ensure that buffer size is a multiple of period size */
173 ret = snd_pcm_hw_constraint_integer(runtime,
174 SNDRV_PCM_HW_PARAM_PERIODS);
175 if (ret < 0)
176 goto err;
177
178 return 0;
179
180err:
181 if (prtd->dma_chan) {
182 tegra_dma_free_channel(prtd->dma_chan);
183 }
184
185 kfree(prtd);
186
187 return ret;
188}
189
190static int tegra_pcm_close(struct snd_pcm_substream *substream)
191{
192 struct snd_pcm_runtime *runtime = substream->runtime;
193 struct tegra_runtime_data *prtd = runtime->private_data;
194
195 tegra_dma_free_channel(prtd->dma_chan);
196
197 kfree(prtd);
198
199 return 0;
200}
201
202static int tegra_pcm_hw_params(struct snd_pcm_substream *substream,
203 struct snd_pcm_hw_params *params)
204{
205 struct snd_pcm_runtime *runtime = substream->runtime;
206 struct tegra_runtime_data *prtd = runtime->private_data;
207
208 snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
209
210 prtd->dma_req[0].size = params_period_bytes(params);
211 prtd->dma_req[1].size = prtd->dma_req[0].size;
212
213 return 0;
214}
215
216static int tegra_pcm_hw_free(struct snd_pcm_substream *substream)
217{
218 snd_pcm_set_runtime_buffer(substream, NULL);
219
220 return 0;
221}
222
223static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
224{
225 struct snd_pcm_runtime *runtime = substream->runtime;
226 struct tegra_runtime_data *prtd = runtime->private_data;
227 unsigned long flags;
228
229 switch (cmd) {
230 case SNDRV_PCM_TRIGGER_START:
231 prtd->dma_pos = 0;
232 prtd->dma_pos_end = frames_to_bytes(runtime, runtime->periods * runtime->period_size);
233 prtd->period_index = 0;
234 prtd->dma_req_idx = 0;
235 /* Fall-through */
236 case SNDRV_PCM_TRIGGER_RESUME:
237 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
238 spin_lock_irqsave(&prtd->lock, flags);
239 prtd->running = 1;
240 spin_unlock_irqrestore(&prtd->lock, flags);
241 tegra_pcm_queue_dma(prtd);
242 tegra_pcm_queue_dma(prtd);
243 break;
244 case SNDRV_PCM_TRIGGER_STOP:
245 case SNDRV_PCM_TRIGGER_SUSPEND:
246 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
247 spin_lock_irqsave(&prtd->lock, flags);
248 prtd->running = 0;
249 spin_unlock_irqrestore(&prtd->lock, flags);
250 tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[0]);
251 tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[1]);
252 break;
253 default:
254 return -EINVAL;
255 }
256
257 return 0;
258}
259
260static snd_pcm_uframes_t tegra_pcm_pointer(struct snd_pcm_substream *substream)
261{
262 struct snd_pcm_runtime *runtime = substream->runtime;
263 struct tegra_runtime_data *prtd = runtime->private_data;
264
265 return prtd->period_index * runtime->period_size;
266}
267
268
269static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
270 struct vm_area_struct *vma)
271{
272 struct snd_pcm_runtime *runtime = substream->runtime;
273
274 return dma_mmap_writecombine(substream->pcm->card->dev, vma,
275 runtime->dma_area,
276 runtime->dma_addr,
277 runtime->dma_bytes);
278}
279
280static struct snd_pcm_ops tegra_pcm_ops = {
281 .open = tegra_pcm_open,
282 .close = tegra_pcm_close,
283 .ioctl = snd_pcm_lib_ioctl,
284 .hw_params = tegra_pcm_hw_params,
285 .hw_free = tegra_pcm_hw_free,
286 .trigger = tegra_pcm_trigger,
287 .pointer = tegra_pcm_pointer,
288 .mmap = tegra_pcm_mmap,
289};
290#else
291static int tegra_pcm_open(struct snd_pcm_substream *substream) 60static int tegra_pcm_open(struct snd_pcm_substream *substream)
292{ 61{
293 struct snd_soc_pcm_runtime *rtd = substream->private_data; 62 struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -399,7 +168,6 @@ static struct snd_pcm_ops tegra_pcm_ops = {
399 .pointer = snd_dmaengine_pcm_pointer, 168 .pointer = snd_dmaengine_pcm_pointer,
400 .mmap = tegra_pcm_mmap, 169 .mmap = tegra_pcm_mmap,
401}; 170};
402#endif
403 171
404static int tegra_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) 172static int tegra_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
405{ 173{
diff --git a/sound/soc/tegra/tegra_pcm.h b/sound/soc/tegra/tegra_pcm.h
index a3a450352dcf..b40279b9f413 100644
--- a/sound/soc/tegra/tegra_pcm.h
+++ b/sound/soc/tegra/tegra_pcm.h
@@ -40,20 +40,6 @@ struct tegra_pcm_dma_params {
40 unsigned long req_sel; 40 unsigned long req_sel;
41}; 41};
42 42
43#if defined(CONFIG_TEGRA_SYSTEM_DMA)
44struct tegra_runtime_data {
45 struct snd_pcm_substream *substream;
46 spinlock_t lock;
47 int running;
48 int dma_pos;
49 int dma_pos_end;
50 int period_index;
51 int dma_req_idx;
52 struct tegra_dma_req dma_req[2];
53 struct tegra_dma_channel *dma_chan;
54};
55#endif
56
57int tegra_pcm_platform_register(struct device *dev); 43int tegra_pcm_platform_register(struct device *dev);
58void tegra_pcm_platform_unregister(struct device *dev); 44void tegra_pcm_platform_unregister(struct device *dev);
59 45