aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig19
-rw-r--r--arch/arm/Kconfig.debug47
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/boot/dts/Makefile17
-rw-r--r--arch/arm/boot/dts/am335x-bone.dts50
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts118
-rw-r--r--arch/arm/boot/dts/am335x-evmsk.dts250
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi156
-rw-r--r--arch/arm/boot/dts/at91sam9260.dtsi6
-rw-r--r--arch/arm/boot/dts/at91sam9263.dtsi6
-rw-r--r--arch/arm/boot/dts/at91sam9g45.dtsi6
-rw-r--r--arch/arm/boot/dts/ccu9540.dts72
-rw-r--r--arch/arm/boot/dts/cros5250-common.dtsi184
-rw-r--r--arch/arm/boot/dts/da850-enbw-cmc.dts30
-rw-r--r--arch/arm/boot/dts/da850-evm.dts28
-rw-r--r--arch/arm/boot/dts/da850.dtsi60
-rw-r--r--arch/arm/boot/dts/dbx5x0.dtsi57
-rw-r--r--arch/arm/boot/dts/evk-pro3.dts12
-rw-r--r--arch/arm/boot/dts/exynos4.dtsi54
-rw-r--r--arch/arm/boot/dts/exynos4210-origen.dts70
-rw-r--r--arch/arm/boot/dts/exynos4210-pinctrl.dtsi334
-rw-r--r--arch/arm/boot/dts/exynos4210-smdkv310.dts16
-rw-r--r--arch/arm/boot/dts/exynos4210-trats.dts87
-rw-r--r--arch/arm/boot/dts/exynos4210.dtsi249
-rw-r--r--arch/arm/boot/dts/exynos4212.dtsi28
-rw-r--r--arch/arm/boot/dts/exynos4412-smdk4412.dts45
-rw-r--r--arch/arm/boot/dts/exynos4412.dtsi28
-rw-r--r--arch/arm/boot/dts/exynos4x12-pinctrl.dtsi965
-rw-r--r--arch/arm/boot/dts/exynos4x12.dtsi69
-rw-r--r--arch/arm/boot/dts/exynos5250-smdk5250.dts56
-rw-r--r--arch/arm/boot/dts/exynos5250-snow.dts43
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi62
-rw-r--r--arch/arm/boot/dts/href.dtsi273
-rw-r--r--arch/arm/boot/dts/hrefprev60.dts41
-rw-r--r--arch/arm/boot/dts/hrefv60plus.dts217
-rw-r--r--arch/arm/boot/dts/imx23-olinuxino.dts23
-rw-r--r--arch/arm/boot/dts/imx23.dtsi13
-rw-r--r--arch/arm/boot/dts/imx25-karo-tx25.dts44
-rw-r--r--arch/arm/boot/dts/imx25.dtsi515
-rw-r--r--arch/arm/boot/dts/imx27-apf27.dts89
-rw-r--r--arch/arm/boot/dts/imx27.dtsi9
-rw-r--r--arch/arm/boot/dts/imx28-apf28.dts85
-rw-r--r--arch/arm/boot/dts/imx28-apf28dev.dts154
-rw-r--r--arch/arm/boot/dts/imx28-cfa10036.dts46
-rw-r--r--arch/arm/boot/dts/imx28-cfa10049.dts33
-rw-r--r--arch/arm/boot/dts/imx28-evk.dts13
-rw-r--r--arch/arm/boot/dts/imx28-sps1.dts169
-rw-r--r--arch/arm/boot/dts/imx28.dtsi35
-rw-r--r--arch/arm/boot/dts/imx51.dtsi47
-rw-r--r--arch/arm/boot/dts/imx53-qsb.dts62
-rw-r--r--arch/arm/boot/dts/imx53.dtsi98
-rw-r--r--arch/arm/boot/dts/imx6q-sabreauto.dts64
-rw-r--r--arch/arm/boot/dts/imx6q-sabresd.dts18
-rw-r--r--arch/arm/boot/dts/imx6q.dtsi120
-rw-r--r--arch/arm/boot/dts/lpc32xx.dtsi7
-rw-r--r--arch/arm/boot/dts/omap2.dtsi86
-rw-r--r--arch/arm/boot/dts/omap2420.dtsi16
-rw-r--r--arch/arm/boot/dts/omap2430.dtsi19
-rw-r--r--arch/arm/boot/dts/omap3-beagle-xm.dts6
-rw-r--r--arch/arm/boot/dts/omap3-beagle.dts67
-rw-r--r--arch/arm/boot/dts/omap3.dtsi107
-rw-r--r--arch/arm/boot/dts/omap4-panda-a4.dts17
-rw-r--r--arch/arm/boot/dts/omap4-panda-es.dts (renamed from arch/arm/boot/dts/omap4-pandaES.dts)9
-rw-r--r--arch/arm/boot/dts/omap4-panda.dts22
-rw-r--r--arch/arm/boot/dts/omap4-sdp-es23plus.dts17
-rw-r--r--arch/arm/boot/dts/omap4-sdp.dts22
-rw-r--r--arch/arm/boot/dts/omap4-var-som.dts (renamed from arch/arm/boot/dts/omap4-var_som.dts)0
-rw-r--r--arch/arm/boot/dts/omap4.dtsi105
-rw-r--r--arch/arm/boot/dts/omap5-evm.dts13
-rw-r--r--arch/arm/boot/dts/omap5.dtsi178
-rw-r--r--arch/arm/boot/dts/samsung_k3pe0e000b.dtsi67
-rw-r--r--arch/arm/boot/dts/snowball.dts140
-rw-r--r--arch/arm/boot/dts/stuib.dtsi78
-rw-r--r--arch/arm/boot/dts/tegra20-harmony.dts84
-rw-r--r--arch/arm/boot/dts/tegra20-paz00.dts59
-rw-r--r--arch/arm/boot/dts/tegra20-plutux.dts6
-rw-r--r--arch/arm/boot/dts/tegra20-seaboard.dts65
-rw-r--r--arch/arm/boot/dts/tegra20-tamonten.dtsi147
-rw-r--r--arch/arm/boot/dts/tegra20-tec.dts9
-rw-r--r--arch/arm/boot/dts/tegra20-trimslice.dts54
-rw-r--r--arch/arm/boot/dts/tegra20-ventana.dts149
-rw-r--r--arch/arm/boot/dts/tegra20-whistler.dts136
-rw-r--r--arch/arm/boot/dts/tegra20.dtsi146
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu-a02.dts6
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu-a04.dts6
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu.dtsi84
-rw-r--r--arch/arm/boot/dts/tegra30.dtsi156
-rw-r--r--arch/arm/boot/dts/twl4030.dtsi27
-rw-r--r--arch/arm/boot/dts/twl6030.dtsi5
-rw-r--r--arch/arm/boot/dts/u9540.dts72
-rw-r--r--arch/arm/boot/dts/zynq-7000.dtsi166
-rw-r--r--arch/arm/boot/dts/zynq-ep107.dts52
-rw-r--r--arch/arm/boot/dts/zynq-zc702.dts44
-rw-r--r--arch/arm/configs/imx_v4_v5_defconfig4
-rw-r--r--arch/arm/configs/imx_v6_v7_defconfig2
-rw-r--r--arch/arm/configs/mxs_defconfig6
-rw-r--r--arch/arm/configs/u8500_defconfig1
-rw-r--r--arch/arm/include/debug/imx.S74
-rw-r--r--arch/arm/mach-davinci/Kconfig8
-rw-r--r--arch/arm/mach-davinci/Makefile1
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c2
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c4
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c2
-rw-r--r--arch/arm/mach-davinci/da850.c17
-rw-r--r--arch/arm/mach-davinci/da8xx-dt.c66
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c77
-rw-r--r--arch/arm/mach-davinci/dm355.c6
-rw-r--r--arch/arm/mach-davinci/dm365.c6
-rw-r--r--arch/arm/mach-davinci/dm644x.c6
-rw-r--r--arch/arm/mach-davinci/dm646x.c6
-rw-r--r--arch/arm/mach-davinci/include/mach/common.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/serial.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/sram.h3
-rw-r--r--arch/arm/mach-davinci/serial.c39
-rw-r--r--arch/arm/mach-davinci/sram.c23
-rw-r--r--arch/arm/mach-davinci/time.c4
-rw-r--r--arch/arm/mach-exynos/Kconfig1
-rw-r--r--arch/arm/mach-exynos/Makefile1
-rw-r--r--arch/arm/mach-exynos/clock-exynos4.c4
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c21
-rw-r--r--arch/arm/mach-exynos/common.c7
-rw-r--r--arch/arm/mach-exynos/dev-drm.c29
-rw-r--r--arch/arm/mach-exynos/include/mach/irqs.h3
-rw-r--r--arch/arm/mach-exynos/include/mach/map.h2
-rw-r--r--arch/arm/mach-exynos/mach-exynos4-dt.c4
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c42
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c3
-rw-r--r--arch/arm/mach-exynos/mach-origen.c3
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c3
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c3
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c3
-rw-r--r--arch/arm/mach-exynos/pm_domains.c93
-rw-r--r--arch/arm/mach-imx/3ds_debugboard.c (renamed from arch/arm/plat-mxc/3ds_debugboard.c)2
-rw-r--r--arch/arm/mach-imx/3ds_debugboard.h (renamed from arch/arm/plat-mxc/include/mach/3ds_debugboard.h)0
-rw-r--r--arch/arm/mach-imx/Kconfig108
-rw-r--r--arch/arm/mach-imx/Makefile23
-rw-r--r--arch/arm/mach-imx/avic.c (renamed from arch/arm/plat-mxc/avic.c)5
-rw-r--r--arch/arm/mach-imx/board-mx31lilly.h (renamed from arch/arm/plat-mxc/include/mach/board-mx31lilly.h)0
-rw-r--r--arch/arm/mach-imx/board-mx31lite.h (renamed from arch/arm/plat-mxc/include/mach/board-mx31lite.h)0
-rw-r--r--arch/arm/mach-imx/board-mx31moboard.h (renamed from arch/arm/plat-mxc/include/mach/board-mx31moboard.h)0
-rw-r--r--arch/arm/mach-imx/board-pcm038.h (renamed from arch/arm/plat-mxc/include/mach/board-pcm038.h)0
-rw-r--r--arch/arm/mach-imx/clk-imx1.c17
-rw-r--r--arch/arm/mach-imx/clk-imx21.c18
-rw-r--r--arch/arm/mach-imx/clk-imx25.c145
-rw-r--r--arch/arm/mach-imx/clk-imx27.c40
-rw-r--r--arch/arm/mach-imx/clk-imx31.c21
-rw-r--r--arch/arm/mach-imx/clk-imx35.c13
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c15
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c4
-rw-r--r--arch/arm/mach-imx/clk-pllv1.c4
-rw-r--r--arch/arm/mach-imx/common.h (renamed from arch/arm/plat-mxc/include/mach/common.h)2
-rw-r--r--arch/arm/mach-imx/cpu-imx25.c5
-rw-r--r--arch/arm/mach-imx/cpu-imx27.c2
-rw-r--r--arch/arm/mach-imx/cpu-imx31.c7
-rw-r--r--arch/arm/mach-imx/cpu-imx35.c5
-rw-r--r--arch/arm/mach-imx/cpu-imx5.c3
-rw-r--r--arch/arm/mach-imx/cpu.c (renamed from arch/arm/plat-mxc/cpu.c)3
-rw-r--r--arch/arm/mach-imx/cpu_op-mx51.c3
-rw-r--r--arch/arm/mach-imx/cpufreq.c (renamed from arch/arm/plat-mxc/cpufreq.c)3
-rw-r--r--arch/arm/mach-imx/cpuidle.c (renamed from arch/arm/plat-mxc/cpuidle.c)0
-rw-r--r--arch/arm/mach-imx/cpuidle.h (renamed from arch/arm/plat-mxc/include/mach/cpuidle.h)0
-rw-r--r--arch/arm/mach-imx/devices-imx1.h3
-rw-r--r--arch/arm/mach-imx/devices-imx21.h3
-rw-r--r--arch/arm/mach-imx/devices-imx25.h3
-rw-r--r--arch/arm/mach-imx/devices-imx27.h3
-rw-r--r--arch/arm/mach-imx/devices-imx31.h3
-rw-r--r--arch/arm/mach-imx/devices-imx35.h3
-rw-r--r--arch/arm/mach-imx/devices-imx50.h3
-rw-r--r--arch/arm/mach-imx/devices-imx51.h3
-rw-r--r--arch/arm/mach-imx/devices/Kconfig (renamed from arch/arm/plat-mxc/devices/Kconfig)0
-rw-r--r--arch/arm/mach-imx/devices/Makefile (renamed from arch/arm/plat-mxc/devices/Makefile)2
-rw-r--r--arch/arm/mach-imx/devices/devices-common.h (renamed from arch/arm/plat-mxc/include/mach/devices-common.h)9
-rw-r--r--arch/arm/mach-imx/devices/devices.c (renamed from arch/arm/plat-mxc/devices.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-ahci-imx.c (renamed from arch/arm/plat-mxc/devices/platform-ahci-imx.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-fec.c (renamed from arch/arm/plat-mxc/devices/platform-fec.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-flexcan.c (renamed from arch/arm/plat-mxc/devices/platform-flexcan.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c (renamed from arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-gpio-mxc.c (renamed from arch/arm/plat-mxc/devices/platform-gpio-mxc.c)2
-rw-r--r--arch/arm/mach-imx/devices/platform-gpio_keys.c (renamed from arch/arm/plat-mxc/devices/platform-gpio_keys.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-dma.c (renamed from arch/arm/plat-mxc/devices/platform-imx-dma.c)23
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-fb.c (renamed from arch/arm/plat-mxc/devices/platform-imx-fb.c)16
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-i2c.c (renamed from arch/arm/plat-mxc/devices/platform-imx-i2c.c)32
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-keypad.c (renamed from arch/arm/plat-mxc/devices/platform-imx-keypad.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-ssi.c (renamed from arch/arm/plat-mxc/devices/platform-imx-ssi.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-uart.c (renamed from arch/arm/plat-mxc/devices/platform-imx-uart.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-imx2-wdt.c (renamed from arch/arm/plat-mxc/devices/platform-imx2-wdt.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-imx21-hcd.c (renamed from arch/arm/plat-mxc/devices/platform-imx21-hcd.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-imx27-coda.c (renamed from arch/arm/plat-mxc/devices/platform-imx27-coda.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-imx_udc.c (renamed from arch/arm/plat-mxc/devices/platform-imx_udc.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-imxdi_rtc.c (renamed from arch/arm/plat-mxc/devices/platform-imxdi_rtc.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-ipu-core.c (renamed from arch/arm/plat-mxc/devices/platform-ipu-core.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-mx1-camera.c (renamed from arch/arm/plat-mxc/devices/platform-mx1-camera.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-mx2-camera.c (renamed from arch/arm/plat-mxc/devices/platform-mx2-camera.c)16
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc-ehci.c (renamed from arch/arm/plat-mxc/devices/platform-mxc-ehci.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc-mmc.c (renamed from arch/arm/plat-mxc/devices/platform-mxc-mmc.c)20
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc_nand.c (renamed from arch/arm/plat-mxc/devices/platform-mxc_nand.c)25
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc_pwm.c (renamed from arch/arm/plat-mxc/devices/platform-mxc_pwm.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc_rnga.c (renamed from arch/arm/plat-mxc/devices/platform-mxc_rnga.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc_rtc.c (renamed from arch/arm/plat-mxc/devices/platform-mxc_rtc.c)13
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc_w1.c (renamed from arch/arm/plat-mxc/devices/platform-mxc_w1.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-pata_imx.c (renamed from arch/arm/plat-mxc/devices/platform-pata_imx.c)4
-rw-r--r--arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c (renamed from arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c)5
-rw-r--r--arch/arm/mach-imx/devices/platform-spi_imx.c (renamed from arch/arm/plat-mxc/devices/platform-spi_imx.c)4
-rw-r--r--arch/arm/mach-imx/ehci-imx25.c4
-rw-r--r--arch/arm/mach-imx/ehci-imx27.c4
-rw-r--r--arch/arm/mach-imx/ehci-imx31.c4
-rw-r--r--arch/arm/mach-imx/ehci-imx35.c4
-rw-r--r--arch/arm/mach-imx/ehci-imx5.c4
-rw-r--r--arch/arm/mach-imx/epit.c (renamed from arch/arm/plat-mxc/epit.c)6
-rw-r--r--arch/arm/mach-imx/eukrea-baseboards.h (renamed from arch/arm/plat-mxc/include/mach/eukrea-baseboards.h)0
-rw-r--r--arch/arm/mach-imx/eukrea_mbimx27-baseboard.c7
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c8
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c7
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c7
-rw-r--r--arch/arm/mach-imx/hardware.h (renamed from arch/arm/plat-mxc/include/mach/hardware.h)26
-rw-r--r--arch/arm/mach-imx/hotplug.c3
-rw-r--r--arch/arm/mach-imx/iim.h (renamed from arch/arm/plat-mxc/include/mach/iim.h)0
-rw-r--r--arch/arm/mach-imx/imx25-dt.c48
-rw-r--r--arch/arm/mach-imx/imx27-dt.c11
-rw-r--r--arch/arm/mach-imx/imx31-dt.c5
-rw-r--r--arch/arm/mach-imx/imx51-dt.c9
-rw-r--r--arch/arm/mach-imx/include/mach/dma-mx1-mx2.h10
-rw-r--r--arch/arm/mach-imx/iomux-imx31.c5
-rw-r--r--arch/arm/mach-imx/iomux-mx1.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx1.h)2
-rw-r--r--arch/arm/mach-imx/iomux-mx21.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx21.h)4
-rw-r--r--arch/arm/mach-imx/iomux-mx25.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx25.h)2
-rw-r--r--arch/arm/mach-imx/iomux-mx27.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx27.h)4
-rw-r--r--arch/arm/mach-imx/iomux-mx2x.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx2x.h)0
-rw-r--r--arch/arm/mach-imx/iomux-mx3.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx3.h)0
-rw-r--r--arch/arm/mach-imx/iomux-mx35.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx35.h)2
-rw-r--r--arch/arm/mach-imx/iomux-mx50.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx50.h)2
-rw-r--r--arch/arm/mach-imx/iomux-mx51.h (renamed from arch/arm/plat-mxc/include/mach/iomux-mx51.h)2
-rw-r--r--arch/arm/mach-imx/iomux-v1.c (renamed from arch/arm/plat-mxc/iomux-v1.c)5
-rw-r--r--arch/arm/mach-imx/iomux-v1.h (renamed from arch/arm/plat-mxc/include/mach/iomux-v1.h)0
-rw-r--r--arch/arm/mach-imx/iomux-v3.c (renamed from arch/arm/plat-mxc/iomux-v3.c)5
-rw-r--r--arch/arm/mach-imx/iomux-v3.h (renamed from arch/arm/plat-mxc/include/mach/iomux-v3.h)0
-rw-r--r--arch/arm/mach-imx/iram.h (renamed from arch/arm/plat-mxc/include/mach/iram.h)0
-rw-r--r--arch/arm/mach-imx/iram_alloc.c (renamed from arch/arm/plat-mxc/iram_alloc.c)3
-rw-r--r--arch/arm/mach-imx/irq-common.c (renamed from arch/arm/plat-mxc/irq-common.c)0
-rw-r--r--arch/arm/mach-imx/irq-common.h (renamed from arch/arm/plat-mxc/irq-common.h)3
-rw-r--r--arch/arm/mach-imx/lluart.c31
-rw-r--r--arch/arm/mach-imx/mach-apf9328.c7
-rw-r--r--arch/arm/mach-imx/mach-armadillo5x0.c9
-rw-r--r--arch/arm/mach-imx/mach-bug.c7
-rw-r--r--arch/arm/mach-imx/mach-cpuimx27.c11
-rw-r--r--arch/arm/mach-imx/mach-cpuimx35.c9
-rw-r--r--arch/arm/mach-imx/mach-cpuimx51sd.c9
-rw-r--r--arch/arm/mach-imx/mach-eukrea_cpuimx25.c10
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c6
-rw-r--r--arch/arm/mach-imx/mach-imx27ipcam.c6
-rw-r--r--arch/arm/mach-imx/mach-imx27lite.c6
-rw-r--r--arch/arm/mach-imx/mach-imx53.c11
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c41
-rw-r--r--arch/arm/mach-imx/mach-kzm_arm11_01.c7
-rw-r--r--arch/arm/mach-imx/mach-mx1ads.c7
-rw-r--r--arch/arm/mach-imx/mach-mx21ads.c6
-rw-r--r--arch/arm/mach-imx/mach-mx25_3ds.c8
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c10
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c6
-rw-r--r--arch/arm/mach-imx/mach-mx31_3ds.c12
-rw-r--r--arch/arm/mach-imx/mach-mx31ads.c5
-rw-r--r--arch/arm/mach-imx/mach-mx31lilly.c11
-rw-r--r--arch/arm/mach-imx/mach-mx31lite.c11
-rw-r--r--arch/arm/mach-imx/mach-mx31moboard.c14
-rw-r--r--arch/arm/mach-imx/mach-mx35_3ds.c8
-rw-r--r--arch/arm/mach-imx/mach-mx50_rdp.c7
-rw-r--r--arch/arm/mach-imx/mach-mx51_3ds.c9
-rw-r--r--arch/arm/mach-imx/mach-mx51_babbage.c7
-rw-r--r--arch/arm/mach-imx/mach-mxt_td60.c6
-rw-r--r--arch/arm/mach-imx/mach-pca100.c8
-rw-r--r--arch/arm/mach-imx/mach-pcm037.c8
-rw-r--r--arch/arm/mach-imx/mach-pcm037_eet.c5
-rw-r--r--arch/arm/mach-imx/mach-pcm038.c13
-rw-r--r--arch/arm/mach-imx/mach-pcm043.c9
-rw-r--r--arch/arm/mach-imx/mach-qong.c6
-rw-r--r--arch/arm/mach-imx/mach-scb9328.c7
-rw-r--r--arch/arm/mach-imx/mach-vpr200.c7
-rw-r--r--arch/arm/mach-imx/mm-imx1.c9
-rw-r--r--arch/arm/mach-imx/mm-imx21.c14
-rw-r--r--arch/arm/mach-imx/mm-imx25.c12
-rw-r--r--arch/arm/mach-imx/mm-imx27.c14
-rw-r--r--arch/arm/mach-imx/mm-imx3.c13
-rw-r--r--arch/arm/mach-imx/mm-imx5.c12
-rw-r--r--arch/arm/mach-imx/mx1.h (renamed from arch/arm/plat-mxc/include/mach/mx1.h)0
-rw-r--r--arch/arm/mach-imx/mx21.h (renamed from arch/arm/plat-mxc/include/mach/mx21.h)0
-rw-r--r--arch/arm/mach-imx/mx25.h (renamed from arch/arm/plat-mxc/include/mach/mx25.h)0
-rw-r--r--arch/arm/mach-imx/mx27.h (renamed from arch/arm/plat-mxc/include/mach/mx27.h)0
-rw-r--r--arch/arm/mach-imx/mx2x.h (renamed from arch/arm/plat-mxc/include/mach/mx2x.h)0
-rw-r--r--arch/arm/mach-imx/mx31.h (renamed from arch/arm/plat-mxc/include/mach/mx31.h)0
-rw-r--r--arch/arm/mach-imx/mx31lilly-db.c9
-rw-r--r--arch/arm/mach-imx/mx31lite-db.c9
-rw-r--r--arch/arm/mach-imx/mx31moboard-devboard.c9
-rw-r--r--arch/arm/mach-imx/mx31moboard-marxbot.c9
-rw-r--r--arch/arm/mach-imx/mx31moboard-smartbot.c11
-rw-r--r--arch/arm/mach-imx/mx35.h (renamed from arch/arm/plat-mxc/include/mach/mx35.h)0
-rw-r--r--arch/arm/mach-imx/mx3x.h (renamed from arch/arm/plat-mxc/include/mach/mx3x.h)0
-rw-r--r--arch/arm/mach-imx/mx50.h (renamed from arch/arm/plat-mxc/include/mach/mx50.h)0
-rw-r--r--arch/arm/mach-imx/mx51.h (renamed from arch/arm/plat-mxc/include/mach/mx51.h)0
-rw-r--r--arch/arm/mach-imx/mx53.h (renamed from arch/arm/plat-mxc/include/mach/mx53.h)0
-rw-r--r--arch/arm/mach-imx/mx6q.h (renamed from arch/arm/plat-mxc/include/mach/mx6q.h)4
-rw-r--r--arch/arm/mach-imx/mxc.h (renamed from arch/arm/plat-mxc/include/mach/mxc.h)0
-rw-r--r--arch/arm/mach-imx/pcm970-baseboard.c7
-rw-r--r--arch/arm/mach-imx/platsmp.c5
-rw-r--r--arch/arm/mach-imx/pm-imx27.c3
-rw-r--r--arch/arm/mach-imx/pm-imx3.c7
-rw-r--r--arch/arm/mach-imx/pm-imx5.c7
-rw-r--r--arch/arm/mach-imx/pm-imx6q.c5
-rw-r--r--arch/arm/mach-imx/ssi-fiq-ksym.c (renamed from arch/arm/plat-mxc/ssi-fiq-ksym.c)0
-rw-r--r--arch/arm/mach-imx/ssi-fiq.S (renamed from arch/arm/plat-mxc/ssi-fiq.S)0
-rw-r--r--arch/arm/mach-imx/system.c (renamed from arch/arm/plat-mxc/system.c)5
-rw-r--r--arch/arm/mach-imx/time.c (renamed from arch/arm/plat-mxc/time.c)5
-rw-r--r--arch/arm/mach-imx/tzic.c (renamed from arch/arm/plat-mxc/tzic.c)6
-rw-r--r--arch/arm/mach-imx/ulpi.c (renamed from arch/arm/plat-mxc/ulpi.c)2
-rw-r--r--arch/arm/mach-imx/ulpi.h (renamed from arch/arm/plat-mxc/include/mach/ulpi.h)0
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c56
-rw-r--r--arch/arm/mach-mxs/timer.c10
-rw-r--r--arch/arm/mach-omap1/Makefile3
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c1
-rw-r--r--arch/arm/mach-omap1/board-fsample.c9
-rw-r--r--arch/arm/mach-omap1/board-generic.c1
-rw-r--r--arch/arm/mach-omap1/board-h2-mmc.c5
-rw-r--r--arch/arm/mach-omap1/board-h2.c6
-rw-r--r--arch/arm/mach-omap1/board-h3-mmc.c3
-rw-r--r--arch/arm/mach-omap1/board-h3.c5
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c3
-rw-r--r--arch/arm/mach-omap1/board-innovator.c30
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c5
-rw-r--r--arch/arm/mach-omap1/board-osk.c3
-rw-r--r--arch/arm/mach-omap1/board-palmte.c6
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c8
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c6
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c9
-rw-r--r--arch/arm/mach-omap1/board-sx1-mmc.c3
-rw-r--r--arch/arm/mach-omap1/board-sx1.c6
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c3
-rw-r--r--arch/arm/mach-omap1/clock.c507
-rw-r--r--arch/arm/mach-omap1/clock.h178
-rw-r--r--arch/arm/mach-omap1/clock_data.c16
-rw-r--r--arch/arm/mach-omap1/common.h7
-rw-r--r--arch/arm/mach-omap1/devices.c35
-rw-r--r--arch/arm/mach-omap1/dma.c9
-rw-r--r--arch/arm/mach-omap1/dma.h83
-rw-r--r--arch/arm/mach-omap1/flash.c2
-rw-r--r--arch/arm/mach-omap1/fpga.c4
-rw-r--r--arch/arm/mach-omap1/fpga.h52
-rw-r--r--arch/arm/mach-omap1/gpio15xx.c2
-rw-r--r--arch/arm/mach-omap1/gpio16xx.c2
-rw-r--r--arch/arm/mach-omap1/gpio7xx.c2
-rw-r--r--arch/arm/mach-omap1/i2c.c64
-rw-r--r--arch/arm/mach-omap1/id.c2
-rw-r--r--arch/arm/mach-omap1/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-omap1/include/mach/entry-macro.S2
-rw-r--r--arch/arm/mach-omap1/include/mach/gpio.h3
-rw-r--r--arch/arm/mach-omap1/include/mach/hardware.h9
-rw-r--r--arch/arm/mach-omap1/include/mach/memory.h2
-rw-r--r--arch/arm/mach-omap1/include/mach/omap1510.h113
-rw-r--r--arch/arm/mach-omap1/include/mach/serial.h53
-rw-r--r--arch/arm/mach-omap1/include/mach/soc.h229
-rw-r--r--arch/arm/mach-omap1/include/mach/tc.h (renamed from arch/arm/plat-omap/include/plat/tc.h)0
-rw-r--r--arch/arm/mach-omap1/include/mach/uncompress.h121
-rw-r--r--arch/arm/mach-omap1/io.c5
-rw-r--r--arch/arm/mach-omap1/iomap.h3
-rw-r--r--arch/arm/mach-omap1/irq.c2
-rw-r--r--arch/arm/mach-omap1/lcd_dma.c4
-rw-r--r--arch/arm/mach-omap1/mcbsp.c5
-rw-r--r--arch/arm/mach-omap1/mmc.h18
-rw-r--r--arch/arm/mach-omap1/opp_data.c2
-rw-r--r--arch/arm/mach-omap1/pm.c10
-rw-r--r--arch/arm/mach-omap1/pm_bus.c3
-rw-r--r--arch/arm/mach-omap1/reset.c41
-rw-r--r--arch/arm/mach-omap1/serial.c1
-rw-r--r--arch/arm/mach-omap1/sleep.S2
-rw-r--r--arch/arm/mach-omap1/soc.h4
-rw-r--r--arch/arm/mach-omap1/sram-init.c76
-rw-r--r--arch/arm/mach-omap1/sram.h7
-rw-r--r--arch/arm/mach-omap1/timer32k.c1
-rw-r--r--arch/arm/mach-omap1/usb.c6
-rw-r--r--arch/arm/mach-omap2/Makefile121
-rw-r--r--arch/arm/mach-omap2/am33xx.h1
-rw-r--r--arch/arm/mach-omap2/am35xx-emac.c2
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c6
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c8
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c5
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c6
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c3
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c4
-rw-r--r--arch/arm/mach-omap2/board-apollon.c6
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c28
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c8
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c13
-rw-r--r--arch/arm/mach-omap2/board-flash.c52
-rw-r--r--arch/arm/mach-omap2/board-flash.h8
-rw-r--r--arch/arm/mach-omap2/board-generic.c27
-rw-r--r--arch/arm/mach-omap2/board-h4.c10
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c13
-rw-r--r--arch/arm/mach-omap2/board-ldp.c11
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c11
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c18
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c13
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c11
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c6
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c5
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c13
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c8
-rw-r--r--arch/arm/mach-omap2/board-overo.c13
-rw-r--r--arch/arm/mach-omap2/board-rm680.c13
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c7
-rw-r--r--arch/arm/mach-omap2/board-rx51.c10
-rw-r--r--arch/arm/mach-omap2/board-ti8168evm.c7
-rw-r--r--arch/arm/mach-omap2/board-zoom-debugboard.c4
-rw-r--r--arch/arm/mach-omap2/board-zoom-display.c3
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c3
-rw-r--r--arch/arm/mach-omap2/board-zoom.c12
-rw-r--r--arch/arm/mach-omap2/board-zoom.h (renamed from arch/arm/mach-omap2/include/mach/board-zoom.h)0
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_apll.c60
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpll.c4
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpllcore.c42
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_osc.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_sys.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c76
-rw-r--r--arch/arm/mach-omap2/clkt34xx_dpll3m2.c5
-rw-r--r--arch/arm/mach-omap2/clkt_clksel.c2
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c2
-rw-r--r--arch/arm/mach-omap2/clkt_iclk.c2
-rw-r--r--arch/arm/mach-omap2/clock.c578
-rw-r--r--arch/arm/mach-omap2/clock.h345
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c32
-rw-r--r--arch/arm/mach-omap2/clock2430.c4
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c32
-rw-r--r--arch/arm/mach-omap2/clock2xxx.c18
-rw-r--r--arch/arm/mach-omap2/clock2xxx.h9
-rw-r--r--arch/arm/mach-omap2/clock33xx_data.c5
-rw-r--r--arch/arm/mach-omap2/clock34xx.c4
-rw-r--r--arch/arm/mach-omap2/clock3517.c4
-rw-r--r--arch/arm/mach-omap2/clock36xx.c2
-rw-r--r--arch/arm/mach-omap2/clock3xxx.c2
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c6
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c4
-rw-r--r--arch/arm/mach-omap2/clockdomain.c3
-rw-r--r--arch/arm/mach-omap2/clockdomain.h5
-rw-r--r--arch/arm/mach-omap2/clockdomain2xxx_3xxx.c339
-rw-r--r--arch/arm/mach-omap2/clockdomain33xx.c74
-rw-r--r--arch/arm/mach-omap2/clockdomain44xx.c151
-rw-r--r--arch/arm/mach-omap2/clockdomains2420_data.c1
-rw-r--r--arch/arm/mach-omap2/clockdomains2430_data.c1
-rw-r--r--arch/arm/mach-omap2/clockdomains3xxx_data.c1
-rw-r--r--arch/arm/mach-omap2/cm-regbits-24xx.h2
-rw-r--r--arch/arm/mach-omap2/cm.h30
-rw-r--r--arch/arm/mach-omap2/cm2xxx.c381
-rw-r--r--arch/arm/mach-omap2/cm2xxx.h70
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.h125
-rw-r--r--arch/arm/mach-omap2/cm33xx.c58
-rw-r--r--arch/arm/mach-omap2/cm3xxx.c (renamed from arch/arm/mach-omap2/cm2xxx_3xxx.c)371
-rw-r--r--arch/arm/mach-omap2/cm3xxx.h91
-rw-r--r--arch/arm/mach-omap2/cm_common.c140
-rw-r--r--arch/arm/mach-omap2/cminst44xx.c142
-rw-r--r--arch/arm/mach-omap2/cminst44xx.h2
-rw-r--r--arch/arm/mach-omap2/common-board-devices.c46
-rw-r--r--arch/arm/mach-omap2/common-board-devices.h1
-rw-r--r--arch/arm/mach-omap2/common.c187
-rw-r--r--arch/arm/mach-omap2/common.h146
-rw-r--r--arch/arm/mach-omap2/control.c18
-rw-r--r--arch/arm/mach-omap2/control.h2
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c1
-rw-r--r--arch/arm/mach-omap2/devices.c34
-rw-r--r--arch/arm/mach-omap2/display.c47
-rw-r--r--arch/arm/mach-omap2/dma.c11
-rw-r--r--arch/arm/mach-omap2/dma.h131
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c2
-rw-r--r--arch/arm/mach-omap2/dpll44xx.c2
-rw-r--r--arch/arm/mach-omap2/drm.c4
-rw-r--r--arch/arm/mach-omap2/dsp.c2
-rw-r--r--arch/arm/mach-omap2/gpio.c6
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c85
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.h27
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c214
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.h24
-rw-r--r--arch/arm/mach-omap2/gpmc-smc91x.c2
-rw-r--r--arch/arm/mach-omap2/gpmc-smsc911x.c2
-rw-r--r--arch/arm/mach-omap2/gpmc.c464
-rw-r--r--arch/arm/mach-omap2/gpmc.h (renamed from arch/arm/plat-omap/include/plat/gpmc.h)61
-rw-r--r--arch/arm/mach-omap2/hdq1w.c8
-rw-r--r--arch/arm/mach-omap2/hdq1w.h2
-rw-r--r--arch/arm/mach-omap2/hsmmc.c8
-rw-r--r--arch/arm/mach-omap2/hwspinlock.c4
-rw-r--r--arch/arm/mach-omap2/i2c.c73
-rw-r--r--arch/arm/mach-omap2/i2c.h42
-rw-r--r--arch/arm/mach-omap2/id.c7
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-omap2/include/mach/gpio.h3
-rw-r--r--arch/arm/mach-omap2/include/mach/serial.h (renamed from arch/arm/plat-omap/include/plat/serial.h)29
-rw-r--r--arch/arm/mach-omap2/include/mach/uncompress.h175
-rw-r--r--arch/arm/mach-omap2/io.c110
-rw-r--r--arch/arm/mach-omap2/mcbsp.c9
-rw-r--r--arch/arm/mach-omap2/mmc.h23
-rw-r--r--arch/arm/mach-omap2/msdi.c11
-rw-r--r--arch/arm/mach-omap2/mux.c3
-rw-r--r--arch/arm/mach-omap2/omap-mpuss-lowpower.c1
-rw-r--r--arch/arm/mach-omap2/omap-pm-noop.c (renamed from arch/arm/plat-omap/omap-pm-noop.c)5
-rw-r--r--arch/arm/mach-omap2/omap-pm.h (renamed from arch/arm/plat-omap/include/plat/omap-pm.h)0
-rw-r--r--arch/arm/mach-omap2/omap-secure.c1
-rw-r--r--arch/arm/mach-omap2/omap-secure.h7
-rw-r--r--arch/arm/mach-omap2/omap2-restart.c65
-rw-r--r--arch/arm/mach-omap2/omap3-restart.c36
-rw-r--r--arch/arm/mach-omap2/omap4-common.c27
-rw-r--r--arch/arm/mach-omap2/omap_device.c (renamed from arch/arm/plat-omap/omap_device.c)5
-rw-r--r--arch/arm/mach-omap2/omap_device.h (renamed from arch/arm/plat-omap/include/plat/omap_device.h)2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c63
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h (renamed from arch/arm/plat-omap/include/plat/omap_hwmod.h)1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c13
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c12
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c3
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c9
-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.c6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c10
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c14
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c13
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_common_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_common_data.h2
-rw-r--r--arch/arm/mach-omap2/omap_opp_data.h2
-rw-r--r--arch/arm/mach-omap2/omap_phy_internal.c4
-rw-r--r--arch/arm/mach-omap2/omap_twl.c1
-rw-r--r--arch/arm/mach-omap2/opp.c2
-rw-r--r--arch/arm/mach-omap2/opp3xxx_data.c1
-rw-r--r--arch/arm/mach-omap2/pm-debug.c5
-rw-r--r--arch/arm/mach-omap2/pm.c5
-rw-r--r--arch/arm/mach-omap2/pm24xx.c13
-rw-r--r--arch/arm/mach-omap2/pm34xx.c15
-rw-r--r--arch/arm/mach-omap2/pm44xx.c1
-rw-r--r--arch/arm/mach-omap2/pmu.c5
-rw-r--r--arch/arm/mach-omap2/powerdomain.c2
-rw-r--r--arch/arm/mach-omap2/powerdomain.h2
-rw-r--r--arch/arm/mach-omap2/powerdomain2xxx_3xxx.c242
-rw-r--r--arch/arm/mach-omap2/powerdomain33xx.c229
-rw-r--r--arch/arm/mach-omap2/powerdomain44xx.c285
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_data.c1
-rw-r--r--arch/arm/mach-omap2/prcm-common.h22
-rw-r--r--arch/arm/mach-omap2/prcm.c188
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.c17
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.h9
-rw-r--r--arch/arm/mach-omap2/prm-regbits-24xx.h6
-rw-r--r--arch/arm/mach-omap2/prm-regbits-34xx.h12
-rw-r--r--arch/arm/mach-omap2/prm.h77
-rw-r--r--arch/arm/mach-omap2/prm2xxx.c139
-rw-r--r--arch/arm/mach-omap2/prm2xxx.h134
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c332
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.h284
-rw-r--r--arch/arm/mach-omap2/prm33xx.c204
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c417
-rw-r--r--arch/arm/mach-omap2/prm3xxx.h162
-rw-r--r--arch/arm/mach-omap2/prm44xx.c356
-rw-r--r--arch/arm/mach-omap2/prm44xx.h2
-rw-r--r--arch/arm/mach-omap2/prm_common.c118
-rw-r--r--arch/arm/mach-omap2/prminst44xx.h2
-rw-r--r--arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h2
-rw-r--r--arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h2
-rw-r--r--arch/arm/mach-omap2/sdram-nokia.c4
-rw-r--r--arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h2
-rw-r--r--arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h2
-rw-r--r--arch/arm/mach-omap2/sdrc.c29
-rw-r--r--arch/arm/mach-omap2/sdrc.h148
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c7
-rw-r--r--arch/arm/mach-omap2/serial.c13
-rw-r--r--arch/arm/mach-omap2/serial.h1
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S7
-rw-r--r--arch/arm/mach-omap2/soc.h468
-rw-r--r--arch/arm/mach-omap2/sr_device.c4
-rw-r--r--arch/arm/mach-omap2/sram.c305
-rw-r--r--arch/arm/mach-omap2/sram.h83
-rw-r--r--arch/arm/mach-omap2/sram242x.S4
-rw-r--r--arch/arm/mach-omap2/sram243x.S4
-rw-r--r--arch/arm/mach-omap2/sram34xx.S2
-rw-r--r--arch/arm/mach-omap2/ti81xx.h9
-rw-r--r--arch/arm/mach-omap2/timer.c212
-rw-r--r--arch/arm/mach-omap2/twl-common.c3
-rw-r--r--arch/arm/mach-omap2/usb-host.c6
-rw-r--r--arch/arm/mach-omap2/usb-musb.c8
-rw-r--r--arch/arm/mach-omap2/usb-tusb6010.c3
-rw-r--r--arch/arm/mach-omap2/usb.h82
-rw-r--r--arch/arm/mach-omap2/wd_timer.c40
-rw-r--r--arch/arm/mach-omap2/wd_timer.h2
-rw-r--r--arch/arm/mach-tegra/Makefile2
-rw-r--r--arch/arm/mach-tegra/apbio.c5
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra20.c27
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra30.c28
-rw-r--r--arch/arm/mach-tegra/clock.c2
-rw-r--r--arch/arm/mach-tegra/common.c19
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c3
-rw-r--r--arch/arm/mach-tegra/cpuidle.c2
-rw-r--r--arch/arm/mach-tegra/flowctrl.c3
-rw-r--r--arch/arm/mach-tegra/fuse.c52
-rw-r--r--arch/arm/mach-tegra/fuse.h16
-rw-r--r--arch/arm/mach-tegra/headsmp.S3
-rw-r--r--arch/arm/mach-tegra/include/mach/debug-macro.S4
-rw-r--r--arch/arm/mach-tegra/include/mach/dma.h54
-rw-r--r--arch/arm/mach-tegra/include/mach/powergate.h2
-rw-r--r--arch/arm/mach-tegra/include/mach/tegra-ahb.h19
-rw-r--r--arch/arm/mach-tegra/include/mach/uncompress.h4
-rw-r--r--arch/arm/mach-tegra/io.c2
-rw-r--r--arch/arm/mach-tegra/iomap.h (renamed from arch/arm/mach-tegra/include/mach/iomap.h)2
-rw-r--r--arch/arm/mach-tegra/irammap.h (renamed from arch/arm/mach-tegra/include/mach/irammap.h)0
-rw-r--r--arch/arm/mach-tegra/irq.c3
-rw-r--r--arch/arm/mach-tegra/pcie.c2
-rw-r--r--arch/arm/mach-tegra/platsmp.c3
-rw-r--r--arch/arm/mach-tegra/pmc.c2
-rw-r--r--arch/arm/mach-tegra/powergate.c2
-rw-r--r--arch/arm/mach-tegra/reset.c5
-rw-r--r--arch/arm/mach-tegra/sleep-t20.S2
-rw-r--r--arch/arm/mach-tegra/sleep-t30.S2
-rw-r--r--arch/arm/mach-tegra/sleep.S2
-rw-r--r--arch/arm/mach-tegra/sleep.h2
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks.c3
-rw-r--r--arch/arm/mach-tegra/tegra20_clocks_data.c13
-rw-r--r--arch/arm/mach-tegra/tegra20_speedo.c109
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.c2
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks.c109
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks.h1
-rw-r--r--arch/arm/mach-tegra/tegra30_clocks_data.c51
-rw-r--r--arch/arm/mach-tegra/tegra30_speedo.c292
-rw-r--r--arch/arm/mach-tegra/timer.c2
-rw-r--r--arch/arm/mach-ux500/board-mop500-stuib.c22
-rw-r--r--arch/arm/mach-ux500/board-mop500.c146
-rw-r--r--arch/arm/mach-ux500/board-mop500.h8
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c107
-rw-r--r--arch/arm/mach-ux500/cpu.c3
-rw-r--r--arch/arm/mach-zynq/common.c54
-rw-r--r--arch/arm/mach-zynq/common.h4
-rw-r--r--arch/arm/mach-zynq/include/mach/clkdev.h32
-rw-r--r--arch/arm/mach-zynq/include/mach/zynq_soc.h45
-rw-r--r--arch/arm/mach-zynq/timer.c297
-rw-r--r--arch/arm/plat-mxc/Kconfig89
-rw-r--r--arch/arm/plat-mxc/Makefile24
-rw-r--r--arch/arm/plat-mxc/include/mach/debug-macro.S51
-rw-r--r--arch/arm/plat-mxc/include/mach/ipu.h177
-rw-r--r--arch/arm/plat-mxc/include/mach/irqs.h21
-rw-r--r--arch/arm/plat-mxc/include/mach/timex.h22
-rw-r--r--arch/arm/plat-mxc/include/mach/uncompress.h132
-rw-r--r--arch/arm/plat-omap/Makefile4
-rw-r--r--arch/arm/plat-omap/clock.c544
-rw-r--r--arch/arm/plat-omap/common.c48
-rw-r--r--arch/arm/plat-omap/counter_32k.c3
-rw-r--r--arch/arm/plat-omap/debug-devices.c3
-rw-r--r--arch/arm/plat-omap/debug-leds.c23
-rw-r--r--arch/arm/plat-omap/dma.c132
-rw-r--r--arch/arm/plat-omap/dmtimer.c113
-rw-r--r--arch/arm/plat-omap/fb.c62
-rw-r--r--arch/arm/plat-omap/i2c.c155
-rw-r--r--arch/arm/plat-omap/include/plat-omap/dma-omap.h (renamed from arch/arm/plat-omap/include/plat/dma.h)201
-rw-r--r--arch/arm/plat-omap/include/plat/clkdev_omap.h51
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h309
-rw-r--r--arch/arm/plat-omap/include/plat/common.h42
-rw-r--r--arch/arm/plat-omap/include/plat/counter-32k.h1
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h468
-rw-r--r--arch/arm/plat-omap/include/plat/debug-devices.h (renamed from arch/arm/mach-omap2/debug-devices.h)7
-rw-r--r--arch/arm/plat-omap/include/plat/dma-44xx.h147
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h3
-rw-r--r--arch/arm/plat-omap/include/plat/fpga.h193
-rw-r--r--arch/arm/plat-omap/include/plat/i2c.h30
-rw-r--r--arch/arm/plat-omap/include/plat/led.h24
-rw-r--r--arch/arm/plat-omap/include/plat/menelaus.h49
-rw-r--r--arch/arm/plat-omap/include/plat/mmc.h188
-rw-r--r--arch/arm/plat-omap/include/plat/multi.h120
-rw-r--r--arch/arm/plat-omap/include/plat/omap-secure.h14
-rw-r--r--arch/arm/plat-omap/include/plat/prcm.h37
-rw-r--r--arch/arm/plat-omap/include/plat/sdrc.h164
-rw-r--r--arch/arm/plat-omap/include/plat/sram.h97
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h204
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h179
-rw-r--r--arch/arm/plat-omap/include/plat/vrfb.h66
-rw-r--r--arch/arm/plat-omap/sram.c366
-rw-r--r--arch/arm/plat-omap/sram.h6
-rw-r--r--arch/arm/plat-samsung/devs.c1
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/mfc.h11
-rw-r--r--arch/arm/plat-samsung/s5p-dev-mfc.c34
679 files changed, 18110 insertions, 10652 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3cf5742a23ca..f88fce5e9772 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -433,19 +433,6 @@ config ARCH_FOOTBRIDGE
433 Support for systems based on the DC21285 companion chip 433 Support for systems based on the DC21285 companion chip
434 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. 434 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
435 435
436config ARCH_MXC
437 bool "Freescale MXC/iMX-based"
438 select ARCH_REQUIRE_GPIOLIB
439 select CLKDEV_LOOKUP
440 select CLKSRC_MMIO
441 select GENERIC_CLOCKEVENTS
442 select GENERIC_IRQ_CHIP
443 select MULTI_IRQ_HANDLER
444 select SPARSE_IRQ
445 select USE_OF
446 help
447 Support for Freescale MXC/iMX-based family of processors
448
449config ARCH_MXS 436config ARCH_MXS
450 bool "Freescale MXS-based" 437 bool "Freescale MXS-based"
451 select ARCH_REQUIRE_GPIOLIB 438 select ARCH_REQUIRE_GPIOLIB
@@ -928,6 +915,7 @@ config ARCH_DAVINCI
928 select GENERIC_IRQ_CHIP 915 select GENERIC_IRQ_CHIP
929 select HAVE_IDE 916 select HAVE_IDE
930 select NEED_MACH_GPIO_H 917 select NEED_MACH_GPIO_H
918 select USE_OF
931 select ZONE_DMA 919 select ZONE_DMA
932 help 920 help
933 Support for TI's DaVinci platform. 921 Support for TI's DaVinci platform.
@@ -941,7 +929,6 @@ config ARCH_OMAP
941 select CLKSRC_MMIO 929 select CLKSRC_MMIO
942 select GENERIC_CLOCKEVENTS 930 select GENERIC_CLOCKEVENTS
943 select HAVE_CLK 931 select HAVE_CLK
944 select NEED_MACH_GPIO_H
945 help 932 help
946 Support for TI's OMAP platform (OMAP1/2/3/4). 933 Support for TI's OMAP platform (OMAP1/2/3/4).
947 934
@@ -963,7 +950,7 @@ config ARCH_ZYNQ
963 bool "Xilinx Zynq ARM Cortex A9 Platform" 950 bool "Xilinx Zynq ARM Cortex A9 Platform"
964 select ARM_AMBA 951 select ARM_AMBA
965 select ARM_GIC 952 select ARM_GIC
966 select CLKDEV_LOOKUP 953 select COMMON_CLK
967 select CPU_V7 954 select CPU_V7
968 select GENERIC_CLOCKEVENTS 955 select GENERIC_CLOCKEVENTS
969 select ICST 956 select ICST
@@ -1062,7 +1049,7 @@ source "arch/arm/mach-msm/Kconfig"
1062 1049
1063source "arch/arm/mach-mv78xx0/Kconfig" 1050source "arch/arm/mach-mv78xx0/Kconfig"
1064 1051
1065source "arch/arm/plat-mxc/Kconfig" 1052source "arch/arm/mach-imx/Kconfig"
1066 1053
1067source "arch/arm/mach-mxs/Kconfig" 1054source "arch/arm/mach-mxs/Kconfig"
1068 1055
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index b0f3857b3a4c..00e9a53888ba 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -132,6 +132,23 @@ choice
132 their output to UART1 serial port on DaVinci TNETV107X 132 their output to UART1 serial port on DaVinci TNETV107X
133 devices. 133 devices.
134 134
135 config DEBUG_ZYNQ_UART0
136 bool "Kernel low-level debugging on Xilinx Zynq using UART0"
137 depends on ARCH_ZYNQ
138 help
139 Say Y here if you want the debug print routines to direct
140 their output to UART0 on the Zynq platform.
141
142 config DEBUG_ZYNQ_UART1
143 bool "Kernel low-level debugging on Xilinx Zynq using UART1"
144 depends on ARCH_ZYNQ
145 help
146 Say Y here if you want the debug print routines to direct
147 their output to UART1 on the Zynq platform.
148
149 If you have a ZC702 board and want early boot messages to
150 appear on the USB serial adaptor, select this option.
151
135 config DEBUG_DC21285_PORT 152 config DEBUG_DC21285_PORT
136 bool "Kernel low-level debugging messages via footbridge serial port" 153 bool "Kernel low-level debugging messages via footbridge serial port"
137 depends on FOOTBRIDGE 154 depends on FOOTBRIDGE
@@ -209,20 +226,12 @@ choice
209 Say Y here if you want kernel low-level debugging support 226 Say Y here if you want kernel low-level debugging support
210 on i.MX50 or i.MX53. 227 on i.MX50 or i.MX53.
211 228
212 config DEBUG_IMX6Q_UART2 229 config DEBUG_IMX6Q_UART
213 bool "i.MX6Q Debug UART2" 230 bool "i.MX6Q Debug UART"
214 depends on SOC_IMX6Q 231 depends on SOC_IMX6Q
215 help 232 help
216 Say Y here if you want kernel low-level debugging support 233 Say Y here if you want kernel low-level debugging support
217 on i.MX6Q UART2. This is correct for e.g. the SabreLite 234 on i.MX6Q.
218 board.
219
220 config DEBUG_IMX6Q_UART4
221 bool "i.MX6Q Debug UART4"
222 depends on SOC_IMX6Q
223 help
224 Say Y here if you want kernel low-level debugging support
225 on i.MX6Q UART4.
226 235
227 config DEBUG_MMP_UART2 236 config DEBUG_MMP_UART2
228 bool "Kernel low-level debugging message via MMP UART2" 237 bool "Kernel low-level debugging message via MMP UART2"
@@ -409,9 +418,25 @@ choice
409 418
410endchoice 419endchoice
411 420
421config DEBUG_IMX6Q_UART_PORT
422 int "i.MX6Q Debug UART Port (1-5)" if DEBUG_IMX6Q_UART
423 range 1 5
424 default 1
425 depends on SOC_IMX6Q
426 help
427 Choose UART port on which kernel low-level debug messages
428 should be output.
429
412config DEBUG_LL_INCLUDE 430config DEBUG_LL_INCLUDE
413 string 431 string
414 default "debug/icedcc.S" if DEBUG_ICEDCC 432 default "debug/icedcc.S" if DEBUG_ICEDCC
433 default "debug/imx.S" if DEBUG_IMX1_UART || \
434 DEBUG_IMX25_UART || \
435 DEBUG_IMX21_IMX27_UART || \
436 DEBUG_IMX31_IMX35_UART || \
437 DEBUG_IMX51_UART || \
438 DEBUG_IMX50_IMX53_UART ||\
439 DEBUG_IMX6Q_UART
415 default "debug/highbank.S" if DEBUG_HIGHBANK_UART 440 default "debug/highbank.S" if DEBUG_HIGHBANK_UART
416 default "debug/mvebu.S" if DEBUG_MVEBU_UART 441 default "debug/mvebu.S" if DEBUG_MVEBU_UART
417 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART 442 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 5f914fca911b..97252d86a701 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -196,10 +196,8 @@ machine-$(CONFIG_ARCH_ZYNQ) += zynq
196 196
197# Platform directory name. This list is sorted alphanumerically 197# Platform directory name. This list is sorted alphanumerically
198# by CONFIG_* macro name. 198# by CONFIG_* macro name.
199plat-$(CONFIG_ARCH_MXC) += mxc
200plat-$(CONFIG_ARCH_OMAP) += omap 199plat-$(CONFIG_ARCH_OMAP) += omap
201plat-$(CONFIG_ARCH_S3C64XX) += samsung 200plat-$(CONFIG_ARCH_S3C64XX) += samsung
202plat-$(CONFIG_ARCH_ZYNQ) += versatile
203plat-$(CONFIG_PLAT_IOP) += iop 201plat-$(CONFIG_PLAT_IOP) += iop
204plat-$(CONFIG_PLAT_NOMADIK) += nomadik 202plat-$(CONFIG_PLAT_NOMADIK) += nomadik
205plat-$(CONFIG_PLAT_ORION) += orion 203plat-$(CONFIG_PLAT_ORION) += orion
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 94561b500429..d9cf7340572f 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -17,13 +17,17 @@ dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb \
17 usb_a9263.dtb \ 17 usb_a9263.dtb \
18 usb_a9g20.dtb 18 usb_a9g20.dtb
19dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb 19dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
20dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \
21 da850-evm.dtb
20dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \ 22dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \
21 dove-cubox.dtb \ 23 dove-cubox.dtb \
22 dove-dove-db.dtb 24 dove-dove-db.dtb
23dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \ 25dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
24 exynos4210-smdkv310.dtb \ 26 exynos4210-smdkv310.dtb \
25 exynos4210-trats.dtb \ 27 exynos4210-trats.dtb \
26 exynos5250-smdk5250.dtb 28 exynos4412-smdk4412.dtb \
29 exynos5250-smdk5250.dtb \
30 exynos5250-snow.dtb
27dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb 31dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb
28dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ 32dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
29 integratorcp.dtb 33 integratorcp.dtb
@@ -60,27 +64,33 @@ dtb-$(CONFIG_ARCH_MXC) += imx51-babbage.dtb \
60 imx53-qsb.dtb \ 64 imx53-qsb.dtb \
61 imx53-smd.dtb \ 65 imx53-smd.dtb \
62 imx6q-arm2.dtb \ 66 imx6q-arm2.dtb \
67 imx6q-sabreauto.dtb \
63 imx6q-sabrelite.dtb \ 68 imx6q-sabrelite.dtb \
64 imx6q-sabresd.dtb 69 imx6q-sabresd.dtb
65dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \ 70dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
66 imx23-olinuxino.dtb \ 71 imx23-olinuxino.dtb \
67 imx23-stmp378x_devb.dtb \ 72 imx23-stmp378x_devb.dtb \
73 imx28-apf28.dtb \
74 imx28-apf28dev.dtb \
68 imx28-apx4devkit.dtb \ 75 imx28-apx4devkit.dtb \
69 imx28-cfa10036.dtb \ 76 imx28-cfa10036.dtb \
70 imx28-cfa10049.dtb \ 77 imx28-cfa10049.dtb \
71 imx28-evk.dtb \ 78 imx28-evk.dtb \
72 imx28-m28evk.dtb \ 79 imx28-m28evk.dtb \
80 imx28-sps1.dtb \
73 imx28-tx28.dtb 81 imx28-tx28.dtb
74dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ 82dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
83 omap3-beagle.dtb \
75 omap3-beagle-xm.dtb \ 84 omap3-beagle-xm.dtb \
76 omap3-evm.dtb \ 85 omap3-evm.dtb \
77 omap3-tobi.dtb \ 86 omap3-tobi.dtb \
78 omap4-panda.dtb \ 87 omap4-panda.dtb \
79 omap4-pandaES.dtb \ 88 omap4-panda-es.dtb \
80 omap4-var_som.dtb \ 89 omap4-var-som.dtb \
81 omap4-sdp.dtb \ 90 omap4-sdp.dtb \
82 omap5-evm.dtb \ 91 omap5-evm.dtb \
83 am335x-evm.dtb \ 92 am335x-evm.dtb \
93 am335x-evmsk.dtb \
84 am335x-bone.dtb 94 am335x-bone.dtb
85dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb 95dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb
86dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb 96dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
@@ -113,5 +123,6 @@ dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
113dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \ 123dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
114 wm8505-ref.dtb \ 124 wm8505-ref.dtb \
115 wm8650-mid.dtb 125 wm8650-mid.dtb
126dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
116 127
117endif 128endif
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index c634f87e230e..2c338889df1b 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -13,11 +13,31 @@
13 model = "TI AM335x BeagleBone"; 13 model = "TI AM335x BeagleBone";
14 compatible = "ti,am335x-bone", "ti,am33xx"; 14 compatible = "ti,am335x-bone", "ti,am33xx";
15 15
16 cpus {
17 cpu@0 {
18 cpu0-supply = <&dcdc2_reg>;
19 };
20 };
21
16 memory { 22 memory {
17 device_type = "memory"; 23 device_type = "memory";
18 reg = <0x80000000 0x10000000>; /* 256 MB */ 24 reg = <0x80000000 0x10000000>; /* 256 MB */
19 }; 25 };
20 26
27 am33xx_pinmux: pinmux@44e10800 {
28 pinctrl-names = "default";
29 pinctrl-0 = <&user_leds_s0>;
30
31 user_leds_s0: user_leds_s0 {
32 pinctrl-single,pins = <
33 0x54 0x7 /* gpmc_a5.gpio1_21, OUTPUT | MODE7 */
34 0x58 0x17 /* gpmc_a6.gpio1_22, OUTPUT_PULLUP | MODE7 */
35 0x5c 0x7 /* gpmc_a7.gpio1_23, OUTPUT | MODE7 */
36 0x60 0x17 /* gpmc_a8.gpio1_24, OUTPUT_PULLUP | MODE7 */
37 >;
38 };
39 };
40
21 ocp { 41 ocp {
22 uart1: serial@44e09000 { 42 uart1: serial@44e09000 {
23 status = "okay"; 43 status = "okay";
@@ -33,6 +53,36 @@
33 53
34 }; 54 };
35 }; 55 };
56
57 leds {
58 compatible = "gpio-leds";
59
60 led@2 {
61 label = "beaglebone:green:heartbeat";
62 gpios = <&gpio2 21 0>;
63 linux,default-trigger = "heartbeat";
64 default-state = "off";
65 };
66
67 led@3 {
68 label = "beaglebone:green:mmc0";
69 gpios = <&gpio2 22 0>;
70 linux,default-trigger = "mmc0";
71 default-state = "off";
72 };
73
74 led@4 {
75 label = "beaglebone:green:usr2";
76 gpios = <&gpio2 23 0>;
77 default-state = "off";
78 };
79
80 led@5 {
81 label = "beaglebone:green:usr3";
82 gpios = <&gpio2 24 0>;
83 default-state = "off";
84 };
85 };
36}; 86};
37 87
38/include/ "tps65217.dtsi" 88/include/ "tps65217.dtsi"
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 185d6325a458..9f65f17ebdf8 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -13,11 +13,39 @@
13 model = "TI AM335x EVM"; 13 model = "TI AM335x EVM";
14 compatible = "ti,am335x-evm", "ti,am33xx"; 14 compatible = "ti,am335x-evm", "ti,am33xx";
15 15
16 cpus {
17 cpu@0 {
18 cpu0-supply = <&vdd1_reg>;
19 };
20 };
21
16 memory { 22 memory {
17 device_type = "memory"; 23 device_type = "memory";
18 reg = <0x80000000 0x10000000>; /* 256 MB */ 24 reg = <0x80000000 0x10000000>; /* 256 MB */
19 }; 25 };
20 26
27 am33xx_pinmux: pinmux@44e10800 {
28 pinctrl-names = "default";
29 pinctrl-0 = <&matrix_keypad_s0 &volume_keys_s0>;
30
31 matrix_keypad_s0: matrix_keypad_s0 {
32 pinctrl-single,pins = <
33 0x54 0x7 /* gpmc_a5.gpio1_21, OUTPUT | MODE7 */
34 0x58 0x7 /* gpmc_a6.gpio1_22, OUTPUT | MODE7 */
35 0x64 0x27 /* gpmc_a9.gpio1_25, INPUT | MODE7 */
36 0x68 0x27 /* gpmc_a10.gpio1_26, INPUT | MODE7 */
37 0x6c 0x27 /* gpmc_a11.gpio1_27, INPUT | MODE7 */
38 >;
39 };
40
41 volume_keys_s0: volume_keys_s0 {
42 pinctrl-single,pins = <
43 0x150 0x27 /* spi0_sclk.gpio0_2, INPUT | MODE7 */
44 0x154 0x27 /* spi0_d0.gpio0_3, INPUT | MODE7 */
45 >;
46 };
47 };
48
21 ocp { 49 ocp {
22 uart1: serial@44e09000 { 50 uart1: serial@44e09000 {
23 status = "okay"; 51 status = "okay";
@@ -31,6 +59,49 @@
31 reg = <0x2d>; 59 reg = <0x2d>;
32 }; 60 };
33 }; 61 };
62
63 i2c2: i2c@4802a000 {
64 status = "okay";
65 clock-frequency = <100000>;
66
67 lis331dlh: lis331dlh@18 {
68 compatible = "st,lis331dlh", "st,lis3lv02d";
69 reg = <0x18>;
70 Vdd-supply = <&lis3_reg>;
71 Vdd_IO-supply = <&lis3_reg>;
72
73 st,click-single-x;
74 st,click-single-y;
75 st,click-single-z;
76 st,click-thresh-x = <10>;
77 st,click-thresh-y = <10>;
78 st,click-thresh-z = <10>;
79 st,irq1-click;
80 st,irq2-click;
81 st,wakeup-x-lo;
82 st,wakeup-x-hi;
83 st,wakeup-y-lo;
84 st,wakeup-y-hi;
85 st,wakeup-z-lo;
86 st,wakeup-z-hi;
87 st,min-limit-x = <120>;
88 st,min-limit-y = <120>;
89 st,min-limit-z = <140>;
90 st,max-limit-x = <550>;
91 st,max-limit-y = <550>;
92 st,max-limit-z = <750>;
93 };
94
95 tsl2550: tsl2550@39 {
96 compatible = "taos,tsl2550";
97 reg = <0x39>;
98 };
99
100 tmp275: tmp275@48 {
101 compatible = "ti,tmp275";
102 reg = <0x48>;
103 };
104 };
34 }; 105 };
35 106
36 vbat: fixedregulator@0 { 107 vbat: fixedregulator@0 {
@@ -40,6 +111,53 @@
40 regulator-max-microvolt = <5000000>; 111 regulator-max-microvolt = <5000000>;
41 regulator-boot-on; 112 regulator-boot-on;
42 }; 113 };
114
115 lis3_reg: fixedregulator@1 {
116 compatible = "regulator-fixed";
117 regulator-name = "lis3_reg";
118 regulator-boot-on;
119 };
120
121 matrix_keypad: matrix_keypad@0 {
122 compatible = "gpio-matrix-keypad";
123 debounce-delay-ms = <5>;
124 col-scan-delay-us = <2>;
125
126 row-gpios = <&gpio2 25 0 /* Bank1, pin25 */
127 &gpio2 26 0 /* Bank1, pin26 */
128 &gpio2 27 0>; /* Bank1, pin27 */
129
130 col-gpios = <&gpio2 21 0 /* Bank1, pin21 */
131 &gpio2 22 0>; /* Bank1, pin22 */
132
133 linux,keymap = <0x0000008b /* MENU */
134 0x0100009e /* BACK */
135 0x02000069 /* LEFT */
136 0x0001006a /* RIGHT */
137 0x0101001c /* ENTER */
138 0x0201006c>; /* DOWN */
139 };
140
141 gpio_keys: volume_keys@0 {
142 compatible = "gpio-keys";
143 #address-cells = <1>;
144 #size-cells = <0>;
145 autorepeat;
146
147 switch@9 {
148 label = "volume-up";
149 linux,code = <115>;
150 gpios = <&gpio1 2 1>;
151 gpio-key,wakeup;
152 };
153
154 switch@10 {
155 label = "volume-down";
156 linux,code = <114>;
157 gpios = <&gpio1 3 1>;
158 gpio-key,wakeup;
159 };
160 };
43}; 161};
44 162
45/include/ "tps65910.dtsi" 163/include/ "tps65910.dtsi"
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
new file mode 100644
index 000000000000..f5a6162a4ff2
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -0,0 +1,250 @@
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 * AM335x Starter Kit
11 * http://www.ti.com/tool/tmdssk3358
12 */
13
14/dts-v1/;
15
16/include/ "am33xx.dtsi"
17
18/ {
19 model = "TI AM335x EVM-SK";
20 compatible = "ti,am335x-evmsk", "ti,am33xx";
21
22 cpus {
23 cpu@0 {
24 cpu0-supply = <&vdd1_reg>;
25 };
26 };
27
28 memory {
29 device_type = "memory";
30 reg = <0x80000000 0x10000000>; /* 256 MB */
31 };
32
33 am33xx_pinmux: pinmux@44e10800 {
34 pinctrl-names = "default";
35 pinctrl-0 = <&user_leds_s0 &gpio_keys_s0>;
36
37 user_leds_s0: user_leds_s0 {
38 pinctrl-single,pins = <
39 0x10 0x7 /* gpmc_ad4.gpio1_4, OUTPUT | MODE7 */
40 0x14 0x7 /* gpmc_ad5.gpio1_5, OUTPUT | MODE7 */
41 0x18 0x7 /* gpmc_ad6.gpio1_6, OUTPUT | MODE7 */
42 0x1c 0x7 /* gpmc_ad7.gpio1_7, OUTPUT | MODE7 */
43 >;
44 };
45
46 gpio_keys_s0: gpio_keys_s0 {
47 pinctrl-single,pins = <
48 0x94 0x27 /* gpmc_oen_ren.gpio2_3, INPUT | MODE7 */
49 0x90 0x27 /* gpmc_advn_ale.gpio2_2, INPUT | MODE7 */
50 0x70 0x27 /* gpmc_wait0.gpio0_30, INPUT | MODE7 */
51 0x9c 0x27 /* gpmc_ben0_cle.gpio2_5, INPUT | MODE7 */
52 >;
53 };
54 };
55
56 ocp {
57 uart1: serial@44e09000 {
58 status = "okay";
59 };
60
61 i2c1: i2c@44e0b000 {
62 status = "okay";
63 clock-frequency = <400000>;
64
65 tps: tps@2d {
66 reg = <0x2d>;
67 };
68
69 lis331dlh: lis331dlh@18 {
70 compatible = "st,lis331dlh", "st,lis3lv02d";
71 reg = <0x18>;
72 Vdd-supply = <&lis3_reg>;
73 Vdd_IO-supply = <&lis3_reg>;
74
75 st,click-single-x;
76 st,click-single-y;
77 st,click-single-z;
78 st,click-thresh-x = <10>;
79 st,click-thresh-y = <10>;
80 st,click-thresh-z = <10>;
81 st,irq1-click;
82 st,irq2-click;
83 st,wakeup-x-lo;
84 st,wakeup-x-hi;
85 st,wakeup-y-lo;
86 st,wakeup-y-hi;
87 st,wakeup-z-lo;
88 st,wakeup-z-hi;
89 st,min-limit-x = <120>;
90 st,min-limit-y = <120>;
91 st,min-limit-z = <140>;
92 st,max-limit-x = <550>;
93 st,max-limit-y = <550>;
94 st,max-limit-z = <750>;
95 };
96 };
97 };
98
99 vbat: fixedregulator@0 {
100 compatible = "regulator-fixed";
101 regulator-name = "vbat";
102 regulator-min-microvolt = <5000000>;
103 regulator-max-microvolt = <5000000>;
104 regulator-boot-on;
105 };
106
107 lis3_reg: fixedregulator@1 {
108 compatible = "regulator-fixed";
109 regulator-name = "lis3_reg";
110 regulator-boot-on;
111 };
112
113 leds {
114 compatible = "gpio-leds";
115
116 led@1 {
117 label = "evmsk:green:usr0";
118 gpios = <&gpio2 4 0>;
119 default-state = "off";
120 };
121
122 led@2 {
123 label = "evmsk:green:usr1";
124 gpios = <&gpio2 5 0>;
125 default-state = "off";
126 };
127
128 led@3 {
129 label = "evmsk:green:mmc0";
130 gpios = <&gpio2 6 0>;
131 linux,default-trigger = "mmc0";
132 default-state = "off";
133 };
134
135 led@4 {
136 label = "evmsk:green:heartbeat";
137 gpios = <&gpio2 7 0>;
138 linux,default-trigger = "heartbeat";
139 default-state = "off";
140 };
141 };
142
143 gpio_buttons: gpio_buttons@0 {
144 compatible = "gpio-keys";
145 #address-cells = <1>;
146 #size-cells = <0>;
147
148 switch@1 {
149 label = "button0";
150 linux,code = <0x100>;
151 gpios = <&gpio3 3 0>;
152 };
153
154 switch@2 {
155 label = "button1";
156 linux,code = <0x101>;
157 gpios = <&gpio3 2 0>;
158 };
159
160 switch@3 {
161 label = "button2";
162 linux,code = <0x102>;
163 gpios = <&gpio1 30 0>;
164 gpio-key,wakeup;
165 };
166
167 switch@4 {
168 label = "button3";
169 linux,code = <0x103>;
170 gpios = <&gpio3 5 0>;
171 };
172 };
173};
174
175/include/ "tps65910.dtsi"
176
177&tps {
178 vcc1-supply = <&vbat>;
179 vcc2-supply = <&vbat>;
180 vcc3-supply = <&vbat>;
181 vcc4-supply = <&vbat>;
182 vcc5-supply = <&vbat>;
183 vcc6-supply = <&vbat>;
184 vcc7-supply = <&vbat>;
185 vccio-supply = <&vbat>;
186
187 regulators {
188 vrtc_reg: regulator@0 {
189 regulator-always-on;
190 };
191
192 vio_reg: regulator@1 {
193 regulator-always-on;
194 };
195
196 vdd1_reg: regulator@2 {
197 /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
198 regulator-name = "vdd_mpu";
199 regulator-min-microvolt = <912500>;
200 regulator-max-microvolt = <1312500>;
201 regulator-boot-on;
202 regulator-always-on;
203 };
204
205 vdd2_reg: regulator@3 {
206 /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
207 regulator-name = "vdd_core";
208 regulator-min-microvolt = <912500>;
209 regulator-max-microvolt = <1150000>;
210 regulator-boot-on;
211 regulator-always-on;
212 };
213
214 vdd3_reg: regulator@4 {
215 regulator-always-on;
216 };
217
218 vdig1_reg: regulator@5 {
219 regulator-always-on;
220 };
221
222 vdig2_reg: regulator@6 {
223 regulator-always-on;
224 };
225
226 vpll_reg: regulator@7 {
227 regulator-always-on;
228 };
229
230 vdac_reg: regulator@8 {
231 regulator-always-on;
232 };
233
234 vaux1_reg: regulator@9 {
235 regulator-always-on;
236 };
237
238 vaux2_reg: regulator@10 {
239 regulator-always-on;
240 };
241
242 vaux33_reg: regulator@11 {
243 regulator-always-on;
244 };
245
246 vmmc_reg: regulator@12 {
247 regulator-always-on;
248 };
249 };
250};
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index bb31bff01998..20a3f29a6bfe 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -12,6 +12,7 @@
12 12
13/ { 13/ {
14 compatible = "ti,am33xx"; 14 compatible = "ti,am33xx";
15 interrupt-parent = <&intc>;
15 16
16 aliases { 17 aliases {
17 serial0 = &uart1; 18 serial0 = &uart1;
@@ -25,6 +26,21 @@
25 cpus { 26 cpus {
26 cpu@0 { 27 cpu@0 {
27 compatible = "arm,cortex-a8"; 28 compatible = "arm,cortex-a8";
29
30 /*
31 * To consider voltage drop between PMIC and SoC,
32 * tolerance value is reduced to 2% from 4% and
33 * voltage value is increased as a precaution.
34 */
35 operating-points = <
36 /* kHz uV */
37 720000 1285000
38 600000 1225000
39 500000 1125000
40 275000 1125000
41 >;
42 voltage-tolerance = <2>; /* 2 percentage */
43 clock-latency = <300000>; /* From omap-cpufreq driver */
28 }; 44 };
29 }; 45 };
30 46
@@ -40,6 +56,15 @@
40 }; 56 };
41 }; 57 };
42 58
59 am33xx_pinmux: pinmux@44e10800 {
60 compatible = "pinctrl-single";
61 reg = <0x44e10800 0x0238>;
62 #address-cells = <1>;
63 #size-cells = <0>;
64 pinctrl-single,register-width = <32>;
65 pinctrl-single,function-mask = <0x7f>;
66 };
67
43 /* 68 /*
44 * XXX: Use a flat representation of the AM33XX interconnect. 69 * XXX: Use a flat representation of the AM33XX interconnect.
45 * The real AM33XX interconnect network is quite complex.Since 70 * The real AM33XX interconnect network is quite complex.Since
@@ -70,7 +95,6 @@
70 interrupt-controller; 95 interrupt-controller;
71 #interrupt-cells = <1>; 96 #interrupt-cells = <1>;
72 reg = <0x44e07000 0x1000>; 97 reg = <0x44e07000 0x1000>;
73 interrupt-parent = <&intc>;
74 interrupts = <96>; 98 interrupts = <96>;
75 }; 99 };
76 100
@@ -82,7 +106,6 @@
82 interrupt-controller; 106 interrupt-controller;
83 #interrupt-cells = <1>; 107 #interrupt-cells = <1>;
84 reg = <0x4804c000 0x1000>; 108 reg = <0x4804c000 0x1000>;
85 interrupt-parent = <&intc>;
86 interrupts = <98>; 109 interrupts = <98>;
87 }; 110 };
88 111
@@ -94,7 +117,6 @@
94 interrupt-controller; 117 interrupt-controller;
95 #interrupt-cells = <1>; 118 #interrupt-cells = <1>;
96 reg = <0x481ac000 0x1000>; 119 reg = <0x481ac000 0x1000>;
97 interrupt-parent = <&intc>;
98 interrupts = <32>; 120 interrupts = <32>;
99 }; 121 };
100 122
@@ -106,7 +128,6 @@
106 interrupt-controller; 128 interrupt-controller;
107 #interrupt-cells = <1>; 129 #interrupt-cells = <1>;
108 reg = <0x481ae000 0x1000>; 130 reg = <0x481ae000 0x1000>;
109 interrupt-parent = <&intc>;
110 interrupts = <62>; 131 interrupts = <62>;
111 }; 132 };
112 133
@@ -115,7 +136,6 @@
115 ti,hwmods = "uart1"; 136 ti,hwmods = "uart1";
116 clock-frequency = <48000000>; 137 clock-frequency = <48000000>;
117 reg = <0x44e09000 0x2000>; 138 reg = <0x44e09000 0x2000>;
118 interrupt-parent = <&intc>;
119 interrupts = <72>; 139 interrupts = <72>;
120 status = "disabled"; 140 status = "disabled";
121 }; 141 };
@@ -125,7 +145,6 @@
125 ti,hwmods = "uart2"; 145 ti,hwmods = "uart2";
126 clock-frequency = <48000000>; 146 clock-frequency = <48000000>;
127 reg = <0x48022000 0x2000>; 147 reg = <0x48022000 0x2000>;
128 interrupt-parent = <&intc>;
129 interrupts = <73>; 148 interrupts = <73>;
130 status = "disabled"; 149 status = "disabled";
131 }; 150 };
@@ -135,7 +154,6 @@
135 ti,hwmods = "uart3"; 154 ti,hwmods = "uart3";
136 clock-frequency = <48000000>; 155 clock-frequency = <48000000>;
137 reg = <0x48024000 0x2000>; 156 reg = <0x48024000 0x2000>;
138 interrupt-parent = <&intc>;
139 interrupts = <74>; 157 interrupts = <74>;
140 status = "disabled"; 158 status = "disabled";
141 }; 159 };
@@ -145,7 +163,6 @@
145 ti,hwmods = "uart4"; 163 ti,hwmods = "uart4";
146 clock-frequency = <48000000>; 164 clock-frequency = <48000000>;
147 reg = <0x481a6000 0x2000>; 165 reg = <0x481a6000 0x2000>;
148 interrupt-parent = <&intc>;
149 interrupts = <44>; 166 interrupts = <44>;
150 status = "disabled"; 167 status = "disabled";
151 }; 168 };
@@ -155,7 +172,6 @@
155 ti,hwmods = "uart5"; 172 ti,hwmods = "uart5";
156 clock-frequency = <48000000>; 173 clock-frequency = <48000000>;
157 reg = <0x481a8000 0x2000>; 174 reg = <0x481a8000 0x2000>;
158 interrupt-parent = <&intc>;
159 interrupts = <45>; 175 interrupts = <45>;
160 status = "disabled"; 176 status = "disabled";
161 }; 177 };
@@ -165,7 +181,6 @@
165 ti,hwmods = "uart6"; 181 ti,hwmods = "uart6";
166 clock-frequency = <48000000>; 182 clock-frequency = <48000000>;
167 reg = <0x481aa000 0x2000>; 183 reg = <0x481aa000 0x2000>;
168 interrupt-parent = <&intc>;
169 interrupts = <46>; 184 interrupts = <46>;
170 status = "disabled"; 185 status = "disabled";
171 }; 186 };
@@ -176,7 +191,6 @@
176 #size-cells = <0>; 191 #size-cells = <0>;
177 ti,hwmods = "i2c1"; 192 ti,hwmods = "i2c1";
178 reg = <0x44e0b000 0x1000>; 193 reg = <0x44e0b000 0x1000>;
179 interrupt-parent = <&intc>;
180 interrupts = <70>; 194 interrupts = <70>;
181 status = "disabled"; 195 status = "disabled";
182 }; 196 };
@@ -187,7 +201,6 @@
187 #size-cells = <0>; 201 #size-cells = <0>;
188 ti,hwmods = "i2c2"; 202 ti,hwmods = "i2c2";
189 reg = <0x4802a000 0x1000>; 203 reg = <0x4802a000 0x1000>;
190 interrupt-parent = <&intc>;
191 interrupts = <71>; 204 interrupts = <71>;
192 status = "disabled"; 205 status = "disabled";
193 }; 206 };
@@ -198,7 +211,6 @@
198 #size-cells = <0>; 211 #size-cells = <0>;
199 ti,hwmods = "i2c3"; 212 ti,hwmods = "i2c3";
200 reg = <0x4819c000 0x1000>; 213 reg = <0x4819c000 0x1000>;
201 interrupt-parent = <&intc>;
202 interrupts = <30>; 214 interrupts = <30>;
203 status = "disabled"; 215 status = "disabled";
204 }; 216 };
@@ -207,8 +219,124 @@
207 compatible = "ti,omap3-wdt"; 219 compatible = "ti,omap3-wdt";
208 ti,hwmods = "wd_timer2"; 220 ti,hwmods = "wd_timer2";
209 reg = <0x44e35000 0x1000>; 221 reg = <0x44e35000 0x1000>;
210 interrupt-parent = <&intc>;
211 interrupts = <91>; 222 interrupts = <91>;
212 }; 223 };
224
225 dcan0: d_can@481cc000 {
226 compatible = "bosch,d_can";
227 ti,hwmods = "d_can0";
228 reg = <0x481cc000 0x2000>;
229 interrupts = <52>;
230 status = "disabled";
231 };
232
233 dcan1: d_can@481d0000 {
234 compatible = "bosch,d_can";
235 ti,hwmods = "d_can1";
236 reg = <0x481d0000 0x2000>;
237 interrupts = <55>;
238 status = "disabled";
239 };
240
241 timer1: timer@44e31000 {
242 compatible = "ti,omap2-timer";
243 reg = <0x44e31000 0x400>;
244 interrupts = <67>;
245 ti,hwmods = "timer1";
246 ti,timer-alwon;
247 };
248
249 timer2: timer@48040000 {
250 compatible = "ti,omap2-timer";
251 reg = <0x48040000 0x400>;
252 interrupts = <68>;
253 ti,hwmods = "timer2";
254 };
255
256 timer3: timer@48042000 {
257 compatible = "ti,omap2-timer";
258 reg = <0x48042000 0x400>;
259 interrupts = <69>;
260 ti,hwmods = "timer3";
261 };
262
263 timer4: timer@48044000 {
264 compatible = "ti,omap2-timer";
265 reg = <0x48044000 0x400>;
266 interrupts = <92>;
267 ti,hwmods = "timer4";
268 ti,timer-pwm;
269 };
270
271 timer5: timer@48046000 {
272 compatible = "ti,omap2-timer";
273 reg = <0x48046000 0x400>;
274 interrupts = <93>;
275 ti,hwmods = "timer5";
276 ti,timer-pwm;
277 };
278
279 timer6: timer@48048000 {
280 compatible = "ti,omap2-timer";
281 reg = <0x48048000 0x400>;
282 interrupts = <94>;
283 ti,hwmods = "timer6";
284 ti,timer-pwm;
285 };
286
287 timer7: timer@4804a000 {
288 compatible = "ti,omap2-timer";
289 reg = <0x4804a000 0x400>;
290 interrupts = <95>;
291 ti,hwmods = "timer7";
292 ti,timer-pwm;
293 };
294
295 rtc@44e3e000 {
296 compatible = "ti,da830-rtc";
297 reg = <0x44e3e000 0x1000>;
298 interrupts = <75
299 76>;
300 ti,hwmods = "rtc";
301 };
302
303 spi0: spi@48030000 {
304 compatible = "ti,omap4-mcspi";
305 #address-cells = <1>;
306 #size-cells = <0>;
307 reg = <0x48030000 0x400>;
308 interrupt = <65>;
309 ti,spi-num-cs = <2>;
310 ti,hwmods = "spi0";
311 status = "disabled";
312 };
313
314 spi1: spi@481a0000 {
315 compatible = "ti,omap4-mcspi";
316 #address-cells = <1>;
317 #size-cells = <0>;
318 reg = <0x481a0000 0x400>;
319 interrupt = <125>;
320 ti,spi-num-cs = <2>;
321 ti,hwmods = "spi1";
322 status = "disabled";
323 };
324
325 usb@47400000 {
326 compatible = "ti,musb-am33xx";
327 reg = <0x47400000 0x1000 /* usbss */
328 0x47401000 0x800 /* musb instance 0 */
329 0x47401800 0x800>; /* musb instance 1 */
330 interrupts = <17 /* usbss */
331 18 /* musb instance 0 */
332 19>; /* musb instance 1 */
333 multipoint = <1>;
334 num-eps = <16>;
335 ram-bits = <12>;
336 port0-mode = <3>;
337 port1-mode = <3>;
338 power = <250>;
339 ti,hwmods = "usb_otg_hs";
340 };
213 }; 341 };
214}; 342};
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index d410581a5a85..bfb5bb6528b5 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -246,6 +246,12 @@
246 trigger-external; 246 trigger-external;
247 }; 247 };
248 }; 248 };
249
250 watchdog@fffffd40 {
251 compatible = "atmel,at91sam9260-wdt";
252 reg = <0xfffffd40 0x10>;
253 status = "disabled";
254 };
249 }; 255 };
250 256
251 nand0: nand@40000000 { 257 nand0: nand@40000000 {
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index 3e6e5c1abbf3..ff5461278c03 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -195,6 +195,12 @@
195 #size-cells = <0>; 195 #size-cells = <0>;
196 status = "disabled"; 196 status = "disabled";
197 }; 197 };
198
199 watchdog@fffffd40 {
200 compatible = "atmel,at91sam9260-wdt";
201 reg = <0xfffffd40 0x10>;
202 status = "disabled";
203 };
198 }; 204 };
199 205
200 nand0: nand@40000000 { 206 nand0: nand@40000000 {
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 3add030d61f8..a98c00a234eb 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -262,6 +262,12 @@
262 trigger-value = <0x6>; 262 trigger-value = <0x6>;
263 }; 263 };
264 }; 264 };
265
266 watchdog@fffffd40 {
267 compatible = "atmel,at91sam9260-wdt";
268 reg = <0xfffffd40 0x10>;
269 status = "disabled";
270 };
265 }; 271 };
266 272
267 nand0: nand@40000000 { 273 nand0: nand@40000000 {
diff --git a/arch/arm/boot/dts/ccu9540.dts b/arch/arm/boot/dts/ccu9540.dts
new file mode 100644
index 000000000000..04305463f00d
--- /dev/null
+++ b/arch/arm/boot/dts/ccu9540.dts
@@ -0,0 +1,72 @@
1/*
2 * Copyright 2012 ST-Ericsson AB
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/dts-v1/;
13/include/ "dbx5x0.dtsi"
14
15/ {
16 model = "ST-Ericsson CCU9540 platform with Device Tree";
17 compatible = "st-ericsson,ccu9540", "st-ericsson,u9540";
18
19 memory {
20 reg = <0x00000000 0x20000000>;
21 };
22
23 soc-u9500 {
24 uart@80120000 {
25 status = "okay";
26 };
27
28 uart@80121000 {
29 status = "okay";
30 };
31
32 uart@80007000 {
33 status = "okay";
34 };
35
36 // External Micro SD slot
37 sdi0_per1@80126000 {
38 arm,primecell-periphid = <0x10480180>;
39 max-frequency = <100000000>;
40 bus-width = <4>;
41 mmc-cap-sd-highspeed;
42 mmc-cap-mmc-highspeed;
43 vmmc-supply = <&ab8500_ldo_aux3_reg>;
44
45 cd-gpios = <&gpio7 6 0x4>; // 230
46 cd-inverted;
47
48 status = "okay";
49 };
50
51
52 // WLAN SDIO channel
53 sdi1_per2@80118000 {
54 arm,primecell-periphid = <0x10480180>;
55 max-frequency = <50000000>;
56 bus-width = <4>;
57
58 status = "okay";
59 };
60
61 // On-board eMMC
62 sdi4_per2@80114000 {
63 arm,primecell-periphid = <0x10480180>;
64 max-frequency = <100000000>;
65 bus-width = <8>;
66 mmc-cap-mmc-highspeed;
67 vmmc-supply = <&ab8500_ldo_aux2_reg>;
68
69 status = "okay";
70 };
71 };
72};
diff --git a/arch/arm/boot/dts/cros5250-common.dtsi b/arch/arm/boot/dts/cros5250-common.dtsi
new file mode 100644
index 000000000000..fddd17417433
--- /dev/null
+++ b/arch/arm/boot/dts/cros5250-common.dtsi
@@ -0,0 +1,184 @@
1/*
2 * Common device tree include for all Exynos 5250 boards based off of Daisy.
3 *
4 * Copyright (c) 2012 Google, 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/ {
12 aliases {
13 };
14
15 memory {
16 reg = <0x40000000 0x80000000>;
17 };
18
19 chosen {
20 };
21
22 i2c@12C60000 {
23 samsung,i2c-sda-delay = <100>;
24 samsung,i2c-max-bus-freq = <378000>;
25 gpios = <&gpb3 0 2 3 0>,
26 <&gpb3 1 2 3 0>;
27 };
28
29 i2c@12C70000 {
30 samsung,i2c-sda-delay = <100>;
31 samsung,i2c-max-bus-freq = <378000>;
32 gpios = <&gpb3 2 2 3 0>,
33 <&gpb3 3 2 3 0>;
34 };
35
36 i2c@12C80000 {
37 samsung,i2c-sda-delay = <100>;
38 samsung,i2c-max-bus-freq = <66000>;
39
40 /*
41 * Disabled pullups since external part has its own pullups and
42 * double-pulling gets us out of spec in some cases.
43 */
44 gpios = <&gpa0 6 3 0 0>,
45 <&gpa0 7 3 0 0>;
46
47 hdmiddc@50 {
48 compatible = "samsung,exynos5-hdmiddc";
49 reg = <0x50>;
50 };
51 };
52
53 i2c@12C90000 {
54 samsung,i2c-sda-delay = <100>;
55 samsung,i2c-max-bus-freq = <66000>;
56 gpios = <&gpa1 2 3 3 0>,
57 <&gpa1 3 3 3 0>;
58 };
59
60 i2c@12CA0000 {
61 status = "disabled";
62 };
63
64 i2c@12CB0000 {
65 samsung,i2c-sda-delay = <100>;
66 samsung,i2c-max-bus-freq = <66000>;
67 gpios = <&gpa2 2 3 3 0>,
68 <&gpa2 3 3 3 0>;
69 };
70
71 i2c@12CC0000 {
72 status = "disabled";
73 };
74
75 i2c@12CD0000 {
76 samsung,i2c-sda-delay = <100>;
77 samsung,i2c-max-bus-freq = <66000>;
78 gpios = <&gpb2 2 3 3 0>,
79 <&gpb2 3 3 3 0>;
80 };
81
82 i2c@12CE0000 {
83 samsung,i2c-sda-delay = <100>;
84 samsung,i2c-max-bus-freq = <378000>;
85
86 hdmiphy@38 {
87 compatible = "samsung,exynos5-hdmiphy";
88 reg = <0x38>;
89 };
90 };
91
92 dwmmc0@12200000 {
93 num-slots = <1>;
94 supports-highspeed;
95 broken-cd;
96 fifo-depth = <0x80>;
97 card-detect-delay = <200>;
98 samsung,dw-mshc-ciu-div = <3>;
99 samsung,dw-mshc-sdr-timing = <2 3 3>;
100 samsung,dw-mshc-ddr-timing = <1 2 3>;
101
102 slot@0 {
103 reg = <0>;
104 bus-width = <8>;
105 gpios = <&gpc0 0 2 0 3>, <&gpc0 1 2 0 3>,
106 <&gpc1 0 2 3 3>, <&gpc1 1 2 3 3>,
107 <&gpc1 2 2 3 3>, <&gpc1 3 2 3 3>,
108 <&gpc0 3 2 3 3>, <&gpc0 4 2 3 3>,
109 <&gpc0 5 2 3 3>, <&gpc0 6 2 3 3>;
110 };
111 };
112
113 dwmmc1@12210000 {
114 status = "disabled";
115 };
116
117 dwmmc2@12220000 {
118 num-slots = <1>;
119 supports-highspeed;
120 fifo-depth = <0x80>;
121 card-detect-delay = <200>;
122 samsung,dw-mshc-ciu-div = <3>;
123 samsung,dw-mshc-sdr-timing = <2 3 3>;
124 samsung,dw-mshc-ddr-timing = <1 2 3>;
125
126 slot@0 {
127 reg = <0>;
128 bus-width = <4>;
129 samsung,cd-pinmux-gpio = <&gpc3 2 2 3 3>;
130 wp-gpios = <&gpc2 1 0 0 3>;
131 gpios = <&gpc3 0 2 0 3>, <&gpc3 1 2 0 3>,
132 <&gpc3 3 2 3 3>, <&gpc3 4 2 3 3>,
133 <&gpc3 5 2 3 3>, <&gpc3 6 2 3 3>;
134 };
135 };
136
137 dwmmc3@12230000 {
138 num-slots = <1>;
139 supports-highspeed;
140 broken-cd;
141 fifo-depth = <0x80>;
142 card-detect-delay = <200>;
143 samsung,dw-mshc-ciu-div = <3>;
144 samsung,dw-mshc-sdr-timing = <2 3 3>;
145 samsung,dw-mshc-ddr-timing = <1 2 3>;
146
147 slot@0 {
148 reg = <0>;
149 bus-width = <4>;
150 /* See board-specific dts files for GPIOs */
151 };
152 };
153
154 spi_0: spi@12d20000 {
155 status = "disabled";
156 };
157
158 spi_1: spi@12d30000 {
159 gpios = <&gpa2 4 2 3 0>,
160 <&gpa2 6 2 3 0>,
161 <&gpa2 7 2 3 0>;
162 samsung,spi-src-clk = <0>;
163 num-cs = <1>;
164 };
165
166 spi_2: spi@12d40000 {
167 status = "disabled";
168 };
169
170 hdmi {
171 hpd-gpio = <&gpx3 7 0xf 1 3>;
172 };
173
174 gpio-keys {
175 compatible = "gpio-keys";
176
177 power {
178 label = "Power";
179 gpios = <&gpx1 3 0 0x10000 0>;
180 linux,code = <116>; /* KEY_POWER */
181 gpio-key,wakeup;
182 };
183 };
184};
diff --git a/arch/arm/boot/dts/da850-enbw-cmc.dts b/arch/arm/boot/dts/da850-enbw-cmc.dts
new file mode 100644
index 000000000000..422fdb3fcfc1
--- /dev/null
+++ b/arch/arm/boot/dts/da850-enbw-cmc.dts
@@ -0,0 +1,30 @@
1/*
2 * Device Tree for AM1808 EnBW CMC board
3 *
4 * Copyright 2012 DENX Software Engineering GmbH
5 * Heiko Schocher <hs@denx.de>
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/dts-v1/;
13/include/ "da850.dtsi"
14
15/ {
16 compatible = "enbw,cmc", "ti,da850";
17 model = "EnBW CMC";
18
19 soc {
20 serial0: serial@1c42000 {
21 status = "okay";
22 };
23 serial1: serial@1d0c000 {
24 status = "okay";
25 };
26 serial2: serial@1d0d000 {
27 status = "okay";
28 };
29 };
30};
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
new file mode 100644
index 000000000000..37dc5a3243b8
--- /dev/null
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -0,0 +1,28 @@
1/*
2 * Device Tree for DA850 EVM board
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, version 2.
9 */
10/dts-v1/;
11/include/ "da850.dtsi"
12
13/ {
14 compatible = "ti,da850-evm", "ti,da850";
15 model = "DA850/AM1808/OMAP-L138 EVM";
16
17 soc {
18 serial0: serial@1c42000 {
19 status = "okay";
20 };
21 serial1: serial@1d0c000 {
22 status = "okay";
23 };
24 serial2: serial@1d0d000 {
25 status = "okay";
26 };
27 };
28};
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
new file mode 100644
index 000000000000..640ab75c20db
--- /dev/null
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -0,0 +1,60 @@
1/*
2 * Copyright 2012 DENX Software Engineering GmbH
3 * Heiko Schocher <hs@denx.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10/include/ "skeleton.dtsi"
11
12/ {
13 arm {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 ranges;
17 intc: interrupt-controller {
18 compatible = "ti,cp-intc";
19 interrupt-controller;
20 #interrupt-cells = <1>;
21 ti,intc-size = <100>;
22 reg = <0xfffee000 0x2000>;
23 };
24 };
25 soc {
26 compatible = "simple-bus";
27 model = "da850";
28 #address-cells = <1>;
29 #size-cells = <1>;
30 ranges = <0x0 0x01c00000 0x400000>;
31
32 serial0: serial@1c42000 {
33 compatible = "ns16550a";
34 reg = <0x42000 0x100>;
35 clock-frequency = <150000000>;
36 reg-shift = <2>;
37 interrupts = <25>;
38 interrupt-parent = <&intc>;
39 status = "disabled";
40 };
41 serial1: serial@1d0c000 {
42 compatible = "ns16550a";
43 reg = <0x10c000 0x100>;
44 clock-frequency = <150000000>;
45 reg-shift = <2>;
46 interrupts = <53>;
47 interrupt-parent = <&intc>;
48 status = "disabled";
49 };
50 serial2: serial@1d0d000 {
51 compatible = "ns16550a";
52 reg = <0x10d000 0x100>;
53 clock-frequency = <150000000>;
54 reg-shift = <2>;
55 interrupts = <61>;
56 interrupt-parent = <&intc>;
57 status = "disabled";
58 };
59 };
60};
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi
index 4b0e0ca08f40..7ce45fc461fb 100644
--- a/arch/arm/boot/dts/dbx5x0.dtsi
+++ b/arch/arm/boot/dts/dbx5x0.dtsi
@@ -209,123 +209,103 @@
209 // DB8500_REGULATOR_VAPE 209 // DB8500_REGULATOR_VAPE
210 db8500_vape_reg: db8500_vape { 210 db8500_vape_reg: db8500_vape {
211 regulator-compatible = "db8500_vape"; 211 regulator-compatible = "db8500_vape";
212 regulator-name = "db8500-vape";
213 regulator-always-on; 212 regulator-always-on;
214 }; 213 };
215 214
216 // DB8500_REGULATOR_VARM 215 // DB8500_REGULATOR_VARM
217 db8500_varm_reg: db8500_varm { 216 db8500_varm_reg: db8500_varm {
218 regulator-compatible = "db8500_varm"; 217 regulator-compatible = "db8500_varm";
219 regulator-name = "db8500-varm";
220 }; 218 };
221 219
222 // DB8500_REGULATOR_VMODEM 220 // DB8500_REGULATOR_VMODEM
223 db8500_vmodem_reg: db8500_vmodem { 221 db8500_vmodem_reg: db8500_vmodem {
224 regulator-compatible = "db8500_vmodem"; 222 regulator-compatible = "db8500_vmodem";
225 regulator-name = "db8500-vmodem";
226 }; 223 };
227 224
228 // DB8500_REGULATOR_VPLL 225 // DB8500_REGULATOR_VPLL
229 db8500_vpll_reg: db8500_vpll { 226 db8500_vpll_reg: db8500_vpll {
230 regulator-compatible = "db8500_vpll"; 227 regulator-compatible = "db8500_vpll";
231 regulator-name = "db8500-vpll";
232 }; 228 };
233 229
234 // DB8500_REGULATOR_VSMPS1 230 // DB8500_REGULATOR_VSMPS1
235 db8500_vsmps1_reg: db8500_vsmps1 { 231 db8500_vsmps1_reg: db8500_vsmps1 {
236 regulator-compatible = "db8500_vsmps1"; 232 regulator-compatible = "db8500_vsmps1";
237 regulator-name = "db8500-vsmps1";
238 }; 233 };
239 234
240 // DB8500_REGULATOR_VSMPS2 235 // DB8500_REGULATOR_VSMPS2
241 db8500_vsmps2_reg: db8500_vsmps2 { 236 db8500_vsmps2_reg: db8500_vsmps2 {
242 regulator-compatible = "db8500_vsmps2"; 237 regulator-compatible = "db8500_vsmps2";
243 regulator-name = "db8500-vsmps2";
244 }; 238 };
245 239
246 // DB8500_REGULATOR_VSMPS3 240 // DB8500_REGULATOR_VSMPS3
247 db8500_vsmps3_reg: db8500_vsmps3 { 241 db8500_vsmps3_reg: db8500_vsmps3 {
248 regulator-compatible = "db8500_vsmps3"; 242 regulator-compatible = "db8500_vsmps3";
249 regulator-name = "db8500-vsmps3";
250 }; 243 };
251 244
252 // DB8500_REGULATOR_VRF1 245 // DB8500_REGULATOR_VRF1
253 db8500_vrf1_reg: db8500_vrf1 { 246 db8500_vrf1_reg: db8500_vrf1 {
254 regulator-compatible = "db8500_vrf1"; 247 regulator-compatible = "db8500_vrf1";
255 regulator-name = "db8500-vrf1";
256 }; 248 };
257 249
258 // DB8500_REGULATOR_SWITCH_SVAMMDSP 250 // DB8500_REGULATOR_SWITCH_SVAMMDSP
259 db8500_sva_mmdsp_reg: db8500_sva_mmdsp { 251 db8500_sva_mmdsp_reg: db8500_sva_mmdsp {
260 regulator-compatible = "db8500_sva_mmdsp"; 252 regulator-compatible = "db8500_sva_mmdsp";
261 regulator-name = "db8500-sva-mmdsp";
262 }; 253 };
263 254
264 // DB8500_REGULATOR_SWITCH_SVAMMDSPRET 255 // DB8500_REGULATOR_SWITCH_SVAMMDSPRET
265 db8500_sva_mmdsp_ret_reg: db8500_sva_mmdsp_ret { 256 db8500_sva_mmdsp_ret_reg: db8500_sva_mmdsp_ret {
266 regulator-compatible = "db8500_sva_mmdsp_ret"; 257 regulator-compatible = "db8500_sva_mmdsp_ret";
267 regulator-name = "db8500-sva-mmdsp-ret";
268 }; 258 };
269 259
270 // DB8500_REGULATOR_SWITCH_SVAPIPE 260 // DB8500_REGULATOR_SWITCH_SVAPIPE
271 db8500_sva_pipe_reg: db8500_sva_pipe { 261 db8500_sva_pipe_reg: db8500_sva_pipe {
272 regulator-compatible = "db8500_sva_pipe"; 262 regulator-compatible = "db8500_sva_pipe";
273 regulator-name = "db8500_sva_pipe";
274 }; 263 };
275 264
276 // DB8500_REGULATOR_SWITCH_SIAMMDSP 265 // DB8500_REGULATOR_SWITCH_SIAMMDSP
277 db8500_sia_mmdsp_reg: db8500_sia_mmdsp { 266 db8500_sia_mmdsp_reg: db8500_sia_mmdsp {
278 regulator-compatible = "db8500_sia_mmdsp"; 267 regulator-compatible = "db8500_sia_mmdsp";
279 regulator-name = "db8500_sia_mmdsp";
280 }; 268 };
281 269
282 // DB8500_REGULATOR_SWITCH_SIAMMDSPRET 270 // DB8500_REGULATOR_SWITCH_SIAMMDSPRET
283 db8500_sia_mmdsp_ret_reg: db8500_sia_mmdsp_ret { 271 db8500_sia_mmdsp_ret_reg: db8500_sia_mmdsp_ret {
284 regulator-name = "db8500-sia-mmdsp-ret";
285 }; 272 };
286 273
287 // DB8500_REGULATOR_SWITCH_SIAPIPE 274 // DB8500_REGULATOR_SWITCH_SIAPIPE
288 db8500_sia_pipe_reg: db8500_sia_pipe { 275 db8500_sia_pipe_reg: db8500_sia_pipe {
289 regulator-compatible = "db8500_sia_pipe"; 276 regulator-compatible = "db8500_sia_pipe";
290 regulator-name = "db8500-sia-pipe";
291 }; 277 };
292 278
293 // DB8500_REGULATOR_SWITCH_SGA 279 // DB8500_REGULATOR_SWITCH_SGA
294 db8500_sga_reg: db8500_sga { 280 db8500_sga_reg: db8500_sga {
295 regulator-compatible = "db8500_sga"; 281 regulator-compatible = "db8500_sga";
296 regulator-name = "db8500-sga";
297 vin-supply = <&db8500_vape_reg>; 282 vin-supply = <&db8500_vape_reg>;
298 }; 283 };
299 284
300 // DB8500_REGULATOR_SWITCH_B2R2_MCDE 285 // DB8500_REGULATOR_SWITCH_B2R2_MCDE
301 db8500_b2r2_mcde_reg: db8500_b2r2_mcde { 286 db8500_b2r2_mcde_reg: db8500_b2r2_mcde {
302 regulator-compatible = "db8500_b2r2_mcde"; 287 regulator-compatible = "db8500_b2r2_mcde";
303 regulator-name = "db8500-b2r2-mcde";
304 vin-supply = <&db8500_vape_reg>; 288 vin-supply = <&db8500_vape_reg>;
305 }; 289 };
306 290
307 // DB8500_REGULATOR_SWITCH_ESRAM12 291 // DB8500_REGULATOR_SWITCH_ESRAM12
308 db8500_esram12_reg: db8500_esram12 { 292 db8500_esram12_reg: db8500_esram12 {
309 regulator-compatible = "db8500_esram12"; 293 regulator-compatible = "db8500_esram12";
310 regulator-name = "db8500-esram12";
311 }; 294 };
312 295
313 // DB8500_REGULATOR_SWITCH_ESRAM12RET 296 // DB8500_REGULATOR_SWITCH_ESRAM12RET
314 db8500_esram12_ret_reg: db8500_esram12_ret { 297 db8500_esram12_ret_reg: db8500_esram12_ret {
315 regulator-compatible = "db8500_esram12_ret"; 298 regulator-compatible = "db8500_esram12_ret";
316 regulator-name = "db8500-esram12-ret";
317 }; 299 };
318 300
319 // DB8500_REGULATOR_SWITCH_ESRAM34 301 // DB8500_REGULATOR_SWITCH_ESRAM34
320 db8500_esram34_reg: db8500_esram34 { 302 db8500_esram34_reg: db8500_esram34 {
321 regulator-compatible = "db8500_esram34"; 303 regulator-compatible = "db8500_esram34";
322 regulator-name = "db8500-esram34";
323 }; 304 };
324 305
325 // DB8500_REGULATOR_SWITCH_ESRAM34RET 306 // DB8500_REGULATOR_SWITCH_ESRAM34RET
326 db8500_esram34_ret_reg: db8500_esram34_ret { 307 db8500_esram34_ret_reg: db8500_esram34_ret {
327 regulator-compatible = "db8500_esram34_ret"; 308 regulator-compatible = "db8500_esram34_ret";
328 regulator-name = "db8500-esram34-ret";
329 }; 309 };
330 }; 310 };
331 311
@@ -404,7 +384,6 @@
404 // supplies to the display/camera 384 // supplies to the display/camera
405 ab8500_ldo_aux1_reg: ab8500_ldo_aux1 { 385 ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
406 regulator-compatible = "ab8500_ldo_aux1"; 386 regulator-compatible = "ab8500_ldo_aux1";
407 regulator-name = "V-DISPLAY";
408 regulator-min-microvolt = <2500000>; 387 regulator-min-microvolt = <2500000>;
409 regulator-max-microvolt = <2900000>; 388 regulator-max-microvolt = <2900000>;
410 regulator-boot-on; 389 regulator-boot-on;
@@ -415,7 +394,6 @@
415 // supplies to the on-board eMMC 394 // supplies to the on-board eMMC
416 ab8500_ldo_aux2_reg: ab8500_ldo_aux2 { 395 ab8500_ldo_aux2_reg: ab8500_ldo_aux2 {
417 regulator-compatible = "ab8500_ldo_aux2"; 396 regulator-compatible = "ab8500_ldo_aux2";
418 regulator-name = "V-eMMC1";
419 regulator-min-microvolt = <1100000>; 397 regulator-min-microvolt = <1100000>;
420 regulator-max-microvolt = <3300000>; 398 regulator-max-microvolt = <3300000>;
421 }; 399 };
@@ -423,7 +401,6 @@
423 // supply for VAUX3; SDcard slots 401 // supply for VAUX3; SDcard slots
424 ab8500_ldo_aux3_reg: ab8500_ldo_aux3 { 402 ab8500_ldo_aux3_reg: ab8500_ldo_aux3 {
425 regulator-compatible = "ab8500_ldo_aux3"; 403 regulator-compatible = "ab8500_ldo_aux3";
426 regulator-name = "V-MMC-SD";
427 regulator-min-microvolt = <1100000>; 404 regulator-min-microvolt = <1100000>;
428 regulator-max-microvolt = <3300000>; 405 regulator-max-microvolt = <3300000>;
429 }; 406 };
@@ -431,49 +408,41 @@
431 // supply for v-intcore12; VINTCORE12 LDO 408 // supply for v-intcore12; VINTCORE12 LDO
432 ab8500_ldo_initcore_reg: ab8500_ldo_initcore { 409 ab8500_ldo_initcore_reg: ab8500_ldo_initcore {
433 regulator-compatible = "ab8500_ldo_initcore"; 410 regulator-compatible = "ab8500_ldo_initcore";
434 regulator-name = "V-INTCORE";
435 }; 411 };
436 412
437 // supply for tvout; gpadc; TVOUT LDO 413 // supply for tvout; gpadc; TVOUT LDO
438 ab8500_ldo_tvout_reg: ab8500_ldo_tvout { 414 ab8500_ldo_tvout_reg: ab8500_ldo_tvout {
439 regulator-compatible = "ab8500_ldo_tvout"; 415 regulator-compatible = "ab8500_ldo_tvout";
440 regulator-name = "V-TVOUT";
441 }; 416 };
442 417
443 // supply for ab8500-usb; USB LDO 418 // supply for ab8500-usb; USB LDO
444 ab8500_ldo_usb_reg: ab8500_ldo_usb { 419 ab8500_ldo_usb_reg: ab8500_ldo_usb {
445 regulator-compatible = "ab8500_ldo_usb"; 420 regulator-compatible = "ab8500_ldo_usb";
446 regulator-name = "dummy";
447 }; 421 };
448 422
449 // supply for ab8500-vaudio; VAUDIO LDO 423 // supply for ab8500-vaudio; VAUDIO LDO
450 ab8500_ldo_audio_reg: ab8500_ldo_audio { 424 ab8500_ldo_audio_reg: ab8500_ldo_audio {
451 regulator-compatible = "ab8500_ldo_audio"; 425 regulator-compatible = "ab8500_ldo_audio";
452 regulator-name = "V-AUD";
453 }; 426 };
454 427
455 // supply for v-anamic1 VAMic1-LDO 428 // supply for v-anamic1 VAMic1-LDO
456 ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 { 429 ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {
457 regulator-compatible = "ab8500_ldo_anamic1"; 430 regulator-compatible = "ab8500_ldo_anamic1";
458 regulator-name = "V-AMIC1";
459 }; 431 };
460 432
461 // supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1 433 // supply for v-amic2; VAMIC2 LDO; reuse constants for AMIC1
462 ab8500_ldo_amamic2_reg: ab8500_ldo_amamic2 { 434 ab8500_ldo_amamic2_reg: ab8500_ldo_amamic2 {
463 regulator-compatible = "ab8500_ldo_amamic2"; 435 regulator-compatible = "ab8500_ldo_amamic2";
464 regulator-name = "V-AMIC2";
465 }; 436 };
466 437
467 // supply for v-dmic; VDMIC LDO 438 // supply for v-dmic; VDMIC LDO
468 ab8500_ldo_dmic_reg: ab8500_ldo_dmic { 439 ab8500_ldo_dmic_reg: ab8500_ldo_dmic {
469 regulator-compatible = "ab8500_ldo_dmic"; 440 regulator-compatible = "ab8500_ldo_dmic";
470 regulator-name = "V-DMIC";
471 }; 441 };
472 442
473 // supply for U8500 CSI/DSI; VANA LDO 443 // supply for U8500 CSI/DSI; VANA LDO
474 ab8500_ldo_ana_reg: ab8500_ldo_ana { 444 ab8500_ldo_ana_reg: ab8500_ldo_ana {
475 regulator-compatible = "ab8500_ldo_ana"; 445 regulator-compatible = "ab8500_ldo_ana";
476 regulator-name = "V-CSI/DSI";
477 }; 446 };
478 }; 447 };
479 }; 448 };
@@ -577,42 +546,42 @@
577 status = "disabled"; 546 status = "disabled";
578 }; 547 };
579 548
580 sdi@80126000 { 549 sdi0_per1@80126000 {
581 compatible = "arm,pl18x", "arm,primecell"; 550 compatible = "arm,pl18x", "arm,primecell";
582 reg = <0x80126000 0x1000>; 551 reg = <0x80126000 0x1000>;
583 interrupts = <0 60 0x4>; 552 interrupts = <0 60 0x4>;
584 status = "disabled"; 553 status = "disabled";
585 }; 554 };
586 555
587 sdi@80118000 { 556 sdi1_per2@80118000 {
588 compatible = "arm,pl18x", "arm,primecell"; 557 compatible = "arm,pl18x", "arm,primecell";
589 reg = <0x80118000 0x1000>; 558 reg = <0x80118000 0x1000>;
590 interrupts = <0 50 0x4>; 559 interrupts = <0 50 0x4>;
591 status = "disabled"; 560 status = "disabled";
592 }; 561 };
593 562
594 sdi@80005000 { 563 sdi2_per3@80005000 {
595 compatible = "arm,pl18x", "arm,primecell"; 564 compatible = "arm,pl18x", "arm,primecell";
596 reg = <0x80005000 0x1000>; 565 reg = <0x80005000 0x1000>;
597 interrupts = <0 41 0x4>; 566 interrupts = <0 41 0x4>;
598 status = "disabled"; 567 status = "disabled";
599 }; 568 };
600 569
601 sdi@80119000 { 570 sdi3_per2@80119000 {
602 compatible = "arm,pl18x", "arm,primecell"; 571 compatible = "arm,pl18x", "arm,primecell";
603 reg = <0x80119000 0x1000>; 572 reg = <0x80119000 0x1000>;
604 interrupts = <0 59 0x4>; 573 interrupts = <0 59 0x4>;
605 status = "disabled"; 574 status = "disabled";
606 }; 575 };
607 576
608 sdi@80114000 { 577 sdi4_per2@80114000 {
609 compatible = "arm,pl18x", "arm,primecell"; 578 compatible = "arm,pl18x", "arm,primecell";
610 reg = <0x80114000 0x1000>; 579 reg = <0x80114000 0x1000>;
611 interrupts = <0 99 0x4>; 580 interrupts = <0 99 0x4>;
612 status = "disabled"; 581 status = "disabled";
613 }; 582 };
614 583
615 sdi@80008000 { 584 sdi5_per3@80008000 {
616 compatible = "arm,pl18x", "arm,primecell"; 585 compatible = "arm,pl18x", "arm,primecell";
617 reg = <0x80008000 0x1000>; 586 reg = <0x80008000 0x1000>;
618 interrupts = <0 100 0x4>; 587 interrupts = <0 100 0x4>;
@@ -660,5 +629,19 @@
660 ranges = <0 0x50000000 0x4000000>; 629 ranges = <0 0x50000000 0x4000000>;
661 status = "disabled"; 630 status = "disabled";
662 }; 631 };
632
633 vmmci: regulator-gpio {
634 compatible = "regulator-gpio";
635
636 regulator-min-microvolt = <1800000>;
637 regulator-max-microvolt = <2600000>;
638 regulator-name = "mmci-reg";
639 regulator-type = "voltage";
640
641 gpios = <&tc3589x_gpio 18 0x4>;
642 gpio-enable = <&tc3589x_gpio 17 0x4>;
643 states = <1800000 0x1
644 2900000 0x0>;
645 };
663 }; 646 };
664}; 647};
diff --git a/arch/arm/boot/dts/evk-pro3.dts b/arch/arm/boot/dts/evk-pro3.dts
index b7354e6506de..96e50f569433 100644
--- a/arch/arm/boot/dts/evk-pro3.dts
+++ b/arch/arm/boot/dts/evk-pro3.dts
@@ -22,10 +22,22 @@
22 status = "okay"; 22 status = "okay";
23 }; 23 };
24 24
25 usart0: serial@fffb0000 {
26 status = "okay";
27 };
28
29 usart2: serial@fffb8000 {
30 status = "okay";
31 };
32
25 usb1: gadget@fffa4000 { 33 usb1: gadget@fffa4000 {
26 atmel,vbus-gpio = <&pioC 5 0>; 34 atmel,vbus-gpio = <&pioC 5 0>;
27 status = "okay"; 35 status = "okay";
28 }; 36 };
37
38 watchdog@fffffd40 {
39 status = "okay";
40 };
29 }; 41 };
30 42
31 usb0: ohci@00500000 { 43 usb0: ohci@00500000 {
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index a26c3dd58269..3428f1a94dcc 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -28,6 +28,44 @@
28 spi0 = &spi_0; 28 spi0 = &spi_0;
29 spi1 = &spi_1; 29 spi1 = &spi_1;
30 spi2 = &spi_2; 30 spi2 = &spi_2;
31 i2c0 = &i2c_0;
32 i2c1 = &i2c_1;
33 i2c2 = &i2c_2;
34 i2c3 = &i2c_3;
35 i2c4 = &i2c_4;
36 i2c5 = &i2c_5;
37 i2c6 = &i2c_6;
38 i2c7 = &i2c_7;
39 };
40
41 pd_mfc: mfc-power-domain@10023C40 {
42 compatible = "samsung,exynos4210-pd";
43 reg = <0x10023C40 0x20>;
44 };
45
46 pd_g3d: g3d-power-domain@10023C60 {
47 compatible = "samsung,exynos4210-pd";
48 reg = <0x10023C60 0x20>;
49 };
50
51 pd_lcd0: lcd0-power-domain@10023C80 {
52 compatible = "samsung,exynos4210-pd";
53 reg = <0x10023C80 0x20>;
54 };
55
56 pd_tv: tv-power-domain@10023C20 {
57 compatible = "samsung,exynos4210-pd";
58 reg = <0x10023C20 0x20>;
59 };
60
61 pd_cam: cam-power-domain@10023C00 {
62 compatible = "samsung,exynos4210-pd";
63 reg = <0x10023C00 0x20>;
64 };
65
66 pd_gps: gps-power-domain@10023CE0 {
67 compatible = "samsung,exynos4210-pd";
68 reg = <0x10023CE0 0x20>;
31 }; 69 };
32 70
33 gic:interrupt-controller@10490000 { 71 gic:interrupt-controller@10490000 {
@@ -121,7 +159,7 @@
121 status = "disabled"; 159 status = "disabled";
122 }; 160 };
123 161
124 i2c@13860000 { 162 i2c_0: i2c@13860000 {
125 #address-cells = <1>; 163 #address-cells = <1>;
126 #size-cells = <0>; 164 #size-cells = <0>;
127 compatible = "samsung,s3c2440-i2c"; 165 compatible = "samsung,s3c2440-i2c";
@@ -130,7 +168,7 @@
130 status = "disabled"; 168 status = "disabled";
131 }; 169 };
132 170
133 i2c@13870000 { 171 i2c_1: i2c@13870000 {
134 #address-cells = <1>; 172 #address-cells = <1>;
135 #size-cells = <0>; 173 #size-cells = <0>;
136 compatible = "samsung,s3c2440-i2c"; 174 compatible = "samsung,s3c2440-i2c";
@@ -139,7 +177,7 @@
139 status = "disabled"; 177 status = "disabled";
140 }; 178 };
141 179
142 i2c@13880000 { 180 i2c_2: i2c@13880000 {
143 #address-cells = <1>; 181 #address-cells = <1>;
144 #size-cells = <0>; 182 #size-cells = <0>;
145 compatible = "samsung,s3c2440-i2c"; 183 compatible = "samsung,s3c2440-i2c";
@@ -148,7 +186,7 @@
148 status = "disabled"; 186 status = "disabled";
149 }; 187 };
150 188
151 i2c@13890000 { 189 i2c_3: i2c@13890000 {
152 #address-cells = <1>; 190 #address-cells = <1>;
153 #size-cells = <0>; 191 #size-cells = <0>;
154 compatible = "samsung,s3c2440-i2c"; 192 compatible = "samsung,s3c2440-i2c";
@@ -157,7 +195,7 @@
157 status = "disabled"; 195 status = "disabled";
158 }; 196 };
159 197
160 i2c@138A0000 { 198 i2c_4: i2c@138A0000 {
161 #address-cells = <1>; 199 #address-cells = <1>;
162 #size-cells = <0>; 200 #size-cells = <0>;
163 compatible = "samsung,s3c2440-i2c"; 201 compatible = "samsung,s3c2440-i2c";
@@ -166,7 +204,7 @@
166 status = "disabled"; 204 status = "disabled";
167 }; 205 };
168 206
169 i2c@138B0000 { 207 i2c_5: i2c@138B0000 {
170 #address-cells = <1>; 208 #address-cells = <1>;
171 #size-cells = <0>; 209 #size-cells = <0>;
172 compatible = "samsung,s3c2440-i2c"; 210 compatible = "samsung,s3c2440-i2c";
@@ -175,7 +213,7 @@
175 status = "disabled"; 213 status = "disabled";
176 }; 214 };
177 215
178 i2c@138C0000 { 216 i2c_6: i2c@138C0000 {
179 #address-cells = <1>; 217 #address-cells = <1>;
180 #size-cells = <0>; 218 #size-cells = <0>;
181 compatible = "samsung,s3c2440-i2c"; 219 compatible = "samsung,s3c2440-i2c";
@@ -184,7 +222,7 @@
184 status = "disabled"; 222 status = "disabled";
185 }; 223 };
186 224
187 i2c@138D0000 { 225 i2c_7: i2c@138D0000 {
188 #address-cells = <1>; 226 #address-cells = <1>;
189 #size-cells = <0>; 227 #size-cells = <0>;
190 compatible = "samsung,s3c2440-i2c"; 228 compatible = "samsung,s3c2440-i2c";
diff --git a/arch/arm/boot/dts/exynos4210-origen.dts b/arch/arm/boot/dts/exynos4210-origen.dts
index 3e68f52e8454..f2710018e84e 100644
--- a/arch/arm/boot/dts/exynos4210-origen.dts
+++ b/arch/arm/boot/dts/exynos4210-origen.dts
@@ -22,38 +22,54 @@
22 compatible = "insignal,origen", "samsung,exynos4210"; 22 compatible = "insignal,origen", "samsung,exynos4210";
23 23
24 memory { 24 memory {
25 reg = <0x40000000 0x40000000>; 25 reg = <0x40000000 0x10000000
26 0x50000000 0x10000000
27 0x60000000 0x10000000
28 0x70000000 0x10000000>;
26 }; 29 };
27 30
28 chosen { 31 chosen {
29 bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc"; 32 bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
30 }; 33 };
31 34
35 mmc_reg: voltage-regulator {
36 compatible = "regulator-fixed";
37 regulator-name = "VMEM_VDD_2.8V";
38 regulator-min-microvolt = <2800000>;
39 regulator-max-microvolt = <2800000>;
40 gpio = <&gpx1 1 0>;
41 enable-active-high;
42 };
43
32 sdhci@12530000 { 44 sdhci@12530000 {
33 samsung,sdhci-bus-width = <4>; 45 bus-width = <4>;
34 linux,mmc_cap_4_bit_data; 46 pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_bus4 &sd2_cd>;
35 samsung,sdhci-cd-internal; 47 pinctrl-names = "default";
36 gpio-cd = <&gpk2 2 2 3 3>; 48 vmmc-supply = <&mmc_reg>;
37 gpios = <&gpk2 0 2 0 3>,
38 <&gpk2 1 2 0 3>,
39 <&gpk2 3 2 3 3>,
40 <&gpk2 4 2 3 3>,
41 <&gpk2 5 2 3 3>,
42 <&gpk2 6 2 3 3>;
43 status = "okay"; 49 status = "okay";
44 }; 50 };
45 51
46 sdhci@12510000 { 52 sdhci@12510000 {
47 samsung,sdhci-bus-width = <4>; 53 bus-width = <4>;
48 linux,mmc_cap_4_bit_data; 54 pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_cd>;
49 samsung,sdhci-cd-internal; 55 pinctrl-names = "default";
50 gpio-cd = <&gpk0 2 2 3 3>; 56 vmmc-supply = <&mmc_reg>;
51 gpios = <&gpk0 0 2 0 3>, 57 status = "okay";
52 <&gpk0 1 2 0 3>, 58 };
53 <&gpk0 3 2 3 3>, 59
54 <&gpk0 4 2 3 3>, 60 serial@13800000 {
55 <&gpk0 5 2 3 3>, 61 status = "okay";
56 <&gpk0 6 2 3 3>; 62 };
63
64 serial@13810000 {
65 status = "okay";
66 };
67
68 serial@13820000 {
69 status = "okay";
70 };
71
72 serial@13830000 {
57 status = "okay"; 73 status = "okay";
58 }; 74 };
59 75
@@ -64,35 +80,35 @@
64 80
65 up { 81 up {
66 label = "Up"; 82 label = "Up";
67 gpios = <&gpx2 0 0 0x10000 2>; 83 gpios = <&gpx2 0 1>;
68 linux,code = <103>; 84 linux,code = <103>;
69 gpio-key,wakeup; 85 gpio-key,wakeup;
70 }; 86 };
71 87
72 down { 88 down {
73 label = "Down"; 89 label = "Down";
74 gpios = <&gpx2 1 0 0x10000 2>; 90 gpios = <&gpx2 1 1>;
75 linux,code = <108>; 91 linux,code = <108>;
76 gpio-key,wakeup; 92 gpio-key,wakeup;
77 }; 93 };
78 94
79 back { 95 back {
80 label = "Back"; 96 label = "Back";
81 gpios = <&gpx1 7 0 0x10000 2>; 97 gpios = <&gpx1 7 1>;
82 linux,code = <158>; 98 linux,code = <158>;
83 gpio-key,wakeup; 99 gpio-key,wakeup;
84 }; 100 };
85 101
86 home { 102 home {
87 label = "Home"; 103 label = "Home";
88 gpios = <&gpx1 6 0 0x10000 2>; 104 gpios = <&gpx1 6 1>;
89 linux,code = <102>; 105 linux,code = <102>;
90 gpio-key,wakeup; 106 gpio-key,wakeup;
91 }; 107 };
92 108
93 menu { 109 menu {
94 label = "Menu"; 110 label = "Menu";
95 gpios = <&gpx1 5 0 0x10000 2>; 111 gpios = <&gpx1 5 1>;
96 linux,code = <139>; 112 linux,code = <139>;
97 gpio-key,wakeup; 113 gpio-key,wakeup;
98 }; 114 };
@@ -101,7 +117,7 @@
101 leds { 117 leds {
102 compatible = "gpio-leds"; 118 compatible = "gpio-leds";
103 status { 119 status {
104 gpios = <&gpx1 3 0 0x10000 2>; 120 gpios = <&gpx1 3 1>;
105 linux,default-trigger = "heartbeat"; 121 linux,default-trigger = "heartbeat";
106 }; 122 };
107 }; 123 };
diff --git a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
index b12cf272ad0d..55a2efb763d1 100644
--- a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
@@ -16,6 +16,134 @@
16 16
17/ { 17/ {
18 pinctrl@11400000 { 18 pinctrl@11400000 {
19 gpa0: gpa0 {
20 gpio-controller;
21 #gpio-cells = <2>;
22
23 interrupt-controller;
24 #interrupt-cells = <2>;
25 };
26
27 gpa1: gpa1 {
28 gpio-controller;
29 #gpio-cells = <2>;
30
31 interrupt-controller;
32 #interrupt-cells = <2>;
33 };
34
35 gpb: gpb {
36 gpio-controller;
37 #gpio-cells = <2>;
38
39 interrupt-controller;
40 #interrupt-cells = <2>;
41 };
42
43 gpc0: gpc0 {
44 gpio-controller;
45 #gpio-cells = <2>;
46
47 interrupt-controller;
48 #interrupt-cells = <2>;
49 };
50
51 gpc1: gpc1 {
52 gpio-controller;
53 #gpio-cells = <2>;
54
55 interrupt-controller;
56 #interrupt-cells = <2>;
57 };
58
59 gpd0: gpd0 {
60 gpio-controller;
61 #gpio-cells = <2>;
62
63 interrupt-controller;
64 #interrupt-cells = <2>;
65 };
66
67 gpd1: gpd1 {
68 gpio-controller;
69 #gpio-cells = <2>;
70
71 interrupt-controller;
72 #interrupt-cells = <2>;
73 };
74
75 gpe0: gpe0 {
76 gpio-controller;
77 #gpio-cells = <2>;
78
79 interrupt-controller;
80 #interrupt-cells = <2>;
81 };
82
83 gpe1: gpe1 {
84 gpio-controller;
85 #gpio-cells = <2>;
86
87 interrupt-controller;
88 #interrupt-cells = <2>;
89 };
90
91 gpe2: gpe2 {
92 gpio-controller;
93 #gpio-cells = <2>;
94
95 interrupt-controller;
96 #interrupt-cells = <2>;
97 };
98
99 gpe3: gpe3 {
100 gpio-controller;
101 #gpio-cells = <2>;
102
103 interrupt-controller;
104 #interrupt-cells = <2>;
105 };
106
107 gpe4: gpe4 {
108 gpio-controller;
109 #gpio-cells = <2>;
110
111 interrupt-controller;
112 #interrupt-cells = <2>;
113 };
114
115 gpf0: gpf0 {
116 gpio-controller;
117 #gpio-cells = <2>;
118
119 interrupt-controller;
120 #interrupt-cells = <2>;
121 };
122
123 gpf1: gpf1 {
124 gpio-controller;
125 #gpio-cells = <2>;
126
127 interrupt-controller;
128 #interrupt-cells = <2>;
129 };
130
131 gpf2: gpf2 {
132 gpio-controller;
133 #gpio-cells = <2>;
134
135 interrupt-controller;
136 #interrupt-cells = <2>;
137 };
138
139 gpf3: gpf3 {
140 gpio-controller;
141 #gpio-cells = <2>;
142
143 interrupt-controller;
144 #interrupt-cells = <2>;
145 };
146
19 uart0_data: uart0-data { 147 uart0_data: uart0-data {
20 samsung,pins = "gpa0-0", "gpa0-1"; 148 samsung,pins = "gpa0-0", "gpa0-1";
21 samsung,pin-function = <0x2>; 149 samsung,pin-function = <0x2>;
@@ -205,200 +333,345 @@
205 }; 333 };
206 334
207 pinctrl@11000000 { 335 pinctrl@11000000 {
336 gpj0: gpj0 {
337 gpio-controller;
338 #gpio-cells = <2>;
339
340 interrupt-controller;
341 #interrupt-cells = <2>;
342 };
343
344 gpj1: gpj1 {
345 gpio-controller;
346 #gpio-cells = <2>;
347
348 interrupt-controller;
349 #interrupt-cells = <2>;
350 };
351
352 gpk0: gpk0 {
353 gpio-controller;
354 #gpio-cells = <2>;
355
356 interrupt-controller;
357 #interrupt-cells = <2>;
358 };
359
360 gpk1: gpk1 {
361 gpio-controller;
362 #gpio-cells = <2>;
363
364 interrupt-controller;
365 #interrupt-cells = <2>;
366 };
367
368 gpk2: gpk2 {
369 gpio-controller;
370 #gpio-cells = <2>;
371
372 interrupt-controller;
373 #interrupt-cells = <2>;
374 };
375
376 gpk3: gpk3 {
377 gpio-controller;
378 #gpio-cells = <2>;
379
380 interrupt-controller;
381 #interrupt-cells = <2>;
382 };
383
384 gpl0: gpl0 {
385 gpio-controller;
386 #gpio-cells = <2>;
387
388 interrupt-controller;
389 #interrupt-cells = <2>;
390 };
391
392 gpl1: gpl1 {
393 gpio-controller;
394 #gpio-cells = <2>;
395
396 interrupt-controller;
397 #interrupt-cells = <2>;
398 };
399
400 gpl2: gpl2 {
401 gpio-controller;
402 #gpio-cells = <2>;
403
404 interrupt-controller;
405 #interrupt-cells = <2>;
406 };
407
408 gpy0: gpy0 {
409 gpio-controller;
410 #gpio-cells = <2>;
411 };
412
413 gpy1: gpy1 {
414 gpio-controller;
415 #gpio-cells = <2>;
416 };
417
418 gpy2: gpy2 {
419 gpio-controller;
420 #gpio-cells = <2>;
421 };
422
423 gpy3: gpy3 {
424 gpio-controller;
425 #gpio-cells = <2>;
426 };
427
428 gpy4: gpy4 {
429 gpio-controller;
430 #gpio-cells = <2>;
431 };
432
433 gpy5: gpy5 {
434 gpio-controller;
435 #gpio-cells = <2>;
436 };
437
438 gpy6: gpy6 {
439 gpio-controller;
440 #gpio-cells = <2>;
441 };
442
443 gpx0: gpx0 {
444 gpio-controller;
445 #gpio-cells = <2>;
446
447 interrupt-controller;
448 interrupt-parent = <&gic>;
449 interrupts = <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>,
450 <0 20 0>, <0 21 0>, <0 22 0>, <0 23 0>;
451 #interrupt-cells = <2>;
452 };
453
454 gpx1: gpx1 {
455 gpio-controller;
456 #gpio-cells = <2>;
457
458 interrupt-controller;
459 interrupt-parent = <&gic>;
460 interrupts = <0 24 0>, <0 25 0>, <0 26 0>, <0 27 0>,
461 <0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>;
462 #interrupt-cells = <2>;
463 };
464
465 gpx2: gpx2 {
466 gpio-controller;
467 #gpio-cells = <2>;
468
469 interrupt-controller;
470 #interrupt-cells = <2>;
471 };
472
473 gpx3: gpx3 {
474 gpio-controller;
475 #gpio-cells = <2>;
476
477 interrupt-controller;
478 #interrupt-cells = <2>;
479 };
480
208 sd0_clk: sd0-clk { 481 sd0_clk: sd0-clk {
209 samsung,pins = "gpk0-0"; 482 samsung,pins = "gpk0-0";
210 samsung,pin-function = <2>; 483 samsung,pin-function = <2>;
211 samsung,pin-pud = <0>; 484 samsung,pin-pud = <0>;
212 samsung,pin-drv = <0>; 485 samsung,pin-drv = <3>;
213 }; 486 };
214 487
215 sd0_cmd: sd0-cmd { 488 sd0_cmd: sd0-cmd {
216 samsung,pins = "gpk0-1"; 489 samsung,pins = "gpk0-1";
217 samsung,pin-function = <2>; 490 samsung,pin-function = <2>;
218 samsung,pin-pud = <0>; 491 samsung,pin-pud = <0>;
219 samsung,pin-drv = <0>; 492 samsung,pin-drv = <3>;
220 }; 493 };
221 494
222 sd0_cd: sd0-cd { 495 sd0_cd: sd0-cd {
223 samsung,pins = "gpk0-2"; 496 samsung,pins = "gpk0-2";
224 samsung,pin-function = <2>; 497 samsung,pin-function = <2>;
225 samsung,pin-pud = <3>; 498 samsung,pin-pud = <3>;
226 samsung,pin-drv = <0>; 499 samsung,pin-drv = <3>;
227 }; 500 };
228 501
229 sd0_bus1: sd0-bus-width1 { 502 sd0_bus1: sd0-bus-width1 {
230 samsung,pins = "gpk0-3"; 503 samsung,pins = "gpk0-3";
231 samsung,pin-function = <2>; 504 samsung,pin-function = <2>;
232 samsung,pin-pud = <3>; 505 samsung,pin-pud = <3>;
233 samsung,pin-drv = <0>; 506 samsung,pin-drv = <3>;
234 }; 507 };
235 508
236 sd0_bus4: sd0-bus-width4 { 509 sd0_bus4: sd0-bus-width4 {
237 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6"; 510 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
238 samsung,pin-function = <2>; 511 samsung,pin-function = <2>;
239 samsung,pin-pud = <3>; 512 samsung,pin-pud = <3>;
240 samsung,pin-drv = <0>; 513 samsung,pin-drv = <3>;
241 }; 514 };
242 515
243 sd0_bus8: sd0-bus-width8 { 516 sd0_bus8: sd0-bus-width8 {
244 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; 517 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
245 samsung,pin-function = <3>; 518 samsung,pin-function = <3>;
246 samsung,pin-pud = <3>; 519 samsung,pin-pud = <3>;
247 samsung,pin-drv = <0>; 520 samsung,pin-drv = <3>;
248 }; 521 };
249 522
250 sd4_clk: sd4-clk { 523 sd4_clk: sd4-clk {
251 samsung,pins = "gpk0-0"; 524 samsung,pins = "gpk0-0";
252 samsung,pin-function = <3>; 525 samsung,pin-function = <3>;
253 samsung,pin-pud = <0>; 526 samsung,pin-pud = <0>;
254 samsung,pin-drv = <0>; 527 samsung,pin-drv = <3>;
255 }; 528 };
256 529
257 sd4_cmd: sd4-cmd { 530 sd4_cmd: sd4-cmd {
258 samsung,pins = "gpk0-1"; 531 samsung,pins = "gpk0-1";
259 samsung,pin-function = <3>; 532 samsung,pin-function = <3>;
260 samsung,pin-pud = <0>; 533 samsung,pin-pud = <0>;
261 samsung,pin-drv = <0>; 534 samsung,pin-drv = <3>;
262 }; 535 };
263 536
264 sd4_cd: sd4-cd { 537 sd4_cd: sd4-cd {
265 samsung,pins = "gpk0-2"; 538 samsung,pins = "gpk0-2";
266 samsung,pin-function = <3>; 539 samsung,pin-function = <3>;
267 samsung,pin-pud = <3>; 540 samsung,pin-pud = <3>;
268 samsung,pin-drv = <0>; 541 samsung,pin-drv = <3>;
269 }; 542 };
270 543
271 sd4_bus1: sd4-bus-width1 { 544 sd4_bus1: sd4-bus-width1 {
272 samsung,pins = "gpk0-3"; 545 samsung,pins = "gpk0-3";
273 samsung,pin-function = <3>; 546 samsung,pin-function = <3>;
274 samsung,pin-pud = <3>; 547 samsung,pin-pud = <3>;
275 samsung,pin-drv = <0>; 548 samsung,pin-drv = <3>;
276 }; 549 };
277 550
278 sd4_bus4: sd4-bus-width4 { 551 sd4_bus4: sd4-bus-width4 {
279 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6"; 552 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
280 samsung,pin-function = <3>; 553 samsung,pin-function = <3>;
281 samsung,pin-pud = <3>; 554 samsung,pin-pud = <3>;
282 samsung,pin-drv = <0>; 555 samsung,pin-drv = <3>;
283 }; 556 };
284 557
285 sd4_bus8: sd4-bus-width8 { 558 sd4_bus8: sd4-bus-width8 {
286 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; 559 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
287 samsung,pin-function = <3>; 560 samsung,pin-function = <3>;
288 samsung,pin-pud = <4>; 561 samsung,pin-pud = <4>;
289 samsung,pin-drv = <0>; 562 samsung,pin-drv = <3>;
290 }; 563 };
291 564
292 sd1_clk: sd1-clk { 565 sd1_clk: sd1-clk {
293 samsung,pins = "gpk1-0"; 566 samsung,pins = "gpk1-0";
294 samsung,pin-function = <2>; 567 samsung,pin-function = <2>;
295 samsung,pin-pud = <0>; 568 samsung,pin-pud = <0>;
296 samsung,pin-drv = <0>; 569 samsung,pin-drv = <3>;
297 }; 570 };
298 571
299 sd1_cmd: sd1-cmd { 572 sd1_cmd: sd1-cmd {
300 samsung,pins = "gpk1-1"; 573 samsung,pins = "gpk1-1";
301 samsung,pin-function = <2>; 574 samsung,pin-function = <2>;
302 samsung,pin-pud = <0>; 575 samsung,pin-pud = <0>;
303 samsung,pin-drv = <0>; 576 samsung,pin-drv = <3>;
304 }; 577 };
305 578
306 sd1_cd: sd1-cd { 579 sd1_cd: sd1-cd {
307 samsung,pins = "gpk1-2"; 580 samsung,pins = "gpk1-2";
308 samsung,pin-function = <2>; 581 samsung,pin-function = <2>;
309 samsung,pin-pud = <3>; 582 samsung,pin-pud = <3>;
310 samsung,pin-drv = <0>; 583 samsung,pin-drv = <3>;
311 }; 584 };
312 585
313 sd1_bus1: sd1-bus-width1 { 586 sd1_bus1: sd1-bus-width1 {
314 samsung,pins = "gpk1-3"; 587 samsung,pins = "gpk1-3";
315 samsung,pin-function = <2>; 588 samsung,pin-function = <2>;
316 samsung,pin-pud = <3>; 589 samsung,pin-pud = <3>;
317 samsung,pin-drv = <0>; 590 samsung,pin-drv = <3>;
318 }; 591 };
319 592
320 sd1_bus4: sd1-bus-width4 { 593 sd1_bus4: sd1-bus-width4 {
321 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6"; 594 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
322 samsung,pin-function = <2>; 595 samsung,pin-function = <2>;
323 samsung,pin-pud = <3>; 596 samsung,pin-pud = <3>;
324 samsung,pin-drv = <0>; 597 samsung,pin-drv = <3>;
325 }; 598 };
326 599
327 sd2_clk: sd2-clk { 600 sd2_clk: sd2-clk {
328 samsung,pins = "gpk2-0"; 601 samsung,pins = "gpk2-0";
329 samsung,pin-function = <2>; 602 samsung,pin-function = <2>;
330 samsung,pin-pud = <0>; 603 samsung,pin-pud = <0>;
331 samsung,pin-drv = <0>; 604 samsung,pin-drv = <3>;
332 }; 605 };
333 606
334 sd2_cmd: sd2-cmd { 607 sd2_cmd: sd2-cmd {
335 samsung,pins = "gpk2-1"; 608 samsung,pins = "gpk2-1";
336 samsung,pin-function = <2>; 609 samsung,pin-function = <2>;
337 samsung,pin-pud = <0>; 610 samsung,pin-pud = <0>;
338 samsung,pin-drv = <0>; 611 samsung,pin-drv = <3>;
339 }; 612 };
340 613
341 sd2_cd: sd2-cd { 614 sd2_cd: sd2-cd {
342 samsung,pins = "gpk2-2"; 615 samsung,pins = "gpk2-2";
343 samsung,pin-function = <2>; 616 samsung,pin-function = <2>;
344 samsung,pin-pud = <3>; 617 samsung,pin-pud = <3>;
345 samsung,pin-drv = <0>; 618 samsung,pin-drv = <3>;
346 }; 619 };
347 620
348 sd2_bus1: sd2-bus-width1 { 621 sd2_bus1: sd2-bus-width1 {
349 samsung,pins = "gpk2-3"; 622 samsung,pins = "gpk2-3";
350 samsung,pin-function = <2>; 623 samsung,pin-function = <2>;
351 samsung,pin-pud = <3>; 624 samsung,pin-pud = <3>;
352 samsung,pin-drv = <0>; 625 samsung,pin-drv = <3>;
353 }; 626 };
354 627
355 sd2_bus4: sd2-bus-width4 { 628 sd2_bus4: sd2-bus-width4 {
356 samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6"; 629 samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6";
357 samsung,pin-function = <2>; 630 samsung,pin-function = <2>;
358 samsung,pin-pud = <3>; 631 samsung,pin-pud = <3>;
359 samsung,pin-drv = <0>; 632 samsung,pin-drv = <3>;
360 }; 633 };
361 634
362 sd2_bus8: sd2-bus-width8 { 635 sd2_bus8: sd2-bus-width8 {
363 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6"; 636 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
364 samsung,pin-function = <3>; 637 samsung,pin-function = <3>;
365 samsung,pin-pud = <3>; 638 samsung,pin-pud = <3>;
366 samsung,pin-drv = <0>; 639 samsung,pin-drv = <3>;
367 }; 640 };
368 641
369 sd3_clk: sd3-clk { 642 sd3_clk: sd3-clk {
370 samsung,pins = "gpk3-0"; 643 samsung,pins = "gpk3-0";
371 samsung,pin-function = <2>; 644 samsung,pin-function = <2>;
372 samsung,pin-pud = <0>; 645 samsung,pin-pud = <0>;
373 samsung,pin-drv = <0>; 646 samsung,pin-drv = <3>;
374 }; 647 };
375 648
376 sd3_cmd: sd3-cmd { 649 sd3_cmd: sd3-cmd {
377 samsung,pins = "gpk3-1"; 650 samsung,pins = "gpk3-1";
378 samsung,pin-function = <2>; 651 samsung,pin-function = <2>;
379 samsung,pin-pud = <0>; 652 samsung,pin-pud = <0>;
380 samsung,pin-drv = <0>; 653 samsung,pin-drv = <3>;
381 }; 654 };
382 655
383 sd3_cd: sd3-cd { 656 sd3_cd: sd3-cd {
384 samsung,pins = "gpk3-2"; 657 samsung,pins = "gpk3-2";
385 samsung,pin-function = <2>; 658 samsung,pin-function = <2>;
386 samsung,pin-pud = <3>; 659 samsung,pin-pud = <3>;
387 samsung,pin-drv = <0>; 660 samsung,pin-drv = <3>;
388 }; 661 };
389 662
390 sd3_bus1: sd3-bus-width1 { 663 sd3_bus1: sd3-bus-width1 {
391 samsung,pins = "gpk3-3"; 664 samsung,pins = "gpk3-3";
392 samsung,pin-function = <2>; 665 samsung,pin-function = <2>;
393 samsung,pin-pud = <3>; 666 samsung,pin-pud = <3>;
394 samsung,pin-drv = <0>; 667 samsung,pin-drv = <3>;
395 }; 668 };
396 669
397 sd3_bus4: sd3-bus-width4 { 670 sd3_bus4: sd3-bus-width4 {
398 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6"; 671 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
399 samsung,pin-function = <2>; 672 samsung,pin-function = <2>;
400 samsung,pin-pud = <3>; 673 samsung,pin-pud = <3>;
401 samsung,pin-drv = <0>; 674 samsung,pin-drv = <3>;
402 }; 675 };
403 676
404 eint0: ext-int0 { 677 eint0: ext-int0 {
@@ -438,6 +711,11 @@
438 }; 711 };
439 712
440 pinctrl@03860000 { 713 pinctrl@03860000 {
714 gpz: gpz {
715 gpio-controller;
716 #gpio-cells = <2>;
717 };
718
441 i2s0_bus: i2s0-bus { 719 i2s0_bus: i2s0-bus {
442 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3", 720 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
443 "gpz-4", "gpz-5", "gpz-6"; 721 "gpz-4", "gpz-5", "gpz-6";
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts
index 63610c3ba3af..9b23a8255e39 100644
--- a/arch/arm/boot/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts
@@ -43,6 +43,22 @@
43 status = "okay"; 43 status = "okay";
44 }; 44 };
45 45
46 serial@13800000 {
47 status = "okay";
48 };
49
50 serial@13810000 {
51 status = "okay";
52 };
53
54 serial@13820000 {
55 status = "okay";
56 };
57
58 serial@13830000 {
59 status = "okay";
60 };
61
46 keypad@100A0000 { 62 keypad@100A0000 {
47 samsung,keypad-num-rows = <2>; 63 samsung,keypad-num-rows = <2>;
48 samsung,keypad-num-columns = <8>; 64 samsung,keypad-num-columns = <8>;
diff --git a/arch/arm/boot/dts/exynos4210-trats.dts b/arch/arm/boot/dts/exynos4210-trats.dts
index a21511c14071..c346b64dff55 100644
--- a/arch/arm/boot/dts/exynos4210-trats.dts
+++ b/arch/arm/boot/dts/exynos4210-trats.dts
@@ -35,24 +35,15 @@
35 regulator-name = "VMEM_VDD_2.8V"; 35 regulator-name = "VMEM_VDD_2.8V";
36 regulator-min-microvolt = <2800000>; 36 regulator-min-microvolt = <2800000>;
37 regulator-max-microvolt = <2800000>; 37 regulator-max-microvolt = <2800000>;
38 gpio = <&gpk0 2 1 0 0>; 38 gpio = <&gpk0 2 0>;
39 enable-active-high; 39 enable-active-high;
40 }; 40 };
41 41
42 sdhci_emmc: sdhci@12510000 { 42 sdhci_emmc: sdhci@12510000 {
43 bus-width = <8>; 43 bus-width = <8>;
44 non-removable; 44 non-removable;
45 broken-voltage; 45 pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus8>;
46 gpios = <&gpk0 0 2 0 3>, 46 pinctrl-names = "default";
47 <&gpk0 1 2 0 3>,
48 <&gpk0 3 2 2 3>,
49 <&gpk0 4 2 2 3>,
50 <&gpk0 5 2 2 3>,
51 <&gpk0 6 2 2 3>,
52 <&gpk1 3 3 3 3>,
53 <&gpk1 4 3 3 3>,
54 <&gpk1 5 3 3 3>,
55 <&gpk1 6 3 3 3>;
56 vmmc-supply = <&vemmc_reg>; 47 vmmc-supply = <&vemmc_reg>;
57 status = "okay"; 48 status = "okay";
58 }; 49 };
@@ -73,12 +64,74 @@
73 status = "okay"; 64 status = "okay";
74 }; 65 };
75 66
67 gpio-keys {
68 compatible = "gpio-keys";
69
70 vol-down-key {
71 gpios = <&gpx2 1 1>;
72 linux,code = <114>;
73 label = "volume down";
74 debounce-interval = <10>;
75 };
76
77 vol-up-key {
78 gpios = <&gpx2 0 1>;
79 linux,code = <115>;
80 label = "volume up";
81 debounce-interval = <10>;
82 };
83
84 power-key {
85 gpios = <&gpx2 7 1>;
86 linux,code = <116>;
87 label = "power";
88 debounce-interval = <10>;
89 gpio-key,wakeup;
90 };
91
92 ok-key {
93 gpios = <&gpx3 5 1>;
94 linux,code = <352>;
95 label = "ok";
96 debounce-interval = <10>;
97 };
98 };
99
100 tsp_reg: voltage-regulator {
101 compatible = "regulator-fixed";
102 regulator-name = "TSP_FIXED_VOLTAGES";
103 regulator-min-microvolt = <2800000>;
104 regulator-max-microvolt = <2800000>;
105 gpio = <&gpl0 3 0>;
106 enable-active-high;
107 };
108
109 i2c@13890000 {
110 samsung,i2c-sda-delay = <100>;
111 samsung,i2c-slave-addr = <0x10>;
112 samsung,i2c-max-bus-freq = <400000>;
113 pinctrl-0 = <&i2c3_bus>;
114 pinctrl-names = "default";
115 status = "okay";
116
117 mms114-touchscreen@48 {
118 compatible = "melfas,mms114";
119 reg = <0x48>;
120 interrupt-parent = <&gpx0>;
121 interrupts = <4 2>;
122 x-size = <720>;
123 y-size = <1280>;
124 avdd-supply = <&tsp_reg>;
125 vdd-supply = <&tsp_reg>;
126 };
127 };
128
76 i2c@138B0000 { 129 i2c@138B0000 {
77 samsung,i2c-sda-delay = <100>; 130 samsung,i2c-sda-delay = <100>;
78 samsung,i2c-slave-addr = <0x10>; 131 samsung,i2c-slave-addr = <0x10>;
79 samsung,i2c-max-bus-freq = <100000>; 132 samsung,i2c-max-bus-freq = <100000>;
80 gpios = <&gpb 6 3 3 0>, 133 pinctrl-0 = <&i2c5_bus>;
81 <&gpb 7 3 3 0>; 134 pinctrl-names = "default";
82 status = "okay"; 135 status = "okay";
83 136
84 max8997_pmic@66 { 137 max8997_pmic@66 {
@@ -93,9 +146,9 @@
93 max8997,pmic-ignore-gpiodvs-side-effect; 146 max8997,pmic-ignore-gpiodvs-side-effect;
94 max8997,pmic-buck125-default-dvs-idx = <0>; 147 max8997,pmic-buck125-default-dvs-idx = <0>;
95 148
96 max8997,pmic-buck125-dvs-gpios = <&gpx0 5 1 0 0>, 149 max8997,pmic-buck125-dvs-gpios = <&gpx0 5 0>,
97 <&gpx0 6 1 0 0>, 150 <&gpx0 6 0>,
98 <&gpl0 0 1 0 0>; 151 <&gpl0 0 0>;
99 152
100 max8997,pmic-buck1-dvs-voltage = <1350000>, <1300000>, 153 max8997,pmic-buck1-dvs-voltage = <1350000>, <1300000>,
101 <1250000>, <1200000>, 154 <1250000>, <1200000>,
diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi
index 214c557eda7f..e31bfc4a6f09 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -31,6 +31,11 @@
31 pinctrl2 = &pinctrl_2; 31 pinctrl2 = &pinctrl_2;
32 }; 32 };
33 33
34 pd_lcd1: lcd1-power-domain@10023CA0 {
35 compatible = "samsung,exynos4210-pd";
36 reg = <0x10023CA0 0x20>;
37 };
38
34 gic:interrupt-controller@10490000 { 39 gic:interrupt-controller@10490000 {
35 cpu-offset = <0x8000>; 40 cpu-offset = <0x8000>;
36 }; 41 };
@@ -46,27 +51,17 @@
46 compatible = "samsung,pinctrl-exynos4210"; 51 compatible = "samsung,pinctrl-exynos4210";
47 reg = <0x11400000 0x1000>; 52 reg = <0x11400000 0x1000>;
48 interrupts = <0 47 0>; 53 interrupts = <0 47 0>;
49 interrupt-controller;
50 #interrupt-cells = <2>;
51 }; 54 };
52 55
53 pinctrl_1: pinctrl@11000000 { 56 pinctrl_1: pinctrl@11000000 {
54 compatible = "samsung,pinctrl-exynos4210"; 57 compatible = "samsung,pinctrl-exynos4210";
55 reg = <0x11000000 0x1000>; 58 reg = <0x11000000 0x1000>;
56 interrupts = <0 46 0>; 59 interrupts = <0 46 0>;
57 interrupt-controller;
58 #interrupt-cells = <2>;
59 60
60 wakup_eint: wakeup-interrupt-controller { 61 wakup_eint: wakeup-interrupt-controller {
61 compatible = "samsung,exynos4210-wakeup-eint"; 62 compatible = "samsung,exynos4210-wakeup-eint";
62 interrupt-parent = <&gic>; 63 interrupt-parent = <&gic>;
63 interrupt-controller; 64 interrupts = <0 32 0>;
64 #interrupt-cells = <2>;
65 interrupts = <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>,
66 <0 20 0>, <0 21 0>, <0 22 0>, <0 23 0>,
67 <0 24 0>, <0 25 0>, <0 26 0>, <0 27 0>,
68 <0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>,
69 <0 32 0>;
70 }; 65 };
71 }; 66 };
72 67
@@ -75,232 +70,10 @@
75 reg = <0x03860000 0x1000>; 70 reg = <0x03860000 0x1000>;
76 }; 71 };
77 72
78 gpio-controllers { 73 tmu@100C0000 {
79 #address-cells = <1>; 74 compatible = "samsung,exynos4210-tmu";
80 #size-cells = <1>; 75 interrupt-parent = <&combiner>;
81 gpio-controller; 76 reg = <0x100C0000 0x100>;
82 ranges; 77 interrupts = <2 4>;
83
84 gpa0: gpio-controller@11400000 {
85 compatible = "samsung,exynos4-gpio";
86 reg = <0x11400000 0x20>;
87 #gpio-cells = <4>;
88 };
89
90 gpa1: gpio-controller@11400020 {
91 compatible = "samsung,exynos4-gpio";
92 reg = <0x11400020 0x20>;
93 #gpio-cells = <4>;
94 };
95
96 gpb: gpio-controller@11400040 {
97 compatible = "samsung,exynos4-gpio";
98 reg = <0x11400040 0x20>;
99 #gpio-cells = <4>;
100 };
101
102 gpc0: gpio-controller@11400060 {
103 compatible = "samsung,exynos4-gpio";
104 reg = <0x11400060 0x20>;
105 #gpio-cells = <4>;
106 };
107
108 gpc1: gpio-controller@11400080 {
109 compatible = "samsung,exynos4-gpio";
110 reg = <0x11400080 0x20>;
111 #gpio-cells = <4>;
112 };
113
114 gpd0: gpio-controller@114000A0 {
115 compatible = "samsung,exynos4-gpio";
116 reg = <0x114000A0 0x20>;
117 #gpio-cells = <4>;
118 };
119
120 gpd1: gpio-controller@114000C0 {
121 compatible = "samsung,exynos4-gpio";
122 reg = <0x114000C0 0x20>;
123 #gpio-cells = <4>;
124 };
125
126 gpe0: gpio-controller@114000E0 {
127 compatible = "samsung,exynos4-gpio";
128 reg = <0x114000E0 0x20>;
129 #gpio-cells = <4>;
130 };
131
132 gpe1: gpio-controller@11400100 {
133 compatible = "samsung,exynos4-gpio";
134 reg = <0x11400100 0x20>;
135 #gpio-cells = <4>;
136 };
137
138 gpe2: gpio-controller@11400120 {
139 compatible = "samsung,exynos4-gpio";
140 reg = <0x11400120 0x20>;
141 #gpio-cells = <4>;
142 };
143
144 gpe3: gpio-controller@11400140 {
145 compatible = "samsung,exynos4-gpio";
146 reg = <0x11400140 0x20>;
147 #gpio-cells = <4>;
148 };
149
150 gpe4: gpio-controller@11400160 {
151 compatible = "samsung,exynos4-gpio";
152 reg = <0x11400160 0x20>;
153 #gpio-cells = <4>;
154 };
155
156 gpf0: gpio-controller@11400180 {
157 compatible = "samsung,exynos4-gpio";
158 reg = <0x11400180 0x20>;
159 #gpio-cells = <4>;
160 };
161
162 gpf1: gpio-controller@114001A0 {
163 compatible = "samsung,exynos4-gpio";
164 reg = <0x114001A0 0x20>;
165 #gpio-cells = <4>;
166 };
167
168 gpf2: gpio-controller@114001C0 {
169 compatible = "samsung,exynos4-gpio";
170 reg = <0x114001C0 0x20>;
171 #gpio-cells = <4>;
172 };
173
174 gpf3: gpio-controller@114001E0 {
175 compatible = "samsung,exynos4-gpio";
176 reg = <0x114001E0 0x20>;
177 #gpio-cells = <4>;
178 };
179
180 gpj0: gpio-controller@11000000 {
181 compatible = "samsung,exynos4-gpio";
182 reg = <0x11000000 0x20>;
183 #gpio-cells = <4>;
184 };
185
186 gpj1: gpio-controller@11000020 {
187 compatible = "samsung,exynos4-gpio";
188 reg = <0x11000020 0x20>;
189 #gpio-cells = <4>;
190 };
191
192 gpk0: gpio-controller@11000040 {
193 compatible = "samsung,exynos4-gpio";
194 reg = <0x11000040 0x20>;
195 #gpio-cells = <4>;
196 };
197
198 gpk1: gpio-controller@11000060 {
199 compatible = "samsung,exynos4-gpio";
200 reg = <0x11000060 0x20>;
201 #gpio-cells = <4>;
202 };
203
204 gpk2: gpio-controller@11000080 {
205 compatible = "samsung,exynos4-gpio";
206 reg = <0x11000080 0x20>;
207 #gpio-cells = <4>;
208 };
209
210 gpk3: gpio-controller@110000A0 {
211 compatible = "samsung,exynos4-gpio";
212 reg = <0x110000A0 0x20>;
213 #gpio-cells = <4>;
214 };
215
216 gpl0: gpio-controller@110000C0 {
217 compatible = "samsung,exynos4-gpio";
218 reg = <0x110000C0 0x20>;
219 #gpio-cells = <4>;
220 };
221
222 gpl1: gpio-controller@110000E0 {
223 compatible = "samsung,exynos4-gpio";
224 reg = <0x110000E0 0x20>;
225 #gpio-cells = <4>;
226 };
227
228 gpl2: gpio-controller@11000100 {
229 compatible = "samsung,exynos4-gpio";
230 reg = <0x11000100 0x20>;
231 #gpio-cells = <4>;
232 };
233
234 gpy0: gpio-controller@11000120 {
235 compatible = "samsung,exynos4-gpio";
236 reg = <0x11000120 0x20>;
237 #gpio-cells = <4>;
238 };
239
240 gpy1: gpio-controller@11000140 {
241 compatible = "samsung,exynos4-gpio";
242 reg = <0x11000140 0x20>;
243 #gpio-cells = <4>;
244 };
245
246 gpy2: gpio-controller@11000160 {
247 compatible = "samsung,exynos4-gpio";
248 reg = <0x11000160 0x20>;
249 #gpio-cells = <4>;
250 };
251
252 gpy3: gpio-controller@11000180 {
253 compatible = "samsung,exynos4-gpio";
254 reg = <0x11000180 0x20>;
255 #gpio-cells = <4>;
256 };
257
258 gpy4: gpio-controller@110001A0 {
259 compatible = "samsung,exynos4-gpio";
260 reg = <0x110001A0 0x20>;
261 #gpio-cells = <4>;
262 };
263
264 gpy5: gpio-controller@110001C0 {
265 compatible = "samsung,exynos4-gpio";
266 reg = <0x110001C0 0x20>;
267 #gpio-cells = <4>;
268 };
269
270 gpy6: gpio-controller@110001E0 {
271 compatible = "samsung,exynos4-gpio";
272 reg = <0x110001E0 0x20>;
273 #gpio-cells = <4>;
274 };
275
276 gpx0: gpio-controller@11000C00 {
277 compatible = "samsung,exynos4-gpio";
278 reg = <0x11000C00 0x20>;
279 #gpio-cells = <4>;
280 };
281
282 gpx1: gpio-controller@11000C20 {
283 compatible = "samsung,exynos4-gpio";
284 reg = <0x11000C20 0x20>;
285 #gpio-cells = <4>;
286 };
287
288 gpx2: gpio-controller@11000C40 {
289 compatible = "samsung,exynos4-gpio";
290 reg = <0x11000C40 0x20>;
291 #gpio-cells = <4>;
292 };
293
294 gpx3: gpio-controller@11000C60 {
295 compatible = "samsung,exynos4-gpio";
296 reg = <0x11000C60 0x20>;
297 #gpio-cells = <4>;
298 };
299
300 gpz: gpio-controller@03860000 {
301 compatible = "samsung,exynos4-gpio";
302 reg = <0x03860000 0x20>;
303 #gpio-cells = <4>;
304 };
305 }; 78 };
306}; 79};
diff --git a/arch/arm/boot/dts/exynos4212.dtsi b/arch/arm/boot/dts/exynos4212.dtsi
new file mode 100644
index 000000000000..c6ae2005961f
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4212.dtsi
@@ -0,0 +1,28 @@
1/*
2 * Samsung's Exynos4212 SoC device tree source
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * Samsung's Exynos4212 SoC device nodes are listed in this file. Exynos4212
8 * based board files can include this file and provide values for board specfic
9 * bindings.
10 *
11 * Note: This file does not include device nodes for all the controllers in
12 * Exynos4212 SoC. As device tree coverage for Exynos4212 increases, additional
13 * nodes can be added to this file.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18*/
19
20/include/ "exynos4x12.dtsi"
21
22/ {
23 compatible = "samsung,exynos4212";
24
25 gic:interrupt-controller@10490000 {
26 cpu-offset = <0x8000>;
27 };
28};
diff --git a/arch/arm/boot/dts/exynos4412-smdk4412.dts b/arch/arm/boot/dts/exynos4412-smdk4412.dts
new file mode 100644
index 000000000000..f05bf575cc45
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4412-smdk4412.dts
@@ -0,0 +1,45 @@
1/*
2 * Samsung's Exynos4412 based SMDK board device tree source
3 *
4 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * Device tree source file for Samsung's SMDK4412 board which is based on
8 * Samsung's Exynos4412 SoC.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15/dts-v1/;
16/include/ "exynos4412.dtsi"
17
18/ {
19 model = "Samsung SMDK evaluation board based on Exynos4412";
20 compatible = "samsung,smdk4412", "samsung,exynos4412";
21
22 memory {
23 reg = <0x40000000 0x40000000>;
24 };
25
26 chosen {
27 bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc";
28 };
29
30 serial@13800000 {
31 status = "okay";
32 };
33
34 serial@13810000 {
35 status = "okay";
36 };
37
38 serial@13820000 {
39 status = "okay";
40 };
41
42 serial@13830000 {
43 status = "okay";
44 };
45};
diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi
new file mode 100644
index 000000000000..d7dfe312772a
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4412.dtsi
@@ -0,0 +1,28 @@
1/*
2 * Samsung's Exynos4412 SoC device tree source
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * Samsung's Exynos4412 SoC device nodes are listed in this file. Exynos4412
8 * based board files can include this file and provide values for board specfic
9 * bindings.
10 *
11 * Note: This file does not include device nodes for all the controllers in
12 * Exynos4412 SoC. As device tree coverage for Exynos4412 increases, additional
13 * nodes can be added to this file.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18*/
19
20/include/ "exynos4x12.dtsi"
21
22/ {
23 compatible = "samsung,exynos4412";
24
25 gic:interrupt-controller@10490000 {
26 cpu-offset = <0x4000>;
27 };
28};
diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
new file mode 100644
index 000000000000..8e6115adcd97
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
@@ -0,0 +1,965 @@
1/*
2 * Samsung's Exynos4x12 SoCs pin-mux and pin-config device tree source
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * Samsung's Exynos4x12 SoCs pin-mux and pin-config optiosn are listed as device
8 * tree nodes are listed in this file.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15/ {
16 pinctrl@11400000 {
17 gpa0: gpa0 {
18 gpio-controller;
19 #gpio-cells = <2>;
20
21 interrupt-controller;
22 #interrupt-cells = <2>;
23 };
24
25 gpa1: gpa1 {
26 gpio-controller;
27 #gpio-cells = <2>;
28
29 interrupt-controller;
30 #interrupt-cells = <2>;
31 };
32
33 gpb: gpb {
34 gpio-controller;
35 #gpio-cells = <2>;
36
37 interrupt-controller;
38 #interrupt-cells = <2>;
39 };
40
41 gpc0: gpc0 {
42 gpio-controller;
43 #gpio-cells = <2>;
44
45 interrupt-controller;
46 #interrupt-cells = <2>;
47 };
48
49 gpc1: gpc1 {
50 gpio-controller;
51 #gpio-cells = <2>;
52
53 interrupt-controller;
54 #interrupt-cells = <2>;
55 };
56
57 gpd0: gpd0 {
58 gpio-controller;
59 #gpio-cells = <2>;
60
61 interrupt-controller;
62 #interrupt-cells = <2>;
63 };
64
65 gpd1: gpd1 {
66 gpio-controller;
67 #gpio-cells = <2>;
68
69 interrupt-controller;
70 #interrupt-cells = <2>;
71 };
72
73 gpf0: gpf0 {
74 gpio-controller;
75 #gpio-cells = <2>;
76
77 interrupt-controller;
78 #interrupt-cells = <2>;
79 };
80
81 gpf1: gpf1 {
82 gpio-controller;
83 #gpio-cells = <2>;
84
85 interrupt-controller;
86 #interrupt-cells = <2>;
87 };
88
89 gpf2: gpf2 {
90 gpio-controller;
91 #gpio-cells = <2>;
92
93 interrupt-controller;
94 #interrupt-cells = <2>;
95 };
96
97 gpf3: gpf3 {
98 gpio-controller;
99 #gpio-cells = <2>;
100
101 interrupt-controller;
102 #interrupt-cells = <2>;
103 };
104
105 gpj0: gpj0 {
106 gpio-controller;
107 #gpio-cells = <2>;
108
109 interrupt-controller;
110 #interrupt-cells = <2>;
111 };
112
113 gpj1: gpj1 {
114 gpio-controller;
115 #gpio-cells = <2>;
116
117 interrupt-controller;
118 #interrupt-cells = <2>;
119 };
120
121 uart0_data: uart0-data {
122 samsung,pins = "gpa0-0", "gpa0-1";
123 samsung,pin-function = <0x2>;
124 samsung,pin-pud = <0>;
125 samsung,pin-drv = <0>;
126 };
127
128 uart0_fctl: uart0-fctl {
129 samsung,pins = "gpa0-2", "gpa0-3";
130 samsung,pin-function = <2>;
131 samsung,pin-pud = <0>;
132 samsung,pin-drv = <0>;
133 };
134
135 uart1_data: uart1-data {
136 samsung,pins = "gpa0-4", "gpa0-5";
137 samsung,pin-function = <2>;
138 samsung,pin-pud = <0>;
139 samsung,pin-drv = <0>;
140 };
141
142 uart1_fctl: uart1-fctl {
143 samsung,pins = "gpa0-6", "gpa0-7";
144 samsung,pin-function = <2>;
145 samsung,pin-pud = <0>;
146 samsung,pin-drv = <0>;
147 };
148
149 i2c2_bus: i2c2-bus {
150 samsung,pins = "gpa0-6", "gpa0-7";
151 samsung,pin-function = <3>;
152 samsung,pin-pud = <3>;
153 samsung,pin-drv = <0>;
154 };
155
156 uart2_data: uart2-data {
157 samsung,pins = "gpa1-0", "gpa1-1";
158 samsung,pin-function = <2>;
159 samsung,pin-pud = <0>;
160 samsung,pin-drv = <0>;
161 };
162
163 uart2_fctl: uart2-fctl {
164 samsung,pins = "gpa1-2", "gpa1-3";
165 samsung,pin-function = <2>;
166 samsung,pin-pud = <0>;
167 samsung,pin-drv = <0>;
168 };
169
170 uart_audio_a: uart-audio-a {
171 samsung,pins = "gpa1-0", "gpa1-1";
172 samsung,pin-function = <4>;
173 samsung,pin-pud = <0>;
174 samsung,pin-drv = <0>;
175 };
176
177 i2c3_bus: i2c3-bus {
178 samsung,pins = "gpa1-2", "gpa1-3";
179 samsung,pin-function = <3>;
180 samsung,pin-pud = <3>;
181 samsung,pin-drv = <0>;
182 };
183
184 uart3_data: uart3-data {
185 samsung,pins = "gpa1-4", "gpa1-5";
186 samsung,pin-function = <2>;
187 samsung,pin-pud = <0>;
188 samsung,pin-drv = <0>;
189 };
190
191 uart_audio_b: uart-audio-b {
192 samsung,pins = "gpa1-4", "gpa1-5";
193 samsung,pin-function = <4>;
194 samsung,pin-pud = <0>;
195 samsung,pin-drv = <0>;
196 };
197
198 spi0_bus: spi0-bus {
199 samsung,pins = "gpb-0", "gpb-2", "gpb-3";
200 samsung,pin-function = <2>;
201 samsung,pin-pud = <3>;
202 samsung,pin-drv = <0>;
203 };
204
205 i2c4_bus: i2c4-bus {
206 samsung,pins = "gpb-0", "gpb-1";
207 samsung,pin-function = <3>;
208 samsung,pin-pud = <3>;
209 samsung,pin-drv = <0>;
210 };
211
212 spi1_bus: spi1-bus {
213 samsung,pins = "gpb-4", "gpb-6", "gpb-7";
214 samsung,pin-function = <2>;
215 samsung,pin-pud = <3>;
216 samsung,pin-drv = <0>;
217 };
218
219 i2c5_bus: i2c5-bus {
220 samsung,pins = "gpb-2", "gpb-3";
221 samsung,pin-function = <3>;
222 samsung,pin-pud = <3>;
223 samsung,pin-drv = <0>;
224 };
225
226 i2s1_bus: i2s1-bus {
227 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
228 "gpc0-4";
229 samsung,pin-function = <2>;
230 samsung,pin-pud = <0>;
231 samsung,pin-drv = <0>;
232 };
233
234 pcm1_bus: pcm1-bus {
235 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
236 "gpc0-4";
237 samsung,pin-function = <3>;
238 samsung,pin-pud = <0>;
239 samsung,pin-drv = <0>;
240 };
241
242 ac97_bus: ac97-bus {
243 samsung,pins = "gpc0-0", "gpc0-1", "gpc0-2", "gpc0-3",
244 "gpc0-4";
245 samsung,pin-function = <4>;
246 samsung,pin-pud = <0>;
247 samsung,pin-drv = <0>;
248 };
249
250 i2s2_bus: i2s2-bus {
251 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
252 "gpc1-4";
253 samsung,pin-function = <2>;
254 samsung,pin-pud = <0>;
255 samsung,pin-drv = <0>;
256 };
257
258 pcm2_bus: pcm2-bus {
259 samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
260 "gpc1-4";
261 samsung,pin-function = <3>;
262 samsung,pin-pud = <0>;
263 samsung,pin-drv = <0>;
264 };
265
266 spdif_bus: spdif-bus {
267 samsung,pins = "gpc1-0", "gpc1-1";
268 samsung,pin-function = <4>;
269 samsung,pin-pud = <0>;
270 samsung,pin-drv = <0>;
271 };
272
273 i2c6_bus: i2c6-bus {
274 samsung,pins = "gpc1-3", "gpc1-4";
275 samsung,pin-function = <4>;
276 samsung,pin-pud = <3>;
277 samsung,pin-drv = <0>;
278 };
279
280 spi2_bus: spi2-bus {
281 samsung,pins = "gpc1-1", "gpc1-3", "gpc1-4";
282 samsung,pin-function = <5>;
283 samsung,pin-pud = <3>;
284 samsung,pin-drv = <0>;
285 };
286
287 pwm0_out: pwm0-out {
288 samsung,pins = "gpd0-0";
289 samsung,pin-function = <2>;
290 samsung,pin-pud = <0>;
291 samsung,pin-drv = <0>;
292 };
293
294 pwm1_out: pwm1-out {
295 samsung,pins = "gpd0-1";
296 samsung,pin-function = <2>;
297 samsung,pin-pud = <0>;
298 samsung,pin-drv = <0>;
299 };
300
301 lcd_ctrl: lcd-ctrl {
302 samsung,pins = "gpd0-0", "gpd0-1";
303 samsung,pin-function = <3>;
304 samsung,pin-pud = <0>;
305 samsung,pin-drv = <0>;
306 };
307
308 i2c7_bus: i2c7-bus {
309 samsung,pins = "gpd0-2", "gpd0-3";
310 samsung,pin-function = <3>;
311 samsung,pin-pud = <3>;
312 samsung,pin-drv = <0>;
313 };
314
315 pwm2_out: pwm2-out {
316 samsung,pins = "gpd0-2";
317 samsung,pin-function = <2>;
318 samsung,pin-pud = <0>;
319 samsung,pin-drv = <0>;
320 };
321
322 pwm3_out: pwm3-out {
323 samsung,pins = "gpd0-3";
324 samsung,pin-function = <2>;
325 samsung,pin-pud = <0>;
326 samsung,pin-drv = <0>;
327 };
328
329 i2c0_bus: i2c0-bus {
330 samsung,pins = "gpd1-0", "gpd1-1";
331 samsung,pin-function = <2>;
332 samsung,pin-pud = <3>;
333 samsung,pin-drv = <0>;
334 };
335
336 mipi0_clk: mipi0-clk {
337 samsung,pins = "gpd1-0", "gpd1-1";
338 samsung,pin-function = <3>;
339 samsung,pin-pud = <0>;
340 samsung,pin-drv = <0>;
341 };
342
343 i2c1_bus: i2c1-bus {
344 samsung,pins = "gpd1-2", "gpd1-3";
345 samsung,pin-function = <2>;
346 samsung,pin-pud = <3>;
347 samsung,pin-drv = <0>;
348 };
349
350 mipi1_clk: mipi1-clk {
351 samsung,pins = "gpd1-2", "gpd1-3";
352 samsung,pin-function = <3>;
353 samsung,pin-pud = <0>;
354 samsung,pin-drv = <0>;
355 };
356
357 lcd_clk: lcd-clk {
358 samsung,pins = "gpf0-0", "gpf0-1", "gpf0-2", "gpf0-3";
359 samsung,pin-function = <2>;
360 samsung,pin-pud = <0>;
361 samsung,pin-drv = <0>;
362 };
363
364 lcd_data16: lcd-data-width16 {
365 samsung,pins = "gpf0-7", "gpf1-0", "gpf1-1", "gpf1-2",
366 "gpf1-3", "gpf1-6", "gpf1-7", "gpf2-0",
367 "gpf2-1", "gpf2-2", "gpf2-3", "gpf2-7",
368 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
369 samsung,pin-function = <2>;
370 samsung,pin-pud = <0>;
371 samsung,pin-drv = <0>;
372 };
373
374 lcd_data18: lcd-data-width18 {
375 samsung,pins = "gpf0-6", "gpf0-7", "gpf1-0", "gpf1-1",
376 "gpf1-2", "gpf1-3", "gpf1-6", "gpf1-7",
377 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
378 "gpf2-6", "gpf2-7", "gpf3-0", "gpf3-1",
379 "gpf3-2", "gpf3-3";
380 samsung,pin-function = <2>;
381 samsung,pin-pud = <0>;
382 samsung,pin-drv = <0>;
383 };
384
385 lcd_data24: lcd-data-width24 {
386 samsung,pins = "gpf0-4", "gpf0-5", "gpf0-6", "gpf0-7",
387 "gpf1-0", "gpf1-1", "gpf1-2", "gpf1-3",
388 "gpf1-4", "gpf1-5", "gpf1-6", "gpf1-7",
389 "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
390 "gpf2-4", "gpf2-5", "gpf2-6", "gpf2-7",
391 "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
392 samsung,pin-function = <2>;
393 samsung,pin-pud = <0>;
394 samsung,pin-drv = <0>;
395 };
396
397 lcd_ldi: lcd-ldi {
398 samsung,pins = "gpf3-4";
399 samsung,pin-function = <2>;
400 samsung,pin-pud = <0>;
401 samsung,pin-drv = <0>;
402 };
403
404 cam_port_a: cam-port-a {
405 samsung,pins = "gpj0-0", "gpj0-1", "gpj0-2", "gpj0-3",
406 "gpj0-4", "gpj0-5", "gpj0-6", "gpj0-7",
407 "gpj1-0", "gpj1-1", "gpj1-2", "gpj1-3",
408 "gpj1-4";
409 samsung,pin-function = <2>;
410 samsung,pin-pud = <3>;
411 samsung,pin-drv = <0>;
412 };
413 };
414
415 pinctrl@11000000 {
416 gpk0: gpk0 {
417 gpio-controller;
418 #gpio-cells = <2>;
419
420 interrupt-controller;
421 #interrupt-cells = <2>;
422 };
423
424 gpk1: gpk1 {
425 gpio-controller;
426 #gpio-cells = <2>;
427
428 interrupt-controller;
429 #interrupt-cells = <2>;
430 };
431
432 gpk2: gpk2 {
433 gpio-controller;
434 #gpio-cells = <2>;
435
436 interrupt-controller;
437 #interrupt-cells = <2>;
438 };
439
440 gpk3: gpk3 {
441 gpio-controller;
442 #gpio-cells = <2>;
443
444 interrupt-controller;
445 #interrupt-cells = <2>;
446 };
447
448 gpl0: gpl0 {
449 gpio-controller;
450 #gpio-cells = <2>;
451
452 interrupt-controller;
453 #interrupt-cells = <2>;
454 };
455
456 gpl1: gpl1 {
457 gpio-controller;
458 #gpio-cells = <2>;
459
460 interrupt-controller;
461 #interrupt-cells = <2>;
462 };
463
464 gpl2: gpl2 {
465 gpio-controller;
466 #gpio-cells = <2>;
467
468 interrupt-controller;
469 #interrupt-cells = <2>;
470 };
471
472 gpm0: gpm0 {
473 gpio-controller;
474 #gpio-cells = <2>;
475
476 interrupt-controller;
477 #interrupt-cells = <2>;
478 };
479
480 gpm1: gpm1 {
481 gpio-controller;
482 #gpio-cells = <2>;
483
484 interrupt-controller;
485 #interrupt-cells = <2>;
486 };
487
488 gpm2: gpm2 {
489 gpio-controller;
490 #gpio-cells = <2>;
491
492 interrupt-controller;
493 #interrupt-cells = <2>;
494 };
495
496 gpm3: gpm3 {
497 gpio-controller;
498 #gpio-cells = <2>;
499
500 interrupt-controller;
501 #interrupt-cells = <2>;
502 };
503
504 gpm4: gpm4 {
505 gpio-controller;
506 #gpio-cells = <2>;
507
508 interrupt-controller;
509 #interrupt-cells = <2>;
510 };
511
512 gpy0: gpy0 {
513 gpio-controller;
514 #gpio-cells = <2>;
515 };
516
517 gpy1: gpy1 {
518 gpio-controller;
519 #gpio-cells = <2>;
520 };
521
522 gpy2: gpy2 {
523 gpio-controller;
524 #gpio-cells = <2>;
525 };
526
527 gpy3: gpy3 {
528 gpio-controller;
529 #gpio-cells = <2>;
530 };
531
532 gpy4: gpy4 {
533 gpio-controller;
534 #gpio-cells = <2>;
535 };
536
537 gpy5: gpy5 {
538 gpio-controller;
539 #gpio-cells = <2>;
540 };
541
542 gpy6: gpy6 {
543 gpio-controller;
544 #gpio-cells = <2>;
545 };
546
547 gpx0: gpx0 {
548 gpio-controller;
549 #gpio-cells = <2>;
550
551 interrupt-controller;
552 interrupt-parent = <&gic>;
553 interrupts = <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>,
554 <0 20 0>, <0 21 0>, <0 22 0>, <0 23 0>;
555 #interrupt-cells = <2>;
556 };
557
558 gpx1: gpx1 {
559 gpio-controller;
560 #gpio-cells = <2>;
561
562 interrupt-controller;
563 interrupt-parent = <&gic>;
564 interrupts = <0 24 0>, <0 25 0>, <0 26 0>, <0 27 0>,
565 <0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>;
566 #interrupt-cells = <2>;
567 };
568
569 gpx2: gpx2 {
570 gpio-controller;
571 #gpio-cells = <2>;
572
573 interrupt-controller;
574 #interrupt-cells = <2>;
575 };
576
577 gpx3: gpx3 {
578 gpio-controller;
579 #gpio-cells = <2>;
580
581 interrupt-controller;
582 #interrupt-cells = <2>;
583 };
584
585 sd0_clk: sd0-clk {
586 samsung,pins = "gpk0-0";
587 samsung,pin-function = <2>;
588 samsung,pin-pud = <0>;
589 samsung,pin-drv = <3>;
590 };
591
592 sd0_cmd: sd0-cmd {
593 samsung,pins = "gpk0-1";
594 samsung,pin-function = <2>;
595 samsung,pin-pud = <0>;
596 samsung,pin-drv = <3>;
597 };
598
599 sd0_cd: sd0-cd {
600 samsung,pins = "gpk0-2";
601 samsung,pin-function = <2>;
602 samsung,pin-pud = <3>;
603 samsung,pin-drv = <3>;
604 };
605
606 sd0_bus1: sd0-bus-width1 {
607 samsung,pins = "gpk0-3";
608 samsung,pin-function = <2>;
609 samsung,pin-pud = <3>;
610 samsung,pin-drv = <3>;
611 };
612
613 sd0_bus4: sd0-bus-width4 {
614 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
615 samsung,pin-function = <2>;
616 samsung,pin-pud = <3>;
617 samsung,pin-drv = <3>;
618 };
619
620 sd0_bus8: sd0-bus-width8 {
621 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
622 samsung,pin-function = <3>;
623 samsung,pin-pud = <3>;
624 samsung,pin-drv = <3>;
625 };
626
627 sd4_clk: sd4-clk {
628 samsung,pins = "gpk0-0";
629 samsung,pin-function = <3>;
630 samsung,pin-pud = <0>;
631 samsung,pin-drv = <3>;
632 };
633
634 sd4_cmd: sd4-cmd {
635 samsung,pins = "gpk0-1";
636 samsung,pin-function = <3>;
637 samsung,pin-pud = <0>;
638 samsung,pin-drv = <3>;
639 };
640
641 sd4_cd: sd4-cd {
642 samsung,pins = "gpk0-2";
643 samsung,pin-function = <3>;
644 samsung,pin-pud = <3>;
645 samsung,pin-drv = <3>;
646 };
647
648 sd4_bus1: sd4-bus-width1 {
649 samsung,pins = "gpk0-3";
650 samsung,pin-function = <3>;
651 samsung,pin-pud = <3>;
652 samsung,pin-drv = <3>;
653 };
654
655 sd4_bus4: sd4-bus-width4 {
656 samsung,pins = "gpk0-3", "gpk0-4", "gpk0-5", "gpk0-6";
657 samsung,pin-function = <3>;
658 samsung,pin-pud = <3>;
659 samsung,pin-drv = <3>;
660 };
661
662 sd4_bus8: sd4-bus-width8 {
663 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
664 samsung,pin-function = <3>;
665 samsung,pin-pud = <4>;
666 samsung,pin-drv = <3>;
667 };
668
669 sd1_clk: sd1-clk {
670 samsung,pins = "gpk1-0";
671 samsung,pin-function = <2>;
672 samsung,pin-pud = <0>;
673 samsung,pin-drv = <3>;
674 };
675
676 sd1_cmd: sd1-cmd {
677 samsung,pins = "gpk1-1";
678 samsung,pin-function = <2>;
679 samsung,pin-pud = <0>;
680 samsung,pin-drv = <3>;
681 };
682
683 sd1_cd: sd1-cd {
684 samsung,pins = "gpk1-2";
685 samsung,pin-function = <2>;
686 samsung,pin-pud = <3>;
687 samsung,pin-drv = <3>;
688 };
689
690 sd1_bus1: sd1-bus-width1 {
691 samsung,pins = "gpk1-3";
692 samsung,pin-function = <2>;
693 samsung,pin-pud = <3>;
694 samsung,pin-drv = <3>;
695 };
696
697 sd1_bus4: sd1-bus-width4 {
698 samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
699 samsung,pin-function = <2>;
700 samsung,pin-pud = <3>;
701 samsung,pin-drv = <3>;
702 };
703
704 sd2_clk: sd2-clk {
705 samsung,pins = "gpk2-0";
706 samsung,pin-function = <2>;
707 samsung,pin-pud = <0>;
708 samsung,pin-drv = <3>;
709 };
710
711 sd2_cmd: sd2-cmd {
712 samsung,pins = "gpk2-1";
713 samsung,pin-function = <2>;
714 samsung,pin-pud = <0>;
715 samsung,pin-drv = <3>;
716 };
717
718 sd2_cd: sd2-cd {
719 samsung,pins = "gpk2-2";
720 samsung,pin-function = <2>;
721 samsung,pin-pud = <3>;
722 samsung,pin-drv = <3>;
723 };
724
725 sd2_bus1: sd2-bus-width1 {
726 samsung,pins = "gpk2-3";
727 samsung,pin-function = <2>;
728 samsung,pin-pud = <3>;
729 samsung,pin-drv = <3>;
730 };
731
732 sd2_bus4: sd2-bus-width4 {
733 samsung,pins = "gpk2-3", "gpk2-4", "gpk2-5", "gpk2-6";
734 samsung,pin-function = <2>;
735 samsung,pin-pud = <3>;
736 samsung,pin-drv = <3>;
737 };
738
739 sd2_bus8: sd2-bus-width8 {
740 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
741 samsung,pin-function = <3>;
742 samsung,pin-pud = <3>;
743 samsung,pin-drv = <3>;
744 };
745
746 sd3_clk: sd3-clk {
747 samsung,pins = "gpk3-0";
748 samsung,pin-function = <2>;
749 samsung,pin-pud = <0>;
750 samsung,pin-drv = <3>;
751 };
752
753 sd3_cmd: sd3-cmd {
754 samsung,pins = "gpk3-1";
755 samsung,pin-function = <2>;
756 samsung,pin-pud = <0>;
757 samsung,pin-drv = <3>;
758 };
759
760 sd3_cd: sd3-cd {
761 samsung,pins = "gpk3-2";
762 samsung,pin-function = <2>;
763 samsung,pin-pud = <3>;
764 samsung,pin-drv = <3>;
765 };
766
767 sd3_bus1: sd3-bus-width1 {
768 samsung,pins = "gpk3-3";
769 samsung,pin-function = <2>;
770 samsung,pin-pud = <3>;
771 samsung,pin-drv = <3>;
772 };
773
774 sd3_bus4: sd3-bus-width4 {
775 samsung,pins = "gpk3-3", "gpk3-4", "gpk3-5", "gpk3-6";
776 samsung,pin-function = <2>;
777 samsung,pin-pud = <3>;
778 samsung,pin-drv = <3>;
779 };
780
781 keypad_col0: keypad-col0 {
782 samsung,pins = "gpl2-0";
783 samsung,pin-function = <3>;
784 samsung,pin-pud = <0>;
785 samsung,pin-drv = <0>;
786 };
787
788 keypad_col1: keypad-col1 {
789 samsung,pins = "gpl2-1";
790 samsung,pin-function = <3>;
791 samsung,pin-pud = <0>;
792 samsung,pin-drv = <0>;
793 };
794
795 keypad_col2: keypad-col2 {
796 samsung,pins = "gpl2-2";
797 samsung,pin-function = <3>;
798 samsung,pin-pud = <0>;
799 samsung,pin-drv = <0>;
800 };
801
802 keypad_col3: keypad-col3 {
803 samsung,pins = "gpl2-3";
804 samsung,pin-function = <3>;
805 samsung,pin-pud = <0>;
806 samsung,pin-drv = <0>;
807 };
808
809 keypad_col4: keypad-col4 {
810 samsung,pins = "gpl2-4";
811 samsung,pin-function = <3>;
812 samsung,pin-pud = <0>;
813 samsung,pin-drv = <0>;
814 };
815
816 keypad_col5: keypad-col5 {
817 samsung,pins = "gpl2-5";
818 samsung,pin-function = <3>;
819 samsung,pin-pud = <0>;
820 samsung,pin-drv = <0>;
821 };
822
823 keypad_col6: keypad-col6 {
824 samsung,pins = "gpl2-6";
825 samsung,pin-function = <3>;
826 samsung,pin-pud = <0>;
827 samsung,pin-drv = <0>;
828 };
829
830 keypad_col7: keypad-col7 {
831 samsung,pins = "gpl2-7";
832 samsung,pin-function = <3>;
833 samsung,pin-pud = <0>;
834 samsung,pin-drv = <0>;
835 };
836
837 cam_port_b: cam-port-b {
838 samsung,pins = "gpm0-0", "gpm0-1", "gpm0-2", "gpm0-3",
839 "gpm0-4", "gpm0-5", "gpm0-6", "gpm0-7",
840 "gpm1-0", "gpm1-1", "gpm2-0", "gpm2-1",
841 "gpm2-2";
842 samsung,pin-function = <3>;
843 samsung,pin-pud = <3>;
844 samsung,pin-drv = <0>;
845 };
846
847 eint0: ext-int0 {
848 samsung,pins = "gpx0-0";
849 samsung,pin-function = <0xf>;
850 samsung,pin-pud = <0>;
851 samsung,pin-drv = <0>;
852 };
853
854 eint8: ext-int8 {
855 samsung,pins = "gpx1-0";
856 samsung,pin-function = <0xf>;
857 samsung,pin-pud = <0>;
858 samsung,pin-drv = <0>;
859 };
860
861 eint15: ext-int15 {
862 samsung,pins = "gpx1-7";
863 samsung,pin-function = <0xf>;
864 samsung,pin-pud = <0>;
865 samsung,pin-drv = <0>;
866 };
867
868 eint16: ext-int16 {
869 samsung,pins = "gpx2-0";
870 samsung,pin-function = <0xf>;
871 samsung,pin-pud = <0>;
872 samsung,pin-drv = <0>;
873 };
874
875 eint31: ext-int31 {
876 samsung,pins = "gpx3-7";
877 samsung,pin-function = <0xf>;
878 samsung,pin-pud = <0>;
879 samsung,pin-drv = <0>;
880 };
881 };
882
883 pinctrl@03860000 {
884 gpz: gpz {
885 gpio-controller;
886 #gpio-cells = <2>;
887
888 interrupt-controller;
889 #interrupt-cells = <2>;
890 };
891
892 i2s0_bus: i2s0-bus {
893 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
894 "gpz-4", "gpz-5", "gpz-6";
895 samsung,pin-function = <0x2>;
896 samsung,pin-pud = <0>;
897 samsung,pin-drv = <0>;
898 };
899
900 pcm0_bus: pcm0-bus {
901 samsung,pins = "gpz-0", "gpz-1", "gpz-2", "gpz-3",
902 "gpz-4";
903 samsung,pin-function = <0x3>;
904 samsung,pin-pud = <0>;
905 samsung,pin-drv = <0>;
906 };
907 };
908
909 pinctrl@106E0000 {
910 gpv0: gpv0 {
911 gpio-controller;
912 #gpio-cells = <2>;
913
914 interrupt-controller;
915 #interrupt-cells = <2>;
916 };
917
918 gpv1: gpv1 {
919 gpio-controller;
920 #gpio-cells = <2>;
921
922 interrupt-controller;
923 #interrupt-cells = <2>;
924 };
925
926 gpv2: gpv2 {
927 gpio-controller;
928 #gpio-cells = <2>;
929
930 interrupt-controller;
931 #interrupt-cells = <2>;
932 };
933
934 gpv3: gpv3 {
935 gpio-controller;
936 #gpio-cells = <2>;
937
938 interrupt-controller;
939 #interrupt-cells = <2>;
940 };
941
942 gpv4: gpv4 {
943 gpio-controller;
944 #gpio-cells = <2>;
945
946 interrupt-controller;
947 #interrupt-cells = <2>;
948 };
949
950 c2c_bus: c2c-bus {
951 samsung,pins = "gpv0-0", "gpv0-1", "gpv0-2", "gpv0-3",
952 "gpv0-4", "gpv0-5", "gpv0-6", "gpv0-7",
953 "gpv1-0", "gpv1-1", "gpv1-2", "gpv1-3",
954 "gpv1-4", "gpv1-5", "gpv1-6", "gpv1-7",
955 "gpv2-0", "gpv2-1", "gpv2-2", "gpv2-3",
956 "gpv2-4", "gpv2-5", "gpv2-6", "gpv2-7",
957 "gpv3-0", "gpv3-1", "gpv3-2", "gpv3-3",
958 "gpv3-4", "gpv3-5", "gpv3-6", "gpv3-7",
959 "gpv4-0", "gpv4-1";
960 samsung,pin-function = <0x2>;
961 samsung,pin-pud = <0>;
962 samsung,pin-drv = <0>;
963 };
964 };
965};
diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
new file mode 100644
index 000000000000..179a62e46c9d
--- /dev/null
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -0,0 +1,69 @@
1/*
2 * Samsung's Exynos4x12 SoCs device tree source
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * Samsung's Exynos4x12 SoCs device nodes are listed in this file. Exynos4x12
8 * based board files can include this file and provide values for board specfic
9 * bindings.
10 *
11 * Note: This file does not include device nodes for all the controllers in
12 * Exynos4x12 SoC. As device tree coverage for Exynos4x12 increases, additional
13 * nodes can be added to this file.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18*/
19
20/include/ "exynos4.dtsi"
21/include/ "exynos4x12-pinctrl.dtsi"
22
23/ {
24 aliases {
25 pinctrl0 = &pinctrl_0;
26 pinctrl1 = &pinctrl_1;
27 pinctrl2 = &pinctrl_2;
28 pinctrl3 = &pinctrl_3;
29 };
30
31 combiner:interrupt-controller@10440000 {
32 interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
33 <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
34 <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
35 <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>,
36 <0 16 0>, <0 17 0>, <0 18 0>, <0 19 0>;
37 };
38
39 pinctrl_0: pinctrl@11400000 {
40 compatible = "samsung,pinctrl-exynos4x12";
41 reg = <0x11400000 0x1000>;
42 interrupts = <0 47 0>;
43 };
44
45 pinctrl_1: pinctrl@11000000 {
46 compatible = "samsung,pinctrl-exynos4x12";
47 reg = <0x11000000 0x1000>;
48 interrupts = <0 46 0>;
49
50 wakup_eint: wakeup-interrupt-controller {
51 compatible = "samsung,exynos4210-wakeup-eint";
52 interrupt-parent = <&gic>;
53 interrupts = <0 32 0>;
54 };
55 };
56
57 pinctrl_2: pinctrl@03860000 {
58 compatible = "samsung,pinctrl-exynos4x12";
59 reg = <0x03860000 0x1000>;
60 interrupt-parent = <&combiner>;
61 interrupts = <10 0>;
62 };
63
64 pinctrl_3: pinctrl@106E0000 {
65 compatible = "samsung,pinctrl-exynos4x12";
66 reg = <0x106E0000 0x1000>;
67 interrupts = <0 72 0>;
68 };
69};
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index a352df403b7a..942d5761ca97 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -17,10 +17,6 @@
17 compatible = "samsung,smdk5250", "samsung,exynos5250"; 17 compatible = "samsung,smdk5250", "samsung,exynos5250";
18 18
19 aliases { 19 aliases {
20 mshc0 = &dwmmc_0;
21 mshc1 = &dwmmc_1;
22 mshc2 = &dwmmc_2;
23 mshc3 = &dwmmc_3;
24 }; 20 };
25 21
26 memory { 22 memory {
@@ -55,8 +51,31 @@
55 }; 51 };
56 }; 52 };
57 53
54 i2c@121D0000 {
55 samsung,i2c-sda-delay = <100>;
56 samsung,i2c-max-bus-freq = <40000>;
57 samsung,i2c-slave-addr = <0x38>;
58
59 sata-phy {
60 compatible = "samsung,sata-phy";
61 reg = <0x38>;
62 };
63 };
64
65 sata@122F0000 {
66 samsung,sata-freq = <66>;
67 };
68
58 i2c@12C80000 { 69 i2c@12C80000 {
59 status = "disabled"; 70 samsung,i2c-sda-delay = <100>;
71 samsung,i2c-max-bus-freq = <66000>;
72 gpios = <&gpa0 6 3 3 0>,
73 <&gpa0 7 3 3 0>;
74
75 hdmiddc@50 {
76 compatible = "samsung,exynos5-hdmiddc";
77 reg = <0x50>;
78 };
60 }; 79 };
61 80
62 i2c@12C90000 { 81 i2c@12C90000 {
@@ -79,7 +98,17 @@
79 status = "disabled"; 98 status = "disabled";
80 }; 99 };
81 100
82 dwmmc_0: dwmmc0@12200000 { 101 i2c@12CE0000 {
102 samsung,i2c-sda-delay = <100>;
103 samsung,i2c-max-bus-freq = <66000>;
104
105 hdmiphy@38 {
106 compatible = "samsung,exynos5-hdmiphy";
107 reg = <0x38>;
108 };
109 };
110
111 dwmmc0@12200000 {
83 num-slots = <1>; 112 num-slots = <1>;
84 supports-highspeed; 113 supports-highspeed;
85 broken-cd; 114 broken-cd;
@@ -100,11 +129,11 @@
100 }; 129 };
101 }; 130 };
102 131
103 dwmmc_1: dwmmc1@12210000 { 132 dwmmc1@12210000 {
104 status = "disabled"; 133 status = "disabled";
105 }; 134 };
106 135
107 dwmmc_2: dwmmc2@12220000 { 136 dwmmc2@12220000 {
108 num-slots = <1>; 137 num-slots = <1>;
109 supports-highspeed; 138 supports-highspeed;
110 fifo-depth = <0x80>; 139 fifo-depth = <0x80>;
@@ -125,7 +154,7 @@
125 }; 154 };
126 }; 155 };
127 156
128 dwmmc_3: dwmmc3@12230000 { 157 dwmmc3@12230000 {
129 status = "disabled"; 158 status = "disabled";
130 }; 159 };
131 160
@@ -166,4 +195,13 @@
166 spi_2: spi@12d40000 { 195 spi_2: spi@12d40000 {
167 status = "disabled"; 196 status = "disabled";
168 }; 197 };
198
199 hdmi {
200 hpd-gpio = <&gpx3 7 0xf 1 3>;
201 };
202
203 codec@11000000 {
204 samsung,mfc-r = <0x43000000 0x800000>;
205 samsung,mfc-l = <0x51000000 0x800000>;
206 };
169}; 207};
diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
new file mode 100644
index 000000000000..17dd951c1cd2
--- /dev/null
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -0,0 +1,43 @@
1/*
2 * Google Snow board device tree source
3 *
4 * Copyright (c) 2012 Google, 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/dts-v1/;
12/include/ "exynos5250.dtsi"
13/include/ "cros5250-common.dtsi"
14
15/ {
16 model = "Google Snow";
17 compatible = "google,snow", "samsung,exynos5250";
18
19 gpio-keys {
20 compatible = "gpio-keys";
21
22 lid-switch {
23 label = "Lid";
24 gpios = <&gpx3 5 0 0x10000 0>;
25 linux,input-type = <5>; /* EV_SW */
26 linux,code = <0>; /* SW_LID */
27 debounce-interval = <1>;
28 gpio-key,wakeup;
29 };
30 };
31
32 /*
33 * On Snow we've got SIP WiFi and so can keep drive strengths low to
34 * reduce EMI.
35 */
36 dwmmc3@12230000 {
37 slot@0 {
38 gpios = <&gpc4 0 2 0 0>, <&gpc4 1 2 3 0>,
39 <&gpc4 3 2 3 0>, <&gpc4 4 2 3 0>,
40 <&gpc4 5 2 3 0>, <&gpc4 6 2 3 0>;
41 };
42 };
43};
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index dddfd6e444dc..36d8246ea50e 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -31,6 +31,10 @@
31 gsc1 = &gsc_1; 31 gsc1 = &gsc_1;
32 gsc2 = &gsc_2; 32 gsc2 = &gsc_2;
33 gsc3 = &gsc_3; 33 gsc3 = &gsc_3;
34 mshc0 = &dwmmc_0;
35 mshc1 = &dwmmc_1;
36 mshc2 = &dwmmc_2;
37 mshc3 = &dwmmc_3;
34 }; 38 };
35 39
36 gic:interrupt-controller@10481000 { 40 gic:interrupt-controller@10481000 {
@@ -62,12 +66,24 @@
62 interrupts = <0 42 0>; 66 interrupts = <0 42 0>;
63 }; 67 };
64 68
69 codec@11000000 {
70 compatible = "samsung,mfc-v6";
71 reg = <0x11000000 0x10000>;
72 interrupts = <0 96 0>;
73 };
74
65 rtc { 75 rtc {
66 compatible = "samsung,s3c6410-rtc"; 76 compatible = "samsung,s3c6410-rtc";
67 reg = <0x101E0000 0x100>; 77 reg = <0x101E0000 0x100>;
68 interrupts = <0 43 0>, <0 44 0>; 78 interrupts = <0 43 0>, <0 44 0>;
69 }; 79 };
70 80
81 tmu@10060000 {
82 compatible = "samsung,exynos5250-tmu";
83 reg = <0x10060000 0x100>;
84 interrupts = <0 65 0>;
85 };
86
71 serial@12C00000 { 87 serial@12C00000 {
72 compatible = "samsung,exynos4210-uart"; 88 compatible = "samsung,exynos4210-uart";
73 reg = <0x12C00000 0x100>; 89 reg = <0x12C00000 0x100>;
@@ -92,6 +108,17 @@
92 interrupts = <0 54 0>; 108 interrupts = <0 54 0>;
93 }; 109 };
94 110
111 sata@122F0000 {
112 compatible = "samsung,exynos5-sata-ahci";
113 reg = <0x122F0000 0x1ff>;
114 interrupts = <0 115 0>;
115 };
116
117 sata-phy@12170000 {
118 compatible = "samsung,exynos5-sata-phy";
119 reg = <0x12170000 0x1ff>;
120 };
121
95 i2c@12C60000 { 122 i2c@12C60000 {
96 compatible = "samsung,s3c2440-i2c"; 123 compatible = "samsung,s3c2440-i2c";
97 reg = <0x12C60000 0x100>; 124 reg = <0x12C60000 0x100>;
@@ -156,6 +183,21 @@
156 #size-cells = <0>; 183 #size-cells = <0>;
157 }; 184 };
158 185
186 i2c@12CE0000 {
187 compatible = "samsung,s3c2440-hdmiphy-i2c";
188 reg = <0x12CE0000 0x1000>;
189 interrupts = <0 64 0>;
190 #address-cells = <1>;
191 #size-cells = <0>;
192 };
193
194 i2c@121D0000 {
195 compatible = "samsung,exynos5-sata-phy-i2c";
196 reg = <0x121D0000 0x100>;
197 #address-cells = <1>;
198 #size-cells = <0>;
199 };
200
159 spi_0: spi@12d20000 { 201 spi_0: spi@12d20000 {
160 compatible = "samsung,exynos4210-spi"; 202 compatible = "samsung,exynos4210-spi";
161 reg = <0x12d20000 0x100>; 203 reg = <0x12d20000 0x100>;
@@ -186,7 +228,7 @@
186 #size-cells = <0>; 228 #size-cells = <0>;
187 }; 229 };
188 230
189 dwmmc0@12200000 { 231 dwmmc_0: dwmmc0@12200000 {
190 compatible = "samsung,exynos5250-dw-mshc"; 232 compatible = "samsung,exynos5250-dw-mshc";
191 reg = <0x12200000 0x1000>; 233 reg = <0x12200000 0x1000>;
192 interrupts = <0 75 0>; 234 interrupts = <0 75 0>;
@@ -194,7 +236,7 @@
194 #size-cells = <0>; 236 #size-cells = <0>;
195 }; 237 };
196 238
197 dwmmc1@12210000 { 239 dwmmc_1: dwmmc1@12210000 {
198 compatible = "samsung,exynos5250-dw-mshc"; 240 compatible = "samsung,exynos5250-dw-mshc";
199 reg = <0x12210000 0x1000>; 241 reg = <0x12210000 0x1000>;
200 interrupts = <0 76 0>; 242 interrupts = <0 76 0>;
@@ -202,7 +244,7 @@
202 #size-cells = <0>; 244 #size-cells = <0>;
203 }; 245 };
204 246
205 dwmmc2@12220000 { 247 dwmmc_2: dwmmc2@12220000 {
206 compatible = "samsung,exynos5250-dw-mshc"; 248 compatible = "samsung,exynos5250-dw-mshc";
207 reg = <0x12220000 0x1000>; 249 reg = <0x12220000 0x1000>;
208 interrupts = <0 77 0>; 250 interrupts = <0 77 0>;
@@ -210,7 +252,7 @@
210 #size-cells = <0>; 252 #size-cells = <0>;
211 }; 253 };
212 254
213 dwmmc3@12230000 { 255 dwmmc_3: dwmmc3@12230000 {
214 compatible = "samsung,exynos5250-dw-mshc"; 256 compatible = "samsung,exynos5250-dw-mshc";
215 reg = <0x12230000 0x1000>; 257 reg = <0x12230000 0x1000>;
216 interrupts = <0 78 0>; 258 interrupts = <0 78 0>;
@@ -520,4 +562,16 @@
520 reg = <0x13e30000 0x1000>; 562 reg = <0x13e30000 0x1000>;
521 interrupts = <0 88 0>; 563 interrupts = <0 88 0>;
522 }; 564 };
565
566 hdmi {
567 compatible = "samsung,exynos5-hdmi";
568 reg = <0x14530000 0x100000>;
569 interrupts = <0 95 0>;
570 };
571
572 mixer {
573 compatible = "samsung,exynos5-mixer";
574 reg = <0x14450000 0x10000>;
575 interrupts = <0 94 0>;
576 };
523}; 577};
diff --git a/arch/arm/boot/dts/href.dtsi b/arch/arm/boot/dts/href.dtsi
new file mode 100644
index 000000000000..592fb9dc35bd
--- /dev/null
+++ b/arch/arm/boot/dts/href.dtsi
@@ -0,0 +1,273 @@
1/*
2 * Copyright 2012 ST-Ericsson AB
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/include/ "dbx5x0.dtsi"
13
14/ {
15 memory {
16 reg = <0x00000000 0x20000000>;
17 };
18
19 gpio_keys {
20 compatible = "gpio-keys";
21 #address-cells = <1>;
22 #size-cells = <0>;
23
24 button@1 {
25 linux,code = <11>;
26 label = "SFH7741 Proximity Sensor";
27 };
28 };
29
30 soc-u9500 {
31 uart@80120000 {
32 status = "okay";
33 };
34
35 uart@80121000 {
36 status = "okay";
37 };
38
39 uart@80007000 {
40 status = "okay";
41 };
42
43 i2c@80004000 {
44 tc3589x@42 {
45 compatible = "tc3589x";
46 reg = <0x42>;
47 interrupt-parent = <&gpio6>;
48 interrupts = <25 0x1>;
49
50 interrupt-controller;
51 #interrupt-cells = <2>;
52
53 tc3589x_gpio: tc3589x_gpio {
54 compatible = "tc3589x-gpio";
55 interrupts = <0 0x1>;
56
57 interrupt-controller;
58 #interrupt-cells = <2>;
59 gpio-controller;
60 #gpio-cells = <2>;
61 };
62 };
63 };
64
65 i2c@80128000 {
66 lp5521@0x33 {
67 compatible = "lp5521";
68 reg = <0x33>;
69 };
70
71 lp5521@0x34 {
72 compatible = "lp5521";
73 reg = <0x34>;
74 };
75
76 bh1780@0x29 {
77 compatible = "rohm,bh1780gli";
78 reg = <0x33>;
79 };
80 };
81
82 // External Micro SD slot
83 sdi0_per1@80126000 {
84 arm,primecell-periphid = <0x10480180>;
85 max-frequency = <50000000>;
86 bus-width = <4>;
87 mmc-cap-sd-highspeed;
88 mmc-cap-mmc-highspeed;
89 vmmc-supply = <&ab8500_ldo_aux3_reg>;
90
91 cd-gpios = <&tc3589x_gpio 3 0x4>;
92
93 status = "okay";
94 };
95
96 // WLAN SDIO channel
97 sdi1_per2@80118000 {
98 arm,primecell-periphid = <0x10480180>;
99 max-frequency = <50000000>;
100 bus-width = <4>;
101
102 status = "okay";
103 };
104
105 // PoP:ed eMMC
106 sdi2_per3@80005000 {
107 arm,primecell-periphid = <0x10480180>;
108 max-frequency = <50000000>;
109 bus-width = <8>;
110 mmc-cap-mmc-highspeed;
111
112 status = "okay";
113 };
114
115 // On-board eMMC
116 sdi4_per2@80114000 {
117 arm,primecell-periphid = <0x10480180>;
118 max-frequency = <50000000>;
119 bus-width = <8>;
120 mmc-cap-mmc-highspeed;
121 vmmc-supply = <&ab8500_ldo_aux2_reg>;
122
123 status = "okay";
124 };
125
126 sound {
127 compatible = "stericsson,snd-soc-mop500";
128
129 stericsson,cpu-dai = <&msp1 &msp3>;
130 stericsson,audio-codec = <&codec>;
131 };
132
133 msp1: msp@80124000 {
134 status = "okay";
135 };
136
137 msp3: msp@80125000 {
138 status = "okay";
139 };
140
141 prcmu@80157000 {
142 db8500-prcmu-regulators {
143 db8500_vape_reg: db8500_vape {
144 regulator-name = "db8500-vape";
145 };
146
147 db8500_varm_reg: db8500_varm {
148 regulator-name = "db8500-varm";
149 };
150
151 db8500_vmodem_reg: db8500_vmodem {
152 regulator-name = "db8500-vmodem";
153 };
154
155 db8500_vpll_reg: db8500_vpll {
156 regulator-name = "db8500-vpll";
157 };
158
159 db8500_vsmps1_reg: db8500_vsmps1 {
160 regulator-name = "db8500-vsmps1";
161 };
162
163 db8500_vsmps2_reg: db8500_vsmps2 {
164 regulator-name = "db8500-vsmps2";
165 };
166
167 db8500_vsmps3_reg: db8500_vsmps3 {
168 regulator-name = "db8500-vsmps3";
169 };
170
171 db8500_vrf1_reg: db8500_vrf1 {
172 regulator-name = "db8500-vrf1";
173 };
174
175 db8500_sva_mmdsp_reg: db8500_sva_mmdsp {
176 regulator-name = "db8500-sva-mmdsp";
177 };
178
179 db8500_sva_mmdsp_ret_reg: db8500_sva_mmdsp_ret {
180 regulator-name = "db8500-sva-mmdsp-ret";
181 };
182
183 db8500_sva_pipe_reg: db8500_sva_pipe {
184 regulator-name = "db8500_sva_pipe";
185 };
186
187 db8500_sia_mmdsp_reg: db8500_sia_mmdsp {
188 regulator-name = "db8500_sia_mmdsp";
189 };
190
191 db8500_sia_mmdsp_ret_reg: db8500_sia_mmdsp_ret {
192 regulator-name = "db8500-sia-mmdsp-ret";
193 };
194
195 db8500_sia_pipe_reg: db8500_sia_pipe {
196 regulator-name = "db8500-sia-pipe";
197 };
198
199 db8500_sga_reg: db8500_sga {
200 regulator-name = "db8500-sga";
201 };
202
203 db8500_b2r2_mcde_reg: db8500_b2r2_mcde {
204 regulator-name = "db8500-b2r2-mcde";
205 };
206
207 db8500_esram12_reg: db8500_esram12 {
208 regulator-name = "db8500-esram12";
209 };
210
211 db8500_esram12_ret_reg: db8500_esram12_ret {
212 regulator-name = "db8500-esram12-ret";
213 };
214
215 db8500_esram34_reg: db8500_esram34 {
216 regulator-name = "db8500-esram34";
217 };
218
219 db8500_esram34_ret_reg: db8500_esram34_ret {
220 regulator-name = "db8500-esram34-ret";
221 };
222 };
223
224 ab8500@5 {
225 ab8500-regulators {
226 ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
227 regulator-name = "V-DISPLAY";
228 };
229
230 ab8500_ldo_aux2_reg: ab8500_ldo_aux2 {
231 regulator-name = "V-eMMC1";
232 };
233
234 ab8500_ldo_aux3_reg: ab8500_ldo_aux3 {
235 regulator-name = "V-MMC-SD";
236 };
237
238 ab8500_ldo_initcore_reg: ab8500_ldo_initcore {
239 regulator-name = "V-INTCORE";
240 };
241
242 ab8500_ldo_tvout_reg: ab8500_ldo_tvout {
243 regulator-name = "V-TVOUT";
244 };
245
246 ab8500_ldo_usb_reg: ab8500_ldo_usb {
247 regulator-name = "dummy";
248 };
249
250 ab8500_ldo_audio_reg: ab8500_ldo_audio {
251 regulator-name = "V-AUD";
252 };
253
254 ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {
255 regulator-name = "V-AMIC1";
256 };
257
258 ab8500_ldo_amamic2_reg: ab8500_ldo_amamic2 {
259 regulator-name = "V-AMIC2";
260 };
261
262 ab8500_ldo_dmic_reg: ab8500_ldo_dmic {
263 regulator-name = "V-DMIC";
264 };
265
266 ab8500_ldo_ana_reg: ab8500_ldo_ana {
267 regulator-name = "V-CSI/DSI";
268 };
269 };
270 };
271 };
272 };
273};
diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts
new file mode 100644
index 000000000000..b398946fd64a
--- /dev/null
+++ b/arch/arm/boot/dts/hrefprev60.dts
@@ -0,0 +1,41 @@
1/*
2 * Copyright 2012 ST-Ericsson AB
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/dts-v1/;
13/include/ "dbx5x0.dtsi"
14/include/ "href.dtsi"
15/include/ "stuib.dtsi"
16
17/ {
18 model = "ST-Ericsson HREF (pre-v60) platform with Device Tree";
19 compatible = "st-ericsson,mop500", "st-ericsson,u8500";
20
21 gpio_keys {
22 button@1 {
23 gpios = <&tc3589x_gpio 7 0x4>;
24 };
25 };
26
27 soc-u9500 {
28 i2c@80004000 {
29 tps61052@33 {
30 compatible = "tps61052";
31 reg = <0x33>;
32 };
33 };
34
35 i2c@80110000 {
36 bu21013_tp@0x5c {
37 reset-gpio = <&tc3589x_gpio 13 0x4>;
38 };
39 };
40 };
41};
diff --git a/arch/arm/boot/dts/hrefv60plus.dts b/arch/arm/boot/dts/hrefv60plus.dts
index 2131d77dc9c9..55f4191a626e 100644
--- a/arch/arm/boot/dts/hrefv60plus.dts
+++ b/arch/arm/boot/dts/hrefv60plus.dts
@@ -11,85 +11,200 @@
11 11
12/dts-v1/; 12/dts-v1/;
13/include/ "dbx5x0.dtsi" 13/include/ "dbx5x0.dtsi"
14/include/ "href.dtsi"
15/include/ "stuib.dtsi"
14 16
15/ { 17/ {
16 model = "ST-Ericsson HREF platform with Device Tree"; 18 model = "ST-Ericsson HREF (v60+) platform with Device Tree";
17 compatible = "st-ericsson,hrefv60+"; 19 compatible = "st-ericsson,hrefv60+", "st-ericsson,u8500";
18 20
19 memory { 21 gpio_keys {
20 reg = <0x00000000 0x20000000>; 22 button@1 {
23 gpios = <&gpio6 25 0x4>;
24 };
21 }; 25 };
22 26
23 soc-u9500 { 27 soc-u9500 {
24 uart@80120000 { 28 i2c@80110000 {
29 bu21013_tp@0x5c {
30 reset-gpio = <&gpio4 15 0x4>;
31 };
32 };
33
34 // External Micro SD slot
35 sdi0_per1@80126000 {
36 arm,primecell-periphid = <0x10480180>;
37 max-frequency = <50000000>;
38 bus-width = <4>;
39 mmc-cap-sd-highspeed;
40 mmc-cap-mmc-highspeed;
41 vmmc-supply = <&ab8500_ldo_aux3_reg>;
42
43 cd-gpios = <&tc3589x_gpio 3 0x4>;
44
25 status = "okay"; 45 status = "okay";
26 }; 46 };
27 47
28 uart@80121000 { 48 // WLAN SDIO channel
49 sdi1_per2@80118000 {
50 arm,primecell-periphid = <0x10480180>;
51 max-frequency = <50000000>;
52 bus-width = <4>;
53
29 status = "okay"; 54 status = "okay";
30 }; 55 };
31 56
32 uart@80007000 { 57 // PoP:ed eMMC
58 sdi2_per3@80005000 {
59 arm,primecell-periphid = <0x10480180>;
60 max-frequency = <50000000>;
61 bus-width = <8>;
62 mmc-cap-mmc-highspeed;
63
33 status = "okay"; 64 status = "okay";
34 }; 65 };
35 66
36 i2c@80004000 { 67 // On-board eMMC
37 tc3589x@42 { 68 sdi4_per2@80114000 {
38 compatible = "tc3589x"; 69 arm,primecell-periphid = <0x10480180>;
39 reg = <0x42>; 70 max-frequency = <50000000>;
40 interrupt-parent = <&gpio6>; 71 bus-width = <8>;
41 interrupts = <25 0x1>; 72 mmc-cap-mmc-highspeed;
73 vmmc-supply = <&ab8500_ldo_aux2_reg>;
42 74
43 interrupt-controller; 75 status = "okay";
44 #interrupt-cells = <2>; 76 };
45 77
46 tc3589x_gpio: tc3589x_gpio { 78 prcmu@80157000 {
47 compatible = "tc3589x-gpio"; 79 db8500-prcmu-regulators {
48 interrupts = <0 0x1>; 80 db8500_vape_reg: db8500_vape {
81 regulator-name = "db8500-vape";
82 };
49 83
50 interrupt-controller; 84 db8500_varm_reg: db8500_varm {
51 #interrupt-cells = <2>; 85 regulator-name = "db8500-varm";
52 gpio-controller;
53 #gpio-cells = <2>;
54 }; 86 };
55 };
56 87
57 tps61052@33 { 88 db8500_vmodem_reg: db8500_vmodem {
58 compatible = "tps61052"; 89 regulator-name = "db8500-vmodem";
59 reg = <0x33>; 90 };
60 };
61 };
62 91
63 i2c@80128000 { 92 db8500_vpll_reg: db8500_vpll {
64 lp5521@0x33 { 93 regulator-name = "db8500-vpll";
65 compatible = "lp5521"; 94 };
66 reg = <0x33>;
67 };
68 95
69 lp5521@0x34 { 96 db8500_vsmps1_reg: db8500_vsmps1 {
70 compatible = "lp5521"; 97 regulator-name = "db8500-vsmps1";
71 reg = <0x34>; 98 };
72 }; 99
100 db8500_vsmps2_reg: db8500_vsmps2 {
101 regulator-name = "db8500-vsmps2";
102 };
103
104 db8500_vsmps3_reg: db8500_vsmps3 {
105 regulator-name = "db8500-vsmps3";
106 };
107
108 db8500_vrf1_reg: db8500_vrf1 {
109 regulator-name = "db8500-vrf1";
110 };
111
112 db8500_sva_mmdsp_reg: db8500_sva_mmdsp {
113 regulator-name = "db8500-sva-mmdsp";
114 };
115
116 db8500_sva_mmdsp_ret_reg: db8500_sva_mmdsp_ret {
117 regulator-name = "db8500-sva-mmdsp-ret";
118 };
119
120 db8500_sva_pipe_reg: db8500_sva_pipe {
121 regulator-name = "db8500_sva_pipe";
122 };
73 123
74 bh1780@0x29 { 124 db8500_sia_mmdsp_reg: db8500_sia_mmdsp {
75 compatible = "rohm,bh1780gli"; 125 regulator-name = "db8500_sia_mmdsp";
76 reg = <0x33>; 126 };
127
128 db8500_sia_mmdsp_ret_reg: db8500_sia_mmdsp_ret {
129 regulator-name = "db8500-sia-mmdsp-ret";
130 };
131
132 db8500_sia_pipe_reg: db8500_sia_pipe {
133 regulator-name = "db8500-sia-pipe";
134 };
135
136 db8500_sga_reg: db8500_sga {
137 regulator-name = "db8500-sga";
138 };
139
140 db8500_b2r2_mcde_reg: db8500_b2r2_mcde {
141 regulator-name = "db8500-b2r2-mcde";
142 };
143
144 db8500_esram12_reg: db8500_esram12 {
145 regulator-name = "db8500-esram12";
146 };
147
148 db8500_esram12_ret_reg: db8500_esram12_ret {
149 regulator-name = "db8500-esram12-ret";
150 };
151
152 db8500_esram34_reg: db8500_esram34 {
153 regulator-name = "db8500-esram34";
154 };
155
156 db8500_esram34_ret_reg: db8500_esram34_ret {
157 regulator-name = "db8500-esram34-ret";
158 };
77 }; 159 };
78 };
79 160
80 sound { 161 ab8500@5 {
81 compatible = "stericsson,snd-soc-mop500"; 162 ab8500-regulators {
163 ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
164 regulator-name = "V-DISPLAY";
165 };
82 166
83 stericsson,cpu-dai = <&msp1 &msp3>; 167 ab8500_ldo_aux2_reg: ab8500_ldo_aux2 {
84 stericsson,audio-codec = <&codec>; 168 regulator-name = "V-eMMC1";
85 }; 169 };
86 170
87 msp1: msp@80124000 { 171 ab8500_ldo_aux3_reg: ab8500_ldo_aux3 {
88 status = "okay"; 172 regulator-name = "V-MMC-SD";
89 }; 173 };
90 174
91 msp3: msp@80125000 { 175 ab8500_ldo_initcore_reg: ab8500_ldo_initcore {
92 status = "okay"; 176 regulator-name = "V-INTCORE";
177 };
178
179 ab8500_ldo_tvout_reg: ab8500_ldo_tvout {
180 regulator-name = "V-TVOUT";
181 };
182
183 ab8500_ldo_usb_reg: ab8500_ldo_usb {
184 regulator-name = "dummy";
185 };
186
187 ab8500_ldo_audio_reg: ab8500_ldo_audio {
188 regulator-name = "V-AUD";
189 };
190
191 ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {
192 regulator-name = "V-AMIC1";
193 };
194
195 ab8500_ldo_amamic2_reg: ab8500_ldo_amamic2 {
196 regulator-name = "V-AMIC2";
197 };
198
199 ab8500_ldo_dmic_reg: ab8500_ldo_dmic {
200 regulator-name = "V-DMIC";
201 };
202
203 ab8500_ldo_ana_reg: ab8500_ldo_ana {
204 regulator-name = "V-CSI/DSI";
205 };
206 };
207 };
93 }; 208 };
94 }; 209 };
95}; 210};
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index 384d8b66f337..7c43b8e70b9f 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -40,6 +40,15 @@
40 reg = <0>; 40 reg = <0>;
41 fsl,pinmux-ids = < 41 fsl,pinmux-ids = <
42 0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */ 42 0x2013 /* MX23_PAD_SSP1_DETECT__GPIO_2_1 */
43 >;
44 fsl,drive-strength = <0>;
45 fsl,voltage = <1>;
46 fsl,pull-up = <0>;
47 };
48
49 led_pin_gpio0_17: led_gpio0_17@0 {
50 reg = <0>;
51 fsl,pinmux-ids = <
43 0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */ 52 0x0113 /* MX23_PAD_GPMI_ALE__GPIO_0_17 */
44 >; 53 >;
45 fsl,drive-strength = <0>; 54 fsl,drive-strength = <0>;
@@ -47,6 +56,15 @@
47 fsl,pull-up = <0>; 56 fsl,pull-up = <0>;
48 }; 57 };
49 }; 58 };
59
60 ssp1: ssp@80034000 {
61 #address-cells = <1>;
62 #size-cells = <0>;
63 compatible = "fsl,imx23-spi";
64 pinctrl-names = "default";
65 pinctrl-0 = <&spi2_pins_a>;
66 status = "okay";
67 };
50 }; 68 };
51 69
52 apbx@80040000 { 70 apbx@80040000 {
@@ -91,11 +109,12 @@
91 109
92 leds { 110 leds {
93 compatible = "gpio-leds"; 111 compatible = "gpio-leds";
112 pinctrl-names = "default";
113 pinctrl-0 = <&led_pin_gpio0_17>;
94 114
95 user { 115 user {
96 label = "green"; 116 label = "green";
97 gpios = <&gpio2 1 0>; 117 gpios = <&gpio2 1 1>;
98 linux,default-trigger = "default-on";
99 }; 118 };
100 }; 119 };
101}; 120};
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index 6d31aa383460..65415c598a5e 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -279,6 +279,19 @@
279 fsl,voltage = <1>; 279 fsl,voltage = <1>;
280 fsl,pull-up = <0>; 280 fsl,pull-up = <0>;
281 }; 281 };
282
283 spi2_pins_a: spi2@0 {
284 reg = <0>;
285 fsl,pinmux-ids = <
286 0x0182 /* MX23_PAD_GPMI_WRN__SSP2_SCK */
287 0x0142 /* MX23_PAD_GPMI_RDY1__SSP2_CMD */
288 0x0002 /* MX23_PAD_GPMI_D00__SSP2_DATA0 */
289 0x0032 /* MX23_PAD_GPMI_D03__SSP2_DATA3 */
290 >;
291 fsl,drive-strength = <1>;
292 fsl,voltage = <1>;
293 fsl,pull-up = <1>;
294 };
282 }; 295 };
283 296
284 digctl@8001c000 { 297 digctl@8001c000 {
diff --git a/arch/arm/boot/dts/imx25-karo-tx25.dts b/arch/arm/boot/dts/imx25-karo-tx25.dts
new file mode 100644
index 000000000000..d81f8a0b9794
--- /dev/null
+++ b/arch/arm/boot/dts/imx25-karo-tx25.dts
@@ -0,0 +1,44 @@
1/*
2 * Copyright 2012 Sascha Hauer, Pengutronix
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/dts-v1/;
13/include/ "imx25.dtsi"
14
15/ {
16 model = "Ka-Ro TX25";
17 compatible = "karo,imx25-tx25", "fsl,imx25";
18
19 memory {
20 reg = <0x80000000 0x02000000 0x90000000 0x02000000>;
21 };
22
23 soc {
24 aips@43f00000 {
25 uart1: serial@43f90000 {
26 status = "okay";
27 };
28 };
29
30 spba@50000000 {
31 fec: ethernet@50038000 {
32 status = "okay";
33 phy-mode = "rmii";
34 };
35 };
36
37 emi@80000000 {
38 nand@bb000000 {
39 nand-on-flash-bbt;
40 status = "okay";
41 };
42 };
43 };
44};
diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
new file mode 100644
index 000000000000..e1b13ebc96d6
--- /dev/null
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -0,0 +1,515 @@
1/*
2 * Copyright 2012 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
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/include/ "skeleton.dtsi"
13
14/ {
15 aliases {
16 serial0 = &uart1;
17 serial1 = &uart2;
18 serial2 = &uart3;
19 serial3 = &uart4;
20 serial4 = &uart5;
21 gpio0 = &gpio1;
22 gpio1 = &gpio2;
23 gpio2 = &gpio3;
24 gpio3 = &gpio4;
25 usb0 = &usbotg;
26 usb1 = &usbhost1;
27 };
28
29 asic: asic-interrupt-controller@68000000 {
30 compatible = "fsl,imx25-asic", "fsl,avic";
31 interrupt-controller;
32 #interrupt-cells = <1>;
33 reg = <0x68000000 0x8000000>;
34 };
35
36 clocks {
37 #address-cells = <1>;
38 #size-cells = <0>;
39
40 osc {
41 compatible = "fsl,imx-osc", "fixed-clock";
42 clock-frequency = <24000000>;
43 };
44 };
45
46 soc {
47 #address-cells = <1>;
48 #size-cells = <1>;
49 compatible = "simple-bus";
50 interrupt-parent = <&asic>;
51 ranges;
52
53 aips@43f00000 { /* AIPS1 */
54 compatible = "fsl,aips-bus", "simple-bus";
55 #address-cells = <1>;
56 #size-cells = <1>;
57 reg = <0x43f00000 0x100000>;
58 ranges;
59
60 i2c1: i2c@43f80000 {
61 #address-cells = <1>;
62 #size-cells = <0>;
63 compatible = "fsl,imx25-i2c", "fsl,imx21-i2c";
64 reg = <0x43f80000 0x4000>;
65 clocks = <&clks 48>;
66 clock-names = "";
67 interrupts = <3>;
68 status = "disabled";
69 };
70
71 i2c3: i2c@43f84000 {
72 #address-cells = <1>;
73 #size-cells = <0>;
74 compatible = "fsl,imx25-i2c", "fsl,imx21-i2c";
75 reg = <0x43f84000 0x4000>;
76 clocks = <&clks 48>;
77 clock-names = "";
78 interrupts = <10>;
79 status = "disabled";
80 };
81
82 can1: can@43f88000 {
83 compatible = "fsl,imx25-flexcan", "fsl,p1010-flexcan";
84 reg = <0x43f88000 0x4000>;
85 interrupts = <43>;
86 clocks = <&clks 75>, <&clks 75>;
87 clock-names = "ipg", "per";
88 status = "disabled";
89 };
90
91 can2: can@43f8c000 {
92 compatible = "fsl,imx25-flexcan", "fsl,p1010-flexcan";
93 reg = <0x43f8c000 0x4000>;
94 interrupts = <44>;
95 clocks = <&clks 76>, <&clks 76>;
96 clock-names = "ipg", "per";
97 status = "disabled";
98 };
99
100 uart1: serial@43f90000 {
101 compatible = "fsl,imx25-uart", "fsl,imx21-uart";
102 reg = <0x43f90000 0x4000>;
103 interrupts = <45>;
104 clocks = <&clks 120>, <&clks 57>;
105 clock-names = "ipg", "per";
106 status = "disabled";
107 };
108
109 uart2: serial@43f94000 {
110 compatible = "fsl,imx25-uart", "fsl,imx21-uart";
111 reg = <0x43f94000 0x4000>;
112 interrupts = <32>;
113 clocks = <&clks 121>, <&clks 57>;
114 clock-names = "ipg", "per";
115 status = "disabled";
116 };
117
118 i2c2: i2c@43f98000 {
119 #address-cells = <1>;
120 #size-cells = <0>;
121 compatible = "fsl,imx25-i2c", "fsl,imx21-i2c";
122 reg = <0x43f98000 0x4000>;
123 clocks = <&clks 48>;
124 clock-names = "";
125 interrupts = <4>;
126 status = "disabled";
127 };
128
129 owire@43f9c000 {
130 #address-cells = <1>;
131 #size-cells = <0>;
132 reg = <0x43f9c000 0x4000>;
133 clocks = <&clks 51>;
134 clock-names = "";
135 interrupts = <2>;
136 status = "disabled";
137 };
138
139 spi1: cspi@43fa4000 {
140 #address-cells = <1>;
141 #size-cells = <0>;
142 compatible = "fsl,imx25-cspi", "fsl,imx35-cspi";
143 reg = <0x43fa4000 0x4000>;
144 clocks = <&clks 62>;
145 clock-names = "ipg";
146 interrupts = <14>;
147 status = "disabled";
148 };
149
150 kpp@43fa8000 {
151 #address-cells = <1>;
152 #size-cells = <0>;
153 reg = <0x43fa8000 0x4000>;
154 clocks = <&clks 102>;
155 clock-names = "";
156 interrupts = <24>;
157 status = "disabled";
158 };
159
160 iomuxc@43fac000{
161 compatible = "fsl,imx25-iomuxc";
162 reg = <0x43fac000 0x4000>;
163 };
164
165 audmux@43fb0000 {
166 compatible = "fsl,imx25-audmux", "fsl,imx31-audmux";
167 reg = <0x43fb0000 0x4000>;
168 status = "disabled";
169 };
170 };
171
172 spba@50000000 {
173 compatible = "fsl,spba-bus", "simple-bus";
174 #address-cells = <1>;
175 #size-cells = <1>;
176 reg = <0x50000000 0x40000>;
177 ranges;
178
179 spi3: cspi@50004000 {
180 #address-cells = <1>;
181 #size-cells = <0>;
182 compatible = "fsl,imx25-cspi", "fsl,imx35-cspi";
183 reg = <0x50004000 0x4000>;
184 interrupts = <0>;
185 clocks = <&clks 80>;
186 clock-names = "ipg";
187 status = "disabled";
188 };
189
190 uart4: serial@50008000 {
191 compatible = "fsl,imx25-uart", "fsl,imx21-uart";
192 reg = <0x50008000 0x4000>;
193 interrupts = <5>;
194 clocks = <&clks 123>, <&clks 57>;
195 clock-names = "ipg", "per";
196 status = "disabled";
197 };
198
199 uart3: serial@5000c000 {
200 compatible = "fsl,imx25-uart", "fsl,imx21-uart";
201 reg = <0x5000c000 0x4000>;
202 interrupts = <18>;
203 clocks = <&clks 122>, <&clks 57>;
204 clock-names = "ipg", "per";
205 status = "disabled";
206 };
207
208 spi2: cspi@50010000 {
209 #address-cells = <1>;
210 #size-cells = <0>;
211 compatible = "fsl,imx25-cspi", "fsl,imx35-cspi";
212 reg = <0x50010000 0x4000>;
213 clocks = <&clks 79>;
214 clock-names = "ipg";
215 interrupts = <13>;
216 status = "disabled";
217 };
218
219 ssi2: ssi@50014000 {
220 compatible = "fsl,imx25-ssi", "fsl,imx21-ssi";
221 reg = <0x50014000 0x4000>;
222 interrupts = <11>;
223 status = "disabled";
224 };
225
226 esai@50018000 {
227 reg = <0x50018000 0x4000>;
228 interrupts = <7>;
229 };
230
231 uart5: serial@5002c000 {
232 compatible = "fsl,imx25-uart", "fsl,imx21-uart";
233 reg = <0x5002c000 0x4000>;
234 interrupts = <40>;
235 clocks = <&clks 124>, <&clks 57>;
236 clock-names = "ipg", "per";
237 status = "disabled";
238 };
239
240 tsc: tsc@50030000 {
241 compatible = "fsl,imx25-adc", "fsl,imx21-tsc";
242 reg = <0x50030000 0x4000>;
243 interrupts = <46>;
244 clocks = <&clks 119>;
245 clock-names = "ipg";
246 status = "disabled";
247 };
248
249 ssi1: ssi@50034000 {
250 compatible = "fsl,imx25-ssi", "fsl,imx21-ssi";
251 reg = <0x50034000 0x4000>;
252 interrupts = <12>;
253 status = "disabled";
254 };
255
256 fec: ethernet@50038000 {
257 compatible = "fsl,imx25-fec";
258 reg = <0x50038000 0x4000>;
259 interrupts = <57>;
260 clocks = <&clks 88>, <&clks 65>;
261 clock-names = "ipg", "ahb";
262 status = "disabled";
263 };
264 };
265
266 aips@53f00000 { /* AIPS2 */
267 compatible = "fsl,aips-bus", "simple-bus";
268 #address-cells = <1>;
269 #size-cells = <1>;
270 reg = <0x53f00000 0x100000>;
271 ranges;
272
273 clks: ccm@53f80000 {
274 compatible = "fsl,imx25-ccm";
275 reg = <0x53f80000 0x4000>;
276 interrupts = <31>;
277 #clock-cells = <1>;
278 };
279
280 gpt4: timer@53f84000 {
281 compatible = "fsl,imx25-gpt", "fsl,imx31-gpt";
282 reg = <0x53f84000 0x4000>;
283 clocks = <&clks 9>, <&clks 45>;
284 clock-names = "ipg", "per";
285 interrupts = <1>;
286 };
287
288 gpt3: timer@53f88000 {
289 compatible = "fsl,imx25-gpt", "fsl,imx31-gpt";
290 reg = <0x53f88000 0x4000>;
291 clocks = <&clks 9>, <&clks 47>;
292 clock-names = "ipg", "per";
293 interrupts = <29>;
294 };
295
296 gpt2: timer@53f8c000 {
297 compatible = "fsl,imx25-gpt", "fsl,imx31-gpt";
298 reg = <0x53f8c000 0x4000>;
299 clocks = <&clks 9>, <&clks 47>;
300 clock-names = "ipg", "per";
301 interrupts = <53>;
302 };
303
304 gpt1: timer@53f90000 {
305 compatible = "fsl,imx25-gpt", "fsl,imx31-gpt";
306 reg = <0x53f90000 0x4000>;
307 clocks = <&clks 9>, <&clks 47>;
308 clock-names = "ipg", "per";
309 interrupts = <54>;
310 };
311
312 epit1: timer@53f94000 {
313 compatible = "fsl,imx25-epit";
314 reg = <0x53f94000 0x4000>;
315 interrupts = <28>;
316 };
317
318 epit2: timer@53f98000 {
319 compatible = "fsl,imx25-epit";
320 reg = <0x53f98000 0x4000>;
321 interrupts = <27>;
322 };
323
324 gpio4: gpio@53f9c000 {
325 compatible = "fsl,imx25-gpio", "fsl,imx35-gpio";
326 reg = <0x53f9c000 0x4000>;
327 interrupts = <23>;
328 gpio-controller;
329 #gpio-cells = <2>;
330 interrupt-controller;
331 #interrupt-cells = <2>;
332 };
333
334 pwm2: pwm@53fa0000 {
335 compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
336 #pwm-cells = <2>;
337 reg = <0x53fa0000 0x4000>;
338 clocks = <&clks 106>, <&clks 36>;
339 clock-names = "ipg", "per";
340 interrupts = <36>;
341 };
342
343 gpio3: gpio@53fa4000 {
344 compatible = "fsl,imx25-gpio", "fsl,imx35-gpio";
345 reg = <0x53fa4000 0x4000>;
346 interrupts = <16>;
347 gpio-controller;
348 #gpio-cells = <2>;
349 interrupt-controller;
350 #interrupt-cells = <2>;
351 };
352
353 pwm3: pwm@53fa8000 {
354 compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
355 #pwm-cells = <2>;
356 reg = <0x53fa8000 0x4000>;
357 clocks = <&clks 107>, <&clks 36>;
358 clock-names = "ipg", "per";
359 interrupts = <41>;
360 };
361
362 esdhc1: esdhc@53fb4000 {
363 compatible = "fsl,imx25-esdhc";
364 reg = <0x53fb4000 0x4000>;
365 interrupts = <9>;
366 clocks = <&clks 86>, <&clks 63>, <&clks 45>;
367 clock-names = "ipg", "ahb", "per";
368 status = "disabled";
369 };
370
371 esdhc2: esdhc@53fb8000 {
372 compatible = "fsl,imx25-esdhc";
373 reg = <0x53fb8000 0x4000>;
374 interrupts = <8>;
375 clocks = <&clks 87>, <&clks 64>, <&clks 46>;
376 clock-names = "ipg", "ahb", "per";
377 status = "disabled";
378 };
379
380 lcdc@53fbc000 {
381 reg = <0x53fbc000 0x4000>;
382 interrupts = <39>;
383 clocks = <&clks 103>, <&clks 66>, <&clks 49>;
384 clock-names = "ipg", "ahb", "per";
385 status = "disabled";
386 };
387
388 slcdc@53fc0000 {
389 reg = <0x53fc0000 0x4000>;
390 interrupts = <38>;
391 status = "disabled";
392 };
393
394 pwm4: pwm@53fc8000 {
395 compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
396 reg = <0x53fc8000 0x4000>;
397 clocks = <&clks 108>, <&clks 36>;
398 clock-names = "ipg", "per";
399 interrupts = <42>;
400 };
401
402 gpio1: gpio@53fcc000 {
403 compatible = "fsl,imx25-gpio", "fsl,imx35-gpio";
404 reg = <0x53fcc000 0x4000>;
405 interrupts = <52>;
406 gpio-controller;
407 #gpio-cells = <2>;
408 interrupt-controller;
409 #interrupt-cells = <2>;
410 };
411
412 gpio2: gpio@53fd0000 {
413 compatible = "fsl,imx25-gpio", "fsl,imx35-gpio";
414 reg = <0x53fd0000 0x4000>;
415 interrupts = <51>;
416 gpio-controller;
417 #gpio-cells = <2>;
418 interrupt-controller;
419 #interrupt-cells = <2>;
420 };
421
422 sdma@53fd4000 {
423 compatible = "fsl,imx25-sdma", "fsl,imx35-sdma";
424 reg = <0x53fd4000 0x4000>;
425 clocks = <&clks 112>, <&clks 68>;
426 clock-names = "ipg", "ahb";
427 interrupts = <34>;
428 };
429
430 wdog@53fdc000 {
431 compatible = "fsl,imx25-wdt", "fsl,imx21-wdt";
432 reg = <0x53fdc000 0x4000>;
433 clocks = <&clks 126>;
434 clock-names = "";
435 interrupts = <55>;
436 };
437
438 pwm1: pwm@53fe0000 {
439 compatible = "fsl,imx25-pwm", "fsl,imx27-pwm";
440 #pwm-cells = <2>;
441 reg = <0x53fe0000 0x4000>;
442 clocks = <&clks 105>, <&clks 36>;
443 clock-names = "ipg", "per";
444 interrupts = <26>;
445 };
446
447 usbphy1: usbphy@1 {
448 compatible = "nop-usbphy";
449 status = "disabled";
450 };
451
452 usbphy2: usbphy@2 {
453 compatible = "nop-usbphy";
454 status = "disabled";
455 };
456
457 usbotg: usb@53ff4000 {
458 compatible = "fsl,imx25-usb", "fsl,imx27-usb";
459 reg = <0x53ff4000 0x0200>;
460 interrupts = <37>;
461 clocks = <&clks 9>, <&clks 70>, <&clks 8>;
462 clock-names = "ipg", "ahb", "per";
463 fsl,usbmisc = <&usbmisc 0>;
464 status = "disabled";
465 };
466
467 usbhost1: usb@53ff4400 {
468 compatible = "fsl,imx25-usb", "fsl,imx27-usb";
469 reg = <0x53ff4400 0x0200>;
470 interrupts = <35>;
471 clocks = <&clks 9>, <&clks 70>, <&clks 8>;
472 clock-names = "ipg", "ahb", "per";
473 fsl,usbmisc = <&usbmisc 1>;
474 status = "disabled";
475 };
476
477 usbmisc: usbmisc@53ff4600 {
478 #index-cells = <1>;
479 compatible = "fsl,imx25-usbmisc";
480 clocks = <&clks 9>, <&clks 70>, <&clks 8>;
481 clock-names = "ipg", "ahb", "per";
482 reg = <0x53ff4600 0x00f>;
483 status = "disabled";
484 };
485
486 dryice@53ffc000 {
487 compatible = "fsl,imx25-dryice", "fsl,imx25-rtc";
488 reg = <0x53ffc000 0x4000>;
489 clocks = <&clks 81>;
490 clock-names = "ipg";
491 interrupts = <25>;
492 };
493 };
494
495 emi@80000000 {
496 compatible = "fsl,emi-bus", "simple-bus";
497 #address-cells = <1>;
498 #size-cells = <1>;
499 reg = <0x80000000 0x3b002000>;
500 ranges;
501
502 nand@bb000000 {
503 #address-cells = <1>;
504 #size-cells = <1>;
505
506 compatible = "fsl,imx25-nand";
507 reg = <0xbb000000 0x2000>;
508 clocks = <&clks 50>;
509 clock-names = "";
510 interrupts = <33>;
511 status = "disabled";
512 };
513 };
514 };
515};
diff --git a/arch/arm/boot/dts/imx27-apf27.dts b/arch/arm/boot/dts/imx27-apf27.dts
new file mode 100644
index 000000000000..c0327c054de2
--- /dev/null
+++ b/arch/arm/boot/dts/imx27-apf27.dts
@@ -0,0 +1,89 @@
1/*
2 * Copyright 2012 Philippe Reynes <tremyfr@yahoo.fr>
3 * Copyright 2012 Armadeus Systems <support@armadeus.com>
4 *
5 * Based on code which is: Copyright 2012 Sascha Hauer, Pengutronix
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/dts-v1/;
16/include/ "imx27.dtsi"
17
18/ {
19 model = "Armadeus Systems APF27 module";
20 compatible = "armadeus,imx27-apf27", "fsl,imx27";
21
22 memory {
23 reg = <0xa0000000 0x04000000>;
24 };
25
26 clocks {
27 #address-cells = <1>;
28 #size-cells = <0>;
29
30 osc26m {
31 compatible = "fsl,imx-osc26m", "fixed-clock";
32 clock-frequency = <0>;
33 };
34 };
35
36 soc {
37 aipi@10000000 {
38 serial@1000a000 {
39 status = "okay";
40 };
41
42 ethernet@1002b000 {
43 status = "okay";
44 };
45 };
46
47 nand@d8000000 {
48 status = "okay";
49 nand-bus-width = <16>;
50 nand-ecc-mode = "hw";
51 nand-on-flash-bbt;
52
53 partition@0 {
54 label = "u-boot";
55 reg = <0x0 0x100000>;
56 };
57
58 partition@100000 {
59 label = "env";
60 reg = <0x100000 0x80000>;
61 };
62
63 partition@180000 {
64 label = "env2";
65 reg = <0x180000 0x80000>;
66 };
67
68 partition@200000 {
69 label = "firmware";
70 reg = <0x200000 0x80000>;
71 };
72
73 partition@280000 {
74 label = "dtb";
75 reg = <0x280000 0x80000>;
76 };
77
78 partition@300000 {
79 label = "kernel";
80 reg = <0x300000 0x500000>;
81 };
82
83 partition@800000 {
84 label = "rootfs";
85 reg = <0x800000 0xf800000>;
86 };
87 };
88 };
89};
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 3e54f1498841..b8d3905915ac 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -58,7 +58,7 @@
58 reg = <0x10000000 0x10000000>; 58 reg = <0x10000000 0x10000000>;
59 ranges; 59 ranges;
60 60
61 wdog@10002000 { 61 wdog: wdog@10002000 {
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>;
@@ -113,7 +113,7 @@
113 i2c1: i2c@10012000 { 113 i2c1: i2c@10012000 {
114 #address-cells = <1>; 114 #address-cells = <1>;
115 #size-cells = <0>; 115 #size-cells = <0>;
116 compatible = "fsl,imx27-i2c", "fsl,imx1-i2c"; 116 compatible = "fsl,imx27-i2c", "fsl,imx21-i2c";
117 reg = <0x10012000 0x1000>; 117 reg = <0x10012000 0x1000>;
118 interrupts = <12>; 118 interrupts = <12>;
119 status = "disabled"; 119 status = "disabled";
@@ -205,7 +205,7 @@
205 i2c2: i2c@1001d000 { 205 i2c2: i2c@1001d000 {
206 #address-cells = <1>; 206 #address-cells = <1>;
207 #size-cells = <0>; 207 #size-cells = <0>;
208 compatible = "fsl,imx27-i2c", "fsl,imx1-i2c"; 208 compatible = "fsl,imx27-i2c", "fsl,imx21-i2c";
209 reg = <0x1001d000 0x1000>; 209 reg = <0x1001d000 0x1000>;
210 interrupts = <1>; 210 interrupts = <1>;
211 status = "disabled"; 211 status = "disabled";
@@ -218,7 +218,8 @@
218 status = "disabled"; 218 status = "disabled";
219 }; 219 };
220 }; 220 };
221 nand@d8000000 { 221
222 nfc: nand@d8000000 {
222 #address-cells = <1>; 223 #address-cells = <1>;
223 #size-cells = <1>; 224 #size-cells = <1>;
224 225
diff --git a/arch/arm/boot/dts/imx28-apf28.dts b/arch/arm/boot/dts/imx28-apf28.dts
new file mode 100644
index 000000000000..7eb075876c4c
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-apf28.dts
@@ -0,0 +1,85 @@
1/*
2 * Copyright 2012 Armadeus Systems - <support@armadeus.com>
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/dts-v1/;
13/include/ "imx28.dtsi"
14
15/ {
16 model = "Armadeus Systems APF28 module";
17 compatible = "armadeus,imx28-apf28", "fsl,imx28";
18
19 memory {
20 reg = <0x40000000 0x08000000>;
21 };
22
23 apb@80000000 {
24 apbh@80000000 {
25 gpmi-nand@8000c000 {
26 pinctrl-names = "default";
27 pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
28 status = "okay";
29
30 partition@0 {
31 label = "u-boot";
32 reg = <0x0 0x300000>;
33 };
34
35 partition@300000 {
36 label = "env";
37 reg = <0x300000 0x80000>;
38 };
39
40 partition@380000 {
41 label = "env2";
42 reg = <0x380000 0x80000>;
43 };
44
45 partition@400000 {
46 label = "dtb";
47 reg = <0x400000 0x80000>;
48 };
49
50 partition@480000 {
51 label = "splash";
52 reg = <0x480000 0x80000>;
53 };
54
55 partition@500000 {
56 label = "kernel";
57 reg = <0x500000 0x800000>;
58 };
59
60 partition@d00000 {
61 label = "rootfs";
62 reg = <0xd00000 0xf300000>;
63 };
64 };
65 };
66
67 apbx@80040000 {
68 duart: serial@80074000 {
69 pinctrl-names = "default";
70 pinctrl-0 = <&duart_pins_a>;
71 status = "okay";
72 };
73 };
74 };
75
76 ahb@80080000 {
77 mac0: ethernet@800f0000 {
78 phy-mode = "rmii";
79 pinctrl-names = "default";
80 pinctrl-0 = <&mac0_pins_a>;
81 phy-reset-gpios = <&gpio4 13 0>;
82 status = "okay";
83 };
84 };
85};
diff --git a/arch/arm/boot/dts/imx28-apf28dev.dts b/arch/arm/boot/dts/imx28-apf28dev.dts
new file mode 100644
index 000000000000..6d8865bfb4b7
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-apf28dev.dts
@@ -0,0 +1,154 @@
1/*
2 * Copyright 2012 Armadeus Systems - <support@armadeus.com>
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/* APF28Dev is a docking board for the APF28 SOM */
13/include/ "imx28-apf28.dts"
14
15/ {
16 model = "Armadeus Systems APF28Dev docking/development board";
17 compatible = "armadeus,imx28-apf28dev", "armadeus,imx28-apf28", "fsl,imx28";
18
19 apb@80000000 {
20 apbh@80000000 {
21 ssp0: ssp@80010000 {
22 compatible = "fsl,imx28-mmc";
23 pinctrl-names = "default";
24 pinctrl-0 = <&mmc0_4bit_pins_a
25 &mmc0_cd_cfg &mmc0_sck_cfg>;
26 bus-width = <4>;
27 status = "okay";
28 };
29
30 ssp2: ssp@80014000 {
31 compatible = "fsl,imx28-spi";
32 pinctrl-names = "default";
33 pinctrl-0 = <&spi2_pins_a>;
34 status = "okay";
35 };
36
37 pinctrl@80018000 {
38 pinctrl-names = "default";
39 pinctrl-0 = <&hog_pins_apf28dev>;
40
41 hog_pins_apf28dev: hog@0 {
42 reg = <0>;
43 fsl,pinmux-ids = <
44 0x1103 /* MX28_PAD_LCD_D16__GPIO_1_16 */
45 0x1113 /* MX28_PAD_LCD_D17__GPIO_1_17 */
46 0x1123 /* MX28_PAD_LCD_D18__GPIO_1_18 */
47 0x1133 /* MX28_PAD_LCD_D19__GPIO_1_19 */
48 0x1143 /* MX28_PAD_LCD_D20__GPIO_1_20 */
49 0x1153 /* MX28_PAD_LCD_D21__GPIO_1_21 */
50 0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */
51 >;
52 fsl,drive-strength = <0>;
53 fsl,voltage = <1>;
54 fsl,pull-up = <0>;
55 };
56
57 lcdif_pins_apf28dev: lcdif-apf28dev@0 {
58 reg = <0>;
59 fsl,pinmux-ids = <
60 0x1181 /* MX28_PAD_LCD_RD_E__LCD_VSYNC */
61 0x1191 /* MX28_PAD_LCD_WR_RWN__LCD_HSYNC */
62 0x11a1 /* MX28_PAD_LCD_RS__LCD_DOTCLK */
63 0x11b1 /* MX28_PAD_LCD_CS__LCD_ENABLE */
64 >;
65 fsl,drive-strength = <0>;
66 fsl,voltage = <1>;
67 fsl,pull-up = <0>;
68 };
69 };
70
71 lcdif@80030000 {
72 pinctrl-names = "default";
73 pinctrl-0 = <&lcdif_16bit_pins_a
74 &lcdif_pins_apf28dev>;
75 status = "okay";
76 };
77 };
78
79 apbx@80040000 {
80 lradc@80050000 {
81 status = "okay";
82 };
83
84 i2c0: i2c@80058000 {
85 pinctrl-names = "default";
86 pinctrl-0 = <&i2c0_pins_a>;
87 status = "okay";
88 };
89
90 pwm: pwm@80064000 {
91 pinctrl-names = "default";
92 pinctrl-0 = <&pwm3_pins_a &pwm4_pins_a>;
93 status = "okay";
94 };
95
96 usbphy0: usbphy@8007c000 {
97 status = "okay";
98 };
99
100 usbphy1: usbphy@8007e000 {
101 status = "okay";
102 };
103 };
104 };
105
106 ahb@80080000 {
107 usb0: usb@80080000 {
108 vbus-supply = <&reg_usb0_vbus>;
109 status = "okay";
110 };
111
112 usb1: usb@80090000 {
113 status = "okay";
114 };
115
116 mac1: ethernet@800f4000 {
117 phy-mode = "rmii";
118 pinctrl-names = "default";
119 pinctrl-0 = <&mac1_pins_a>;
120 phy-reset-gpios = <&gpio0 23 0>;
121 status = "okay";
122 };
123 };
124
125 regulators {
126 compatible = "simple-bus";
127
128 reg_usb0_vbus: usb0_vbus {
129 compatible = "regulator-fixed";
130 regulator-name = "usb0_vbus";
131 regulator-min-microvolt = <5000000>;
132 regulator-max-microvolt = <5000000>;
133 gpio = <&gpio1 23 1>;
134 };
135 };
136
137 leds {
138 compatible = "gpio-leds";
139
140 user {
141 label = "Heartbeat";
142 gpios = <&gpio0 21 0>;
143 linux,default-trigger = "heartbeat";
144 };
145 };
146
147 backlight {
148 compatible = "pwm-backlight";
149
150 pwms = <&pwm 3 191000>;
151 brightness-levels = <0 4 8 16 32 64 128 255>;
152 default-brightness-level = <6>;
153 };
154};
diff --git a/arch/arm/boot/dts/imx28-cfa10036.dts b/arch/arm/boot/dts/imx28-cfa10036.dts
index c03a577beca3..1594694532b9 100644
--- a/arch/arm/boot/dts/imx28-cfa10036.dts
+++ b/arch/arm/boot/dts/imx28-cfa10036.dts
@@ -22,6 +22,31 @@
22 22
23 apb@80000000 { 23 apb@80000000 {
24 apbh@80000000 { 24 apbh@80000000 {
25 pinctrl@80018000 {
26 pinctrl-names = "default";
27 pinctrl-0 = <&hog_pins_cfa10036>;
28
29 hog_pins_cfa10036: hog-10036@0 {
30 reg = <0>;
31 fsl,pinmux-ids = <
32 0x2073 /* MX28_PAD_SSP0_D7__GPIO_2_7 */
33 >;
34 fsl,drive-strength = <0>;
35 fsl,voltage = <1>;
36 fsl,pull-up = <0>;
37 };
38
39 led_pins_cfa10036: leds-10036@0 {
40 reg = <0>;
41 fsl,pinmux-ids = <
42 0x3043 /* MX28_PAD_AUART1_RX__GPIO_3_4 */
43 >;
44 fsl,drive-strength = <0>;
45 fsl,voltage = <1>;
46 fsl,pull-up = <0>;
47 };
48 };
49
25 ssp0: ssp@80010000 { 50 ssp0: ssp@80010000 {
26 compatible = "fsl,imx28-mmc"; 51 compatible = "fsl,imx28-mmc";
27 pinctrl-names = "default"; 52 pinctrl-names = "default";
@@ -33,16 +58,37 @@
33 }; 58 };
34 59
35 apbx@80040000 { 60 apbx@80040000 {
61 pwm: pwm@80064000 {
62 pinctrl-names = "default";
63 pinctrl-0 = <&pwm4_pins_a>;
64 status = "okay";
65 };
66
36 duart: serial@80074000 { 67 duart: serial@80074000 {
37 pinctrl-names = "default"; 68 pinctrl-names = "default";
38 pinctrl-0 = <&duart_pins_b>; 69 pinctrl-0 = <&duart_pins_b>;
39 status = "okay"; 70 status = "okay";
40 }; 71 };
72
73 i2c0: i2c@80058000 {
74 pinctrl-names = "default";
75 pinctrl-0 = <&i2c0_pins_b>;
76 status = "okay";
77
78 ssd1307: oled@3c {
79 compatible = "solomon,ssd1307fb-i2c";
80 reg = <0x3c>;
81 pwms = <&pwm 4 3000>;
82 reset-gpios = <&gpio2 7 0>;
83 };
84 };
41 }; 85 };
42 }; 86 };
43 87
44 leds { 88 leds {
45 compatible = "gpio-leds"; 89 compatible = "gpio-leds";
90 pinctrl-names = "default";
91 pinctrl-0 = <&led_pins_cfa10036>;
46 92
47 power { 93 power {
48 gpios = <&gpio3 4 1>; 94 gpios = <&gpio3 4 1>;
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index 05c892e931e3..b222614ac9e0 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -22,6 +22,22 @@
22 apb@80000000 { 22 apb@80000000 {
23 apbh@80000000 { 23 apbh@80000000 {
24 pinctrl@80018000 { 24 pinctrl@80018000 {
25 pinctrl-names = "default", "default";
26 pinctrl-1 = <&hog_pins_cfa10049>;
27
28 hog_pins_cfa10049: hog-10049@0 {
29 reg = <0>;
30 fsl,pinmux-ids = <
31 0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
32 0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */
33 0x1173 /* MX28_PAD_LCD_D22__GPIO_1_23 */
34 0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */
35 >;
36 fsl,drive-strength = <0>;
37 fsl,voltage = <1>;
38 fsl,pull-up = <0>;
39 };
40
25 spi3_pins_cfa10049: spi3-cfa10049@0 { 41 spi3_pins_cfa10049: spi3-cfa10049@0 {
26 reg = <0>; 42 reg = <0>;
27 fsl,pinmux-ids = < 43 fsl,pinmux-ids = <
@@ -29,6 +45,7 @@
29 0x01c1 /* MX28_PAD_GPMI_RESETN__SSP3_CMD */ 45 0x01c1 /* MX28_PAD_GPMI_RESETN__SSP3_CMD */
30 0x0111 /* MX28_PAD_GPMI_CE1N__SSP3_D3 */ 46 0x0111 /* MX28_PAD_GPMI_CE1N__SSP3_D3 */
31 0x01a2 /* MX28_PAD_GPMI_ALE__SSP3_D4 */ 47 0x01a2 /* MX28_PAD_GPMI_ALE__SSP3_D4 */
48 0x01b2 /* MX28_PAD_GPMI_CLE__SSP3_D5 */
32 >; 49 >;
33 fsl,drive-strength = <1>; 50 fsl,drive-strength = <1>;
34 fsl,voltage = <1>; 51 fsl,voltage = <1>;
@@ -60,6 +77,11 @@
60 spi-max-frequency = <100000>; 77 spi-max-frequency = <100000>;
61 }; 78 };
62 79
80 dac0: dh2228@2 {
81 compatible = "rohm,dh2228fv";
82 reg = <2>;
83 spi-max-frequency = <100000>;
84 };
63 }; 85 };
64 }; 86 };
65 87
@@ -96,4 +118,15 @@
96 gpio = <&gpio0 7 1>; 118 gpio = <&gpio0 7 1>;
97 }; 119 };
98 }; 120 };
121
122 ahb@80080000 {
123 mac0: ethernet@800f0000 {
124 phy-mode = "rmii";
125 pinctrl-names = "default";
126 pinctrl-0 = <&mac0_pins_a>;
127 phy-reset-gpios = <&gpio2 21 0>;
128 phy-reset-duration = <100>;
129 status = "okay";
130 };
131 };
99}; 132};
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index a0ad71ca3a44..2da316e04409 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -76,7 +76,6 @@
76 0x20c3 /* MX28_PAD_SSP1_SCK__GPIO_2_12 */ 76 0x20c3 /* MX28_PAD_SSP1_SCK__GPIO_2_12 */
77 0x31c3 /* MX28_PAD_PWM3__GPIO_3_28 */ 77 0x31c3 /* MX28_PAD_PWM3__GPIO_3_28 */
78 0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */ 78 0x31e3 /* MX28_PAD_LCD_RESET__GPIO_3_30 */
79 0x3053 /* MX28_PAD_AUART1_TX__GPIO_3_5 */
80 0x3083 /* MX28_PAD_AUART2_RX__GPIO_3_8 */ 79 0x3083 /* MX28_PAD_AUART2_RX__GPIO_3_8 */
81 0x3093 /* MX28_PAD_AUART2_TX__GPIO_3_9 */ 80 0x3093 /* MX28_PAD_AUART2_TX__GPIO_3_9 */
82 >; 81 >;
@@ -85,6 +84,16 @@
85 fsl,pull-up = <0>; 84 fsl,pull-up = <0>;
86 }; 85 };
87 86
87 led_pin_gpio3_5: led_gpio3_5@0 {
88 reg = <0>;
89 fsl,pinmux-ids = <
90 0x3053 /* MX28_PAD_AUART1_TX__GPIO_3_5 */
91 >;
92 fsl,drive-strength = <0>;
93 fsl,voltage = <1>;
94 fsl,pull-up = <0>;
95 };
96
88 gpmi_pins_evk: gpmi-nand-evk@0 { 97 gpmi_pins_evk: gpmi-nand-evk@0 {
89 reg = <0>; 98 reg = <0>;
90 fsl,pinmux-ids = < 99 fsl,pinmux-ids = <
@@ -288,6 +297,8 @@
288 297
289 leds { 298 leds {
290 compatible = "gpio-leds"; 299 compatible = "gpio-leds";
300 pinctrl-names = "default";
301 pinctrl-0 = <&led_pin_gpio3_5>;
291 302
292 user { 303 user {
293 label = "Heartbeat"; 304 label = "Heartbeat";
diff --git a/arch/arm/boot/dts/imx28-sps1.dts b/arch/arm/boot/dts/imx28-sps1.dts
new file mode 100644
index 000000000000..e6cde8aa7fff
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-sps1.dts
@@ -0,0 +1,169 @@
1/*
2 * Copyright (C) 2012 Marek Vasut <marex@denx.de>
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/dts-v1/;
13/include/ "imx28.dtsi"
14
15/ {
16 model = "SchulerControl GmbH, SC SPS 1";
17 compatible = "schulercontrol,imx28-sps1", "fsl,imx28";
18
19 memory {
20 reg = <0x40000000 0x08000000>;
21 };
22
23 apb@80000000 {
24 apbh@80000000 {
25 pinctrl@80018000 {
26 pinctrl-names = "default";
27 pinctrl-0 = <&hog_pins_a>;
28
29 hog_pins_a: hog-gpios@0 {
30 reg = <0>;
31 fsl,pinmux-ids = <
32 0x0003 /* MX28_PAD_GPMI_D00__GPIO_0_0 */
33 0x0033 /* MX28_PAD_GPMI_D03__GPIO_0_3 */
34 0x0063 /* MX28_PAD_GPMI_D06__GPIO_0_6 */
35 >;
36 fsl,drive-strength = <0>;
37 fsl,voltage = <1>;
38 fsl,pull-up = <0>;
39 };
40
41 };
42
43 ssp0: ssp@80010000 {
44 compatible = "fsl,imx28-mmc";
45 pinctrl-names = "default";
46 pinctrl-0 = <&mmc0_4bit_pins_a>;
47 bus-width = <4>;
48 status = "okay";
49 };
50
51 ssp2: ssp@80014000 {
52 #address-cells = <1>;
53 #size-cells = <0>;
54 compatible = "fsl,imx28-spi";
55 pinctrl-names = "default";
56 pinctrl-0 = <&spi2_pins_a>;
57 status = "okay";
58
59 flash: m25p80@0 {
60 #address-cells = <1>;
61 #size-cells = <1>;
62 compatible = "everspin,mr25h256", "mr25h256";
63 spi-max-frequency = <40000000>;
64 reg = <0>;
65 };
66 };
67 };
68
69 apbx@80040000 {
70 i2c0: i2c@80058000 {
71 pinctrl-names = "default";
72 pinctrl-0 = <&i2c0_pins_a>;
73 clock-frequency = <400000>;
74 status = "okay";
75
76 rtc: rtc@51 {
77 compatible = "nxp,pcf8563";
78 reg = <0x51>;
79 };
80
81 eeprom: eeprom@52 {
82 compatible = "atmel,24c64";
83 reg = <0x52>;
84 pagesize = <32>;
85 };
86 };
87
88 duart: serial@80074000 {
89 pinctrl-names = "default";
90 pinctrl-0 = <&duart_pins_a>;
91 status = "okay";
92 };
93
94 usbphy0: usbphy@8007c000 {
95 status = "okay";
96 };
97
98 auart0: serial@8006a000 {
99 pinctrl-names = "default";
100 pinctrl-0 = <&auart0_pins_a>;
101 status = "okay";
102 };
103 };
104 };
105
106 ahb@80080000 {
107 usb0: usb@80080000 {
108 vbus-supply = <&reg_usb0_vbus>;
109 pinctrl-names = "default";
110 pinctrl-0 = <&usbphy0_pins_b>;
111 status = "okay";
112 };
113
114 mac0: ethernet@800f0000 {
115 phy-mode = "rmii";
116 pinctrl-names = "default";
117 pinctrl-0 = <&mac0_pins_a>;
118 status = "okay";
119 };
120
121 mac1: ethernet@800f4000 {
122 phy-mode = "rmii";
123 pinctrl-names = "default";
124 pinctrl-0 = <&mac1_pins_a>;
125 status = "okay";
126 };
127 };
128
129 regulators {
130 compatible = "simple-bus";
131
132 reg_usb0_vbus: usb0_vbus {
133 compatible = "regulator-fixed";
134 regulator-name = "usb0_vbus";
135 regulator-min-microvolt = <5000000>;
136 regulator-max-microvolt = <5000000>;
137 gpio = <&gpio3 9 0>;
138 };
139 };
140
141 leds {
142 #address-cells = <1>;
143 #size-cells = <0>;
144 compatible = "gpio-leds";
145 status = "okay";
146
147 led@1 {
148 label = "sps1-1:yellow:user";
149 gpios = <&gpio0 6 0>;
150 linux,default-trigger = "heartbeat";
151 reg = <0>;
152 };
153
154 led@2 {
155 label = "sps1-2:red:user";
156 gpios = <&gpio0 3 0>;
157 linux,default-trigger = "heartbeat";
158 reg = <1>;
159 };
160
161 led@3 {
162 label = "sps1-3:red:user";
163 gpios = <&gpio0 0 0>;
164 default-trigger = "heartbeat";
165 reg = <2>;
166 };
167
168 };
169};
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 55c57ea6169e..d7013f73f2e9 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -492,6 +492,16 @@
492 fsl,pull-up = <0>; 492 fsl,pull-up = <0>;
493 }; 493 };
494 494
495 pwm3_pins_a: pwm3@0 {
496 reg = <0>;
497 fsl,pinmux-ids = <
498 0x31c0 /* MX28_PAD_PWM3__PWM_3 */
499 >;
500 fsl,drive-strength = <0>;
501 fsl,voltage = <1>;
502 fsl,pull-up = <0>;
503 };
504
495 pwm4_pins_a: pwm4@0 { 505 pwm4_pins_a: pwm4@0 {
496 reg = <0>; 506 reg = <0>;
497 fsl,pinmux-ids = < 507 fsl,pinmux-ids = <
@@ -535,6 +545,31 @@
535 fsl,pull-up = <0>; 545 fsl,pull-up = <0>;
536 }; 546 };
537 547
548 lcdif_16bit_pins_a: lcdif-16bit@0 {
549 reg = <0>;
550 fsl,pinmux-ids = <
551 0x1000 /* MX28_PAD_LCD_D00__LCD_D0 */
552 0x1010 /* MX28_PAD_LCD_D01__LCD_D1 */
553 0x1020 /* MX28_PAD_LCD_D02__LCD_D2 */
554 0x1030 /* MX28_PAD_LCD_D03__LCD_D3 */
555 0x1040 /* MX28_PAD_LCD_D04__LCD_D4 */
556 0x1050 /* MX28_PAD_LCD_D05__LCD_D5 */
557 0x1060 /* MX28_PAD_LCD_D06__LCD_D6 */
558 0x1070 /* MX28_PAD_LCD_D07__LCD_D7 */
559 0x1080 /* MX28_PAD_LCD_D08__LCD_D8 */
560 0x1090 /* MX28_PAD_LCD_D09__LCD_D9 */
561 0x10a0 /* MX28_PAD_LCD_D10__LCD_D10 */
562 0x10b0 /* MX28_PAD_LCD_D11__LCD_D11 */
563 0x10c0 /* MX28_PAD_LCD_D12__LCD_D12 */
564 0x10d0 /* MX28_PAD_LCD_D13__LCD_D13 */
565 0x10e0 /* MX28_PAD_LCD_D14__LCD_D14 */
566 0x10f0 /* MX28_PAD_LCD_D15__LCD_D15 */
567 >;
568 fsl,drive-strength = <0>;
569 fsl,voltage = <1>;
570 fsl,pull-up = <0>;
571 };
572
538 can0_pins_a: can0@0 { 573 can0_pins_a: can0@0 {
539 reg = <0>; 574 reg = <0>;
540 fsl,pinmux-ids = < 575 fsl,pinmux-ids = <
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 75d069fcf897..1fdee31b4909 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -76,17 +76,18 @@
76 reg = <0x70000000 0x40000>; 76 reg = <0x70000000 0x40000>;
77 ranges; 77 ranges;
78 78
79 esdhc@70004000 { /* ESDHC1 */ 79 esdhc1: esdhc@70004000 {
80 compatible = "fsl,imx51-esdhc"; 80 compatible = "fsl,imx51-esdhc";
81 reg = <0x70004000 0x4000>; 81 reg = <0x70004000 0x4000>;
82 interrupts = <1>; 82 interrupts = <1>;
83 status = "disabled"; 83 status = "disabled";
84 }; 84 };
85 85
86 esdhc@70008000 { /* ESDHC2 */ 86 esdhc2: esdhc@70008000 {
87 compatible = "fsl,imx51-esdhc"; 87 compatible = "fsl,imx51-esdhc";
88 reg = <0x70008000 0x4000>; 88 reg = <0x70008000 0x4000>;
89 interrupts = <2>; 89 interrupts = <2>;
90 bus-width = <4>;
90 status = "disabled"; 91 status = "disabled";
91 }; 92 };
92 93
@@ -97,7 +98,7 @@
97 status = "disabled"; 98 status = "disabled";
98 }; 99 };
99 100
100 ecspi@70010000 { /* ECSPI1 */ 101 ecspi1: ecspi@70010000 {
101 #address-cells = <1>; 102 #address-cells = <1>;
102 #size-cells = <0>; 103 #size-cells = <0>;
103 compatible = "fsl,imx51-ecspi"; 104 compatible = "fsl,imx51-ecspi";
@@ -115,43 +116,45 @@
115 status = "disabled"; 116 status = "disabled";
116 }; 117 };
117 118
118 esdhc@70020000 { /* ESDHC3 */ 119 esdhc3: esdhc@70020000 {
119 compatible = "fsl,imx51-esdhc"; 120 compatible = "fsl,imx51-esdhc";
120 reg = <0x70020000 0x4000>; 121 reg = <0x70020000 0x4000>;
121 interrupts = <3>; 122 interrupts = <3>;
123 bus-width = <4>;
122 status = "disabled"; 124 status = "disabled";
123 }; 125 };
124 126
125 esdhc@70024000 { /* ESDHC4 */ 127 esdhc4: esdhc@70024000 {
126 compatible = "fsl,imx51-esdhc"; 128 compatible = "fsl,imx51-esdhc";
127 reg = <0x70024000 0x4000>; 129 reg = <0x70024000 0x4000>;
128 interrupts = <4>; 130 interrupts = <4>;
131 bus-width = <4>;
129 status = "disabled"; 132 status = "disabled";
130 }; 133 };
131 }; 134 };
132 135
133 usb@73f80000 { 136 usbotg: usb@73f80000 {
134 compatible = "fsl,imx51-usb", "fsl,imx27-usb"; 137 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
135 reg = <0x73f80000 0x0200>; 138 reg = <0x73f80000 0x0200>;
136 interrupts = <18>; 139 interrupts = <18>;
137 status = "disabled"; 140 status = "disabled";
138 }; 141 };
139 142
140 usb@73f80200 { 143 usbh1: usb@73f80200 {
141 compatible = "fsl,imx51-usb", "fsl,imx27-usb"; 144 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
142 reg = <0x73f80200 0x0200>; 145 reg = <0x73f80200 0x0200>;
143 interrupts = <14>; 146 interrupts = <14>;
144 status = "disabled"; 147 status = "disabled";
145 }; 148 };
146 149
147 usb@73f80400 { 150 usbh2: usb@73f80400 {
148 compatible = "fsl,imx51-usb", "fsl,imx27-usb"; 151 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
149 reg = <0x73f80400 0x0200>; 152 reg = <0x73f80400 0x0200>;
150 interrupts = <16>; 153 interrupts = <16>;
151 status = "disabled"; 154 status = "disabled";
152 }; 155 };
153 156
154 usb@73f80600 { 157 usbh3: usb@73f80600 {
155 compatible = "fsl,imx51-usb", "fsl,imx27-usb"; 158 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
156 reg = <0x73f80600 0x0200>; 159 reg = <0x73f80600 0x0200>;
157 interrupts = <17>; 160 interrupts = <17>;
@@ -198,20 +201,20 @@
198 #interrupt-cells = <2>; 201 #interrupt-cells = <2>;
199 }; 202 };
200 203
201 wdog@73f98000 { /* WDOG1 */ 204 wdog1: wdog@73f98000 {
202 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; 205 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt";
203 reg = <0x73f98000 0x4000>; 206 reg = <0x73f98000 0x4000>;
204 interrupts = <58>; 207 interrupts = <58>;
205 }; 208 };
206 209
207 wdog@73f9c000 { /* WDOG2 */ 210 wdog2: wdog@73f9c000 {
208 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; 211 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt";
209 reg = <0x73f9c000 0x4000>; 212 reg = <0x73f9c000 0x4000>;
210 interrupts = <59>; 213 interrupts = <59>;
211 status = "disabled"; 214 status = "disabled";
212 }; 215 };
213 216
214 iomuxc@73fa8000 { 217 iomuxc: iomuxc@73fa8000 {
215 compatible = "fsl,imx51-iomuxc"; 218 compatible = "fsl,imx51-iomuxc";
216 reg = <0x73fa8000 0x4000>; 219 reg = <0x73fa8000 0x4000>;
217 220
@@ -349,7 +352,7 @@
349 reg = <0x80000000 0x10000000>; 352 reg = <0x80000000 0x10000000>;
350 ranges; 353 ranges;
351 354
352 ecspi@83fac000 { /* ECSPI2 */ 355 ecspi2: ecspi@83fac000 {
353 #address-cells = <1>; 356 #address-cells = <1>;
354 #size-cells = <0>; 357 #size-cells = <0>;
355 compatible = "fsl,imx51-ecspi"; 358 compatible = "fsl,imx51-ecspi";
@@ -358,14 +361,14 @@
358 status = "disabled"; 361 status = "disabled";
359 }; 362 };
360 363
361 sdma@83fb0000 { 364 sdma: sdma@83fb0000 {
362 compatible = "fsl,imx51-sdma", "fsl,imx35-sdma"; 365 compatible = "fsl,imx51-sdma", "fsl,imx35-sdma";
363 reg = <0x83fb0000 0x4000>; 366 reg = <0x83fb0000 0x4000>;
364 interrupts = <6>; 367 interrupts = <6>;
365 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx51.bin"; 368 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx51.bin";
366 }; 369 };
367 370
368 cspi@83fc0000 { 371 cspi: cspi@83fc0000 {
369 #address-cells = <1>; 372 #address-cells = <1>;
370 #size-cells = <0>; 373 #size-cells = <0>;
371 compatible = "fsl,imx51-cspi", "fsl,imx35-cspi"; 374 compatible = "fsl,imx51-cspi", "fsl,imx35-cspi";
@@ -374,19 +377,19 @@
374 status = "disabled"; 377 status = "disabled";
375 }; 378 };
376 379
377 i2c@83fc4000 { /* I2C2 */ 380 i2c2: i2c@83fc4000 {
378 #address-cells = <1>; 381 #address-cells = <1>;
379 #size-cells = <0>; 382 #size-cells = <0>;
380 compatible = "fsl,imx51-i2c", "fsl,imx1-i2c"; 383 compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
381 reg = <0x83fc4000 0x4000>; 384 reg = <0x83fc4000 0x4000>;
382 interrupts = <63>; 385 interrupts = <63>;
383 status = "disabled"; 386 status = "disabled";
384 }; 387 };
385 388
386 i2c@83fc8000 { /* I2C1 */ 389 i2c1: i2c@83fc8000 {
387 #address-cells = <1>; 390 #address-cells = <1>;
388 #size-cells = <0>; 391 #size-cells = <0>;
389 compatible = "fsl,imx51-i2c", "fsl,imx1-i2c"; 392 compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
390 reg = <0x83fc8000 0x4000>; 393 reg = <0x83fc8000 0x4000>;
391 interrupts = <62>; 394 interrupts = <62>;
392 status = "disabled"; 395 status = "disabled";
@@ -401,13 +404,13 @@
401 status = "disabled"; 404 status = "disabled";
402 }; 405 };
403 406
404 audmux@83fd0000 { 407 audmux: audmux@83fd0000 {
405 compatible = "fsl,imx51-audmux", "fsl,imx31-audmux"; 408 compatible = "fsl,imx51-audmux", "fsl,imx31-audmux";
406 reg = <0x83fd0000 0x4000>; 409 reg = <0x83fd0000 0x4000>;
407 status = "disabled"; 410 status = "disabled";
408 }; 411 };
409 412
410 nand@83fdb000 { 413 nfc: nand@83fdb000 {
411 compatible = "fsl,imx51-nand"; 414 compatible = "fsl,imx51-nand";
412 reg = <0x83fdb000 0x1000 0xcfff0000 0x10000>; 415 reg = <0x83fdb000 0x1000 0xcfff0000 0x10000>;
413 interrupts = <8>; 416 interrupts = <8>;
@@ -423,7 +426,7 @@
423 status = "disabled"; 426 status = "disabled";
424 }; 427 };
425 428
426 ethernet@83fec000 { 429 fec: ethernet@83fec000 {
427 compatible = "fsl,imx51-fec", "fsl,imx27-fec"; 430 compatible = "fsl,imx51-fec", "fsl,imx27-fec";
428 reg = <0x83fec000 0x4000>; 431 reg = <0x83fec000 0x4000>;
429 interrupts = <87>; 432 interrupts = <87>;
diff --git a/arch/arm/boot/dts/imx53-qsb.dts b/arch/arm/boot/dts/imx53-qsb.dts
index 08948af86d1a..b0075537195b 100644
--- a/arch/arm/boot/dts/imx53-qsb.dts
+++ b/arch/arm/boot/dts/imx53-qsb.dts
@@ -60,10 +60,17 @@
60 697 0x80000000 /* MX53_PAD_EIM_DA12__GPIO3_12 */ 60 697 0x80000000 /* MX53_PAD_EIM_DA12__GPIO3_12 */
61 701 0x80000000 /* MX53_PAD_EIM_DA13__GPIO3_13 */ 61 701 0x80000000 /* MX53_PAD_EIM_DA13__GPIO3_13 */
62 868 0x80000000 /* MX53_PAD_PATA_DA_0__GPIO7_6 */ 62 868 0x80000000 /* MX53_PAD_PATA_DA_0__GPIO7_6 */
63 1149 0x80000000 /* MX53_PAD_GPIO_16__GPIO7_11 */
64 >;
65 };
66
67 led_pin_gpio7_7: led_gpio7_7@0 {
68 fsl,pins = <
63 873 0x80000000 /* MX53_PAD_PATA_DA_1__GPIO7_7 */ 69 873 0x80000000 /* MX53_PAD_PATA_DA_1__GPIO7_7 */
64 >; 70 >;
65 }; 71 };
66 }; 72 };
73
67 }; 74 };
68 75
69 uart1: serial@53fbc000 { 76 uart1: serial@53fbc000 {
@@ -100,76 +107,93 @@
100 pmic: dialog@48 { 107 pmic: dialog@48 {
101 compatible = "dlg,da9053-aa", "dlg,da9052"; 108 compatible = "dlg,da9053-aa", "dlg,da9052";
102 reg = <0x48>; 109 reg = <0x48>;
110 interrupt-parent = <&gpio7>;
111 interrupts = <11 0x8>; /* low-level active IRQ at GPIO7_11 */
103 112
104 regulators { 113 regulators {
105 buck0 { 114 buck1_reg: buck1 {
106 regulator-min-microvolt = <500000>; 115 regulator-min-microvolt = <500000>;
107 regulator-max-microvolt = <2075000>; 116 regulator-max-microvolt = <2075000>;
117 regulator-always-on;
108 }; 118 };
109 119
110 buck1 { 120 buck2_reg: buck2 {
111 regulator-min-microvolt = <500000>; 121 regulator-min-microvolt = <500000>;
112 regulator-max-microvolt = <2075000>; 122 regulator-max-microvolt = <2075000>;
123 regulator-always-on;
113 }; 124 };
114 125
115 buck2 { 126 buck3_reg: buck3 {
116 regulator-min-microvolt = <925000>; 127 regulator-min-microvolt = <925000>;
117 regulator-max-microvolt = <2500000>; 128 regulator-max-microvolt = <2500000>;
129 regulator-always-on;
118 }; 130 };
119 131
120 buck3 { 132 buck4_reg: buck4 {
121 regulator-min-microvolt = <925000>; 133 regulator-min-microvolt = <925000>;
122 regulator-max-microvolt = <2500000>; 134 regulator-max-microvolt = <2500000>;
135 regulator-always-on;
123 }; 136 };
124 137
125 ldo4 { 138 ldo1_reg: ldo1 {
126 regulator-min-microvolt = <600000>; 139 regulator-min-microvolt = <600000>;
127 regulator-max-microvolt = <1800000>; 140 regulator-max-microvolt = <1800000>;
141 regulator-boot-on;
142 regulator-always-on;
128 }; 143 };
129 144
130 ldo5 { 145 ldo2_reg: ldo2 {
146 regulator-min-microvolt = <600000>;
147 regulator-max-microvolt = <1800000>;
148 regulator-always-on;
149 };
150
151 ldo3_reg: ldo3 {
131 regulator-min-microvolt = <600000>; 152 regulator-min-microvolt = <600000>;
132 regulator-max-microvolt = <1800000>; 153 regulator-max-microvolt = <1800000>;
154 regulator-always-on;
133 }; 155 };
134 156
135 ldo6 { 157 ldo4_reg: ldo4 {
136 regulator-min-microvolt = <1725000>; 158 regulator-min-microvolt = <1725000>;
137 regulator-max-microvolt = <3300000>; 159 regulator-max-microvolt = <3300000>;
160 regulator-always-on;
138 }; 161 };
139 162
140 ldo7 { 163 ldo5_reg: ldo5 {
141 regulator-min-microvolt = <1725000>; 164 regulator-min-microvolt = <1725000>;
142 regulator-max-microvolt = <3300000>; 165 regulator-max-microvolt = <3300000>;
166 regulator-always-on;
143 }; 167 };
144 168
145 ldo8 { 169 ldo6_reg: ldo6 {
146 regulator-min-microvolt = <1200000>; 170 regulator-min-microvolt = <1200000>;
147 regulator-max-microvolt = <3600000>; 171 regulator-max-microvolt = <3600000>;
172 regulator-always-on;
148 }; 173 };
149 174
150 ldo9 { 175 ldo7_reg: ldo7 {
151 regulator-min-microvolt = <1200000>; 176 regulator-min-microvolt = <1200000>;
152 regulator-max-microvolt = <3600000>; 177 regulator-max-microvolt = <3600000>;
178 regulator-always-on;
153 }; 179 };
154 180
155 ldo10 { 181 ldo8_reg: ldo8 {
156 regulator-min-microvolt = <1200000>; 182 regulator-min-microvolt = <1200000>;
157 regulator-max-microvolt = <3600000>; 183 regulator-max-microvolt = <3600000>;
184 regulator-always-on;
158 }; 185 };
159 186
160 ldo11 { 187 ldo9_reg: ldo9 {
161 regulator-min-microvolt = <1200000>; 188 regulator-min-microvolt = <1200000>;
162 regulator-max-microvolt = <3600000>; 189 regulator-max-microvolt = <3600000>;
190 regulator-always-on;
163 }; 191 };
164 192
165 ldo12 { 193 ldo10_reg: ldo10 {
166 regulator-min-microvolt = <1250000>; 194 regulator-min-microvolt = <1250000>;
167 regulator-max-microvolt = <3650000>; 195 regulator-max-microvolt = <3650000>;
168 }; 196 regulator-always-on;
169
170 ldo13 {
171 regulator-min-microvolt = <1200000>;
172 regulator-max-microvolt = <3600000>;
173 }; 197 };
174 }; 198 };
175 }; 199 };
@@ -216,6 +240,8 @@
216 240
217 leds { 241 leds {
218 compatible = "gpio-leds"; 242 compatible = "gpio-leds";
243 pinctrl-names = "default";
244 pinctrl-0 = <&led_pin_gpio7_7>;
219 245
220 user { 246 user {
221 label = "Heartbeat"; 247 label = "Heartbeat";
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index 76ebb1ad2675..f45d4b1e21b5 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -81,17 +81,19 @@
81 reg = <0x50000000 0x40000>; 81 reg = <0x50000000 0x40000>;
82 ranges; 82 ranges;
83 83
84 esdhc@50004000 { /* ESDHC1 */ 84 esdhc1: esdhc@50004000 {
85 compatible = "fsl,imx53-esdhc"; 85 compatible = "fsl,imx53-esdhc";
86 reg = <0x50004000 0x4000>; 86 reg = <0x50004000 0x4000>;
87 interrupts = <1>; 87 interrupts = <1>;
88 bus-width = <4>;
88 status = "disabled"; 89 status = "disabled";
89 }; 90 };
90 91
91 esdhc@50008000 { /* ESDHC2 */ 92 esdhc2: esdhc@50008000 {
92 compatible = "fsl,imx53-esdhc"; 93 compatible = "fsl,imx53-esdhc";
93 reg = <0x50008000 0x4000>; 94 reg = <0x50008000 0x4000>;
94 interrupts = <2>; 95 interrupts = <2>;
96 bus-width = <4>;
95 status = "disabled"; 97 status = "disabled";
96 }; 98 };
97 99
@@ -102,7 +104,7 @@
102 status = "disabled"; 104 status = "disabled";
103 }; 105 };
104 106
105 ecspi@50010000 { /* ECSPI1 */ 107 ecspi1: ecspi@50010000 {
106 #address-cells = <1>; 108 #address-cells = <1>;
107 #size-cells = <0>; 109 #size-cells = <0>;
108 compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi"; 110 compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi";
@@ -120,43 +122,45 @@
120 status = "disabled"; 122 status = "disabled";
121 }; 123 };
122 124
123 esdhc@50020000 { /* ESDHC3 */ 125 esdhc3: esdhc@50020000 {
124 compatible = "fsl,imx53-esdhc"; 126 compatible = "fsl,imx53-esdhc";
125 reg = <0x50020000 0x4000>; 127 reg = <0x50020000 0x4000>;
126 interrupts = <3>; 128 interrupts = <3>;
129 bus-width = <4>;
127 status = "disabled"; 130 status = "disabled";
128 }; 131 };
129 132
130 esdhc@50024000 { /* ESDHC4 */ 133 esdhc4: esdhc@50024000 {
131 compatible = "fsl,imx53-esdhc"; 134 compatible = "fsl,imx53-esdhc";
132 reg = <0x50024000 0x4000>; 135 reg = <0x50024000 0x4000>;
133 interrupts = <4>; 136 interrupts = <4>;
137 bus-width = <4>;
134 status = "disabled"; 138 status = "disabled";
135 }; 139 };
136 }; 140 };
137 141
138 usb@53f80000 { 142 usbotg: usb@53f80000 {
139 compatible = "fsl,imx53-usb", "fsl,imx27-usb"; 143 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
140 reg = <0x53f80000 0x0200>; 144 reg = <0x53f80000 0x0200>;
141 interrupts = <18>; 145 interrupts = <18>;
142 status = "disabled"; 146 status = "disabled";
143 }; 147 };
144 148
145 usb@53f80200 { 149 usbh1: usb@53f80200 {
146 compatible = "fsl,imx53-usb", "fsl,imx27-usb"; 150 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
147 reg = <0x53f80200 0x0200>; 151 reg = <0x53f80200 0x0200>;
148 interrupts = <14>; 152 interrupts = <14>;
149 status = "disabled"; 153 status = "disabled";
150 }; 154 };
151 155
152 usb@53f80400 { 156 usbh2: usb@53f80400 {
153 compatible = "fsl,imx53-usb", "fsl,imx27-usb"; 157 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
154 reg = <0x53f80400 0x0200>; 158 reg = <0x53f80400 0x0200>;
155 interrupts = <16>; 159 interrupts = <16>;
156 status = "disabled"; 160 status = "disabled";
157 }; 161 };
158 162
159 usb@53f80600 { 163 usbh3: usb@53f80600 {
160 compatible = "fsl,imx53-usb", "fsl,imx27-usb"; 164 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
161 reg = <0x53f80600 0x0200>; 165 reg = <0x53f80600 0x0200>;
162 interrupts = <17>; 166 interrupts = <17>;
@@ -203,20 +207,20 @@
203 #interrupt-cells = <2>; 207 #interrupt-cells = <2>;
204 }; 208 };
205 209
206 wdog@53f98000 { /* WDOG1 */ 210 wdog1: wdog@53f98000 {
207 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt"; 211 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt";
208 reg = <0x53f98000 0x4000>; 212 reg = <0x53f98000 0x4000>;
209 interrupts = <58>; 213 interrupts = <58>;
210 }; 214 };
211 215
212 wdog@53f9c000 { /* WDOG2 */ 216 wdog2: wdog@53f9c000 {
213 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt"; 217 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt";
214 reg = <0x53f9c000 0x4000>; 218 reg = <0x53f9c000 0x4000>;
215 interrupts = <59>; 219 interrupts = <59>;
216 status = "disabled"; 220 status = "disabled";
217 }; 221 };
218 222
219 iomuxc@53fa8000 { 223 iomuxc: iomuxc@53fa8000 {
220 compatible = "fsl,imx53-iomuxc"; 224 compatible = "fsl,imx53-iomuxc";
221 reg = <0x53fa8000 0x4000>; 225 reg = <0x53fa8000 0x4000>;
222 226
@@ -316,6 +320,24 @@
316 }; 320 };
317 }; 321 };
318 322
323 can1 {
324 pinctrl_can1_1: can1grp-1 {
325 fsl,pins = <
326 847 0x80000000 /* MX53_PAD_PATA_INTRQ__CAN1_TXCAN */
327 853 0x80000000 /* MX53_PAD_PATA_DIOR__CAN1_RXCAN */
328 >;
329 };
330 };
331
332 can2 {
333 pinctrl_can2_1: can2grp-1 {
334 fsl,pins = <
335 67 0x80000000 /* MX53_PAD_KEY_COL4__CAN2_TXCAN */
336 74 0x80000000 /* MX53_PAD_KEY_ROW4__CAN2_RXCAN */
337 >;
338 };
339 };
340
319 i2c1 { 341 i2c1 {
320 pinctrl_i2c1_1: i2c1grp-1 { 342 pinctrl_i2c1_1: i2c1grp-1 {
321 fsl,pins = < 343 fsl,pins = <
@@ -334,6 +356,15 @@
334 }; 356 };
335 }; 357 };
336 358
359 i2c3 {
360 pinctrl_i2c3_1: i2c3grp-1 {
361 fsl,pins = <
362 1102 0xc0000000 /* MX53_PAD_GPIO_6__I2C3_SDA */
363 1130 0xc0000000 /* MX53_PAD_GPIO_5__I2C3_SCL */
364 >;
365 };
366 };
367
337 uart1 { 368 uart1 {
338 pinctrl_uart1_1: uart1grp-1 { 369 pinctrl_uart1_1: uart1grp-1 {
339 fsl,pins = < 370 fsl,pins = <
@@ -369,6 +400,25 @@
369 >; 400 >;
370 }; 401 };
371 }; 402 };
403
404 uart4 {
405 pinctrl_uart4_1: uart4grp-1 {
406 fsl,pins = <
407 11 0x1c5 /* MX53_PAD_KEY_COL0__UART4_TXD_MUX */
408 18 0x1c5 /* MX53_PAD_KEY_ROW0__UART4_RXD_MUX */
409 >;
410 };
411 };
412
413 uart5 {
414 pinctrl_uart5_1: uart5grp-1 {
415 fsl,pins = <
416 24 0x1c5 /* MX53_PAD_KEY_COL1__UART5_TXD_MUX */
417 31 0x1c5 /* MX53_PAD_KEY_ROW1__UART5_RXD_MUX */
418 >;
419 };
420 };
421
372 }; 422 };
373 423
374 uart1: serial@53fbc000 { 424 uart1: serial@53fbc000 {
@@ -429,10 +479,10 @@
429 #interrupt-cells = <2>; 479 #interrupt-cells = <2>;
430 }; 480 };
431 481
432 i2c@53fec000 { /* I2C3 */ 482 i2c3: i2c@53fec000 {
433 #address-cells = <1>; 483 #address-cells = <1>;
434 #size-cells = <0>; 484 #size-cells = <0>;
435 compatible = "fsl,imx53-i2c", "fsl,imx1-i2c"; 485 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
436 reg = <0x53fec000 0x4000>; 486 reg = <0x53fec000 0x4000>;
437 interrupts = <64>; 487 interrupts = <64>;
438 status = "disabled"; 488 status = "disabled";
@@ -460,7 +510,7 @@
460 status = "disabled"; 510 status = "disabled";
461 }; 511 };
462 512
463 ecspi@63fac000 { /* ECSPI2 */ 513 ecspi2: ecspi@63fac000 {
464 #address-cells = <1>; 514 #address-cells = <1>;
465 #size-cells = <0>; 515 #size-cells = <0>;
466 compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi"; 516 compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi";
@@ -469,14 +519,14 @@
469 status = "disabled"; 519 status = "disabled";
470 }; 520 };
471 521
472 sdma@63fb0000 { 522 sdma: sdma@63fb0000 {
473 compatible = "fsl,imx53-sdma", "fsl,imx35-sdma"; 523 compatible = "fsl,imx53-sdma", "fsl,imx35-sdma";
474 reg = <0x63fb0000 0x4000>; 524 reg = <0x63fb0000 0x4000>;
475 interrupts = <6>; 525 interrupts = <6>;
476 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin"; 526 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
477 }; 527 };
478 528
479 cspi@63fc0000 { 529 cspi: cspi@63fc0000 {
480 #address-cells = <1>; 530 #address-cells = <1>;
481 #size-cells = <0>; 531 #size-cells = <0>;
482 compatible = "fsl,imx53-cspi", "fsl,imx35-cspi"; 532 compatible = "fsl,imx53-cspi", "fsl,imx35-cspi";
@@ -485,19 +535,19 @@
485 status = "disabled"; 535 status = "disabled";
486 }; 536 };
487 537
488 i2c@63fc4000 { /* I2C2 */ 538 i2c2: i2c@63fc4000 {
489 #address-cells = <1>; 539 #address-cells = <1>;
490 #size-cells = <0>; 540 #size-cells = <0>;
491 compatible = "fsl,imx53-i2c", "fsl,imx1-i2c"; 541 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
492 reg = <0x63fc4000 0x4000>; 542 reg = <0x63fc4000 0x4000>;
493 interrupts = <63>; 543 interrupts = <63>;
494 status = "disabled"; 544 status = "disabled";
495 }; 545 };
496 546
497 i2c@63fc8000 { /* I2C1 */ 547 i2c1: i2c@63fc8000 {
498 #address-cells = <1>; 548 #address-cells = <1>;
499 #size-cells = <0>; 549 #size-cells = <0>;
500 compatible = "fsl,imx53-i2c", "fsl,imx1-i2c"; 550 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
501 reg = <0x63fc8000 0x4000>; 551 reg = <0x63fc8000 0x4000>;
502 interrupts = <62>; 552 interrupts = <62>;
503 status = "disabled"; 553 status = "disabled";
@@ -512,13 +562,13 @@
512 status = "disabled"; 562 status = "disabled";
513 }; 563 };
514 564
515 audmux@63fd0000 { 565 audmux: audmux@63fd0000 {
516 compatible = "fsl,imx53-audmux", "fsl,imx31-audmux"; 566 compatible = "fsl,imx53-audmux", "fsl,imx31-audmux";
517 reg = <0x63fd0000 0x4000>; 567 reg = <0x63fd0000 0x4000>;
518 status = "disabled"; 568 status = "disabled";
519 }; 569 };
520 570
521 nand@63fdb000 { 571 nfc: nand@63fdb000 {
522 compatible = "fsl,imx53-nand"; 572 compatible = "fsl,imx53-nand";
523 reg = <0x63fdb000 0x1000 0xf7ff0000 0x10000>; 573 reg = <0x63fdb000 0x1000 0xf7ff0000 0x10000>;
524 interrupts = <8>; 574 interrupts = <8>;
@@ -534,7 +584,7 @@
534 status = "disabled"; 584 status = "disabled";
535 }; 585 };
536 586
537 ethernet@63fec000 { 587 fec: ethernet@63fec000 {
538 compatible = "fsl,imx53-fec", "fsl,imx25-fec"; 588 compatible = "fsl,imx53-fec", "fsl,imx25-fec";
539 reg = <0x63fec000 0x4000>; 589 reg = <0x63fec000 0x4000>;
540 interrupts = <87>; 590 interrupts = <87>;
diff --git a/arch/arm/boot/dts/imx6q-sabreauto.dts b/arch/arm/boot/dts/imx6q-sabreauto.dts
new file mode 100644
index 000000000000..826e4ad1477e
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-sabreauto.dts
@@ -0,0 +1,64 @@
1/*
2 * Copyright 2012 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13/dts-v1/;
14/include/ "imx6q.dtsi"
15
16/ {
17 model = "Freescale i.MX6 Quad SABRE Automotive Board";
18 compatible = "fsl,imx6q-sabreauto", "fsl,imx6q";
19
20 memory {
21 reg = <0x10000000 0x80000000>;
22 };
23
24 soc {
25 aips-bus@02000000 { /* AIPS1 */
26 iomuxc@020e0000 {
27 pinctrl-names = "default";
28 pinctrl-0 = <&pinctrl_hog>;
29
30 hog {
31 pinctrl_hog: hoggrp {
32 fsl,pins = <
33 1376 0x80000000 /* MX6Q_PAD_NANDF_CS2__GPIO_6_15 */
34 13 0x80000000 /* MX6Q_PAD_SD2_DAT2__GPIO_1_13 */
35 >;
36 };
37 };
38 };
39 };
40
41 aips-bus@02100000 { /* AIPS2 */
42 uart4: serial@021f0000 {
43 pinctrl-names = "default";
44 pinctrl-0 = <&pinctrl_uart4_1>;
45 status = "okay";
46 };
47
48 ethernet@02188000 {
49 pinctrl-names = "default";
50 pinctrl-0 = <&pinctrl_enet_2>;
51 phy-mode = "rgmii";
52 status = "okay";
53 };
54
55 usdhc@02198000 { /* uSDHC3 */
56 pinctrl-names = "default";
57 pinctrl-0 = <&pinctrl_usdhc3_1>;
58 cd-gpios = <&gpio6 15 0>;
59 wp-gpios = <&gpio1 13 0>;
60 status = "okay";
61 };
62 };
63 };
64};
diff --git a/arch/arm/boot/dts/imx6q-sabresd.dts b/arch/arm/boot/dts/imx6q-sabresd.dts
index e596c28c214d..a42402562b7b 100644
--- a/arch/arm/boot/dts/imx6q-sabresd.dts
+++ b/arch/arm/boot/dts/imx6q-sabresd.dts
@@ -38,6 +38,8 @@
38 hog { 38 hog {
39 pinctrl_hog: hoggrp { 39 pinctrl_hog: hoggrp {
40 fsl,pins = < 40 fsl,pins = <
41 1004 0x80000000 /* MX6Q_PAD_GPIO_4__GPIO_1_4 */
42 1012 0x80000000 /* MX6Q_PAD_GPIO_5__GPIO_1_5 */
41 1402 0x80000000 /* MX6Q_PAD_NANDF_D0__GPIO_2_0 */ 43 1402 0x80000000 /* MX6Q_PAD_NANDF_D0__GPIO_2_0 */
42 1410 0x80000000 /* MX6Q_PAD_NANDF_D1__GPIO_2_1 */ 44 1410 0x80000000 /* MX6Q_PAD_NANDF_D1__GPIO_2_1 */
43 1418 0x80000000 /* MX6Q_PAD_NANDF_D2__GPIO_2_2 */ 45 1418 0x80000000 /* MX6Q_PAD_NANDF_D2__GPIO_2_2 */
@@ -73,4 +75,20 @@
73 }; 75 };
74 }; 76 };
75 }; 77 };
78
79 gpio-keys {
80 compatible = "gpio-keys";
81
82 volume-up {
83 label = "Volume Up";
84 gpios = <&gpio1 4 0>;
85 linux,code = <115>; /* KEY_VOLUMEUP */
86 };
87
88 volume-down {
89 label = "Volume Down";
90 gpios = <&gpio1 5 0>;
91 linux,code = <114>; /* KEY_VOLUMEDOWN */
92 };
93 };
76}; 94};
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index f3990b04fecf..6dfeaedef307 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -36,6 +36,14 @@
36 compatible = "arm,cortex-a9"; 36 compatible = "arm,cortex-a9";
37 reg = <0>; 37 reg = <0>;
38 next-level-cache = <&L2>; 38 next-level-cache = <&L2>;
39 operating-points = <
40 /* kHz uV */
41 792000 1100000
42 396000 950000
43 198000 850000
44 >;
45 clock-latency = <61036>; /* two CLK32 periods */
46 cpu0-supply = <&reg_cpu>;
39 }; 47 };
40 48
41 cpu@1 { 49 cpu@1 {
@@ -100,7 +108,7 @@
100 clocks = <&clks 106>; 108 clocks = <&clks 106>;
101 }; 109 };
102 110
103 gpmi-nand@00112000 { 111 nfc: gpmi-nand@00112000 {
104 compatible = "fsl,imx6q-gpmi-nand"; 112 compatible = "fsl,imx6q-gpmi-nand";
105 #address-cells = <1>; 113 #address-cells = <1>;
106 #size-cells = <1>; 114 #size-cells = <1>;
@@ -144,12 +152,12 @@
144 reg = <0x02000000 0x40000>; 152 reg = <0x02000000 0x40000>;
145 ranges; 153 ranges;
146 154
147 spdif@02004000 { 155 spdif: spdif@02004000 {
148 reg = <0x02004000 0x4000>; 156 reg = <0x02004000 0x4000>;
149 interrupts = <0 52 0x04>; 157 interrupts = <0 52 0x04>;
150 }; 158 };
151 159
152 ecspi@02008000 { /* eCSPI1 */ 160 ecspi1: ecspi@02008000 {
153 #address-cells = <1>; 161 #address-cells = <1>;
154 #size-cells = <0>; 162 #size-cells = <0>;
155 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 163 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
@@ -160,7 +168,7 @@
160 status = "disabled"; 168 status = "disabled";
161 }; 169 };
162 170
163 ecspi@0200c000 { /* eCSPI2 */ 171 ecspi2: ecspi@0200c000 {
164 #address-cells = <1>; 172 #address-cells = <1>;
165 #size-cells = <0>; 173 #size-cells = <0>;
166 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 174 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
@@ -171,7 +179,7 @@
171 status = "disabled"; 179 status = "disabled";
172 }; 180 };
173 181
174 ecspi@02010000 { /* eCSPI3 */ 182 ecspi3: ecspi@02010000 {
175 #address-cells = <1>; 183 #address-cells = <1>;
176 #size-cells = <0>; 184 #size-cells = <0>;
177 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 185 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
@@ -182,7 +190,7 @@
182 status = "disabled"; 190 status = "disabled";
183 }; 191 };
184 192
185 ecspi@02014000 { /* eCSPI4 */ 193 ecspi4: ecspi@02014000 {
186 #address-cells = <1>; 194 #address-cells = <1>;
187 #size-cells = <0>; 195 #size-cells = <0>;
188 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 196 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
@@ -193,7 +201,7 @@
193 status = "disabled"; 201 status = "disabled";
194 }; 202 };
195 203
196 ecspi@02018000 { /* eCSPI5 */ 204 ecspi5: ecspi@02018000 {
197 #address-cells = <1>; 205 #address-cells = <1>;
198 #size-cells = <0>; 206 #size-cells = <0>;
199 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 207 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
@@ -213,7 +221,7 @@
213 status = "disabled"; 221 status = "disabled";
214 }; 222 };
215 223
216 esai@02024000 { 224 esai: esai@02024000 {
217 reg = <0x02024000 0x4000>; 225 reg = <0x02024000 0x4000>;
218 interrupts = <0 51 0x04>; 226 interrupts = <0 51 0x04>;
219 }; 227 };
@@ -248,7 +256,7 @@
248 status = "disabled"; 256 status = "disabled";
249 }; 257 };
250 258
251 asrc@02034000 { 259 asrc: asrc@02034000 {
252 reg = <0x02034000 0x4000>; 260 reg = <0x02034000 0x4000>;
253 interrupts = <0 50 0x04>; 261 interrupts = <0 50 0x04>;
254 }; 262 };
@@ -258,7 +266,7 @@
258 }; 266 };
259 }; 267 };
260 268
261 vpu@02040000 { 269 vpu: vpu@02040000 {
262 reg = <0x02040000 0x3c000>; 270 reg = <0x02040000 0x3c000>;
263 interrupts = <0 3 0x04 0 12 0x04>; 271 interrupts = <0 3 0x04 0 12 0x04>;
264 }; 272 };
@@ -267,37 +275,37 @@
267 reg = <0x0207c000 0x4000>; 275 reg = <0x0207c000 0x4000>;
268 }; 276 };
269 277
270 pwm@02080000 { /* PWM1 */ 278 pwm1: pwm@02080000 {
271 reg = <0x02080000 0x4000>; 279 reg = <0x02080000 0x4000>;
272 interrupts = <0 83 0x04>; 280 interrupts = <0 83 0x04>;
273 }; 281 };
274 282
275 pwm@02084000 { /* PWM2 */ 283 pwm2: pwm@02084000 {
276 reg = <0x02084000 0x4000>; 284 reg = <0x02084000 0x4000>;
277 interrupts = <0 84 0x04>; 285 interrupts = <0 84 0x04>;
278 }; 286 };
279 287
280 pwm@02088000 { /* PWM3 */ 288 pwm3: pwm@02088000 {
281 reg = <0x02088000 0x4000>; 289 reg = <0x02088000 0x4000>;
282 interrupts = <0 85 0x04>; 290 interrupts = <0 85 0x04>;
283 }; 291 };
284 292
285 pwm@0208c000 { /* PWM4 */ 293 pwm4: pwm@0208c000 {
286 reg = <0x0208c000 0x4000>; 294 reg = <0x0208c000 0x4000>;
287 interrupts = <0 86 0x04>; 295 interrupts = <0 86 0x04>;
288 }; 296 };
289 297
290 flexcan@02090000 { /* CAN1 */ 298 can1: flexcan@02090000 {
291 reg = <0x02090000 0x4000>; 299 reg = <0x02090000 0x4000>;
292 interrupts = <0 110 0x04>; 300 interrupts = <0 110 0x04>;
293 }; 301 };
294 302
295 flexcan@02094000 { /* CAN2 */ 303 can2: flexcan@02094000 {
296 reg = <0x02094000 0x4000>; 304 reg = <0x02094000 0x4000>;
297 interrupts = <0 111 0x04>; 305 interrupts = <0 111 0x04>;
298 }; 306 };
299 307
300 gpt@02098000 { 308 gpt: gpt@02098000 {
301 compatible = "fsl,imx6q-gpt"; 309 compatible = "fsl,imx6q-gpt";
302 reg = <0x02098000 0x4000>; 310 reg = <0x02098000 0x4000>;
303 interrupts = <0 55 0x04>; 311 interrupts = <0 55 0x04>;
@@ -373,19 +381,19 @@
373 #interrupt-cells = <2>; 381 #interrupt-cells = <2>;
374 }; 382 };
375 383
376 kpp@020b8000 { 384 kpp: kpp@020b8000 {
377 reg = <0x020b8000 0x4000>; 385 reg = <0x020b8000 0x4000>;
378 interrupts = <0 82 0x04>; 386 interrupts = <0 82 0x04>;
379 }; 387 };
380 388
381 wdog@020bc000 { /* WDOG1 */ 389 wdog1: wdog@020bc000 {
382 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt"; 390 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
383 reg = <0x020bc000 0x4000>; 391 reg = <0x020bc000 0x4000>;
384 interrupts = <0 80 0x04>; 392 interrupts = <0 80 0x04>;
385 clocks = <&clks 0>; 393 clocks = <&clks 0>;
386 }; 394 };
387 395
388 wdog@020c0000 { /* WDOG2 */ 396 wdog2: wdog@020c0000 {
389 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt"; 397 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
390 reg = <0x020c0000 0x4000>; 398 reg = <0x020c0000 0x4000>;
391 interrupts = <0 81 0x04>; 399 interrupts = <0 81 0x04>;
@@ -447,7 +455,7 @@
447 anatop-max-voltage = <2750000>; 455 anatop-max-voltage = <2750000>;
448 }; 456 };
449 457
450 regulator-vddcore@140 { 458 reg_cpu: regulator-vddcore@140 {
451 compatible = "fsl,anatop-regulator"; 459 compatible = "fsl,anatop-regulator";
452 regulator-name = "cpu"; 460 regulator-name = "cpu";
453 regulator-min-microvolt = <725000>; 461 regulator-min-microvolt = <725000>;
@@ -505,27 +513,35 @@
505 }; 513 };
506 514
507 snvs@020cc000 { 515 snvs@020cc000 {
508 reg = <0x020cc000 0x4000>; 516 compatible = "fsl,sec-v4.0-mon", "simple-bus";
509 interrupts = <0 19 0x04 0 20 0x04>; 517 #address-cells = <1>;
518 #size-cells = <1>;
519 ranges = <0 0x020cc000 0x4000>;
520
521 snvs-rtc-lp@34 {
522 compatible = "fsl,sec-v4.0-mon-rtc-lp";
523 reg = <0x34 0x58>;
524 interrupts = <0 19 0x04 0 20 0x04>;
525 };
510 }; 526 };
511 527
512 epit@020d0000 { /* EPIT1 */ 528 epit1: epit@020d0000 { /* EPIT1 */
513 reg = <0x020d0000 0x4000>; 529 reg = <0x020d0000 0x4000>;
514 interrupts = <0 56 0x04>; 530 interrupts = <0 56 0x04>;
515 }; 531 };
516 532
517 epit@020d4000 { /* EPIT2 */ 533 epit2: epit@020d4000 { /* EPIT2 */
518 reg = <0x020d4000 0x4000>; 534 reg = <0x020d4000 0x4000>;
519 interrupts = <0 57 0x04>; 535 interrupts = <0 57 0x04>;
520 }; 536 };
521 537
522 src@020d8000 { 538 src: src@020d8000 {
523 compatible = "fsl,imx6q-src"; 539 compatible = "fsl,imx6q-src";
524 reg = <0x020d8000 0x4000>; 540 reg = <0x020d8000 0x4000>;
525 interrupts = <0 91 0x04 0 96 0x04>; 541 interrupts = <0 91 0x04 0 96 0x04>;
526 }; 542 };
527 543
528 gpc@020dc000 { 544 gpc: gpc@020dc000 {
529 compatible = "fsl,imx6q-gpc"; 545 compatible = "fsl,imx6q-gpc";
530 reg = <0x020dc000 0x4000>; 546 reg = <0x020dc000 0x4000>;
531 interrupts = <0 89 0x04 0 90 0x04>; 547 interrupts = <0 89 0x04 0 90 0x04>;
@@ -536,7 +552,7 @@
536 reg = <0x020e0000 0x38>; 552 reg = <0x020e0000 0x38>;
537 }; 553 };
538 554
539 iomuxc@020e0000 { 555 iomuxc: iomuxc@020e0000 {
540 compatible = "fsl,imx6q-iomuxc"; 556 compatible = "fsl,imx6q-iomuxc";
541 reg = <0x020e0000 0x4000>; 557 reg = <0x020e0000 0x4000>;
542 558
@@ -748,17 +764,17 @@
748 }; 764 };
749 }; 765 };
750 766
751 dcic@020e4000 { /* DCIC1 */ 767 dcic1: dcic@020e4000 {
752 reg = <0x020e4000 0x4000>; 768 reg = <0x020e4000 0x4000>;
753 interrupts = <0 124 0x04>; 769 interrupts = <0 124 0x04>;
754 }; 770 };
755 771
756 dcic@020e8000 { /* DCIC2 */ 772 dcic2: dcic@020e8000 {
757 reg = <0x020e8000 0x4000>; 773 reg = <0x020e8000 0x4000>;
758 interrupts = <0 125 0x04>; 774 interrupts = <0 125 0x04>;
759 }; 775 };
760 776
761 sdma@020ec000 { 777 sdma: sdma@020ec000 {
762 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma"; 778 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma";
763 reg = <0x020ec000 0x4000>; 779 reg = <0x020ec000 0x4000>;
764 interrupts = <0 2 0x04>; 780 interrupts = <0 2 0x04>;
@@ -784,7 +800,7 @@
784 reg = <0x0217c000 0x4000>; 800 reg = <0x0217c000 0x4000>;
785 }; 801 };
786 802
787 usb@02184000 { /* USB OTG */ 803 usbotg: usb@02184000 {
788 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 804 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
789 reg = <0x02184000 0x200>; 805 reg = <0x02184000 0x200>;
790 interrupts = <0 43 0x04>; 806 interrupts = <0 43 0x04>;
@@ -794,7 +810,7 @@
794 status = "disabled"; 810 status = "disabled";
795 }; 811 };
796 812
797 usb@02184200 { /* USB1 */ 813 usbh1: usb@02184200 {
798 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 814 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
799 reg = <0x02184200 0x200>; 815 reg = <0x02184200 0x200>;
800 interrupts = <0 40 0x04>; 816 interrupts = <0 40 0x04>;
@@ -804,7 +820,7 @@
804 status = "disabled"; 820 status = "disabled";
805 }; 821 };
806 822
807 usb@02184400 { /* USB2 */ 823 usbh2: usb@02184400 {
808 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 824 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
809 reg = <0x02184400 0x200>; 825 reg = <0x02184400 0x200>;
810 interrupts = <0 41 0x04>; 826 interrupts = <0 41 0x04>;
@@ -813,7 +829,7 @@
813 status = "disabled"; 829 status = "disabled";
814 }; 830 };
815 831
816 usb@02184600 { /* USB3 */ 832 usbh3: usb@02184600 {
817 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 833 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
818 reg = <0x02184600 0x200>; 834 reg = <0x02184600 0x200>;
819 interrupts = <0 42 0x04>; 835 interrupts = <0 42 0x04>;
@@ -822,14 +838,14 @@
822 status = "disabled"; 838 status = "disabled";
823 }; 839 };
824 840
825 usbmisc: usbmisc@02184800 { 841 usbmisc: usbmisc: usbmisc@02184800 {
826 #index-cells = <1>; 842 #index-cells = <1>;
827 compatible = "fsl,imx6q-usbmisc"; 843 compatible = "fsl,imx6q-usbmisc";
828 reg = <0x02184800 0x200>; 844 reg = <0x02184800 0x200>;
829 clocks = <&clks 162>; 845 clocks = <&clks 162>;
830 }; 846 };
831 847
832 ethernet@02188000 { 848 fec: ethernet@02188000 {
833 compatible = "fsl,imx6q-fec"; 849 compatible = "fsl,imx6q-fec";
834 reg = <0x02188000 0x4000>; 850 reg = <0x02188000 0x4000>;
835 interrupts = <0 118 0x04 0 119 0x04>; 851 interrupts = <0 118 0x04 0 119 0x04>;
@@ -843,66 +859,70 @@
843 interrupts = <0 53 0x04 0 117 0x04 0 126 0x04>; 859 interrupts = <0 53 0x04 0 117 0x04 0 126 0x04>;
844 }; 860 };
845 861
846 usdhc@02190000 { /* uSDHC1 */ 862 usdhc1: usdhc@02190000 {
847 compatible = "fsl,imx6q-usdhc"; 863 compatible = "fsl,imx6q-usdhc";
848 reg = <0x02190000 0x4000>; 864 reg = <0x02190000 0x4000>;
849 interrupts = <0 22 0x04>; 865 interrupts = <0 22 0x04>;
850 clocks = <&clks 163>, <&clks 163>, <&clks 163>; 866 clocks = <&clks 163>, <&clks 163>, <&clks 163>;
851 clock-names = "ipg", "ahb", "per"; 867 clock-names = "ipg", "ahb", "per";
868 bus-width = <4>;
852 status = "disabled"; 869 status = "disabled";
853 }; 870 };
854 871
855 usdhc@02194000 { /* uSDHC2 */ 872 usdhc2: usdhc@02194000 {
856 compatible = "fsl,imx6q-usdhc"; 873 compatible = "fsl,imx6q-usdhc";
857 reg = <0x02194000 0x4000>; 874 reg = <0x02194000 0x4000>;
858 interrupts = <0 23 0x04>; 875 interrupts = <0 23 0x04>;
859 clocks = <&clks 164>, <&clks 164>, <&clks 164>; 876 clocks = <&clks 164>, <&clks 164>, <&clks 164>;
860 clock-names = "ipg", "ahb", "per"; 877 clock-names = "ipg", "ahb", "per";
878 bus-width = <4>;
861 status = "disabled"; 879 status = "disabled";
862 }; 880 };
863 881
864 usdhc@02198000 { /* uSDHC3 */ 882 usdhc3: usdhc@02198000 {
865 compatible = "fsl,imx6q-usdhc"; 883 compatible = "fsl,imx6q-usdhc";
866 reg = <0x02198000 0x4000>; 884 reg = <0x02198000 0x4000>;
867 interrupts = <0 24 0x04>; 885 interrupts = <0 24 0x04>;
868 clocks = <&clks 165>, <&clks 165>, <&clks 165>; 886 clocks = <&clks 165>, <&clks 165>, <&clks 165>;
869 clock-names = "ipg", "ahb", "per"; 887 clock-names = "ipg", "ahb", "per";
888 bus-width = <4>;
870 status = "disabled"; 889 status = "disabled";
871 }; 890 };
872 891
873 usdhc@0219c000 { /* uSDHC4 */ 892 usdhc4: usdhc@0219c000 {
874 compatible = "fsl,imx6q-usdhc"; 893 compatible = "fsl,imx6q-usdhc";
875 reg = <0x0219c000 0x4000>; 894 reg = <0x0219c000 0x4000>;
876 interrupts = <0 25 0x04>; 895 interrupts = <0 25 0x04>;
877 clocks = <&clks 166>, <&clks 166>, <&clks 166>; 896 clocks = <&clks 166>, <&clks 166>, <&clks 166>;
878 clock-names = "ipg", "ahb", "per"; 897 clock-names = "ipg", "ahb", "per";
898 bus-width = <4>;
879 status = "disabled"; 899 status = "disabled";
880 }; 900 };
881 901
882 i2c@021a0000 { /* I2C1 */ 902 i2c1: i2c@021a0000 {
883 #address-cells = <1>; 903 #address-cells = <1>;
884 #size-cells = <0>; 904 #size-cells = <0>;
885 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 905 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
886 reg = <0x021a0000 0x4000>; 906 reg = <0x021a0000 0x4000>;
887 interrupts = <0 36 0x04>; 907 interrupts = <0 36 0x04>;
888 clocks = <&clks 125>; 908 clocks = <&clks 125>;
889 status = "disabled"; 909 status = "disabled";
890 }; 910 };
891 911
892 i2c@021a4000 { /* I2C2 */ 912 i2c2: i2c@021a4000 {
893 #address-cells = <1>; 913 #address-cells = <1>;
894 #size-cells = <0>; 914 #size-cells = <0>;
895 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 915 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
896 reg = <0x021a4000 0x4000>; 916 reg = <0x021a4000 0x4000>;
897 interrupts = <0 37 0x04>; 917 interrupts = <0 37 0x04>;
898 clocks = <&clks 126>; 918 clocks = <&clks 126>;
899 status = "disabled"; 919 status = "disabled";
900 }; 920 };
901 921
902 i2c@021a8000 { /* I2C3 */ 922 i2c3: i2c@021a8000 {
903 #address-cells = <1>; 923 #address-cells = <1>;
904 #size-cells = <0>; 924 #size-cells = <0>;
905 compatible = "fsl,imx6q-i2c", "fsl,imx1-i2c"; 925 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
906 reg = <0x021a8000 0x4000>; 926 reg = <0x021a8000 0x4000>;
907 interrupts = <0 38 0x04>; 927 interrupts = <0 38 0x04>;
908 clocks = <&clks 127>; 928 clocks = <&clks 127>;
@@ -913,12 +933,12 @@
913 reg = <0x021ac000 0x4000>; 933 reg = <0x021ac000 0x4000>;
914 }; 934 };
915 935
916 mmdc@021b0000 { /* MMDC0 */ 936 mmdc0: mmdc@021b0000 { /* MMDC0 */
917 compatible = "fsl,imx6q-mmdc"; 937 compatible = "fsl,imx6q-mmdc";
918 reg = <0x021b0000 0x4000>; 938 reg = <0x021b0000 0x4000>;
919 }; 939 };
920 940
921 mmdc@021b4000 { /* MMDC1 */ 941 mmdc1: mmdc@021b4000 { /* MMDC1 */
922 reg = <0x021b4000 0x4000>; 942 reg = <0x021b4000 0x4000>;
923 }; 943 };
924 944
@@ -946,7 +966,7 @@
946 interrupts = <0 109 0x04>; 966 interrupts = <0 109 0x04>;
947 }; 967 };
948 968
949 audmux@021d8000 { 969 audmux: audmux@021d8000 {
950 compatible = "fsl,imx6q-audmux", "fsl,imx31-audmux"; 970 compatible = "fsl,imx6q-audmux", "fsl,imx31-audmux";
951 reg = <0x021d8000 0x4000>; 971 reg = <0x021d8000 0x4000>;
952 status = "disabled"; 972 status = "disabled";
diff --git a/arch/arm/boot/dts/lpc32xx.dtsi b/arch/arm/boot/dts/lpc32xx.dtsi
index e5ffe960dbf3..1582f484a867 100644
--- a/arch/arm/boot/dts/lpc32xx.dtsi
+++ b/arch/arm/boot/dts/lpc32xx.dtsi
@@ -182,6 +182,13 @@
182 pnx,timeout = <0x64>; 182 pnx,timeout = <0x64>;
183 }; 183 };
184 184
185 mpwm: mpwm@400E8000 {
186 compatible = "nxp,lpc3220-motor-pwm";
187 reg = <0x400E8000 0x78>;
188 status = "disabled";
189 #pwm-cells = <2>;
190 };
191
185 i2cusb: i2c@31020300 { 192 i2cusb: i2c@31020300 {
186 compatible = "nxp,pnx-i2c"; 193 compatible = "nxp,pnx-i2c";
187 reg = <0x31020300 0x100>; 194 reg = <0x31020300 0x100>;
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index 581cb081cb0f..761c4b69b25b 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -12,6 +12,7 @@
12 12
13/ { 13/ {
14 compatible = "ti,omap2430", "ti,omap2420", "ti,omap2"; 14 compatible = "ti,omap2430", "ti,omap2420", "ti,omap2";
15 interrupt-parent = <&intc>;
15 16
16 aliases { 17 aliases {
17 serial0 = &uart1; 18 serial0 = &uart1;
@@ -65,5 +66,90 @@
65 ti,hwmods = "uart3"; 66 ti,hwmods = "uart3";
66 clock-frequency = <48000000>; 67 clock-frequency = <48000000>;
67 }; 68 };
69
70 timer2: timer@4802a000 {
71 compatible = "ti,omap2-timer";
72 reg = <0x4802a000 0x400>;
73 interrupts = <38>;
74 ti,hwmods = "timer2";
75 };
76
77 timer3: timer@48078000 {
78 compatible = "ti,omap2-timer";
79 reg = <0x48078000 0x400>;
80 interrupts = <39>;
81 ti,hwmods = "timer3";
82 };
83
84 timer4: timer@4807a000 {
85 compatible = "ti,omap2-timer";
86 reg = <0x4807a000 0x400>;
87 interrupts = <40>;
88 ti,hwmods = "timer4";
89 };
90
91 timer5: timer@4807c000 {
92 compatible = "ti,omap2-timer";
93 reg = <0x4807c000 0x400>;
94 interrupts = <41>;
95 ti,hwmods = "timer5";
96 ti,timer-dsp;
97 };
98
99 timer6: timer@4807e000 {
100 compatible = "ti,omap2-timer";
101 reg = <0x4807e000 0x400>;
102 interrupts = <42>;
103 ti,hwmods = "timer6";
104 ti,timer-dsp;
105 };
106
107 timer7: timer@48080000 {
108 compatible = "ti,omap2-timer";
109 reg = <0x48080000 0x400>;
110 interrupts = <43>;
111 ti,hwmods = "timer7";
112 ti,timer-dsp;
113 };
114
115 timer8: timer@48082000 {
116 compatible = "ti,omap2-timer";
117 reg = <0x48082000 0x400>;
118 interrupts = <44>;
119 ti,hwmods = "timer8";
120 ti,timer-dsp;
121 };
122
123 timer9: timer@48084000 {
124 compatible = "ti,omap2-timer";
125 reg = <0x48084000 0x400>;
126 interrupts = <45>;
127 ti,hwmods = "timer9";
128 ti,timer-pwm;
129 };
130
131 timer10: timer@48086000 {
132 compatible = "ti,omap2-timer";
133 reg = <0x48086000 0x400>;
134 interrupts = <46>;
135 ti,hwmods = "timer10";
136 ti,timer-pwm;
137 };
138
139 timer11: timer@48088000 {
140 compatible = "ti,omap2-timer";
141 reg = <0x48088000 0x400>;
142 interrupts = <47>;
143 ti,hwmods = "timer11";
144 ti,timer-pwm;
145 };
146
147 timer12: timer@4808a000 {
148 compatible = "ti,omap2-timer";
149 reg = <0x4808a000 0x400>;
150 interrupts = <48>;
151 ti,hwmods = "timer12";
152 ti,timer-pwm;
153 };
68 }; 154 };
69}; 155};
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
index bfd76b4a0ddc..af6560908905 100644
--- a/arch/arm/boot/dts/omap2420.dtsi
+++ b/arch/arm/boot/dts/omap2420.dtsi
@@ -14,6 +14,12 @@
14 compatible = "ti,omap2420", "ti,omap2"; 14 compatible = "ti,omap2420", "ti,omap2";
15 15
16 ocp { 16 ocp {
17 counter32k: counter@48004000 {
18 compatible = "ti,omap-counter32k";
19 reg = <0x48004000 0x20>;
20 ti,hwmods = "counter_32k";
21 };
22
17 omap2420_pmx: pinmux@48000030 { 23 omap2420_pmx: pinmux@48000030 {
18 compatible = "ti,omap2420-padconf", "pinctrl-single"; 24 compatible = "ti,omap2420-padconf", "pinctrl-single";
19 reg = <0x48000030 0x0113>; 25 reg = <0x48000030 0x0113>;
@@ -30,7 +36,6 @@
30 interrupts = <59>, /* TX interrupt */ 36 interrupts = <59>, /* TX interrupt */
31 <60>; /* RX interrupt */ 37 <60>; /* RX interrupt */
32 interrupt-names = "tx", "rx"; 38 interrupt-names = "tx", "rx";
33 interrupt-parent = <&intc>;
34 ti,hwmods = "mcbsp1"; 39 ti,hwmods = "mcbsp1";
35 }; 40 };
36 41
@@ -41,8 +46,15 @@
41 interrupts = <62>, /* TX interrupt */ 46 interrupts = <62>, /* TX interrupt */
42 <63>; /* RX interrupt */ 47 <63>; /* RX interrupt */
43 interrupt-names = "tx", "rx"; 48 interrupt-names = "tx", "rx";
44 interrupt-parent = <&intc>;
45 ti,hwmods = "mcbsp2"; 49 ti,hwmods = "mcbsp2";
46 }; 50 };
51
52 timer1: timer@48028000 {
53 compatible = "ti,omap2-timer";
54 reg = <0x48028000 0x400>;
55 interrupts = <37>;
56 ti,hwmods = "timer1";
57 ti,timer-alwon;
58 };
47 }; 59 };
48}; 60};
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
index 4565d9750f4d..c3924457c9b6 100644
--- a/arch/arm/boot/dts/omap2430.dtsi
+++ b/arch/arm/boot/dts/omap2430.dtsi
@@ -14,6 +14,12 @@
14 compatible = "ti,omap2430", "ti,omap2"; 14 compatible = "ti,omap2430", "ti,omap2";
15 15
16 ocp { 16 ocp {
17 counter32k: counter@49020000 {
18 compatible = "ti,omap-counter32k";
19 reg = <0x49020000 0x20>;
20 ti,hwmods = "counter_32k";
21 };
22
17 omap2430_pmx: pinmux@49002030 { 23 omap2430_pmx: pinmux@49002030 {
18 compatible = "ti,omap2430-padconf", "pinctrl-single"; 24 compatible = "ti,omap2430-padconf", "pinctrl-single";
19 reg = <0x49002030 0x0154>; 25 reg = <0x49002030 0x0154>;
@@ -32,7 +38,6 @@
32 <60>, /* RX interrupt */ 38 <60>, /* RX interrupt */
33 <61>; /* RX overflow interrupt */ 39 <61>; /* RX overflow interrupt */
34 interrupt-names = "common", "tx", "rx", "rx_overflow"; 40 interrupt-names = "common", "tx", "rx", "rx_overflow";
35 interrupt-parent = <&intc>;
36 ti,buffer-size = <128>; 41 ti,buffer-size = <128>;
37 ti,hwmods = "mcbsp1"; 42 ti,hwmods = "mcbsp1";
38 }; 43 };
@@ -45,7 +50,6 @@
45 <62>, /* TX interrupt */ 50 <62>, /* TX interrupt */
46 <63>; /* RX interrupt */ 51 <63>; /* RX interrupt */
47 interrupt-names = "common", "tx", "rx"; 52 interrupt-names = "common", "tx", "rx";
48 interrupt-parent = <&intc>;
49 ti,buffer-size = <128>; 53 ti,buffer-size = <128>;
50 ti,hwmods = "mcbsp2"; 54 ti,hwmods = "mcbsp2";
51 }; 55 };
@@ -58,7 +62,6 @@
58 <89>, /* TX interrupt */ 62 <89>, /* TX interrupt */
59 <90>; /* RX interrupt */ 63 <90>; /* RX interrupt */
60 interrupt-names = "common", "tx", "rx"; 64 interrupt-names = "common", "tx", "rx";
61 interrupt-parent = <&intc>;
62 ti,buffer-size = <128>; 65 ti,buffer-size = <128>;
63 ti,hwmods = "mcbsp3"; 66 ti,hwmods = "mcbsp3";
64 }; 67 };
@@ -71,7 +74,6 @@
71 <54>, /* TX interrupt */ 74 <54>, /* TX interrupt */
72 <55>; /* RX interrupt */ 75 <55>; /* RX interrupt */
73 interrupt-names = "common", "tx", "rx"; 76 interrupt-names = "common", "tx", "rx";
74 interrupt-parent = <&intc>;
75 ti,buffer-size = <128>; 77 ti,buffer-size = <128>;
76 ti,hwmods = "mcbsp4"; 78 ti,hwmods = "mcbsp4";
77 }; 79 };
@@ -84,9 +86,16 @@
84 <81>, /* TX interrupt */ 86 <81>, /* TX interrupt */
85 <82>; /* RX interrupt */ 87 <82>; /* RX interrupt */
86 interrupt-names = "common", "tx", "rx"; 88 interrupt-names = "common", "tx", "rx";
87 interrupt-parent = <&intc>;
88 ti,buffer-size = <128>; 89 ti,buffer-size = <128>;
89 ti,hwmods = "mcbsp5"; 90 ti,hwmods = "mcbsp5";
90 }; 91 };
92
93 timer1: timer@49018000 {
94 compatible = "ti,omap2-timer";
95 reg = <0x49018000 0x400>;
96 interrupts = <37>;
97 ti,hwmods = "timer1";
98 ti,timer-alwon;
99 };
91 }; 100 };
92}; 101};
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index c38cf76df81f..3705a81c1fc2 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -55,12 +55,6 @@
55 interrupts = <7>; /* SYS_NIRQ cascaded to intc */ 55 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
56 interrupt-parent = <&intc>; 56 interrupt-parent = <&intc>;
57 57
58 vsim: regulator-vsim {
59 compatible = "ti,twl4030-vsim";
60 regulator-min-microvolt = <1800000>;
61 regulator-max-microvolt = <3000000>;
62 };
63
64 twl_audio: audio { 58 twl_audio: audio {
65 compatible = "ti,twl4030-audio"; 59 compatible = "ti,twl4030-audio";
66 codec { 60 codec {
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
new file mode 100644
index 000000000000..f624dc85d441
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -0,0 +1,67 @@
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/dts-v1/;
9
10/include/ "omap3.dtsi"
11
12/ {
13 model = "TI OMAP3 BeagleBoard";
14 compatible = "ti,omap3-beagle", "ti,omap3";
15
16 memory {
17 device_type = "memory";
18 reg = <0x80000000 0x10000000>; /* 256 MB */
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};
42
43&i2c1 {
44 clock-frequency = <2600000>;
45
46 twl: twl@48 {
47 reg = <0x48>;
48 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
49 interrupt-parent = <&intc>;
50 };
51};
52
53/include/ "twl4030.dtsi"
54
55&mmc1 {
56 vmmc-supply = <&vmmc1>;
57 vmmc_aux-supply = <&vsim>;
58 bus-width = <8>;
59};
60
61&mmc2 {
62 status = "disabled";
63};
64
65&mmc3 {
66 status = "disabled";
67};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 696e929d0304..1acc26148ffc 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -12,6 +12,7 @@
12 12
13/ { 13/ {
14 compatible = "ti,omap3430", "ti,omap3"; 14 compatible = "ti,omap3430", "ti,omap3";
15 interrupt-parent = <&intc>;
15 16
16 aliases { 17 aliases {
17 serial0 = &uart1; 18 serial0 = &uart1;
@@ -60,6 +61,12 @@
60 ranges; 61 ranges;
61 ti,hwmods = "l3_main"; 62 ti,hwmods = "l3_main";
62 63
64 counter32k: counter@48320000 {
65 compatible = "ti,omap-counter32k";
66 reg = <0x48320000 0x20>;
67 ti,hwmods = "counter_32k";
68 };
69
63 intc: interrupt-controller@48200000 { 70 intc: interrupt-controller@48200000 {
64 compatible = "ti,omap2-intc"; 71 compatible = "ti,omap2-intc";
65 interrupt-controller; 72 interrupt-controller;
@@ -240,7 +247,6 @@
240 <59>, /* TX interrupt */ 247 <59>, /* TX interrupt */
241 <60>; /* RX interrupt */ 248 <60>; /* RX interrupt */
242 interrupt-names = "common", "tx", "rx"; 249 interrupt-names = "common", "tx", "rx";
243 interrupt-parent = <&intc>;
244 ti,buffer-size = <128>; 250 ti,buffer-size = <128>;
245 ti,hwmods = "mcbsp1"; 251 ti,hwmods = "mcbsp1";
246 }; 252 };
@@ -255,7 +261,6 @@
255 <63>, /* RX interrupt */ 261 <63>, /* RX interrupt */
256 <4>; /* Sidetone */ 262 <4>; /* Sidetone */
257 interrupt-names = "common", "tx", "rx", "sidetone"; 263 interrupt-names = "common", "tx", "rx", "sidetone";
258 interrupt-parent = <&intc>;
259 ti,buffer-size = <1280>; 264 ti,buffer-size = <1280>;
260 ti,hwmods = "mcbsp2", "mcbsp2_sidetone"; 265 ti,hwmods = "mcbsp2", "mcbsp2_sidetone";
261 }; 266 };
@@ -270,7 +275,6 @@
270 <90>, /* RX interrupt */ 275 <90>, /* RX interrupt */
271 <5>; /* Sidetone */ 276 <5>; /* Sidetone */
272 interrupt-names = "common", "tx", "rx", "sidetone"; 277 interrupt-names = "common", "tx", "rx", "sidetone";
273 interrupt-parent = <&intc>;
274 ti,buffer-size = <128>; 278 ti,buffer-size = <128>;
275 ti,hwmods = "mcbsp3", "mcbsp3_sidetone"; 279 ti,hwmods = "mcbsp3", "mcbsp3_sidetone";
276 }; 280 };
@@ -283,7 +287,6 @@
283 <54>, /* TX interrupt */ 287 <54>, /* TX interrupt */
284 <55>; /* RX interrupt */ 288 <55>; /* RX interrupt */
285 interrupt-names = "common", "tx", "rx"; 289 interrupt-names = "common", "tx", "rx";
286 interrupt-parent = <&intc>;
287 ti,buffer-size = <128>; 290 ti,buffer-size = <128>;
288 ti,hwmods = "mcbsp4"; 291 ti,hwmods = "mcbsp4";
289 }; 292 };
@@ -296,9 +299,103 @@
296 <81>, /* TX interrupt */ 299 <81>, /* TX interrupt */
297 <82>; /* RX interrupt */ 300 <82>; /* RX interrupt */
298 interrupt-names = "common", "tx", "rx"; 301 interrupt-names = "common", "tx", "rx";
299 interrupt-parent = <&intc>;
300 ti,buffer-size = <128>; 302 ti,buffer-size = <128>;
301 ti,hwmods = "mcbsp5"; 303 ti,hwmods = "mcbsp5";
302 }; 304 };
305
306 timer1: timer@48318000 {
307 compatible = "ti,omap2-timer";
308 reg = <0x48318000 0x400>;
309 interrupts = <37>;
310 ti,hwmods = "timer1";
311 ti,timer-alwon;
312 };
313
314 timer2: timer@49032000 {
315 compatible = "ti,omap2-timer";
316 reg = <0x49032000 0x400>;
317 interrupts = <38>;
318 ti,hwmods = "timer2";
319 };
320
321 timer3: timer@49034000 {
322 compatible = "ti,omap2-timer";
323 reg = <0x49034000 0x400>;
324 interrupts = <39>;
325 ti,hwmods = "timer3";
326 };
327
328 timer4: timer@49036000 {
329 compatible = "ti,omap2-timer";
330 reg = <0x49036000 0x400>;
331 interrupts = <40>;
332 ti,hwmods = "timer4";
333 };
334
335 timer5: timer@49038000 {
336 compatible = "ti,omap2-timer";
337 reg = <0x49038000 0x400>;
338 interrupts = <41>;
339 ti,hwmods = "timer5";
340 ti,timer-dsp;
341 };
342
343 timer6: timer@4903a000 {
344 compatible = "ti,omap2-timer";
345 reg = <0x4903a000 0x400>;
346 interrupts = <42>;
347 ti,hwmods = "timer6";
348 ti,timer-dsp;
349 };
350
351 timer7: timer@4903c000 {
352 compatible = "ti,omap2-timer";
353 reg = <0x4903c000 0x400>;
354 interrupts = <43>;
355 ti,hwmods = "timer7";
356 ti,timer-dsp;
357 };
358
359 timer8: timer@4903e000 {
360 compatible = "ti,omap2-timer";
361 reg = <0x4903e000 0x400>;
362 interrupts = <44>;
363 ti,hwmods = "timer8";
364 ti,timer-pwm;
365 ti,timer-dsp;
366 };
367
368 timer9: timer@49040000 {
369 compatible = "ti,omap2-timer";
370 reg = <0x49040000 0x400>;
371 interrupts = <45>;
372 ti,hwmods = "timer9";
373 ti,timer-pwm;
374 };
375
376 timer10: timer@48086000 {
377 compatible = "ti,omap2-timer";
378 reg = <0x48086000 0x400>;
379 interrupts = <46>;
380 ti,hwmods = "timer10";
381 ti,timer-pwm;
382 };
383
384 timer11: timer@48088000 {
385 compatible = "ti,omap2-timer";
386 reg = <0x48088000 0x400>;
387 interrupts = <47>;
388 ti,hwmods = "timer11";
389 ti,timer-pwm;
390 };
391
392 timer12: timer@48304000 {
393 compatible = "ti,omap2-timer";
394 reg = <0x48304000 0x400>;
395 interrupts = <95>;
396 ti,hwmods = "timer12";
397 ti,timer-alwon;
398 ti,timer-secure;
399 };
303 }; 400 };
304}; 401};
diff --git a/arch/arm/boot/dts/omap4-panda-a4.dts b/arch/arm/boot/dts/omap4-panda-a4.dts
new file mode 100644
index 000000000000..75466d2abfb5
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-panda-a4.dts
@@ -0,0 +1,17 @@
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/include/ "omap4-panda.dts"
9
10/* Pandaboard Rev A4+ have external pullups on SCL & SDA */
11&dss_hdmi_pins {
12 pinctrl-single,pins = <
13 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */
14 0x5c 0x100 /* hdmi_scl.hdmi_scl INPUT | MODE 0 */
15 0x5e 0x100 /* hdmi_sda.hdmi_sda INPUT | MODE 0 */
16 >;
17};
diff --git a/arch/arm/boot/dts/omap4-pandaES.dts b/arch/arm/boot/dts/omap4-panda-es.dts
index d4ba43a48d9b..73bc1a67e444 100644
--- a/arch/arm/boot/dts/omap4-pandaES.dts
+++ b/arch/arm/boot/dts/omap4-panda-es.dts
@@ -22,3 +22,12 @@
22 "AFML", "Line In", 22 "AFML", "Line In",
23 "AFMR", "Line In"; 23 "AFMR", "Line In";
24}; 24};
25
26/* PandaboardES has external pullups on SCL & SDA */
27&dss_hdmi_pins {
28 pinctrl-single,pins = <
29 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */
30 0x5c 0x100 /* hdmi_scl.hdmi_scl INPUT | MODE 0 */
31 0x5e 0x100 /* hdmi_sda.hdmi_sda INPUT | MODE 0 */
32 >;
33};
diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
index e8f927cbb376..4122efe31cfd 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -65,6 +65,8 @@
65 &twl6040_pins 65 &twl6040_pins
66 &mcpdm_pins 66 &mcpdm_pins
67 &mcbsp1_pins 67 &mcbsp1_pins
68 &dss_hdmi_pins
69 &tpd12s015_pins
68 >; 70 >;
69 71
70 twl6040_pins: pinmux_twl6040_pins { 72 twl6040_pins: pinmux_twl6040_pins {
@@ -92,6 +94,22 @@
92 0xc4 0x100 /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */ 94 0xc4 0x100 /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */
93 >; 95 >;
94 }; 96 };
97
98 dss_hdmi_pins: pinmux_dss_hdmi_pins {
99 pinctrl-single,pins = <
100 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */
101 0x5c 0x118 /* hdmi_scl.hdmi_scl INPUT PULLUP | MODE 0 */
102 0x5e 0x118 /* hdmi_sda.hdmi_sda INPUT PULLUP | MODE 0 */
103 >;
104 };
105
106 tpd12s015_pins: pinmux_tpd12s015_pins {
107 pinctrl-single,pins = <
108 0x22 0x3 /* gpmc_a17.gpio_41 OUTPUT | MODE3 */
109 0x48 0x3 /* gpmc_nbe1.gpio_60 OUTPUT | MODE3 */
110 0x58 0x10b /* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */
111 >;
112 };
95}; 113};
96 114
97&i2c1 { 115&i2c1 {
@@ -184,3 +202,7 @@
184&dmic { 202&dmic {
185 status = "disabled"; 203 status = "disabled";
186}; 204};
205
206&twl_usb_comparator {
207 usb-supply = <&vusb>;
208};
diff --git a/arch/arm/boot/dts/omap4-sdp-es23plus.dts b/arch/arm/boot/dts/omap4-sdp-es23plus.dts
new file mode 100644
index 000000000000..b4a40ffbce31
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-sdp-es23plus.dts
@@ -0,0 +1,17 @@
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/include/ "omap4-sdp.dts"
9
10/* SDP boards with 4430 ES2.3+ or 4460 have external pullups on SCL & SDA */
11&dss_hdmi_pins {
12 pinctrl-single,pins = <
13 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */
14 0x5c 0x100 /* hdmi_scl.hdmi_scl INPUT | MODE 0 */
15 0x5e 0x100 /* hdmi_sda.hdmi_sda INPUT | MODE 0 */
16 >;
17};
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 5b7e04fbff50..43e5258a9372 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -124,6 +124,8 @@
124 &dmic_pins 124 &dmic_pins
125 &mcbsp1_pins 125 &mcbsp1_pins
126 &mcbsp2_pins 126 &mcbsp2_pins
127 &dss_hdmi_pins
128 &tpd12s015_pins
127 >; 129 >;
128 130
129 uart2_pins: pinmux_uart2_pins { 131 uart2_pins: pinmux_uart2_pins {
@@ -194,6 +196,22 @@
194 0xbc 0x100 /* abe_mcbsp2_fsx.abe_mcbsp2_fsx INPUT | MODE0 */ 196 0xbc 0x100 /* abe_mcbsp2_fsx.abe_mcbsp2_fsx INPUT | MODE0 */
195 >; 197 >;
196 }; 198 };
199
200 dss_hdmi_pins: pinmux_dss_hdmi_pins {
201 pinctrl-single,pins = <
202 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */
203 0x5c 0x118 /* hdmi_scl.hdmi_scl INPUT PULLUP | MODE 0 */
204 0x5e 0x118 /* hdmi_sda.hdmi_sda INPUT PULLUP | MODE 0 */
205 >;
206 };
207
208 tpd12s015_pins: pinmux_tpd12s015_pins {
209 pinctrl-single,pins = <
210 0x22 0x3 /* gpmc_a17.gpio_41 OUTPUT | MODE3 */
211 0x48 0x3 /* gpmc_nbe1.gpio_60 OUTPUT | MODE3 */
212 0x58 0x10b /* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */
213 >;
214 };
197}; 215};
198 216
199&i2c1 { 217&i2c1 {
@@ -406,3 +424,7 @@
406&mcbsp3 { 424&mcbsp3 {
407 status = "disabled"; 425 status = "disabled";
408}; 426};
427
428&twl_usb_comparator {
429 usb-supply = <&vusb>;
430};
diff --git a/arch/arm/boot/dts/omap4-var_som.dts b/arch/arm/boot/dts/omap4-var-som.dts
index 6601e6af6092..6601e6af6092 100644
--- a/arch/arm/boot/dts/omap4-var_som.dts
+++ b/arch/arm/boot/dts/omap4-var-som.dts
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 3883f94fdbd0..739bb79e410e 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -95,6 +95,12 @@
95 ranges; 95 ranges;
96 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3"; 96 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
97 97
98 counter32k: counter@4a304000 {
99 compatible = "ti,omap-counter32k";
100 reg = <0x4a304000 0x20>;
101 ti,hwmods = "counter_32k";
102 };
103
98 omap4_pmx_core: pinmux@4a100040 { 104 omap4_pmx_core: pinmux@4a100040 {
99 compatible = "ti,omap4-padconf", "pinctrl-single"; 105 compatible = "ti,omap4-padconf", "pinctrl-single";
100 reg = <0x4a100040 0x0196>; 106 reg = <0x4a100040 0x0196>;
@@ -340,7 +346,6 @@
340 <0x49032000 0x7f>; /* L3 Interconnect */ 346 <0x49032000 0x7f>; /* L3 Interconnect */
341 reg-names = "mpu", "dma"; 347 reg-names = "mpu", "dma";
342 interrupts = <0 112 0x4>; 348 interrupts = <0 112 0x4>;
343 interrupt-parent = <&gic>;
344 ti,hwmods = "mcpdm"; 349 ti,hwmods = "mcpdm";
345 }; 350 };
346 351
@@ -350,7 +355,6 @@
350 <0x4902e000 0x7f>; /* L3 Interconnect */ 355 <0x4902e000 0x7f>; /* L3 Interconnect */
351 reg-names = "mpu", "dma"; 356 reg-names = "mpu", "dma";
352 interrupts = <0 114 0x4>; 357 interrupts = <0 114 0x4>;
353 interrupt-parent = <&gic>;
354 ti,hwmods = "dmic"; 358 ti,hwmods = "dmic";
355 }; 359 };
356 360
@@ -361,7 +365,6 @@
361 reg-names = "mpu", "dma"; 365 reg-names = "mpu", "dma";
362 interrupts = <0 17 0x4>; 366 interrupts = <0 17 0x4>;
363 interrupt-names = "common"; 367 interrupt-names = "common";
364 interrupt-parent = <&gic>;
365 ti,buffer-size = <128>; 368 ti,buffer-size = <128>;
366 ti,hwmods = "mcbsp1"; 369 ti,hwmods = "mcbsp1";
367 }; 370 };
@@ -373,7 +376,6 @@
373 reg-names = "mpu", "dma"; 376 reg-names = "mpu", "dma";
374 interrupts = <0 22 0x4>; 377 interrupts = <0 22 0x4>;
375 interrupt-names = "common"; 378 interrupt-names = "common";
376 interrupt-parent = <&gic>;
377 ti,buffer-size = <128>; 379 ti,buffer-size = <128>;
378 ti,hwmods = "mcbsp2"; 380 ti,hwmods = "mcbsp2";
379 }; 381 };
@@ -385,7 +387,6 @@
385 reg-names = "mpu", "dma"; 387 reg-names = "mpu", "dma";
386 interrupts = <0 23 0x4>; 388 interrupts = <0 23 0x4>;
387 interrupt-names = "common"; 389 interrupt-names = "common";
388 interrupt-parent = <&gic>;
389 ti,buffer-size = <128>; 390 ti,buffer-size = <128>;
390 ti,hwmods = "mcbsp3"; 391 ti,hwmods = "mcbsp3";
391 }; 392 };
@@ -396,7 +397,6 @@
396 reg-names = "mpu"; 397 reg-names = "mpu";
397 interrupts = <0 16 0x4>; 398 interrupts = <0 16 0x4>;
398 interrupt-names = "common"; 399 interrupt-names = "common";
399 interrupt-parent = <&gic>;
400 ti,buffer-size = <128>; 400 ti,buffer-size = <128>;
401 ti,hwmods = "mcbsp4"; 401 ti,hwmods = "mcbsp4";
402 }; 402 };
@@ -431,12 +431,103 @@
431 hw-caps-temp-alert; 431 hw-caps-temp-alert;
432 }; 432 };
433 433
434 ocp2scp { 434 ocp2scp@4a0ad000 {
435 compatible = "ti,omap-ocp2scp"; 435 compatible = "ti,omap-ocp2scp";
436 reg = <0x4a0ad000 0x1f>;
436 #address-cells = <1>; 437 #address-cells = <1>;
437 #size-cells = <1>; 438 #size-cells = <1>;
438 ranges; 439 ranges;
439 ti,hwmods = "ocp2scp_usb_phy"; 440 ti,hwmods = "ocp2scp_usb_phy";
440 }; 441 };
442
443 timer1: timer@4a318000 {
444 compatible = "ti,omap2-timer";
445 reg = <0x4a318000 0x80>;
446 interrupts = <0 37 0x4>;
447 ti,hwmods = "timer1";
448 ti,timer-alwon;
449 };
450
451 timer2: timer@48032000 {
452 compatible = "ti,omap2-timer";
453 reg = <0x48032000 0x80>;
454 interrupts = <0 38 0x4>;
455 ti,hwmods = "timer2";
456 };
457
458 timer3: timer@48034000 {
459 compatible = "ti,omap2-timer";
460 reg = <0x48034000 0x80>;
461 interrupts = <0 39 0x4>;
462 ti,hwmods = "timer3";
463 };
464
465 timer4: timer@48036000 {
466 compatible = "ti,omap2-timer";
467 reg = <0x48036000 0x80>;
468 interrupts = <0 40 0x4>;
469 ti,hwmods = "timer4";
470 };
471
472 timer5: timer@40138000 {
473 compatible = "ti,omap2-timer";
474 reg = <0x40138000 0x80>,
475 <0x49038000 0x80>;
476 interrupts = <0 41 0x4>;
477 ti,hwmods = "timer5";
478 ti,timer-dsp;
479 };
480
481 timer6: timer@4013a000 {
482 compatible = "ti,omap2-timer";
483 reg = <0x4013a000 0x80>,
484 <0x4903a000 0x80>;
485 interrupts = <0 42 0x4>;
486 ti,hwmods = "timer6";
487 ti,timer-dsp;
488 };
489
490 timer7: timer@4013c000 {
491 compatible = "ti,omap2-timer";
492 reg = <0x4013c000 0x80>,
493 <0x4903c000 0x80>;
494 interrupts = <0 43 0x4>;
495 ti,hwmods = "timer7";
496 ti,timer-dsp;
497 };
498
499 timer8: timer@4013e000 {
500 compatible = "ti,omap2-timer";
501 reg = <0x4013e000 0x80>,
502 <0x4903e000 0x80>;
503 interrupts = <0 44 0x4>;
504 ti,hwmods = "timer8";
505 ti,timer-pwm;
506 ti,timer-dsp;
507 };
508
509 timer9: timer@4803e000 {
510 compatible = "ti,omap2-timer";
511 reg = <0x4803e000 0x80>;
512 interrupts = <0 45 0x4>;
513 ti,hwmods = "timer9";
514 ti,timer-pwm;
515 };
516
517 timer10: timer@48086000 {
518 compatible = "ti,omap2-timer";
519 reg = <0x48086000 0x80>;
520 interrupts = <0 46 0x4>;
521 ti,hwmods = "timer10";
522 ti,timer-pwm;
523 };
524
525 timer11: timer@48088000 {
526 compatible = "ti,omap2-timer";
527 reg = <0x48088000 0x80>;
528 interrupts = <0 47 0x4>;
529 ti,hwmods = "timer11";
530 ti,timer-pwm;
531 };
441 }; 532 };
442}; 533};
diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index c663eba73168..8722c15bbba2 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -8,6 +8,7 @@
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap5.dtsi" 10/include/ "omap5.dtsi"
11/include/ "samsung_k3pe0e000b.dtsi"
11 12
12/ { 13/ {
13 model = "TI OMAP5 EVM board"; 14 model = "TI OMAP5 EVM board";
@@ -15,7 +16,7 @@
15 16
16 memory { 17 memory {
17 device_type = "memory"; 18 device_type = "memory";
18 reg = <0x80000000 0x40000000>; /* 1 GB */ 19 reg = <0x80000000 0x80000000>; /* 2 GB */
19 }; 20 };
20 21
21 vmmcsd_fixed: fixedregulator-mmcsd { 22 vmmcsd_fixed: fixedregulator-mmcsd {
@@ -140,3 +141,13 @@
140&mcbsp3 { 141&mcbsp3 {
141 status = "disabled"; 142 status = "disabled";
142}; 143};
144
145&emif1 {
146 cs1-used;
147 device-handle = <&samsung_K3PE0E000B>;
148};
149
150&emif2 {
151 cs1-used;
152 device-handle = <&samsung_K3PE0E000B>;
153};
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 42c78beb4fdc..790bb2a4b343 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -77,6 +77,12 @@
77 ranges; 77 ranges;
78 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3"; 78 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
79 79
80 counter32k: counter@4ae04000 {
81 compatible = "ti,omap-counter32k";
82 reg = <0x4ae04000 0x40>;
83 ti,hwmods = "counter_32k";
84 };
85
80 omap5_pmx_core: pinmux@4a002840 { 86 omap5_pmx_core: pinmux@4a002840 {
81 compatible = "ti,omap4-padconf", "pinctrl-single"; 87 compatible = "ti,omap4-padconf", "pinctrl-single";
82 reg = <0x4a002840 0x01b6>; 88 reg = <0x4a002840 0x01b6>;
@@ -104,6 +110,8 @@
104 110
105 gpio1: gpio@4ae10000 { 111 gpio1: gpio@4ae10000 {
106 compatible = "ti,omap4-gpio"; 112 compatible = "ti,omap4-gpio";
113 reg = <0x4ae10000 0x200>;
114 interrupts = <0 29 0x4>;
107 ti,hwmods = "gpio1"; 115 ti,hwmods = "gpio1";
108 gpio-controller; 116 gpio-controller;
109 #gpio-cells = <2>; 117 #gpio-cells = <2>;
@@ -113,6 +121,8 @@
113 121
114 gpio2: gpio@48055000 { 122 gpio2: gpio@48055000 {
115 compatible = "ti,omap4-gpio"; 123 compatible = "ti,omap4-gpio";
124 reg = <0x48055000 0x200>;
125 interrupts = <0 30 0x4>;
116 ti,hwmods = "gpio2"; 126 ti,hwmods = "gpio2";
117 gpio-controller; 127 gpio-controller;
118 #gpio-cells = <2>; 128 #gpio-cells = <2>;
@@ -122,6 +132,8 @@
122 132
123 gpio3: gpio@48057000 { 133 gpio3: gpio@48057000 {
124 compatible = "ti,omap4-gpio"; 134 compatible = "ti,omap4-gpio";
135 reg = <0x48057000 0x200>;
136 interrupts = <0 31 0x4>;
125 ti,hwmods = "gpio3"; 137 ti,hwmods = "gpio3";
126 gpio-controller; 138 gpio-controller;
127 #gpio-cells = <2>; 139 #gpio-cells = <2>;
@@ -131,6 +143,8 @@
131 143
132 gpio4: gpio@48059000 { 144 gpio4: gpio@48059000 {
133 compatible = "ti,omap4-gpio"; 145 compatible = "ti,omap4-gpio";
146 reg = <0x48059000 0x200>;
147 interrupts = <0 32 0x4>;
134 ti,hwmods = "gpio4"; 148 ti,hwmods = "gpio4";
135 gpio-controller; 149 gpio-controller;
136 #gpio-cells = <2>; 150 #gpio-cells = <2>;
@@ -140,6 +154,8 @@
140 154
141 gpio5: gpio@4805b000 { 155 gpio5: gpio@4805b000 {
142 compatible = "ti,omap4-gpio"; 156 compatible = "ti,omap4-gpio";
157 reg = <0x4805b000 0x200>;
158 interrupts = <0 33 0x4>;
143 ti,hwmods = "gpio5"; 159 ti,hwmods = "gpio5";
144 gpio-controller; 160 gpio-controller;
145 #gpio-cells = <2>; 161 #gpio-cells = <2>;
@@ -149,6 +165,8 @@
149 165
150 gpio6: gpio@4805d000 { 166 gpio6: gpio@4805d000 {
151 compatible = "ti,omap4-gpio"; 167 compatible = "ti,omap4-gpio";
168 reg = <0x4805d000 0x200>;
169 interrupts = <0 34 0x4>;
152 ti,hwmods = "gpio6"; 170 ti,hwmods = "gpio6";
153 gpio-controller; 171 gpio-controller;
154 #gpio-cells = <2>; 172 #gpio-cells = <2>;
@@ -158,6 +176,8 @@
158 176
159 gpio7: gpio@48051000 { 177 gpio7: gpio@48051000 {
160 compatible = "ti,omap4-gpio"; 178 compatible = "ti,omap4-gpio";
179 reg = <0x48051000 0x200>;
180 interrupts = <0 35 0x4>;
161 ti,hwmods = "gpio7"; 181 ti,hwmods = "gpio7";
162 gpio-controller; 182 gpio-controller;
163 #gpio-cells = <2>; 183 #gpio-cells = <2>;
@@ -167,6 +187,8 @@
167 187
168 gpio8: gpio@48053000 { 188 gpio8: gpio@48053000 {
169 compatible = "ti,omap4-gpio"; 189 compatible = "ti,omap4-gpio";
190 reg = <0x48053000 0x200>;
191 interrupts = <0 121 0x4>;
170 ti,hwmods = "gpio8"; 192 ti,hwmods = "gpio8";
171 gpio-controller; 193 gpio-controller;
172 #gpio-cells = <2>; 194 #gpio-cells = <2>;
@@ -176,6 +198,8 @@
176 198
177 i2c1: i2c@48070000 { 199 i2c1: i2c@48070000 {
178 compatible = "ti,omap4-i2c"; 200 compatible = "ti,omap4-i2c";
201 reg = <0x48070000 0x100>;
202 interrupts = <0 56 0x4>;
179 #address-cells = <1>; 203 #address-cells = <1>;
180 #size-cells = <0>; 204 #size-cells = <0>;
181 ti,hwmods = "i2c1"; 205 ti,hwmods = "i2c1";
@@ -183,6 +207,8 @@
183 207
184 i2c2: i2c@48072000 { 208 i2c2: i2c@48072000 {
185 compatible = "ti,omap4-i2c"; 209 compatible = "ti,omap4-i2c";
210 reg = <0x48072000 0x100>;
211 interrupts = <0 57 0x4>;
186 #address-cells = <1>; 212 #address-cells = <1>;
187 #size-cells = <0>; 213 #size-cells = <0>;
188 ti,hwmods = "i2c2"; 214 ti,hwmods = "i2c2";
@@ -190,20 +216,26 @@
190 216
191 i2c3: i2c@48060000 { 217 i2c3: i2c@48060000 {
192 compatible = "ti,omap4-i2c"; 218 compatible = "ti,omap4-i2c";
219 reg = <0x48060000 0x100>;
220 interrupts = <0 61 0x4>;
193 #address-cells = <1>; 221 #address-cells = <1>;
194 #size-cells = <0>; 222 #size-cells = <0>;
195 ti,hwmods = "i2c3"; 223 ti,hwmods = "i2c3";
196 }; 224 };
197 225
198 i2c4: i2c@4807A000 { 226 i2c4: i2c@4807a000 {
199 compatible = "ti,omap4-i2c"; 227 compatible = "ti,omap4-i2c";
228 reg = <0x4807a000 0x100>;
229 interrupts = <0 62 0x4>;
200 #address-cells = <1>; 230 #address-cells = <1>;
201 #size-cells = <0>; 231 #size-cells = <0>;
202 ti,hwmods = "i2c4"; 232 ti,hwmods = "i2c4";
203 }; 233 };
204 234
205 i2c5: i2c@4807C000 { 235 i2c5: i2c@4807c000 {
206 compatible = "ti,omap4-i2c"; 236 compatible = "ti,omap4-i2c";
237 reg = <0x4807c000 0x100>;
238 interrupts = <0 60 0x4>;
207 #address-cells = <1>; 239 #address-cells = <1>;
208 #size-cells = <0>; 240 #size-cells = <0>;
209 ti,hwmods = "i2c5"; 241 ti,hwmods = "i2c5";
@@ -211,42 +243,56 @@
211 243
212 uart1: serial@4806a000 { 244 uart1: serial@4806a000 {
213 compatible = "ti,omap4-uart"; 245 compatible = "ti,omap4-uart";
246 reg = <0x4806a000 0x100>;
247 interrupts = <0 72 0x4>;
214 ti,hwmods = "uart1"; 248 ti,hwmods = "uart1";
215 clock-frequency = <48000000>; 249 clock-frequency = <48000000>;
216 }; 250 };
217 251
218 uart2: serial@4806c000 { 252 uart2: serial@4806c000 {
219 compatible = "ti,omap4-uart"; 253 compatible = "ti,omap4-uart";
254 reg = <0x4806c000 0x100>;
255 interrupts = <0 73 0x4>;
220 ti,hwmods = "uart2"; 256 ti,hwmods = "uart2";
221 clock-frequency = <48000000>; 257 clock-frequency = <48000000>;
222 }; 258 };
223 259
224 uart3: serial@48020000 { 260 uart3: serial@48020000 {
225 compatible = "ti,omap4-uart"; 261 compatible = "ti,omap4-uart";
262 reg = <0x48020000 0x100>;
263 interrupts = <0 74 0x4>;
226 ti,hwmods = "uart3"; 264 ti,hwmods = "uart3";
227 clock-frequency = <48000000>; 265 clock-frequency = <48000000>;
228 }; 266 };
229 267
230 uart4: serial@4806e000 { 268 uart4: serial@4806e000 {
231 compatible = "ti,omap4-uart"; 269 compatible = "ti,omap4-uart";
270 reg = <0x4806e000 0x100>;
271 interrupts = <0 70 0x4>;
232 ti,hwmods = "uart4"; 272 ti,hwmods = "uart4";
233 clock-frequency = <48000000>; 273 clock-frequency = <48000000>;
234 }; 274 };
235 275
236 uart5: serial@48066000 { 276 uart5: serial@48066000 {
237 compatible = "ti,omap5-uart"; 277 compatible = "ti,omap4-uart";
278 reg = <0x48066000 0x100>;
279 interrupts = <0 105 0x4>;
238 ti,hwmods = "uart5"; 280 ti,hwmods = "uart5";
239 clock-frequency = <48000000>; 281 clock-frequency = <48000000>;
240 }; 282 };
241 283
242 uart6: serial@48068000 { 284 uart6: serial@48068000 {
243 compatible = "ti,omap6-uart"; 285 compatible = "ti,omap4-uart";
286 reg = <0x48068000 0x100>;
287 interrupts = <0 106 0x4>;
244 ti,hwmods = "uart6"; 288 ti,hwmods = "uart6";
245 clock-frequency = <48000000>; 289 clock-frequency = <48000000>;
246 }; 290 };
247 291
248 mmc1: mmc@4809c000 { 292 mmc1: mmc@4809c000 {
249 compatible = "ti,omap4-hsmmc"; 293 compatible = "ti,omap4-hsmmc";
294 reg = <0x4809c000 0x400>;
295 interrupts = <0 83 0x4>;
250 ti,hwmods = "mmc1"; 296 ti,hwmods = "mmc1";
251 ti,dual-volt; 297 ti,dual-volt;
252 ti,needs-special-reset; 298 ti,needs-special-reset;
@@ -254,24 +300,32 @@
254 300
255 mmc2: mmc@480b4000 { 301 mmc2: mmc@480b4000 {
256 compatible = "ti,omap4-hsmmc"; 302 compatible = "ti,omap4-hsmmc";
303 reg = <0x480b4000 0x400>;
304 interrupts = <0 86 0x4>;
257 ti,hwmods = "mmc2"; 305 ti,hwmods = "mmc2";
258 ti,needs-special-reset; 306 ti,needs-special-reset;
259 }; 307 };
260 308
261 mmc3: mmc@480ad000 { 309 mmc3: mmc@480ad000 {
262 compatible = "ti,omap4-hsmmc"; 310 compatible = "ti,omap4-hsmmc";
311 reg = <0x480ad000 0x400>;
312 interrupts = <0 94 0x4>;
263 ti,hwmods = "mmc3"; 313 ti,hwmods = "mmc3";
264 ti,needs-special-reset; 314 ti,needs-special-reset;
265 }; 315 };
266 316
267 mmc4: mmc@480d1000 { 317 mmc4: mmc@480d1000 {
268 compatible = "ti,omap4-hsmmc"; 318 compatible = "ti,omap4-hsmmc";
319 reg = <0x480d1000 0x400>;
320 interrupts = <0 96 0x4>;
269 ti,hwmods = "mmc4"; 321 ti,hwmods = "mmc4";
270 ti,needs-special-reset; 322 ti,needs-special-reset;
271 }; 323 };
272 324
273 mmc5: mmc@480d5000 { 325 mmc5: mmc@480d5000 {
274 compatible = "ti,omap4-hsmmc"; 326 compatible = "ti,omap4-hsmmc";
327 reg = <0x480d5000 0x400>;
328 interrupts = <0 59 0x4>;
275 ti,hwmods = "mmc5"; 329 ti,hwmods = "mmc5";
276 ti,needs-special-reset; 330 ti,needs-special-reset;
277 }; 331 };
@@ -287,7 +341,6 @@
287 <0x49032000 0x7f>; /* L3 Interconnect */ 341 <0x49032000 0x7f>; /* L3 Interconnect */
288 reg-names = "mpu", "dma"; 342 reg-names = "mpu", "dma";
289 interrupts = <0 112 0x4>; 343 interrupts = <0 112 0x4>;
290 interrupt-parent = <&gic>;
291 ti,hwmods = "mcpdm"; 344 ti,hwmods = "mcpdm";
292 }; 345 };
293 346
@@ -297,7 +350,6 @@
297 <0x4902e000 0x7f>; /* L3 Interconnect */ 350 <0x4902e000 0x7f>; /* L3 Interconnect */
298 reg-names = "mpu", "dma"; 351 reg-names = "mpu", "dma";
299 interrupts = <0 114 0x4>; 352 interrupts = <0 114 0x4>;
300 interrupt-parent = <&gic>;
301 ti,hwmods = "dmic"; 353 ti,hwmods = "dmic";
302 }; 354 };
303 355
@@ -308,7 +360,6 @@
308 reg-names = "mpu", "dma"; 360 reg-names = "mpu", "dma";
309 interrupts = <0 17 0x4>; 361 interrupts = <0 17 0x4>;
310 interrupt-names = "common"; 362 interrupt-names = "common";
311 interrupt-parent = <&gic>;
312 ti,buffer-size = <128>; 363 ti,buffer-size = <128>;
313 ti,hwmods = "mcbsp1"; 364 ti,hwmods = "mcbsp1";
314 }; 365 };
@@ -320,7 +371,6 @@
320 reg-names = "mpu", "dma"; 371 reg-names = "mpu", "dma";
321 interrupts = <0 22 0x4>; 372 interrupts = <0 22 0x4>;
322 interrupt-names = "common"; 373 interrupt-names = "common";
323 interrupt-parent = <&gic>;
324 ti,buffer-size = <128>; 374 ti,buffer-size = <128>;
325 ti,hwmods = "mcbsp2"; 375 ti,hwmods = "mcbsp2";
326 }; 376 };
@@ -332,9 +382,119 @@
332 reg-names = "mpu", "dma"; 382 reg-names = "mpu", "dma";
333 interrupts = <0 23 0x4>; 383 interrupts = <0 23 0x4>;
334 interrupt-names = "common"; 384 interrupt-names = "common";
335 interrupt-parent = <&gic>;
336 ti,buffer-size = <128>; 385 ti,buffer-size = <128>;
337 ti,hwmods = "mcbsp3"; 386 ti,hwmods = "mcbsp3";
338 }; 387 };
388
389 timer1: timer@4ae18000 {
390 compatible = "ti,omap2-timer";
391 reg = <0x4ae18000 0x80>;
392 interrupts = <0 37 0x4>;
393 ti,hwmods = "timer1";
394 ti,timer-alwon;
395 };
396
397 timer2: timer@48032000 {
398 compatible = "ti,omap2-timer";
399 reg = <0x48032000 0x80>;
400 interrupts = <0 38 0x4>;
401 ti,hwmods = "timer2";
402 };
403
404 timer3: timer@48034000 {
405 compatible = "ti,omap2-timer";
406 reg = <0x48034000 0x80>;
407 interrupts = <0 39 0x4>;
408 ti,hwmods = "timer3";
409 };
410
411 timer4: timer@48036000 {
412 compatible = "ti,omap2-timer";
413 reg = <0x48036000 0x80>;
414 interrupts = <0 40 0x4>;
415 ti,hwmods = "timer4";
416 };
417
418 timer5: timer@40138000 {
419 compatible = "ti,omap2-timer";
420 reg = <0x40138000 0x80>,
421 <0x49038000 0x80>;
422 interrupts = <0 41 0x4>;
423 ti,hwmods = "timer5";
424 ti,timer-dsp;
425 };
426
427 timer6: timer@4013a000 {
428 compatible = "ti,omap2-timer";
429 reg = <0x4013a000 0x80>,
430 <0x4903a000 0x80>;
431 interrupts = <0 42 0x4>;
432 ti,hwmods = "timer6";
433 ti,timer-dsp;
434 ti,timer-pwm;
435 };
436
437 timer7: timer@4013c000 {
438 compatible = "ti,omap2-timer";
439 reg = <0x4013c000 0x80>,
440 <0x4903c000 0x80>;
441 interrupts = <0 43 0x4>;
442 ti,hwmods = "timer7";
443 ti,timer-dsp;
444 };
445
446 timer8: timer@4013e000 {
447 compatible = "ti,omap2-timer";
448 reg = <0x4013e000 0x80>,
449 <0x4903e000 0x80>;
450 interrupts = <0 44 0x4>;
451 ti,hwmods = "timer8";
452 ti,timer-dsp;
453 ti,timer-pwm;
454 };
455
456 timer9: timer@4803e000 {
457 compatible = "ti,omap2-timer";
458 reg = <0x4803e000 0x80>;
459 interrupts = <0 45 0x4>;
460 ti,hwmods = "timer9";
461 };
462
463 timer10: timer@48086000 {
464 compatible = "ti,omap2-timer";
465 reg = <0x48086000 0x80>;
466 interrupts = <0 46 0x4>;
467 ti,hwmods = "timer10";
468 };
469
470 timer11: timer@48088000 {
471 compatible = "ti,omap2-timer";
472 reg = <0x48088000 0x80>;
473 interrupts = <0 47 0x4>;
474 ti,hwmods = "timer11";
475 ti,timer-pwm;
476 };
477
478 emif1: emif@0x4c000000 {
479 compatible = "ti,emif-4d5";
480 ti,hwmods = "emif1";
481 phy-type = <2>; /* DDR PHY type: Intelli PHY */
482 reg = <0x4c000000 0x400>;
483 interrupts = <0 110 0x4>;
484 hw-caps-read-idle-ctrl;
485 hw-caps-ll-interface;
486 hw-caps-temp-alert;
487 };
488
489 emif2: emif@0x4d000000 {
490 compatible = "ti,emif-4d5";
491 ti,hwmods = "emif2";
492 phy-type = <2>; /* DDR PHY type: Intelli PHY */
493 reg = <0x4d000000 0x400>;
494 interrupts = <0 111 0x4>;
495 hw-caps-read-idle-ctrl;
496 hw-caps-ll-interface;
497 hw-caps-temp-alert;
498 };
339 }; 499 };
340}; 500};
diff --git a/arch/arm/boot/dts/samsung_k3pe0e000b.dtsi b/arch/arm/boot/dts/samsung_k3pe0e000b.dtsi
new file mode 100644
index 000000000000..9657a5cbc3ad
--- /dev/null
+++ b/arch/arm/boot/dts/samsung_k3pe0e000b.dtsi
@@ -0,0 +1,67 @@
1/*
2 * Timings and Geometry for Samsung K3PE0E000B memory part
3 */
4
5/ {
6 samsung_K3PE0E000B: lpddr2 {
7 compatible = "Samsung,K3PE0E000B","jedec,lpddr2-s4";
8 density = <4096>;
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_samsung_K3PE0E000B_533MHz: lpddr2-timings@0 {
24 compatible = "jedec,lpddr2-timings";
25 min-freq = <10000000>;
26 max-freq = <533333333>;
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_samsung_K3PE0E000B_266MHz: lpddr2-timings@1 {
46 compatible = "jedec,lpddr2-timings";
47 min-freq = <10000000>;
48 max-freq = <266666666>;
49 tRPab = <21000>;
50 tRCD = <18000>;
51 tWR = <15000>;
52 tRAS-min = <42000>;
53 tRRD = <10000>;
54 tWTR = <7500>;
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/snowball.dts b/arch/arm/boot/dts/snowball.dts
index 702c0baa6004..9e02a913eb62 100644
--- a/arch/arm/boot/dts/snowball.dts
+++ b/arch/arm/boot/dts/snowball.dts
@@ -14,7 +14,7 @@
14 14
15/ { 15/ {
16 model = "Calao Systems Snowball platform with device tree"; 16 model = "Calao Systems Snowball platform with device tree";
17 compatible = "calaosystems,snowball-a9500"; 17 compatible = "calaosystems,snowball-a9500", "st-ericsson,u9500";
18 18
19 memory { 19 memory {
20 reg = <0x00000000 0x20000000>; 20 reg = <0x00000000 0x20000000>;
@@ -120,10 +120,10 @@
120 }; 120 };
121 121
122 // External Micro SD slot 122 // External Micro SD slot
123 sdi@80126000 { 123 sdi0_per1@80126000 {
124 arm,primecell-periphid = <0x10480180>; 124 arm,primecell-periphid = <0x10480180>;
125 max-frequency = <50000000>; 125 max-frequency = <50000000>;
126 bus-width = <8>; 126 bus-width = <4>;
127 mmc-cap-mmc-highspeed; 127 mmc-cap-mmc-highspeed;
128 vmmc-supply = <&ab8500_ldo_aux3_reg>; 128 vmmc-supply = <&ab8500_ldo_aux3_reg>;
129 129
@@ -134,7 +134,7 @@
134 }; 134 };
135 135
136 // On-board eMMC 136 // On-board eMMC
137 sdi@80114000 { 137 sdi4_per2@80114000 {
138 arm,primecell-periphid = <0x10480180>; 138 arm,primecell-periphid = <0x10480180>;
139 max-frequency = <50000000>; 139 max-frequency = <50000000>;
140 bus-width = <8>; 140 bus-width = <8>;
@@ -183,5 +183,137 @@
183 reg = <0x33>; 183 reg = <0x33>;
184 }; 184 };
185 }; 185 };
186
187 prcmu@80157000 {
188 db8500-prcmu-regulators {
189 db8500_vape_reg: db8500_vape {
190 regulator-name = "db8500-vape";
191 };
192
193 db8500_varm_reg: db8500_varm {
194 regulator-name = "db8500-varm";
195 };
196
197 db8500_vmodem_reg: db8500_vmodem {
198 regulator-name = "db8500-vmodem";
199 };
200
201 db8500_vpll_reg: db8500_vpll {
202 regulator-name = "db8500-vpll";
203 };
204
205 db8500_vsmps1_reg: db8500_vsmps1 {
206 regulator-name = "db8500-vsmps1";
207 };
208
209 db8500_vsmps2_reg: db8500_vsmps2 {
210 regulator-name = "db8500-vsmps2";
211 };
212
213 db8500_vsmps3_reg: db8500_vsmps3 {
214 regulator-name = "db8500-vsmps3";
215 };
216
217 db8500_vrf1_reg: db8500_vrf1 {
218 regulator-name = "db8500-vrf1";
219 };
220
221 db8500_sva_mmdsp_reg: db8500_sva_mmdsp {
222 regulator-name = "db8500-sva-mmdsp";
223 };
224
225 db8500_sva_mmdsp_ret_reg: db8500_sva_mmdsp_ret {
226 regulator-name = "db8500-sva-mmdsp-ret";
227 };
228
229 db8500_sva_pipe_reg: db8500_sva_pipe {
230 regulator-name = "db8500_sva_pipe";
231 };
232
233 db8500_sia_mmdsp_reg: db8500_sia_mmdsp {
234 regulator-name = "db8500_sia_mmdsp";
235 };
236
237 db8500_sia_mmdsp_ret_reg: db8500_sia_mmdsp_ret {
238 regulator-name = "db8500-sia-mmdsp-ret";
239 };
240
241 db8500_sia_pipe_reg: db8500_sia_pipe {
242 regulator-name = "db8500-sia-pipe";
243 };
244
245 db8500_sga_reg: db8500_sga {
246 regulator-name = "db8500-sga";
247 };
248
249 db8500_b2r2_mcde_reg: db8500_b2r2_mcde {
250 regulator-name = "db8500-b2r2-mcde";
251 };
252
253 db8500_esram12_reg: db8500_esram12 {
254 regulator-name = "db8500-esram12";
255 };
256
257 db8500_esram12_ret_reg: db8500_esram12_ret {
258 regulator-name = "db8500-esram12-ret";
259 };
260
261 db8500_esram34_reg: db8500_esram34 {
262 regulator-name = "db8500-esram34";
263 };
264
265 db8500_esram34_ret_reg: db8500_esram34_ret {
266 regulator-name = "db8500-esram34-ret";
267 };
268 };
269
270 ab8500@5 {
271 ab8500-regulators {
272 ab8500_ldo_aux1_reg: ab8500_ldo_aux1 {
273 regulator-name = "V-DISPLAY";
274 };
275
276 ab8500_ldo_aux2_reg: ab8500_ldo_aux2 {
277 regulator-name = "V-eMMC1";
278 };
279
280 ab8500_ldo_aux3_reg: ab8500_ldo_aux3 {
281 regulator-name = "V-MMC-SD";
282 };
283
284 ab8500_ldo_initcore_reg: ab8500_ldo_initcore {
285 regulator-name = "V-INTCORE";
286 };
287
288 ab8500_ldo_tvout_reg: ab8500_ldo_tvout {
289 regulator-name = "V-TVOUT";
290 };
291
292 ab8500_ldo_usb_reg: ab8500_ldo_usb {
293 regulator-name = "dummy";
294 };
295
296 ab8500_ldo_audio_reg: ab8500_ldo_audio {
297 regulator-name = "V-AUD";
298 };
299
300 ab8500_ldo_anamic1_reg: ab8500_ldo_anamic1 {
301 regulator-name = "V-AMIC1";
302 };
303
304 ab8500_ldo_amamic2_reg: ab8500_ldo_amamic2 {
305 regulator-name = "V-AMIC2";
306 };
307
308 ab8500_ldo_dmic_reg: ab8500_ldo_dmic {
309 regulator-name = "V-DMIC";
310 };
311
312 ab8500_ldo_ana_reg: ab8500_ldo_ana {
313 regulator-name = "V-CSI/DSI";
314 };
315 };
316 };
317 };
186 }; 318 };
187}; 319};
diff --git a/arch/arm/boot/dts/stuib.dtsi b/arch/arm/boot/dts/stuib.dtsi
new file mode 100644
index 000000000000..39446a247e79
--- /dev/null
+++ b/arch/arm/boot/dts/stuib.dtsi
@@ -0,0 +1,78 @@
1/*
2 * Copyright 2012 ST-Ericsson AB
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/ {
13 soc-u9500 {
14 i2c@80004000 {
15 stmpe1601: stmpe1601@40 {
16 compatible = "st,stmpe1601";
17 reg = <0x40>;
18 interrupts = <26 0x1>;
19 interrupt-parent = <&gpio6>;
20 interrupt-controller;
21
22 wakeup-source;
23 st,autosleep-timeout = <1024>;
24
25 stmpe_keypad {
26 compatible = "st,stmpe-keypad";
27
28 debounce-interval = <64>;
29 st,scan-count = <8>;
30 st,no-autorepeat;
31
32 linux,keymap = <0x205006b
33 0x4010074
34 0x3050072
35 0x1030004
36 0x502006a
37 0x500000a
38 0x5008b
39 0x706001c
40 0x405000b
41 0x6070003
42 0x3040067
43 0x303006c
44 0x60400e7
45 0x602009e
46 0x4020073
47 0x5050002
48 0x4030069
49 0x3020008>;
50 };
51 };
52 };
53
54 i2c@80110000 {
55 bu21013_tp@0x5c {
56 compatible = "rhom,bu21013_tp";
57 reg = <0x5c>;
58 touch-gpio = <&gpio2 20 0x4>;
59 avdd-supply = <&ab8500_ldo_aux1_reg>;
60
61 rhom,touch-max-x = <384>;
62 rhom,touch-max-y = <704>;
63 rhom,flip-y;
64 };
65
66 bu21013_tp@0x5d {
67 compatible = "rhom,bu21013_tp";
68 reg = <0x5d>;
69 touch-gpio = <&gpio2 20 0x4>;
70 avdd-supply = <&ab8500_ldo_aux1_reg>;
71
72 rhom,touch-max-x = <384>;
73 rhom,touch-max-y = <704>;
74 rhom,flip-y;
75 };
76 };
77 };
78};
diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts
index c3ef1ad26b6a..43eb72af8948 100644
--- a/arch/arm/boot/dts/tegra20-harmony.dts
+++ b/arch/arm/boot/dts/tegra20-harmony.dts
@@ -10,6 +10,18 @@
10 reg = <0x00000000 0x40000000>; 10 reg = <0x00000000 0x40000000>;
11 }; 11 };
12 12
13 host1x {
14 hdmi {
15 status = "okay";
16
17 vdd-supply = <&hdmi_vdd_reg>;
18 pll-supply = <&hdmi_pll_reg>;
19
20 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
21 nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
22 };
23 };
24
13 pinmux { 25 pinmux {
14 pinctrl-names = "default"; 26 pinctrl-names = "default";
15 pinctrl-0 = <&state_default>; 27 pinctrl-0 = <&state_default>;
@@ -262,9 +274,9 @@
262 }; 274 };
263 }; 275 };
264 276
265 i2c@7000c400 { 277 hdmi_ddc: i2c@7000c400 {
266 status = "okay"; 278 status = "okay";
267 clock-frequency = <400000>; 279 clock-frequency = <100000>;
268 }; 280 };
269 281
270 i2c@7000c500 { 282 i2c@7000c500 {
@@ -297,131 +309,98 @@
297 vinldo9-supply = <&sm2_reg>; 309 vinldo9-supply = <&sm2_reg>;
298 310
299 regulators { 311 regulators {
300 #address-cells = <1>; 312 sys_reg: sys {
301 #size-cells = <0>;
302
303 sys_reg: regulator@0 {
304 reg = <0>;
305 regulator-compatible = "sys";
306 regulator-name = "vdd_sys"; 313 regulator-name = "vdd_sys";
307 regulator-always-on; 314 regulator-always-on;
308 }; 315 };
309 316
310 regulator@1 { 317 sm0 {
311 reg = <1>;
312 regulator-compatible = "sm0";
313 regulator-name = "vdd_sm0,vdd_core"; 318 regulator-name = "vdd_sm0,vdd_core";
314 regulator-min-microvolt = <1200000>; 319 regulator-min-microvolt = <1200000>;
315 regulator-max-microvolt = <1200000>; 320 regulator-max-microvolt = <1200000>;
316 regulator-always-on; 321 regulator-always-on;
317 }; 322 };
318 323
319 regulator@2 { 324 sm1 {
320 reg = <2>;
321 regulator-compatible = "sm1";
322 regulator-name = "vdd_sm1,vdd_cpu"; 325 regulator-name = "vdd_sm1,vdd_cpu";
323 regulator-min-microvolt = <1000000>; 326 regulator-min-microvolt = <1000000>;
324 regulator-max-microvolt = <1000000>; 327 regulator-max-microvolt = <1000000>;
325 regulator-always-on; 328 regulator-always-on;
326 }; 329 };
327 330
328 sm2_reg: regulator@3 { 331 sm2_reg: sm2 {
329 reg = <3>;
330 regulator-compatible = "sm2";
331 regulator-name = "vdd_sm2,vin_ldo*"; 332 regulator-name = "vdd_sm2,vin_ldo*";
332 regulator-min-microvolt = <3700000>; 333 regulator-min-microvolt = <3700000>;
333 regulator-max-microvolt = <3700000>; 334 regulator-max-microvolt = <3700000>;
334 regulator-always-on; 335 regulator-always-on;
335 }; 336 };
336 337
337 regulator@4 { 338 ldo0 {
338 reg = <4>;
339 regulator-compatible = "ldo0";
340 regulator-name = "vdd_ldo0,vddio_pex_clk"; 339 regulator-name = "vdd_ldo0,vddio_pex_clk";
341 regulator-min-microvolt = <3300000>; 340 regulator-min-microvolt = <3300000>;
342 regulator-max-microvolt = <3300000>; 341 regulator-max-microvolt = <3300000>;
343 }; 342 };
344 343
345 regulator@5 { 344 ldo1 {
346 reg = <5>;
347 regulator-compatible = "ldo1";
348 regulator-name = "vdd_ldo1,avdd_pll*"; 345 regulator-name = "vdd_ldo1,avdd_pll*";
349 regulator-min-microvolt = <1100000>; 346 regulator-min-microvolt = <1100000>;
350 regulator-max-microvolt = <1100000>; 347 regulator-max-microvolt = <1100000>;
351 regulator-always-on; 348 regulator-always-on;
352 }; 349 };
353 350
354 regulator@6 { 351 ldo2 {
355 reg = <6>;
356 regulator-compatible = "ldo2";
357 regulator-name = "vdd_ldo2,vdd_rtc"; 352 regulator-name = "vdd_ldo2,vdd_rtc";
358 regulator-min-microvolt = <1200000>; 353 regulator-min-microvolt = <1200000>;
359 regulator-max-microvolt = <1200000>; 354 regulator-max-microvolt = <1200000>;
360 }; 355 };
361 356
362 regulator@7 { 357 ldo3 {
363 reg = <7>;
364 regulator-compatible = "ldo3";
365 regulator-name = "vdd_ldo3,avdd_usb*"; 358 regulator-name = "vdd_ldo3,avdd_usb*";
366 regulator-min-microvolt = <3300000>; 359 regulator-min-microvolt = <3300000>;
367 regulator-max-microvolt = <3300000>; 360 regulator-max-microvolt = <3300000>;
368 regulator-always-on; 361 regulator-always-on;
369 }; 362 };
370 363
371 regulator@8 { 364 ldo4 {
372 reg = <8>;
373 regulator-compatible = "ldo4";
374 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys"; 365 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
375 regulator-min-microvolt = <1800000>; 366 regulator-min-microvolt = <1800000>;
376 regulator-max-microvolt = <1800000>; 367 regulator-max-microvolt = <1800000>;
377 regulator-always-on; 368 regulator-always-on;
378 }; 369 };
379 370
380 regulator@9 { 371 ldo5 {
381 reg = <9>;
382 regulator-compatible = "ldo5";
383 regulator-name = "vdd_ldo5,vcore_mmc"; 372 regulator-name = "vdd_ldo5,vcore_mmc";
384 regulator-min-microvolt = <2850000>; 373 regulator-min-microvolt = <2850000>;
385 regulator-max-microvolt = <2850000>; 374 regulator-max-microvolt = <2850000>;
386 regulator-always-on; 375 regulator-always-on;
387 }; 376 };
388 377
389 regulator@10 { 378 ldo6 {
390 reg = <10>;
391 regulator-compatible = "ldo6";
392 regulator-name = "vdd_ldo6,avdd_vdac"; 379 regulator-name = "vdd_ldo6,avdd_vdac";
393 regulator-min-microvolt = <1800000>; 380 regulator-min-microvolt = <1800000>;
394 regulator-max-microvolt = <1800000>; 381 regulator-max-microvolt = <1800000>;
395 }; 382 };
396 383
397 regulator@11 { 384 hdmi_vdd_reg: ldo7 {
398 reg = <11>;
399 regulator-compatible = "ldo7";
400 regulator-name = "vdd_ldo7,avdd_hdmi"; 385 regulator-name = "vdd_ldo7,avdd_hdmi";
401 regulator-min-microvolt = <3300000>; 386 regulator-min-microvolt = <3300000>;
402 regulator-max-microvolt = <3300000>; 387 regulator-max-microvolt = <3300000>;
403 }; 388 };
404 389
405 regulator@12 { 390 hdmi_pll_reg: ldo8 {
406 reg = <12>;
407 regulator-compatible = "ldo8";
408 regulator-name = "vdd_ldo8,avdd_hdmi_pll"; 391 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
409 regulator-min-microvolt = <1800000>; 392 regulator-min-microvolt = <1800000>;
410 regulator-max-microvolt = <1800000>; 393 regulator-max-microvolt = <1800000>;
411 }; 394 };
412 395
413 regulator@13 { 396 ldo9 {
414 reg = <13>;
415 regulator-compatible = "ldo9";
416 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx"; 397 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
417 regulator-min-microvolt = <2850000>; 398 regulator-min-microvolt = <2850000>;
418 regulator-max-microvolt = <2850000>; 399 regulator-max-microvolt = <2850000>;
419 regulator-always-on; 400 regulator-always-on;
420 }; 401 };
421 402
422 regulator@14 { 403 ldo_rtc {
423 reg = <14>;
424 regulator-compatible = "ldo_rtc";
425 regulator-name = "vdd_rtc_out,vdd_cell"; 404 regulator-name = "vdd_rtc_out,vdd_cell";
426 regulator-min-microvolt = <3300000>; 405 regulator-min-microvolt = <3300000>;
427 regulator-max-microvolt = <3300000>; 406 regulator-max-microvolt = <3300000>;
@@ -429,6 +408,11 @@
429 }; 408 };
430 }; 409 };
431 }; 410 };
411
412 temperature-sensor@4c {
413 compatible = "adi,adt7461";
414 reg = <0x4c>;
415 };
432 }; 416 };
433 417
434 pmc { 418 pmc {
diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index ddf287f52d49..6a93d1404c76 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -291,37 +291,26 @@
291 vinldo9-supply = <&sm2_reg>; 291 vinldo9-supply = <&sm2_reg>;
292 292
293 regulators { 293 regulators {
294 #address-cells = <1>; 294 sys_reg: sys {
295 #size-cells = <0>;
296
297 sys_reg: regulator@0 {
298 reg = <0>;
299 regulator-compatible = "sys";
300 regulator-name = "vdd_sys"; 295 regulator-name = "vdd_sys";
301 regulator-always-on; 296 regulator-always-on;
302 }; 297 };
303 298
304 regulator@1 { 299 sm0 {
305 reg = <1>;
306 regulator-compatible = "sm0";
307 regulator-name = "+1.2vs_sm0,vdd_core"; 300 regulator-name = "+1.2vs_sm0,vdd_core";
308 regulator-min-microvolt = <1200000>; 301 regulator-min-microvolt = <1200000>;
309 regulator-max-microvolt = <1200000>; 302 regulator-max-microvolt = <1200000>;
310 regulator-always-on; 303 regulator-always-on;
311 }; 304 };
312 305
313 regulator@2 { 306 sm1 {
314 reg = <2>;
315 regulator-compatible = "sm1";
316 regulator-name = "+1.0vs_sm1,vdd_cpu"; 307 regulator-name = "+1.0vs_sm1,vdd_cpu";
317 regulator-min-microvolt = <1000000>; 308 regulator-min-microvolt = <1000000>;
318 regulator-max-microvolt = <1000000>; 309 regulator-max-microvolt = <1000000>;
319 regulator-always-on; 310 regulator-always-on;
320 }; 311 };
321 312
322 sm2_reg: regulator@3 { 313 sm2_reg: sm2 {
323 reg = <3>;
324 regulator-compatible = "sm2";
325 regulator-name = "+3.7vs_sm2,vin_ldo*"; 314 regulator-name = "+3.7vs_sm2,vin_ldo*";
326 regulator-min-microvolt = <3700000>; 315 regulator-min-microvolt = <3700000>;
327 regulator-max-microvolt = <3700000>; 316 regulator-max-microvolt = <3700000>;
@@ -330,53 +319,41 @@
330 319
331 /* LDO0 is not connected to anything */ 320 /* LDO0 is not connected to anything */
332 321
333 regulator@5 { 322 ldo1 {
334 reg = <5>;
335 regulator-compatible = "ldo1";
336 regulator-name = "+1.1vs_ldo1,avdd_pll*"; 323 regulator-name = "+1.1vs_ldo1,avdd_pll*";
337 regulator-min-microvolt = <1100000>; 324 regulator-min-microvolt = <1100000>;
338 regulator-max-microvolt = <1100000>; 325 regulator-max-microvolt = <1100000>;
339 regulator-always-on; 326 regulator-always-on;
340 }; 327 };
341 328
342 regulator@6 { 329 ldo2 {
343 reg = <6>;
344 regulator-compatible = "ldo2";
345 regulator-name = "+1.2vs_ldo2,vdd_rtc"; 330 regulator-name = "+1.2vs_ldo2,vdd_rtc";
346 regulator-min-microvolt = <1200000>; 331 regulator-min-microvolt = <1200000>;
347 regulator-max-microvolt = <1200000>; 332 regulator-max-microvolt = <1200000>;
348 }; 333 };
349 334
350 regulator@7 { 335 ldo3 {
351 reg = <7>;
352 regulator-compatible = "ldo3";
353 regulator-name = "+3.3vs_ldo3,avdd_usb*"; 336 regulator-name = "+3.3vs_ldo3,avdd_usb*";
354 regulator-min-microvolt = <3300000>; 337 regulator-min-microvolt = <3300000>;
355 regulator-max-microvolt = <3300000>; 338 regulator-max-microvolt = <3300000>;
356 regulator-always-on; 339 regulator-always-on;
357 }; 340 };
358 341
359 regulator@8 { 342 ldo4 {
360 reg = <8>;
361 regulator-compatible = "ldo4";
362 regulator-name = "+1.8vs_ldo4,avdd_osc,vddio_sys"; 343 regulator-name = "+1.8vs_ldo4,avdd_osc,vddio_sys";
363 regulator-min-microvolt = <1800000>; 344 regulator-min-microvolt = <1800000>;
364 regulator-max-microvolt = <1800000>; 345 regulator-max-microvolt = <1800000>;
365 regulator-always-on; 346 regulator-always-on;
366 }; 347 };
367 348
368 regulator@9 { 349 ldo5 {
369 reg = <9>;
370 regulator-compatible = "ldo5";
371 regulator-name = "+2.85vs_ldo5,vcore_mmc"; 350 regulator-name = "+2.85vs_ldo5,vcore_mmc";
372 regulator-min-microvolt = <2850000>; 351 regulator-min-microvolt = <2850000>;
373 regulator-max-microvolt = <2850000>; 352 regulator-max-microvolt = <2850000>;
374 regulator-always-on; 353 regulator-always-on;
375 }; 354 };
376 355
377 regulator@10 { 356 ldo6 {
378 reg = <10>;
379 regulator-compatible = "ldo6";
380 /* 357 /*
381 * Research indicates this should be 358 * Research indicates this should be
382 * 1.8v; other boards that use this 359 * 1.8v; other boards that use this
@@ -390,34 +367,26 @@
390 regulator-max-microvolt = <1800000>; 367 regulator-max-microvolt = <1800000>;
391 }; 368 };
392 369
393 regulator@11 { 370 ldo7 {
394 reg = <11>;
395 regulator-compatible = "ldo7";
396 regulator-name = "+3.3vs_ldo7,avdd_hdmi"; 371 regulator-name = "+3.3vs_ldo7,avdd_hdmi";
397 regulator-min-microvolt = <3300000>; 372 regulator-min-microvolt = <3300000>;
398 regulator-max-microvolt = <3300000>; 373 regulator-max-microvolt = <3300000>;
399 }; 374 };
400 375
401 regulator@12 { 376 ldo8 {
402 reg = <12>;
403 regulator-compatible = "ldo8";
404 regulator-name = "+1.8vs_ldo8,avdd_hdmi_pll"; 377 regulator-name = "+1.8vs_ldo8,avdd_hdmi_pll";
405 regulator-min-microvolt = <1800000>; 378 regulator-min-microvolt = <1800000>;
406 regulator-max-microvolt = <1800000>; 379 regulator-max-microvolt = <1800000>;
407 }; 380 };
408 381
409 regulator@13 { 382 ldo9 {
410 reg = <13>;
411 regulator-compatible = "ldo9";
412 regulator-name = "+2.85vs_ldo9,vdd_ddr_rx"; 383 regulator-name = "+2.85vs_ldo9,vdd_ddr_rx";
413 regulator-min-microvolt = <2850000>; 384 regulator-min-microvolt = <2850000>;
414 regulator-max-microvolt = <2850000>; 385 regulator-max-microvolt = <2850000>;
415 regulator-always-on; 386 regulator-always-on;
416 }; 387 };
417 388
418 regulator@14 { 389 ldo_rtc {
419 reg = <14>;
420 regulator-compatible = "ldo_rtc";
421 regulator-name = "+3.3vs_rtc"; 390 regulator-name = "+3.3vs_rtc";
422 regulator-min-microvolt = <3300000>; 391 regulator-min-microvolt = <3300000>;
423 regulator-max-microvolt = <3300000>; 392 regulator-max-microvolt = <3300000>;
diff --git a/arch/arm/boot/dts/tegra20-plutux.dts b/arch/arm/boot/dts/tegra20-plutux.dts
index 331a3ef24d59..289480026fbf 100644
--- a/arch/arm/boot/dts/tegra20-plutux.dts
+++ b/arch/arm/boot/dts/tegra20-plutux.dts
@@ -6,6 +6,12 @@
6 model = "Avionic Design Plutux board"; 6 model = "Avionic Design Plutux board";
7 compatible = "ad,plutux", "ad,tamonten", "nvidia,tegra20"; 7 compatible = "ad,plutux", "ad,tamonten", "nvidia,tegra20";
8 8
9 host1x {
10 hdmi {
11 status = "okay";
12 };
13 };
14
9 i2c@7000c000 { 15 i2c@7000c000 {
10 wm8903: wm8903@1a { 16 wm8903: wm8903@1a {
11 compatible = "wlf,wm8903"; 17 compatible = "wlf,wm8903";
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts
index f0ba901676ac..eafeca65eb21 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts
@@ -395,37 +395,26 @@
395 vinldo9-supply = <&sm2_reg>; 395 vinldo9-supply = <&sm2_reg>;
396 396
397 regulators { 397 regulators {
398 #address-cells = <1>; 398 sys_reg: sys {
399 #size-cells = <0>;
400
401 sys_reg: regulator@0 {
402 reg = <0>;
403 regulator-compatible = "sys";
404 regulator-name = "vdd_sys"; 399 regulator-name = "vdd_sys";
405 regulator-always-on; 400 regulator-always-on;
406 }; 401 };
407 402
408 regulator@1 { 403 sm0 {
409 reg = <1>;
410 regulator-compatible = "sm0";
411 regulator-name = "vdd_sm0,vdd_core"; 404 regulator-name = "vdd_sm0,vdd_core";
412 regulator-min-microvolt = <1300000>; 405 regulator-min-microvolt = <1300000>;
413 regulator-max-microvolt = <1300000>; 406 regulator-max-microvolt = <1300000>;
414 regulator-always-on; 407 regulator-always-on;
415 }; 408 };
416 409
417 regulator@2 { 410 sm1 {
418 reg = <2>;
419 regulator-compatible = "sm1";
420 regulator-name = "vdd_sm1,vdd_cpu"; 411 regulator-name = "vdd_sm1,vdd_cpu";
421 regulator-min-microvolt = <1125000>; 412 regulator-min-microvolt = <1125000>;
422 regulator-max-microvolt = <1125000>; 413 regulator-max-microvolt = <1125000>;
423 regulator-always-on; 414 regulator-always-on;
424 }; 415 };
425 416
426 sm2_reg: regulator@3 { 417 sm2_reg: sm2 {
427 reg = <3>;
428 regulator-compatible = "sm2";
429 regulator-name = "vdd_sm2,vin_ldo*"; 418 regulator-name = "vdd_sm2,vin_ldo*";
430 regulator-min-microvolt = <3700000>; 419 regulator-min-microvolt = <3700000>;
431 regulator-max-microvolt = <3700000>; 420 regulator-max-microvolt = <3700000>;
@@ -434,86 +423,66 @@
434 423
435 /* LDO0 is not connected to anything */ 424 /* LDO0 is not connected to anything */
436 425
437 regulator@5 { 426 ldo1 {
438 reg = <5>;
439 regulator-compatible = "ldo1";
440 regulator-name = "vdd_ldo1,avdd_pll*"; 427 regulator-name = "vdd_ldo1,avdd_pll*";
441 regulator-min-microvolt = <1100000>; 428 regulator-min-microvolt = <1100000>;
442 regulator-max-microvolt = <1100000>; 429 regulator-max-microvolt = <1100000>;
443 regulator-always-on; 430 regulator-always-on;
444 }; 431 };
445 432
446 regulator@6 { 433 ldo2 {
447 reg = <6>;
448 regulator-compatible = "ldo2";
449 regulator-name = "vdd_ldo2,vdd_rtc"; 434 regulator-name = "vdd_ldo2,vdd_rtc";
450 regulator-min-microvolt = <1200000>; 435 regulator-min-microvolt = <1200000>;
451 regulator-max-microvolt = <1200000>; 436 regulator-max-microvolt = <1200000>;
452 }; 437 };
453 438
454 regulator@7 { 439 ldo3 {
455 reg = <7>;
456 regulator-compatible = "ldo3";
457 regulator-name = "vdd_ldo3,avdd_usb*"; 440 regulator-name = "vdd_ldo3,avdd_usb*";
458 regulator-min-microvolt = <3300000>; 441 regulator-min-microvolt = <3300000>;
459 regulator-max-microvolt = <3300000>; 442 regulator-max-microvolt = <3300000>;
460 regulator-always-on; 443 regulator-always-on;
461 }; 444 };
462 445
463 regulator@8 { 446 ldo4 {
464 reg = <8>;
465 regulator-compatible = "ldo4";
466 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys"; 447 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
467 regulator-min-microvolt = <1800000>; 448 regulator-min-microvolt = <1800000>;
468 regulator-max-microvolt = <1800000>; 449 regulator-max-microvolt = <1800000>;
469 regulator-always-on; 450 regulator-always-on;
470 }; 451 };
471 452
472 regulator@9 { 453 ldo5 {
473 reg = <9>;
474 regulator-compatible = "ldo5";
475 regulator-name = "vdd_ldo5,vcore_mmc"; 454 regulator-name = "vdd_ldo5,vcore_mmc";
476 regulator-min-microvolt = <2850000>; 455 regulator-min-microvolt = <2850000>;
477 regulator-max-microvolt = <2850000>; 456 regulator-max-microvolt = <2850000>;
478 regulator-always-on; 457 regulator-always-on;
479 }; 458 };
480 459
481 regulator@10 { 460 ldo6 {
482 reg = <10>;
483 regulator-compatible = "ldo6";
484 regulator-name = "vdd_ldo6,avdd_vdac,vddio_vi,vddio_cam"; 461 regulator-name = "vdd_ldo6,avdd_vdac,vddio_vi,vddio_cam";
485 regulator-min-microvolt = <1800000>; 462 regulator-min-microvolt = <1800000>;
486 regulator-max-microvolt = <1800000>; 463 regulator-max-microvolt = <1800000>;
487 }; 464 };
488 465
489 regulator@11 { 466 ldo7 {
490 reg = <11>;
491 regulator-compatible = "ldo7";
492 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse"; 467 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse";
493 regulator-min-microvolt = <3300000>; 468 regulator-min-microvolt = <3300000>;
494 regulator-max-microvolt = <3300000>; 469 regulator-max-microvolt = <3300000>;
495 }; 470 };
496 471
497 regulator@12 { 472 ldo8 {
498 reg = <12>;
499 regulator-compatible = "ldo8";
500 regulator-name = "vdd_ldo8,avdd_hdmi_pll"; 473 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
501 regulator-min-microvolt = <1800000>; 474 regulator-min-microvolt = <1800000>;
502 regulator-max-microvolt = <1800000>; 475 regulator-max-microvolt = <1800000>;
503 }; 476 };
504 477
505 regulator@13 { 478 ldo9 {
506 reg = <13>;
507 regulator-compatible = "ldo9";
508 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx"; 479 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
509 regulator-min-microvolt = <2850000>; 480 regulator-min-microvolt = <2850000>;
510 regulator-max-microvolt = <2850000>; 481 regulator-max-microvolt = <2850000>;
511 regulator-always-on; 482 regulator-always-on;
512 }; 483 };
513 484
514 regulator@14 { 485 ldo_rtc {
515 reg = <14>;
516 regulator-compatible = "ldo_rtc";
517 regulator-name = "vdd_rtc_out,vdd_cell"; 486 regulator-name = "vdd_rtc_out,vdd_cell";
518 regulator-min-microvolt = <3300000>; 487 regulator-min-microvolt = <3300000>;
519 regulator-max-microvolt = <3300000>; 488 regulator-max-microvolt = <3300000>;
@@ -592,6 +561,12 @@
592 status = "okay"; 561 status = "okay";
593 }; 562 };
594 563
564 sdhci@c8000000 {
565 status = "okay";
566 power-gpios = <&gpio 86 0>; /* gpio PK6 */
567 bus-width = <4>;
568 };
569
595 sdhci@c8000400 { 570 sdhci@c8000400 {
596 status = "okay"; 571 status = "okay";
597 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 572 cd-gpios = <&gpio 69 0>; /* gpio PI5 */
diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi b/arch/arm/boot/dts/tegra20-tamonten.dtsi
index f18cec9f6a77..a239ccdfaa52 100644
--- a/arch/arm/boot/dts/tegra20-tamonten.dtsi
+++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi
@@ -8,6 +8,16 @@
8 reg = <0x00000000 0x20000000>; 8 reg = <0x00000000 0x20000000>;
9 }; 9 };
10 10
11 host1x {
12 hdmi {
13 vdd-supply = <&hdmi_vdd_reg>;
14 pll-supply = <&hdmi_pll_reg>;
15
16 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
17 nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
18 };
19 };
20
11 pinmux { 21 pinmux {
12 pinctrl-names = "default"; 22 pinctrl-names = "default";
13 pinctrl-0 = <&state_default>; 23 pinctrl-0 = <&state_default>;
@@ -62,10 +72,6 @@
62 nvidia,pins = "dap4"; 72 nvidia,pins = "dap4";
63 nvidia,function = "dap4"; 73 nvidia,function = "dap4";
64 }; 74 };
65 ddc {
66 nvidia,pins = "ddc";
67 nvidia,function = "i2c2";
68 };
69 dta { 75 dta {
70 nvidia,pins = "dta", "dtd"; 76 nvidia,pins = "dta", "dtd";
71 nvidia,function = "sdio2"; 77 nvidia,function = "sdio2";
@@ -91,7 +97,7 @@
91 nvidia,function = "pcie"; 97 nvidia,function = "pcie";
92 }; 98 };
93 hdint { 99 hdint {
94 nvidia,pins = "hdint", "pta"; 100 nvidia,pins = "hdint";
95 nvidia,function = "hdmi"; 101 nvidia,function = "hdmi";
96 }; 102 };
97 i2cp { 103 i2cp {
@@ -230,6 +236,39 @@
230 nvidia,pull = <1>; 236 nvidia,pull = <1>;
231 }; 237 };
232 }; 238 };
239
240 state_i2cmux_ddc: pinmux_i2cmux_ddc {
241 ddc {
242 nvidia,pins = "ddc";
243 nvidia,function = "i2c2";
244 };
245 pta {
246 nvidia,pins = "pta";
247 nvidia,function = "rsvd4";
248 };
249 };
250
251 state_i2cmux_pta: pinmux_i2cmux_pta {
252 ddc {
253 nvidia,pins = "ddc";
254 nvidia,function = "rsvd4";
255 };
256 pta {
257 nvidia,pins = "pta";
258 nvidia,function = "i2c2";
259 };
260 };
261
262 state_i2cmux_idle: pinmux_i2cmux_idle {
263 ddc {
264 nvidia,pins = "ddc";
265 nvidia,function = "rsvd4";
266 };
267 pta {
268 nvidia,pins = "pta";
269 nvidia,function = "rsvd4";
270 };
271 };
233 }; 272 };
234 273
235 i2s@70002800 { 274 i2s@70002800 {
@@ -246,6 +285,36 @@
246 status = "okay"; 285 status = "okay";
247 }; 286 };
248 287
288 i2c@7000c400 {
289 clock-frequency = <100000>;
290 status = "okay";
291 };
292
293 i2cmux {
294 compatible = "i2c-mux-pinctrl";
295 #address-cells = <1>;
296 #size-cells = <0>;
297
298 i2c-parent = <&{/i2c@7000c400}>;
299
300 pinctrl-names = "ddc", "pta", "idle";
301 pinctrl-0 = <&state_i2cmux_ddc>;
302 pinctrl-1 = <&state_i2cmux_pta>;
303 pinctrl-2 = <&state_i2cmux_idle>;
304
305 hdmi_ddc: i2c@0 {
306 reg = <0>;
307 #address-cells = <1>;
308 #size-cells = <0>;
309 };
310
311 i2c@1 {
312 reg = <1>;
313 #address-cells = <1>;
314 #size-cells = <0>;
315 };
316 };
317
249 i2c@7000d000 { 318 i2c@7000d000 {
250 clock-frequency = <400000>; 319 clock-frequency = <400000>;
251 status = "okay"; 320 status = "okay";
@@ -271,97 +340,72 @@
271 vinldo9-supply = <&sm2_reg>; 340 vinldo9-supply = <&sm2_reg>;
272 341
273 regulators { 342 regulators {
274 #address-cells = <1>; 343 sys_reg: sys {
275 #size-cells = <0>;
276
277 sys_reg: regulator@0 {
278 reg = <0>;
279 regulator-compatible = "sys";
280 regulator-name = "vdd_sys"; 344 regulator-name = "vdd_sys";
281 regulator-always-on; 345 regulator-always-on;
282 }; 346 };
283 347
284 regulator@1 { 348 sm0 {
285 reg = <1>;
286 regulator-compatible = "sm0";
287 regulator-name = "vdd_sys_sm0,vdd_core"; 349 regulator-name = "vdd_sys_sm0,vdd_core";
288 regulator-min-microvolt = <1200000>; 350 regulator-min-microvolt = <1200000>;
289 regulator-max-microvolt = <1200000>; 351 regulator-max-microvolt = <1200000>;
290 regulator-always-on; 352 regulator-always-on;
291 }; 353 };
292 354
293 regulator@2 { 355 sm1 {
294 reg = <2>;
295 regulator-compatible = "sm1";
296 regulator-name = "vdd_sys_sm1,vdd_cpu"; 356 regulator-name = "vdd_sys_sm1,vdd_cpu";
297 regulator-min-microvolt = <1000000>; 357 regulator-min-microvolt = <1000000>;
298 regulator-max-microvolt = <1000000>; 358 regulator-max-microvolt = <1000000>;
299 regulator-always-on; 359 regulator-always-on;
300 }; 360 };
301 361
302 sm2_reg: regulator@3 { 362 sm2_reg: sm2 {
303 reg = <3>;
304 regulator-compatible = "sm2";
305 regulator-name = "vdd_sys_sm2,vin_ldo*"; 363 regulator-name = "vdd_sys_sm2,vin_ldo*";
306 regulator-min-microvolt = <3700000>; 364 regulator-min-microvolt = <3700000>;
307 regulator-max-microvolt = <3700000>; 365 regulator-max-microvolt = <3700000>;
308 regulator-always-on; 366 regulator-always-on;
309 }; 367 };
310 368
311 regulator@4 { 369 ldo0 {
312 reg = <4>;
313 regulator-compatible = "ldo0";
314 regulator-name = "vdd_ldo0,vddio_pex_clk"; 370 regulator-name = "vdd_ldo0,vddio_pex_clk";
315 regulator-min-microvolt = <3300000>; 371 regulator-min-microvolt = <3300000>;
316 regulator-max-microvolt = <3300000>; 372 regulator-max-microvolt = <3300000>;
317 }; 373 };
318 374
319 regulator@5 { 375 ldo1 {
320 reg = <5>;
321 regulator-compatible = "ldo1";
322 regulator-name = "vdd_ldo1,avdd_pll*"; 376 regulator-name = "vdd_ldo1,avdd_pll*";
323 regulator-min-microvolt = <1100000>; 377 regulator-min-microvolt = <1100000>;
324 regulator-max-microvolt = <1100000>; 378 regulator-max-microvolt = <1100000>;
325 regulator-always-on; 379 regulator-always-on;
326 }; 380 };
327 381
328 regulator@6 { 382 ldo2 {
329 reg = <6>;
330 regulator-compatible = "ldo2";
331 regulator-name = "vdd_ldo2,vdd_rtc"; 383 regulator-name = "vdd_ldo2,vdd_rtc";
332 regulator-min-microvolt = <1200000>; 384 regulator-min-microvolt = <1200000>;
333 regulator-max-microvolt = <1200000>; 385 regulator-max-microvolt = <1200000>;
334 }; 386 };
335 387
336 regulator@7 { 388 ldo3 {
337 reg = <7>;
338 regulator-compatible = "ldo3";
339 regulator-name = "vdd_ldo3,avdd_usb*"; 389 regulator-name = "vdd_ldo3,avdd_usb*";
340 regulator-min-microvolt = <3300000>; 390 regulator-min-microvolt = <3300000>;
341 regulator-max-microvolt = <3300000>; 391 regulator-max-microvolt = <3300000>;
342 regulator-always-on; 392 regulator-always-on;
343 }; 393 };
344 394
345 regulator@8 { 395 ldo4 {
346 reg = <8>;
347 regulator-compatible = "ldo4";
348 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys"; 396 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
349 regulator-min-microvolt = <1800000>; 397 regulator-min-microvolt = <1800000>;
350 regulator-max-microvolt = <1800000>; 398 regulator-max-microvolt = <1800000>;
351 regulator-always-on; 399 regulator-always-on;
352 }; 400 };
353 401
354 regulator@9 { 402 ldo5 {
355 reg = <9>;
356 regulator-compatible = "ldo5";
357 regulator-name = "vdd_ldo5,vcore_mmc"; 403 regulator-name = "vdd_ldo5,vcore_mmc";
358 regulator-min-microvolt = <2850000>; 404 regulator-min-microvolt = <2850000>;
359 regulator-max-microvolt = <2850000>; 405 regulator-max-microvolt = <2850000>;
360 }; 406 };
361 407
362 regulator@10 { 408 ldo6 {
363 reg = <10>;
364 regulator-compatible = "ldo6";
365 regulator-name = "vdd_ldo6,avdd_vdac"; 409 regulator-name = "vdd_ldo6,avdd_vdac";
366 /* 410 /*
367 * According to the Tegra 2 Automotive 411 * According to the Tegra 2 Automotive
@@ -373,25 +417,19 @@
373 regulator-max-microvolt = <2850000>; 417 regulator-max-microvolt = <2850000>;
374 }; 418 };
375 419
376 regulator@11 { 420 hdmi_vdd_reg: ldo7 {
377 reg = <11>;
378 regulator-compatible = "ldo7";
379 regulator-name = "vdd_ldo7,avdd_hdmi"; 421 regulator-name = "vdd_ldo7,avdd_hdmi";
380 regulator-min-microvolt = <3300000>; 422 regulator-min-microvolt = <3300000>;
381 regulator-max-microvolt = <3300000>; 423 regulator-max-microvolt = <3300000>;
382 }; 424 };
383 425
384 regulator@12 { 426 hdmi_pll_reg: ldo8 {
385 reg = <12>;
386 regulator-compatible = "ldo8";
387 regulator-name = "vdd_ldo8,avdd_hdmi_pll"; 427 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
388 regulator-min-microvolt = <1800000>; 428 regulator-min-microvolt = <1800000>;
389 regulator-max-microvolt = <1800000>; 429 regulator-max-microvolt = <1800000>;
390 }; 430 };
391 431
392 regulator@13 { 432 ldo9 {
393 reg = <13>;
394 regulator-compatible = "ldo9";
395 regulator-name = "vdd_ldo9,vdd_ddr_rx,avdd_cam"; 433 regulator-name = "vdd_ldo9,vdd_ddr_rx,avdd_cam";
396 /* 434 /*
397 * According to the Tegra 2 Automotive 435 * According to the Tegra 2 Automotive
@@ -404,9 +442,7 @@
404 regulator-always-on; 442 regulator-always-on;
405 }; 443 };
406 444
407 regulator@14 { 445 ldo_rtc {
408 reg = <14>;
409 regulator-compatible = "ldo_rtc";
410 regulator-name = "vdd_rtc_out"; 446 regulator-name = "vdd_rtc_out";
411 regulator-min-microvolt = <3300000>; 447 regulator-min-microvolt = <3300000>;
412 regulator-max-microvolt = <3300000>; 448 regulator-max-microvolt = <3300000>;
@@ -414,6 +450,11 @@
414 }; 450 };
415 }; 451 };
416 }; 452 };
453
454 temperature-sensor@4c {
455 compatible = "onnn,nct1008";
456 reg = <0x4c>;
457 };
417 }; 458 };
418 459
419 pmc { 460 pmc {
diff --git a/arch/arm/boot/dts/tegra20-tec.dts b/arch/arm/boot/dts/tegra20-tec.dts
index 9aff31b0fe4a..402b21004bef 100644
--- a/arch/arm/boot/dts/tegra20-tec.dts
+++ b/arch/arm/boot/dts/tegra20-tec.dts
@@ -6,10 +6,13 @@
6 model = "Avionic Design Tamonten Evaluation Carrier"; 6 model = "Avionic Design Tamonten Evaluation Carrier";
7 compatible = "ad,tec", "ad,tamonten", "nvidia,tegra20"; 7 compatible = "ad,tec", "ad,tamonten", "nvidia,tegra20";
8 8
9 i2c@7000c000 { 9 host1x {
10 clock-frequency = <400000>; 10 hdmi {
11 status = "okay"; 11 status = "okay";
12 };
13 };
12 14
15 i2c@7000c000 {
13 wm8903: wm8903@1a { 16 wm8903: wm8903@1a {
14 compatible = "wlf,wm8903"; 17 compatible = "wlf,wm8903";
15 reg = <0x1a>; 18 reg = <0x1a>;
diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts b/arch/arm/boot/dts/tegra20-trimslice.dts
index 27fb8a67ea42..b70b4cb754c8 100644
--- a/arch/arm/boot/dts/tegra20-trimslice.dts
+++ b/arch/arm/boot/dts/tegra20-trimslice.dts
@@ -10,6 +10,18 @@
10 reg = <0x00000000 0x40000000>; 10 reg = <0x00000000 0x40000000>;
11 }; 11 };
12 12
13 host1x {
14 hdmi {
15 status = "okay";
16
17 vdd-supply = <&hdmi_vdd_reg>;
18 pll-supply = <&hdmi_pll_reg>;
19
20 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
21 nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
22 };
23 };
24
13 pinmux { 25 pinmux {
14 pinctrl-names = "default"; 26 pinctrl-names = "default";
15 pinctrl-0 = <&state_default>; 27 pinctrl-0 = <&state_default>;
@@ -249,14 +261,24 @@
249 clock-frequency = <216000000>; 261 clock-frequency = <216000000>;
250 }; 262 };
251 263
252 i2c@7000c000 { 264 dvi_ddc: i2c@7000c000 {
253 status = "okay"; 265 status = "okay";
254 clock-frequency = <400000>; 266 clock-frequency = <100000>;
255 }; 267 };
256 268
257 i2c@7000c400 { 269 spi@7000c380 {
258 status = "okay"; 270 status = "okay";
259 clock-frequency = <400000>; 271 spi-max-frequency = <48000000>;
272 spi-flash@0 {
273 compatible = "winbond,w25q80bl";
274 reg = <0>;
275 spi-max-frequency = <48000000>;
276 };
277 };
278
279 hdmi_ddc: i2c@7000c400 {
280 status = "okay";
281 clock-frequency = <100000>;
260 }; 282 };
261 283
262 i2c@7000c500 { 284 i2c@7000c500 {
@@ -300,6 +322,30 @@
300 bus-width = <4>; 322 bus-width = <4>;
301 }; 323 };
302 324
325 regulators {
326 compatible = "simple-bus";
327 #address-cells = <1>;
328 #size-cells = <0>;
329
330 hdmi_vdd_reg: regulator@0 {
331 compatible = "regulator-fixed";
332 reg = <0>;
333 regulator-name = "avdd_hdmi";
334 regulator-min-microvolt = <3300000>;
335 regulator-max-microvolt = <3300000>;
336 regulator-always-on;
337 };
338
339 hdmi_pll_reg: regulator@1 {
340 compatible = "regulator-fixed";
341 reg = <1>;
342 regulator-name = "avdd_hdmi_pll";
343 regulator-min-microvolt = <1800000>;
344 regulator-max-microvolt = <1800000>;
345 regulator-always-on;
346 };
347 };
348
303 sound { 349 sound {
304 compatible = "nvidia,tegra-audio-trimslice"; 350 compatible = "nvidia,tegra-audio-trimslice";
305 nvidia,i2s-controller = <&tegra_i2s1>; 351 nvidia,i2s-controller = <&tegra_i2s1>;
diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts
index 3e5952fcfbc5..adc47547eaae 100644
--- a/arch/arm/boot/dts/tegra20-ventana.dts
+++ b/arch/arm/boot/dts/tegra20-ventana.dts
@@ -64,11 +64,6 @@
64 nvidia,pins = "dap4"; 64 nvidia,pins = "dap4";
65 nvidia,function = "dap4"; 65 nvidia,function = "dap4";
66 }; 66 };
67 ddc {
68 nvidia,pins = "ddc", "owc", "spdi", "spdo",
69 "uac";
70 nvidia,function = "rsvd2";
71 };
72 dta { 67 dta {
73 nvidia,pins = "dta", "dtb", "dtc", "dtd", "dte"; 68 nvidia,pins = "dta", "dtb", "dtc", "dtd", "dte";
74 nvidia,function = "vi"; 69 nvidia,function = "vi";
@@ -98,7 +93,7 @@
98 nvidia,function = "pcie"; 93 nvidia,function = "pcie";
99 }; 94 };
100 hdint { 95 hdint {
101 nvidia,pins = "hdint", "pta"; 96 nvidia,pins = "hdint";
102 nvidia,function = "hdmi"; 97 nvidia,function = "hdmi";
103 }; 98 };
104 i2cp { 99 i2cp {
@@ -129,6 +124,10 @@
129 "lspi", "lvp1", "lvs"; 124 "lspi", "lvp1", "lvs";
130 nvidia,function = "displaya"; 125 nvidia,function = "displaya";
131 }; 126 };
127 owc {
128 nvidia,pins = "owc", "spdi", "spdo", "uac";
129 nvidia,function = "rsvd2";
130 };
132 pmc { 131 pmc {
133 nvidia,pins = "pmc"; 132 nvidia,pins = "pmc";
134 nvidia,function = "pwr_on"; 133 nvidia,function = "pwr_on";
@@ -237,6 +236,49 @@
237 "ld23_22"; 236 "ld23_22";
238 nvidia,pull = <1>; 237 nvidia,pull = <1>;
239 }; 238 };
239 drive_sdio1 {
240 nvidia,pins = "drive_sdio1";
241 nvidia,high-speed-mode = <0>;
242 nvidia,schmitt = <1>;
243 nvidia,low-power-mode = <3>;
244 nvidia,pull-down-strength = <31>;
245 nvidia,pull-up-strength = <31>;
246 nvidia,slew-rate-rising = <3>;
247 nvidia,slew-rate-falling = <3>;
248 };
249 };
250
251 state_i2cmux_ddc: pinmux_i2cmux_ddc {
252 ddc {
253 nvidia,pins = "ddc";
254 nvidia,function = "i2c2";
255 };
256 pta {
257 nvidia,pins = "pta";
258 nvidia,function = "rsvd4";
259 };
260 };
261
262 state_i2cmux_pta: pinmux_i2cmux_pta {
263 ddc {
264 nvidia,pins = "ddc";
265 nvidia,function = "rsvd4";
266 };
267 pta {
268 nvidia,pins = "pta";
269 nvidia,function = "i2c2";
270 };
271 };
272
273 state_i2cmux_idle: pinmux_i2cmux_idle {
274 ddc {
275 nvidia,pins = "ddc";
276 nvidia,function = "rsvd4";
277 };
278 pta {
279 nvidia,pins = "pta";
280 nvidia,function = "rsvd4";
281 };
240 }; 282 };
241 }; 283 };
242 284
@@ -281,6 +323,31 @@
281 clock-frequency = <400000>; 323 clock-frequency = <400000>;
282 }; 324 };
283 325
326 i2cmux {
327 compatible = "i2c-mux-pinctrl";
328 #address-cells = <1>;
329 #size-cells = <0>;
330
331 i2c-parent = <&{/i2c@7000c400}>;
332
333 pinctrl-names = "ddc", "pta", "idle";
334 pinctrl-0 = <&state_i2cmux_ddc>;
335 pinctrl-1 = <&state_i2cmux_pta>;
336 pinctrl-2 = <&state_i2cmux_idle>;
337
338 i2c@0 {
339 reg = <0>;
340 #address-cells = <1>;
341 #size-cells = <0>;
342 };
343
344 i2c@1 {
345 reg = <1>;
346 #address-cells = <1>;
347 #size-cells = <0>;
348 };
349 };
350
284 i2c@7000c500 { 351 i2c@7000c500 {
285 status = "okay"; 352 status = "okay";
286 clock-frequency = <400000>; 353 clock-frequency = <400000>;
@@ -311,37 +378,26 @@
311 vinldo9-supply = <&sm2_reg>; 378 vinldo9-supply = <&sm2_reg>;
312 379
313 regulators { 380 regulators {
314 #address-cells = <1>; 381 sys_reg: sys {
315 #size-cells = <0>;
316
317 sys_reg: regulator@0 {
318 reg = <0>;
319 regulator-compatible = "sys";
320 regulator-name = "vdd_sys"; 382 regulator-name = "vdd_sys";
321 regulator-always-on; 383 regulator-always-on;
322 }; 384 };
323 385
324 regulator@1 { 386 sm0 {
325 reg = <1>;
326 regulator-compatible = "sm0";
327 regulator-name = "vdd_sm0,vdd_core"; 387 regulator-name = "vdd_sm0,vdd_core";
328 regulator-min-microvolt = <1200000>; 388 regulator-min-microvolt = <1200000>;
329 regulator-max-microvolt = <1200000>; 389 regulator-max-microvolt = <1200000>;
330 regulator-always-on; 390 regulator-always-on;
331 }; 391 };
332 392
333 regulator@2 { 393 sm1 {
334 reg = <2>;
335 regulator-compatible = "sm1";
336 regulator-name = "vdd_sm1,vdd_cpu"; 394 regulator-name = "vdd_sm1,vdd_cpu";
337 regulator-min-microvolt = <1000000>; 395 regulator-min-microvolt = <1000000>;
338 regulator-max-microvolt = <1000000>; 396 regulator-max-microvolt = <1000000>;
339 regulator-always-on; 397 regulator-always-on;
340 }; 398 };
341 399
342 sm2_reg: regulator@3 { 400 sm2_reg: sm2 {
343 reg = <3>;
344 regulator-compatible = "sm2";
345 regulator-name = "vdd_sm2,vin_ldo*"; 401 regulator-name = "vdd_sm2,vin_ldo*";
346 regulator-min-microvolt = <3700000>; 402 regulator-min-microvolt = <3700000>;
347 regulator-max-microvolt = <3700000>; 403 regulator-max-microvolt = <3700000>;
@@ -350,86 +406,66 @@
350 406
351 /* LDO0 is not connected to anything */ 407 /* LDO0 is not connected to anything */
352 408
353 regulator@5 { 409 ldo1 {
354 reg = <5>;
355 regulator-compatible = "ldo1";
356 regulator-name = "vdd_ldo1,avdd_pll*"; 410 regulator-name = "vdd_ldo1,avdd_pll*";
357 regulator-min-microvolt = <1100000>; 411 regulator-min-microvolt = <1100000>;
358 regulator-max-microvolt = <1100000>; 412 regulator-max-microvolt = <1100000>;
359 regulator-always-on; 413 regulator-always-on;
360 }; 414 };
361 415
362 regulator@6 { 416 ldo2 {
363 reg = <6>;
364 regulator-compatible = "ldo2";
365 regulator-name = "vdd_ldo2,vdd_rtc"; 417 regulator-name = "vdd_ldo2,vdd_rtc";
366 regulator-min-microvolt = <1200000>; 418 regulator-min-microvolt = <1200000>;
367 regulator-max-microvolt = <1200000>; 419 regulator-max-microvolt = <1200000>;
368 }; 420 };
369 421
370 regulator@7 { 422 ldo3 {
371 reg = <7>;
372 regulator-compatible = "ldo3";
373 regulator-name = "vdd_ldo3,avdd_usb*"; 423 regulator-name = "vdd_ldo3,avdd_usb*";
374 regulator-min-microvolt = <3300000>; 424 regulator-min-microvolt = <3300000>;
375 regulator-max-microvolt = <3300000>; 425 regulator-max-microvolt = <3300000>;
376 regulator-always-on; 426 regulator-always-on;
377 }; 427 };
378 428
379 regulator@8 { 429 ldo4 {
380 reg = <8>;
381 regulator-compatible = "ldo4";
382 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys"; 430 regulator-name = "vdd_ldo4,avdd_osc,vddio_sys";
383 regulator-min-microvolt = <1800000>; 431 regulator-min-microvolt = <1800000>;
384 regulator-max-microvolt = <1800000>; 432 regulator-max-microvolt = <1800000>;
385 regulator-always-on; 433 regulator-always-on;
386 }; 434 };
387 435
388 regulator@9 { 436 ldo5 {
389 reg = <9>;
390 regulator-compatible = "ldo5";
391 regulator-name = "vdd_ldo5,vcore_mmc"; 437 regulator-name = "vdd_ldo5,vcore_mmc";
392 regulator-min-microvolt = <2850000>; 438 regulator-min-microvolt = <2850000>;
393 regulator-max-microvolt = <2850000>; 439 regulator-max-microvolt = <2850000>;
394 regulator-always-on; 440 regulator-always-on;
395 }; 441 };
396 442
397 regulator@10 { 443 ldo6 {
398 reg = <10>;
399 regulator-compatible = "ldo6";
400 regulator-name = "vdd_ldo6,avdd_vdac"; 444 regulator-name = "vdd_ldo6,avdd_vdac";
401 regulator-min-microvolt = <1800000>; 445 regulator-min-microvolt = <1800000>;
402 regulator-max-microvolt = <1800000>; 446 regulator-max-microvolt = <1800000>;
403 }; 447 };
404 448
405 regulator@11 { 449 ldo7 {
406 reg = <11>;
407 regulator-compatible = "ldo7";
408 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse"; 450 regulator-name = "vdd_ldo7,avdd_hdmi,vdd_fuse";
409 regulator-min-microvolt = <3300000>; 451 regulator-min-microvolt = <3300000>;
410 regulator-max-microvolt = <3300000>; 452 regulator-max-microvolt = <3300000>;
411 }; 453 };
412 454
413 regulator@12 { 455 ldo8 {
414 reg = <12>;
415 regulator-compatible = "ldo8";
416 regulator-name = "vdd_ldo8,avdd_hdmi_pll"; 456 regulator-name = "vdd_ldo8,avdd_hdmi_pll";
417 regulator-min-microvolt = <1800000>; 457 regulator-min-microvolt = <1800000>;
418 regulator-max-microvolt = <1800000>; 458 regulator-max-microvolt = <1800000>;
419 }; 459 };
420 460
421 regulator@13 { 461 ldo9 {
422 reg = <13>;
423 regulator-compatible = "ldo9";
424 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx"; 462 regulator-name = "vdd_ldo9,avdd_2v85,vdd_ddr_rx";
425 regulator-min-microvolt = <2850000>; 463 regulator-min-microvolt = <2850000>;
426 regulator-max-microvolt = <2850000>; 464 regulator-max-microvolt = <2850000>;
427 regulator-always-on; 465 regulator-always-on;
428 }; 466 };
429 467
430 regulator@14 { 468 ldo_rtc {
431 reg = <14>;
432 regulator-compatible = "ldo_rtc";
433 regulator-name = "vdd_rtc_out,vdd_cell"; 469 regulator-name = "vdd_rtc_out,vdd_cell";
434 regulator-min-microvolt = <3300000>; 470 regulator-min-microvolt = <3300000>;
435 regulator-max-microvolt = <3300000>; 471 regulator-max-microvolt = <3300000>;
@@ -437,6 +473,11 @@
437 }; 473 };
438 }; 474 };
439 }; 475 };
476
477 temperature-sensor@4c {
478 compatible = "onnn,nct1008";
479 reg = <0x4c>;
480 };
440 }; 481 };
441 482
442 pmc { 483 pmc {
@@ -456,6 +497,12 @@
456 status = "okay"; 497 status = "okay";
457 }; 498 };
458 499
500 sdhci@c8000000 {
501 status = "okay";
502 power-gpios = <&gpio 86 0>; /* gpio PK6 */
503 bus-width = <4>;
504 };
505
459 sdhci@c8000400 { 506 sdhci@c8000400 {
460 status = "okay"; 507 status = "okay";
461 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 508 cd-gpios = <&gpio 69 0>; /* gpio PI5 */
diff --git a/arch/arm/boot/dts/tegra20-whistler.dts b/arch/arm/boot/dts/tegra20-whistler.dts
index c636d002d6d8..20d576ecd555 100644
--- a/arch/arm/boot/dts/tegra20-whistler.dts
+++ b/arch/arm/boot/dts/tegra20-whistler.dts
@@ -10,6 +10,18 @@
10 reg = <0x00000000 0x20000000>; 10 reg = <0x00000000 0x20000000>;
11 }; 11 };
12 12
13 host1x {
14 hdmi {
15 status = "okay";
16
17 vdd-supply = <&hdmi_vdd_reg>;
18 pll-supply = <&hdmi_pll_reg>;
19
20 nvidia,ddc-i2c-bus = <&hdmi_ddc>;
21 nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
22 };
23 };
24
13 pinmux { 25 pinmux {
14 pinctrl-names = "default"; 26 pinctrl-names = "default";
15 pinctrl-0 = <&state_default>; 27 pinctrl-0 = <&state_default>;
@@ -246,6 +258,11 @@
246 clock-frequency = <216000000>; 258 clock-frequency = <216000000>;
247 }; 259 };
248 260
261 hdmi_ddc: i2c@7000c400 {
262 status = "okay";
263 clock-frequency = <100000>;
264 };
265
249 i2c@7000d000 { 266 i2c@7000d000 {
250 status = "okay"; 267 status = "okay";
251 clock-frequency = <100000>; 268 clock-frequency = <100000>;
@@ -295,243 +312,182 @@
295 in20-supply = <&mbatt_reg>; 312 in20-supply = <&mbatt_reg>;
296 313
297 regulators { 314 regulators {
298 #address-cells = <1>; 315 mbatt_reg: mbatt {
299 #size-cells = <0>;
300
301 mbatt_reg: regulator@0 {
302 reg = <0>;
303 regulator-compatible = "mbatt";
304 regulator-name = "vbat_pmu"; 316 regulator-name = "vbat_pmu";
305 regulator-always-on; 317 regulator-always-on;
306 }; 318 };
307 319
308 regulator@1 { 320 sd1 {
309 reg = <1>;
310 regulator-compatible = "sd1";
311 regulator-name = "nvvdd_sv1,vdd_cpu_pmu"; 321 regulator-name = "nvvdd_sv1,vdd_cpu_pmu";
312 regulator-min-microvolt = <1000000>; 322 regulator-min-microvolt = <1000000>;
313 regulator-max-microvolt = <1000000>; 323 regulator-max-microvolt = <1000000>;
314 regulator-always-on; 324 regulator-always-on;
315 }; 325 };
316 326
317 regulator@2 { 327 sd2 {
318 reg = <2>;
319 regulator-compatible = "sd2";
320 regulator-name = "nvvdd_sv2,vdd_core"; 328 regulator-name = "nvvdd_sv2,vdd_core";
321 regulator-min-microvolt = <1200000>; 329 regulator-min-microvolt = <1200000>;
322 regulator-max-microvolt = <1200000>; 330 regulator-max-microvolt = <1200000>;
323 regulator-always-on; 331 regulator-always-on;
324 }; 332 };
325 333
326 nvvdd_sv3_reg: regulator@3 { 334 nvvdd_sv3_reg: sd3 {
327 reg = <3>;
328 regulator-compatible = "sd3";
329 regulator-name = "nvvdd_sv3"; 335 regulator-name = "nvvdd_sv3";
330 regulator-min-microvolt = <1800000>; 336 regulator-min-microvolt = <1800000>;
331 regulator-max-microvolt = <1800000>; 337 regulator-max-microvolt = <1800000>;
332 regulator-always-on; 338 regulator-always-on;
333 }; 339 };
334 340
335 regulator@4 { 341 ldo1 {
336 reg = <4>;
337 regulator-compatible = "ldo1";
338 regulator-name = "nvvdd_ldo1,vddio_rx_ddr,vcore_acc"; 342 regulator-name = "nvvdd_ldo1,vddio_rx_ddr,vcore_acc";
339 regulator-min-microvolt = <3300000>; 343 regulator-min-microvolt = <3300000>;
340 regulator-max-microvolt = <3300000>; 344 regulator-max-microvolt = <3300000>;
341 regulator-always-on; 345 regulator-always-on;
342 }; 346 };
343 347
344 regulator@5 { 348 ldo2 {
345 reg = <5>;
346 regulator-compatible = "ldo2";
347 regulator-name = "nvvdd_ldo2,avdd_pll*"; 349 regulator-name = "nvvdd_ldo2,avdd_pll*";
348 regulator-min-microvolt = <1100000>; 350 regulator-min-microvolt = <1100000>;
349 regulator-max-microvolt = <1100000>; 351 regulator-max-microvolt = <1100000>;
350 regulator-always-on; 352 regulator-always-on;
351 }; 353 };
352 354
353 regulator@6 { 355 ldo3 {
354 reg = <6>;
355 regulator-compatible = "ldo3";
356 regulator-name = "nvvdd_ldo3,vcom_1v8b"; 356 regulator-name = "nvvdd_ldo3,vcom_1v8b";
357 regulator-min-microvolt = <1800000>; 357 regulator-min-microvolt = <1800000>;
358 regulator-max-microvolt = <1800000>; 358 regulator-max-microvolt = <1800000>;
359 regulator-always-on; 359 regulator-always-on;
360 }; 360 };
361 361
362 regulator@7 { 362 ldo4 {
363 reg = <7>;
364 regulator-compatible = "ldo4";
365 regulator-name = "nvvdd_ldo4,avdd_usb*"; 363 regulator-name = "nvvdd_ldo4,avdd_usb*";
366 regulator-min-microvolt = <3300000>; 364 regulator-min-microvolt = <3300000>;
367 regulator-max-microvolt = <3300000>; 365 regulator-max-microvolt = <3300000>;
368 regulator-always-on; 366 regulator-always-on;
369 }; 367 };
370 368
371 regulator@8 { 369 ldo5 {
372 reg = <8>;
373 regulator-compatible = "ldo5";
374 regulator-name = "nvvdd_ldo5,vcore_mmc,avdd_lcd1,vddio_1wire"; 370 regulator-name = "nvvdd_ldo5,vcore_mmc,avdd_lcd1,vddio_1wire";
375 regulator-min-microvolt = <2800000>; 371 regulator-min-microvolt = <2800000>;
376 regulator-max-microvolt = <2800000>; 372 regulator-max-microvolt = <2800000>;
377 regulator-always-on; 373 regulator-always-on;
378 }; 374 };
379 375
380 regulator@9 { 376 hdmi_pll_reg: ldo6 {
381 reg = <9>;
382 regulator-compatible = "ldo6";
383 regulator-name = "nvvdd_ldo6,avdd_hdmi_pll"; 377 regulator-name = "nvvdd_ldo6,avdd_hdmi_pll";
384 regulator-min-microvolt = <1800000>; 378 regulator-min-microvolt = <1800000>;
385 regulator-max-microvolt = <1800000>; 379 regulator-max-microvolt = <1800000>;
386 }; 380 };
387 381
388 regulator@10 { 382 ldo7 {
389 reg = <10>;
390 regulator-compatible = "ldo7";
391 regulator-name = "nvvdd_ldo7,avddio_audio"; 383 regulator-name = "nvvdd_ldo7,avddio_audio";
392 regulator-min-microvolt = <2800000>; 384 regulator-min-microvolt = <2800000>;
393 regulator-max-microvolt = <2800000>; 385 regulator-max-microvolt = <2800000>;
394 regulator-always-on; 386 regulator-always-on;
395 }; 387 };
396 388
397 regulator@11 { 389 ldo8 {
398 reg = <11>;
399 regulator-compatible = "ldo8";
400 regulator-name = "nvvdd_ldo8,vcom_3v0,vcore_cmps"; 390 regulator-name = "nvvdd_ldo8,vcom_3v0,vcore_cmps";
401 regulator-min-microvolt = <3000000>; 391 regulator-min-microvolt = <3000000>;
402 regulator-max-microvolt = <3000000>; 392 regulator-max-microvolt = <3000000>;
403 }; 393 };
404 394
405 regulator@12 { 395 ldo9 {
406 reg = <12>;
407 regulator-compatible = "ldo9";
408 regulator-name = "nvvdd_ldo9,avdd_cam*"; 396 regulator-name = "nvvdd_ldo9,avdd_cam*";
409 regulator-min-microvolt = <2800000>; 397 regulator-min-microvolt = <2800000>;
410 regulator-max-microvolt = <2800000>; 398 regulator-max-microvolt = <2800000>;
411 }; 399 };
412 400
413 regulator@13 { 401 ldo10 {
414 reg = <13>;
415 regulator-compatible = "ldo10";
416 regulator-name = "nvvdd_ldo10,avdd_usb_ic_3v0"; 402 regulator-name = "nvvdd_ldo10,avdd_usb_ic_3v0";
417 regulator-min-microvolt = <3000000>; 403 regulator-min-microvolt = <3000000>;
418 regulator-max-microvolt = <3000000>; 404 regulator-max-microvolt = <3000000>;
419 regulator-always-on; 405 regulator-always-on;
420 }; 406 };
421 407
422 regulator@14 { 408 hdmi_vdd_reg: ldo11 {
423 reg = <14>;
424 regulator-compatible = "ldo11";
425 regulator-name = "nvvdd_ldo11,vddio_pex_clk,vcom_33,avdd_hdmi"; 409 regulator-name = "nvvdd_ldo11,vddio_pex_clk,vcom_33,avdd_hdmi";
426 regulator-min-microvolt = <3300000>; 410 regulator-min-microvolt = <3300000>;
427 regulator-max-microvolt = <3300000>; 411 regulator-max-microvolt = <3300000>;
428 }; 412 };
429 413
430 regulator@15 { 414 ldo12 {
431 reg = <15>;
432 regulator-compatible = "ldo12";
433 regulator-name = "nvvdd_ldo12,vddio_sdio"; 415 regulator-name = "nvvdd_ldo12,vddio_sdio";
434 regulator-min-microvolt = <2800000>; 416 regulator-min-microvolt = <2800000>;
435 regulator-max-microvolt = <2800000>; 417 regulator-max-microvolt = <2800000>;
436 regulator-always-on; 418 regulator-always-on;
437 }; 419 };
438 420
439 regulator@16 { 421 ldo13 {
440 reg = <16>;
441 regulator-compatible = "ldo13";
442 regulator-name = "nvvdd_ldo13,vcore_phtn,vdd_af"; 422 regulator-name = "nvvdd_ldo13,vcore_phtn,vdd_af";
443 regulator-min-microvolt = <2800000>; 423 regulator-min-microvolt = <2800000>;
444 regulator-max-microvolt = <2800000>; 424 regulator-max-microvolt = <2800000>;
445 }; 425 };
446 426
447 regulator@17 { 427 ldo14 {
448 reg = <17>;
449 regulator-compatible = "ldo14";
450 regulator-name = "nvvdd_ldo14,avdd_vdac"; 428 regulator-name = "nvvdd_ldo14,avdd_vdac";
451 regulator-min-microvolt = <2800000>; 429 regulator-min-microvolt = <2800000>;
452 regulator-max-microvolt = <2800000>; 430 regulator-max-microvolt = <2800000>;
453 }; 431 };
454 432
455 regulator@18 { 433 ldo15 {
456 reg = <18>;
457 regulator-compatible = "ldo15";
458 regulator-name = "nvvdd_ldo15,vcore_temp,vddio_hdcp"; 434 regulator-name = "nvvdd_ldo15,vcore_temp,vddio_hdcp";
459 regulator-min-microvolt = <3300000>; 435 regulator-min-microvolt = <3300000>;
460 regulator-max-microvolt = <3300000>; 436 regulator-max-microvolt = <3300000>;
461 }; 437 };
462 438
463 regulator@19 { 439 ldo16 {
464 reg = <19>;
465 regulator-compatible = "ldo16";
466 regulator-name = "nvvdd_ldo16,vdd_dbrtr"; 440 regulator-name = "nvvdd_ldo16,vdd_dbrtr";
467 regulator-min-microvolt = <1300000>; 441 regulator-min-microvolt = <1300000>;
468 regulator-max-microvolt = <1300000>; 442 regulator-max-microvolt = <1300000>;
469 }; 443 };
470 444
471 regulator@20 { 445 ldo17 {
472 reg = <20>;
473 regulator-compatible = "ldo17";
474 regulator-name = "nvvdd_ldo17,vddio_mipi"; 446 regulator-name = "nvvdd_ldo17,vddio_mipi";
475 regulator-min-microvolt = <1200000>; 447 regulator-min-microvolt = <1200000>;
476 regulator-max-microvolt = <1200000>; 448 regulator-max-microvolt = <1200000>;
477 }; 449 };
478 450
479 regulator@21 { 451 ldo18 {
480 reg = <21>;
481 regulator-compatible = "ldo18";
482 regulator-name = "nvvdd_ldo18,vddio_vi,vcore_cam*"; 452 regulator-name = "nvvdd_ldo18,vddio_vi,vcore_cam*";
483 regulator-min-microvolt = <1800000>; 453 regulator-min-microvolt = <1800000>;
484 regulator-max-microvolt = <1800000>; 454 regulator-max-microvolt = <1800000>;
485 }; 455 };
486 456
487 regulator@22 { 457 ldo19 {
488 reg = <22>;
489 regulator-compatible = "ldo19";
490 regulator-name = "nvvdd_ldo19,avdd_lcd2,vddio_lx"; 458 regulator-name = "nvvdd_ldo19,avdd_lcd2,vddio_lx";
491 regulator-min-microvolt = <2800000>; 459 regulator-min-microvolt = <2800000>;
492 regulator-max-microvolt = <2800000>; 460 regulator-max-microvolt = <2800000>;
493 }; 461 };
494 462
495 regulator@23 { 463 ldo20 {
496 reg = <23>;
497 regulator-compatible = "ldo20";
498 regulator-name = "nvvdd_ldo20,vddio_ddr_1v2,vddio_hsic,vcom_1v2"; 464 regulator-name = "nvvdd_ldo20,vddio_ddr_1v2,vddio_hsic,vcom_1v2";
499 regulator-min-microvolt = <1200000>; 465 regulator-min-microvolt = <1200000>;
500 regulator-max-microvolt = <1200000>; 466 regulator-max-microvolt = <1200000>;
501 regulator-always-on; 467 regulator-always-on;
502 }; 468 };
503 469
504 regulator@24 { 470 out5v {
505 reg = <24>;
506 regulator-compatible = "out5v";
507 regulator-name = "usb0_vbus_reg"; 471 regulator-name = "usb0_vbus_reg";
508 }; 472 };
509 473
510 regulator@25 { 474 out33v {
511 reg = <25>;
512 regulator-compatible = "out33v";
513 regulator-name = "pmu_out3v3"; 475 regulator-name = "pmu_out3v3";
514 }; 476 };
515 477
516 regulator@26 { 478 bbat {
517 reg = <26>;
518 regulator-compatible = "bbat";
519 regulator-name = "pmu_bbat"; 479 regulator-name = "pmu_bbat";
520 regulator-min-microvolt = <2400000>; 480 regulator-min-microvolt = <2400000>;
521 regulator-max-microvolt = <2400000>; 481 regulator-max-microvolt = <2400000>;
522 regulator-always-on; 482 regulator-always-on;
523 }; 483 };
524 484
525 regulator@27 { 485 sdby {
526 reg = <27>;
527 regulator-compatible = "sdby";
528 regulator-name = "vdd_aon"; 486 regulator-name = "vdd_aon";
529 regulator-always-on; 487 regulator-always-on;
530 }; 488 };
531 489
532 regulator@28 { 490 vrtc {
533 reg = <28>;
534 regulator-compatible = "vrtc";
535 regulator-name = "vrtc,pmu_vccadc"; 491 regulator-name = "vrtc,pmu_vccadc";
536 regulator-always-on; 492 regulator-always-on;
537 }; 493 };
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index f3a09d0d45bc..fba998e3954a 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -4,6 +4,102 @@
4 compatible = "nvidia,tegra20"; 4 compatible = "nvidia,tegra20";
5 interrupt-parent = <&intc>; 5 interrupt-parent = <&intc>;
6 6
7 host1x {
8 compatible = "nvidia,tegra20-host1x", "simple-bus";
9 reg = <0x50000000 0x00024000>;
10 interrupts = <0 65 0x04 /* mpcore syncpt */
11 0 67 0x04>; /* mpcore general */
12
13 #address-cells = <1>;
14 #size-cells = <1>;
15
16 ranges = <0x54000000 0x54000000 0x04000000>;
17
18 mpe {
19 compatible = "nvidia,tegra20-mpe";
20 reg = <0x54040000 0x00040000>;
21 interrupts = <0 68 0x04>;
22 };
23
24 vi {
25 compatible = "nvidia,tegra20-vi";
26 reg = <0x54080000 0x00040000>;
27 interrupts = <0 69 0x04>;
28 };
29
30 epp {
31 compatible = "nvidia,tegra20-epp";
32 reg = <0x540c0000 0x00040000>;
33 interrupts = <0 70 0x04>;
34 };
35
36 isp {
37 compatible = "nvidia,tegra20-isp";
38 reg = <0x54100000 0x00040000>;
39 interrupts = <0 71 0x04>;
40 };
41
42 gr2d {
43 compatible = "nvidia,tegra20-gr2d";
44 reg = <0x54140000 0x00040000>;
45 interrupts = <0 72 0x04>;
46 };
47
48 gr3d {
49 compatible = "nvidia,tegra20-gr3d";
50 reg = <0x54180000 0x00040000>;
51 };
52
53 dc@54200000 {
54 compatible = "nvidia,tegra20-dc";
55 reg = <0x54200000 0x00040000>;
56 interrupts = <0 73 0x04>;
57
58 rgb {
59 status = "disabled";
60 };
61 };
62
63 dc@54240000 {
64 compatible = "nvidia,tegra20-dc";
65 reg = <0x54240000 0x00040000>;
66 interrupts = <0 74 0x04>;
67
68 rgb {
69 status = "disabled";
70 };
71 };
72
73 hdmi {
74 compatible = "nvidia,tegra20-hdmi";
75 reg = <0x54280000 0x00040000>;
76 interrupts = <0 75 0x04>;
77 status = "disabled";
78 };
79
80 tvo {
81 compatible = "nvidia,tegra20-tvo";
82 reg = <0x542c0000 0x00040000>;
83 interrupts = <0 76 0x04>;
84 status = "disabled";
85 };
86
87 dsi {
88 compatible = "nvidia,tegra20-dsi";
89 reg = <0x54300000 0x00040000>;
90 status = "disabled";
91 };
92 };
93
94 cache-controller@50043000 {
95 compatible = "arm,pl310-cache";
96 reg = <0x50043000 0x1000>;
97 arm,data-latency = <5 5 2>;
98 arm,tag-latency = <4 4 2>;
99 cache-unified;
100 cache-level = <2>;
101 };
102
7 intc: interrupt-controller { 103 intc: interrupt-controller {
8 compatible = "arm,cortex-a9-gic"; 104 compatible = "arm,cortex-a9-gic";
9 reg = <0x50041000 0x1000 105 reg = <0x50041000 0x1000
@@ -138,6 +234,16 @@
138 status = "disabled"; 234 status = "disabled";
139 }; 235 };
140 236
237 spi@7000c380 {
238 compatible = "nvidia,tegra20-sflash";
239 reg = <0x7000c380 0x80>;
240 interrupts = <0 39 0x04>;
241 nvidia,dma-request-selector = <&apbdma 11>;
242 #address-cells = <1>;
243 #size-cells = <0>;
244 status = "disabled";
245 };
246
141 i2c@7000c400 { 247 i2c@7000c400 {
142 compatible = "nvidia,tegra20-i2c"; 248 compatible = "nvidia,tegra20-i2c";
143 reg = <0x7000c400 0x100>; 249 reg = <0x7000c400 0x100>;
@@ -165,6 +271,46 @@
165 status = "disabled"; 271 status = "disabled";
166 }; 272 };
167 273
274 spi@7000d400 {
275 compatible = "nvidia,tegra20-slink";
276 reg = <0x7000d400 0x200>;
277 interrupts = <0 59 0x04>;
278 nvidia,dma-request-selector = <&apbdma 15>;
279 #address-cells = <1>;
280 #size-cells = <0>;
281 status = "disabled";
282 };
283
284 spi@7000d600 {
285 compatible = "nvidia,tegra20-slink";
286 reg = <0x7000d600 0x200>;
287 interrupts = <0 82 0x04>;
288 nvidia,dma-request-selector = <&apbdma 16>;
289 #address-cells = <1>;
290 #size-cells = <0>;
291 status = "disabled";
292 };
293
294 spi@7000d800 {
295 compatible = "nvidia,tegra20-slink";
296 reg = <0x7000d480 0x200>;
297 interrupts = <0 83 0x04>;
298 nvidia,dma-request-selector = <&apbdma 17>;
299 #address-cells = <1>;
300 #size-cells = <0>;
301 status = "disabled";
302 };
303
304 spi@7000da00 {
305 compatible = "nvidia,tegra20-slink";
306 reg = <0x7000da00 0x200>;
307 interrupts = <0 93 0x04>;
308 nvidia,dma-request-selector = <&apbdma 18>;
309 #address-cells = <1>;
310 #size-cells = <0>;
311 status = "disabled";
312 };
313
168 pmc { 314 pmc {
169 compatible = "nvidia,tegra20-pmc"; 315 compatible = "nvidia,tegra20-pmc";
170 reg = <0x7000e400 0x400>; 316 reg = <0x7000e400 0x400>;
diff --git a/arch/arm/boot/dts/tegra30-cardhu-a02.dts b/arch/arm/boot/dts/tegra30-cardhu-a02.dts
index dd4222f00eca..adc88aa50eb6 100644
--- a/arch/arm/boot/dts/tegra30-cardhu-a02.dts
+++ b/arch/arm/boot/dts/tegra30-cardhu-a02.dts
@@ -83,5 +83,11 @@
83 gpio = <&gpio 83 0>; /* GPIO PK3 */ 83 gpio = <&gpio 83 0>; /* GPIO PK3 */
84 }; 84 };
85 }; 85 };
86
87 sdhci@78000400 {
88 status = "okay";
89 power-gpios = <&gpio 28 0>; /* gpio PD4 */
90 bus-width = <4>;
91 };
86}; 92};
87 93
diff --git a/arch/arm/boot/dts/tegra30-cardhu-a04.dts b/arch/arm/boot/dts/tegra30-cardhu-a04.dts
index 0828f097ca86..08163e145d57 100644
--- a/arch/arm/boot/dts/tegra30-cardhu-a04.dts
+++ b/arch/arm/boot/dts/tegra30-cardhu-a04.dts
@@ -95,4 +95,10 @@
95 gpio = <&gpio 232 0>; /* GPIO PDD0 */ 95 gpio = <&gpio 232 0>; /* GPIO PDD0 */
96 }; 96 };
97 }; 97 };
98
99 sdhci@78000400 {
100 status = "okay";
101 power-gpios = <&gpio 27 0>; /* gpio PD3 */
102 bus-width = <4>;
103 };
98}; 104};
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
index d10c9c5a3606..bdb2a660f376 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -52,6 +52,22 @@
52 nvidia,pull = <2>; 52 nvidia,pull = <2>;
53 nvidia,tristate = <0>; 53 nvidia,tristate = <0>;
54 }; 54 };
55 sdmmc3_clk_pa6 {
56 nvidia,pins = "sdmmc3_clk_pa6";
57 nvidia,function = "sdmmc3";
58 nvidia,pull = <0>;
59 nvidia,tristate = <0>;
60 };
61 sdmmc3_cmd_pa7 {
62 nvidia,pins = "sdmmc3_cmd_pa7",
63 "sdmmc3_dat0_pb7",
64 "sdmmc3_dat1_pb6",
65 "sdmmc3_dat2_pb5",
66 "sdmmc3_dat3_pb4";
67 nvidia,function = "sdmmc3";
68 nvidia,pull = <2>;
69 nvidia,tristate = <0>;
70 };
55 sdmmc4_clk_pcc4 { 71 sdmmc4_clk_pcc4 {
56 nvidia,pins = "sdmmc4_clk_pcc4", 72 nvidia,pins = "sdmmc4_clk_pcc4",
57 "sdmmc4_rst_n_pcc3"; 73 "sdmmc4_rst_n_pcc3";
@@ -81,6 +97,15 @@
81 nvidia,pull = <0>; 97 nvidia,pull = <0>;
82 nvidia,tristate = <0>; 98 nvidia,tristate = <0>;
83 }; 99 };
100 sdio3 {
101 nvidia,pins = "drive_sdio3";
102 nvidia,high-speed-mode = <0>;
103 nvidia,schmitt = <0>;
104 nvidia,pull-down-strength = <46>;
105 nvidia,pull-up-strength = <42>;
106 nvidia,slew-rate-rising = <1>;
107 nvidia,slew-rate-falling = <1>;
108 };
84 }; 109 };
85 }; 110 };
86 111
@@ -171,56 +196,41 @@
171 vccio-supply = <&vdd_ac_bat_reg>; 196 vccio-supply = <&vdd_ac_bat_reg>;
172 197
173 regulators { 198 regulators {
174 #address-cells = <1>; 199 vdd1_reg: vdd1 {
175 #size-cells = <0>;
176
177 vdd1_reg: regulator@0 {
178 reg = <0>;
179 regulator-compatible = "vdd1";
180 regulator-name = "vddio_ddr_1v2"; 200 regulator-name = "vddio_ddr_1v2";
181 regulator-min-microvolt = <1200000>; 201 regulator-min-microvolt = <1200000>;
182 regulator-max-microvolt = <1200000>; 202 regulator-max-microvolt = <1200000>;
183 regulator-always-on; 203 regulator-always-on;
184 }; 204 };
185 205
186 vdd2_reg: regulator@1 { 206 vdd2_reg: vdd2 {
187 reg = <1>;
188 regulator-compatible = "vdd2";
189 regulator-name = "vdd_1v5_gen"; 207 regulator-name = "vdd_1v5_gen";
190 regulator-min-microvolt = <1500000>; 208 regulator-min-microvolt = <1500000>;
191 regulator-max-microvolt = <1500000>; 209 regulator-max-microvolt = <1500000>;
192 regulator-always-on; 210 regulator-always-on;
193 }; 211 };
194 212
195 vddctrl_reg: regulator@2 { 213 vddctrl_reg: vddctrl {
196 reg = <2>;
197 regulator-compatible = "vddctrl";
198 regulator-name = "vdd_cpu,vdd_sys"; 214 regulator-name = "vdd_cpu,vdd_sys";
199 regulator-min-microvolt = <1000000>; 215 regulator-min-microvolt = <1000000>;
200 regulator-max-microvolt = <1000000>; 216 regulator-max-microvolt = <1000000>;
201 regulator-always-on; 217 regulator-always-on;
202 }; 218 };
203 219
204 vio_reg: regulator@3 { 220 vio_reg: vio {
205 reg = <3>;
206 regulator-compatible = "vio";
207 regulator-name = "vdd_1v8_gen"; 221 regulator-name = "vdd_1v8_gen";
208 regulator-min-microvolt = <1800000>; 222 regulator-min-microvolt = <1800000>;
209 regulator-max-microvolt = <1800000>; 223 regulator-max-microvolt = <1800000>;
210 regulator-always-on; 224 regulator-always-on;
211 }; 225 };
212 226
213 ldo1_reg: regulator@4 { 227 ldo1_reg: ldo1 {
214 reg = <4>;
215 regulator-compatible = "ldo1";
216 regulator-name = "vdd_pexa,vdd_pexb"; 228 regulator-name = "vdd_pexa,vdd_pexb";
217 regulator-min-microvolt = <1050000>; 229 regulator-min-microvolt = <1050000>;
218 regulator-max-microvolt = <1050000>; 230 regulator-max-microvolt = <1050000>;
219 }; 231 };
220 232
221 ldo2_reg: regulator@5 { 233 ldo2_reg: ldo2 {
222 reg = <5>;
223 regulator-compatible = "ldo2";
224 regulator-name = "vdd_sata,avdd_plle"; 234 regulator-name = "vdd_sata,avdd_plle";
225 regulator-min-microvolt = <1050000>; 235 regulator-min-microvolt = <1050000>;
226 regulator-max-microvolt = <1050000>; 236 regulator-max-microvolt = <1050000>;
@@ -228,44 +238,34 @@
228 238
229 /* LDO3 is not connected to anything */ 239 /* LDO3 is not connected to anything */
230 240
231 ldo4_reg: regulator@7 { 241 ldo4_reg: ldo4 {
232 reg = <7>;
233 regulator-compatible = "ldo4";
234 regulator-name = "vdd_rtc"; 242 regulator-name = "vdd_rtc";
235 regulator-min-microvolt = <1200000>; 243 regulator-min-microvolt = <1200000>;
236 regulator-max-microvolt = <1200000>; 244 regulator-max-microvolt = <1200000>;
237 regulator-always-on; 245 regulator-always-on;
238 }; 246 };
239 247
240 ldo5_reg: regulator@8 { 248 ldo5_reg: ldo5 {
241 reg = <8>;
242 regulator-compatible = "ldo5";
243 regulator-name = "vddio_sdmmc,avdd_vdac"; 249 regulator-name = "vddio_sdmmc,avdd_vdac";
244 regulator-min-microvolt = <3300000>; 250 regulator-min-microvolt = <3300000>;
245 regulator-max-microvolt = <3300000>; 251 regulator-max-microvolt = <3300000>;
246 regulator-always-on; 252 regulator-always-on;
247 }; 253 };
248 254
249 ldo6_reg: regulator@9 { 255 ldo6_reg: ldo6 {
250 reg = <9>;
251 regulator-compatible = "ldo6";
252 regulator-name = "avdd_dsi_csi,pwrdet_mipi"; 256 regulator-name = "avdd_dsi_csi,pwrdet_mipi";
253 regulator-min-microvolt = <1200000>; 257 regulator-min-microvolt = <1200000>;
254 regulator-max-microvolt = <1200000>; 258 regulator-max-microvolt = <1200000>;
255 }; 259 };
256 260
257 ldo7_reg: regulator@10 { 261 ldo7_reg: ldo7 {
258 reg = <10>;
259 regulator-compatible = "ldo7";
260 regulator-name = "vdd_pllm,x,u,a_p_c_s"; 262 regulator-name = "vdd_pllm,x,u,a_p_c_s";
261 regulator-min-microvolt = <1200000>; 263 regulator-min-microvolt = <1200000>;
262 regulator-max-microvolt = <1200000>; 264 regulator-max-microvolt = <1200000>;
263 regulator-always-on; 265 regulator-always-on;
264 }; 266 };
265 267
266 ldo8_reg: regulator@11 { 268 ldo8_reg: ldo8 {
267 reg = <11>;
268 regulator-compatible = "ldo8";
269 regulator-name = "vdd_ddr_hs"; 269 regulator-name = "vdd_ddr_hs";
270 regulator-min-microvolt = <1000000>; 270 regulator-min-microvolt = <1000000>;
271 regulator-max-microvolt = <1000000>; 271 regulator-max-microvolt = <1000000>;
@@ -275,6 +275,16 @@
275 }; 275 };
276 }; 276 };
277 277
278 spi@7000da00 {
279 status = "okay";
280 spi-max-frequency = <25000000>;
281 spi-flash@1 {
282 compatible = "winbond,w25q32";
283 reg = <1>;
284 spi-max-frequency = <20000000>;
285 };
286 };
287
278 ahub { 288 ahub {
279 i2s@70080400 { 289 i2s@70080400 {
280 status = "okay"; 290 status = "okay";
@@ -409,6 +419,8 @@
409 regulator-name = "vdd_com"; 419 regulator-name = "vdd_com";
410 regulator-min-microvolt = <3300000>; 420 regulator-min-microvolt = <3300000>;
411 regulator-max-microvolt = <3300000>; 421 regulator-max-microvolt = <3300000>;
422 regulator-always-on;
423 regulator-boot-on;
412 enable-active-high; 424 enable-active-high;
413 gpio = <&gpio 24 0>; /* gpio PD0 */ 425 gpio = <&gpio 24 0>; /* gpio PD0 */
414 vin-supply = <&sys_3v3_reg>; 426 vin-supply = <&sys_3v3_reg>;
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index df7f2270fc91..efa603d47a6a 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -4,6 +4,102 @@
4 compatible = "nvidia,tegra30"; 4 compatible = "nvidia,tegra30";
5 interrupt-parent = <&intc>; 5 interrupt-parent = <&intc>;
6 6
7 host1x {
8 compatible = "nvidia,tegra30-host1x", "simple-bus";
9 reg = <0x50000000 0x00024000>;
10 interrupts = <0 65 0x04 /* mpcore syncpt */
11 0 67 0x04>; /* mpcore general */
12
13 #address-cells = <1>;
14 #size-cells = <1>;
15
16 ranges = <0x54000000 0x54000000 0x04000000>;
17
18 mpe {
19 compatible = "nvidia,tegra30-mpe";
20 reg = <0x54040000 0x00040000>;
21 interrupts = <0 68 0x04>;
22 };
23
24 vi {
25 compatible = "nvidia,tegra30-vi";
26 reg = <0x54080000 0x00040000>;
27 interrupts = <0 69 0x04>;
28 };
29
30 epp {
31 compatible = "nvidia,tegra30-epp";
32 reg = <0x540c0000 0x00040000>;
33 interrupts = <0 70 0x04>;
34 };
35
36 isp {
37 compatible = "nvidia,tegra30-isp";
38 reg = <0x54100000 0x00040000>;
39 interrupts = <0 71 0x04>;
40 };
41
42 gr2d {
43 compatible = "nvidia,tegra30-gr2d";
44 reg = <0x54140000 0x00040000>;
45 interrupts = <0 72 0x04>;
46 };
47
48 gr3d {
49 compatible = "nvidia,tegra30-gr3d";
50 reg = <0x54180000 0x00040000>;
51 };
52
53 dc@54200000 {
54 compatible = "nvidia,tegra30-dc";
55 reg = <0x54200000 0x00040000>;
56 interrupts = <0 73 0x04>;
57
58 rgb {
59 status = "disabled";
60 };
61 };
62
63 dc@54240000 {
64 compatible = "nvidia,tegra30-dc";
65 reg = <0x54240000 0x00040000>;
66 interrupts = <0 74 0x04>;
67
68 rgb {
69 status = "disabled";
70 };
71 };
72
73 hdmi {
74 compatible = "nvidia,tegra30-hdmi";
75 reg = <0x54280000 0x00040000>;
76 interrupts = <0 75 0x04>;
77 status = "disabled";
78 };
79
80 tvo {
81 compatible = "nvidia,tegra30-tvo";
82 reg = <0x542c0000 0x00040000>;
83 interrupts = <0 76 0x04>;
84 status = "disabled";
85 };
86
87 dsi {
88 compatible = "nvidia,tegra30-dsi";
89 reg = <0x54300000 0x00040000>;
90 status = "disabled";
91 };
92 };
93
94 cache-controller@50043000 {
95 compatible = "arm,pl310-cache";
96 reg = <0x50043000 0x1000>;
97 arm,data-latency = <6 6 2>;
98 arm,tag-latency = <5 5 2>;
99 cache-unified;
100 cache-level = <2>;
101 };
102
7 intc: interrupt-controller { 103 intc: interrupt-controller {
8 compatible = "arm,cortex-a9-gic"; 104 compatible = "arm,cortex-a9-gic";
9 reg = <0x50041000 0x1000 105 reg = <0x50041000 0x1000
@@ -168,6 +264,66 @@
168 status = "disabled"; 264 status = "disabled";
169 }; 265 };
170 266
267 spi@7000d400 {
268 compatible = "nvidia,tegra30-slink", "nvidia,tegra20-slink";
269 reg = <0x7000d400 0x200>;
270 interrupts = <0 59 0x04>;
271 nvidia,dma-request-selector = <&apbdma 15>;
272 #address-cells = <1>;
273 #size-cells = <0>;
274 status = "disabled";
275 };
276
277 spi@7000d600 {
278 compatible = "nvidia,tegra30-slink", "nvidia,tegra20-slink";
279 reg = <0x7000d600 0x200>;
280 interrupts = <0 82 0x04>;
281 nvidia,dma-request-selector = <&apbdma 16>;
282 #address-cells = <1>;
283 #size-cells = <0>;
284 status = "disabled";
285 };
286
287 spi@7000d800 {
288 compatible = "nvidia,tegra30-slink", "nvidia,tegra20-slink";
289 reg = <0x7000d480 0x200>;
290 interrupts = <0 83 0x04>;
291 nvidia,dma-request-selector = <&apbdma 17>;
292 #address-cells = <1>;
293 #size-cells = <0>;
294 status = "disabled";
295 };
296
297 spi@7000da00 {
298 compatible = "nvidia,tegra30-slink", "nvidia,tegra20-slink";
299 reg = <0x7000da00 0x200>;
300 interrupts = <0 93 0x04>;
301 nvidia,dma-request-selector = <&apbdma 18>;
302 #address-cells = <1>;
303 #size-cells = <0>;
304 status = "disabled";
305 };
306
307 spi@7000dc00 {
308 compatible = "nvidia,tegra30-slink", "nvidia,tegra20-slink";
309 reg = <0x7000dc00 0x200>;
310 interrupts = <0 94 0x04>;
311 nvidia,dma-request-selector = <&apbdma 27>;
312 #address-cells = <1>;
313 #size-cells = <0>;
314 status = "disabled";
315 };
316
317 spi@7000de00 {
318 compatible = "nvidia,tegra30-slink", "nvidia,tegra20-slink";
319 reg = <0x7000de00 0x200>;
320 interrupts = <0 79 0x04>;
321 nvidia,dma-request-selector = <&apbdma 28>;
322 #address-cells = <1>;
323 #size-cells = <0>;
324 status = "disabled";
325 };
326
171 pmc { 327 pmc {
172 compatible = "nvidia,tegra20-pmc", "nvidia,tegra30-pmc"; 328 compatible = "nvidia,tegra20-pmc", "nvidia,tegra30-pmc";
173 reg = <0x7000e400 0x400>; 329 reg = <0x7000e400 0x400>;
diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
index ff000172c93c..63411b036932 100644
--- a/arch/arm/boot/dts/twl4030.dtsi
+++ b/arch/arm/boot/dts/twl4030.dtsi
@@ -37,6 +37,24 @@
37 regulator-max-microvolt = <3150000>; 37 regulator-max-microvolt = <3150000>;
38 }; 38 };
39 39
40 vusb1v5: regulator-vusb1v5 {
41 compatible = "ti,twl4030-vusb1v5";
42 };
43
44 vusb1v8: regulator-vusb1v8 {
45 compatible = "ti,twl4030-vusb1v8";
46 };
47
48 vusb3v1: regulator-vusb3v1 {
49 compatible = "ti,twl4030-vusb3v1";
50 };
51
52 vsim: regulator-vsim {
53 compatible = "ti,twl4030-vsim";
54 regulator-min-microvolt = <1800000>;
55 regulator-max-microvolt = <3000000>;
56 };
57
40 twl_gpio: gpio { 58 twl_gpio: gpio {
41 compatible = "ti,twl4030-gpio"; 59 compatible = "ti,twl4030-gpio";
42 gpio-controller; 60 gpio-controller;
@@ -44,4 +62,13 @@
44 interrupt-controller; 62 interrupt-controller;
45 #interrupt-cells = <1>; 63 #interrupt-cells = <1>;
46 }; 64 };
65
66 twl4030-usb {
67 compatible = "ti,twl4030-usb";
68 interrupts = <10>, <4>;
69 usb1v5-supply = <&vusb1v5>;
70 usb1v8-supply = <&vusb1v8>;
71 usb3v1-supply = <&vusb3v1>;
72 usb_mode = <1>;
73 };
47}; 74};
diff --git a/arch/arm/boot/dts/twl6030.dtsi b/arch/arm/boot/dts/twl6030.dtsi
index 123e2c40218a..9996cfc5ee80 100644
--- a/arch/arm/boot/dts/twl6030.dtsi
+++ b/arch/arm/boot/dts/twl6030.dtsi
@@ -86,4 +86,9 @@
86 clk32kg: regulator-clk32kg { 86 clk32kg: regulator-clk32kg {
87 compatible = "ti,twl6030-clk32kg"; 87 compatible = "ti,twl6030-clk32kg";
88 }; 88 };
89
90 twl_usb_comparator: usb-comparator {
91 compatible = "ti,twl6030-usb";
92 interrupts = <4>, <10>;
93 };
89}; 94};
diff --git a/arch/arm/boot/dts/u9540.dts b/arch/arm/boot/dts/u9540.dts
new file mode 100644
index 000000000000..95892ec6c342
--- /dev/null
+++ b/arch/arm/boot/dts/u9540.dts
@@ -0,0 +1,72 @@
1/*
2 * Copyright 2012 ST-Ericsson AB
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12/dts-v1/;
13/include/ "dbx5x0.dtsi"
14
15/ {
16 model = "ST-Ericsson U9540 platform with Device Tree";
17 compatible = "st-ericsson,u9540";
18
19 memory {
20 reg = <0x00000000 0x20000000>;
21 };
22
23 soc-u9500 {
24 uart@80120000 {
25 status = "okay";
26 };
27
28 uart@80121000 {
29 status = "okay";
30 };
31
32 uart@80007000 {
33 status = "okay";
34 };
35
36 // External Micro SD slot
37 sdi0_per1@80126000 {
38 arm,primecell-periphid = <0x10480180>;
39 max-frequency = <100000000>;
40 bus-width = <4>;
41 mmc-cap-sd-highspeed;
42 mmc-cap-mmc-highspeed;
43 vmmc-supply = <&ab8500_ldo_aux3_reg>;
44
45 cd-gpios = <&gpio7 6 0x4>; // 230
46 cd-inverted;
47
48 status = "okay";
49 };
50
51
52 // WLAN SDIO channel
53 sdi1_per2@80118000 {
54 arm,primecell-periphid = <0x10480180>;
55 max-frequency = <50000000>;
56 bus-width = <4>;
57
58 status = "okay";
59 };
60
61 // On-board eMMC
62 sdi4_per2@80114000 {
63 arm,primecell-periphid = <0x10480180>;
64 max-frequency = <100000000>;
65 bus-width = <8>;
66 mmc-cap-mmc-highspeed;
67 vmmc-supply = <&ab8500_ldo_aux2_reg>;
68
69 status = "okay";
70 };
71 };
72};
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
new file mode 100644
index 000000000000..401c1262d4ed
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-7000.dtsi
@@ -0,0 +1,166 @@
1/*
2 * Copyright (C) 2011 Xilinx
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13/include/ "skeleton.dtsi"
14
15/ {
16 compatible = "xlnx,zynq-7000";
17
18 amba {
19 compatible = "simple-bus";
20 #address-cells = <1>;
21 #size-cells = <1>;
22 interrupt-parent = <&intc>;
23 ranges;
24
25 intc: interrupt-controller@f8f01000 {
26 compatible = "arm,cortex-a9-gic";
27 #interrupt-cells = <3>;
28 #address-cells = <1>;
29 interrupt-controller;
30 reg = <0xF8F01000 0x1000>,
31 <0xF8F00100 0x100>;
32 };
33
34 L2: cache-controller {
35 compatible = "arm,pl310-cache";
36 reg = <0xF8F02000 0x1000>;
37 arm,data-latency = <2 3 2>;
38 arm,tag-latency = <2 3 2>;
39 cache-unified;
40 cache-level = <2>;
41 };
42
43 uart0: uart@e0000000 {
44 compatible = "xlnx,xuartps";
45 reg = <0xE0000000 0x1000>;
46 interrupts = <0 27 4>;
47 clock = <50000000>;
48 };
49
50 uart1: uart@e0001000 {
51 compatible = "xlnx,xuartps";
52 reg = <0xE0001000 0x1000>;
53 interrupts = <0 50 4>;
54 clock = <50000000>;
55 };
56
57 slcr: slcr@f8000000 {
58 compatible = "xlnx,zynq-slcr";
59 reg = <0xF8000000 0x1000>;
60
61 clocks {
62 #address-cells = <1>;
63 #size-cells = <0>;
64
65 ps_clk: ps_clk {
66 #clock-cells = <0>;
67 compatible = "fixed-clock";
68 /* clock-frequency set in board-specific file */
69 clock-output-names = "ps_clk";
70 };
71 armpll: armpll {
72 #clock-cells = <0>;
73 compatible = "xlnx,zynq-pll";
74 clocks = <&ps_clk>;
75 reg = <0x100 0x110>;
76 clock-output-names = "armpll";
77 };
78 ddrpll: ddrpll {
79 #clock-cells = <0>;
80 compatible = "xlnx,zynq-pll";
81 clocks = <&ps_clk>;
82 reg = <0x104 0x114>;
83 clock-output-names = "ddrpll";
84 };
85 iopll: iopll {
86 #clock-cells = <0>;
87 compatible = "xlnx,zynq-pll";
88 clocks = <&ps_clk>;
89 reg = <0x108 0x118>;
90 clock-output-names = "iopll";
91 };
92 uart_clk: uart_clk {
93 #clock-cells = <1>;
94 compatible = "xlnx,zynq-periph-clock";
95 clocks = <&iopll &armpll &ddrpll>;
96 reg = <0x154>;
97 clock-output-names = "uart0_ref_clk",
98 "uart1_ref_clk";
99 };
100 cpu_clk: cpu_clk {
101 #clock-cells = <1>;
102 compatible = "xlnx,zynq-cpu-clock";
103 clocks = <&iopll &armpll &ddrpll>;
104 reg = <0x120 0x1C4>;
105 clock-output-names = "cpu_6x4x",
106 "cpu_3x2x",
107 "cpu_2x",
108 "cpu_1x";
109 };
110 };
111 };
112
113 ttc0: ttc0@f8001000 {
114 #address-cells = <1>;
115 #size-cells = <0>;
116 compatible = "xlnx,ttc";
117 reg = <0xF8001000 0x1000>;
118 clocks = <&cpu_clk 3>;
119 clock-names = "cpu_1x";
120 clock-ranges;
121
122 ttc0_0: ttc0.0 {
123 status = "disabled";
124 reg = <0>;
125 interrupts = <0 10 4>;
126 };
127 ttc0_1: ttc0.1 {
128 status = "disabled";
129 reg = <1>;
130 interrupts = <0 11 4>;
131 };
132 ttc0_2: ttc0.2 {
133 status = "disabled";
134 reg = <2>;
135 interrupts = <0 12 4>;
136 };
137 };
138
139 ttc1: ttc1@f8002000 {
140 #interrupt-parent = <&intc>;
141 #address-cells = <1>;
142 #size-cells = <0>;
143 compatible = "xlnx,ttc";
144 reg = <0xF8002000 0x1000>;
145 clocks = <&cpu_clk 3>;
146 clock-names = "cpu_1x";
147 clock-ranges;
148
149 ttc1_0: ttc1.0 {
150 status = "disabled";
151 reg = <0>;
152 interrupts = <0 37 4>;
153 };
154 ttc1_1: ttc1.1 {
155 status = "disabled";
156 reg = <1>;
157 interrupts = <0 38 4>;
158 };
159 ttc1_2: ttc1.2 {
160 status = "disabled";
161 reg = <2>;
162 interrupts = <0 39 4>;
163 };
164 };
165 };
166};
diff --git a/arch/arm/boot/dts/zynq-ep107.dts b/arch/arm/boot/dts/zynq-ep107.dts
deleted file mode 100644
index 37ca192fb193..000000000000
--- a/arch/arm/boot/dts/zynq-ep107.dts
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Copyright (C) 2011 Xilinx
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14/dts-v1/;
15/ {
16 model = "Xilinx Zynq EP107";
17 compatible = "xlnx,zynq-ep107";
18 #address-cells = <1>;
19 #size-cells = <1>;
20 interrupt-parent = <&intc>;
21
22 memory {
23 device_type = "memory";
24 reg = <0x0 0x10000000>;
25 };
26
27 chosen {
28 bootargs = "console=ttyPS0,9600 root=/dev/ram rw initrd=0x800000,8M earlyprintk";
29 linux,stdout-path = &uart0;
30 };
31
32 amba {
33 compatible = "simple-bus";
34 #address-cells = <1>;
35 #size-cells = <1>;
36 ranges;
37
38 intc: interrupt-controller@f8f01000 {
39 interrupt-controller;
40 compatible = "arm,gic";
41 reg = <0xF8F01000 0x1000>;
42 #interrupt-cells = <2>;
43 };
44
45 uart0: uart@e0000000 {
46 compatible = "xlnx,xuartps";
47 reg = <0xE0000000 0x1000>;
48 interrupts = <59 0>;
49 clock = <50000000>;
50 };
51 };
52};
diff --git a/arch/arm/boot/dts/zynq-zc702.dts b/arch/arm/boot/dts/zynq-zc702.dts
new file mode 100644
index 000000000000..c772942a399a
--- /dev/null
+++ b/arch/arm/boot/dts/zynq-zc702.dts
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2011 Xilinx
3 * Copyright (C) 2012 National Instruments Corp.
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/dts-v1/;
15/include/ "zynq-7000.dtsi"
16
17/ {
18 model = "Zynq ZC702 Development Board";
19 compatible = "xlnx,zynq-zc702", "xlnx,zynq-7000";
20
21 memory {
22 device_type = "memory";
23 reg = <0x0 0x40000000>;
24 };
25
26 chosen {
27 bootargs = "console=ttyPS1,115200 earlyprintk";
28 };
29
30};
31
32&ps_clk {
33 clock-frequency = <33333330>;
34};
35
36&ttc0_0 {
37 status = "ok";
38 compatible = "xlnx,ttc-counter-clocksource";
39};
40
41&ttc0_1 {
42 status = "ok";
43 compatible = "xlnx,ttc-counter-clockevent";
44};
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index 78ed575feb1a..f71302c3ac33 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -18,7 +18,9 @@ CONFIG_MODULE_UNLOAD=y
18# CONFIG_IOSCHED_DEADLINE is not set 18# CONFIG_IOSCHED_DEADLINE is not set
19# CONFIG_IOSCHED_CFQ is not set 19# CONFIG_IOSCHED_CFQ is not set
20CONFIG_ARCH_MXC=y 20CONFIG_ARCH_MXC=y
21CONFIG_ARCH_IMX_V4_V5=y 21CONFIG_ARCH_MULTI_V4T=y
22CONFIG_ARCH_MULTI_V5=y
23# CONFIG_ARCH_MULTI_V7 is not set
22CONFIG_ARCH_MX1ADS=y 24CONFIG_ARCH_MX1ADS=y
23CONFIG_MACH_SCB9328=y 25CONFIG_MACH_SCB9328=y
24CONFIG_MACH_APF9328=y 26CONFIG_MACH_APF9328=y
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 394ded624e37..44f117aab52c 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -17,6 +17,8 @@ CONFIG_MODVERSIONS=y
17CONFIG_MODULE_SRCVERSION_ALL=y 17CONFIG_MODULE_SRCVERSION_ALL=y
18# CONFIG_BLK_DEV_BSG is not set 18# CONFIG_BLK_DEV_BSG is not set
19CONFIG_ARCH_MXC=y 19CONFIG_ARCH_MXC=y
20CONFIG_ARCH_MULTI_V6=y
21CONFIG_ARCH_MULTI_V7=y
20CONFIG_MACH_MX31LILLY=y 22CONFIG_MACH_MX31LILLY=y
21CONFIG_MACH_MX31LITE=y 23CONFIG_MACH_MX31LITE=y
22CONFIG_MACH_PCM037=y 24CONFIG_MACH_PCM037=y
diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
index 048aaca60814..7bf535104e26 100644
--- a/arch/arm/configs/mxs_defconfig
+++ b/arch/arm/configs/mxs_defconfig
@@ -61,6 +61,8 @@ CONFIG_MTD_NAND_GPMI_NAND=y
61CONFIG_NETDEVICES=y 61CONFIG_NETDEVICES=y
62CONFIG_NET_ETHERNET=y 62CONFIG_NET_ETHERNET=y
63CONFIG_ENC28J60=y 63CONFIG_ENC28J60=y
64CONFIG_USB_USBNET=y
65CONFIG_USB_NET_SMSC95XX=y
64# CONFIG_NETDEV_1000 is not set 66# CONFIG_NETDEV_1000 is not set
65# CONFIG_NETDEV_10000 is not set 67# CONFIG_NETDEV_10000 is not set
66# CONFIG_WLAN is not set 68# CONFIG_WLAN is not set
@@ -158,6 +160,10 @@ CONFIG_NFS_V3=y
158CONFIG_NFS_V3_ACL=y 160CONFIG_NFS_V3_ACL=y
159CONFIG_NFS_V4=y 161CONFIG_NFS_V4=y
160CONFIG_ROOT_NFS=y 162CONFIG_ROOT_NFS=y
163CONFIG_NLS_CODEPAGE_437=y
164CONFIG_NLS_CODEPAGE_850=y
165CONFIG_NLS_ISO8859_1=y
166CONFIG_NLS_ISO8859_15=y
161CONFIG_PRINTK_TIME=y 167CONFIG_PRINTK_TIME=y
162CONFIG_FRAME_WARN=2048 168CONFIG_FRAME_WARN=2048
163CONFIG_MAGIC_SYSRQ=y 169CONFIG_MAGIC_SYSRQ=y
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index da6845493caa..6fe7ede6f0c2 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -76,6 +76,7 @@ CONFIG_AB8500_CORE=y
76CONFIG_REGULATOR=y 76CONFIG_REGULATOR=y
77CONFIG_REGULATOR_AB8500=y 77CONFIG_REGULATOR_AB8500=y
78CONFIG_REGULATOR_FIXED_VOLTAGE=y 78CONFIG_REGULATOR_FIXED_VOLTAGE=y
79CONFIG_REGULATOR_GPIO=y
79# CONFIG_HID_SUPPORT is not set 80# CONFIG_HID_SUPPORT is not set
80CONFIG_USB_GADGET=y 81CONFIG_USB_GADGET=y
81CONFIG_AB8500_USB=y 82CONFIG_AB8500_USB=y
diff --git a/arch/arm/include/debug/imx.S b/arch/arm/include/debug/imx.S
new file mode 100644
index 000000000000..0c4e17d4d359
--- /dev/null
+++ b/arch/arm/include/debug/imx.S
@@ -0,0 +1,74 @@
1/* arch/arm/mach-imx/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#define IMX6Q_UART1_BASE_ADDR 0x02020000
14#define IMX6Q_UART2_BASE_ADDR 0x021e8000
15#define IMX6Q_UART3_BASE_ADDR 0x021ec000
16#define IMX6Q_UART4_BASE_ADDR 0x021f0000
17#define IMX6Q_UART5_BASE_ADDR 0x021f4000
18
19/*
20 * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion
21 * of IMX6Q_UART##n##_BASE_ADDR.
22 */
23#define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR
24#define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n)
25#define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT)
26
27#ifdef CONFIG_DEBUG_IMX1_UART
28#define UART_PADDR 0x00206000
29#elif defined (CONFIG_DEBUG_IMX25_UART)
30#define UART_PADDR 0x43f90000
31#elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
32#define UART_PADDR 0x1000a000
33#elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
34#define UART_PADDR 0x43f90000
35#elif defined (CONFIG_DEBUG_IMX51_UART)
36#define UART_PADDR 0x73fbc000
37#elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
38#define UART_PADDR 0x53fbc000
39#elif defined (CONFIG_DEBUG_IMX6Q_UART)
40#define UART_PADDR IMX6Q_DEBUG_UART_BASE
41#endif
42
43/*
44 * FIXME: This is a copy of IMX_IO_P2V in hardware.h, and needs to
45 * stay sync with that. It's hard to maintain, and should be fixed
46 * globally for multi-platform build to use a fixed virtual address
47 * for low-level debug uart port across platforms.
48 */
49#define IMX_IO_P2V(x) ( \
50 (((x) & 0x80000000) >> 7) | \
51 (0xf4000000 + \
52 (((x) & 0x50000000) >> 6) + \
53 (((x) & 0x0b000000) >> 4) + \
54 (((x) & 0x000fffff))))
55
56#define UART_VADDR IMX_IO_P2V(UART_PADDR)
57
58 .macro addruart, rp, rv, tmp
59 ldr \rp, =UART_PADDR @ physical
60 ldr \rv, =UART_VADDR @ virtual
61 .endm
62
63 .macro senduart,rd,rx
64 str \rd, [\rx, #0x40] @ TXDATA
65 .endm
66
67 .macro waituart,rd,rx
68 .endm
69
70 .macro busyuart,rd,rx
711002: ldr \rd, [\rx, #0x98] @ SR2
72 tst \rd, #1 << 3 @ TXDC
73 beq 1002b @ wait until transmit done
74 .endm
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index f8eecb959413..0153950f6068 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -58,6 +58,14 @@ config ARCH_DAVINCI_TNETV107X
58 58
59comment "DaVinci Board Type" 59comment "DaVinci Board Type"
60 60
61config MACH_DA8XX_DT
62 bool "Support DA8XX platforms using device tree"
63 default y
64 depends on ARCH_DAVINCI_DA8XX
65 help
66 Say y here to include support for TI DaVinci DA850 based using
67 Flattened Device Tree. More information at Documentation/devicetree
68
61config MACH_DAVINCI_EVM 69config MACH_DAVINCI_EVM
62 bool "TI DM644x EVM" 70 bool "TI DM644x EVM"
63 default ARCH_DAVINCI_DM644x 71 default ARCH_DAVINCI_DM644x
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index 2227effcb0e9..fb5c1aa98a63 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_AINTC) += irq.o
22obj-$(CONFIG_CP_INTC) += cp_intc.o 22obj-$(CONFIG_CP_INTC) += cp_intc.o
23 23
24# Board specific 24# Board specific
25obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o
25obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o 26obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o
26obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o 27obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o
27obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o 28obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 88ebea89abdf..cdf8d0746e79 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -324,7 +324,7 @@ static __init void dm355_evm_init(void)
324 if (IS_ERR(aemif)) 324 if (IS_ERR(aemif))
325 WARN("%s: unable to get AEMIF clock\n", __func__); 325 WARN("%s: unable to get AEMIF clock\n", __func__);
326 else 326 else
327 clk_enable(aemif); 327 clk_prepare_enable(aemif);
328 328
329 platform_add_devices(davinci_evm_devices, 329 platform_add_devices(davinci_evm_devices,
330 ARRAY_SIZE(davinci_evm_devices)); 330 ARRAY_SIZE(davinci_evm_devices));
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 2f88103c6459..d41954507fc2 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -246,7 +246,7 @@ static __init void dm355_leopard_init(void)
246 if (IS_ERR(aemif)) 246 if (IS_ERR(aemif))
247 WARN("%s: unable to get AEMIF clock\n", __func__); 247 WARN("%s: unable to get AEMIF clock\n", __func__);
248 else 248 else
249 clk_enable(aemif); 249 clk_prepare_enable(aemif);
250 250
251 platform_add_devices(davinci_leopard_devices, 251 platform_add_devices(davinci_leopard_devices,
252 ARRAY_SIZE(davinci_leopard_devices)); 252 ARRAY_SIZE(davinci_leopard_devices));
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 1b4a8adcfdc9..5d49c75388ca 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -478,7 +478,7 @@ static void __init evm_init_cpld(void)
478 aemif_clk = clk_get(NULL, "aemif"); 478 aemif_clk = clk_get(NULL, "aemif");
479 if (IS_ERR(aemif_clk)) 479 if (IS_ERR(aemif_clk))
480 return; 480 return;
481 clk_enable(aemif_clk); 481 clk_prepare_enable(aemif_clk);
482 482
483 if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE, 483 if (request_mem_region(DM365_ASYNC_EMIF_DATA_CE1_BASE, SECTION_SIZE,
484 "cpld") == NULL) 484 "cpld") == NULL)
@@ -489,7 +489,7 @@ static void __init evm_init_cpld(void)
489 SECTION_SIZE); 489 SECTION_SIZE);
490fail: 490fail:
491 pr_err("ERROR: can't map CPLD\n"); 491 pr_err("ERROR: can't map CPLD\n");
492 clk_disable(aemif_clk); 492 clk_disable_unprepare(aemif_clk);
493 return; 493 return;
494 } 494 }
495 495
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index f22572cee49d..a84dfcbc1154 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -776,7 +776,7 @@ static __init void davinci_evm_init(void)
776 struct davinci_soc_info *soc_info = &davinci_soc_info; 776 struct davinci_soc_info *soc_info = &davinci_soc_info;
777 777
778 aemif_clk = clk_get(NULL, "aemif"); 778 aemif_clk = clk_get(NULL, "aemif");
779 clk_enable(aemif_clk); 779 clk_prepare_enable(aemif_clk);
780 780
781 if (HAS_ATA) { 781 if (HAS_ATA) {
782 if (HAS_NAND || HAS_NOR) 782 if (HAS_NAND || HAS_NOR)
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 144bf31d68dd..3e3e3afebf88 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -188,7 +188,7 @@ static __init void davinci_ntosd2_init(void)
188 struct davinci_soc_info *soc_info = &davinci_soc_info; 188 struct davinci_soc_info *soc_info = &davinci_soc_info;
189 189
190 aemif_clk = clk_get(NULL, "aemif"); 190 aemif_clk = clk_get(NULL, "aemif");
191 clk_enable(aemif_clk); 191 clk_prepare_enable(aemif_clk);
192 192
193 if (HAS_ATA) { 193 if (HAS_ATA) {
194 if (HAS_NAND) 194 if (HAS_NAND)
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index b90c172d5541..68c5fe01857c 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -212,6 +212,12 @@ static struct clk tptc2_clk = {
212 .flags = ALWAYS_ENABLED, 212 .flags = ALWAYS_ENABLED,
213}; 213};
214 214
215static struct clk pruss_clk = {
216 .name = "pruss",
217 .parent = &pll0_sysclk2,
218 .lpsc = DA8XX_LPSC0_PRUSS,
219};
220
215static struct clk uart0_clk = { 221static struct clk uart0_clk = {
216 .name = "uart0", 222 .name = "uart0",
217 .parent = &pll0_sysclk2, 223 .parent = &pll0_sysclk2,
@@ -385,6 +391,7 @@ static struct clk_lookup da850_clks[] = {
385 CLK(NULL, "tptc1", &tptc1_clk), 391 CLK(NULL, "tptc1", &tptc1_clk),
386 CLK(NULL, "tpcc1", &tpcc1_clk), 392 CLK(NULL, "tpcc1", &tpcc1_clk),
387 CLK(NULL, "tptc2", &tptc2_clk), 393 CLK(NULL, "tptc2", &tptc2_clk),
394 CLK("pruss_uio", "pruss", &pruss_clk),
388 CLK(NULL, "uart0", &uart0_clk), 395 CLK(NULL, "uart0", &uart0_clk),
389 CLK(NULL, "uart1", &uart1_clk), 396 CLK(NULL, "uart1", &uart1_clk),
390 CLK(NULL, "uart2", &uart2_clk), 397 CLK(NULL, "uart2", &uart2_clk),
@@ -781,12 +788,6 @@ static struct map_desc da850_io_desc[] = {
781 .length = DA8XX_CP_INTC_SIZE, 788 .length = DA8XX_CP_INTC_SIZE,
782 .type = MT_DEVICE 789 .type = MT_DEVICE
783 }, 790 },
784 {
785 .virtual = SRAM_VIRT,
786 .pfn = __phys_to_pfn(DA8XX_ARM_RAM_BASE),
787 .length = SZ_8K,
788 .type = MT_DEVICE
789 },
790}; 791};
791 792
792static u32 da850_psc_bases[] = { DA8XX_PSC0_BASE, DA8XX_PSC1_BASE }; 793static u32 da850_psc_bases[] = { DA8XX_PSC0_BASE, DA8XX_PSC1_BASE };
@@ -1239,8 +1240,8 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
1239 .gpio_irq = IRQ_DA8XX_GPIO0, 1240 .gpio_irq = IRQ_DA8XX_GPIO0,
1240 .serial_dev = &da8xx_serial_device, 1241 .serial_dev = &da8xx_serial_device,
1241 .emac_pdata = &da8xx_emac_pdata, 1242 .emac_pdata = &da8xx_emac_pdata,
1242 .sram_dma = DA8XX_ARM_RAM_BASE, 1243 .sram_dma = DA8XX_SHARED_RAM_BASE,
1243 .sram_len = SZ_8K, 1244 .sram_len = SZ_128K,
1244}; 1245};
1245 1246
1246void __init da850_init(void) 1247void __init da850_init(void)
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
new file mode 100644
index 000000000000..37c27af18fa0
--- /dev/null
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -0,0 +1,66 @@
1/*
2 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 * Modified from mach-omap/omap2/board-generic.c
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/io.h>
11#include <linux/of_irq.h>
12#include <linux/of_platform.h>
13#include <linux/irqdomain.h>
14
15#include <asm/mach/arch.h>
16
17#include <mach/common.h>
18#include <mach/cp_intc.h>
19#include <mach/da8xx.h>
20
21#define DA8XX_NUM_UARTS 3
22
23void __init da8xx_uart_clk_enable(void)
24{
25 int i;
26 for (i = 0; i < DA8XX_NUM_UARTS; i++)
27 davinci_serial_setup_clk(i, NULL);
28}
29
30static struct of_device_id da8xx_irq_match[] __initdata = {
31 { .compatible = "ti,cp-intc", .data = cp_intc_of_init, },
32 { }
33};
34
35static void __init da8xx_init_irq(void)
36{
37 of_irq_init(da8xx_irq_match);
38}
39
40#ifdef CONFIG_ARCH_DAVINCI_DA850
41
42static void __init da850_init_machine(void)
43{
44 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
45
46 da8xx_uart_clk_enable();
47}
48
49static const char *da850_boards_compat[] __initdata = {
50 "enbw,cmc",
51 "ti,da850-evm",
52 "ti,da850",
53 NULL,
54};
55
56DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x")
57 .map_io = da850_init,
58 .init_irq = da8xx_init_irq,
59 .timer = &davinci_timer,
60 .init_machine = da850_init_machine,
61 .dt_compat = da850_boards_compat,
62 .init_late = davinci_init_late,
63 .restart = da8xx_restart,
64MACHINE_END
65
66#endif
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index bd2f72b414bc..46c9a0c09ae5 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -22,6 +22,7 @@
22#include <mach/time.h> 22#include <mach/time.h>
23#include <mach/da8xx.h> 23#include <mach/da8xx.h>
24#include <mach/cpuidle.h> 24#include <mach/cpuidle.h>
25#include <mach/sram.h>
25 26
26#include "clock.h" 27#include "clock.h"
27#include "asp.h" 28#include "asp.h"
@@ -32,6 +33,7 @@
32#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */ 33#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */
33#define DA8XX_I2C0_BASE 0x01c22000 34#define DA8XX_I2C0_BASE 0x01c22000
34#define DA8XX_RTC_BASE 0x01c23000 35#define DA8XX_RTC_BASE 0x01c23000
36#define DA8XX_PRUSS_MEM_BASE 0x01c30000
35#define DA8XX_MMCSD0_BASE 0x01c40000 37#define DA8XX_MMCSD0_BASE 0x01c40000
36#define DA8XX_SPI0_BASE 0x01c41000 38#define DA8XX_SPI0_BASE 0x01c41000
37#define DA830_SPI1_BASE 0x01e12000 39#define DA830_SPI1_BASE 0x01e12000
@@ -518,6 +520,75 @@ void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
518 } 520 }
519} 521}
520 522
523static struct resource da8xx_pruss_resources[] = {
524 {
525 .start = DA8XX_PRUSS_MEM_BASE,
526 .end = DA8XX_PRUSS_MEM_BASE + 0xFFFF,
527 .flags = IORESOURCE_MEM,
528 },
529 {
530 .start = IRQ_DA8XX_EVTOUT0,
531 .end = IRQ_DA8XX_EVTOUT0,
532 .flags = IORESOURCE_IRQ,
533 },
534 {
535 .start = IRQ_DA8XX_EVTOUT1,
536 .end = IRQ_DA8XX_EVTOUT1,
537 .flags = IORESOURCE_IRQ,
538 },
539 {
540 .start = IRQ_DA8XX_EVTOUT2,
541 .end = IRQ_DA8XX_EVTOUT2,
542 .flags = IORESOURCE_IRQ,
543 },
544 {
545 .start = IRQ_DA8XX_EVTOUT3,
546 .end = IRQ_DA8XX_EVTOUT3,
547 .flags = IORESOURCE_IRQ,
548 },
549 {
550 .start = IRQ_DA8XX_EVTOUT4,
551 .end = IRQ_DA8XX_EVTOUT4,
552 .flags = IORESOURCE_IRQ,
553 },
554 {
555 .start = IRQ_DA8XX_EVTOUT5,
556 .end = IRQ_DA8XX_EVTOUT5,
557 .flags = IORESOURCE_IRQ,
558 },
559 {
560 .start = IRQ_DA8XX_EVTOUT6,
561 .end = IRQ_DA8XX_EVTOUT6,
562 .flags = IORESOURCE_IRQ,
563 },
564 {
565 .start = IRQ_DA8XX_EVTOUT7,
566 .end = IRQ_DA8XX_EVTOUT7,
567 .flags = IORESOURCE_IRQ,
568 },
569};
570
571static struct uio_pruss_pdata da8xx_uio_pruss_pdata = {
572 .pintc_base = 0x4000,
573};
574
575static struct platform_device da8xx_uio_pruss_dev = {
576 .name = "pruss_uio",
577 .id = -1,
578 .num_resources = ARRAY_SIZE(da8xx_pruss_resources),
579 .resource = da8xx_pruss_resources,
580 .dev = {
581 .coherent_dma_mask = DMA_BIT_MASK(32),
582 .platform_data = &da8xx_uio_pruss_pdata,
583 }
584};
585
586int __init da8xx_register_uio_pruss(void)
587{
588 da8xx_uio_pruss_pdata.sram_pool = sram_get_gen_pool();
589 return platform_device_register(&da8xx_uio_pruss_dev);
590}
591
521static const struct display_panel disp_panel = { 592static const struct display_panel disp_panel = {
522 QVGA, 593 QVGA,
523 16, 594 16,
@@ -900,7 +971,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr)
900 if (IS_ERR(da850_sata_clk)) 971 if (IS_ERR(da850_sata_clk))
901 return PTR_ERR(da850_sata_clk); 972 return PTR_ERR(da850_sata_clk);
902 973
903 ret = clk_enable(da850_sata_clk); 974 ret = clk_prepare_enable(da850_sata_clk);
904 if (ret) 975 if (ret)
905 goto err0; 976 goto err0;
906 977
@@ -931,7 +1002,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr)
931 return 0; 1002 return 0;
932 1003
933err1: 1004err1:
934 clk_disable(da850_sata_clk); 1005 clk_disable_unprepare(da850_sata_clk);
935err0: 1006err0:
936 clk_put(da850_sata_clk); 1007 clk_put(da850_sata_clk);
937 return ret; 1008 return ret;
@@ -939,7 +1010,7 @@ err0:
939 1010
940static void da850_sata_exit(struct device *dev) 1011static void da850_sata_exit(struct device *dev)
941{ 1012{
942 clk_disable(da850_sata_clk); 1013 clk_disable_unprepare(da850_sata_clk);
943 clk_put(da850_sata_clk); 1014 clk_put(da850_sata_clk);
944} 1015}
945 1016
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index a255434908db..b49c3b77d55e 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -758,12 +758,6 @@ static struct map_desc dm355_io_desc[] = {
758 .length = IO_SIZE, 758 .length = IO_SIZE,
759 .type = MT_DEVICE 759 .type = MT_DEVICE
760 }, 760 },
761 {
762 .virtual = SRAM_VIRT,
763 .pfn = __phys_to_pfn(0x00010000),
764 .length = SZ_32K,
765 .type = MT_MEMORY_NONCACHED,
766 },
767}; 761};
768 762
769/* Contents of JTAG ID register used to identify exact cpu type */ 763/* Contents of JTAG ID register used to identify exact cpu type */
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index b680c832e0ba..6c3980540be0 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -985,12 +985,6 @@ static struct map_desc dm365_io_desc[] = {
985 .length = IO_SIZE, 985 .length = IO_SIZE,
986 .type = MT_DEVICE 986 .type = MT_DEVICE
987 }, 987 },
988 {
989 .virtual = SRAM_VIRT,
990 .pfn = __phys_to_pfn(0x00010000),
991 .length = SZ_32K,
992 .type = MT_MEMORY_NONCACHED,
993 },
994}; 988};
995 989
996static struct resource dm365_ks_resources[] = { 990static struct resource dm365_ks_resources[] = {
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index cd0c8b1e1ecf..9ab1f105cf00 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -786,12 +786,6 @@ static struct map_desc dm644x_io_desc[] = {
786 .length = IO_SIZE, 786 .length = IO_SIZE,
787 .type = MT_DEVICE 787 .type = MT_DEVICE
788 }, 788 },
789 {
790 .virtual = SRAM_VIRT,
791 .pfn = __phys_to_pfn(0x00008000),
792 .length = SZ_16K,
793 .type = MT_MEMORY_NONCACHED,
794 },
795}; 789};
796 790
797/* Contents of JTAG ID register used to identify exact cpu type */ 791/* Contents of JTAG ID register used to identify exact cpu type */
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 97c0f8e555bd..ac7b431c4c8e 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -756,12 +756,6 @@ static struct map_desc dm646x_io_desc[] = {
756 .length = IO_SIZE, 756 .length = IO_SIZE,
757 .type = MT_DEVICE 757 .type = MT_DEVICE
758 }, 758 },
759 {
760 .virtual = SRAM_VIRT,
761 .pfn = __phys_to_pfn(0x00010000),
762 .length = SZ_32K,
763 .type = MT_MEMORY_NONCACHED,
764 },
765}; 759};
766 760
767/* Contents of JTAG ID register used to identify exact cpu type */ 761/* Contents of JTAG ID register used to identify exact cpu type */
diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
index bdc4aa8e672a..046c7238a3d6 100644
--- a/arch/arm/mach-davinci/include/mach/common.h
+++ b/arch/arm/mach-davinci/include/mach/common.h
@@ -104,8 +104,6 @@ int davinci_pm_init(void);
104static inline int davinci_pm_init(void) { return 0; } 104static inline int davinci_pm_init(void) { return 0; }
105#endif 105#endif
106 106
107/* standard place to map on-chip SRAMs; they *may* support DMA */
108#define SRAM_VIRT 0xfffe0000
109#define SRAM_SIZE SZ_128K 107#define SRAM_SIZE SZ_128K
110 108
111#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */ 109#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index aaccdc4528fc..700d311c6854 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -26,6 +26,7 @@
26#include <linux/platform_data/mmc-davinci.h> 26#include <linux/platform_data/mmc-davinci.h>
27#include <linux/platform_data/usb-davinci.h> 27#include <linux/platform_data/usb-davinci.h>
28#include <linux/platform_data/spi-davinci.h> 28#include <linux/platform_data/spi-davinci.h>
29#include <linux/platform_data/uio_pruss.h>
29 30
30#include <media/davinci/vpif_types.h> 31#include <media/davinci/vpif_types.h>
31 32
@@ -72,6 +73,7 @@ extern unsigned int da850_max_speed;
72#define DA8XX_AEMIF_CS2_BASE 0x60000000 73#define DA8XX_AEMIF_CS2_BASE 0x60000000
73#define DA8XX_AEMIF_CS3_BASE 0x62000000 74#define DA8XX_AEMIF_CS3_BASE 0x62000000
74#define DA8XX_AEMIF_CTL_BASE 0x68000000 75#define DA8XX_AEMIF_CTL_BASE 0x68000000
76#define DA8XX_SHARED_RAM_BASE 0x80000000
75#define DA8XX_ARM_RAM_BASE 0xffff0000 77#define DA8XX_ARM_RAM_BASE 0xffff0000
76 78
77void __init da830_init(void); 79void __init da830_init(void);
@@ -86,6 +88,7 @@ int da8xx_register_watchdog(void);
86int da8xx_register_usb20(unsigned mA, unsigned potpgt); 88int da8xx_register_usb20(unsigned mA, unsigned potpgt);
87int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); 89int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
88int da8xx_register_emac(void); 90int da8xx_register_emac(void);
91int da8xx_register_uio_pruss(void);
89int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata); 92int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
90int da8xx_register_mmcsd0(struct davinci_mmc_config *config); 93int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
91int da850_register_mmcsd1(struct davinci_mmc_config *config); 94int da850_register_mmcsd1(struct davinci_mmc_config *config);
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h
index 46b3cd11c3c2..2d9d921e8b01 100644
--- a/arch/arm/mach-davinci/include/mach/serial.h
+++ b/arch/arm/mach-davinci/include/mach/serial.h
@@ -43,6 +43,7 @@ struct davinci_uart_config {
43}; 43};
44 44
45extern int davinci_serial_init(struct davinci_uart_config *); 45extern int davinci_serial_init(struct davinci_uart_config *);
46extern int davinci_serial_setup_clk(unsigned instance, unsigned int *rate);
46#endif 47#endif
47 48
48#endif /* __ASM_ARCH_SERIAL_H */ 49#endif /* __ASM_ARCH_SERIAL_H */
diff --git a/arch/arm/mach-davinci/include/mach/sram.h b/arch/arm/mach-davinci/include/mach/sram.h
index 111f7cc71e07..4e5db56218b8 100644
--- a/arch/arm/mach-davinci/include/mach/sram.h
+++ b/arch/arm/mach-davinci/include/mach/sram.h
@@ -24,4 +24,7 @@
24extern void *sram_alloc(size_t len, dma_addr_t *dma); 24extern void *sram_alloc(size_t len, dma_addr_t *dma);
25extern void sram_free(void *addr, size_t len); 25extern void sram_free(void *addr, size_t len);
26 26
27/* Get the struct gen_pool * for use in platform data */
28extern struct gen_pool *sram_get_gen_pool(void);
29
27#endif /* __MACH_SRAM_H */ 30#endif /* __MACH_SRAM_H */
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c
index 1875740fe27c..f2625814c3c9 100644
--- a/arch/arm/mach-davinci/serial.c
+++ b/arch/arm/mach-davinci/serial.c
@@ -70,11 +70,33 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p)
70 UART_DM646X_SCR_TX_WATERMARK); 70 UART_DM646X_SCR_TX_WATERMARK);
71} 71}
72 72
73int __init davinci_serial_init(struct davinci_uart_config *info) 73/* Enable UART clock and obtain its rate */
74int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate)
74{ 75{
75 int i;
76 char name[16]; 76 char name[16];
77 struct clk *uart_clk; 77 struct clk *clk;
78 struct davinci_soc_info *soc_info = &davinci_soc_info;
79 struct device *dev = &soc_info->serial_dev->dev;
80
81 sprintf(name, "uart%d", instance);
82 clk = clk_get(dev, name);
83 if (IS_ERR(clk)) {
84 pr_err("%s:%d: failed to get UART%d clock\n",
85 __func__, __LINE__, instance);
86 return PTR_ERR(clk);
87 }
88
89 clk_prepare_enable(clk);
90
91 if (rate)
92 *rate = clk_get_rate(clk);
93
94 return 0;
95}
96
97int __init davinci_serial_init(struct davinci_uart_config *info)
98{
99 int i, ret;
78 struct davinci_soc_info *soc_info = &davinci_soc_info; 100 struct davinci_soc_info *soc_info = &davinci_soc_info;
79 struct device *dev = &soc_info->serial_dev->dev; 101 struct device *dev = &soc_info->serial_dev->dev;
80 struct plat_serial8250_port *p = dev->platform_data; 102 struct plat_serial8250_port *p = dev->platform_data;
@@ -87,16 +109,9 @@ int __init davinci_serial_init(struct davinci_uart_config *info)
87 if (!(info->enabled_uarts & (1 << i))) 109 if (!(info->enabled_uarts & (1 << i)))
88 continue; 110 continue;
89 111
90 sprintf(name, "uart%d", i); 112 ret = davinci_serial_setup_clk(i, &p->uartclk);
91 uart_clk = clk_get(dev, name); 113 if (ret)
92 if (IS_ERR(uart_clk)) {
93 printk(KERN_ERR "%s:%d: failed to get UART%d clock\n",
94 __func__, __LINE__, i);
95 continue; 114 continue;
96 }
97
98 clk_enable(uart_clk);
99 p->uartclk = clk_get_rate(uart_clk);
100 115
101 if (!p->membase && p->mapbase) { 116 if (!p->membase && p->mapbase) {
102 p->membase = ioremap(p->mapbase, SZ_4K); 117 p->membase = ioremap(p->mapbase, SZ_4K);
diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c
index db0f7787faf1..c5f7ee5cc80a 100644
--- a/arch/arm/mach-davinci/sram.c
+++ b/arch/arm/mach-davinci/sram.c
@@ -10,6 +10,7 @@
10 */ 10 */
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/io.h>
13#include <linux/genalloc.h> 14#include <linux/genalloc.h>
14 15
15#include <mach/common.h> 16#include <mach/common.h>
@@ -17,6 +18,11 @@
17 18
18static struct gen_pool *sram_pool; 19static struct gen_pool *sram_pool;
19 20
21struct gen_pool *sram_get_gen_pool(void)
22{
23 return sram_pool;
24}
25
20void *sram_alloc(size_t len, dma_addr_t *dma) 26void *sram_alloc(size_t len, dma_addr_t *dma)
21{ 27{
22 unsigned long vaddr; 28 unsigned long vaddr;
@@ -32,7 +38,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma)
32 return NULL; 38 return NULL;
33 39
34 if (dma) 40 if (dma)
35 *dma = dma_base + (vaddr - SRAM_VIRT); 41 *dma = gen_pool_virt_to_phys(sram_pool, vaddr);
36 return (void *)vaddr; 42 return (void *)vaddr;
37 43
38} 44}
@@ -53,8 +59,10 @@ EXPORT_SYMBOL(sram_free);
53 */ 59 */
54static int __init sram_init(void) 60static int __init sram_init(void)
55{ 61{
62 phys_addr_t phys = davinci_soc_info.sram_dma;
56 unsigned len = davinci_soc_info.sram_len; 63 unsigned len = davinci_soc_info.sram_len;
57 int status = 0; 64 int status = 0;
65 void *addr;
58 66
59 if (len) { 67 if (len) {
60 len = min_t(unsigned, len, SRAM_SIZE); 68 len = min_t(unsigned, len, SRAM_SIZE);
@@ -62,8 +70,17 @@ static int __init sram_init(void)
62 if (!sram_pool) 70 if (!sram_pool)
63 status = -ENOMEM; 71 status = -ENOMEM;
64 } 72 }
65 if (sram_pool) 73
66 status = gen_pool_add(sram_pool, SRAM_VIRT, len, -1); 74 if (sram_pool) {
75 addr = ioremap(phys, len);
76 if (!addr)
77 return -ENOMEM;
78 status = gen_pool_add_virt(sram_pool, (unsigned)addr,
79 phys, len, -1);
80 if (status < 0)
81 iounmap(addr);
82 }
83
67 WARN_ON(status < 0); 84 WARN_ON(status < 0);
68 return status; 85 return status;
69} 86}
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 75da315b6587..9847938785ca 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -379,7 +379,7 @@ static void __init davinci_timer_init(void)
379 379
380 timer_clk = clk_get(NULL, "timer0"); 380 timer_clk = clk_get(NULL, "timer0");
381 BUG_ON(IS_ERR(timer_clk)); 381 BUG_ON(IS_ERR(timer_clk));
382 clk_enable(timer_clk); 382 clk_prepare_enable(timer_clk);
383 383
384 /* init timer hw */ 384 /* init timer hw */
385 timer_init(); 385 timer_init();
@@ -429,7 +429,7 @@ void davinci_watchdog_reset(struct platform_device *pdev)
429 wd_clk = clk_get(&pdev->dev, NULL); 429 wd_clk = clk_get(&pdev->dev, NULL);
430 if (WARN_ON(IS_ERR(wd_clk))) 430 if (WARN_ON(IS_ERR(wd_clk)))
431 return; 431 return;
432 clk_enable(wd_clk); 432 clk_prepare_enable(wd_clk);
433 433
434 /* disable, internal clock source */ 434 /* disable, internal clock source */
435 __raw_writel(0, base + TCR); 435 __raw_writel(0, base + TCR);
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index da55107033dd..bb3b09aa9183 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -63,6 +63,7 @@ config SOC_EXYNOS5250
63 depends on ARCH_EXYNOS5 63 depends on ARCH_EXYNOS5
64 select S5P_PM if PM 64 select S5P_PM if PM
65 select S5P_SLEEP if PM 65 select S5P_SLEEP if PM
66 select S5P_DEV_MFC
66 select SAMSUNG_DMADEV 67 select SAMSUNG_DMADEV
67 help 68 help
68 Enable EXYNOS5250 SoC support 69 Enable EXYNOS5250 SoC support
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 9b58024f7d43..1797dee88a0d 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -53,7 +53,6 @@ obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o
53obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o 53obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o
54obj-$(CONFIG_EXYNOS_DEV_DMA) += dma.o 54obj-$(CONFIG_EXYNOS_DEV_DMA) += dma.o
55obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o 55obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o
56obj-$(CONFIG_EXYNOS_DEV_DRM) += dev-drm.o
57obj-$(CONFIG_EXYNOS_DEV_SYSMMU) += dev-sysmmu.o 56obj-$(CONFIG_EXYNOS_DEV_SYSMMU) += dev-sysmmu.o
58 57
59obj-$(CONFIG_ARCH_EXYNOS) += setup-i2c0.o 58obj-$(CONFIG_ARCH_EXYNOS) += setup-i2c0.o
diff --git a/arch/arm/mach-exynos/clock-exynos4.c b/arch/arm/mach-exynos/clock-exynos4.c
index 6a45c9a9abe9..1870bee991b6 100644
--- a/arch/arm/mach-exynos/clock-exynos4.c
+++ b/arch/arm/mach-exynos/clock-exynos4.c
@@ -576,6 +576,10 @@ static struct clk exynos4_init_clocks_off[] = {
576 .enable = exynos4_clk_ip_peril_ctrl, 576 .enable = exynos4_clk_ip_peril_ctrl,
577 .ctrlbit = (1 << 15), 577 .ctrlbit = (1 << 15),
578 }, { 578 }, {
579 .name = "tmu_apbif",
580 .enable = exynos4_clk_ip_perir_ctrl,
581 .ctrlbit = (1 << 17),
582 }, {
579 .name = "keypad", 583 .name = "keypad",
580 .enable = exynos4_clk_ip_perir_ctrl, 584 .enable = exynos4_clk_ip_perir_ctrl,
581 .ctrlbit = (1 << 16), 585 .ctrlbit = (1 << 16),
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index c44ca1ee1b8d..f1e0386262a8 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -196,6 +196,11 @@ static int exynos5_clk_ip_isp1_ctrl(struct clk *clk, int enable)
196 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ISP1, clk, enable); 196 return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ISP1, clk, enable);
197} 197}
198 198
199static int exynos5_clk_hdmiphy_ctrl(struct clk *clk, int enable)
200{
201 return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
202}
203
199/* Core list of CMU_CPU side */ 204/* Core list of CMU_CPU side */
200 205
201static struct clksrc_clk exynos5_clk_mout_apll = { 206static struct clksrc_clk exynos5_clk_mout_apll = {
@@ -616,6 +621,11 @@ static struct clk exynos5_init_clocks_off[] = {
616 .enable = exynos5_clk_ip_peric_ctrl, 621 .enable = exynos5_clk_ip_peric_ctrl,
617 .ctrlbit = (1 << 24), 622 .ctrlbit = (1 << 24),
618 }, { 623 }, {
624 .name = "tmu_apbif",
625 .parent = &exynos5_clk_aclk_66.clk,
626 .enable = exynos5_clk_ip_peris_ctrl,
627 .ctrlbit = (1 << 21),
628 }, {
619 .name = "rtc", 629 .name = "rtc",
620 .parent = &exynos5_clk_aclk_66.clk, 630 .parent = &exynos5_clk_aclk_66.clk,
621 .enable = exynos5_clk_ip_peris_ctrl, 631 .enable = exynos5_clk_ip_peris_ctrl,
@@ -664,17 +674,22 @@ static struct clk exynos5_init_clocks_off[] = {
664 .ctrlbit = (1 << 25), 674 .ctrlbit = (1 << 25),
665 }, { 675 }, {
666 .name = "mfc", 676 .name = "mfc",
667 .devname = "s5p-mfc", 677 .devname = "s5p-mfc-v6",
668 .enable = exynos5_clk_ip_mfc_ctrl, 678 .enable = exynos5_clk_ip_mfc_ctrl,
669 .ctrlbit = (1 << 0), 679 .ctrlbit = (1 << 0),
670 }, { 680 }, {
671 .name = "hdmi", 681 .name = "hdmi",
672 .devname = "exynos4-hdmi", 682 .devname = "exynos5-hdmi",
673 .enable = exynos5_clk_ip_disp1_ctrl, 683 .enable = exynos5_clk_ip_disp1_ctrl,
674 .ctrlbit = (1 << 6), 684 .ctrlbit = (1 << 6),
675 }, { 685 }, {
686 .name = "hdmiphy",
687 .devname = "exynos5-hdmi",
688 .enable = exynos5_clk_hdmiphy_ctrl,
689 .ctrlbit = (1 << 0),
690 }, {
676 .name = "mixer", 691 .name = "mixer",
677 .devname = "s5p-mixer", 692 .devname = "exynos5-mixer",
678 .enable = exynos5_clk_ip_disp1_ctrl, 693 .enable = exynos5_clk_ip_disp1_ctrl,
679 .ctrlbit = (1 << 5), 694 .ctrlbit = (1 << 5),
680 }, { 695 }, {
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 1947be8e5f5b..4af8284f3597 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -997,11 +997,14 @@ static int __init exynos_init_irq_eint(void)
997 * platforms switch over to using the pinctrl driver, the wakeup 997 * platforms switch over to using the pinctrl driver, the wakeup
998 * interrupt support code here can be completely removed. 998 * interrupt support code here can be completely removed.
999 */ 999 */
1000 static const struct of_device_id exynos_pinctrl_ids[] = {
1001 { .compatible = "samsung,pinctrl-exynos4210", },
1002 { .compatible = "samsung,pinctrl-exynos4x12", },
1003 };
1000 struct device_node *pctrl_np, *wkup_np; 1004 struct device_node *pctrl_np, *wkup_np;
1001 const char *pctrl_compat = "samsung,pinctrl-exynos4210";
1002 const char *wkup_compat = "samsung,exynos4210-wakeup-eint"; 1005 const char *wkup_compat = "samsung,exynos4210-wakeup-eint";
1003 1006
1004 for_each_compatible_node(pctrl_np, NULL, pctrl_compat) { 1007 for_each_matching_node(pctrl_np, exynos_pinctrl_ids) {
1005 if (of_device_is_available(pctrl_np)) { 1008 if (of_device_is_available(pctrl_np)) {
1006 wkup_np = of_find_compatible_node(pctrl_np, NULL, 1009 wkup_np = of_find_compatible_node(pctrl_np, NULL,
1007 wkup_compat); 1010 wkup_compat);
diff --git a/arch/arm/mach-exynos/dev-drm.c b/arch/arm/mach-exynos/dev-drm.c
deleted file mode 100644
index 17c9c6ecc2e0..000000000000
--- a/arch/arm/mach-exynos/dev-drm.c
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * linux/arch/arm/mach-exynos/dev-drm.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 *
7 * EXYNOS - core DRM device
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
15#include <linux/kernel.h>
16#include <linux/dma-mapping.h>
17#include <linux/platform_device.h>
18
19#include <plat/devs.h>
20
21static u64 exynos_drm_dma_mask = DMA_BIT_MASK(32);
22
23struct platform_device exynos_device_drm = {
24 .name = "exynos-drm",
25 .dev = {
26 .dma_mask = &exynos_drm_dma_mask,
27 .coherent_dma_mask = DMA_BIT_MASK(32),
28 }
29};
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-exynos/include/mach/irqs.h
index 35bced6f9092..5adacd12e43b 100644
--- a/arch/arm/mach-exynos/include/mach/irqs.h
+++ b/arch/arm/mach-exynos/include/mach/irqs.h
@@ -136,6 +136,9 @@
136#define EXYNOS4_IRQ_TSI IRQ_SPI(115) 136#define EXYNOS4_IRQ_TSI IRQ_SPI(115)
137#define EXYNOS4_IRQ_SATA IRQ_SPI(116) 137#define EXYNOS4_IRQ_SATA IRQ_SPI(116)
138 138
139#define EXYNOS4_IRQ_TMU_TRIG0 COMBINER_IRQ(2, 4)
140#define EXYNOS4_IRQ_TMU_TRIG1 COMBINER_IRQ(3, 4)
141
139#define EXYNOS4_IRQ_SYSMMU_MDMA0_0 COMBINER_IRQ(4, 0) 142#define EXYNOS4_IRQ_SYSMMU_MDMA0_0 COMBINER_IRQ(4, 0)
140#define EXYNOS4_IRQ_SYSMMU_SSS_0 COMBINER_IRQ(4, 1) 143#define EXYNOS4_IRQ_SYSMMU_SSS_0 COMBINER_IRQ(4, 1)
141#define EXYNOS4_IRQ_SYSMMU_FIMC0_0 COMBINER_IRQ(4, 2) 144#define EXYNOS4_IRQ_SYSMMU_FIMC0_0 COMBINER_IRQ(4, 2)
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 8480849affb9..772acd344cbd 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -88,6 +88,8 @@
88#define EXYNOS4_PA_TWD 0x10500600 88#define EXYNOS4_PA_TWD 0x10500600
89#define EXYNOS4_PA_L2CC 0x10502000 89#define EXYNOS4_PA_L2CC 0x10502000
90 90
91#define EXYNOS4_PA_TMU 0x100C0000
92
91#define EXYNOS4_PA_MDMA0 0x10810000 93#define EXYNOS4_PA_MDMA0 0x10810000
92#define EXYNOS4_PA_MDMA1 0x12850000 94#define EXYNOS4_PA_MDMA1 0x12850000
93#define EXYNOS4_PA_PDMA0 0x12680000 95#define EXYNOS4_PA_PDMA0 0x12680000
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
index eadf4b59e7d2..8858068d2b6a 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -77,6 +77,8 @@ static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = {
77 "exynos4210-spi.2", NULL), 77 "exynos4210-spi.2", NULL),
78 OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL), 78 OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL),
79 OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL), 79 OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL),
80 OF_DEV_AUXDATA("samsung,exynos4210-tmu", EXYNOS4_PA_TMU,
81 "exynos-tmu", NULL),
80 {}, 82 {},
81}; 83};
82 84
@@ -94,6 +96,8 @@ static void __init exynos4_dt_machine_init(void)
94 96
95static char const *exynos4_dt_compat[] __initdata = { 97static char const *exynos4_dt_compat[] __initdata = {
96 "samsung,exynos4210", 98 "samsung,exynos4210",
99 "samsung,exynos4212",
100 "samsung,exynos4412",
97 NULL 101 NULL
98}; 102};
99 103
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index db1cd8eacf28..25f464cf7979 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -11,6 +11,8 @@
11 11
12#include <linux/of_platform.h> 12#include <linux/of_platform.h>
13#include <linux/serial_core.h> 13#include <linux/serial_core.h>
14#include <linux/memblock.h>
15#include <linux/of_fdt.h>
14 16
15#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
16#include <asm/hardware/gic.h> 18#include <asm/hardware/gic.h>
@@ -18,6 +20,7 @@
18 20
19#include <plat/cpu.h> 21#include <plat/cpu.h>
20#include <plat/regs-serial.h> 22#include <plat/regs-serial.h>
23#include <plat/mfc.h>
21 24
22#include "common.h" 25#include "common.h"
23 26
@@ -47,6 +50,20 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
47 "s3c2440-i2c.0", NULL), 50 "s3c2440-i2c.0", NULL),
48 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1), 51 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1),
49 "s3c2440-i2c.1", NULL), 52 "s3c2440-i2c.1", NULL),
53 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(2),
54 "s3c2440-i2c.2", NULL),
55 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(3),
56 "s3c2440-i2c.3", NULL),
57 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(4),
58 "s3c2440-i2c.4", NULL),
59 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(5),
60 "s3c2440-i2c.5", NULL),
61 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(6),
62 "s3c2440-i2c.6", NULL),
63 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(7),
64 "s3c2440-i2c.7", NULL),
65 OF_DEV_AUXDATA("samsung,s3c2440-hdmiphy-i2c", EXYNOS5_PA_IIC(8),
66 "s3c2440-hdmiphy-i2c", NULL),
50 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0, 67 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0,
51 "dw_mmc.0", NULL), 68 "dw_mmc.0", NULL),
52 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI1, 69 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI1,
@@ -61,6 +78,12 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
61 "exynos4210-spi.1", NULL), 78 "exynos4210-spi.1", NULL),
62 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI2, 79 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI2,
63 "exynos4210-spi.2", NULL), 80 "exynos4210-spi.2", NULL),
81 OF_DEV_AUXDATA("samsung,exynos5-sata-ahci", 0x122F0000,
82 "exynos5-sata", NULL),
83 OF_DEV_AUXDATA("samsung,exynos5-sata-phy", 0x12170000,
84 "exynos5-sata-phy", NULL),
85 OF_DEV_AUXDATA("samsung,exynos5-sata-phy-i2c", 0x121D0000,
86 "exynos5-sata-phy-i2c", NULL),
64 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0", NULL), 87 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0", NULL),
65 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1", NULL), 88 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1", NULL),
66 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL), 89 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL),
@@ -72,6 +95,13 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
72 "exynos-gsc.2", NULL), 95 "exynos-gsc.2", NULL),
73 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3, 96 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
74 "exynos-gsc.3", NULL), 97 "exynos-gsc.3", NULL),
98 OF_DEV_AUXDATA("samsung,exynos5-hdmi", 0x14530000,
99 "exynos5-hdmi", NULL),
100 OF_DEV_AUXDATA("samsung,exynos5-mixer", 0x14450000,
101 "exynos5-mixer", NULL),
102 OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL),
103 OF_DEV_AUXDATA("samsung,exynos5250-tmu", 0x10060000,
104 "exynos-tmu", NULL),
75 {}, 105 {},
76}; 106};
77 107
@@ -92,6 +122,17 @@ static char const *exynos5250_dt_compat[] __initdata = {
92 NULL 122 NULL
93}; 123};
94 124
125static void __init exynos5_reserve(void)
126{
127 struct s5p_mfc_dt_meminfo mfc_mem;
128
129 /* Reserve memory for MFC only if it's available */
130 mfc_mem.compatible = "samsung,mfc-v6";
131 if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
132 s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
133 mfc_mem.lsize);
134}
135
95DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") 136DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
96 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 137 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
97 .init_irq = exynos5_init_irq, 138 .init_irq = exynos5_init_irq,
@@ -103,4 +144,5 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
103 .timer = &exynos4_timer, 144 .timer = &exynos4_timer,
104 .dt_compat = exynos5250_dt_compat, 145 .dt_compat = exynos5250_dt_compat,
105 .restart = exynos5_restart, 146 .restart = exynos5_restart,
147 .reserve = exynos5_reserve,
106MACHINE_END 148MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index c05d7aa84031..94970602df61 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1327,9 +1327,6 @@ static struct platform_device *nuri_devices[] __initdata = {
1327 &cam_vdda_fixed_rdev, 1327 &cam_vdda_fixed_rdev,
1328 &cam_8m_12v_fixed_rdev, 1328 &cam_8m_12v_fixed_rdev,
1329 &exynos4_bus_devfreq, 1329 &exynos4_bus_devfreq,
1330#ifdef CONFIG_DRM_EXYNOS
1331 &exynos_device_drm,
1332#endif
1333}; 1330};
1334 1331
1335static void __init nuri_map_io(void) 1332static void __init nuri_map_io(void)
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 9adf491674ea..d8dc6d7f0c00 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -709,9 +709,6 @@ static struct platform_device *origen_devices[] __initdata = {
709 &s5p_device_mfc_l, 709 &s5p_device_mfc_l,
710 &s5p_device_mfc_r, 710 &s5p_device_mfc_r,
711 &s5p_device_mixer, 711 &s5p_device_mixer,
712#ifdef CONFIG_DRM_EXYNOS
713 &exynos_device_drm,
714#endif
715 &exynos4_device_ohci, 712 &exynos4_device_ohci,
716 &origen_device_gpiokeys, 713 &origen_device_gpiokeys,
717 &origen_lcd_hv070wsa, 714 &origen_lcd_hv070wsa,
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index 730f1ac65928..17b9ca48722e 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -317,9 +317,6 @@ static struct platform_device *smdk4x12_devices[] __initdata = {
317 &s5p_device_mfc, 317 &s5p_device_mfc,
318 &s5p_device_mfc_l, 318 &s5p_device_mfc_l,
319 &s5p_device_mfc_r, 319 &s5p_device_mfc_r,
320#ifdef CONFIG_DRM_EXYNOS
321 &exynos_device_drm,
322#endif
323 &samsung_device_keypad, 320 &samsung_device_keypad,
324}; 321};
325 322
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index ee4fb1a9cb72..4f0ac5397ba3 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -300,9 +300,6 @@ static struct platform_device *smdkv310_devices[] __initdata = {
300 &s5p_device_fimc_md, 300 &s5p_device_fimc_md,
301 &s5p_device_g2d, 301 &s5p_device_g2d,
302 &s5p_device_jpeg, 302 &s5p_device_jpeg,
303#ifdef CONFIG_DRM_EXYNOS
304 &exynos_device_drm,
305#endif
306 &exynos4_device_ac97, 303 &exynos4_device_ac97,
307 &exynos4_device_i2s0, 304 &exynos4_device_i2s0,
308 &exynos4_device_ohci, 305 &exynos4_device_ohci,
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index ebc9dd339a38..cfdf876a8626 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -1081,9 +1081,6 @@ static struct platform_device *universal_devices[] __initdata = {
1081 &s5p_device_onenand, 1081 &s5p_device_onenand,
1082 &s5p_device_fimd0, 1082 &s5p_device_fimd0,
1083 &s5p_device_jpeg, 1083 &s5p_device_jpeg,
1084#ifdef CONFIG_DRM_EXYNOS
1085 &exynos_device_drm,
1086#endif
1087 &s3c_device_usb_hsotg, 1084 &s3c_device_usb_hsotg,
1088 &s5p_device_mfc, 1085 &s5p_device_mfc,
1089 &s5p_device_mfc_l, 1086 &s5p_device_mfc_l,
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index c0bc83a7663e..9f1351de52f7 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -19,6 +19,8 @@
19#include <linux/pm_domain.h> 19#include <linux/pm_domain.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/of_address.h> 21#include <linux/of_address.h>
22#include <linux/of_platform.h>
23#include <linux/sched.h>
22 24
23#include <mach/regs-pmu.h> 25#include <mach/regs-pmu.h>
24#include <plat/devs.h> 26#include <plat/devs.h>
@@ -83,12 +85,88 @@ static struct exynos_pm_domain PD = { \
83} 85}
84 86
85#ifdef CONFIG_OF 87#ifdef CONFIG_OF
88static void exynos_add_device_to_domain(struct exynos_pm_domain *pd,
89 struct device *dev)
90{
91 int ret;
92
93 dev_dbg(dev, "adding to power domain %s\n", pd->pd.name);
94
95 while (1) {
96 ret = pm_genpd_add_device(&pd->pd, dev);
97 if (ret != -EAGAIN)
98 break;
99 cond_resched();
100 }
101
102 pm_genpd_dev_need_restore(dev, true);
103}
104
105static void exynos_remove_device_from_domain(struct device *dev)
106{
107 struct generic_pm_domain *genpd = dev_to_genpd(dev);
108 int ret;
109
110 dev_dbg(dev, "removing from power domain %s\n", genpd->name);
111
112 while (1) {
113 ret = pm_genpd_remove_device(genpd, dev);
114 if (ret != -EAGAIN)
115 break;
116 cond_resched();
117 }
118}
119
120static void exynos_read_domain_from_dt(struct device *dev)
121{
122 struct platform_device *pd_pdev;
123 struct exynos_pm_domain *pd;
124 struct device_node *node;
125
126 node = of_parse_phandle(dev->of_node, "samsung,power-domain", 0);
127 if (!node)
128 return;
129 pd_pdev = of_find_device_by_node(node);
130 if (!pd_pdev)
131 return;
132 pd = platform_get_drvdata(pd_pdev);
133 exynos_add_device_to_domain(pd, dev);
134}
135
136static int exynos_pm_notifier_call(struct notifier_block *nb,
137 unsigned long event, void *data)
138{
139 struct device *dev = data;
140
141 switch (event) {
142 case BUS_NOTIFY_BIND_DRIVER:
143 if (dev->of_node)
144 exynos_read_domain_from_dt(dev);
145
146 break;
147
148 case BUS_NOTIFY_UNBOUND_DRIVER:
149 exynos_remove_device_from_domain(dev);
150
151 break;
152 }
153 return NOTIFY_DONE;
154}
155
156static struct notifier_block platform_nb = {
157 .notifier_call = exynos_pm_notifier_call,
158};
159
86static __init int exynos_pm_dt_parse_domains(void) 160static __init int exynos_pm_dt_parse_domains(void)
87{ 161{
162 struct platform_device *pdev;
88 struct device_node *np; 163 struct device_node *np;
89 164
90 for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { 165 for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
91 struct exynos_pm_domain *pd; 166 struct exynos_pm_domain *pd;
167 int on;
168
169 pdev = of_find_device_by_node(np);
92 170
93 pd = kzalloc(sizeof(*pd), GFP_KERNEL); 171 pd = kzalloc(sizeof(*pd), GFP_KERNEL);
94 if (!pd) { 172 if (!pd) {
@@ -97,15 +175,22 @@ static __init int exynos_pm_dt_parse_domains(void)
97 return -ENOMEM; 175 return -ENOMEM;
98 } 176 }
99 177
100 if (of_get_property(np, "samsung,exynos4210-pd-off", NULL)) 178 pd->pd.name = kstrdup(np->name, GFP_KERNEL);
101 pd->is_off = true; 179 pd->name = pd->pd.name;
102 pd->name = np->name;
103 pd->base = of_iomap(np, 0); 180 pd->base = of_iomap(np, 0);
104 pd->pd.power_off = exynos_pd_power_off; 181 pd->pd.power_off = exynos_pd_power_off;
105 pd->pd.power_on = exynos_pd_power_on; 182 pd->pd.power_on = exynos_pd_power_on;
106 pd->pd.of_node = np; 183 pd->pd.of_node = np;
107 pm_genpd_init(&pd->pd, NULL, false); 184
185 platform_set_drvdata(pdev, pd);
186
187 on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
188
189 pm_genpd_init(&pd->pd, NULL, !on);
108 } 190 }
191
192 bus_register_notifier(&platform_bus_type, &platform_nb);
193
109 return 0; 194 return 0;
110} 195}
111#else 196#else
diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/mach-imx/3ds_debugboard.c
index 5c10ad05df74..134377352966 100644
--- a/arch/arm/plat-mxc/3ds_debugboard.c
+++ b/arch/arm/mach-imx/3ds_debugboard.c
@@ -21,7 +21,7 @@
21#include <linux/regulator/machine.h> 21#include <linux/regulator/machine.h>
22#include <linux/regulator/fixed.h> 22#include <linux/regulator/fixed.h>
23 23
24#include <mach/hardware.h> 24#include "hardware.h"
25 25
26/* LAN9217 ethernet base address */ 26/* LAN9217 ethernet base address */
27#define LAN9217_BASE_ADDR(n) (n + 0x0) 27#define LAN9217_BASE_ADDR(n) (n + 0x0)
diff --git a/arch/arm/plat-mxc/include/mach/3ds_debugboard.h b/arch/arm/mach-imx/3ds_debugboard.h
index 9fd6cb3f8fad..9fd6cb3f8fad 100644
--- a/arch/arm/plat-mxc/include/mach/3ds_debugboard.h
+++ b/arch/arm/mach-imx/3ds_debugboard.h
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 8d276584650e..b09924112f99 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,3 +1,70 @@
1config ARCH_MXC
2 bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
3 select ARCH_REQUIRE_GPIOLIB
4 select ARM_PATCH_PHYS_VIRT
5 select AUTO_ZRELADDR if !ZBOOT_ROM
6 select CLKDEV_LOOKUP
7 select CLKSRC_MMIO
8 select GENERIC_CLOCKEVENTS
9 select GENERIC_IRQ_CHIP
10 select MULTI_IRQ_HANDLER
11 select SPARSE_IRQ
12 select USE_OF
13 help
14 Support for Freescale MXC/iMX-based family of processors
15
16menu "Freescale i.MX support"
17 depends on ARCH_MXC
18
19config MXC_IRQ_PRIOR
20 bool "Use IRQ priority"
21 help
22 Select this if you want to use prioritized IRQ handling.
23 This feature prevents higher priority ISR to be interrupted
24 by lower priority IRQ even IRQF_DISABLED flag is not set.
25 This may be useful in embedded applications, where are strong
26 requirements for timing.
27 Say N here, unless you have a specialized requirement.
28
29config MXC_TZIC
30 bool
31
32config MXC_AVIC
33 bool
34
35config MXC_DEBUG_BOARD
36 bool "Enable MXC debug board(for 3-stack)"
37 help
38 The debug board is an integral part of the MXC 3-stack(PDK)
39 platforms, it can be attached or removed from the peripheral
40 board. On debug board, several debug devices(ethernet, UART,
41 buttons, LEDs and JTAG) are implemented. Between the MCU and
42 these devices, a CPLD is added as a bridge which performs
43 data/address de-multiplexing and decode, signal level shift,
44 interrupt control and various board functions.
45
46config HAVE_EPIT
47 bool
48
49config MXC_USE_EPIT
50 bool "Use EPIT instead of GPT"
51 depends on HAVE_EPIT
52 help
53 Use EPIT as the system timer on systems that have it. Normally you
54 don't have a reason to do so as the EPIT has the same features and
55 uses the same clocks as the GPT. Anyway, on some systems the GPT
56 may be in use for other purposes.
57
58config MXC_ULPI
59 bool
60
61config ARCH_HAS_RNGA
62 bool
63
64config IRAM_ALLOC
65 bool
66 select GENERIC_ALLOCATOR
67
1config HAVE_IMX_GPC 68config HAVE_IMX_GPC
2 bool 69 bool
3 70
@@ -5,6 +72,12 @@ config HAVE_IMX_MMDC
5 bool 72 bool
6 73
7config HAVE_IMX_SRC 74config HAVE_IMX_SRC
75 def_bool y if SMP
76
77config IMX_HAVE_IOMUX_V1
78 bool
79
80config ARCH_MXC_IOMUX_V3
8 bool 81 bool
9 82
10config ARCH_MX1 83config ARCH_MX1
@@ -104,7 +177,7 @@ config SOC_IMX51
104 select PINCTRL_IMX51 177 select PINCTRL_IMX51
105 select SOC_IMX5 178 select SOC_IMX5
106 179
107if ARCH_IMX_V4_V5 180if ARCH_MULTI_V4T
108 181
109comment "MX1 platforms:" 182comment "MX1 platforms:"
110config MACH_MXLADS 183config MACH_MXLADS
@@ -133,6 +206,10 @@ config MACH_APF9328
133 help 206 help
134 Say Yes here if you are using the Armadeus APF9328 development board 207 Say Yes here if you are using the Armadeus APF9328 development board
135 208
209endif
210
211if ARCH_MULTI_V5
212
136comment "MX21 platforms:" 213comment "MX21 platforms:"
137 214
138config MACH_MX21ADS 215config MACH_MX21ADS
@@ -195,6 +272,13 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD
195 272
196endchoice 273endchoice
197 274
275config MACH_IMX25_DT
276 bool "Support i.MX25 platforms from device tree"
277 select SOC_IMX25
278 help
279 Include support for Freescale i.MX25 based platforms
280 using the device tree for discovery
281
198comment "MX27 platforms:" 282comment "MX27 platforms:"
199 283
200config MACH_MX27ADS 284config MACH_MX27ADS
@@ -384,7 +468,7 @@ config MACH_IMX27_DT
384 468
385endif 469endif
386 470
387if ARCH_IMX_V6_V7 471if ARCH_MULTI_V6
388 472
389comment "MX31 platforms:" 473comment "MX31 platforms:"
390 474
@@ -649,6 +733,10 @@ config MACH_VPR200
649 Include support for VPR200 platform. This includes specific 733 Include support for VPR200 platform. This includes specific
650 configurations for the board and its peripherals. 734 configurations for the board and its peripherals.
651 735
736endif
737
738if ARCH_MULTI_V7
739
652comment "i.MX5 platforms:" 740comment "i.MX5 platforms:"
653 741
654config MACH_MX50_RDP 742config MACH_MX50_RDP
@@ -748,7 +836,14 @@ config SOC_IMX53
748 836
749config SOC_IMX6Q 837config SOC_IMX6Q
750 bool "i.MX6 Quad support" 838 bool "i.MX6 Quad support"
839 select ARCH_HAS_CPUFREQ
840 select ARCH_HAS_OPP
751 select ARM_CPU_SUSPEND if PM 841 select ARM_CPU_SUSPEND if PM
842 select ARM_ERRATA_743622
843 select ARM_ERRATA_751472
844 select ARM_ERRATA_754322
845 select ARM_ERRATA_764369 if SMP
846 select ARM_ERRATA_775420
752 select ARM_GIC 847 select ARM_GIC
753 select COMMON_CLK 848 select COMMON_CLK
754 select CPU_V7 849 select CPU_V7
@@ -756,13 +851,20 @@ config SOC_IMX6Q
756 select HAVE_CAN_FLEXCAN if CAN 851 select HAVE_CAN_FLEXCAN if CAN
757 select HAVE_IMX_GPC 852 select HAVE_IMX_GPC
758 select HAVE_IMX_MMDC 853 select HAVE_IMX_MMDC
759 select HAVE_IMX_SRC
760 select HAVE_SMP 854 select HAVE_SMP
761 select MFD_SYSCON 855 select MFD_SYSCON
762 select PINCTRL 856 select PINCTRL
763 select PINCTRL_IMX6Q 857 select PINCTRL_IMX6Q
858 select PL310_ERRATA_588369 if CACHE_PL310
859 select PL310_ERRATA_727915 if CACHE_PL310
860 select PL310_ERRATA_769419 if CACHE_PL310
861 select PM_OPP if PM
764 862
765 help 863 help
766 This enables support for Freescale i.MX6 Quad processor. 864 This enables support for Freescale i.MX6 Quad processor.
767 865
768endif 866endif
867
868source "arch/arm/mach-imx/devices/Kconfig"
869
870endmenu
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 895754aeb4f3..0634b3152c24 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -1,3 +1,5 @@
1obj-y := time.o cpu.o system.o irq-common.o
2
1obj-$(CONFIG_SOC_IMX1) += clk-imx1.o mm-imx1.o 3obj-$(CONFIG_SOC_IMX1) += clk-imx1.o mm-imx1.o
2obj-$(CONFIG_SOC_IMX21) += clk-imx21.o mm-imx21.o 4obj-$(CONFIG_SOC_IMX21) += clk-imx21.o mm-imx21.o
3 5
@@ -15,6 +17,24 @@ obj-$(CONFIG_SOC_IMX5) += cpu-imx5.o mm-imx5.o clk-imx51-imx53.o ehci-imx5.o $(i
15obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \ 17obj-$(CONFIG_COMMON_CLK) += clk-pllv1.o clk-pllv2.o clk-pllv3.o clk-gate2.o \
16 clk-pfd.o clk-busy.o clk.o 18 clk-pfd.o clk-busy.o clk.o
17 19
20obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
21obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
22
23obj-$(CONFIG_MXC_TZIC) += tzic.o
24obj-$(CONFIG_MXC_AVIC) += avic.o
25
26obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o
27obj-$(CONFIG_MXC_ULPI) += ulpi.o
28obj-$(CONFIG_MXC_USE_EPIT) += epit.o
29obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
30obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
31obj-$(CONFIG_CPU_IDLE) += cpuidle.o
32
33ifdef CONFIG_SND_IMX_SOC
34obj-y += ssi-fiq.o
35obj-y += ssi-fiq-ksym.o
36endif
37
18# Support for CMOS sensor interface 38# Support for CMOS sensor interface
19obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o 39obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
20 40
@@ -30,6 +50,7 @@ obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o
30obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o 50obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o
31obj-$(CONFIG_MACH_EUKREA_CPUIMX25SD) += mach-eukrea_cpuimx25.o 51obj-$(CONFIG_MACH_EUKREA_CPUIMX25SD) += mach-eukrea_cpuimx25.o
32obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o 52obj-$(CONFIG_MACH_EUKREA_MBIMXSD25_BASEBOARD) += eukrea_mbimxsd25-baseboard.o
53obj-$(CONFIG_MACH_IMX25_DT) += imx25-dt.o
33 54
34# i.MX27 based machines 55# i.MX27 based machines
35obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o 56obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o
@@ -89,3 +110,5 @@ obj-$(CONFIG_MACH_MX50_RDP) += mach-mx50_rdp.o
89 110
90obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o 111obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
91obj-$(CONFIG_SOC_IMX53) += mach-imx53.o 112obj-$(CONFIG_SOC_IMX53) += mach-imx53.o
113
114obj-y += devices/
diff --git a/arch/arm/plat-mxc/avic.c b/arch/arm/mach-imx/avic.c
index cbd55c36def3..0eff23ed92b9 100644
--- a/arch/arm/plat-mxc/avic.c
+++ b/arch/arm/mach-imx/avic.c
@@ -22,12 +22,11 @@
22#include <linux/irqdomain.h> 22#include <linux/irqdomain.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/of.h> 24#include <linux/of.h>
25#include <mach/common.h>
26#include <asm/mach/irq.h> 25#include <asm/mach/irq.h>
27#include <asm/exception.h> 26#include <asm/exception.h>
28#include <mach/hardware.h>
29#include <mach/irqs.h>
30 27
28#include "common.h"
29#include "hardware.h"
31#include "irq-common.h" 30#include "irq-common.h"
32 31
33#define AVIC_INTCNTL 0x00 /* int control reg */ 32#define AVIC_INTCNTL 0x00 /* int control reg */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lilly.h b/arch/arm/mach-imx/board-mx31lilly.h
index 0df71bfefbb1..0df71bfefbb1 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31lilly.h
+++ b/arch/arm/mach-imx/board-mx31lilly.h
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lite.h b/arch/arm/mach-imx/board-mx31lite.h
index c1ad0ae807cc..c1ad0ae807cc 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31lite.h
+++ b/arch/arm/mach-imx/board-mx31lite.h
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h b/arch/arm/mach-imx/board-mx31moboard.h
index de14543891cf..de14543891cf 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
+++ b/arch/arm/mach-imx/board-mx31moboard.h
diff --git a/arch/arm/plat-mxc/include/mach/board-pcm038.h b/arch/arm/mach-imx/board-pcm038.h
index 6f371e35753d..6f371e35753d 100644
--- a/arch/arm/plat-mxc/include/mach/board-pcm038.h
+++ b/arch/arm/mach-imx/board-pcm038.h
diff --git a/arch/arm/mach-imx/clk-imx1.c b/arch/arm/mach-imx/clk-imx1.c
index 516ddee1948e..15f9d223cf0b 100644
--- a/arch/arm/mach-imx/clk-imx1.c
+++ b/arch/arm/mach-imx/clk-imx1.c
@@ -22,9 +22,9 @@
22#include <linux/clkdev.h> 22#include <linux/clkdev.h>
23#include <linux/err.h> 23#include <linux/err.h>
24 24
25#include <mach/hardware.h>
26#include <mach/common.h>
27#include "clk.h" 25#include "clk.h"
26#include "common.h"
27#include "hardware.h"
28 28
29/* CCM register addresses */ 29/* CCM register addresses */
30#define IO_ADDR_CCM(off) (MX1_IO_ADDRESS(MX1_CCM_BASE_ADDR + (off))) 30#define IO_ADDR_CCM(off) (MX1_IO_ADDRESS(MX1_CCM_BASE_ADDR + (off)))
@@ -82,7 +82,8 @@ int __init mx1_clocks_init(unsigned long fref)
82 pr_err("imx1 clk %d: register failed with %ld\n", 82 pr_err("imx1 clk %d: register failed with %ld\n",
83 i, PTR_ERR(clk[i])); 83 i, PTR_ERR(clk[i]));
84 84
85 clk_register_clkdev(clk[dma_gate], "ahb", "imx-dma"); 85 clk_register_clkdev(clk[dma_gate], "ahb", "imx1-dma");
86 clk_register_clkdev(clk[hclk], "ipg", "imx1-dma");
86 clk_register_clkdev(clk[csi_gate], NULL, "mx1-camera.0"); 87 clk_register_clkdev(clk[csi_gate], NULL, "mx1-camera.0");
87 clk_register_clkdev(clk[mma_gate], "mma", NULL); 88 clk_register_clkdev(clk[mma_gate], "mma", NULL);
88 clk_register_clkdev(clk[usbd_gate], NULL, "imx_udc.0"); 89 clk_register_clkdev(clk[usbd_gate], NULL, "imx_udc.0");
@@ -94,18 +95,18 @@ int __init mx1_clocks_init(unsigned long fref)
94 clk_register_clkdev(clk[hclk], "ipg", "imx1-uart.1"); 95 clk_register_clkdev(clk[hclk], "ipg", "imx1-uart.1");
95 clk_register_clkdev(clk[per1], "per", "imx1-uart.2"); 96 clk_register_clkdev(clk[per1], "per", "imx1-uart.2");
96 clk_register_clkdev(clk[hclk], "ipg", "imx1-uart.2"); 97 clk_register_clkdev(clk[hclk], "ipg", "imx1-uart.2");
97 clk_register_clkdev(clk[hclk], NULL, "imx-i2c.0"); 98 clk_register_clkdev(clk[hclk], NULL, "imx1-i2c.0");
98 clk_register_clkdev(clk[per2], "per", "imx1-cspi.0"); 99 clk_register_clkdev(clk[per2], "per", "imx1-cspi.0");
99 clk_register_clkdev(clk[dummy], "ipg", "imx1-cspi.0"); 100 clk_register_clkdev(clk[dummy], "ipg", "imx1-cspi.0");
100 clk_register_clkdev(clk[per2], "per", "imx1-cspi.1"); 101 clk_register_clkdev(clk[per2], "per", "imx1-cspi.1");
101 clk_register_clkdev(clk[dummy], "ipg", "imx1-cspi.1"); 102 clk_register_clkdev(clk[dummy], "ipg", "imx1-cspi.1");
102 clk_register_clkdev(clk[per2], NULL, "imx-mmc.0"); 103 clk_register_clkdev(clk[per2], NULL, "imx-mmc.0");
103 clk_register_clkdev(clk[per2], "per", "imx-fb.0"); 104 clk_register_clkdev(clk[per2], "per", "imx1-fb.0");
104 clk_register_clkdev(clk[dummy], "ipg", "imx-fb.0"); 105 clk_register_clkdev(clk[dummy], "ipg", "imx1-fb.0");
105 clk_register_clkdev(clk[dummy], "ahb", "imx-fb.0"); 106 clk_register_clkdev(clk[dummy], "ahb", "imx1-fb.0");
106 clk_register_clkdev(clk[hclk], "mshc", NULL); 107 clk_register_clkdev(clk[hclk], "mshc", NULL);
107 clk_register_clkdev(clk[per3], "ssi", NULL); 108 clk_register_clkdev(clk[per3], "ssi", NULL);
108 clk_register_clkdev(clk[clk32], NULL, "mxc_rtc.0"); 109 clk_register_clkdev(clk[clk32], NULL, "imx1-rtc.0");
109 clk_register_clkdev(clk[clko], "clko", NULL); 110 clk_register_clkdev(clk[clko], "clko", NULL);
110 111
111 mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT); 112 mxc_timer_init(MX1_IO_ADDRESS(MX1_TIM1_BASE_ADDR), MX1_TIM1_INT);
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index cf65148bc519..d7ed66091a2a 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -25,9 +25,9 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/err.h> 26#include <linux/err.h>
27 27
28#include <mach/hardware.h>
29#include <mach/common.h>
30#include "clk.h" 28#include "clk.h"
29#include "common.h"
30#include "hardware.h"
31 31
32#define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off))) 32#define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off)))
33 33
@@ -156,16 +156,16 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
156 clk_register_clkdev(clk[cspi2_ipg_gate], "ipg", "imx21-cspi.1"); 156 clk_register_clkdev(clk[cspi2_ipg_gate], "ipg", "imx21-cspi.1");
157 clk_register_clkdev(clk[per2], "per", "imx21-cspi.2"); 157 clk_register_clkdev(clk[per2], "per", "imx21-cspi.2");
158 clk_register_clkdev(clk[cspi3_ipg_gate], "ipg", "imx21-cspi.2"); 158 clk_register_clkdev(clk[cspi3_ipg_gate], "ipg", "imx21-cspi.2");
159 clk_register_clkdev(clk[per3], "per", "imx-fb.0"); 159 clk_register_clkdev(clk[per3], "per", "imx21-fb.0");
160 clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0"); 160 clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx21-fb.0");
161 clk_register_clkdev(clk[lcdc_hclk_gate], "ahb", "imx-fb.0"); 161 clk_register_clkdev(clk[lcdc_hclk_gate], "ahb", "imx21-fb.0");
162 clk_register_clkdev(clk[usb_gate], "per", "imx21-hcd.0"); 162 clk_register_clkdev(clk[usb_gate], "per", "imx21-hcd.0");
163 clk_register_clkdev(clk[usb_hclk_gate], "ahb", "imx21-hcd.0"); 163 clk_register_clkdev(clk[usb_hclk_gate], "ahb", "imx21-hcd.0");
164 clk_register_clkdev(clk[nfc_gate], NULL, "mxc_nand.0"); 164 clk_register_clkdev(clk[nfc_gate], NULL, "imx21-nand.0");
165 clk_register_clkdev(clk[dma_hclk_gate], "ahb", "imx-dma"); 165 clk_register_clkdev(clk[dma_hclk_gate], "ahb", "imx21-dma");
166 clk_register_clkdev(clk[dma_gate], "ipg", "imx-dma"); 166 clk_register_clkdev(clk[dma_gate], "ipg", "imx21-dma");
167 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); 167 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
168 clk_register_clkdev(clk[i2c_gate], NULL, "imx-i2c.0"); 168 clk_register_clkdev(clk[i2c_gate], NULL, "imx21-i2c.0");
169 clk_register_clkdev(clk[kpp_gate], NULL, "mxc-keypad"); 169 clk_register_clkdev(clk[kpp_gate], NULL, "mxc-keypad");
170 clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0"); 170 clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
171 clk_register_clkdev(clk[brom_gate], "brom", NULL); 171 clk_register_clkdev(clk[brom_gate], "brom", NULL);
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 01e2f843bf2e..b197aa73dc4b 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -23,11 +23,14 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/clkdev.h> 24#include <linux/clkdev.h>
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/of.h>
27#include <linux/of_address.h>
28#include <linux/of_irq.h>
26 29
27#include <mach/hardware.h>
28#include <mach/common.h>
29#include <mach/mx25.h>
30#include "clk.h" 30#include "clk.h"
31#include "common.h"
32#include "hardware.h"
33#include "mx25.h"
31 34
32#define CRM_BASE MX25_IO_ADDRESS(MX25_CRM_BASE_ADDR) 35#define CRM_BASE MX25_IO_ADDRESS(MX25_CRM_BASE_ADDR)
33 36
@@ -55,6 +58,8 @@
55 58
56#define ccm(x) (CRM_BASE + (x)) 59#define ccm(x) (CRM_BASE + (x))
57 60
61static struct clk_onecell_data clk_data;
62
58static const char *cpu_sel_clks[] = { "mpll", "mpll_cpu_3_4", }; 63static const char *cpu_sel_clks[] = { "mpll", "mpll_cpu_3_4", };
59static const char *per_sel_clks[] = { "ahb", "upll", }; 64static const char *per_sel_clks[] = { "ahb", "upll", };
60 65
@@ -64,24 +69,30 @@ enum mx25_clks {
64 per7_sel, per8_sel, per9_sel, per10_sel, per11_sel, per12_sel, 69 per7_sel, per8_sel, per9_sel, per10_sel, per11_sel, per12_sel,
65 per13_sel, per14_sel, per15_sel, per0, per1, per2, per3, per4, per5, 70 per13_sel, per14_sel, per15_sel, per0, per1, per2, per3, per4, per5,
66 per6, per7, per8, per9, per10, per11, per12, per13, per14, per15, 71 per6, per7, per8, per9, per10, per11, per12, per13, per14, per15,
67 csi_ipg_per, esdhc1_ipg_per, esdhc2_ipg_per, gpt_ipg_per, i2c_ipg_per, 72 csi_ipg_per, epit_ipg_per, esai_ipg_per, esdhc1_ipg_per, esdhc2_ipg_per,
68 lcdc_ipg_per, nfc_ipg_per, ssi1_ipg_per, ssi2_ipg_per, uart_ipg_per, 73 gpt_ipg_per, i2c_ipg_per, lcdc_ipg_per, nfc_ipg_per, owire_ipg_per,
69 csi_ahb, esdhc1_ahb, esdhc2_ahb, fec_ahb, lcdc_ahb, sdma_ahb, 74 pwm_ipg_per, sim1_ipg_per, sim2_ipg_per, ssi1_ipg_per, ssi2_ipg_per,
70 usbotg_ahb, can1_ipg, can2_ipg, csi_ipg, cspi1_ipg, cspi2_ipg, 75 uart_ipg_per, ata_ahb, reserved1, csi_ahb, emi_ahb, esai_ahb, esdhc1_ahb,
71 cspi3_ipg, dryice_ipg, esdhc1_ipg, esdhc2_ipg, fec_ipg, iim_ipg, 76 esdhc2_ahb, fec_ahb, lcdc_ahb, rtic_ahb, sdma_ahb, slcdc_ahb, usbotg_ahb,
72 kpp_ipg, lcdc_ipg, pwm1_ipg, pwm2_ipg, pwm3_ipg, pwm4_ipg, sdma_ipg, 77 reserved2, reserved3, reserved4, reserved5, can1_ipg, can2_ipg, csi_ipg,
73 ssi1_ipg, ssi2_ipg, tsc_ipg, uart1_ipg, uart2_ipg, uart3_ipg, 78 cspi1_ipg, cspi2_ipg, cspi3_ipg, dryice_ipg, ect_ipg, epit1_ipg, epit2_ipg,
74 uart4_ipg, uart5_ipg, wdt_ipg, clk_max 79 reserved6, esdhc1_ipg, esdhc2_ipg, fec_ipg, reserved7, reserved8, reserved9,
80 gpt1_ipg, gpt2_ipg, gpt3_ipg, gpt4_ipg, reserved10, reserved11, reserved12,
81 iim_ipg, reserved13, reserved14, kpp_ipg, lcdc_ipg, reserved15, pwm1_ipg,
82 pwm2_ipg, pwm3_ipg, pwm4_ipg, rngb_ipg, reserved16, scc_ipg, sdma_ipg,
83 sim1_ipg, sim2_ipg, slcdc_ipg, spba_ipg, ssi1_ipg, ssi2_ipg, tsc_ipg,
84 uart1_ipg, uart2_ipg, uart3_ipg, uart4_ipg, uart5_ipg, reserved17,
85 wdt_ipg, clk_max
75}; 86};
76 87
77static struct clk *clk[clk_max]; 88static struct clk *clk[clk_max];
78 89
79int __init mx25_clocks_init(void) 90static int __init __mx25_clocks_init(unsigned long osc_rate)
80{ 91{
81 int i; 92 int i;
82 93
83 clk[dummy] = imx_clk_fixed("dummy", 0); 94 clk[dummy] = imx_clk_fixed("dummy", 0);
84 clk[osc] = imx_clk_fixed("osc", 24000000); 95 clk[osc] = imx_clk_fixed("osc", osc_rate);
85 clk[mpll] = imx_clk_pllv1("mpll", "osc", ccm(CCM_MPCTL)); 96 clk[mpll] = imx_clk_pllv1("mpll", "osc", ccm(CCM_MPCTL));
86 clk[upll] = imx_clk_pllv1("upll", "osc", ccm(CCM_UPCTL)); 97 clk[upll] = imx_clk_pllv1("upll", "osc", ccm(CCM_UPCTL));
87 clk[mpll_cpu_3_4] = imx_clk_fixed_factor("mpll_cpu_3_4", "mpll", 3, 4); 98 clk[mpll_cpu_3_4] = imx_clk_fixed_factor("mpll_cpu_3_4", "mpll", 3, 4);
@@ -123,22 +134,36 @@ int __init mx25_clocks_init(void)
123 clk[per14] = imx_clk_divider("per14", "per14_sel", ccm(CCM_PCDR3), 16, 6); 134 clk[per14] = imx_clk_divider("per14", "per14_sel", ccm(CCM_PCDR3), 16, 6);
124 clk[per15] = imx_clk_divider("per15", "per15_sel", ccm(CCM_PCDR3), 24, 6); 135 clk[per15] = imx_clk_divider("per15", "per15_sel", ccm(CCM_PCDR3), 24, 6);
125 clk[csi_ipg_per] = imx_clk_gate("csi_ipg_per", "per0", ccm(CCM_CGCR0), 0); 136 clk[csi_ipg_per] = imx_clk_gate("csi_ipg_per", "per0", ccm(CCM_CGCR0), 0);
137 clk[epit_ipg_per] = imx_clk_gate("epit_ipg_per", "per1", ccm(CCM_CGCR0), 1);
138 clk[esai_ipg_per] = imx_clk_gate("esai_ipg_per", "per2", ccm(CCM_CGCR0), 2);
126 clk[esdhc1_ipg_per] = imx_clk_gate("esdhc1_ipg_per", "per3", ccm(CCM_CGCR0), 3); 139 clk[esdhc1_ipg_per] = imx_clk_gate("esdhc1_ipg_per", "per3", ccm(CCM_CGCR0), 3);
127 clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0), 4); 140 clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0), 4);
128 clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0), 5); 141 clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0), 5);
129 clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0), 6); 142 clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0), 6);
130 clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per7", ccm(CCM_CGCR0), 7); 143 clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per7", ccm(CCM_CGCR0), 7);
131 clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "per8", ccm(CCM_CGCR0), 8); 144 clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "per8", ccm(CCM_CGCR0), 8);
145 clk[owire_ipg_per] = imx_clk_gate("owire_ipg_per", "per9", ccm(CCM_CGCR0), 9);
146 clk[pwm_ipg_per] = imx_clk_gate("pwm_ipg_per", "per10", ccm(CCM_CGCR0), 10);
147 clk[sim1_ipg_per] = imx_clk_gate("sim1_ipg_per", "per11", ccm(CCM_CGCR0), 11);
148 clk[sim2_ipg_per] = imx_clk_gate("sim2_ipg_per", "per12", ccm(CCM_CGCR0), 12);
132 clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13); 149 clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13);
133 clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14); 150 clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14);
134 clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15); 151 clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15);
152 clk[ata_ahb] = imx_clk_gate("ata_ahb", "ahb", ccm(CCM_CGCR0), 16);
153 /* CCM_CGCR0(17): reserved */
135 clk[csi_ahb] = imx_clk_gate("csi_ahb", "ahb", ccm(CCM_CGCR0), 18); 154 clk[csi_ahb] = imx_clk_gate("csi_ahb", "ahb", ccm(CCM_CGCR0), 18);
155 clk[emi_ahb] = imx_clk_gate("emi_ahb", "ahb", ccm(CCM_CGCR0), 19);
156 clk[esai_ahb] = imx_clk_gate("esai_ahb", "ahb", ccm(CCM_CGCR0), 20);
136 clk[esdhc1_ahb] = imx_clk_gate("esdhc1_ahb", "ahb", ccm(CCM_CGCR0), 21); 157 clk[esdhc1_ahb] = imx_clk_gate("esdhc1_ahb", "ahb", ccm(CCM_CGCR0), 21);
137 clk[esdhc2_ahb] = imx_clk_gate("esdhc2_ahb", "ahb", ccm(CCM_CGCR0), 22); 158 clk[esdhc2_ahb] = imx_clk_gate("esdhc2_ahb", "ahb", ccm(CCM_CGCR0), 22);
138 clk[fec_ahb] = imx_clk_gate("fec_ahb", "ahb", ccm(CCM_CGCR0), 23); 159 clk[fec_ahb] = imx_clk_gate("fec_ahb", "ahb", ccm(CCM_CGCR0), 23);
139 clk[lcdc_ahb] = imx_clk_gate("lcdc_ahb", "ahb", ccm(CCM_CGCR0), 24); 160 clk[lcdc_ahb] = imx_clk_gate("lcdc_ahb", "ahb", ccm(CCM_CGCR0), 24);
161 clk[rtic_ahb] = imx_clk_gate("rtic_ahb", "ahb", ccm(CCM_CGCR0), 25);
140 clk[sdma_ahb] = imx_clk_gate("sdma_ahb", "ahb", ccm(CCM_CGCR0), 26); 162 clk[sdma_ahb] = imx_clk_gate("sdma_ahb", "ahb", ccm(CCM_CGCR0), 26);
163 clk[slcdc_ahb] = imx_clk_gate("slcdc_ahb", "ahb", ccm(CCM_CGCR0), 27);
141 clk[usbotg_ahb] = imx_clk_gate("usbotg_ahb", "ahb", ccm(CCM_CGCR0), 28); 164 clk[usbotg_ahb] = imx_clk_gate("usbotg_ahb", "ahb", ccm(CCM_CGCR0), 28);
165 /* CCM_CGCR0(29-31): reserved */
166 /* CCM_CGCR1(0): reserved in datasheet, used as audmux in FSL kernel */
142 clk[can1_ipg] = imx_clk_gate("can1_ipg", "ipg", ccm(CCM_CGCR1), 2); 167 clk[can1_ipg] = imx_clk_gate("can1_ipg", "ipg", ccm(CCM_CGCR1), 2);
143 clk[can2_ipg] = imx_clk_gate("can2_ipg", "ipg", ccm(CCM_CGCR1), 3); 168 clk[can2_ipg] = imx_clk_gate("can2_ipg", "ipg", ccm(CCM_CGCR1), 3);
144 clk[csi_ipg] = imx_clk_gate("csi_ipg", "ipg", ccm(CCM_CGCR1), 4); 169 clk[csi_ipg] = imx_clk_gate("csi_ipg", "ipg", ccm(CCM_CGCR1), 4);
@@ -146,17 +171,41 @@ int __init mx25_clocks_init(void)
146 clk[cspi2_ipg] = imx_clk_gate("cspi2_ipg", "ipg", ccm(CCM_CGCR1), 6); 171 clk[cspi2_ipg] = imx_clk_gate("cspi2_ipg", "ipg", ccm(CCM_CGCR1), 6);
147 clk[cspi3_ipg] = imx_clk_gate("cspi3_ipg", "ipg", ccm(CCM_CGCR1), 7); 172 clk[cspi3_ipg] = imx_clk_gate("cspi3_ipg", "ipg", ccm(CCM_CGCR1), 7);
148 clk[dryice_ipg] = imx_clk_gate("dryice_ipg", "ipg", ccm(CCM_CGCR1), 8); 173 clk[dryice_ipg] = imx_clk_gate("dryice_ipg", "ipg", ccm(CCM_CGCR1), 8);
174 clk[ect_ipg] = imx_clk_gate("ect_ipg", "ipg", ccm(CCM_CGCR1), 9);
175 clk[epit1_ipg] = imx_clk_gate("epit1_ipg", "ipg", ccm(CCM_CGCR1), 10);
176 clk[epit2_ipg] = imx_clk_gate("epit2_ipg", "ipg", ccm(CCM_CGCR1), 11);
177 /* CCM_CGCR1(12): reserved in datasheet, used as esai in FSL kernel */
149 clk[esdhc1_ipg] = imx_clk_gate("esdhc1_ipg", "ipg", ccm(CCM_CGCR1), 13); 178 clk[esdhc1_ipg] = imx_clk_gate("esdhc1_ipg", "ipg", ccm(CCM_CGCR1), 13);
150 clk[esdhc2_ipg] = imx_clk_gate("esdhc2_ipg", "ipg", ccm(CCM_CGCR1), 14); 179 clk[esdhc2_ipg] = imx_clk_gate("esdhc2_ipg", "ipg", ccm(CCM_CGCR1), 14);
151 clk[fec_ipg] = imx_clk_gate("fec_ipg", "ipg", ccm(CCM_CGCR1), 15); 180 clk[fec_ipg] = imx_clk_gate("fec_ipg", "ipg", ccm(CCM_CGCR1), 15);
181 /* CCM_CGCR1(16): reserved in datasheet, used as gpio1 in FSL kernel */
182 /* CCM_CGCR1(17): reserved in datasheet, used as gpio2 in FSL kernel */
183 /* CCM_CGCR1(18): reserved in datasheet, used as gpio3 in FSL kernel */
184 clk[gpt1_ipg] = imx_clk_gate("gpt1_ipg", "ipg", ccm(CCM_CGCR1), 19);
185 clk[gpt2_ipg] = imx_clk_gate("gpt2_ipg", "ipg", ccm(CCM_CGCR1), 20);
186 clk[gpt3_ipg] = imx_clk_gate("gpt3_ipg", "ipg", ccm(CCM_CGCR1), 21);
187 clk[gpt4_ipg] = imx_clk_gate("gpt4_ipg", "ipg", ccm(CCM_CGCR1), 22);
188 /* CCM_CGCR1(23): reserved in datasheet, used as i2c1 in FSL kernel */
189 /* CCM_CGCR1(24): reserved in datasheet, used as i2c2 in FSL kernel */
190 /* CCM_CGCR1(25): reserved in datasheet, used as i2c3 in FSL kernel */
152 clk[iim_ipg] = imx_clk_gate("iim_ipg", "ipg", ccm(CCM_CGCR1), 26); 191 clk[iim_ipg] = imx_clk_gate("iim_ipg", "ipg", ccm(CCM_CGCR1), 26);
192 /* CCM_CGCR1(27): reserved in datasheet, used as iomuxc in FSL kernel */
193 /* CCM_CGCR1(28): reserved in datasheet, used as kpp in FSL kernel */
153 clk[kpp_ipg] = imx_clk_gate("kpp_ipg", "ipg", ccm(CCM_CGCR1), 28); 194 clk[kpp_ipg] = imx_clk_gate("kpp_ipg", "ipg", ccm(CCM_CGCR1), 28);
154 clk[lcdc_ipg] = imx_clk_gate("lcdc_ipg", "ipg", ccm(CCM_CGCR1), 29); 195 clk[lcdc_ipg] = imx_clk_gate("lcdc_ipg", "ipg", ccm(CCM_CGCR1), 29);
196 /* CCM_CGCR1(30): reserved in datasheet, used as owire in FSL kernel */
155 clk[pwm1_ipg] = imx_clk_gate("pwm1_ipg", "ipg", ccm(CCM_CGCR1), 31); 197 clk[pwm1_ipg] = imx_clk_gate("pwm1_ipg", "ipg", ccm(CCM_CGCR1), 31);
156 clk[pwm2_ipg] = imx_clk_gate("pwm2_ipg", "ipg", ccm(CCM_CGCR2), 0); 198 clk[pwm2_ipg] = imx_clk_gate("pwm2_ipg", "ipg", ccm(CCM_CGCR2), 0);
157 clk[pwm3_ipg] = imx_clk_gate("pwm3_ipg", "ipg", ccm(CCM_CGCR2), 1); 199 clk[pwm3_ipg] = imx_clk_gate("pwm3_ipg", "ipg", ccm(CCM_CGCR2), 1);
158 clk[pwm4_ipg] = imx_clk_gate("pwm4_ipg", "ipg", ccm(CCM_CGCR2), 2); 200 clk[pwm4_ipg] = imx_clk_gate("pwm4_ipg", "ipg", ccm(CCM_CGCR2), 2);
201 clk[rngb_ipg] = imx_clk_gate("rngb_ipg", "ipg", ccm(CCM_CGCR2), 3);
202 /* CCM_CGCR2(4): reserved in datasheet, used as rtic in FSL kernel */
203 clk[scc_ipg] = imx_clk_gate("scc_ipg", "ipg", ccm(CCM_CGCR2), 5);
159 clk[sdma_ipg] = imx_clk_gate("sdma_ipg", "ipg", ccm(CCM_CGCR2), 6); 204 clk[sdma_ipg] = imx_clk_gate("sdma_ipg", "ipg", ccm(CCM_CGCR2), 6);
205 clk[sim1_ipg] = imx_clk_gate("sim1_ipg", "ipg", ccm(CCM_CGCR2), 7);
206 clk[sim2_ipg] = imx_clk_gate("sim2_ipg", "ipg", ccm(CCM_CGCR2), 8);
207 clk[slcdc_ipg] = imx_clk_gate("slcdc_ipg", "ipg", ccm(CCM_CGCR2), 9);
208 clk[spba_ipg] = imx_clk_gate("spba_ipg", "ipg", ccm(CCM_CGCR2), 10);
160 clk[ssi1_ipg] = imx_clk_gate("ssi1_ipg", "ipg", ccm(CCM_CGCR2), 11); 209 clk[ssi1_ipg] = imx_clk_gate("ssi1_ipg", "ipg", ccm(CCM_CGCR2), 11);
161 clk[ssi2_ipg] = imx_clk_gate("ssi2_ipg", "ipg", ccm(CCM_CGCR2), 12); 210 clk[ssi2_ipg] = imx_clk_gate("ssi2_ipg", "ipg", ccm(CCM_CGCR2), 12);
162 clk[tsc_ipg] = imx_clk_gate("tsc_ipg", "ipg", ccm(CCM_CGCR2), 13); 211 clk[tsc_ipg] = imx_clk_gate("tsc_ipg", "ipg", ccm(CCM_CGCR2), 13);
@@ -165,6 +214,7 @@ int __init mx25_clocks_init(void)
165 clk[uart3_ipg] = imx_clk_gate("uart3_ipg", "ipg", ccm(CCM_CGCR2), 16); 214 clk[uart3_ipg] = imx_clk_gate("uart3_ipg", "ipg", ccm(CCM_CGCR2), 16);
166 clk[uart4_ipg] = imx_clk_gate("uart4_ipg", "ipg", ccm(CCM_CGCR2), 17); 215 clk[uart4_ipg] = imx_clk_gate("uart4_ipg", "ipg", ccm(CCM_CGCR2), 17);
167 clk[uart5_ipg] = imx_clk_gate("uart5_ipg", "ipg", ccm(CCM_CGCR2), 18); 216 clk[uart5_ipg] = imx_clk_gate("uart5_ipg", "ipg", ccm(CCM_CGCR2), 18);
217 /* CCM_CGCR2(19): reserved in datasheet, but used as wdt in FSL kernel */
168 clk[wdt_ipg] = imx_clk_gate("wdt_ipg", "ipg", ccm(CCM_CGCR2), 19); 218 clk[wdt_ipg] = imx_clk_gate("wdt_ipg", "ipg", ccm(CCM_CGCR2), 19);
169 219
170 for (i = 0; i < ARRAY_SIZE(clk); i++) 220 for (i = 0; i < ARRAY_SIZE(clk); i++)
@@ -172,6 +222,18 @@ int __init mx25_clocks_init(void)
172 pr_err("i.MX25 clk %d: register failed with %ld\n", 222 pr_err("i.MX25 clk %d: register failed with %ld\n",
173 i, PTR_ERR(clk[i])); 223 i, PTR_ERR(clk[i]));
174 224
225 clk_prepare_enable(clk[emi_ahb]);
226
227 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
228 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
229
230 return 0;
231}
232
233int __init mx25_clocks_init(void)
234{
235 __mx25_clocks_init(24000000);
236
175 /* i.mx25 has the i.mx21 type uart */ 237 /* i.mx25 has the i.mx21 type uart */
176 clk_register_clkdev(clk[uart1_ipg], "ipg", "imx21-uart.0"); 238 clk_register_clkdev(clk[uart1_ipg], "ipg", "imx21-uart.0");
177 clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.0"); 239 clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.0");
@@ -183,8 +245,6 @@ int __init mx25_clocks_init(void)
183 clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.3"); 245 clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.3");
184 clk_register_clkdev(clk[uart5_ipg], "ipg", "imx21-uart.4"); 246 clk_register_clkdev(clk[uart5_ipg], "ipg", "imx21-uart.4");
185 clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.4"); 247 clk_register_clkdev(clk[uart_ipg_per], "per", "imx21-uart.4");
186 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
187 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
188 clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0"); 248 clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
189 clk_register_clkdev(clk[usbotg_ahb], "ahb", "mxc-ehci.0"); 249 clk_register_clkdev(clk[usbotg_ahb], "ahb", "mxc-ehci.0");
190 clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0"); 250 clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0");
@@ -197,7 +257,7 @@ int __init mx25_clocks_init(void)
197 clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc"); 257 clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc");
198 clk_register_clkdev(clk[usbotg_ahb], "ahb", "fsl-usb2-udc"); 258 clk_register_clkdev(clk[usbotg_ahb], "ahb", "fsl-usb2-udc");
199 clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc"); 259 clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
200 clk_register_clkdev(clk[nfc_ipg_per], NULL, "mxc_nand.0"); 260 clk_register_clkdev(clk[nfc_ipg_per], NULL, "imx25-nand.0");
201 /* i.mx25 has the i.mx35 type cspi */ 261 /* i.mx25 has the i.mx35 type cspi */
202 clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0"); 262 clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0");
203 clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1"); 263 clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1");
@@ -212,15 +272,15 @@ int __init mx25_clocks_init(void)
212 clk_register_clkdev(clk[per10], "per", "mxc_pwm.3"); 272 clk_register_clkdev(clk[per10], "per", "mxc_pwm.3");
213 clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad"); 273 clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad");
214 clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc"); 274 clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc");
215 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx-i2c.0"); 275 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.0");
216 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx-i2c.1"); 276 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.1");
217 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx-i2c.2"); 277 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.2");
218 clk_register_clkdev(clk[fec_ipg], "ipg", "imx25-fec.0"); 278 clk_register_clkdev(clk[fec_ipg], "ipg", "imx25-fec.0");
219 clk_register_clkdev(clk[fec_ahb], "ahb", "imx25-fec.0"); 279 clk_register_clkdev(clk[fec_ahb], "ahb", "imx25-fec.0");
220 clk_register_clkdev(clk[dryice_ipg], NULL, "imxdi_rtc.0"); 280 clk_register_clkdev(clk[dryice_ipg], NULL, "imxdi_rtc.0");
221 clk_register_clkdev(clk[lcdc_ipg_per], "per", "imx-fb.0"); 281 clk_register_clkdev(clk[lcdc_ipg_per], "per", "imx21-fb.0");
222 clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx-fb.0"); 282 clk_register_clkdev(clk[lcdc_ipg], "ipg", "imx21-fb.0");
223 clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx-fb.0"); 283 clk_register_clkdev(clk[lcdc_ahb], "ahb", "imx21-fb.0");
224 clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0"); 284 clk_register_clkdev(clk[wdt_ipg], NULL, "imx2-wdt.0");
225 clk_register_clkdev(clk[ssi1_ipg], NULL, "imx-ssi.0"); 285 clk_register_clkdev(clk[ssi1_ipg], NULL, "imx-ssi.0");
226 clk_register_clkdev(clk[ssi2_ipg], NULL, "imx-ssi.1"); 286 clk_register_clkdev(clk[ssi2_ipg], NULL, "imx-ssi.1");
@@ -230,9 +290,9 @@ int __init mx25_clocks_init(void)
230 clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1"); 290 clk_register_clkdev(clk[esdhc2_ipg_per], "per", "sdhci-esdhc-imx25.1");
231 clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1"); 291 clk_register_clkdev(clk[esdhc2_ipg], "ipg", "sdhci-esdhc-imx25.1");
232 clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1"); 292 clk_register_clkdev(clk[esdhc2_ahb], "ahb", "sdhci-esdhc-imx25.1");
233 clk_register_clkdev(clk[csi_ipg_per], "per", "mx2-camera.0"); 293 clk_register_clkdev(clk[csi_ipg_per], "per", "imx25-camera.0");
234 clk_register_clkdev(clk[csi_ipg], "ipg", "mx2-camera.0"); 294 clk_register_clkdev(clk[csi_ipg], "ipg", "imx25-camera.0");
235 clk_register_clkdev(clk[csi_ahb], "ahb", "mx2-camera.0"); 295 clk_register_clkdev(clk[csi_ahb], "ahb", "imx25-camera.0");
236 clk_register_clkdev(clk[dummy], "audmux", NULL); 296 clk_register_clkdev(clk[dummy], "audmux", NULL);
237 clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0"); 297 clk_register_clkdev(clk[can1_ipg], NULL, "flexcan.0");
238 clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1"); 298 clk_register_clkdev(clk[can2_ipg], NULL, "flexcan.1");
@@ -242,5 +302,40 @@ int __init mx25_clocks_init(void)
242 clk_register_clkdev(clk[iim_ipg], "iim", NULL); 302 clk_register_clkdev(clk[iim_ipg], "iim", NULL);
243 303
244 mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), MX25_INT_GPT1); 304 mxc_timer_init(MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), MX25_INT_GPT1);
305
306 return 0;
307}
308
309int __init mx25_clocks_init_dt(void)
310{
311 struct device_node *np;
312 void __iomem *base;
313 int irq;
314 unsigned long osc_rate = 24000000;
315
316 /* retrieve the freqency of fixed clocks from device tree */
317 for_each_compatible_node(np, NULL, "fixed-clock") {
318 u32 rate;
319 if (of_property_read_u32(np, "clock-frequency", &rate))
320 continue;
321
322 if (of_device_is_compatible(np, "fsl,imx-osc"))
323 osc_rate = rate;
324 }
325
326 np = of_find_compatible_node(NULL, NULL, "fsl,imx25-ccm");
327 clk_data.clks = clk;
328 clk_data.clk_num = ARRAY_SIZE(clk);
329 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
330
331 __mx25_clocks_init(osc_rate);
332
333 np = of_find_compatible_node(NULL, NULL, "fsl,imx25-gpt");
334 base = of_iomap(np, 0);
335 WARN_ON(!base);
336 irq = irq_of_parse_and_map(np, 0);
337
338 mxc_timer_init(base, irq);
339
245 return 0; 340 return 0;
246} 341}
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 366e5d59d886..585ab256c58f 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -6,9 +6,9 @@
6#include <linux/clk-provider.h> 6#include <linux/clk-provider.h>
7#include <linux/of.h> 7#include <linux/of.h>
8 8
9#include <mach/common.h>
10#include <mach/hardware.h>
11#include "clk.h" 9#include "clk.h"
10#include "common.h"
11#include "hardware.h"
12 12
13#define IO_ADDR_CCM(off) (MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR + (off))) 13#define IO_ADDR_CCM(off) (MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR + (off)))
14 14
@@ -211,19 +211,19 @@ int __init mx27_clocks_init(unsigned long fref)
211 clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5"); 211 clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5");
212 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5"); 212 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5");
213 clk_register_clkdev(clk[pwm_ipg_gate], NULL, "mxc_pwm.0"); 213 clk_register_clkdev(clk[pwm_ipg_gate], NULL, "mxc_pwm.0");
214 clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.0"); 214 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0");
215 clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "mxc-mmc.0"); 215 clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0");
216 clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.1"); 216 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1");
217 clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "mxc-mmc.1"); 217 clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.1");
218 clk_register_clkdev(clk[per2_gate], "per", "mxc-mmc.2"); 218 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.2");
219 clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "mxc-mmc.2"); 219 clk_register_clkdev(clk[sdhc2_ipg_gate], "ipg", "imx21-mmc.2");
220 clk_register_clkdev(clk[cspi1_ipg_gate], NULL, "imx27-cspi.0"); 220 clk_register_clkdev(clk[cspi1_ipg_gate], NULL, "imx27-cspi.0");
221 clk_register_clkdev(clk[cspi2_ipg_gate], NULL, "imx27-cspi.1"); 221 clk_register_clkdev(clk[cspi2_ipg_gate], NULL, "imx27-cspi.1");
222 clk_register_clkdev(clk[cspi3_ipg_gate], NULL, "imx27-cspi.2"); 222 clk_register_clkdev(clk[cspi3_ipg_gate], NULL, "imx27-cspi.2");
223 clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0"); 223 clk_register_clkdev(clk[per3_gate], "per", "imx21-fb.0");
224 clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0"); 224 clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx21-fb.0");
225 clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0"); 225 clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx21-fb.0");
226 clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0"); 226 clk_register_clkdev(clk[csi_ahb_gate], "ahb", "imx27-camera.0");
227 clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc"); 227 clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
228 clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc"); 228 clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
229 clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc"); 229 clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
@@ -238,27 +238,27 @@ int __init mx27_clocks_init(unsigned long fref)
238 clk_register_clkdev(clk[usb_ahb_gate], "ahb", "mxc-ehci.2"); 238 clk_register_clkdev(clk[usb_ahb_gate], "ahb", "mxc-ehci.2");
239 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0"); 239 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0");
240 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); 240 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1");
241 clk_register_clkdev(clk[nfc_baud_gate], NULL, "mxc_nand.0"); 241 clk_register_clkdev(clk[nfc_baud_gate], NULL, "imx27-nand.0");
242 clk_register_clkdev(clk[vpu_baud_gate], "per", "coda-imx27.0"); 242 clk_register_clkdev(clk[vpu_baud_gate], "per", "coda-imx27.0");
243 clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "coda-imx27.0"); 243 clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "coda-imx27.0");
244 clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx-dma"); 244 clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx27-dma");
245 clk_register_clkdev(clk[dma_ipg_gate], "ipg", "imx-dma"); 245 clk_register_clkdev(clk[dma_ipg_gate], "ipg", "imx27-dma");
246 clk_register_clkdev(clk[fec_ipg_gate], "ipg", "imx27-fec.0"); 246 clk_register_clkdev(clk[fec_ipg_gate], "ipg", "imx27-fec.0");
247 clk_register_clkdev(clk[fec_ahb_gate], "ahb", "imx27-fec.0"); 247 clk_register_clkdev(clk[fec_ahb_gate], "ahb", "imx27-fec.0");
248 clk_register_clkdev(clk[wdog_ipg_gate], NULL, "imx2-wdt.0"); 248 clk_register_clkdev(clk[wdog_ipg_gate], NULL, "imx2-wdt.0");
249 clk_register_clkdev(clk[i2c1_ipg_gate], NULL, "imx-i2c.0"); 249 clk_register_clkdev(clk[i2c1_ipg_gate], NULL, "imx21-i2c.0");
250 clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx-i2c.1"); 250 clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx21-i2c.1");
251 clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0"); 251 clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
252 clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad"); 252 clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
253 clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0"); 253 clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "imx27-camera.0");
254 clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0"); 254 clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "imx27-camera.0");
255 clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0"); 255 clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
256 clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0"); 256 clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
257 clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL); 257 clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
258 clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL); 258 clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL);
259 clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL); 259 clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL);
260 clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL); 260 clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL);
261 clk_register_clkdev(clk[rtc_ipg_gate], NULL, "mxc_rtc"); 261 clk_register_clkdev(clk[rtc_ipg_gate], NULL, "imx21-rtc");
262 clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL); 262 clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL);
263 clk_register_clkdev(clk[cpu_div], "cpu", NULL); 263 clk_register_clkdev(clk[cpu_div], "cpu", NULL);
264 clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL); 264 clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL);
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 1253af2d9971..8be64e0a4ace 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -22,12 +22,11 @@
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/of.h> 23#include <linux/of.h>
24 24
25#include <mach/hardware.h>
26#include <mach/mx31.h>
27#include <mach/common.h>
28
29#include "clk.h" 25#include "clk.h"
26#include "common.h"
30#include "crmregs-imx3.h" 27#include "crmregs-imx3.h"
28#include "hardware.h"
29#include "mx31.h"
31 30
32static const char *mcu_main_sel[] = { "spll", "mpll", }; 31static const char *mcu_main_sel[] = { "spll", "mpll", };
33static const char *per_sel[] = { "per_div", "ipg", }; 32static const char *per_sel[] = { "per_div", "ipg", };
@@ -124,10 +123,10 @@ int __init mx31_clocks_init(unsigned long fref)
124 clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2"); 123 clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
125 clk_register_clkdev(clk[pwm_gate], "pwm", NULL); 124 clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
126 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); 125 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
127 clk_register_clkdev(clk[rtc_gate], NULL, "mxc_rtc"); 126 clk_register_clkdev(clk[rtc_gate], NULL, "imx21-rtc");
128 clk_register_clkdev(clk[epit1_gate], "epit", NULL); 127 clk_register_clkdev(clk[epit1_gate], "epit", NULL);
129 clk_register_clkdev(clk[epit2_gate], "epit", NULL); 128 clk_register_clkdev(clk[epit2_gate], "epit", NULL);
130 clk_register_clkdev(clk[nfc], NULL, "mxc_nand.0"); 129 clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
131 clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core"); 130 clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
132 clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb"); 131 clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
133 clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad"); 132 clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
@@ -155,12 +154,12 @@ int __init mx31_clocks_init(unsigned long fref)
155 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.3"); 154 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.3");
156 clk_register_clkdev(clk[uart5_gate], "per", "imx21-uart.4"); 155 clk_register_clkdev(clk[uart5_gate], "per", "imx21-uart.4");
157 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.4"); 156 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.4");
158 clk_register_clkdev(clk[i2c1_gate], NULL, "imx-i2c.0"); 157 clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
159 clk_register_clkdev(clk[i2c2_gate], NULL, "imx-i2c.1"); 158 clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
160 clk_register_clkdev(clk[i2c3_gate], NULL, "imx-i2c.2"); 159 clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
161 clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0"); 160 clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
162 clk_register_clkdev(clk[sdhc1_gate], NULL, "mxc-mmc.0"); 161 clk_register_clkdev(clk[sdhc1_gate], NULL, "imx31-mmc.0");
163 clk_register_clkdev(clk[sdhc2_gate], NULL, "mxc-mmc.1"); 162 clk_register_clkdev(clk[sdhc2_gate], NULL, "imx31-mmc.1");
164 clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0"); 163 clk_register_clkdev(clk[ssi1_gate], NULL, "imx-ssi.0");
165 clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1"); 164 clk_register_clkdev(clk[ssi2_gate], NULL, "imx-ssi.1");
166 clk_register_clkdev(clk[firi_gate], "firi", NULL); 165 clk_register_clkdev(clk[firi_gate], "firi", NULL);
diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index 177259b523cd..66f3d65ea275 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -14,11 +14,10 @@
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/err.h> 15#include <linux/err.h>
16 16
17#include <mach/hardware.h>
18#include <mach/common.h>
19
20#include "crmregs-imx3.h" 17#include "crmregs-imx3.h"
21#include "clk.h" 18#include "clk.h"
19#include "common.h"
20#include "hardware.h"
22 21
23struct arm_ahb_div { 22struct arm_ahb_div {
24 unsigned char arm, ahb, sel; 23 unsigned char arm, ahb, sel;
@@ -226,9 +225,9 @@ int __init mx35_clocks_init()
226 clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0"); 225 clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
227 clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0"); 226 clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
228 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); 227 clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
229 clk_register_clkdev(clk[i2c1_gate], NULL, "imx-i2c.0"); 228 clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
230 clk_register_clkdev(clk[i2c2_gate], NULL, "imx-i2c.1"); 229 clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
231 clk_register_clkdev(clk[i2c3_gate], NULL, "imx-i2c.2"); 230 clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
232 clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core"); 231 clk_register_clkdev(clk[ipu_gate], NULL, "ipu-core");
233 clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb"); 232 clk_register_clkdev(clk[ipu_gate], NULL, "mx3_sdc_fb");
234 clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad"); 233 clk_register_clkdev(clk[kpp_gate], NULL, "imx-keypad");
@@ -256,7 +255,7 @@ int __init mx35_clocks_init()
256 clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc"); 255 clk_register_clkdev(clk[ipg], "ipg", "fsl-usb2-udc");
257 clk_register_clkdev(clk[usbotg_gate], "ahb", "fsl-usb2-udc"); 256 clk_register_clkdev(clk[usbotg_gate], "ahb", "fsl-usb2-udc");
258 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); 257 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
259 clk_register_clkdev(clk[nfc_div], NULL, "mxc_nand.0"); 258 clk_register_clkdev(clk[nfc_div], NULL, "imx25-nand.0");
260 clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0"); 259 clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
261 260
262 clk_prepare_enable(clk[spba_gate]); 261 clk_prepare_enable(clk[spba_gate]);
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index a0bf84803eac..abb71f6b4d60 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -14,11 +14,10 @@
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/err.h> 15#include <linux/err.h>
16 16
17#include <mach/hardware.h>
18#include <mach/common.h>
19
20#include "crm-regs-imx5.h" 17#include "crm-regs-imx5.h"
21#include "clk.h" 18#include "clk.h"
19#include "common.h"
20#include "hardware.h"
22 21
23/* Low-power Audio Playback Mode clock */ 22/* Low-power Audio Playback Mode clock */
24static const char *lp_apm_sel[] = { "osc", }; 23static const char *lp_apm_sel[] = { "osc", };
@@ -258,8 +257,8 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
258 clk_register_clkdev(clk[cspi_ipg_gate], NULL, "imx35-cspi.2"); 257 clk_register_clkdev(clk[cspi_ipg_gate], NULL, "imx35-cspi.2");
259 clk_register_clkdev(clk[pwm1_ipg_gate], "pwm", "mxc_pwm.0"); 258 clk_register_clkdev(clk[pwm1_ipg_gate], "pwm", "mxc_pwm.0");
260 clk_register_clkdev(clk[pwm2_ipg_gate], "pwm", "mxc_pwm.1"); 259 clk_register_clkdev(clk[pwm2_ipg_gate], "pwm", "mxc_pwm.1");
261 clk_register_clkdev(clk[i2c1_gate], NULL, "imx-i2c.0"); 260 clk_register_clkdev(clk[i2c1_gate], NULL, "imx21-i2c.0");
262 clk_register_clkdev(clk[i2c2_gate], NULL, "imx-i2c.1"); 261 clk_register_clkdev(clk[i2c2_gate], NULL, "imx21-i2c.1");
263 clk_register_clkdev(clk[usboh3_per_gate], "per", "mxc-ehci.0"); 262 clk_register_clkdev(clk[usboh3_per_gate], "per", "mxc-ehci.0");
264 clk_register_clkdev(clk[usboh3_gate], "ipg", "mxc-ehci.0"); 263 clk_register_clkdev(clk[usboh3_gate], "ipg", "mxc-ehci.0");
265 clk_register_clkdev(clk[usboh3_gate], "ahb", "mxc-ehci.0"); 264 clk_register_clkdev(clk[usboh3_gate], "ahb", "mxc-ehci.0");
@@ -272,7 +271,7 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
272 clk_register_clkdev(clk[usboh3_per_gate], "per", "fsl-usb2-udc"); 271 clk_register_clkdev(clk[usboh3_per_gate], "per", "fsl-usb2-udc");
273 clk_register_clkdev(clk[usboh3_gate], "ipg", "fsl-usb2-udc"); 272 clk_register_clkdev(clk[usboh3_gate], "ipg", "fsl-usb2-udc");
274 clk_register_clkdev(clk[usboh3_gate], "ahb", "fsl-usb2-udc"); 273 clk_register_clkdev(clk[usboh3_gate], "ahb", "fsl-usb2-udc");
275 clk_register_clkdev(clk[nfc_gate], NULL, "mxc_nand"); 274 clk_register_clkdev(clk[nfc_gate], NULL, "imx51-nand");
276 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0"); 275 clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0");
277 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); 276 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1");
278 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2"); 277 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2");
@@ -345,7 +344,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
345 344
346 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2); 345 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2);
347 346
348 clk_register_clkdev(clk[hsi2c_gate], NULL, "imx-i2c.2"); 347 clk_register_clkdev(clk[hsi2c_gate], NULL, "imx21-i2c.2");
349 clk_register_clkdev(clk[mx51_mipi], "mipi_hsp", NULL); 348 clk_register_clkdev(clk[mx51_mipi], "mipi_hsp", NULL);
350 clk_register_clkdev(clk[vpu_gate], NULL, "imx51-vpu.0"); 349 clk_register_clkdev(clk[vpu_gate], NULL, "imx51-vpu.0");
351 clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0"); 350 clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
@@ -440,7 +439,7 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
440 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2); 439 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2);
441 440
442 clk_register_clkdev(clk[vpu_gate], NULL, "imx53-vpu.0"); 441 clk_register_clkdev(clk[vpu_gate], NULL, "imx53-vpu.0");
443 clk_register_clkdev(clk[i2c3_gate], NULL, "imx-i2c.2"); 442 clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
444 clk_register_clkdev(clk[fec_gate], NULL, "imx25-fec.0"); 443 clk_register_clkdev(clk[fec_gate], NULL, "imx25-fec.0");
445 clk_register_clkdev(clk[ipu_gate], "bus", "imx53-ipu"); 444 clk_register_clkdev(clk[ipu_gate], "bus", "imx53-ipu");
446 clk_register_clkdev(clk[ipu_di0_gate], "di0", "imx53-ipu"); 445 clk_register_clkdev(clk[ipu_di0_gate], "di0", "imx53-ipu");
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 3ec242f3341e..5f9f5919dd74 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -19,8 +19,9 @@
19#include <linux/of.h> 19#include <linux/of.h>
20#include <linux/of_address.h> 20#include <linux/of_address.h>
21#include <linux/of_irq.h> 21#include <linux/of_irq.h>
22#include <mach/common.h> 22
23#include "clk.h" 23#include "clk.h"
24#include "common.h"
24 25
25#define CCGR0 0x68 26#define CCGR0 0x68
26#define CCGR1 0x6c 27#define CCGR1 0x6c
@@ -405,6 +406,7 @@ int __init mx6q_clocks_init(void)
405 clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL); 406 clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL);
406 clk_register_clkdev(clk[ahb], "ahb", NULL); 407 clk_register_clkdev(clk[ahb], "ahb", NULL);
407 clk_register_clkdev(clk[cko1], "cko1", NULL); 408 clk_register_clkdev(clk[cko1], "cko1", NULL);
409 clk_register_clkdev(clk[arm], NULL, "cpu0");
408 410
409 /* 411 /*
410 * The gpmi needs 100MHz frequency in the EDO/Sync mode, 412 * The gpmi needs 100MHz frequency in the EDO/Sync mode,
diff --git a/arch/arm/mach-imx/clk-pllv1.c b/arch/arm/mach-imx/clk-pllv1.c
index 02be73178912..abff350ba24c 100644
--- a/arch/arm/mach-imx/clk-pllv1.c
+++ b/arch/arm/mach-imx/clk-pllv1.c
@@ -4,10 +4,10 @@
4#include <linux/slab.h> 4#include <linux/slab.h>
5#include <linux/kernel.h> 5#include <linux/kernel.h>
6#include <linux/err.h> 6#include <linux/err.h>
7#include <mach/common.h>
8#include <mach/hardware.h>
9 7
10#include "clk.h" 8#include "clk.h"
9#include "common.h"
10#include "hardware.h"
11 11
12/** 12/**
13 * pll v1 13 * pll v1
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/mach-imx/common.h
index ead901814c0d..7191ab4434e5 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -66,6 +66,7 @@ extern int mx51_clocks_init(unsigned long ckil, unsigned long osc,
66 unsigned long ckih1, unsigned long ckih2); 66 unsigned long ckih1, unsigned long ckih2);
67extern int mx53_clocks_init(unsigned long ckil, unsigned long osc, 67extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
68 unsigned long ckih1, unsigned long ckih2); 68 unsigned long ckih1, unsigned long ckih2);
69extern int mx25_clocks_init_dt(void);
69extern int mx27_clocks_init_dt(void); 70extern int mx27_clocks_init_dt(void);
70extern int mx31_clocks_init_dt(void); 71extern int mx31_clocks_init_dt(void);
71extern int mx51_clocks_init_dt(void); 72extern int mx51_clocks_init_dt(void);
@@ -79,6 +80,7 @@ extern void mxc_arch_reset_init(void __iomem *);
79extern int mx53_revision(void); 80extern int mx53_revision(void);
80extern int mx53_display_revision(void); 81extern int mx53_display_revision(void);
81extern void imx_set_aips(void __iomem *); 82extern void imx_set_aips(void __iomem *);
83extern int mxc_device_init(void);
82 84
83enum mxc_cpu_pwr_mode { 85enum mxc_cpu_pwr_mode {
84 WAIT_CLOCKED, /* wfi only */ 86 WAIT_CLOCKED, /* wfi only */
diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c
index 6914bcbf84e4..96ec64b5ff7d 100644
--- a/arch/arm/mach-imx/cpu-imx25.c
+++ b/arch/arm/mach-imx/cpu-imx25.c
@@ -11,8 +11,9 @@
11 */ 11 */
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <mach/hardware.h> 14
15#include <mach/iim.h> 15#include "iim.h"
16#include "hardware.h"
16 17
17static int mx25_cpu_rev = -1; 18static int mx25_cpu_rev = -1;
18 19
diff --git a/arch/arm/mach-imx/cpu-imx27.c b/arch/arm/mach-imx/cpu-imx27.c
index ff38e1505f67..fe8d36f7e30e 100644
--- a/arch/arm/mach-imx/cpu-imx27.c
+++ b/arch/arm/mach-imx/cpu-imx27.c
@@ -24,7 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/module.h> 25#include <linux/module.h>
26 26
27#include <mach/hardware.h> 27#include "hardware.h"
28 28
29static int mx27_cpu_rev = -1; 29static int mx27_cpu_rev = -1;
30static int mx27_cpu_partnumber; 30static int mx27_cpu_partnumber;
diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index 3f2345f0cdaf..fde1860a2521 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -11,9 +11,10 @@
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <mach/hardware.h> 14
15#include <mach/iim.h> 15#include "common.h"
16#include <mach/common.h> 16#include "hardware.h"
17#include "iim.h"
17 18
18static int mx31_cpu_rev = -1; 19static int mx31_cpu_rev = -1;
19 20
diff --git a/arch/arm/mach-imx/cpu-imx35.c b/arch/arm/mach-imx/cpu-imx35.c
index 846e46eb8cbf..ec3aaa098c17 100644
--- a/arch/arm/mach-imx/cpu-imx35.c
+++ b/arch/arm/mach-imx/cpu-imx35.c
@@ -10,8 +10,9 @@
10 */ 10 */
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <mach/hardware.h> 13
14#include <mach/iim.h> 14#include "hardware.h"
15#include "iim.h"
15 16
16static int mx35_cpu_rev = -1; 17static int mx35_cpu_rev = -1;
17 18
diff --git a/arch/arm/mach-imx/cpu-imx5.c b/arch/arm/mach-imx/cpu-imx5.c
index 8eb15a2fcaf9..d88760014ff9 100644
--- a/arch/arm/mach-imx/cpu-imx5.c
+++ b/arch/arm/mach-imx/cpu-imx5.c
@@ -15,9 +15,10 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <mach/hardware.h>
19#include <linux/io.h> 18#include <linux/io.h>
20 19
20#include "hardware.h"
21
21static int mx5_cpu_rev = -1; 22static int mx5_cpu_rev = -1;
22 23
23#define IIM_SREV 0x24 24#define IIM_SREV 0x24
diff --git a/arch/arm/plat-mxc/cpu.c b/arch/arm/mach-imx/cpu.c
index 220dd6f93126..03fcbd082593 100644
--- a/arch/arm/plat-mxc/cpu.c
+++ b/arch/arm/mach-imx/cpu.c
@@ -1,7 +1,8 @@
1 1
2#include <linux/module.h> 2#include <linux/module.h>
3#include <linux/io.h> 3#include <linux/io.h>
4#include <mach/hardware.h> 4
5#include "hardware.h"
5 6
6unsigned int __mxc_cpu_type; 7unsigned int __mxc_cpu_type;
7EXPORT_SYMBOL(__mxc_cpu_type); 8EXPORT_SYMBOL(__mxc_cpu_type);
diff --git a/arch/arm/mach-imx/cpu_op-mx51.c b/arch/arm/mach-imx/cpu_op-mx51.c
index 7b92cd6da6d3..b9ef692b61a2 100644
--- a/arch/arm/mach-imx/cpu_op-mx51.c
+++ b/arch/arm/mach-imx/cpu_op-mx51.c
@@ -13,9 +13,10 @@
13 13
14#include <linux/bug.h> 14#include <linux/bug.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <mach/hardware.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18 17
18#include "hardware.h"
19
19static struct cpu_op mx51_cpu_op[] = { 20static struct cpu_op mx51_cpu_op[] = {
20 { 21 {
21 .cpu_rate = 160000000,}, 22 .cpu_rate = 160000000,},
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/mach-imx/cpufreq.c
index b5b6f8083130..36e8b3994470 100644
--- a/arch/arm/plat-mxc/cpufreq.c
+++ b/arch/arm/mach-imx/cpufreq.c
@@ -22,7 +22,8 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
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
26#include "hardware.h"
26 27
27#define CLK32_FREQ 32768 28#define CLK32_FREQ 32768
28#define NANOSECOND (1000 * 1000 * 1000) 29#define NANOSECOND (1000 * 1000 * 1000)
diff --git a/arch/arm/plat-mxc/cpuidle.c b/arch/arm/mach-imx/cpuidle.c
index d4cb511a44a8..d4cb511a44a8 100644
--- a/arch/arm/plat-mxc/cpuidle.c
+++ b/arch/arm/mach-imx/cpuidle.c
diff --git a/arch/arm/plat-mxc/include/mach/cpuidle.h b/arch/arm/mach-imx/cpuidle.h
index bc932d1af372..bc932d1af372 100644
--- a/arch/arm/plat-mxc/include/mach/cpuidle.h
+++ b/arch/arm/mach-imx/cpuidle.h
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h
index 3aad1e70de96..f9b5afc6bcd1 100644
--- a/arch/arm/mach-imx/devices-imx1.h
+++ b/arch/arm/mach-imx/devices-imx1.h
@@ -6,8 +6,7 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/mx1.h> 9#include "devices/devices-common.h"
10#include <mach/devices-common.h>
11 10
12extern const struct imx_imx_fb_data imx1_imx_fb_data; 11extern const struct imx_imx_fb_data imx1_imx_fb_data;
13#define imx1_add_imx_fb(pdata) \ 12#define imx1_add_imx_fb(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx21.h b/arch/arm/mach-imx/devices-imx21.h
index 93ece55f75df..bd9393280159 100644
--- a/arch/arm/mach-imx/devices-imx21.h
+++ b/arch/arm/mach-imx/devices-imx21.h
@@ -6,8 +6,7 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/mx21.h> 9#include "devices/devices-common.h"
10#include <mach/devices-common.h>
11 10
12extern const struct imx_imx21_hcd_data imx21_imx21_hcd_data; 11extern const struct imx_imx21_hcd_data imx21_imx21_hcd_data;
13#define imx21_add_imx21_hcd(pdata) \ 12#define imx21_add_imx21_hcd(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h
index f8e03dd1f116..0d2922bc575c 100644
--- a/arch/arm/mach-imx/devices-imx25.h
+++ b/arch/arm/mach-imx/devices-imx25.h
@@ -6,8 +6,7 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/mx25.h> 9#include "devices/devices-common.h"
10#include <mach/devices-common.h>
11 10
12extern const struct imx_fec_data imx25_fec_data; 11extern const struct imx_fec_data imx25_fec_data;
13#define imx25_add_fec(pdata) \ 12#define imx25_add_fec(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h
index 04822932cdd1..8a1ad7972d4c 100644
--- a/arch/arm/mach-imx/devices-imx27.h
+++ b/arch/arm/mach-imx/devices-imx27.h
@@ -6,8 +6,7 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/mx27.h> 9#include "devices/devices-common.h"
10#include <mach/devices-common.h>
11 10
12extern const struct imx_fec_data imx27_fec_data; 11extern const struct imx_fec_data imx27_fec_data;
13#define imx27_add_fec(pdata) \ 12#define imx27_add_fec(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx31.h b/arch/arm/mach-imx/devices-imx31.h
index 8b2ceb45bb83..e8d1611bbc8e 100644
--- a/arch/arm/mach-imx/devices-imx31.h
+++ b/arch/arm/mach-imx/devices-imx31.h
@@ -6,8 +6,7 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/mx31.h> 9#include "devices/devices-common.h"
10#include <mach/devices-common.h>
11 10
12extern const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data; 11extern const struct imx_fsl_usb2_udc_data imx31_fsl_usb2_udc_data;
13#define imx31_add_fsl_usb2_udc(pdata) \ 12#define imx31_add_fsl_usb2_udc(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx35.h b/arch/arm/mach-imx/devices-imx35.h
index c3e9f206ac2b..e2675f1b141c 100644
--- a/arch/arm/mach-imx/devices-imx35.h
+++ b/arch/arm/mach-imx/devices-imx35.h
@@ -6,8 +6,7 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/mx35.h> 9#include "devices/devices-common.h"
10#include <mach/devices-common.h>
11 10
12extern const struct imx_fec_data imx35_fec_data; 11extern const struct imx_fec_data imx35_fec_data;
13#define imx35_add_fec(pdata) \ 12#define imx35_add_fec(pdata) \
diff --git a/arch/arm/mach-imx/devices-imx50.h b/arch/arm/mach-imx/devices-imx50.h
index 7216667eaafc..2c290391f298 100644
--- a/arch/arm/mach-imx/devices-imx50.h
+++ b/arch/arm/mach-imx/devices-imx50.h
@@ -18,8 +18,7 @@
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */ 19 */
20 20
21#include <mach/mx50.h> 21#include "devices/devices-common.h"
22#include <mach/devices-common.h>
23 22
24extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[]; 23extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[];
25#define imx50_add_imx_uart(id, pdata) \ 24#define imx50_add_imx_uart(id, pdata) \
diff --git a/arch/arm/mach-imx/devices-imx51.h b/arch/arm/mach-imx/devices-imx51.h
index 9f1718725195..deee5baee88c 100644
--- a/arch/arm/mach-imx/devices-imx51.h
+++ b/arch/arm/mach-imx/devices-imx51.h
@@ -6,8 +6,7 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/mx51.h> 9#include "devices/devices-common.h"
10#include <mach/devices-common.h>
11 10
12extern const struct imx_fec_data imx51_fec_data; 11extern const struct imx_fec_data imx51_fec_data;
13#define imx51_add_fec(pdata) \ 12#define imx51_add_fec(pdata) \
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
index a35d9841f494..a35d9841f494 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/mach-imx/devices/Kconfig
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/mach-imx/devices/Makefile
index 76f3195475d0..2abe2a5144d0 100644
--- a/arch/arm/plat-mxc/devices/Makefile
+++ b/arch/arm/mach-imx/devices/Makefile
@@ -1,3 +1,5 @@
1obj-y := devices.o
2
1obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o 3obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o
2obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o 4obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
3obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o 5obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index eaf79d220c9a..e4b790b9e2aa 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -108,6 +108,7 @@ struct platform_device *__init imx_add_imxdi_rtc(
108 108
109#include <linux/platform_data/video-imxfb.h> 109#include <linux/platform_data/video-imxfb.h>
110struct imx_imx_fb_data { 110struct imx_imx_fb_data {
111 const char *devid;
111 resource_size_t iobase; 112 resource_size_t iobase;
112 resource_size_t iosize; 113 resource_size_t iosize;
113 resource_size_t irq; 114 resource_size_t irq;
@@ -118,6 +119,7 @@ struct platform_device *__init imx_add_imx_fb(
118 119
119#include <linux/platform_data/i2c-imx.h> 120#include <linux/platform_data/i2c-imx.h>
120struct imx_imx_i2c_data { 121struct imx_imx_i2c_data {
122 const char *devid;
121 int id; 123 int id;
122 resource_size_t iobase; 124 resource_size_t iobase;
123 resource_size_t iosize; 125 resource_size_t iosize;
@@ -219,6 +221,7 @@ struct platform_device *__init imx_add_mx1_camera(
219 221
220#include <linux/platform_data/camera-mx2.h> 222#include <linux/platform_data/camera-mx2.h>
221struct imx_mx2_camera_data { 223struct imx_mx2_camera_data {
224 const char *devid;
222 resource_size_t iobasecsi; 225 resource_size_t iobasecsi;
223 resource_size_t iosizecsi; 226 resource_size_t iosizecsi;
224 resource_size_t irqcsi; 227 resource_size_t irqcsi;
@@ -244,6 +247,7 @@ struct platform_device *__init imx_add_mxc_ehci(
244 247
245#include <linux/platform_data/mmc-mxcmmc.h> 248#include <linux/platform_data/mmc-mxcmmc.h>
246struct imx_mxc_mmc_data { 249struct imx_mxc_mmc_data {
250 const char *devid;
247 int id; 251 int id;
248 resource_size_t iobase; 252 resource_size_t iobase;
249 resource_size_t iosize; 253 resource_size_t iosize;
@@ -256,6 +260,7 @@ struct platform_device *__init imx_add_mxc_mmc(
256 260
257#include <linux/platform_data/mtd-mxc_nand.h> 261#include <linux/platform_data/mtd-mxc_nand.h>
258struct imx_mxc_nand_data { 262struct imx_mxc_nand_data {
263 const char *devid;
259 /* 264 /*
260 * id is traditionally 0, but -1 is more appropriate. We use -1 for new 265 * id is traditionally 0, but -1 is more appropriate. We use -1 for new
261 * machines but don't change existing devices as the nand device usually 266 * machines but don't change existing devices as the nand device usually
@@ -290,6 +295,7 @@ struct platform_device *__init imx_add_mxc_pwm(
290 295
291/* mxc_rtc */ 296/* mxc_rtc */
292struct imx_mxc_rtc_data { 297struct imx_mxc_rtc_data {
298 const char *devid;
293 resource_size_t iobase; 299 resource_size_t iobase;
294 resource_size_t irq; 300 resource_size_t irq;
295}; 301};
@@ -326,7 +332,8 @@ struct platform_device *__init imx_add_spi_imx(
326 const struct imx_spi_imx_data *data, 332 const struct imx_spi_imx_data *data,
327 const struct spi_imx_master *pdata); 333 const struct spi_imx_master *pdata);
328 334
329struct platform_device *imx_add_imx_dma(void); 335struct platform_device *imx_add_imx_dma(char *name, resource_size_t iobase,
336 int irq, int irq_err);
330struct platform_device *imx_add_imx_sdma(char *name, 337struct platform_device *imx_add_imx_sdma(char *name,
331 resource_size_t iobase, int irq, struct sdma_platform_data *pdata); 338 resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
332 339
diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/mach-imx/devices/devices.c
index 4d55a7a26e98..1b37482407f9 100644
--- a/arch/arm/plat-mxc/devices.c
+++ b/arch/arm/mach-imx/devices/devices.c
@@ -21,7 +21,6 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <mach/common.h>
25 24
26struct device mxc_aips_bus = { 25struct device mxc_aips_bus = {
27 .init_name = "mxc_aips", 26 .init_name = "mxc_aips",
@@ -33,7 +32,7 @@ struct device mxc_ahb_bus = {
33 .parent = &platform_bus, 32 .parent = &platform_bus,
34}; 33};
35 34
36static int __init mxc_device_init(void) 35int __init mxc_device_init(void)
37{ 36{
38 int ret; 37 int ret;
39 38
@@ -46,4 +45,3 @@ static int __init mxc_device_init(void)
46done: 45done:
47 return ret; 46 return ret;
48} 47}
49core_initcall(mxc_device_init);
diff --git a/arch/arm/plat-mxc/devices/platform-ahci-imx.c b/arch/arm/mach-imx/devices/platform-ahci-imx.c
index ade4a1c4e2a3..3d87dd9c284a 100644
--- a/arch/arm/plat-mxc/devices/platform-ahci-imx.c
+++ b/arch/arm/mach-imx/devices/platform-ahci-imx.c
@@ -24,8 +24,9 @@
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26#include <asm/sizes.h> 26#include <asm/sizes.h>
27#include <mach/hardware.h> 27
28#include <mach/devices-common.h> 28#include "../hardware.h"
29#include "devices-common.h"
29 30
30#define imx_ahci_imx_data_entry_single(soc, _devid) \ 31#define imx_ahci_imx_data_entry_single(soc, _devid) \
31 { \ 32 { \
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/mach-imx/devices/platform-fec.c
index 0bae44e890db..2cb188ad9a0a 100644
--- a/arch/arm/plat-mxc/devices/platform-fec.c
+++ b/arch/arm/mach-imx/devices/platform-fec.c
@@ -8,8 +8,9 @@
8 */ 8 */
9#include <linux/dma-mapping.h> 9#include <linux/dma-mapping.h>
10#include <asm/sizes.h> 10#include <asm/sizes.h>
11#include <mach/hardware.h> 11
12#include <mach/devices-common.h> 12#include "../hardware.h"
13#include "devices-common.h"
13 14
14#define imx_fec_data_entry_single(soc, _devid) \ 15#define imx_fec_data_entry_single(soc, _devid) \
15 { \ 16 { \
diff --git a/arch/arm/plat-mxc/devices/platform-flexcan.c b/arch/arm/mach-imx/devices/platform-flexcan.c
index 4e8497af2eb1..1078bf0a94ef 100644
--- a/arch/arm/plat-mxc/devices/platform-flexcan.c
+++ b/arch/arm/mach-imx/devices/platform-flexcan.c
@@ -5,8 +5,8 @@
5 * the terms of the GNU General Public License version 2 as published by the 5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation. 6 * Free Software Foundation.
7 */ 7 */
8#include <mach/hardware.h> 8#include "../hardware.h"
9#include <mach/devices-common.h> 9#include "devices-common.h"
10 10
11#define imx_flexcan_data_entry_single(soc, _id, _hwid, _size) \ 11#define imx_flexcan_data_entry_single(soc, _id, _hwid, _size) \
12 { \ 12 { \
diff --git a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
index 848038f301fd..37e44398197b 100644
--- a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
+++ b/arch/arm/mach-imx/devices/platform-fsl-usb2-udc.c
@@ -7,8 +7,9 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <linux/dma-mapping.h> 9#include <linux/dma-mapping.h>
10#include <mach/hardware.h> 10
11#include <mach/devices-common.h> 11#include "../hardware.h"
12#include "devices-common.h"
12 13
13#define imx_fsl_usb2_udc_data_entry_single(soc) \ 14#define imx_fsl_usb2_udc_data_entry_single(soc) \
14 { \ 15 { \
diff --git a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c b/arch/arm/mach-imx/devices/platform-gpio-mxc.c
index a7919a241032..26483fa94b75 100644
--- a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
+++ b/arch/arm/mach-imx/devices/platform-gpio-mxc.c
@@ -6,7 +6,7 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/devices-common.h> 9#include "devices-common.h"
10 10
11struct platform_device *__init mxc_register_gpio(char *name, int id, 11struct platform_device *__init mxc_register_gpio(char *name, int id,
12 resource_size_t iobase, resource_size_t iosize, int irq, int irq_high) 12 resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
diff --git a/arch/arm/plat-mxc/devices/platform-gpio_keys.c b/arch/arm/mach-imx/devices/platform-gpio_keys.c
index 1c53a532ea0e..486282539c76 100644
--- a/arch/arm/plat-mxc/devices/platform-gpio_keys.c
+++ b/arch/arm/mach-imx/devices/platform-gpio_keys.c
@@ -16,8 +16,9 @@
16 * Boston, MA 02110-1301, USA. 16 * Boston, MA 02110-1301, USA.
17 */ 17 */
18#include <asm/sizes.h> 18#include <asm/sizes.h>
19#include <mach/hardware.h> 19
20#include <mach/devices-common.h> 20#include "../hardware.h"
21#include "devices-common.h"
21 22
22struct platform_device *__init imx_add_gpio_keys( 23struct platform_device *__init imx_add_gpio_keys(
23 const struct gpio_keys_platform_data *pdata) 24 const struct gpio_keys_platform_data *pdata)
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/mach-imx/devices/platform-imx-dma.c
index 7fa7e9c92468..ccdb5dc4ddbd 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-dma.c
+++ b/arch/arm/mach-imx/devices/platform-imx-dma.c
@@ -6,12 +6,29 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/devices-common.h> 9#include "devices-common.h"
10 10
11struct platform_device __init __maybe_unused *imx_add_imx_dma(void) 11struct platform_device __init __maybe_unused *imx_add_imx_dma(char *name,
12 resource_size_t iobase, int irq, int irq_err)
12{ 13{
14 struct resource res[] = {
15 {
16 .start = iobase,
17 .end = iobase + SZ_4K - 1,
18 .flags = IORESOURCE_MEM,
19 }, {
20 .start = irq,
21 .end = irq,
22 .flags = IORESOURCE_IRQ,
23 }, {
24 .start = irq_err,
25 .end = irq_err,
26 .flags = IORESOURCE_IRQ,
27 },
28 };
29
13 return platform_device_register_resndata(&mxc_ahb_bus, 30 return platform_device_register_resndata(&mxc_ahb_bus,
14 "imx-dma", -1, NULL, 0, NULL, 0); 31 name, -1, res, ARRAY_SIZE(res), NULL, 0);
15} 32}
16 33
17struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name, 34struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
diff --git a/arch/arm/plat-mxc/devices/platform-imx-fb.c b/arch/arm/mach-imx/devices/platform-imx-fb.c
index 2b0b5e0aa998..10b0ed39f07f 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-fb.c
+++ b/arch/arm/mach-imx/devices/platform-imx-fb.c
@@ -7,11 +7,13 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <linux/dma-mapping.h> 9#include <linux/dma-mapping.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12 10
13#define imx_imx_fb_data_entry_single(soc, _size) \ 11#include "../hardware.h"
12#include "devices-common.h"
13
14#define imx_imx_fb_data_entry_single(soc, _devid, _size) \
14 { \ 15 { \
16 .devid = _devid, \
15 .iobase = soc ## _LCDC_BASE_ADDR, \ 17 .iobase = soc ## _LCDC_BASE_ADDR, \
16 .iosize = _size, \ 18 .iosize = _size, \
17 .irq = soc ## _INT_LCDC, \ 19 .irq = soc ## _INT_LCDC, \
@@ -19,22 +21,22 @@
19 21
20#ifdef CONFIG_SOC_IMX1 22#ifdef CONFIG_SOC_IMX1
21const struct imx_imx_fb_data imx1_imx_fb_data __initconst = 23const struct imx_imx_fb_data imx1_imx_fb_data __initconst =
22 imx_imx_fb_data_entry_single(MX1, SZ_4K); 24 imx_imx_fb_data_entry_single(MX1, "imx1-fb", SZ_4K);
23#endif /* ifdef CONFIG_SOC_IMX1 */ 25#endif /* ifdef CONFIG_SOC_IMX1 */
24 26
25#ifdef CONFIG_SOC_IMX21 27#ifdef CONFIG_SOC_IMX21
26const struct imx_imx_fb_data imx21_imx_fb_data __initconst = 28const struct imx_imx_fb_data imx21_imx_fb_data __initconst =
27 imx_imx_fb_data_entry_single(MX21, SZ_4K); 29 imx_imx_fb_data_entry_single(MX21, "imx21-fb", SZ_4K);
28#endif /* ifdef CONFIG_SOC_IMX21 */ 30#endif /* ifdef CONFIG_SOC_IMX21 */
29 31
30#ifdef CONFIG_SOC_IMX25 32#ifdef CONFIG_SOC_IMX25
31const struct imx_imx_fb_data imx25_imx_fb_data __initconst = 33const struct imx_imx_fb_data imx25_imx_fb_data __initconst =
32 imx_imx_fb_data_entry_single(MX25, SZ_16K); 34 imx_imx_fb_data_entry_single(MX25, "imx21-fb", SZ_16K);
33#endif /* ifdef CONFIG_SOC_IMX25 */ 35#endif /* ifdef CONFIG_SOC_IMX25 */
34 36
35#ifdef CONFIG_SOC_IMX27 37#ifdef CONFIG_SOC_IMX27
36const struct imx_imx_fb_data imx27_imx_fb_data __initconst = 38const struct imx_imx_fb_data imx27_imx_fb_data __initconst =
37 imx_imx_fb_data_entry_single(MX27, SZ_4K); 39 imx_imx_fb_data_entry_single(MX27, "imx21-fb", SZ_4K);
38#endif /* ifdef CONFIG_SOC_IMX27 */ 40#endif /* ifdef CONFIG_SOC_IMX27 */
39 41
40struct platform_device *__init imx_add_imx_fb( 42struct platform_device *__init imx_add_imx_fb(
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/mach-imx/devices/platform-imx-i2c.c
index 19ad580c0be3..8e30e5703cd2 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-i2c.c
+++ b/arch/arm/mach-imx/devices/platform-imx-i2c.c
@@ -6,34 +6,35 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size) \ 12#define imx_imx_i2c_data_entry_single(soc, _devid, _id, _hwid, _size) \
13 { \ 13 { \
14 .devid = _devid, \
14 .id = _id, \ 15 .id = _id, \
15 .iobase = soc ## _I2C ## _hwid ## _BASE_ADDR, \ 16 .iobase = soc ## _I2C ## _hwid ## _BASE_ADDR, \
16 .iosize = _size, \ 17 .iosize = _size, \
17 .irq = soc ## _INT_I2C ## _hwid, \ 18 .irq = soc ## _INT_I2C ## _hwid, \
18 } 19 }
19 20
20#define imx_imx_i2c_data_entry(soc, _id, _hwid, _size) \ 21#define imx_imx_i2c_data_entry(soc, _devid, _id, _hwid, _size) \
21 [_id] = imx_imx_i2c_data_entry_single(soc, _id, _hwid, _size) 22 [_id] = imx_imx_i2c_data_entry_single(soc, _devid, _id, _hwid, _size)
22 23
23#ifdef CONFIG_SOC_IMX1 24#ifdef CONFIG_SOC_IMX1
24const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst = 25const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst =
25 imx_imx_i2c_data_entry_single(MX1, 0, , SZ_4K); 26 imx_imx_i2c_data_entry_single(MX1, "imx1-i2c", 0, , SZ_4K);
26#endif /* ifdef CONFIG_SOC_IMX1 */ 27#endif /* ifdef CONFIG_SOC_IMX1 */
27 28
28#ifdef CONFIG_SOC_IMX21 29#ifdef CONFIG_SOC_IMX21
29const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst = 30const struct imx_imx_i2c_data imx21_imx_i2c_data __initconst =
30 imx_imx_i2c_data_entry_single(MX21, 0, , SZ_4K); 31 imx_imx_i2c_data_entry_single(MX21, "imx21-i2c", 0, , SZ_4K);
31#endif /* ifdef CONFIG_SOC_IMX21 */ 32#endif /* ifdef CONFIG_SOC_IMX21 */
32 33
33#ifdef CONFIG_SOC_IMX25 34#ifdef CONFIG_SOC_IMX25
34const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = { 35const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = {
35#define imx25_imx_i2c_data_entry(_id, _hwid) \ 36#define imx25_imx_i2c_data_entry(_id, _hwid) \
36 imx_imx_i2c_data_entry(MX25, _id, _hwid, SZ_16K) 37 imx_imx_i2c_data_entry(MX25, "imx21-i2c", _id, _hwid, SZ_16K)
37 imx25_imx_i2c_data_entry(0, 1), 38 imx25_imx_i2c_data_entry(0, 1),
38 imx25_imx_i2c_data_entry(1, 2), 39 imx25_imx_i2c_data_entry(1, 2),
39 imx25_imx_i2c_data_entry(2, 3), 40 imx25_imx_i2c_data_entry(2, 3),
@@ -43,7 +44,7 @@ const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst = {
43#ifdef CONFIG_SOC_IMX27 44#ifdef CONFIG_SOC_IMX27
44const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = { 45const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = {
45#define imx27_imx_i2c_data_entry(_id, _hwid) \ 46#define imx27_imx_i2c_data_entry(_id, _hwid) \
46 imx_imx_i2c_data_entry(MX27, _id, _hwid, SZ_4K) 47 imx_imx_i2c_data_entry(MX27, "imx21-i2c", _id, _hwid, SZ_4K)
47 imx27_imx_i2c_data_entry(0, 1), 48 imx27_imx_i2c_data_entry(0, 1),
48 imx27_imx_i2c_data_entry(1, 2), 49 imx27_imx_i2c_data_entry(1, 2),
49}; 50};
@@ -52,7 +53,7 @@ const struct imx_imx_i2c_data imx27_imx_i2c_data[] __initconst = {
52#ifdef CONFIG_SOC_IMX31 53#ifdef CONFIG_SOC_IMX31
53const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = { 54const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = {
54#define imx31_imx_i2c_data_entry(_id, _hwid) \ 55#define imx31_imx_i2c_data_entry(_id, _hwid) \
55 imx_imx_i2c_data_entry(MX31, _id, _hwid, SZ_4K) 56 imx_imx_i2c_data_entry(MX31, "imx21-i2c", _id, _hwid, SZ_4K)
56 imx31_imx_i2c_data_entry(0, 1), 57 imx31_imx_i2c_data_entry(0, 1),
57 imx31_imx_i2c_data_entry(1, 2), 58 imx31_imx_i2c_data_entry(1, 2),
58 imx31_imx_i2c_data_entry(2, 3), 59 imx31_imx_i2c_data_entry(2, 3),
@@ -62,7 +63,7 @@ const struct imx_imx_i2c_data imx31_imx_i2c_data[] __initconst = {
62#ifdef CONFIG_SOC_IMX35 63#ifdef CONFIG_SOC_IMX35
63const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = { 64const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
64#define imx35_imx_i2c_data_entry(_id, _hwid) \ 65#define imx35_imx_i2c_data_entry(_id, _hwid) \
65 imx_imx_i2c_data_entry(MX35, _id, _hwid, SZ_4K) 66 imx_imx_i2c_data_entry(MX35, "imx21-i2c", _id, _hwid, SZ_4K)
66 imx35_imx_i2c_data_entry(0, 1), 67 imx35_imx_i2c_data_entry(0, 1),
67 imx35_imx_i2c_data_entry(1, 2), 68 imx35_imx_i2c_data_entry(1, 2),
68 imx35_imx_i2c_data_entry(2, 3), 69 imx35_imx_i2c_data_entry(2, 3),
@@ -72,7 +73,7 @@ const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
72#ifdef CONFIG_SOC_IMX50 73#ifdef CONFIG_SOC_IMX50
73const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = { 74const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
74#define imx50_imx_i2c_data_entry(_id, _hwid) \ 75#define imx50_imx_i2c_data_entry(_id, _hwid) \
75 imx_imx_i2c_data_entry(MX50, _id, _hwid, SZ_4K) 76 imx_imx_i2c_data_entry(MX50, "imx21-i2c", _id, _hwid, SZ_4K)
76 imx50_imx_i2c_data_entry(0, 1), 77 imx50_imx_i2c_data_entry(0, 1),
77 imx50_imx_i2c_data_entry(1, 2), 78 imx50_imx_i2c_data_entry(1, 2),
78 imx50_imx_i2c_data_entry(2, 3), 79 imx50_imx_i2c_data_entry(2, 3),
@@ -82,10 +83,11 @@ const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
82#ifdef CONFIG_SOC_IMX51 83#ifdef CONFIG_SOC_IMX51
83const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = { 84const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
84#define imx51_imx_i2c_data_entry(_id, _hwid) \ 85#define imx51_imx_i2c_data_entry(_id, _hwid) \
85 imx_imx_i2c_data_entry(MX51, _id, _hwid, SZ_4K) 86 imx_imx_i2c_data_entry(MX51, "imx21-i2c", _id, _hwid, SZ_4K)
86 imx51_imx_i2c_data_entry(0, 1), 87 imx51_imx_i2c_data_entry(0, 1),
87 imx51_imx_i2c_data_entry(1, 2), 88 imx51_imx_i2c_data_entry(1, 2),
88 { 89 {
90 .devid = "imx21-i2c",
89 .id = 2, 91 .id = 2,
90 .iobase = MX51_HSI2C_DMA_BASE_ADDR, 92 .iobase = MX51_HSI2C_DMA_BASE_ADDR,
91 .iosize = SZ_16K, 93 .iosize = SZ_16K,
@@ -97,7 +99,7 @@ const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
97#ifdef CONFIG_SOC_IMX53 99#ifdef CONFIG_SOC_IMX53
98const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst = { 100const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst = {
99#define imx53_imx_i2c_data_entry(_id, _hwid) \ 101#define imx53_imx_i2c_data_entry(_id, _hwid) \
100 imx_imx_i2c_data_entry(MX53, _id, _hwid, SZ_4K) 102 imx_imx_i2c_data_entry(MX53, "imx21-i2c", _id, _hwid, SZ_4K)
101 imx53_imx_i2c_data_entry(0, 1), 103 imx53_imx_i2c_data_entry(0, 1),
102 imx53_imx_i2c_data_entry(1, 2), 104 imx53_imx_i2c_data_entry(1, 2),
103 imx53_imx_i2c_data_entry(2, 3), 105 imx53_imx_i2c_data_entry(2, 3),
@@ -120,7 +122,7 @@ struct platform_device *__init imx_add_imx_i2c(
120 }, 122 },
121 }; 123 };
122 124
123 return imx_add_platform_device("imx-i2c", data->id, 125 return imx_add_platform_device(data->devid, data->id,
124 res, ARRAY_SIZE(res), 126 res, ARRAY_SIZE(res),
125 pdata, sizeof(*pdata)); 127 pdata, sizeof(*pdata));
126} 128}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-keypad.c b/arch/arm/mach-imx/devices/platform-imx-keypad.c
index 479c3e9f771f..8f22a4c98a4c 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-keypad.c
+++ b/arch/arm/mach-imx/devices/platform-imx-keypad.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_imx_keypad_data_entry_single(soc, _size) \ 12#define imx_imx_keypad_data_entry_single(soc, _size) \
13 { \ 13 { \
diff --git a/arch/arm/plat-mxc/devices/platform-imx-ssi.c b/arch/arm/mach-imx/devices/platform-imx-ssi.c
index 21c6f30e1017..bfcb8f3dfa8d 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-ssi.c
+++ b/arch/arm/mach-imx/devices/platform-imx-ssi.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_imx_ssi_data_entry(soc, _id, _hwid, _size) \ 12#define imx_imx_ssi_data_entry(soc, _id, _hwid, _size) \
13 [_id] = { \ 13 [_id] = { \
diff --git a/arch/arm/plat-mxc/devices/platform-imx-uart.c b/arch/arm/mach-imx/devices/platform-imx-uart.c
index d390f00bd294..67bf866a2cb6 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-uart.c
+++ b/arch/arm/mach-imx/devices/platform-imx-uart.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_imx_uart_3irq_data_entry(soc, _id, _hwid, _size) \ 12#define imx_imx_uart_3irq_data_entry(soc, _id, _hwid, _size) \
13 [_id] = { \ 13 [_id] = { \
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/mach-imx/devices/platform-imx2-wdt.c
index 5e07ef2bf1c4..ec75d6413686 100644
--- a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
+++ b/arch/arm/mach-imx/devices/platform-imx2-wdt.c
@@ -7,8 +7,9 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <asm/sizes.h> 9#include <asm/sizes.h>
10#include <mach/hardware.h> 10
11#include <mach/devices-common.h> 11#include "../hardware.h"
12#include "devices-common.h"
12 13
13#define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \ 14#define imx_imx2_wdt_data_entry_single(soc, _id, _hwid, _size) \
14 { \ 15 { \
diff --git a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c b/arch/arm/mach-imx/devices/platform-imx21-hcd.c
index 5770a42f33bf..30c81616a9a1 100644
--- a/arch/arm/plat-mxc/devices/platform-imx21-hcd.c
+++ b/arch/arm/mach-imx/devices/platform-imx21-hcd.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_imx21_hcd_data_entry_single(soc) \ 12#define imx_imx21_hcd_data_entry_single(soc) \
13 { \ 13 { \
diff --git a/arch/arm/plat-mxc/devices/platform-imx27-coda.c b/arch/arm/mach-imx/devices/platform-imx27-coda.c
index 8b12aacdf396..25bebc29e546 100644
--- a/arch/arm/plat-mxc/devices/platform-imx27-coda.c
+++ b/arch/arm/mach-imx/devices/platform-imx27-coda.c
@@ -7,8 +7,8 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9 9
10#include <mach/hardware.h> 10#include "../hardware.h"
11#include <mach/devices-common.h> 11#include "devices-common.h"
12 12
13#ifdef CONFIG_SOC_IMX27 13#ifdef CONFIG_SOC_IMX27
14const struct imx_imx27_coda_data imx27_coda_data __initconst = { 14const struct imx_imx27_coda_data imx27_coda_data __initconst = {
diff --git a/arch/arm/plat-mxc/devices/platform-imx_udc.c b/arch/arm/mach-imx/devices/platform-imx_udc.c
index 6fd675dfce14..5ced7e4e2c71 100644
--- a/arch/arm/plat-mxc/devices/platform-imx_udc.c
+++ b/arch/arm/mach-imx/devices/platform-imx_udc.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_imx_udc_data_entry_single(soc, _size) \ 12#define imx_imx_udc_data_entry_single(soc, _size) \
13 { \ 13 { \
diff --git a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c b/arch/arm/mach-imx/devices/platform-imxdi_rtc.c
index 805336fdc252..5bb490d556ea 100644
--- a/arch/arm/plat-mxc/devices/platform-imxdi_rtc.c
+++ b/arch/arm/mach-imx/devices/platform-imxdi_rtc.c
@@ -7,8 +7,9 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <asm/sizes.h> 9#include <asm/sizes.h>
10#include <mach/hardware.h> 10
11#include <mach/devices-common.h> 11#include "../hardware.h"
12#include "devices-common.h"
12 13
13#define imx_imxdi_rtc_data_entry_single(soc) \ 14#define imx_imxdi_rtc_data_entry_single(soc) \
14 { \ 15 { \
diff --git a/arch/arm/plat-mxc/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
index d1e33cc6f12e..fc4dd7cedc11 100644
--- a/arch/arm/plat-mxc/devices/platform-ipu-core.c
+++ b/arch/arm/mach-imx/devices/platform-ipu-core.c
@@ -7,8 +7,9 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <linux/dma-mapping.h> 9#include <linux/dma-mapping.h>
10#include <mach/hardware.h> 10
11#include <mach/devices-common.h> 11#include "../hardware.h"
12#include "devices-common.h"
12 13
13#define imx_ipu_core_entry_single(soc) \ 14#define imx_ipu_core_entry_single(soc) \
14{ \ 15{ \
diff --git a/arch/arm/plat-mxc/devices/platform-mx1-camera.c b/arch/arm/mach-imx/devices/platform-mx1-camera.c
index edcc581a30a9..2c6788131080 100644
--- a/arch/arm/plat-mxc/devices/platform-mx1-camera.c
+++ b/arch/arm/mach-imx/devices/platform-mx1-camera.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_mx1_camera_data_entry_single(soc, _size) \ 12#define imx_mx1_camera_data_entry_single(soc, _size) \
13 { \ 13 { \
diff --git a/arch/arm/plat-mxc/devices/platform-mx2-camera.c b/arch/arm/mach-imx/devices/platform-mx2-camera.c
index 11eace953a09..f4910160346b 100644
--- a/arch/arm/plat-mxc/devices/platform-mx2-camera.c
+++ b/arch/arm/mach-imx/devices/platform-mx2-camera.c
@@ -6,17 +6,19 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_mx2_camera_data_entry_single(soc) \ 12#define imx_mx2_camera_data_entry_single(soc, _devid) \
13 { \ 13 { \
14 .devid = _devid, \
14 .iobasecsi = soc ## _CSI_BASE_ADDR, \ 15 .iobasecsi = soc ## _CSI_BASE_ADDR, \
15 .iosizecsi = SZ_4K, \ 16 .iosizecsi = SZ_4K, \
16 .irqcsi = soc ## _INT_CSI, \ 17 .irqcsi = soc ## _INT_CSI, \
17 } 18 }
18#define imx_mx2_camera_data_entry_single_emma(soc) \ 19#define imx_mx2_camera_data_entry_single_emma(soc, _devid) \
19 { \ 20 { \
21 .devid = _devid, \
20 .iobasecsi = soc ## _CSI_BASE_ADDR, \ 22 .iobasecsi = soc ## _CSI_BASE_ADDR, \
21 .iosizecsi = SZ_32, \ 23 .iosizecsi = SZ_32, \
22 .irqcsi = soc ## _INT_CSI, \ 24 .irqcsi = soc ## _INT_CSI, \
@@ -27,12 +29,12 @@
27 29
28#ifdef CONFIG_SOC_IMX25 30#ifdef CONFIG_SOC_IMX25
29const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst = 31const struct imx_mx2_camera_data imx25_mx2_camera_data __initconst =
30 imx_mx2_camera_data_entry_single(MX25); 32 imx_mx2_camera_data_entry_single(MX25, "imx25-camera");
31#endif /* ifdef CONFIG_SOC_IMX25 */ 33#endif /* ifdef CONFIG_SOC_IMX25 */
32 34
33#ifdef CONFIG_SOC_IMX27 35#ifdef CONFIG_SOC_IMX27
34const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst = 36const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst =
35 imx_mx2_camera_data_entry_single_emma(MX27); 37 imx_mx2_camera_data_entry_single_emma(MX27, "imx27-camera");
36#endif /* ifdef CONFIG_SOC_IMX27 */ 38#endif /* ifdef CONFIG_SOC_IMX27 */
37 39
38struct platform_device *__init imx_add_mx2_camera( 40struct platform_device *__init imx_add_mx2_camera(
@@ -58,7 +60,7 @@ struct platform_device *__init imx_add_mx2_camera(
58 .flags = IORESOURCE_IRQ, 60 .flags = IORESOURCE_IRQ,
59 }, 61 },
60 }; 62 };
61 return imx_add_platform_device_dmamask("mx2-camera", 0, 63 return imx_add_platform_device_dmamask(data->devid, 0,
62 res, data->iobaseemmaprp ? 4 : 2, 64 res, data->iobaseemmaprp ? 4 : 2,
63 pdata, sizeof(*pdata), DMA_BIT_MASK(32)); 65 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
64} 66}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c b/arch/arm/mach-imx/devices/platform-mxc-ehci.c
index 35851d889aca..5d4bbbfde641 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c
+++ b/arch/arm/mach-imx/devices/platform-mxc-ehci.c
@@ -7,8 +7,9 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <linux/dma-mapping.h> 9#include <linux/dma-mapping.h>
10#include <mach/hardware.h> 10
11#include <mach/devices-common.h> 11#include "../hardware.h"
12#include "devices-common.h"
12 13
13#define imx_mxc_ehci_data_entry_single(soc, _id, hs) \ 14#define imx_mxc_ehci_data_entry_single(soc, _id, hs) \
14 { \ 15 { \
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c b/arch/arm/mach-imx/devices/platform-mxc-mmc.c
index e7b920b58675..b8203c760c8f 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc-mmc.c
@@ -7,24 +7,26 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <linux/dma-mapping.h> 9#include <linux/dma-mapping.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12 10
13#define imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) \ 11#include "../hardware.h"
12#include "devices-common.h"
13
14#define imx_mxc_mmc_data_entry_single(soc, _devid, _id, _hwid, _size) \
14 { \ 15 { \
16 .devid = _devid, \
15 .id = _id, \ 17 .id = _id, \
16 .iobase = soc ## _SDHC ## _hwid ## _BASE_ADDR, \ 18 .iobase = soc ## _SDHC ## _hwid ## _BASE_ADDR, \
17 .iosize = _size, \ 19 .iosize = _size, \
18 .irq = soc ## _INT_SDHC ## _hwid, \ 20 .irq = soc ## _INT_SDHC ## _hwid, \
19 .dmareq = soc ## _DMA_REQ_SDHC ## _hwid, \ 21 .dmareq = soc ## _DMA_REQ_SDHC ## _hwid, \
20 } 22 }
21#define imx_mxc_mmc_data_entry(soc, _id, _hwid, _size) \ 23#define imx_mxc_mmc_data_entry(soc, _devid, _id, _hwid, _size) \
22 [_id] = imx_mxc_mmc_data_entry_single(soc, _id, _hwid, _size) 24 [_id] = imx_mxc_mmc_data_entry_single(soc, _devid, _id, _hwid, _size)
23 25
24#ifdef CONFIG_SOC_IMX21 26#ifdef CONFIG_SOC_IMX21
25const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = { 27const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = {
26#define imx21_mxc_mmc_data_entry(_id, _hwid) \ 28#define imx21_mxc_mmc_data_entry(_id, _hwid) \
27 imx_mxc_mmc_data_entry(MX21, _id, _hwid, SZ_4K) 29 imx_mxc_mmc_data_entry(MX21, "imx21-mmc", _id, _hwid, SZ_4K)
28 imx21_mxc_mmc_data_entry(0, 1), 30 imx21_mxc_mmc_data_entry(0, 1),
29 imx21_mxc_mmc_data_entry(1, 2), 31 imx21_mxc_mmc_data_entry(1, 2),
30}; 32};
@@ -33,7 +35,7 @@ const struct imx_mxc_mmc_data imx21_mxc_mmc_data[] __initconst = {
33#ifdef CONFIG_SOC_IMX27 35#ifdef CONFIG_SOC_IMX27
34const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = { 36const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = {
35#define imx27_mxc_mmc_data_entry(_id, _hwid) \ 37#define imx27_mxc_mmc_data_entry(_id, _hwid) \
36 imx_mxc_mmc_data_entry(MX27, _id, _hwid, SZ_4K) 38 imx_mxc_mmc_data_entry(MX27, "imx21-mmc", _id, _hwid, SZ_4K)
37 imx27_mxc_mmc_data_entry(0, 1), 39 imx27_mxc_mmc_data_entry(0, 1),
38 imx27_mxc_mmc_data_entry(1, 2), 40 imx27_mxc_mmc_data_entry(1, 2),
39}; 41};
@@ -42,7 +44,7 @@ const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst = {
42#ifdef CONFIG_SOC_IMX31 44#ifdef CONFIG_SOC_IMX31
43const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst = { 45const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst = {
44#define imx31_mxc_mmc_data_entry(_id, _hwid) \ 46#define imx31_mxc_mmc_data_entry(_id, _hwid) \
45 imx_mxc_mmc_data_entry(MX31, _id, _hwid, SZ_16K) 47 imx_mxc_mmc_data_entry(MX31, "imx31-mmc", _id, _hwid, SZ_16K)
46 imx31_mxc_mmc_data_entry(0, 1), 48 imx31_mxc_mmc_data_entry(0, 1),
47 imx31_mxc_mmc_data_entry(1, 2), 49 imx31_mxc_mmc_data_entry(1, 2),
48}; 50};
@@ -67,7 +69,7 @@ struct platform_device *__init imx_add_mxc_mmc(
67 .flags = IORESOURCE_DMA, 69 .flags = IORESOURCE_DMA,
68 }, 70 },
69 }; 71 };
70 return imx_add_platform_device_dmamask("mxc-mmc", data->id, 72 return imx_add_platform_device_dmamask(data->devid, data->id,
71 res, ARRAY_SIZE(res), 73 res, ARRAY_SIZE(res),
72 pdata, sizeof(*pdata), DMA_BIT_MASK(32)); 74 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
73} 75}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_nand.c b/arch/arm/mach-imx/devices/platform-mxc_nand.c
index 95b75cc70515..7af1c53e42b5 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_nand.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_nand.c
@@ -7,18 +7,21 @@
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <asm/sizes.h> 9#include <asm/sizes.h>
10#include <mach/hardware.h>
11#include <mach/devices-common.h>
12 10
13#define imx_mxc_nand_data_entry_single(soc, _size) \ 11#include "../hardware.h"
12#include "devices-common.h"
13
14#define imx_mxc_nand_data_entry_single(soc, _devid, _size) \
14 { \ 15 { \
16 .devid = _devid, \
15 .iobase = soc ## _NFC_BASE_ADDR, \ 17 .iobase = soc ## _NFC_BASE_ADDR, \
16 .iosize = _size, \ 18 .iosize = _size, \
17 .irq = soc ## _INT_NFC \ 19 .irq = soc ## _INT_NFC \
18 } 20 }
19 21
20#define imx_mxc_nandv3_data_entry_single(soc, _size) \ 22#define imx_mxc_nandv3_data_entry_single(soc, _devid, _size) \
21 { \ 23 { \
24 .devid = _devid, \
22 .id = -1, \ 25 .id = -1, \
23 .iobase = soc ## _NFC_BASE_ADDR, \ 26 .iobase = soc ## _NFC_BASE_ADDR, \
24 .iosize = _size, \ 27 .iosize = _size, \
@@ -28,32 +31,32 @@
28 31
29#ifdef CONFIG_SOC_IMX21 32#ifdef CONFIG_SOC_IMX21
30const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst = 33const struct imx_mxc_nand_data imx21_mxc_nand_data __initconst =
31 imx_mxc_nand_data_entry_single(MX21, SZ_4K); 34 imx_mxc_nand_data_entry_single(MX21, "imx21-nand", SZ_4K);
32#endif /* ifdef CONFIG_SOC_IMX21 */ 35#endif /* ifdef CONFIG_SOC_IMX21 */
33 36
34#ifdef CONFIG_SOC_IMX25 37#ifdef CONFIG_SOC_IMX25
35const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst = 38const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst =
36 imx_mxc_nand_data_entry_single(MX25, SZ_8K); 39 imx_mxc_nand_data_entry_single(MX25, "imx25-nand", SZ_8K);
37#endif /* ifdef CONFIG_SOC_IMX25 */ 40#endif /* ifdef CONFIG_SOC_IMX25 */
38 41
39#ifdef CONFIG_SOC_IMX27 42#ifdef CONFIG_SOC_IMX27
40const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst = 43const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst =
41 imx_mxc_nand_data_entry_single(MX27, SZ_4K); 44 imx_mxc_nand_data_entry_single(MX27, "imx27-nand", SZ_4K);
42#endif /* ifdef CONFIG_SOC_IMX27 */ 45#endif /* ifdef CONFIG_SOC_IMX27 */
43 46
44#ifdef CONFIG_SOC_IMX31 47#ifdef CONFIG_SOC_IMX31
45const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst = 48const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst =
46 imx_mxc_nand_data_entry_single(MX31, SZ_4K); 49 imx_mxc_nand_data_entry_single(MX31, "imx27-nand", SZ_4K);
47#endif 50#endif
48 51
49#ifdef CONFIG_SOC_IMX35 52#ifdef CONFIG_SOC_IMX35
50const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst = 53const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst =
51 imx_mxc_nand_data_entry_single(MX35, SZ_8K); 54 imx_mxc_nand_data_entry_single(MX35, "imx25-nand", SZ_8K);
52#endif 55#endif
53 56
54#ifdef CONFIG_SOC_IMX51 57#ifdef CONFIG_SOC_IMX51
55const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst = 58const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst =
56 imx_mxc_nandv3_data_entry_single(MX51, SZ_16K); 59 imx_mxc_nandv3_data_entry_single(MX51, "imx51-nand", SZ_16K);
57#endif 60#endif
58 61
59struct platform_device *__init imx_add_mxc_nand( 62struct platform_device *__init imx_add_mxc_nand(
@@ -76,7 +79,7 @@ struct platform_device *__init imx_add_mxc_nand(
76 .flags = IORESOURCE_MEM, 79 .flags = IORESOURCE_MEM,
77 }, 80 },
78 }; 81 };
79 return imx_add_platform_device("mxc_nand", data->id, 82 return imx_add_platform_device(data->devid, data->id,
80 res, ARRAY_SIZE(res) - !data->axibase, 83 res, ARRAY_SIZE(res) - !data->axibase,
81 pdata, sizeof(*pdata)); 84 pdata, sizeof(*pdata));
82} 85}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c b/arch/arm/mach-imx/devices/platform-mxc_pwm.c
index b0c4ae298111..dcd289777687 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_pwm.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_pwm.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \ 12#define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \
13 { \ 13 { \
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
index b4b7612b6e17..c58404badb59 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_rnga.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rnga.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12struct imx_mxc_rnga_data { 12struct imx_mxc_rnga_data {
13 resource_size_t iobase; 13 resource_size_t iobase;
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
index a5c9ad5721c2..c7fffaadf847 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_rtc.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_rtc.c
@@ -6,23 +6,24 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_mxc_rtc_data_entry_single(soc) \ 12#define imx_mxc_rtc_data_entry_single(soc, _devid) \
13 { \ 13 { \
14 .devid = _devid, \
14 .iobase = soc ## _RTC_BASE_ADDR, \ 15 .iobase = soc ## _RTC_BASE_ADDR, \
15 .irq = soc ## _INT_RTC, \ 16 .irq = soc ## _INT_RTC, \
16 } 17 }
17 18
18#ifdef CONFIG_SOC_IMX31 19#ifdef CONFIG_SOC_IMX31
19const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst = 20const struct imx_mxc_rtc_data imx31_mxc_rtc_data __initconst =
20 imx_mxc_rtc_data_entry_single(MX31); 21 imx_mxc_rtc_data_entry_single(MX31, "imx21-rtc");
21#endif /* ifdef CONFIG_SOC_IMX31 */ 22#endif /* ifdef CONFIG_SOC_IMX31 */
22 23
23#ifdef CONFIG_SOC_IMX35 24#ifdef CONFIG_SOC_IMX35
24const struct imx_mxc_rtc_data imx35_mxc_rtc_data __initconst = 25const struct imx_mxc_rtc_data imx35_mxc_rtc_data __initconst =
25 imx_mxc_rtc_data_entry_single(MX35); 26 imx_mxc_rtc_data_entry_single(MX35, "imx21-rtc");
26#endif /* ifdef CONFIG_SOC_IMX35 */ 27#endif /* ifdef CONFIG_SOC_IMX35 */
27 28
28struct platform_device *__init imx_add_mxc_rtc( 29struct platform_device *__init imx_add_mxc_rtc(
@@ -40,6 +41,6 @@ struct platform_device *__init imx_add_mxc_rtc(
40 }, 41 },
41 }; 42 };
42 43
43 return imx_add_platform_device("mxc_rtc", -1, 44 return imx_add_platform_device(data->devid, -1,
44 res, ARRAY_SIZE(res), NULL, 0); 45 res, ARRAY_SIZE(res), NULL, 0);
45} 46}
diff --git a/arch/arm/plat-mxc/devices/platform-mxc_w1.c b/arch/arm/mach-imx/devices/platform-mxc_w1.c
index 96fa5ea91fe8..88c18b720d63 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc_w1.c
+++ b/arch/arm/mach-imx/devices/platform-mxc_w1.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_mxc_w1_data_entry_single(soc) \ 12#define imx_mxc_w1_data_entry_single(soc) \
13 { \ 13 { \
diff --git a/arch/arm/plat-mxc/devices/platform-pata_imx.c b/arch/arm/mach-imx/devices/platform-pata_imx.c
index 70e2f2a44714..e4ec11c8ce55 100644
--- a/arch/arm/plat-mxc/devices/platform-pata_imx.c
+++ b/arch/arm/mach-imx/devices/platform-pata_imx.c
@@ -3,8 +3,8 @@
3 * the terms of the GNU General Public License version 2 as published by the 3 * the terms of the GNU General Public License version 2 as published by the
4 * Free Software Foundation. 4 * Free Software Foundation.
5 */ 5 */
6#include <mach/hardware.h> 6#include "../hardware.h"
7#include <mach/devices-common.h> 7#include "devices-common.h"
8 8
9#define imx_pata_imx_data_entry_single(soc, _size) \ 9#define imx_pata_imx_data_entry_single(soc, _size) \
10 { \ 10 { \
diff --git a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c b/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
index 3793e475cd95..e66a4e316311 100644
--- a/arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
+++ b/arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c
@@ -6,10 +6,11 @@
6 * Free Software Foundation. 6 * Free Software Foundation.
7 */ 7 */
8 8
9#include <mach/hardware.h>
10#include <mach/devices-common.h>
11#include <linux/platform_data/mmc-esdhc-imx.h> 9#include <linux/platform_data/mmc-esdhc-imx.h>
12 10
11#include "../hardware.h"
12#include "devices-common.h"
13
13#define imx_sdhci_esdhc_imx_data_entry_single(soc, _devid, _id, hwid) \ 14#define imx_sdhci_esdhc_imx_data_entry_single(soc, _devid, _id, hwid) \
14 { \ 15 { \
15 .devid = _devid, \ 16 .devid = _devid, \
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/mach-imx/devices/platform-spi_imx.c
index 9c50c14c8f92..8880bcb11e05 100644
--- a/arch/arm/plat-mxc/devices/platform-spi_imx.c
+++ b/arch/arm/mach-imx/devices/platform-spi_imx.c
@@ -6,8 +6,8 @@
6 * the terms of the GNU General Public License version 2 as published by the 6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation. 7 * Free Software Foundation.
8 */ 8 */
9#include <mach/hardware.h> 9#include "../hardware.h"
10#include <mach/devices-common.h> 10#include "devices-common.h"
11 11
12#define imx_spi_imx_data_entry_single(soc, type, _devid, _id, hwid, _size) \ 12#define imx_spi_imx_data_entry_single(soc, type, _devid, _id, hwid, _size) \
13 { \ 13 { \
diff --git a/arch/arm/mach-imx/ehci-imx25.c b/arch/arm/mach-imx/ehci-imx25.c
index 576af7446952..134c190e3003 100644
--- a/arch/arm/mach-imx/ehci-imx25.c
+++ b/arch/arm/mach-imx/ehci-imx25.c
@@ -15,10 +15,10 @@
15 15
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <linux/platform_data/usb-ehci-mxc.h> 18#include <linux/platform_data/usb-ehci-mxc.h>
21 19
20#include "hardware.h"
21
22#define USBCTRL_OTGBASE_OFFSET 0x600 22#define USBCTRL_OTGBASE_OFFSET 0x600
23 23
24#define MX25_OTG_SIC_SHIFT 29 24#define MX25_OTG_SIC_SHIFT 29
diff --git a/arch/arm/mach-imx/ehci-imx27.c b/arch/arm/mach-imx/ehci-imx27.c
index cd6e1f81508d..448d9115539d 100644
--- a/arch/arm/mach-imx/ehci-imx27.c
+++ b/arch/arm/mach-imx/ehci-imx27.c
@@ -15,10 +15,10 @@
15 15
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <linux/platform_data/usb-ehci-mxc.h> 18#include <linux/platform_data/usb-ehci-mxc.h>
21 19
20#include "hardware.h"
21
22#define USBCTRL_OTGBASE_OFFSET 0x600 22#define USBCTRL_OTGBASE_OFFSET 0x600
23 23
24#define MX27_OTG_SIC_SHIFT 29 24#define MX27_OTG_SIC_SHIFT 29
diff --git a/arch/arm/mach-imx/ehci-imx31.c b/arch/arm/mach-imx/ehci-imx31.c
index 9a880c78af34..05de4e1e39d7 100644
--- a/arch/arm/mach-imx/ehci-imx31.c
+++ b/arch/arm/mach-imx/ehci-imx31.c
@@ -15,10 +15,10 @@
15 15
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <linux/platform_data/usb-ehci-mxc.h> 18#include <linux/platform_data/usb-ehci-mxc.h>
21 19
20#include "hardware.h"
21
22#define USBCTRL_OTGBASE_OFFSET 0x600 22#define USBCTRL_OTGBASE_OFFSET 0x600
23 23
24#define MX31_OTG_SIC_SHIFT 29 24#define MX31_OTG_SIC_SHIFT 29
diff --git a/arch/arm/mach-imx/ehci-imx35.c b/arch/arm/mach-imx/ehci-imx35.c
index 293397852e4e..554e7cccff53 100644
--- a/arch/arm/mach-imx/ehci-imx35.c
+++ b/arch/arm/mach-imx/ehci-imx35.c
@@ -15,10 +15,10 @@
15 15
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <linux/platform_data/usb-ehci-mxc.h> 18#include <linux/platform_data/usb-ehci-mxc.h>
21 19
20#include "hardware.h"
21
22#define USBCTRL_OTGBASE_OFFSET 0x600 22#define USBCTRL_OTGBASE_OFFSET 0x600
23 23
24#define MX35_OTG_SIC_SHIFT 29 24#define MX35_OTG_SIC_SHIFT 29
diff --git a/arch/arm/mach-imx/ehci-imx5.c b/arch/arm/mach-imx/ehci-imx5.c
index cf8d00e5cce1..e49710b10c68 100644
--- a/arch/arm/mach-imx/ehci-imx5.c
+++ b/arch/arm/mach-imx/ehci-imx5.c
@@ -15,10 +15,10 @@
15 15
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <linux/platform_data/usb-ehci-mxc.h> 18#include <linux/platform_data/usb-ehci-mxc.h>
21 19
20#include "hardware.h"
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
24#define MXC_H2_OFFSET 0x400 24#define MXC_H2_OFFSET 0x400
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/mach-imx/epit.c
index 88726f4dbbfa..04a5961beeac 100644
--- a/arch/arm/plat-mxc/epit.c
+++ b/arch/arm/mach-imx/epit.c
@@ -51,10 +51,10 @@
51#include <linux/clockchips.h> 51#include <linux/clockchips.h>
52#include <linux/clk.h> 52#include <linux/clk.h>
53#include <linux/err.h> 53#include <linux/err.h>
54
55#include <mach/hardware.h>
56#include <asm/mach/time.h> 54#include <asm/mach/time.h>
57#include <mach/common.h> 55
56#include "common.h"
57#include "hardware.h"
58 58
59static struct clock_event_device clockevent_epit; 59static struct clock_event_device clockevent_epit;
60static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; 60static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
diff --git a/arch/arm/plat-mxc/include/mach/eukrea-baseboards.h b/arch/arm/mach-imx/eukrea-baseboards.h
index a21d3313f994..a21d3313f994 100644
--- a/arch/arm/plat-mxc/include/mach/eukrea-baseboards.h
+++ b/arch/arm/mach-imx/eukrea-baseboards.h
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index 98aef571b9f8..b4c70028d359 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -29,11 +29,10 @@
29 29
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31 31
32#include <mach/common.h> 32#include "common.h"
33#include <mach/iomux-mx27.h>
34#include <mach/hardware.h>
35
36#include "devices-imx27.h" 33#include "devices-imx27.h"
34#include "hardware.h"
35#include "iomux-mx27.h"
37 36
38static const int eukrea_mbimx27_pins[] __initconst = { 37static const int eukrea_mbimx27_pins[] __initconst = {
39 /* UART2 */ 38 /* UART2 */
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
index 0b84666792f0..e2b70f4c1a2c 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
@@ -26,14 +26,14 @@
26#include <linux/spi/spi.h> 26#include <linux/spi/spi.h>
27#include <video/platform_lcd.h> 27#include <video/platform_lcd.h>
28 28
29#include <mach/hardware.h>
30#include <mach/iomux-mx25.h>
31#include <mach/common.h>
32#include <asm/mach-types.h> 29#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
34#include <mach/mx25.h>
35 31
32#include "common.h"
36#include "devices-imx25.h" 33#include "devices-imx25.h"
34#include "hardware.h"
35#include "iomux-mx25.h"
36#include "mx25.h"
37 37
38static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { 38static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
39 /* LCD */ 39 /* LCD */
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index c6532a007d46..5a2d5ef12dd5 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -36,11 +36,10 @@
36#include <asm/mach/time.h> 36#include <asm/mach/time.h>
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38 38
39#include <mach/hardware.h> 39#include "common.h"
40#include <mach/common.h>
41#include <mach/iomux-mx35.h>
42
43#include "devices-imx35.h" 40#include "devices-imx35.h"
41#include "hardware.h"
42#include "iomux-mx35.h"
44 43
45static const struct fb_videomode fb_modedb[] = { 44static const struct fb_videomode fb_modedb[] = {
46 { 45 {
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
index 8b0de30d7a3f..9be6c1e69d68 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
@@ -36,11 +36,10 @@
36#include <asm/mach/time.h> 36#include <asm/mach/time.h>
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
38 38
39#include <mach/hardware.h> 39#include "common.h"
40#include <mach/common.h>
41#include <mach/iomux-mx51.h>
42
43#include "devices-imx51.h" 40#include "devices-imx51.h"
41#include "hardware.h"
42#include "iomux-mx51.h"
44 43
45static iomux_v3_cfg_t eukrea_mbimxsd51_pads[] = { 44static iomux_v3_cfg_t eukrea_mbimxsd51_pads[] = {
46 /* LED */ 45 /* LED */
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/mach-imx/hardware.h
index ebf10654bb42..3ce7fa3bd43f 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/mach-imx/hardware.h
@@ -105,20 +105,20 @@
105 105
106#define IMX_IO_ADDRESS(x) IOMEM(IMX_IO_P2V(x)) 106#define IMX_IO_ADDRESS(x) IOMEM(IMX_IO_P2V(x))
107 107
108#include <mach/mxc.h> 108#include "mxc.h"
109 109
110#include <mach/mx6q.h> 110#include "mx6q.h"
111#include <mach/mx50.h> 111#include "mx50.h"
112#include <mach/mx51.h> 112#include "mx51.h"
113#include <mach/mx53.h> 113#include "mx53.h"
114#include <mach/mx3x.h> 114#include "mx3x.h"
115#include <mach/mx31.h> 115#include "mx31.h"
116#include <mach/mx35.h> 116#include "mx35.h"
117#include <mach/mx2x.h> 117#include "mx2x.h"
118#include <mach/mx21.h> 118#include "mx21.h"
119#include <mach/mx27.h> 119#include "mx27.h"
120#include <mach/mx1.h> 120#include "mx1.h"
121#include <mach/mx25.h> 121#include "mx25.h"
122 122
123#define imx_map_entry(soc, name, _type) { \ 123#define imx_map_entry(soc, name, _type) { \
124 .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \ 124 .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \
diff --git a/arch/arm/mach-imx/hotplug.c b/arch/arm/mach-imx/hotplug.c
index b07b778dc9a8..3dec962b0770 100644
--- a/arch/arm/mach-imx/hotplug.c
+++ b/arch/arm/mach-imx/hotplug.c
@@ -13,7 +13,8 @@
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
15#include <asm/cp15.h> 15#include <asm/cp15.h>
16#include <mach/common.h> 16
17#include "common.h"
17 18
18static inline void cpu_enter_lowpower(void) 19static inline void cpu_enter_lowpower(void)
19{ 20{
diff --git a/arch/arm/plat-mxc/include/mach/iim.h b/arch/arm/mach-imx/iim.h
index 315bffadafda..315bffadafda 100644
--- a/arch/arm/plat-mxc/include/mach/iim.h
+++ b/arch/arm/mach-imx/iim.h
diff --git a/arch/arm/mach-imx/imx25-dt.c b/arch/arm/mach-imx/imx25-dt.c
new file mode 100644
index 000000000000..e17dfbc42192
--- /dev/null
+++ b/arch/arm/mach-imx/imx25-dt.c
@@ -0,0 +1,48 @@
1/*
2 * Copyright 2012 Sascha Hauer, Pengutronix
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#include <linux/irq.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 "common.h"
18#include "mx25.h"
19
20static void __init imx25_dt_init(void)
21{
22 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
23}
24
25static void __init imx25_timer_init(void)
26{
27 mx25_clocks_init_dt();
28}
29
30static struct sys_timer imx25_timer = {
31 .init = imx25_timer_init,
32};
33
34static const char * const imx25_dt_board_compat[] __initconst = {
35 "fsl,imx25",
36 NULL
37};
38
39DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)")
40 .map_io = mx25_map_io,
41 .init_early = imx25_init_early,
42 .init_irq = mx25_init_irq,
43 .handle_irq = imx25_handle_irq,
44 .timer = &imx25_timer,
45 .init_machine = imx25_dt_init,
46 .dt_compat = imx25_dt_board_compat,
47 .restart = mxc_restart,
48MACHINE_END
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index e80d5235dac0..ebfae96543c4 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -14,21 +14,22 @@
14#include <linux/of_platform.h> 14#include <linux/of_platform.h>
15#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
16#include <asm/mach/time.h> 16#include <asm/mach/time.h>
17#include <mach/common.h> 17
18#include <mach/mx27.h> 18#include "common.h"
19#include "mx27.h"
19 20
20static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = { 21static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
21 OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART1_BASE_ADDR, "imx21-uart.0", NULL), 22 OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART1_BASE_ADDR, "imx21-uart.0", NULL),
22 OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART2_BASE_ADDR, "imx21-uart.1", NULL), 23 OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART2_BASE_ADDR, "imx21-uart.1", NULL),
23 OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART3_BASE_ADDR, "imx21-uart.2", NULL), 24 OF_DEV_AUXDATA("fsl,imx27-uart", MX27_UART3_BASE_ADDR, "imx21-uart.2", NULL),
24 OF_DEV_AUXDATA("fsl,imx27-fec", MX27_FEC_BASE_ADDR, "imx27-fec.0", NULL), 25 OF_DEV_AUXDATA("fsl,imx27-fec", MX27_FEC_BASE_ADDR, "imx27-fec.0", NULL),
25 OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C1_BASE_ADDR, "imx-i2c.0", NULL), 26 OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C1_BASE_ADDR, "imx21-i2c.0", NULL),
26 OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C2_BASE_ADDR, "imx-i2c.1", NULL), 27 OF_DEV_AUXDATA("fsl,imx27-i2c", MX27_I2C2_BASE_ADDR, "imx21-i2c.1", NULL),
27 OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI1_BASE_ADDR, "imx27-cspi.0", NULL), 28 OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI1_BASE_ADDR, "imx27-cspi.0", NULL),
28 OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI2_BASE_ADDR, "imx27-cspi.1", NULL), 29 OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI2_BASE_ADDR, "imx27-cspi.1", NULL),
29 OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI3_BASE_ADDR, "imx27-cspi.2", NULL), 30 OF_DEV_AUXDATA("fsl,imx27-cspi", MX27_CSPI3_BASE_ADDR, "imx27-cspi.2", NULL),
30 OF_DEV_AUXDATA("fsl,imx27-wdt", MX27_WDOG_BASE_ADDR, "imx2-wdt.0", NULL), 31 OF_DEV_AUXDATA("fsl,imx27-wdt", MX27_WDOG_BASE_ADDR, "imx2-wdt.0", NULL),
31 OF_DEV_AUXDATA("fsl,imx27-nand", MX27_NFC_BASE_ADDR, "mxc_nand.0", NULL), 32 OF_DEV_AUXDATA("fsl,imx27-nand", MX27_NFC_BASE_ADDR, "imx27-nand.0", NULL),
32 { /* sentinel */ } 33 { /* sentinel */ }
33}; 34};
34 35
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c
index a68ba207b2b7..af476de2570e 100644
--- a/arch/arm/mach-imx/imx31-dt.c
+++ b/arch/arm/mach-imx/imx31-dt.c
@@ -14,8 +14,9 @@
14#include <linux/of_platform.h> 14#include <linux/of_platform.h>
15#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
16#include <asm/mach/time.h> 16#include <asm/mach/time.h>
17#include <mach/common.h> 17
18#include <mach/mx31.h> 18#include "common.h"
19#include "mx31.h"
19 20
20static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = { 21static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = {
21 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR, 22 OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR,
diff --git a/arch/arm/mach-imx/imx51-dt.c b/arch/arm/mach-imx/imx51-dt.c
index f233b4bb2342..50742990a136 100644
--- a/arch/arm/mach-imx/imx51-dt.c
+++ b/arch/arm/mach-imx/imx51-dt.c
@@ -15,8 +15,9 @@
15#include <linux/of_platform.h> 15#include <linux/of_platform.h>
16#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
17#include <asm/mach/time.h> 17#include <asm/mach/time.h>
18#include <mach/common.h> 18
19#include <mach/mx51.h> 19#include "common.h"
20#include "mx51.h"
20 21
21/* 22/*
22 * Lookup table for attaching a specific name and platform_data pointer to 23 * Lookup table for attaching a specific name and platform_data pointer to
@@ -36,8 +37,8 @@ static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = {
36 OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL), 37 OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL),
37 OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL), 38 OF_DEV_AUXDATA("fsl,imx51-ecspi", MX51_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL),
38 OF_DEV_AUXDATA("fsl,imx51-cspi", MX51_CSPI_BASE_ADDR, "imx35-cspi.0", NULL), 39 OF_DEV_AUXDATA("fsl,imx51-cspi", MX51_CSPI_BASE_ADDR, "imx35-cspi.0", NULL),
39 OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C1_BASE_ADDR, "imx-i2c.0", NULL), 40 OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C1_BASE_ADDR, "imx21-i2c.0", NULL),
40 OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C2_BASE_ADDR, "imx-i2c.1", NULL), 41 OF_DEV_AUXDATA("fsl,imx51-i2c", MX51_I2C2_BASE_ADDR, "imx21-i2c.1", NULL),
41 OF_DEV_AUXDATA("fsl,imx51-sdma", MX51_SDMA_BASE_ADDR, "imx35-sdma", NULL), 42 OF_DEV_AUXDATA("fsl,imx51-sdma", MX51_SDMA_BASE_ADDR, "imx35-sdma", NULL),
42 OF_DEV_AUXDATA("fsl,imx51-wdt", MX51_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL), 43 OF_DEV_AUXDATA("fsl,imx51-wdt", MX51_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL),
43 { /* sentinel */ } 44 { /* sentinel */ }
diff --git a/arch/arm/mach-imx/include/mach/dma-mx1-mx2.h b/arch/arm/mach-imx/include/mach/dma-mx1-mx2.h
deleted file mode 100644
index df5f522da6b3..000000000000
--- a/arch/arm/mach-imx/include/mach/dma-mx1-mx2.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __MACH_DMA_MX1_MX2_H__
2#define __MACH_DMA_MX1_MX2_H__
3/*
4 * Don't use this header in new code, it will go away when all users are
5 * converted to mach/dma-v1.h
6 */
7
8#include <mach/dma-v1.h>
9
10#endif /* ifndef __MACH_DMA_MX1_MX2_H__ */
diff --git a/arch/arm/mach-imx/iomux-imx31.c b/arch/arm/mach-imx/iomux-imx31.c
index 82bd4403b450..cabefbc5e7c1 100644
--- a/arch/arm/mach-imx/iomux-imx31.c
+++ b/arch/arm/mach-imx/iomux-imx31.c
@@ -22,8 +22,9 @@
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <mach/hardware.h> 25
26#include <mach/iomux-mx3.h> 26#include "hardware.h"
27#include "iomux-mx3.h"
27 28
28/* 29/*
29 * IOMUX register (base) addresses 30 * IOMUX register (base) addresses
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1.h b/arch/arm/mach-imx/iomux-mx1.h
index 6b1507cf378e..95f4681d85d7 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx1.h
+++ b/arch/arm/mach-imx/iomux-mx1.h
@@ -18,7 +18,7 @@
18#ifndef __MACH_IOMUX_MX1_H__ 18#ifndef __MACH_IOMUX_MX1_H__
19#define __MACH_IOMUX_MX1_H__ 19#define __MACH_IOMUX_MX1_H__
20 20
21#include <mach/iomux-v1.h> 21#include "iomux-v1.h"
22 22
23#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0) 23#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0)
24#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0) 24#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx21.h b/arch/arm/mach-imx/iomux-mx21.h
index 1495dfda7834..a70cffceb085 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx21.h
+++ b/arch/arm/mach-imx/iomux-mx21.h
@@ -18,8 +18,8 @@
18#ifndef __MACH_IOMUX_MX21_H__ 18#ifndef __MACH_IOMUX_MX21_H__
19#define __MACH_IOMUX_MX21_H__ 19#define __MACH_IOMUX_MX21_H__
20 20
21#include <mach/iomux-mx2x.h> 21#include "iomux-mx2x.h"
22#include <mach/iomux-v1.h> 22#include "iomux-v1.h"
23 23
24/* Primary GPIO pin functions */ 24/* Primary GPIO pin functions */
25 25
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx25.h b/arch/arm/mach-imx/iomux-mx25.h
index c61ec0fc10d4..be51e838375c 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx25.h
+++ b/arch/arm/mach-imx/iomux-mx25.h
@@ -19,7 +19,7 @@
19#ifndef __MACH_IOMUX_MX25_H__ 19#ifndef __MACH_IOMUX_MX25_H__
20#define __MACH_IOMUX_MX25_H__ 20#define __MACH_IOMUX_MX25_H__
21 21
22#include <mach/iomux-v3.h> 22#include "iomux-v3.h"
23 23
24/* 24/*
25 * IOMUX/PAD Bit field definitions 25 * IOMUX/PAD Bit field definitions
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx27.h b/arch/arm/mach-imx/iomux-mx27.h
index d9f9a6e32d80..218e99e89e86 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx27.h
+++ b/arch/arm/mach-imx/iomux-mx27.h
@@ -19,8 +19,8 @@
19#ifndef __MACH_IOMUX_MX27_H__ 19#ifndef __MACH_IOMUX_MX27_H__
20#define __MACH_IOMUX_MX27_H__ 20#define __MACH_IOMUX_MX27_H__
21 21
22#include <mach/iomux-mx2x.h> 22#include "iomux-mx2x.h"
23#include <mach/iomux-v1.h> 23#include "iomux-v1.h"
24 24
25/* Primary GPIO pin functions */ 25/* Primary GPIO pin functions */
26 26
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h b/arch/arm/mach-imx/iomux-mx2x.h
index 7a9b20abda09..7a9b20abda09 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
+++ b/arch/arm/mach-imx/iomux-mx2x.h
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/mach-imx/iomux-mx3.h
index f79f78a1c0ed..f79f78a1c0ed 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/mach-imx/iomux-mx3.h
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx35.h b/arch/arm/mach-imx/iomux-mx35.h
index 3117c18bbbd9..90bfa6b5be6a 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx35.h
+++ b/arch/arm/mach-imx/iomux-mx35.h
@@ -19,7 +19,7 @@
19#ifndef __MACH_IOMUX_MX35_H__ 19#ifndef __MACH_IOMUX_MX35_H__
20#define __MACH_IOMUX_MX35_H__ 20#define __MACH_IOMUX_MX35_H__
21 21
22#include <mach/iomux-v3.h> 22#include "iomux-v3.h"
23 23
24/* 24/*
25 * The naming convention for the pad modes is MX35_PAD_<padname>__<padmode> 25 * The naming convention for the pad modes is MX35_PAD_<padname>__<padmode>
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx50.h b/arch/arm/mach-imx/iomux-mx50.h
index 98e7fd0b9083..00f56e0e8009 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx50.h
+++ b/arch/arm/mach-imx/iomux-mx50.h
@@ -19,7 +19,7 @@
19#ifndef __MACH_IOMUX_MX50_H__ 19#ifndef __MACH_IOMUX_MX50_H__
20#define __MACH_IOMUX_MX50_H__ 20#define __MACH_IOMUX_MX50_H__
21 21
22#include <mach/iomux-v3.h> 22#include "iomux-v3.h"
23 23
24#define MX50_ELCDIF_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_DSE_HIGH) 24#define MX50_ELCDIF_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
25 25
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/mach-imx/iomux-mx51.h
index 2623e7a2e190..75bbcc4aa2d2 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h
+++ b/arch/arm/mach-imx/iomux-mx51.h
@@ -13,7 +13,7 @@
13#ifndef __MACH_IOMUX_MX51_H__ 13#ifndef __MACH_IOMUX_MX51_H__
14#define __MACH_IOMUX_MX51_H__ 14#define __MACH_IOMUX_MX51_H__
15 15
16#include <mach/iomux-v3.h> 16#include "iomux-v3.h"
17#define __NA_ 0x000 17#define __NA_ 0x000
18 18
19 19
diff --git a/arch/arm/plat-mxc/iomux-v1.c b/arch/arm/mach-imx/iomux-v1.c
index 1f73963bc13e..2b156d1d9e21 100644
--- a/arch/arm/plat-mxc/iomux-v1.c
+++ b/arch/arm/mach-imx/iomux-v1.c
@@ -28,9 +28,10 @@
28#include <linux/string.h> 28#include <linux/string.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30 30
31#include <mach/hardware.h>
32#include <asm/mach/map.h> 31#include <asm/mach/map.h>
33#include <mach/iomux-v1.h> 32
33#include "hardware.h"
34#include "iomux-v1.h"
34 35
35static void __iomem *imx_iomuxv1_baseaddr; 36static void __iomem *imx_iomuxv1_baseaddr;
36static unsigned imx_iomuxv1_numports; 37static unsigned imx_iomuxv1_numports;
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/mach-imx/iomux-v1.h
index 02651a40fe23..02651a40fe23 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v1.h
+++ b/arch/arm/mach-imx/iomux-v1.h
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/mach-imx/iomux-v3.c
index 99a9cdb9d6be..9dae74bf47fc 100644
--- a/arch/arm/plat-mxc/iomux-v3.c
+++ b/arch/arm/mach-imx/iomux-v3.c
@@ -25,9 +25,10 @@
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27 27
28#include <mach/hardware.h>
29#include <asm/mach/map.h> 28#include <asm/mach/map.h>
30#include <mach/iomux-v3.h> 29
30#include "hardware.h"
31#include "iomux-v3.h"
31 32
32static void __iomem *base; 33static void __iomem *base;
33 34
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/mach-imx/iomux-v3.h
index 2fa3b5430102..2fa3b5430102 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/mach-imx/iomux-v3.h
diff --git a/arch/arm/plat-mxc/include/mach/iram.h b/arch/arm/mach-imx/iram.h
index 022690c33702..022690c33702 100644
--- a/arch/arm/plat-mxc/include/mach/iram.h
+++ b/arch/arm/mach-imx/iram.h
diff --git a/arch/arm/plat-mxc/iram_alloc.c b/arch/arm/mach-imx/iram_alloc.c
index 074c3869626a..6c80424f678e 100644
--- a/arch/arm/plat-mxc/iram_alloc.c
+++ b/arch/arm/mach-imx/iram_alloc.c
@@ -22,7 +22,8 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/genalloc.h> 24#include <linux/genalloc.h>
25#include <mach/iram.h> 25
26#include "iram.h"
26 27
27static unsigned long iram_phys_base; 28static unsigned long iram_phys_base;
28static void __iomem *iram_virt_base; 29static void __iomem *iram_virt_base;
diff --git a/arch/arm/plat-mxc/irq-common.c b/arch/arm/mach-imx/irq-common.c
index b6e11458e5ae..b6e11458e5ae 100644
--- a/arch/arm/plat-mxc/irq-common.c
+++ b/arch/arm/mach-imx/irq-common.c
diff --git a/arch/arm/plat-mxc/irq-common.h b/arch/arm/mach-imx/irq-common.h
index 6ccb3a14c693..5b2dabba330f 100644
--- a/arch/arm/plat-mxc/irq-common.h
+++ b/arch/arm/mach-imx/irq-common.h
@@ -19,6 +19,9 @@
19#ifndef __PLAT_MXC_IRQ_COMMON_H__ 19#ifndef __PLAT_MXC_IRQ_COMMON_H__
20#define __PLAT_MXC_IRQ_COMMON_H__ 20#define __PLAT_MXC_IRQ_COMMON_H__
21 21
22/* all normal IRQs can be FIQs */
23#define FIQ_START 0
24
22struct mxc_extra_irq 25struct mxc_extra_irq
23{ 26{
24 int (*set_priority)(unsigned char irq, unsigned char prio); 27 int (*set_priority)(unsigned char irq, unsigned char prio);
diff --git a/arch/arm/mach-imx/lluart.c b/arch/arm/mach-imx/lluart.c
index c40a34c00489..2fdc9bf2fb5e 100644
--- a/arch/arm/mach-imx/lluart.c
+++ b/arch/arm/mach-imx/lluart.c
@@ -14,19 +14,28 @@
14#include <asm/page.h> 14#include <asm/page.h>
15#include <asm/sizes.h> 15#include <asm/sizes.h>
16#include <asm/mach/map.h> 16#include <asm/mach/map.h>
17#include <mach/hardware.h> 17
18#include "hardware.h"
19
20#define IMX6Q_UART1_BASE_ADDR 0x02020000
21#define IMX6Q_UART2_BASE_ADDR 0x021e8000
22#define IMX6Q_UART3_BASE_ADDR 0x021ec000
23#define IMX6Q_UART4_BASE_ADDR 0x021f0000
24#define IMX6Q_UART5_BASE_ADDR 0x021f4000
25
26/*
27 * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion
28 * of IMX6Q_UART##n##_BASE_ADDR.
29 */
30#define IMX6Q_UART_BASE_ADDR(n) IMX6Q_UART##n##_BASE_ADDR
31#define IMX6Q_UART_BASE(n) IMX6Q_UART_BASE_ADDR(n)
32#define IMX6Q_DEBUG_UART_BASE IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT)
18 33
19static struct map_desc imx_lluart_desc = { 34static struct map_desc imx_lluart_desc = {
20#ifdef CONFIG_DEBUG_IMX6Q_UART2 35#ifdef CONFIG_DEBUG_IMX6Q_UART
21 .virtual = MX6Q_IO_P2V(MX6Q_UART2_BASE_ADDR), 36 .virtual = IMX_IO_P2V(IMX6Q_DEBUG_UART_BASE),
22 .pfn = __phys_to_pfn(MX6Q_UART2_BASE_ADDR), 37 .pfn = __phys_to_pfn(IMX6Q_DEBUG_UART_BASE),
23 .length = MX6Q_UART2_SIZE, 38 .length = 0x4000,
24 .type = MT_DEVICE,
25#endif
26#ifdef CONFIG_DEBUG_IMX6Q_UART4
27 .virtual = MX6Q_IO_P2V(MX6Q_UART4_BASE_ADDR),
28 .pfn = __phys_to_pfn(MX6Q_UART4_BASE_ADDR),
29 .length = MX6Q_UART4_SIZE,
30 .type = MT_DEVICE, 39 .type = MT_DEVICE,
31#endif 40#endif
32}; 41};
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c
index 7b99a79722b6..5c9bd2c66e6d 100644
--- a/arch/arm/mach-imx/mach-apf9328.c
+++ b/arch/arm/mach-imx/mach-apf9328.c
@@ -25,11 +25,10 @@
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/time.h> 26#include <asm/mach/time.h>
27 27
28#include <mach/common.h> 28#include "common.h"
29#include <mach/hardware.h>
30#include <mach/iomux-mx1.h>
31
32#include "devices-imx1.h" 29#include "devices-imx1.h"
30#include "hardware.h"
31#include "iomux-mx1.h"
33 32
34static const int apf9328_pins[] __initconst = { 33static const int apf9328_pins[] __initconst = {
35 /* UART1 */ 34 /* UART1 */
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index 5985ed1b8c98..59bd6b06a6b5 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -41,19 +41,18 @@
41#include <linux/regulator/machine.h> 41#include <linux/regulator/machine.h>
42#include <linux/regulator/fixed.h> 42#include <linux/regulator/fixed.h>
43 43
44#include <mach/hardware.h>
45#include <asm/mach-types.h> 44#include <asm/mach-types.h>
46#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
47#include <asm/mach/time.h> 46#include <asm/mach/time.h>
48#include <asm/memory.h> 47#include <asm/memory.h>
49#include <asm/mach/map.h> 48#include <asm/mach/map.h>
50 49
51#include <mach/common.h> 50#include "common.h"
52#include <mach/iomux-mx3.h>
53#include <mach/ulpi.h>
54
55#include "devices-imx31.h" 51#include "devices-imx31.h"
56#include "crmregs-imx3.h" 52#include "crmregs-imx3.h"
53#include "hardware.h"
54#include "iomux-mx3.h"
55#include "ulpi.h"
57 56
58static int armadillo5x0_pins[] = { 57static int armadillo5x0_pins[] = {
59 /* UART1 */ 58 /* UART1 */
diff --git a/arch/arm/mach-imx/mach-bug.c b/arch/arm/mach-imx/mach-bug.c
index 9a9897749dd6..3a39d5aec07a 100644
--- a/arch/arm/mach-imx/mach-bug.c
+++ b/arch/arm/mach-imx/mach-bug.c
@@ -19,15 +19,14 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21 21
22#include <mach/iomux-mx3.h>
23#include <mach/hardware.h>
24#include <mach/common.h>
25
26#include <asm/mach/time.h> 22#include <asm/mach/time.h>
27#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
28#include <asm/mach-types.h> 24#include <asm/mach-types.h>
29 25
26#include "common.h"
30#include "devices-imx31.h" 27#include "devices-imx31.h"
28#include "hardware.h"
29#include "iomux-mx3.h"
31 30
32static const struct imxuart_platform_data uart_pdata __initconst = { 31static const struct imxuart_platform_data uart_pdata __initconst = {
33 .flags = IMXUART_HAVE_RTSCTS, 32 .flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 2bb9e18d9ee1..12a370646b45 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -34,13 +34,12 @@
34#include <asm/mach/time.h> 34#include <asm/mach/time.h>
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36 36
37#include <mach/eukrea-baseboards.h> 37#include "common.h"
38#include <mach/common.h>
39#include <mach/hardware.h>
40#include <mach/iomux-mx27.h>
41#include <mach/ulpi.h>
42
43#include "devices-imx27.h" 38#include "devices-imx27.h"
39#include "eukrea-baseboards.h"
40#include "hardware.h"
41#include "iomux-mx27.h"
42#include "ulpi.h"
44 43
45static const int eukrea_cpuimx27_pins[] __initconst = { 44static const int eukrea_cpuimx27_pins[] __initconst = {
46 /* UART1 */ 45 /* UART1 */
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index d49b0ec6bdec..5a31bf8c8f4c 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -37,12 +37,11 @@
37#include <asm/mach/time.h> 37#include <asm/mach/time.h>
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
39 39
40#include <mach/eukrea-baseboards.h> 40#include "common.h"
41#include <mach/hardware.h>
42#include <mach/common.h>
43#include <mach/iomux-mx35.h>
44
45#include "devices-imx35.h" 41#include "devices-imx35.h"
42#include "eukrea-baseboards.h"
43#include "hardware.h"
44#include "iomux-mx35.h"
46 45
47static const struct imxuart_platform_data uart_pdata __initconst = { 46static const struct imxuart_platform_data uart_pdata __initconst = {
48 .flags = IMXUART_HAVE_RTSCTS, 47 .flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index b87cc49ab1e8..b727de029c8f 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -26,18 +26,17 @@
26#include <linux/spi/spi.h> 26#include <linux/spi/spi.h>
27#include <linux/can/platform/mcp251x.h> 27#include <linux/can/platform/mcp251x.h>
28 28
29#include <mach/eukrea-baseboards.h>
30#include <mach/common.h>
31#include <mach/hardware.h>
32#include <mach/iomux-mx51.h>
33
34#include <asm/setup.h> 29#include <asm/setup.h>
35#include <asm/mach-types.h> 30#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
37#include <asm/mach/time.h> 32#include <asm/mach/time.h>
38 33
34#include "common.h"
39#include "devices-imx51.h" 35#include "devices-imx51.h"
40#include "cpu_op-mx51.h" 36#include "cpu_op-mx51.h"
37#include "eukrea-baseboards.h"
38#include "hardware.h"
39#include "iomux-mx51.h"
41 40
42#define USBH1_RST IMX_GPIO_NR(2, 28) 41#define USBH1_RST IMX_GPIO_NR(2, 28)
43#define ETH_RST IMX_GPIO_NR(2, 31) 42#define ETH_RST IMX_GPIO_NR(2, 31)
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index 017bbb70ea41..75027a5ad8b7 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -27,18 +27,18 @@
27#include <linux/usb/otg.h> 27#include <linux/usb/otg.h>
28#include <linux/usb/ulpi.h> 28#include <linux/usb/ulpi.h>
29 29
30#include <mach/eukrea-baseboards.h>
31#include <mach/hardware.h>
32#include <asm/mach-types.h> 30#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
34#include <asm/mach/time.h> 32#include <asm/mach/time.h>
35#include <asm/memory.h> 33#include <asm/memory.h>
36#include <asm/mach/map.h> 34#include <asm/mach/map.h>
37#include <mach/common.h>
38#include <mach/mx25.h>
39#include <mach/iomux-mx25.h>
40 35
36#include "common.h"
41#include "devices-imx25.h" 37#include "devices-imx25.h"
38#include "eukrea-baseboards.h"
39#include "hardware.h"
40#include "iomux-mx25.h"
41#include "mx25.h"
42 42
43static const struct imxuart_platform_data uart_pdata __initconst = { 43static const struct imxuart_platform_data uart_pdata __initconst = {
44 .flags = IMXUART_HAVE_RTSCTS, 44 .flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index 141756f00ae5..b74422679126 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -40,11 +40,11 @@
40#include <asm/mach/time.h> 40#include <asm/mach/time.h>
41#include <asm/system_info.h> 41#include <asm/system_info.h>
42#include <asm/memblock.h> 42#include <asm/memblock.h>
43#include <mach/common.h>
44#include <mach/hardware.h>
45#include <mach/iomux-mx27.h>
46 43
44#include "common.h"
47#include "devices-imx27.h" 45#include "devices-imx27.h"
46#include "hardware.h"
47#include "iomux-mx27.h"
48 48
49#define TVP5150_RSTN (GPIO_PORTC + 18) 49#define TVP5150_RSTN (GPIO_PORTC + 18)
50#define TVP5150_PWDN (GPIO_PORTC + 19) 50#define TVP5150_PWDN (GPIO_PORTC + 19)
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c
index 7381387a8905..53a860112938 100644
--- a/arch/arm/mach-imx/mach-imx27ipcam.c
+++ b/arch/arm/mach-imx/mach-imx27ipcam.c
@@ -17,11 +17,11 @@
17#include <asm/mach-types.h> 17#include <asm/mach-types.h>
18#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
19#include <asm/mach/time.h> 19#include <asm/mach/time.h>
20#include <mach/hardware.h>
21#include <mach/common.h>
22#include <mach/iomux-mx27.h>
23 20
21#include "hardware.h"
22#include "common.h"
24#include "devices-imx27.h" 23#include "devices-imx27.h"
24#include "iomux-mx27.h"
25 25
26static const int mx27ipcam_pins[] __initconst = { 26static const int mx27ipcam_pins[] __initconst = {
27 /* UART1 */ 27 /* UART1 */
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c
index 1f45b9189229..fc8dce931378 100644
--- a/arch/arm/mach-imx/mach-imx27lite.c
+++ b/arch/arm/mach-imx/mach-imx27lite.c
@@ -20,11 +20,11 @@
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach/time.h> 21#include <asm/mach/time.h>
22#include <asm/mach/map.h> 22#include <asm/mach/map.h>
23#include <mach/hardware.h>
24#include <mach/common.h>
25#include <mach/iomux-mx27.h>
26 23
24#include "common.h"
27#include "devices-imx27.h" 25#include "devices-imx27.h"
26#include "hardware.h"
27#include "iomux-mx27.h"
28 28
29static const int mx27lite_pins[] __initconst = { 29static const int mx27lite_pins[] __initconst = {
30 /* UART1 */ 30 /* UART1 */
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 29711e95579f..e71e62610eba 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -19,8 +19,9 @@
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach/time.h> 21#include <asm/mach/time.h>
22#include <mach/common.h> 22
23#include <mach/mx53.h> 23#include "common.h"
24#include "mx53.h"
24 25
25/* 26/*
26 * Lookup table for attaching a specific name and platform_data pointer to 27 * Lookup table for attaching a specific name and platform_data pointer to
@@ -42,9 +43,9 @@ static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = {
42 OF_DEV_AUXDATA("fsl,imx53-ecspi", MX53_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL), 43 OF_DEV_AUXDATA("fsl,imx53-ecspi", MX53_ECSPI1_BASE_ADDR, "imx51-ecspi.0", NULL),
43 OF_DEV_AUXDATA("fsl,imx53-ecspi", MX53_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL), 44 OF_DEV_AUXDATA("fsl,imx53-ecspi", MX53_ECSPI2_BASE_ADDR, "imx51-ecspi.1", NULL),
44 OF_DEV_AUXDATA("fsl,imx53-cspi", MX53_CSPI_BASE_ADDR, "imx35-cspi.0", NULL), 45 OF_DEV_AUXDATA("fsl,imx53-cspi", MX53_CSPI_BASE_ADDR, "imx35-cspi.0", NULL),
45 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C1_BASE_ADDR, "imx-i2c.0", NULL), 46 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C1_BASE_ADDR, "imx21-i2c.0", NULL),
46 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C2_BASE_ADDR, "imx-i2c.1", NULL), 47 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C2_BASE_ADDR, "imx21-i2c.1", NULL),
47 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C3_BASE_ADDR, "imx-i2c.2", NULL), 48 OF_DEV_AUXDATA("fsl,imx53-i2c", MX53_I2C3_BASE_ADDR, "imx21-i2c.2", NULL),
48 OF_DEV_AUXDATA("fsl,imx53-sdma", MX53_SDMA_BASE_ADDR, "imx35-sdma", NULL), 49 OF_DEV_AUXDATA("fsl,imx53-sdma", MX53_SDMA_BASE_ADDR, "imx35-sdma", NULL),
49 OF_DEV_AUXDATA("fsl,imx53-wdt", MX53_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL), 50 OF_DEV_AUXDATA("fsl,imx53-wdt", MX53_WDOG1_BASE_ADDR, "imx2-wdt.0", NULL),
50 { /* sentinel */ } 51 { /* sentinel */ }
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 47c91f7185d2..9511142d436c 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -33,10 +33,44 @@
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach/time.h> 34#include <asm/mach/time.h>
35#include <asm/system_misc.h> 35#include <asm/system_misc.h>
36#include <mach/common.h>
37#include <mach/cpuidle.h>
38#include <mach/hardware.h>
39 36
37#include "common.h"
38#include "cpuidle.h"
39#include "hardware.h"
40
41#define IMX6Q_ANALOG_DIGPROG 0x260
42
43static int imx6q_revision(void)
44{
45 struct device_node *np;
46 void __iomem *base;
47 static u32 rev;
48
49 if (!rev) {
50 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
51 if (!np)
52 return IMX_CHIP_REVISION_UNKNOWN;
53 base = of_iomap(np, 0);
54 if (!base) {
55 of_node_put(np);
56 return IMX_CHIP_REVISION_UNKNOWN;
57 }
58 rev = readl_relaxed(base + IMX6Q_ANALOG_DIGPROG);
59 iounmap(base);
60 of_node_put(np);
61 }
62
63 switch (rev & 0xff) {
64 case 0:
65 return IMX_CHIP_REVISION_1_0;
66 case 1:
67 return IMX_CHIP_REVISION_1_1;
68 case 2:
69 return IMX_CHIP_REVISION_1_2;
70 default:
71 return IMX_CHIP_REVISION_UNKNOWN;
72 }
73}
40 74
41void imx6q_restart(char mode, const char *cmd) 75void imx6q_restart(char mode, const char *cmd)
42{ 76{
@@ -192,6 +226,7 @@ static void __init imx6q_timer_init(void)
192{ 226{
193 mx6q_clocks_init(); 227 mx6q_clocks_init();
194 twd_local_timer_of_register(); 228 twd_local_timer_of_register();
229 imx_print_silicon_rev("i.MX6Q", imx6q_revision());
195} 230}
196 231
197static struct sys_timer imx6q_timer = { 232static struct sys_timer imx6q_timer = {
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c
index 0330078ff788..2e536ea53444 100644
--- a/arch/arm/mach-imx/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c
@@ -36,11 +36,10 @@
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/common.h> 39#include "common.h"
40#include <mach/hardware.h>
41#include <mach/iomux-mx3.h>
42
43#include "devices-imx31.h" 40#include "devices-imx31.h"
41#include "hardware.h"
42#include "iomux-mx3.h"
44 43
45#define KZM_ARM11_IO_ADDRESS(x) (IOMEM( \ 44#define KZM_ARM11_IO_ADDRESS(x) (IOMEM( \
46 IMX_IO_P2V_MODULE(x, MX31_CS4) ?: \ 45 IMX_IO_P2V_MODULE(x, MX31_CS4) ?: \
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index 667f359a2e8b..06b483783e68 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -23,11 +23,10 @@
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/time.h> 24#include <asm/mach/time.h>
25 25
26#include <mach/common.h> 26#include "common.h"
27#include <mach/hardware.h>
28#include <mach/iomux-mx1.h>
29
30#include "devices-imx1.h" 27#include "devices-imx1.h"
28#include "hardware.h"
29#include "iomux-mx1.h"
31 30
32static const int mx1ads_pins[] __initconst = { 31static const int mx1ads_pins[] __initconst = {
33 /* UART1 */ 32 /* UART1 */
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index ed22e3fe6ec8..6adb3136bb08 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -18,15 +18,15 @@
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/physmap.h> 19#include <linux/mtd/physmap.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <mach/common.h>
22#include <mach/hardware.h>
23#include <asm/mach-types.h> 21#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
25#include <asm/mach/time.h> 23#include <asm/mach/time.h>
26#include <asm/mach/map.h> 24#include <asm/mach/map.h>
27#include <mach/iomux-mx21.h>
28 25
26#include "common.h"
29#include "devices-imx21.h" 27#include "devices-imx21.h"
28#include "hardware.h"
29#include "iomux-mx21.h"
30 30
31/* 31/*
32 * Memory-mapped I/O on MX21ADS base board 32 * Memory-mapped I/O on MX21ADS base board
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index ce247fd1269a..b1b03aa55bb8 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -31,17 +31,17 @@
31#include <linux/platform_device.h> 31#include <linux/platform_device.h>
32#include <linux/usb/otg.h> 32#include <linux/usb/otg.h>
33 33
34#include <mach/hardware.h>
35#include <asm/mach-types.h> 34#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
37#include <asm/mach/time.h> 36#include <asm/mach/time.h>
38#include <asm/memory.h> 37#include <asm/memory.h>
39#include <asm/mach/map.h> 38#include <asm/mach/map.h>
40#include <mach/common.h>
41#include <mach/mx25.h>
42#include <mach/iomux-mx25.h>
43 39
40#include "common.h"
44#include "devices-imx25.h" 41#include "devices-imx25.h"
42#include "hardware.h"
43#include "iomux-mx25.h"
44#include "mx25.h"
45 45
46#define MX25PDK_CAN_PWDN IMX_GPIO_NR(4, 6) 46#define MX25PDK_CAN_PWDN IMX_GPIO_NR(4, 6)
47 47
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 05996f39005c..d0e547fa925f 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -36,13 +36,13 @@
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/time.h> 38#include <asm/mach/time.h>
39#include <mach/hardware.h>
40#include <mach/common.h>
41#include <mach/iomux-mx27.h>
42#include <mach/ulpi.h>
43#include <mach/3ds_debugboard.h>
44 39
40#include "3ds_debugboard.h"
41#include "common.h"
45#include "devices-imx27.h" 42#include "devices-imx27.h"
43#include "hardware.h"
44#include "iomux-mx27.h"
45#include "ulpi.h"
46 46
47#define SD1_EN_GPIO IMX_GPIO_NR(2, 25) 47#define SD1_EN_GPIO IMX_GPIO_NR(2, 25)
48#define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23) 48#define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23)
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 7dc59bac0e55..3d036f57f0e6 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -21,15 +21,15 @@
21#include <linux/mtd/physmap.h> 21#include <linux/mtd/physmap.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <mach/common.h>
25#include <mach/hardware.h>
26#include <asm/mach-types.h> 24#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
28#include <asm/mach/time.h> 26#include <asm/mach/time.h>
29#include <asm/mach/map.h> 27#include <asm/mach/map.h>
30#include <mach/iomux-mx27.h>
31 28
29#include "common.h"
32#include "devices-imx27.h" 30#include "devices-imx27.h"
31#include "hardware.h"
32#include "iomux-mx27.h"
33 33
34/* 34/*
35 * Base address of PBC controller, CS4 35 * Base address of PBC controller, CS4
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 8915f937b7d5..bc301befdd06 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -30,19 +30,19 @@
30 30
31#include <media/soc_camera.h> 31#include <media/soc_camera.h>
32 32
33#include <mach/hardware.h>
34#include <asm/mach-types.h> 33#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
36#include <asm/mach/time.h> 35#include <asm/mach/time.h>
37#include <asm/memory.h> 36#include <asm/memory.h>
38#include <asm/mach/map.h> 37#include <asm/mach/map.h>
39#include <asm/memblock.h> 38#include <asm/memblock.h>
40#include <mach/common.h>
41#include <mach/iomux-mx3.h>
42#include <mach/3ds_debugboard.h>
43#include <mach/ulpi.h>
44 39
40#include "3ds_debugboard.h"
41#include "common.h"
45#include "devices-imx31.h" 42#include "devices-imx31.h"
43#include "hardware.h"
44#include "iomux-mx3.h"
45#include "ulpi.h"
46 46
47static int mx31_3ds_pins[] = { 47static int mx31_3ds_pins[] = {
48 /* UART1 */ 48 /* UART1 */
@@ -393,7 +393,7 @@ static struct regulator_init_data gpo_init = {
393}; 393};
394 394
395static struct regulator_consumer_supply vmmc2_consumers[] = { 395static struct regulator_consumer_supply vmmc2_consumers[] = {
396 REGULATOR_SUPPLY("vmmc", "mxc-mmc.0"), 396 REGULATOR_SUPPLY("vmmc", "imx31-mmc.0"),
397}; 397};
398 398
399static struct regulator_init_data vmmc2_init = { 399static struct regulator_init_data vmmc2_init = {
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c
index e774b07f48d3..8b56f8883f32 100644
--- a/arch/arm/mach-imx/mach-mx31ads.c
+++ b/arch/arm/mach-imx/mach-mx31ads.c
@@ -28,8 +28,6 @@
28#include <asm/mach/time.h> 28#include <asm/mach/time.h>
29#include <asm/memory.h> 29#include <asm/memory.h>
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31#include <mach/common.h>
32#include <mach/iomux-mx3.h>
33 31
34#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 32#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
35#include <linux/mfd/wm8350/audio.h> 33#include <linux/mfd/wm8350/audio.h>
@@ -37,7 +35,10 @@
37#include <linux/mfd/wm8350/pmic.h> 35#include <linux/mfd/wm8350/pmic.h>
38#endif 36#endif
39 37
38#include "common.h"
40#include "devices-imx31.h" 39#include "devices-imx31.h"
40#include "hardware.h"
41#include "iomux-mx3.h"
41 42
42/* Base address of PBC controller */ 43/* Base address of PBC controller */
43#define PBC_BASE_ADDRESS MX31_CS4_BASE_ADDR_VIRT 44#define PBC_BASE_ADDRESS MX31_CS4_BASE_ADDR_VIRT
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 34b9bf075daf..08b9965c8b36 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -42,13 +42,12 @@
42#include <asm/mach/time.h> 42#include <asm/mach/time.h>
43#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44 44
45#include <mach/hardware.h> 45#include "board-mx31lilly.h"
46#include <mach/common.h> 46#include "common.h"
47#include <mach/iomux-mx3.h>
48#include <mach/board-mx31lilly.h>
49#include <mach/ulpi.h>
50
51#include "devices-imx31.h" 47#include "devices-imx31.h"
48#include "hardware.h"
49#include "iomux-mx3.h"
50#include "ulpi.h"
52 51
53/* 52/*
54 * This file contains module-specific initialization routines for LILLY-1131. 53 * This file contains module-specific initialization routines for LILLY-1131.
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index ef57cff5abfb..bdcd92e59518 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -39,13 +39,12 @@
39#include <asm/page.h> 39#include <asm/page.h>
40#include <asm/setup.h> 40#include <asm/setup.h>
41 41
42#include <mach/hardware.h> 42#include "board-mx31lite.h"
43#include <mach/common.h> 43#include "common.h"
44#include <mach/board-mx31lite.h>
45#include <mach/iomux-mx3.h>
46#include <mach/ulpi.h>
47
48#include "devices-imx31.h" 44#include "devices-imx31.h"
45#include "hardware.h"
46#include "iomux-mx3.h"
47#include "ulpi.h"
49 48
50/* 49/*
51 * This file contains the module-specific initialization routines. 50 * This file contains the module-specific initialization routines.
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 459e754ef8c9..2517cfa9f26b 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -42,14 +42,14 @@
42#include <asm/mach/time.h> 42#include <asm/mach/time.h>
43#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44#include <asm/memblock.h> 44#include <asm/memblock.h>
45#include <mach/board-mx31moboard.h>
46#include <mach/common.h>
47#include <mach/hardware.h>
48#include <mach/iomux-mx3.h>
49#include <mach/ulpi.h>
50#include <linux/platform_data/asoc-imx-ssi.h> 45#include <linux/platform_data/asoc-imx-ssi.h>
51 46
47#include "board-mx31moboard.h"
48#include "common.h"
52#include "devices-imx31.h" 49#include "devices-imx31.h"
50#include "hardware.h"
51#include "iomux-mx3.h"
52#include "ulpi.h"
53 53
54static unsigned int moboard_pins[] = { 54static unsigned int moboard_pins[] = {
55 /* UART0 */ 55 /* UART0 */
@@ -175,11 +175,11 @@ static const struct spi_imx_master moboard_spi1_pdata __initconst = {
175 175
176static struct regulator_consumer_supply sdhc_consumers[] = { 176static struct regulator_consumer_supply sdhc_consumers[] = {
177 { 177 {
178 .dev_name = "mxc-mmc.0", 178 .dev_name = "imx31-mmc.0",
179 .supply = "sdhc0_vcc", 179 .supply = "sdhc0_vcc",
180 }, 180 },
181 { 181 {
182 .dev_name = "mxc-mmc.1", 182 .dev_name = "imx31-mmc.1",
183 .supply = "sdhc1_vcc", 183 .supply = "sdhc1_vcc",
184 }, 184 },
185}; 185};
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index 504983c68aa8..5277da45d60c 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -43,15 +43,15 @@
43#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44#include <asm/memblock.h> 44#include <asm/memblock.h>
45 45
46#include <mach/hardware.h>
47#include <mach/common.h>
48#include <mach/iomux-mx35.h>
49#include <mach/3ds_debugboard.h>
50#include <video/platform_lcd.h> 46#include <video/platform_lcd.h>
51 47
52#include <media/soc_camera.h> 48#include <media/soc_camera.h>
53 49
50#include "3ds_debugboard.h"
51#include "common.h"
54#include "devices-imx35.h" 52#include "devices-imx35.h"
53#include "hardware.h"
54#include "iomux-mx35.h"
55 55
56#define GPIO_MC9S08DZ60_GPS_ENABLE 0 56#define GPIO_MC9S08DZ60_GPS_ENABLE 0
57#define GPIO_MC9S08DZ60_HDD_ENABLE 4 57#define GPIO_MC9S08DZ60_HDD_ENABLE 4
diff --git a/arch/arm/mach-imx/mach-mx50_rdp.c b/arch/arm/mach-imx/mach-mx50_rdp.c
index 42b66e8d9615..0c1f88a80bdc 100644
--- a/arch/arm/mach-imx/mach-mx50_rdp.c
+++ b/arch/arm/mach-imx/mach-mx50_rdp.c
@@ -24,17 +24,16 @@
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <mach/common.h>
28#include <mach/hardware.h>
29#include <mach/iomux-mx50.h>
30
31#include <asm/irq.h> 27#include <asm/irq.h>
32#include <asm/setup.h> 28#include <asm/setup.h>
33#include <asm/mach-types.h> 29#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
35#include <asm/mach/time.h> 31#include <asm/mach/time.h>
36 32
33#include "common.h"
37#include "devices-imx50.h" 34#include "devices-imx50.h"
35#include "hardware.h"
36#include "iomux-mx50.h"
38 37
39#define FEC_EN IMX_GPIO_NR(6, 23) 38#define FEC_EN IMX_GPIO_NR(6, 23)
40#define FEC_RESET_B IMX_GPIO_NR(4, 12) 39#define FEC_RESET_B IMX_GPIO_NR(4, 12)
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
index 9ee84a4af639..abc25bd1107b 100644
--- a/arch/arm/mach-imx/mach-mx51_3ds.c
+++ b/arch/arm/mach-imx/mach-mx51_3ds.c
@@ -19,12 +19,11 @@
19#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
20#include <asm/mach/time.h> 20#include <asm/mach/time.h>
21 21
22#include <mach/hardware.h> 22#include "3ds_debugboard.h"
23#include <mach/common.h> 23#include "common.h"
24#include <mach/iomux-mx51.h>
25#include <mach/3ds_debugboard.h>
26
27#include "devices-imx51.h" 24#include "devices-imx51.h"
25#include "hardware.h"
26#include "iomux-mx51.h"
28 27
29#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) 28#define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28)
30 29
diff --git a/arch/arm/mach-imx/mach-mx51_babbage.c b/arch/arm/mach-imx/mach-mx51_babbage.c
index 7b31cbde8775..d9a84ca2199a 100644
--- a/arch/arm/mach-imx/mach-mx51_babbage.c
+++ b/arch/arm/mach-imx/mach-mx51_babbage.c
@@ -20,17 +20,16 @@
20#include <linux/spi/flash.h> 20#include <linux/spi/flash.h>
21#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
22 22
23#include <mach/common.h>
24#include <mach/hardware.h>
25#include <mach/iomux-mx51.h>
26
27#include <asm/setup.h> 23#include <asm/setup.h>
28#include <asm/mach-types.h> 24#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
30#include <asm/mach/time.h> 26#include <asm/mach/time.h>
31 27
28#include "common.h"
32#include "devices-imx51.h" 29#include "devices-imx51.h"
33#include "cpu_op-mx51.h" 30#include "cpu_op-mx51.h"
31#include "hardware.h"
32#include "iomux-mx51.h"
34 33
35#define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7) 34#define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7)
36#define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27) 35#define BABBAGE_USBH1_STP IMX_GPIO_NR(1, 27)
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index 0bf6d30aa32d..f4a8c7e108e1 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -21,17 +21,17 @@
21#include <linux/mtd/physmap.h> 21#include <linux/mtd/physmap.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <mach/common.h>
25#include <mach/hardware.h>
26#include <asm/mach-types.h> 24#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
28#include <asm/mach/time.h> 26#include <asm/mach/time.h>
29#include <asm/mach/map.h> 27#include <asm/mach/map.h>
30#include <linux/gpio.h> 28#include <linux/gpio.h>
31#include <mach/iomux-mx27.h>
32#include <linux/i2c/pca953x.h> 29#include <linux/i2c/pca953x.h>
33 30
31#include "common.h"
34#include "devices-imx27.h" 32#include "devices-imx27.h"
33#include "hardware.h"
34#include "iomux-mx27.h"
35 35
36static const int mxt_td60_pins[] __initconst = { 36static const int mxt_td60_pins[] __initconst = {
37 /* UART0 */ 37 /* UART0 */
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index de8516b7d69f..eee369fa94a2 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -32,13 +32,13 @@
32 32
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35#include <mach/common.h>
36#include <mach/hardware.h>
37#include <mach/iomux-mx27.h>
38#include <asm/mach/time.h> 35#include <asm/mach/time.h>
39#include <mach/ulpi.h>
40 36
37#include "common.h"
41#include "devices-imx27.h" 38#include "devices-imx27.h"
39#include "hardware.h"
40#include "iomux-mx27.h"
41#include "ulpi.h"
42 42
43#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23) 43#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
44#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24) 44#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24)
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c
index e3c45130fb3c..547fef133f65 100644
--- a/arch/arm/mach-imx/mach-pcm037.c
+++ b/arch/arm/mach-imx/mach-pcm037.c
@@ -42,13 +42,13 @@
42#include <asm/mach/time.h> 42#include <asm/mach/time.h>
43#include <asm/mach/map.h> 43#include <asm/mach/map.h>
44#include <asm/memblock.h> 44#include <asm/memblock.h>
45#include <mach/common.h>
46#include <mach/hardware.h>
47#include <mach/iomux-mx3.h>
48#include <mach/ulpi.h>
49 45
46#include "common.h"
50#include "devices-imx31.h" 47#include "devices-imx31.h"
48#include "hardware.h"
49#include "iomux-mx3.h"
51#include "pcm037.h" 50#include "pcm037.h"
51#include "ulpi.h"
52 52
53static enum pcm037_board_variant pcm037_instance = PCM037_PCM970; 53static enum pcm037_board_variant pcm037_instance = PCM037_PCM970;
54 54
diff --git a/arch/arm/mach-imx/mach-pcm037_eet.c b/arch/arm/mach-imx/mach-pcm037_eet.c
index 11ffa81ad17d..8fd8255068ee 100644
--- a/arch/arm/mach-imx/mach-pcm037_eet.c
+++ b/arch/arm/mach-imx/mach-pcm037_eet.c
@@ -11,13 +11,12 @@
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/spi/spi.h> 12#include <linux/spi/spi.h>
13 13
14#include <mach/common.h>
15#include <mach/iomux-mx3.h>
16
17#include <asm/mach-types.h> 14#include <asm/mach-types.h>
18 15
19#include "pcm037.h" 16#include "pcm037.h"
17#include "common.h"
20#include "devices-imx31.h" 18#include "devices-imx31.h"
19#include "iomux-mx3.h"
21 20
22static unsigned int pcm037_eet_pins[] = { 21static unsigned int pcm037_eet_pins[] = {
23 /* Reserve and hardwire GPIO 57 high - S6E63D6 chipselect */ 22 /* Reserve and hardwire GPIO 57 high - S6E63D6 chipselect */
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 95f49d936fd3..4aa0d0798605 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -33,13 +33,12 @@
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach/time.h> 34#include <asm/mach/time.h>
35 35
36#include <mach/board-pcm038.h> 36#include "board-pcm038.h"
37#include <mach/common.h> 37#include "common.h"
38#include <mach/hardware.h>
39#include <mach/iomux-mx27.h>
40#include <mach/ulpi.h>
41
42#include "devices-imx27.h" 38#include "devices-imx27.h"
39#include "hardware.h"
40#include "iomux-mx27.h"
41#include "ulpi.h"
43 42
44static const int pcm038_pins[] __initconst = { 43static const int pcm038_pins[] __initconst = {
45 /* UART1 */ 44 /* UART1 */
@@ -212,7 +211,7 @@ static const struct spi_imx_master pcm038_spi0_data __initconst = {
212 211
213static struct regulator_consumer_supply sdhc1_consumers[] = { 212static struct regulator_consumer_supply sdhc1_consumers[] = {
214 { 213 {
215 .dev_name = "mxc-mmc.1", 214 .dev_name = "imx21-mmc.1",
216 .supply = "sdhc_vcc", 215 .supply = "sdhc_vcc",
217 }, 216 },
218}; 217};
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index e4bd4387e344..92445440221e 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -33,12 +33,11 @@
33#include <asm/mach/time.h> 33#include <asm/mach/time.h>
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35 35
36#include <mach/hardware.h> 36#include "common.h"
37#include <mach/common.h>
38#include <mach/iomux-mx35.h>
39#include <mach/ulpi.h>
40
41#include "devices-imx35.h" 37#include "devices-imx35.h"
38#include "hardware.h"
39#include "iomux-mx35.h"
40#include "ulpi.h"
42 41
43static const struct fb_videomode fb_modedb[] = { 42static const struct fb_videomode fb_modedb[] = {
44 { 43 {
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c
index fb25fbd31226..96d9a91f8a3b 100644
--- a/arch/arm/mach-imx/mach-qong.c
+++ b/arch/arm/mach-imx/mach-qong.c
@@ -21,17 +21,17 @@
21#include <linux/mtd/nand.h> 21#include <linux/mtd/nand.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23 23
24#include <mach/hardware.h>
25#include <asm/mach-types.h> 24#include <asm/mach-types.h>
26#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
27#include <asm/mach/time.h> 26#include <asm/mach/time.h>
28#include <asm/mach/map.h> 27#include <asm/mach/map.h>
29#include <mach/common.h>
30#include <asm/page.h> 28#include <asm/page.h>
31#include <asm/setup.h> 29#include <asm/setup.h>
32#include <mach/iomux-mx3.h>
33 30
31#include "common.h"
34#include "devices-imx31.h" 32#include "devices-imx31.h"
33#include "hardware.h"
34#include "iomux-mx3.h"
35 35
36/* FPGA defines */ 36/* FPGA defines */
37#define QONG_FPGA_VERSION(major, minor, rev) \ 37#define QONG_FPGA_VERSION(major, minor, rev) \
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index 67ff38e9a3ca..fc970409dbaf 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -20,11 +20,10 @@
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach/time.h> 21#include <asm/mach/time.h>
22 22
23#include <mach/common.h> 23#include "common.h"
24#include <mach/hardware.h>
25#include <mach/iomux-mx1.h>
26
27#include "devices-imx1.h" 24#include "devices-imx1.h"
25#include "hardware.h"
26#include "iomux-mx1.h"
28 27
29/* 28/*
30 * This scb9328 has a 32MiB flash 29 * This scb9328 has a 32MiB flash
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 39eb7960e2a4..3aecf91e4289 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -28,15 +28,14 @@
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include <asm/mach/time.h> 29#include <asm/mach/time.h>
30 30
31#include <mach/hardware.h>
32#include <mach/common.h>
33#include <mach/iomux-mx35.h>
34
35#include <linux/i2c.h> 31#include <linux/i2c.h>
36#include <linux/i2c/at24.h> 32#include <linux/i2c/at24.h>
37#include <linux/mfd/mc13xxx.h> 33#include <linux/mfd/mc13xxx.h>
38 34
35#include "common.h"
39#include "devices-imx35.h" 36#include "devices-imx35.h"
37#include "hardware.h"
38#include "iomux-mx35.h"
40 39
41#define GPIO_LCDPWR IMX_GPIO_NR(1, 2) 40#define GPIO_LCDPWR IMX_GPIO_NR(1, 2)
42#define GPIO_PMIC_INT IMX_GPIO_NR(2, 0) 41#define GPIO_PMIC_INT IMX_GPIO_NR(2, 0)
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index 6d60d51868bc..7a146671e65a 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -22,9 +22,10 @@
22 22
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24 24
25#include <mach/common.h> 25#include "common.h"
26#include <mach/hardware.h> 26#include "devices/devices-common.h"
27#include <mach/iomux-v1.h> 27#include "hardware.h"
28#include "iomux-v1.h"
28 29
29static struct map_desc imx_io_desc[] __initdata = { 30static struct map_desc imx_io_desc[] __initdata = {
30 imx_map_entry(MX1, IO, MT_DEVICE), 31 imx_map_entry(MX1, IO, MT_DEVICE),
@@ -58,5 +59,7 @@ void __init imx1_soc_init(void)
58 MX1_GPIO_INT_PORTC, 0); 59 MX1_GPIO_INT_PORTC, 0);
59 mxc_register_gpio("imx1-gpio", 3, MX1_GPIO4_BASE_ADDR, SZ_256, 60 mxc_register_gpio("imx1-gpio", 3, MX1_GPIO4_BASE_ADDR, SZ_256,
60 MX1_GPIO_INT_PORTD, 0); 61 MX1_GPIO_INT_PORTD, 0);
62 imx_add_imx_dma("imx1-dma", MX1_DMA_BASE_ADDR,
63 MX1_DMA_INT, MX1_DMA_ERR);
61 pinctrl_provide_dummies(); 64 pinctrl_provide_dummies();
62} 65}
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index d056dad0940d..d8ccd3a8ec53 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -21,12 +21,13 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/pinctrl/machine.h> 23#include <linux/pinctrl/machine.h>
24#include <mach/hardware.h>
25#include <mach/common.h>
26#include <mach/devices-common.h>
27#include <asm/pgtable.h> 24#include <asm/pgtable.h>
28#include <asm/mach/map.h> 25#include <asm/mach/map.h>
29#include <mach/iomux-v1.h> 26
27#include "common.h"
28#include "devices/devices-common.h"
29#include "hardware.h"
30#include "iomux-v1.h"
30 31
31/* MX21 memory map definition */ 32/* MX21 memory map definition */
32static struct map_desc imx21_io_desc[] __initdata = { 33static struct map_desc imx21_io_desc[] __initdata = {
@@ -81,6 +82,8 @@ static const struct resource imx21_audmux_res[] __initconst = {
81 82
82void __init imx21_soc_init(void) 83void __init imx21_soc_init(void)
83{ 84{
85 mxc_device_init();
86
84 mxc_register_gpio("imx21-gpio", 0, MX21_GPIO1_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); 87 mxc_register_gpio("imx21-gpio", 0, MX21_GPIO1_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
85 mxc_register_gpio("imx21-gpio", 1, MX21_GPIO2_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); 88 mxc_register_gpio("imx21-gpio", 1, MX21_GPIO2_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
86 mxc_register_gpio("imx21-gpio", 2, MX21_GPIO3_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); 89 mxc_register_gpio("imx21-gpio", 2, MX21_GPIO3_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
@@ -89,7 +92,8 @@ void __init imx21_soc_init(void)
89 mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); 92 mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
90 93
91 pinctrl_provide_dummies(); 94 pinctrl_provide_dummies();
92 imx_add_imx_dma(); 95 imx_add_imx_dma("imx21-dma", MX21_DMA_BASE_ADDR,
96 MX21_INT_DMACH0, 0); /* No ERR irq */
93 platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res, 97 platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res,
94 ARRAY_SIZE(imx21_audmux_res)); 98 ARRAY_SIZE(imx21_audmux_res));
95} 99}
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index f3f5c6542ab4..9357707bb7af 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -24,11 +24,11 @@
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26 26
27#include <mach/common.h> 27#include "common.h"
28#include <mach/devices-common.h> 28#include "devices/devices-common.h"
29#include <mach/hardware.h> 29#include "hardware.h"
30#include <mach/mx25.h> 30#include "iomux-v3.h"
31#include <mach/iomux-v3.h> 31#include "mx25.h"
32 32
33/* 33/*
34 * This table defines static virtual address mappings for I/O regions. 34 * This table defines static virtual address mappings for I/O regions.
@@ -89,6 +89,8 @@ static const struct resource imx25_audmux_res[] __initconst = {
89 89
90void __init imx25_soc_init(void) 90void __init imx25_soc_init(void)
91{ 91{
92 mxc_device_init();
93
92 /* i.mx25 has the i.mx35 type gpio */ 94 /* i.mx25 has the i.mx35 type gpio */
93 mxc_register_gpio("imx35-gpio", 0, MX25_GPIO1_BASE_ADDR, SZ_16K, MX25_INT_GPIO1, 0); 95 mxc_register_gpio("imx35-gpio", 0, MX25_GPIO1_BASE_ADDR, SZ_16K, MX25_INT_GPIO1, 0);
94 mxc_register_gpio("imx35-gpio", 1, MX25_GPIO2_BASE_ADDR, SZ_16K, MX25_INT_GPIO2, 0); 96 mxc_register_gpio("imx35-gpio", 1, MX25_GPIO2_BASE_ADDR, SZ_16K, MX25_INT_GPIO2, 0);
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index e7e24afc45ed..4f1be65a7b5f 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -21,12 +21,13 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/pinctrl/machine.h> 23#include <linux/pinctrl/machine.h>
24#include <mach/hardware.h>
25#include <mach/common.h>
26#include <mach/devices-common.h>
27#include <asm/pgtable.h> 24#include <asm/pgtable.h>
28#include <asm/mach/map.h> 25#include <asm/mach/map.h>
29#include <mach/iomux-v1.h> 26
27#include "common.h"
28#include "devices/devices-common.h"
29#include "hardware.h"
30#include "iomux-v1.h"
30 31
31/* MX27 memory map definition */ 32/* MX27 memory map definition */
32static struct map_desc imx27_io_desc[] __initdata = { 33static struct map_desc imx27_io_desc[] __initdata = {
@@ -81,6 +82,8 @@ static const struct resource imx27_audmux_res[] __initconst = {
81 82
82void __init imx27_soc_init(void) 83void __init imx27_soc_init(void)
83{ 84{
85 mxc_device_init();
86
84 /* i.mx27 has the i.mx21 type gpio */ 87 /* i.mx27 has the i.mx21 type gpio */
85 mxc_register_gpio("imx21-gpio", 0, MX27_GPIO1_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); 88 mxc_register_gpio("imx21-gpio", 0, MX27_GPIO1_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
86 mxc_register_gpio("imx21-gpio", 1, MX27_GPIO2_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); 89 mxc_register_gpio("imx21-gpio", 1, MX27_GPIO2_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
@@ -90,7 +93,8 @@ void __init imx27_soc_init(void)
90 mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); 93 mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
91 94
92 pinctrl_provide_dummies(); 95 pinctrl_provide_dummies();
93 imx_add_imx_dma(); 96 imx_add_imx_dma("imx27-dma", MX27_DMA_BASE_ADDR,
97 MX27_INT_DMACH0, 0); /* No ERR irq */
94 /* imx27 has the imx21 type audmux */ 98 /* imx27 has the imx21 type audmux */
95 platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res, 99 platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
96 ARRAY_SIZE(imx27_audmux_res)); 100 ARRAY_SIZE(imx27_audmux_res));
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index b5deb0554552..cefa047c4053 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -26,12 +26,11 @@
26#include <asm/hardware/cache-l2x0.h> 26#include <asm/hardware/cache-l2x0.h>
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include <mach/common.h> 29#include "common.h"
30#include <mach/devices-common.h>
31#include <mach/hardware.h>
32#include <mach/iomux-v3.h>
33
34#include "crmregs-imx3.h" 30#include "crmregs-imx3.h"
31#include "devices/devices-common.h"
32#include "hardware.h"
33#include "iomux-v3.h"
35 34
36void __iomem *mx3_ccm_base; 35void __iomem *mx3_ccm_base;
37 36
@@ -175,6 +174,8 @@ void __init imx31_soc_init(void)
175 174
176 imx3_init_l2x0(); 175 imx3_init_l2x0();
177 176
177 mxc_device_init();
178
178 mxc_register_gpio("imx31-gpio", 0, MX31_GPIO1_BASE_ADDR, SZ_16K, MX31_INT_GPIO1, 0); 179 mxc_register_gpio("imx31-gpio", 0, MX31_GPIO1_BASE_ADDR, SZ_16K, MX31_INT_GPIO1, 0);
179 mxc_register_gpio("imx31-gpio", 1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0); 180 mxc_register_gpio("imx31-gpio", 1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0);
180 mxc_register_gpio("imx31-gpio", 2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0); 181 mxc_register_gpio("imx31-gpio", 2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0);
@@ -271,6 +272,8 @@ void __init imx35_soc_init(void)
271 272
272 imx3_init_l2x0(); 273 imx3_init_l2x0();
273 274
275 mxc_device_init();
276
274 mxc_register_gpio("imx35-gpio", 0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0); 277 mxc_register_gpio("imx35-gpio", 0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0);
275 mxc_register_gpio("imx35-gpio", 1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0); 278 mxc_register_gpio("imx35-gpio", 1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0);
276 mxc_register_gpio("imx35-gpio", 2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0); 279 mxc_register_gpio("imx35-gpio", 2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0);
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index acb0aadb4255..f92caf1b30ba 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -18,10 +18,10 @@
18 18
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20 20
21#include <mach/hardware.h> 21#include "common.h"
22#include <mach/common.h> 22#include "devices/devices-common.h"
23#include <mach/devices-common.h> 23#include "hardware.h"
24#include <mach/iomux-v3.h> 24#include "iomux-v3.h"
25 25
26/* 26/*
27 * Define the MX50 memory map. 27 * Define the MX50 memory map.
@@ -138,6 +138,8 @@ static const struct resource imx51_audmux_res[] __initconst = {
138 138
139void __init imx50_soc_init(void) 139void __init imx50_soc_init(void)
140{ 140{
141 mxc_device_init();
142
141 /* i.mx50 has the i.mx35 type gpio */ 143 /* i.mx50 has the i.mx35 type gpio */
142 mxc_register_gpio("imx35-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH); 144 mxc_register_gpio("imx35-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
143 mxc_register_gpio("imx35-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH); 145 mxc_register_gpio("imx35-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
@@ -153,6 +155,8 @@ void __init imx50_soc_init(void)
153 155
154void __init imx51_soc_init(void) 156void __init imx51_soc_init(void)
155{ 157{
158 mxc_device_init();
159
156 /* i.mx51 has the i.mx35 type gpio */ 160 /* i.mx51 has the i.mx35 type gpio */
157 mxc_register_gpio("imx35-gpio", 0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_INT_GPIO1_LOW, MX51_INT_GPIO1_HIGH); 161 mxc_register_gpio("imx35-gpio", 0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_INT_GPIO1_LOW, MX51_INT_GPIO1_HIGH);
158 mxc_register_gpio("imx35-gpio", 1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_INT_GPIO2_LOW, MX51_INT_GPIO2_HIGH); 162 mxc_register_gpio("imx35-gpio", 1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_INT_GPIO2_LOW, MX51_INT_GPIO2_HIGH);
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/mach-imx/mx1.h
index 45bd31cc34d6..45bd31cc34d6 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/mach-imx/mx1.h
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/mach-imx/mx21.h
index 468738aa997f..468738aa997f 100644
--- a/arch/arm/plat-mxc/include/mach/mx21.h
+++ b/arch/arm/mach-imx/mx21.h
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/mach-imx/mx25.h
index ec466400a200..ec466400a200 100644
--- a/arch/arm/plat-mxc/include/mach/mx25.h
+++ b/arch/arm/mach-imx/mx25.h
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/mach-imx/mx27.h
index e074616d54ca..e074616d54ca 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/mach-imx/mx27.h
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/mach-imx/mx2x.h
index 11642f5b224c..11642f5b224c 100644
--- a/arch/arm/plat-mxc/include/mach/mx2x.h
+++ b/arch/arm/mach-imx/mx2x.h
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/mach-imx/mx31.h
index ee9b1f9215df..ee9b1f9215df 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/mach-imx/mx31.h
diff --git a/arch/arm/mach-imx/mx31lilly-db.c b/arch/arm/mach-imx/mx31lilly-db.c
index 29e890f92055..d4361b80c5fb 100644
--- a/arch/arm/mach-imx/mx31lilly-db.c
+++ b/arch/arm/mach-imx/mx31lilly-db.c
@@ -30,12 +30,11 @@
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32 32
33#include <mach/hardware.h> 33#include "board-mx31lilly.h"
34#include <mach/common.h> 34#include "common.h"
35#include <mach/iomux-mx3.h>
36#include <mach/board-mx31lilly.h>
37
38#include "devices-imx31.h" 35#include "devices-imx31.h"
36#include "hardware.h"
37#include "iomux-mx3.h"
39 38
40/* 39/*
41 * This file contains board-specific initialization routines for the 40 * This file contains board-specific initialization routines for the
diff --git a/arch/arm/mach-imx/mx31lite-db.c b/arch/arm/mach-imx/mx31lite-db.c
index 83d17d9e0bc8..5a160b7e4fce 100644
--- a/arch/arm/mach-imx/mx31lite-db.c
+++ b/arch/arm/mach-imx/mx31lite-db.c
@@ -31,12 +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 <mach/hardware.h> 34#include "board-mx31lite.h"
35#include <mach/common.h> 35#include "common.h"
36#include <mach/iomux-mx3.h>
37#include <mach/board-mx31lite.h>
38
39#include "devices-imx31.h" 36#include "devices-imx31.h"
37#include "hardware.h"
38#include "iomux-mx3.h"
40 39
41/* 40/*
42 * This file contains board-specific initialization routines for the 41 * This file contains board-specific initialization routines for the
diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index cc285e507286..52d5b1574721 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -22,12 +22,11 @@
22 22
23#include <linux/usb/otg.h> 23#include <linux/usb/otg.h>
24 24
25#include <mach/common.h> 25#include "common.h"
26#include <mach/iomux-mx3.h>
27#include <mach/hardware.h>
28#include <mach/ulpi.h>
29
30#include "devices-imx31.h" 26#include "devices-imx31.h"
27#include "hardware.h"
28#include "iomux-mx3.h"
29#include "ulpi.h"
31 30
32static unsigned int devboard_pins[] = { 31static unsigned int devboard_pins[] = {
33 /* UART1 */ 32 /* UART1 */
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index 135c90e3a45f..a4f43e90f3c1 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -24,14 +24,13 @@
24 24
25#include <linux/usb/otg.h> 25#include <linux/usb/otg.h>
26 26
27#include <mach/common.h>
28#include <mach/hardware.h>
29#include <mach/iomux-mx3.h>
30#include <mach/ulpi.h>
31
32#include <media/soc_camera.h> 27#include <media/soc_camera.h>
33 28
29#include "common.h"
34#include "devices-imx31.h" 30#include "devices-imx31.h"
31#include "hardware.h"
32#include "iomux-mx3.h"
33#include "ulpi.h"
35 34
36static unsigned int marxbot_pins[] = { 35static unsigned int marxbot_pins[] = {
37 /* SDHC2 */ 36 /* SDHC2 */
diff --git a/arch/arm/mach-imx/mx31moboard-smartbot.c b/arch/arm/mach-imx/mx31moboard-smartbot.c
index fabb801e7994..04ae45dbfaa7 100644
--- a/arch/arm/mach-imx/mx31moboard-smartbot.c
+++ b/arch/arm/mach-imx/mx31moboard-smartbot.c
@@ -23,15 +23,14 @@
23#include <linux/usb/otg.h> 23#include <linux/usb/otg.h>
24#include <linux/usb/ulpi.h> 24#include <linux/usb/ulpi.h>
25 25
26#include <mach/common.h>
27#include <mach/hardware.h>
28#include <mach/iomux-mx3.h>
29#include <mach/board-mx31moboard.h>
30#include <mach/ulpi.h>
31
32#include <media/soc_camera.h> 26#include <media/soc_camera.h>
33 27
28#include "board-mx31moboard.h"
29#include "common.h"
34#include "devices-imx31.h" 30#include "devices-imx31.h"
31#include "hardware.h"
32#include "iomux-mx3.h"
33#include "ulpi.h"
35 34
36static unsigned int smartbot_pins[] = { 35static unsigned int smartbot_pins[] = {
37 /* UART1 */ 36 /* UART1 */
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/mach-imx/mx35.h
index 2af5d3a699c7..2af5d3a699c7 100644
--- a/arch/arm/plat-mxc/include/mach/mx35.h
+++ b/arch/arm/mach-imx/mx35.h
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/mach-imx/mx3x.h
index 96fb4fbc8ad7..96fb4fbc8ad7 100644
--- a/arch/arm/plat-mxc/include/mach/mx3x.h
+++ b/arch/arm/mach-imx/mx3x.h
diff --git a/arch/arm/plat-mxc/include/mach/mx50.h b/arch/arm/mach-imx/mx50.h
index 09ac19c1570c..09ac19c1570c 100644
--- a/arch/arm/plat-mxc/include/mach/mx50.h
+++ b/arch/arm/mach-imx/mx50.h
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/mach-imx/mx51.h
index af844f76261a..af844f76261a 100644
--- a/arch/arm/plat-mxc/include/mach/mx51.h
+++ b/arch/arm/mach-imx/mx51.h
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/mach-imx/mx53.h
index f829d1c22501..f829d1c22501 100644
--- a/arch/arm/plat-mxc/include/mach/mx53.h
+++ b/arch/arm/mach-imx/mx53.h
diff --git a/arch/arm/plat-mxc/include/mach/mx6q.h b/arch/arm/mach-imx/mx6q.h
index f7e7dbac8f4b..19d3f54db5af 100644
--- a/arch/arm/plat-mxc/include/mach/mx6q.h
+++ b/arch/arm/mach-imx/mx6q.h
@@ -27,9 +27,5 @@
27#define MX6Q_CCM_SIZE 0x4000 27#define MX6Q_CCM_SIZE 0x4000
28#define MX6Q_ANATOP_BASE_ADDR 0x020c8000 28#define MX6Q_ANATOP_BASE_ADDR 0x020c8000
29#define MX6Q_ANATOP_SIZE 0x1000 29#define MX6Q_ANATOP_SIZE 0x1000
30#define MX6Q_UART2_BASE_ADDR 0x021e8000
31#define MX6Q_UART2_SIZE 0x4000
32#define MX6Q_UART4_BASE_ADDR 0x021f0000
33#define MX6Q_UART4_SIZE 0x4000
34 30
35#endif /* __MACH_MX6Q_H__ */ 31#endif /* __MACH_MX6Q_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/mach-imx/mxc.h
index d78298366a91..d78298366a91 100644
--- a/arch/arm/plat-mxc/include/mach/mxc.h
+++ b/arch/arm/mach-imx/mxc.h
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c
index 9917e2ff51da..51c608234089 100644
--- a/arch/arm/mach-imx/pcm970-baseboard.c
+++ b/arch/arm/mach-imx/pcm970-baseboard.c
@@ -23,11 +23,10 @@
23 23
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25 25
26#include <mach/common.h> 26#include "common.h"
27#include <mach/iomux-mx27.h>
28#include <mach/hardware.h>
29
30#include "devices-imx27.h" 27#include "devices-imx27.h"
28#include "hardware.h"
29#include "iomux-mx27.h"
31 30
32static const int pcm970_pins[] __initconst = { 31static const int pcm970_pins[] __initconst = {
33 /* SDHC */ 32 /* SDHC */
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index 2ac43e1a2dfd..3777b805b76b 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -16,8 +16,9 @@
16#include <asm/smp_scu.h> 16#include <asm/smp_scu.h>
17#include <asm/hardware/gic.h> 17#include <asm/hardware/gic.h>
18#include <asm/mach/map.h> 18#include <asm/mach/map.h>
19#include <mach/common.h> 19
20#include <mach/hardware.h> 20#include "common.h"
21#include "hardware.h"
21 22
22static void __iomem *scu_base; 23static void __iomem *scu_base;
23 24
diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c
index 6fcffa7db978..56d02d064fbf 100644
--- a/arch/arm/mach-imx/pm-imx27.c
+++ b/arch/arm/mach-imx/pm-imx27.c
@@ -10,7 +10,8 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/suspend.h> 11#include <linux/suspend.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <mach/hardware.h> 13
14#include "hardware.h"
14 15
15static int mx27_suspend_enter(suspend_state_t state) 16static int mx27_suspend_enter(suspend_state_t state)
16{ 17{
diff --git a/arch/arm/mach-imx/pm-imx3.c b/arch/arm/mach-imx/pm-imx3.c
index 822103bdb709..6a07006ff0f4 100644
--- a/arch/arm/mach-imx/pm-imx3.c
+++ b/arch/arm/mach-imx/pm-imx3.c
@@ -9,10 +9,11 @@
9 * http://www.gnu.org/copyleft/gpl.html 9 * http://www.gnu.org/copyleft/gpl.html
10 */ 10 */
11#include <linux/io.h> 11#include <linux/io.h>
12#include <mach/common.h> 12
13#include <mach/hardware.h> 13#include "common.h"
14#include <mach/devices-common.h>
15#include "crmregs-imx3.h" 14#include "crmregs-imx3.h"
15#include "devices/devices-common.h"
16#include "hardware.h"
16 17
17/* 18/*
18 * Set cpu low power mode before WFI instruction. This function is called 19 * Set cpu low power mode before WFI instruction. This function is called
diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
index 19621ed1ffa5..2e063c2deb9e 100644
--- a/arch/arm/mach-imx/pm-imx5.c
+++ b/arch/arm/mach-imx/pm-imx5.c
@@ -16,10 +16,11 @@
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/system_misc.h> 17#include <asm/system_misc.h>
18#include <asm/tlbflush.h> 18#include <asm/tlbflush.h>
19#include <mach/common.h> 19
20#include <mach/cpuidle.h> 20#include "common.h"
21#include <mach/hardware.h> 21#include "cpuidle.h"
22#include "crm-regs-imx5.h" 22#include "crm-regs-imx5.h"
23#include "hardware.h"
23 24
24/* 25/*
25 * The WAIT_UNCLOCKED_POWER_OFF state only requires <= 500ns to exit. 26 * The WAIT_UNCLOCKED_POWER_OFF state only requires <= 500ns to exit.
diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c
index f7b0c2b1b905..a17543da602d 100644
--- a/arch/arm/mach-imx/pm-imx6q.c
+++ b/arch/arm/mach-imx/pm-imx6q.c
@@ -18,8 +18,9 @@
18#include <asm/proc-fns.h> 18#include <asm/proc-fns.h>
19#include <asm/suspend.h> 19#include <asm/suspend.h>
20#include <asm/hardware/cache-l2x0.h> 20#include <asm/hardware/cache-l2x0.h>
21#include <mach/common.h> 21
22#include <mach/hardware.h> 22#include "common.h"
23#include "hardware.h"
23 24
24extern unsigned long phys_l2x0_saved_regs; 25extern unsigned long phys_l2x0_saved_regs;
25 26
diff --git a/arch/arm/plat-mxc/ssi-fiq-ksym.c b/arch/arm/mach-imx/ssi-fiq-ksym.c
index 792090f9a032..792090f9a032 100644
--- a/arch/arm/plat-mxc/ssi-fiq-ksym.c
+++ b/arch/arm/mach-imx/ssi-fiq-ksym.c
diff --git a/arch/arm/plat-mxc/ssi-fiq.S b/arch/arm/mach-imx/ssi-fiq.S
index a8b93c5f29b5..a8b93c5f29b5 100644
--- a/arch/arm/plat-mxc/ssi-fiq.S
+++ b/arch/arm/mach-imx/ssi-fiq.S
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/mach-imx/system.c
index 3da78cfc5a94..695e0d73bf85 100644
--- a/arch/arm/plat-mxc/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -22,12 +22,13 @@
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24 24
25#include <mach/hardware.h>
26#include <mach/common.h>
27#include <asm/system_misc.h> 25#include <asm/system_misc.h>
28#include <asm/proc-fns.h> 26#include <asm/proc-fns.h>
29#include <asm/mach-types.h> 27#include <asm/mach-types.h>
30 28
29#include "common.h"
30#include "hardware.h"
31
31static void __iomem *wdog_base; 32static void __iomem *wdog_base;
32 33
33/* 34/*
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/mach-imx/time.c
index a17abcf98325..f017302f6d09 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -27,10 +27,11 @@
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/err.h> 28#include <linux/err.h>
29 29
30#include <mach/hardware.h>
31#include <asm/sched_clock.h> 30#include <asm/sched_clock.h>
32#include <asm/mach/time.h> 31#include <asm/mach/time.h>
33#include <mach/common.h> 32
33#include "common.h"
34#include "hardware.h"
34 35
35/* 36/*
36 * There are 2 versions of the timer hardware on Freescale MXC hardware. 37 * There are 2 versions of the timer hardware on Freescale MXC hardware.
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/mach-imx/tzic.c
index 3ed1adbc09f8..9721161f208f 100644
--- a/arch/arm/plat-mxc/tzic.c
+++ b/arch/arm/mach-imx/tzic.c
@@ -21,10 +21,8 @@
21#include <asm/mach/irq.h> 21#include <asm/mach/irq.h>
22#include <asm/exception.h> 22#include <asm/exception.h>
23 23
24#include <mach/hardware.h> 24#include "common.h"
25#include <mach/common.h> 25#include "hardware.h"
26#include <mach/irqs.h>
27
28#include "irq-common.h" 26#include "irq-common.h"
29 27
30/* 28/*
diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/mach-imx/ulpi.c
index d2963427184f..0f051957d10c 100644
--- a/arch/arm/plat-mxc/ulpi.c
+++ b/arch/arm/mach-imx/ulpi.c
@@ -24,7 +24,7 @@
24#include <linux/usb/otg.h> 24#include <linux/usb/otg.h>
25#include <linux/usb/ulpi.h> 25#include <linux/usb/ulpi.h>
26 26
27#include <mach/ulpi.h> 27#include "ulpi.h"
28 28
29/* ULPIVIEW register bits */ 29/* ULPIVIEW register bits */
30#define ULPIVW_WU (1 << 31) /* Wakeup */ 30#define ULPIVW_WU (1 << 31) /* Wakeup */
diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/mach-imx/ulpi.h
index 42bdaca6d7d9..42bdaca6d7d9 100644
--- a/arch/arm/plat-mxc/include/mach/ulpi.h
+++ b/arch/arm/mach-imx/ulpi.h
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 4748ec551a68..98070370d602 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -100,6 +100,25 @@ static struct fb_videomode apx4devkit_video_modes[] = {
100 }, 100 },
101}; 101};
102 102
103static struct fb_videomode apf28dev_video_modes[] = {
104 {
105 .name = "LW700",
106 .refresh = 60,
107 .xres = 800,
108 .yres = 480,
109 .pixclock = 30303, /* picosecond */
110 .left_margin = 96,
111 .right_margin = 96, /* at least 3 & 1 */
112 .upper_margin = 0x14,
113 .lower_margin = 0x15,
114 .hsync_len = 64,
115 .vsync_len = 4,
116 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT |
117 FB_SYNC_DATA_ENABLE_HIGH_ACT |
118 FB_SYNC_DOTCLK_FAILING_ACT,
119 },
120};
121
103static struct mxsfb_platform_data mxsfb_pdata __initdata; 122static struct mxsfb_platform_data mxsfb_pdata __initdata;
104 123
105/* 124/*
@@ -160,6 +179,7 @@ static struct sys_timer imx28_timer = {
160enum mac_oui { 179enum mac_oui {
161 OUI_FSL, 180 OUI_FSL,
162 OUI_DENX, 181 OUI_DENX,
182 OUI_CRYSTALFONTZ,
163}; 183};
164 184
165static void __init update_fec_mac_prop(enum mac_oui oui) 185static void __init update_fec_mac_prop(enum mac_oui oui)
@@ -175,8 +195,12 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
175 np = of_find_compatible_node(from, NULL, "fsl,imx28-fec"); 195 np = of_find_compatible_node(from, NULL, "fsl,imx28-fec");
176 if (!np) 196 if (!np)
177 return; 197 return;
198
178 from = np; 199 from = np;
179 200
201 if (of_get_property(np, "local-mac-address", NULL))
202 continue;
203
180 newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL); 204 newmac = kzalloc(sizeof(*newmac) + 6, GFP_KERNEL);
181 if (!newmac) 205 if (!newmac)
182 return; 206 return;
@@ -205,6 +229,11 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
205 macaddr[1] = 0xe5; 229 macaddr[1] = 0xe5;
206 macaddr[2] = 0x4e; 230 macaddr[2] = 0x4e;
207 break; 231 break;
232 case OUI_CRYSTALFONTZ:
233 macaddr[0] = 0x58;
234 macaddr[1] = 0xb9;
235 macaddr[2] = 0xe1;
236 break;
208 } 237 }
209 val = ocotp[i]; 238 val = ocotp[i];
210 macaddr[3] = (val >> 16) & 0xff; 239 macaddr[3] = (val >> 16) & 0xff;
@@ -261,6 +290,11 @@ static void __init m28evk_init(void)
261 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT; 290 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
262} 291}
263 292
293static void __init sc_sps1_init(void)
294{
295 enable_clk_enet_out();
296}
297
264static int apx4devkit_phy_fixup(struct phy_device *phy) 298static int apx4devkit_phy_fixup(struct phy_device *phy)
265{ 299{
266 phy->dev_flags |= MICREL_PHY_50MHZ_CLK; 300 phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
@@ -355,6 +389,22 @@ static void __init tx28_post_init(void)
355 pinctrl_put(pctl); 389 pinctrl_put(pctl);
356} 390}
357 391
392static void __init cfa10049_init(void)
393{
394 enable_clk_enet_out();
395 update_fec_mac_prop(OUI_CRYSTALFONTZ);
396}
397
398static void __init apf28_init(void)
399{
400 enable_clk_enet_out();
401
402 mxsfb_pdata.mode_list = apf28dev_video_modes;
403 mxsfb_pdata.mode_count = ARRAY_SIZE(apf28dev_video_modes);
404 mxsfb_pdata.default_bpp = 16;
405 mxsfb_pdata.ld_intf_width = STMLCDIF_16BIT;
406}
407
358static void __init mxs_machine_init(void) 408static void __init mxs_machine_init(void)
359{ 409{
360 if (of_machine_is_compatible("fsl,imx28-evk")) 410 if (of_machine_is_compatible("fsl,imx28-evk"))
@@ -365,6 +415,12 @@ static void __init mxs_machine_init(void)
365 m28evk_init(); 415 m28evk_init();
366 else if (of_machine_is_compatible("bluegiga,apx4devkit")) 416 else if (of_machine_is_compatible("bluegiga,apx4devkit"))
367 apx4devkit_init(); 417 apx4devkit_init();
418 else if (of_machine_is_compatible("crystalfontz,cfa10049"))
419 cfa10049_init();
420 else if (of_machine_is_compatible("armadeus,imx28-apf28"))
421 apf28_init();
422 else if (of_machine_is_compatible("schulercontrol,imx28-sps1"))
423 sc_sps1_init();
368 424
369 of_platform_populate(NULL, of_default_bus_match_table, 425 of_platform_populate(NULL, of_default_bus_match_table,
370 mxs_auxdata_lookup, NULL); 426 mxs_auxdata_lookup, NULL);
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index 7c3792613392..856f4c796061 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -29,6 +29,7 @@
29#include <linux/of_irq.h> 29#include <linux/of_irq.h>
30 30
31#include <asm/mach/time.h> 31#include <asm/mach/time.h>
32#include <asm/sched_clock.h>
32#include <mach/mxs.h> 33#include <mach/mxs.h>
33#include <mach/common.h> 34#include <mach/common.h>
34 35
@@ -233,15 +234,22 @@ static struct clocksource clocksource_mxs = {
233 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 234 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
234}; 235};
235 236
237static u32 notrace mxs_read_sched_clock_v2(void)
238{
239 return ~readl_relaxed(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1));
240}
241
236static int __init mxs_clocksource_init(struct clk *timer_clk) 242static int __init mxs_clocksource_init(struct clk *timer_clk)
237{ 243{
238 unsigned int c = clk_get_rate(timer_clk); 244 unsigned int c = clk_get_rate(timer_clk);
239 245
240 if (timrot_is_v1()) 246 if (timrot_is_v1())
241 clocksource_register_hz(&clocksource_mxs, c); 247 clocksource_register_hz(&clocksource_mxs, c);
242 else 248 else {
243 clocksource_mmio_init(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1), 249 clocksource_mmio_init(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1),
244 "mxs_timer", c, 200, 32, clocksource_mmio_readl_down); 250 "mxs_timer", c, 200, 32, clocksource_mmio_readl_down);
251 setup_sched_clock(mxs_read_sched_clock_v2, 32, c);
252 }
245 253
246 return 0; 254 return 0;
247} 255}
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index cd169c386161..f0e69cbc5baa 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -3,7 +3,8 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o 6obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \
7 serial.o devices.o dma.o
7obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o timer.o 8obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o timer.o
8 9
9ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) 10ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index e255164ff087..a8fce3ccc707 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -625,7 +625,6 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
625 .atag_offset = 0x100, 625 .atag_offset = 0x100,
626 .map_io = ams_delta_map_io, 626 .map_io = ams_delta_map_io,
627 .init_early = omap1_init_early, 627 .init_early = omap1_init_early,
628 .reserve = omap_reserve,
629 .init_irq = omap1_init_irq, 628 .init_irq = omap1_init_irq,
630 .init_machine = ams_delta_init, 629 .init_machine = ams_delta_init,
631 .init_late = ams_delta_init_late, 630 .init_late = ams_delta_init_late,
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 4b6de70c47a6..e067f221f0f9 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -27,16 +27,16 @@
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 29
30#include <plat/tc.h> 30#include <mach/tc.h>
31#include <mach/mux.h> 31#include <mach/mux.h>
32#include <mach/flash.h> 32#include <mach/flash.h>
33#include <plat/fpga.h>
34#include <linux/platform_data/keypad-omap.h> 33#include <linux/platform_data/keypad-omap.h>
35 34
36#include <mach/hardware.h> 35#include <mach/hardware.h>
37 36
38#include "iomap.h" 37#include "iomap.h"
39#include "common.h" 38#include "common.h"
39#include "fpga.h"
40 40
41/* fsample is pretty close to p2-sample */ 41/* fsample is pretty close to p2-sample */
42 42
@@ -123,9 +123,9 @@ static struct resource smc91x_resources[] = {
123 123
124static void __init fsample_init_smc91x(void) 124static void __init fsample_init_smc91x(void)
125{ 125{
126 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); 126 __raw_writeb(1, H2P2_DBG_FPGA_LAN_RESET);
127 mdelay(50); 127 mdelay(50);
128 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, 128 __raw_writeb(__raw_readb(H2P2_DBG_FPGA_LAN_RESET) & ~1,
129 H2P2_DBG_FPGA_LAN_RESET); 129 H2P2_DBG_FPGA_LAN_RESET);
130 mdelay(50); 130 mdelay(50);
131} 131}
@@ -362,7 +362,6 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
362 .atag_offset = 0x100, 362 .atag_offset = 0x100,
363 .map_io = omap_fsample_map_io, 363 .map_io = omap_fsample_map_io,
364 .init_early = omap1_init_early, 364 .init_early = omap1_init_early,
365 .reserve = omap_reserve,
366 .init_irq = omap1_init_irq, 365 .init_irq = omap1_init_irq,
367 .init_machine = omap_fsample_init, 366 .init_machine = omap_fsample_init,
368 .init_late = omap1_init_late, 367 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 4ec579fdd366..608e7d2a2778 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -81,7 +81,6 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
81 .atag_offset = 0x100, 81 .atag_offset = 0x100,
82 .map_io = omap16xx_map_io, 82 .map_io = omap16xx_map_io,
83 .init_early = omap1_init_early, 83 .init_early = omap1_init_early,
84 .reserve = omap_reserve,
85 .init_irq = omap1_init_irq, 84 .init_irq = omap1_init_irq,
86 .init_machine = omap_generic_init, 85 .init_machine = omap_generic_init,
87 .init_late = omap1_init_late, 86 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c
index e1362ce48497..7119ef28e0ad 100644
--- a/arch/arm/mach-omap1/board-h2-mmc.c
+++ b/arch/arm/mach-omap1/board-h2-mmc.c
@@ -13,12 +13,11 @@
13 */ 13 */
14#include <linux/gpio.h> 14#include <linux/gpio.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16 16#include <linux/platform_data/gpio-omap.h>
17#include <linux/i2c/tps65010.h> 17#include <linux/i2c/tps65010.h>
18 18
19#include <plat/mmc.h>
20
21#include "board-h2.h" 19#include "board-h2.h"
20#include "mmc.h"
22 21
23#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
24 23
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 376f7f29ef77..9134b646f01b 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -39,8 +39,8 @@
39#include <asm/mach/map.h> 39#include <asm/mach/map.h>
40 40
41#include <mach/mux.h> 41#include <mach/mux.h>
42#include <plat/dma.h> 42#include <plat-omap/dma-omap.h>
43#include <plat/tc.h> 43#include <mach/tc.h>
44#include <mach/irda.h> 44#include <mach/irda.h>
45#include <linux/platform_data/keypad-omap.h> 45#include <linux/platform_data/keypad-omap.h>
46#include <mach/flash.h> 46#include <mach/flash.h>
@@ -50,6 +50,7 @@
50 50
51#include "common.h" 51#include "common.h"
52#include "board-h2.h" 52#include "board-h2.h"
53#include "dma.h"
53 54
54/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 55/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
55#define OMAP1610_ETHR_START 0x04000300 56#define OMAP1610_ETHR_START 0x04000300
@@ -458,7 +459,6 @@ MACHINE_START(OMAP_H2, "TI-H2")
458 .atag_offset = 0x100, 459 .atag_offset = 0x100,
459 .map_io = omap16xx_map_io, 460 .map_io = omap16xx_map_io,
460 .init_early = omap1_init_early, 461 .init_early = omap1_init_early,
461 .reserve = omap_reserve,
462 .init_irq = omap1_init_irq, 462 .init_irq = omap1_init_irq,
463 .init_machine = h2_init, 463 .init_machine = h2_init,
464 .init_late = omap1_init_late, 464 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c
index c74daace8cd6..17d77914d769 100644
--- a/arch/arm/mach-omap1/board-h3-mmc.c
+++ b/arch/arm/mach-omap1/board-h3-mmc.c
@@ -16,9 +16,8 @@
16 16
17#include <linux/i2c/tps65010.h> 17#include <linux/i2c/tps65010.h>
18 18
19#include <plat/mmc.h>
20
21#include "board-h3.h" 19#include "board-h3.h"
20#include "mmc.h"
22 21
23#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
24 23
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index ededdb7ef28c..bf213d1d8075 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -41,9 +41,9 @@
41#include <asm/mach/map.h> 41#include <asm/mach/map.h>
42 42
43#include <mach/mux.h> 43#include <mach/mux.h>
44#include <plat/tc.h> 44#include <mach/tc.h>
45#include <linux/platform_data/keypad-omap.h> 45#include <linux/platform_data/keypad-omap.h>
46#include <plat/dma.h> 46#include <plat-omap/dma-omap.h>
47#include <mach/flash.h> 47#include <mach/flash.h>
48 48
49#include <mach/hardware.h> 49#include <mach/hardware.h>
@@ -452,7 +452,6 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
452 .atag_offset = 0x100, 452 .atag_offset = 0x100,
453 .map_io = omap16xx_map_io, 453 .map_io = omap16xx_map_io,
454 .init_early = omap1_init_early, 454 .init_early = omap1_init_early,
455 .reserve = omap_reserve,
456 .init_irq = omap1_init_irq, 455 .init_irq = omap1_init_irq,
457 .init_machine = h3_init, 456 .init_machine = h3_init,
458 .init_late = omap1_init_late, 457 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 87ab2086ef96..356f816c84a6 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -43,7 +43,7 @@
43#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
44 44
45#include <mach/omap7xx.h> 45#include <mach/omap7xx.h>
46#include <plat/mmc.h> 46#include "mmc.h"
47 47
48#include <mach/irqs.h> 48#include <mach/irqs.h>
49#include <mach/usb.h> 49#include <mach/usb.h>
@@ -600,7 +600,6 @@ MACHINE_START(HERALD, "HTC Herald")
600 .atag_offset = 0x100, 600 .atag_offset = 0x100,
601 .map_io = htcherald_map_io, 601 .map_io = htcherald_map_io,
602 .init_early = omap1_init_early, 602 .init_early = omap1_init_early,
603 .reserve = omap_reserve,
604 .init_irq = omap1_init_irq, 603 .init_irq = omap1_init_irq,
605 .init_machine = htcherald_init, 604 .init_machine = htcherald_init,
606 .init_late = omap1_init_late, 605 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index db5f7d2976e7..f8033fab0f82 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -33,16 +33,15 @@
33 33
34#include <mach/mux.h> 34#include <mach/mux.h>
35#include <mach/flash.h> 35#include <mach/flash.h>
36#include <plat/fpga.h> 36#include <mach/tc.h>
37#include <plat/tc.h>
38#include <linux/platform_data/keypad-omap.h> 37#include <linux/platform_data/keypad-omap.h>
39#include <plat/mmc.h>
40 38
41#include <mach/hardware.h> 39#include <mach/hardware.h>
42#include <mach/usb.h> 40#include <mach/usb.h>
43 41
44#include "iomap.h" 42#include "iomap.h"
45#include "common.h" 43#include "common.h"
44#include "mmc.h"
46 45
47/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 46/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
48#define INNOVATOR1610_ETHR_START 0x04000300 47#define INNOVATOR1610_ETHR_START 0x04000300
@@ -215,7 +214,7 @@ static struct platform_device *innovator1510_devices[] __initdata = {
215 214
216static int innovator_get_pendown_state(void) 215static int innovator_get_pendown_state(void)
217{ 216{
218 return !(fpga_read(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5)); 217 return !(__raw_readb(OMAP1510_FPGA_TOUCHSCREEN) & (1 << 5));
219} 218}
220 219
221static const struct ads7846_platform_data innovator1510_ts_info = { 220static const struct ads7846_platform_data innovator1510_ts_info = {
@@ -279,7 +278,7 @@ static struct platform_device *innovator1610_devices[] __initdata = {
279static void __init innovator_init_smc91x(void) 278static void __init innovator_init_smc91x(void)
280{ 279{
281 if (cpu_is_omap1510()) { 280 if (cpu_is_omap1510()) {
282 fpga_write(fpga_read(OMAP1510_FPGA_RST) & ~1, 281 __raw_writeb(__raw_readb(OMAP1510_FPGA_RST) & ~1,
283 OMAP1510_FPGA_RST); 282 OMAP1510_FPGA_RST);
284 udelay(750); 283 udelay(750);
285 } else { 284 } else {
@@ -335,10 +334,10 @@ static int mmc_set_power(struct device *dev, int slot, int power_on,
335 int vdd) 334 int vdd)
336{ 335{
337 if (power_on) 336 if (power_on)
338 fpga_write(fpga_read(OMAP1510_FPGA_POWER) | (1 << 3), 337 __raw_writeb(__raw_readb(OMAP1510_FPGA_POWER) | (1 << 3),
339 OMAP1510_FPGA_POWER); 338 OMAP1510_FPGA_POWER);
340 else 339 else
341 fpga_write(fpga_read(OMAP1510_FPGA_POWER) & ~(1 << 3), 340 __raw_writeb(__raw_readb(OMAP1510_FPGA_POWER) & ~(1 << 3),
342 OMAP1510_FPGA_POWER); 341 OMAP1510_FPGA_POWER);
343 342
344 return 0; 343 return 0;
@@ -390,14 +389,14 @@ static void __init innovator_init(void)
390 omap_cfg_reg(UART3_TX); 389 omap_cfg_reg(UART3_TX);
391 omap_cfg_reg(UART3_RX); 390 omap_cfg_reg(UART3_RX);
392 391
393 reg = fpga_read(OMAP1510_FPGA_POWER); 392 reg = __raw_readb(OMAP1510_FPGA_POWER);
394 reg |= OMAP1510_FPGA_PCR_COM1_EN; 393 reg |= OMAP1510_FPGA_PCR_COM1_EN;
395 fpga_write(reg, OMAP1510_FPGA_POWER); 394 __raw_writeb(reg, OMAP1510_FPGA_POWER);
396 udelay(10); 395 udelay(10);
397 396
398 reg = fpga_read(OMAP1510_FPGA_POWER); 397 reg = __raw_readb(OMAP1510_FPGA_POWER);
399 reg |= OMAP1510_FPGA_PCR_COM2_EN; 398 reg |= OMAP1510_FPGA_PCR_COM2_EN;
400 fpga_write(reg, OMAP1510_FPGA_POWER); 399 __raw_writeb(reg, OMAP1510_FPGA_POWER);
401 udelay(10); 400 udelay(10);
402 401
403 platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices)); 402 platform_add_devices(innovator1510_devices, ARRAY_SIZE(innovator1510_devices));
@@ -437,6 +436,7 @@ static void __init innovator_init(void)
437 */ 436 */
438static void __init innovator_map_io(void) 437static void __init innovator_map_io(void)
439{ 438{
439#ifdef CONFIG_ARCH_OMAP15XX
440 omap15xx_map_io(); 440 omap15xx_map_io();
441 441
442 iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc)); 442 iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc));
@@ -444,9 +444,10 @@ static void __init innovator_map_io(void)
444 444
445 /* Dump the Innovator FPGA rev early - useful info for support. */ 445 /* Dump the Innovator FPGA rev early - useful info for support. */
446 pr_debug("Innovator FPGA Rev %d.%d Board Rev %d\n", 446 pr_debug("Innovator FPGA Rev %d.%d Board Rev %d\n",
447 fpga_read(OMAP1510_FPGA_REV_HIGH), 447 __raw_readb(OMAP1510_FPGA_REV_HIGH),
448 fpga_read(OMAP1510_FPGA_REV_LOW), 448 __raw_readb(OMAP1510_FPGA_REV_LOW),
449 fpga_read(OMAP1510_FPGA_BOARD_REV)); 449 __raw_readb(OMAP1510_FPGA_BOARD_REV));
450#endif
450} 451}
451 452
452MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") 453MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
@@ -454,7 +455,6 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
454 .atag_offset = 0x100, 455 .atag_offset = 0x100,
455 .map_io = innovator_map_io, 456 .map_io = innovator_map_io,
456 .init_early = omap1_init_early, 457 .init_early = omap1_init_early,
457 .reserve = omap_reserve,
458 .init_irq = omap1_init_irq, 458 .init_irq = omap1_init_irq,
459 .init_machine = innovator_init, 459 .init_machine = innovator_init,
460 .init_late = omap1_init_late, 460 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 7d5c06d6a52a..3e8ead67e459 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -29,13 +29,13 @@
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30 30
31#include <mach/mux.h> 31#include <mach/mux.h>
32#include <plat/mmc.h>
33#include <plat/clock.h>
34 32
35#include <mach/hardware.h> 33#include <mach/hardware.h>
36#include <mach/usb.h> 34#include <mach/usb.h>
37 35
38#include "common.h" 36#include "common.h"
37#include "clock.h"
38#include "mmc.h"
39 39
40#define ADS7846_PENDOWN_GPIO 15 40#define ADS7846_PENDOWN_GPIO 15
41 41
@@ -251,7 +251,6 @@ MACHINE_START(NOKIA770, "Nokia 770")
251 .atag_offset = 0x100, 251 .atag_offset = 0x100,
252 .map_io = omap16xx_map_io, 252 .map_io = omap16xx_map_io,
253 .init_early = omap1_init_early, 253 .init_early = omap1_init_early,
254 .reserve = omap_reserve,
255 .init_irq = omap1_init_irq, 254 .init_irq = omap1_init_irq,
256 .init_machine = omap_nokia770_init, 255 .init_machine = omap_nokia770_init,
257 .init_late = omap1_init_late, 256 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 5973945a8741..872ea47cd28a 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -48,7 +48,7 @@
48 48
49#include <mach/flash.h> 49#include <mach/flash.h>
50#include <mach/mux.h> 50#include <mach/mux.h>
51#include <plat/tc.h> 51#include <mach/tc.h>
52 52
53#include <mach/hardware.h> 53#include <mach/hardware.h>
54#include <mach/usb.h> 54#include <mach/usb.h>
@@ -606,7 +606,6 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
606 .atag_offset = 0x100, 606 .atag_offset = 0x100,
607 .map_io = omap16xx_map_io, 607 .map_io = omap16xx_map_io,
608 .init_early = omap1_init_early, 608 .init_early = omap1_init_early,
609 .reserve = omap_reserve,
610 .init_irq = omap1_init_irq, 609 .init_irq = omap1_init_irq,
611 .init_machine = osk_init, 610 .init_machine = osk_init,
612 .init_late = omap1_init_late, 611 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 1c578d58923a..584b6fab894b 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -36,8 +36,8 @@
36 36
37#include <mach/flash.h> 37#include <mach/flash.h>
38#include <mach/mux.h> 38#include <mach/mux.h>
39#include <plat/tc.h> 39#include <mach/tc.h>
40#include <plat/dma.h> 40#include <plat-omap/dma-omap.h>
41#include <mach/irda.h> 41#include <mach/irda.h>
42#include <linux/platform_data/keypad-omap.h> 42#include <linux/platform_data/keypad-omap.h>
43 43
@@ -45,6 +45,7 @@
45#include <mach/usb.h> 45#include <mach/usb.h>
46 46
47#include "common.h" 47#include "common.h"
48#include "dma.h"
48 49
49#define PALMTE_USBDETECT_GPIO 0 50#define PALMTE_USBDETECT_GPIO 0
50#define PALMTE_USB_OR_DC_GPIO 1 51#define PALMTE_USB_OR_DC_GPIO 1
@@ -264,7 +265,6 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
264 .atag_offset = 0x100, 265 .atag_offset = 0x100,
265 .map_io = omap15xx_map_io, 266 .map_io = omap15xx_map_io,
266 .init_early = omap1_init_early, 267 .init_early = omap1_init_early,
267 .reserve = omap_reserve,
268 .init_irq = omap1_init_irq, 268 .init_irq = omap1_init_irq,
269 .init_machine = omap_palmte_init, 269 .init_machine = omap_palmte_init,
270 .init_late = omap1_init_late, 270 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 97158095083c..fbc986bfe69e 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -28,16 +28,16 @@
28#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
29#include <linux/spi/ads7846.h> 29#include <linux/spi/ads7846.h>
30#include <linux/platform_data/omap1_bl.h> 30#include <linux/platform_data/omap1_bl.h>
31#include <linux/platform_data/leds-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/led.h>
37#include <mach/flash.h> 37#include <mach/flash.h>
38#include <mach/mux.h> 38#include <mach/mux.h>
39#include <plat/dma.h> 39#include <plat-omap/dma-omap.h>
40#include <plat/tc.h> 40#include <mach/tc.h>
41#include <mach/irda.h> 41#include <mach/irda.h>
42#include <linux/platform_data/keypad-omap.h> 42#include <linux/platform_data/keypad-omap.h>
43 43
@@ -45,6 +45,7 @@
45#include <mach/usb.h> 45#include <mach/usb.h>
46 46
47#include "common.h" 47#include "common.h"
48#include "dma.h"
48 49
49#define PALMTT_USBDETECT_GPIO 0 50#define PALMTT_USBDETECT_GPIO 0
50#define PALMTT_CABLE_GPIO 1 51#define PALMTT_CABLE_GPIO 1
@@ -310,7 +311,6 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
310 .atag_offset = 0x100, 311 .atag_offset = 0x100,
311 .map_io = omap15xx_map_io, 312 .map_io = omap15xx_map_io,
312 .init_early = omap1_init_early, 313 .init_early = omap1_init_early,
313 .reserve = omap_reserve,
314 .init_irq = omap1_init_irq, 314 .init_irq = omap1_init_irq,
315 .init_machine = omap_palmtt_init, 315 .init_machine = omap_palmtt_init,
316 .init_late = omap1_init_late, 316 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index e311032e7eeb..60d917a93763 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -38,8 +38,8 @@
38 38
39#include <mach/flash.h> 39#include <mach/flash.h>
40#include <mach/mux.h> 40#include <mach/mux.h>
41#include <plat/dma.h> 41#include <plat-omap/dma-omap.h>
42#include <plat/tc.h> 42#include <mach/tc.h>
43#include <mach/irda.h> 43#include <mach/irda.h>
44#include <linux/platform_data/keypad-omap.h> 44#include <linux/platform_data/keypad-omap.h>
45 45
@@ -47,6 +47,7 @@
47#include <mach/usb.h> 47#include <mach/usb.h>
48 48
49#include "common.h" 49#include "common.h"
50#include "dma.h"
50 51
51#define PALMZ71_USBDETECT_GPIO 0 52#define PALMZ71_USBDETECT_GPIO 0
52#define PALMZ71_PENIRQ_GPIO 6 53#define PALMZ71_PENIRQ_GPIO 6
@@ -326,7 +327,6 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
326 .atag_offset = 0x100, 327 .atag_offset = 0x100,
327 .map_io = omap15xx_map_io, 328 .map_io = omap15xx_map_io,
328 .init_early = omap1_init_early, 329 .init_early = omap1_init_early,
329 .reserve = omap_reserve,
330 .init_irq = omap1_init_irq, 330 .init_irq = omap1_init_irq,
331 .init_machine = omap_palmz71_init, 331 .init_machine = omap_palmz71_init,
332 .init_late = omap1_init_late, 332 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 198b05417bfc..9a7e483ed6fd 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -28,15 +28,15 @@
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30 30
31#include <plat/tc.h> 31#include <mach/tc.h>
32#include <mach/mux.h> 32#include <mach/mux.h>
33#include <plat/fpga.h>
34#include <mach/flash.h> 33#include <mach/flash.h>
35 34
36#include <mach/hardware.h> 35#include <mach/hardware.h>
37 36
38#include "iomap.h" 37#include "iomap.h"
39#include "common.h" 38#include "common.h"
39#include "fpga.h"
40 40
41static const unsigned int p2_keymap[] = { 41static const unsigned int p2_keymap[] = {
42 KEY(0, 0, KEY_UP), 42 KEY(0, 0, KEY_UP),
@@ -231,9 +231,9 @@ static struct omap_lcd_config perseus2_lcd_config __initdata = {
231 231
232static void __init perseus2_init_smc91x(void) 232static void __init perseus2_init_smc91x(void)
233{ 233{
234 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET); 234 __raw_writeb(1, H2P2_DBG_FPGA_LAN_RESET);
235 mdelay(50); 235 mdelay(50);
236 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1, 236 __raw_writeb(__raw_readb(H2P2_DBG_FPGA_LAN_RESET) & ~1,
237 H2P2_DBG_FPGA_LAN_RESET); 237 H2P2_DBG_FPGA_LAN_RESET);
238 mdelay(50); 238 mdelay(50);
239} 239}
@@ -324,7 +324,6 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
324 .atag_offset = 0x100, 324 .atag_offset = 0x100,
325 .map_io = omap_perseus2_map_io, 325 .map_io = omap_perseus2_map_io,
326 .init_early = omap1_init_early, 326 .init_early = omap1_init_early,
327 .reserve = omap_reserve,
328 .init_irq = omap1_init_irq, 327 .init_irq = omap1_init_irq,
329 .init_machine = omap_perseus2_init, 328 .init_machine = omap_perseus2_init,
330 .init_late = omap1_init_late, 329 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c
index 5932d56e17bf..4fcf19c78a08 100644
--- a/arch/arm/mach-omap1/board-sx1-mmc.c
+++ b/arch/arm/mach-omap1/board-sx1-mmc.c
@@ -16,9 +16,10 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17 17
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19#include <plat/mmc.h>
20#include <mach/board-sx1.h> 19#include <mach/board-sx1.h>
21 20
21#include "mmc.h"
22
22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 23#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
23 24
24static int mmc_set_power(struct device *dev, int slot, int power_on, 25static int mmc_set_power(struct device *dev, int slot, int power_on,
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 13bf2cc56814..1ebc7e08d6e5 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -36,15 +36,16 @@
36 36
37#include <mach/flash.h> 37#include <mach/flash.h>
38#include <mach/mux.h> 38#include <mach/mux.h>
39#include <plat/dma.h> 39#include <plat-omap/dma-omap.h>
40#include <mach/irda.h> 40#include <mach/irda.h>
41#include <plat/tc.h> 41#include <mach/tc.h>
42#include <mach/board-sx1.h> 42#include <mach/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>
46 46
47#include "common.h" 47#include "common.h"
48#include "dma.h"
48 49
49/* Write to I2C device */ 50/* Write to I2C device */
50int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) 51int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
@@ -403,7 +404,6 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
403 .atag_offset = 0x100, 404 .atag_offset = 0x100,
404 .map_io = omap15xx_map_io, 405 .map_io = omap15xx_map_io,
405 .init_early = omap1_init_early, 406 .init_early = omap1_init_early,
406 .reserve = omap_reserve,
407 .init_irq = omap1_init_irq, 407 .init_irq = omap1_init_irq,
408 .init_machine = omap_sx1_init, 408 .init_machine = omap_sx1_init,
409 .init_late = omap1_init_late, 409 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index ad75e3411d46..abf705f49b19 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -34,7 +34,7 @@
34#include <mach/board-voiceblue.h> 34#include <mach/board-voiceblue.h>
35#include <mach/flash.h> 35#include <mach/flash.h>
36#include <mach/mux.h> 36#include <mach/mux.h>
37#include <plat/tc.h> 37#include <mach/tc.h>
38 38
39#include <mach/hardware.h> 39#include <mach/hardware.h>
40#include <mach/usb.h> 40#include <mach/usb.h>
@@ -286,7 +286,6 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
286 .atag_offset = 0x100, 286 .atag_offset = 0x100,
287 .map_io = omap15xx_map_io, 287 .map_io = omap15xx_map_io,
288 .init_early = omap1_init_early, 288 .init_early = omap1_init_early,
289 .reserve = omap_reserve,
290 .init_irq = omap1_init_irq, 289 .init_irq = omap1_init_irq,
291 .init_machine = voiceblue_init, 290 .init_machine = voiceblue_init,
292 .init_late = omap1_init_late, 291 .init_late = omap1_init_late,
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 638f4070fc70..4f5fd4a084c0 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -12,6 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/export.h>
15#include <linux/list.h> 16#include <linux/list.h>
16#include <linux/errno.h> 17#include <linux/errno.h>
17#include <linux/err.h> 18#include <linux/err.h>
@@ -21,21 +22,21 @@
21 22
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23 24
24#include <plat/cpu.h>
25#include <plat/usb.h>
26#include <plat/clock.h>
27#include <plat/sram.h>
28#include <plat/clkdev_omap.h>
29
30#include <mach/hardware.h> 25#include <mach/hardware.h>
31 26
27#include "soc.h"
32#include "iomap.h" 28#include "iomap.h"
33#include "clock.h" 29#include "clock.h"
34#include "opp.h" 30#include "opp.h"
31#include "sram.h"
35 32
36__u32 arm_idlect1_mask; 33__u32 arm_idlect1_mask;
37struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p; 34struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
38 35
36static LIST_HEAD(clocks);
37static DEFINE_MUTEX(clocks_mutex);
38static DEFINE_SPINLOCK(clockfw_lock);
39
39/* 40/*
40 * Omap1 specific clock functions 41 * Omap1 specific clock functions
41 */ 42 */
@@ -607,3 +608,497 @@ void omap1_clk_disable_unused(struct clk *clk)
607} 608}
608 609
609#endif 610#endif
611
612
613int clk_enable(struct clk *clk)
614{
615 unsigned long flags;
616 int ret;
617
618 if (clk == NULL || IS_ERR(clk))
619 return -EINVAL;
620
621 spin_lock_irqsave(&clockfw_lock, flags);
622 ret = omap1_clk_enable(clk);
623 spin_unlock_irqrestore(&clockfw_lock, flags);
624
625 return ret;
626}
627EXPORT_SYMBOL(clk_enable);
628
629void clk_disable(struct clk *clk)
630{
631 unsigned long flags;
632
633 if (clk == NULL || IS_ERR(clk))
634 return;
635
636 spin_lock_irqsave(&clockfw_lock, flags);
637 if (clk->usecount == 0) {
638 pr_err("Trying disable clock %s with 0 usecount\n",
639 clk->name);
640 WARN_ON(1);
641 goto out;
642 }
643
644 omap1_clk_disable(clk);
645
646out:
647 spin_unlock_irqrestore(&clockfw_lock, flags);
648}
649EXPORT_SYMBOL(clk_disable);
650
651unsigned long clk_get_rate(struct clk *clk)
652{
653 unsigned long flags;
654 unsigned long ret;
655
656 if (clk == NULL || IS_ERR(clk))
657 return 0;
658
659 spin_lock_irqsave(&clockfw_lock, flags);
660 ret = clk->rate;
661 spin_unlock_irqrestore(&clockfw_lock, flags);
662
663 return ret;
664}
665EXPORT_SYMBOL(clk_get_rate);
666
667/*
668 * Optional clock functions defined in include/linux/clk.h
669 */
670
671long clk_round_rate(struct clk *clk, unsigned long rate)
672{
673 unsigned long flags;
674 long ret;
675
676 if (clk == NULL || IS_ERR(clk))
677 return 0;
678
679 spin_lock_irqsave(&clockfw_lock, flags);
680 ret = omap1_clk_round_rate(clk, rate);
681 spin_unlock_irqrestore(&clockfw_lock, flags);
682
683 return ret;
684}
685EXPORT_SYMBOL(clk_round_rate);
686
687int clk_set_rate(struct clk *clk, unsigned long rate)
688{
689 unsigned long flags;
690 int ret = -EINVAL;
691
692 if (clk == NULL || IS_ERR(clk))
693 return ret;
694
695 spin_lock_irqsave(&clockfw_lock, flags);
696 ret = omap1_clk_set_rate(clk, rate);
697 if (ret == 0)
698 propagate_rate(clk);
699 spin_unlock_irqrestore(&clockfw_lock, flags);
700
701 return ret;
702}
703EXPORT_SYMBOL(clk_set_rate);
704
705int clk_set_parent(struct clk *clk, struct clk *parent)
706{
707 WARN_ONCE(1, "clk_set_parent() not implemented for OMAP1\n");
708
709 return -EINVAL;
710}
711EXPORT_SYMBOL(clk_set_parent);
712
713struct clk *clk_get_parent(struct clk *clk)
714{
715 return clk->parent;
716}
717EXPORT_SYMBOL(clk_get_parent);
718
719/*
720 * OMAP specific clock functions shared between omap1 and omap2
721 */
722
723int __initdata mpurate;
724
725/*
726 * By default we use the rate set by the bootloader.
727 * You can override this with mpurate= cmdline option.
728 */
729static int __init omap_clk_setup(char *str)
730{
731 get_option(&str, &mpurate);
732
733 if (!mpurate)
734 return 1;
735
736 if (mpurate < 1000)
737 mpurate *= 1000000;
738
739 return 1;
740}
741__setup("mpurate=", omap_clk_setup);
742
743/* Used for clocks that always have same value as the parent clock */
744unsigned long followparent_recalc(struct clk *clk)
745{
746 return clk->parent->rate;
747}
748
749/*
750 * Used for clocks that have the same value as the parent clock,
751 * divided by some factor
752 */
753unsigned long omap_fixed_divisor_recalc(struct clk *clk)
754{
755 WARN_ON(!clk->fixed_div);
756
757 return clk->parent->rate / clk->fixed_div;
758}
759
760void clk_reparent(struct clk *child, struct clk *parent)
761{
762 list_del_init(&child->sibling);
763 if (parent)
764 list_add(&child->sibling, &parent->children);
765 child->parent = parent;
766
767 /* now do the debugfs renaming to reattach the child
768 to the proper parent */
769}
770
771/* Propagate rate to children */
772void propagate_rate(struct clk *tclk)
773{
774 struct clk *clkp;
775
776 list_for_each_entry(clkp, &tclk->children, sibling) {
777 if (clkp->recalc)
778 clkp->rate = clkp->recalc(clkp);
779 propagate_rate(clkp);
780 }
781}
782
783static LIST_HEAD(root_clks);
784
785/**
786 * recalculate_root_clocks - recalculate and propagate all root clocks
787 *
788 * Recalculates all root clocks (clocks with no parent), which if the
789 * clock's .recalc is set correctly, should also propagate their rates.
790 * Called at init.
791 */
792void recalculate_root_clocks(void)
793{
794 struct clk *clkp;
795
796 list_for_each_entry(clkp, &root_clks, sibling) {
797 if (clkp->recalc)
798 clkp->rate = clkp->recalc(clkp);
799 propagate_rate(clkp);
800 }
801}
802
803/**
804 * clk_preinit - initialize any fields in the struct clk before clk init
805 * @clk: struct clk * to initialize
806 *
807 * Initialize any struct clk fields needed before normal clk initialization
808 * can run. No return value.
809 */
810void clk_preinit(struct clk *clk)
811{
812 INIT_LIST_HEAD(&clk->children);
813}
814
815int clk_register(struct clk *clk)
816{
817 if (clk == NULL || IS_ERR(clk))
818 return -EINVAL;
819
820 /*
821 * trap out already registered clocks
822 */
823 if (clk->node.next || clk->node.prev)
824 return 0;
825
826 mutex_lock(&clocks_mutex);
827 if (clk->parent)
828 list_add(&clk->sibling, &clk->parent->children);
829 else
830 list_add(&clk->sibling, &root_clks);
831
832 list_add(&clk->node, &clocks);
833 if (clk->init)
834 clk->init(clk);
835 mutex_unlock(&clocks_mutex);
836
837 return 0;
838}
839EXPORT_SYMBOL(clk_register);
840
841void clk_unregister(struct clk *clk)
842{
843 if (clk == NULL || IS_ERR(clk))
844 return;
845
846 mutex_lock(&clocks_mutex);
847 list_del(&clk->sibling);
848 list_del(&clk->node);
849 mutex_unlock(&clocks_mutex);
850}
851EXPORT_SYMBOL(clk_unregister);
852
853void clk_enable_init_clocks(void)
854{
855 struct clk *clkp;
856
857 list_for_each_entry(clkp, &clocks, node)
858 if (clkp->flags & ENABLE_ON_INIT)
859 clk_enable(clkp);
860}
861
862/**
863 * omap_clk_get_by_name - locate OMAP struct clk by its name
864 * @name: name of the struct clk to locate
865 *
866 * Locate an OMAP struct clk by its name. Assumes that struct clk
867 * names are unique. Returns NULL if not found or a pointer to the
868 * struct clk if found.
869 */
870struct clk *omap_clk_get_by_name(const char *name)
871{
872 struct clk *c;
873 struct clk *ret = NULL;
874
875 mutex_lock(&clocks_mutex);
876
877 list_for_each_entry(c, &clocks, node) {
878 if (!strcmp(c->name, name)) {
879 ret = c;
880 break;
881 }
882 }
883
884 mutex_unlock(&clocks_mutex);
885
886 return ret;
887}
888
889int omap_clk_enable_autoidle_all(void)
890{
891 struct clk *c;
892 unsigned long flags;
893
894 spin_lock_irqsave(&clockfw_lock, flags);
895
896 list_for_each_entry(c, &clocks, node)
897 if (c->ops->allow_idle)
898 c->ops->allow_idle(c);
899
900 spin_unlock_irqrestore(&clockfw_lock, flags);
901
902 return 0;
903}
904
905int omap_clk_disable_autoidle_all(void)
906{
907 struct clk *c;
908 unsigned long flags;
909
910 spin_lock_irqsave(&clockfw_lock, flags);
911
912 list_for_each_entry(c, &clocks, node)
913 if (c->ops->deny_idle)
914 c->ops->deny_idle(c);
915
916 spin_unlock_irqrestore(&clockfw_lock, flags);
917
918 return 0;
919}
920
921/*
922 * Low level helpers
923 */
924static int clkll_enable_null(struct clk *clk)
925{
926 return 0;
927}
928
929static void clkll_disable_null(struct clk *clk)
930{
931}
932
933const struct clkops clkops_null = {
934 .enable = clkll_enable_null,
935 .disable = clkll_disable_null,
936};
937
938/*
939 * Dummy clock
940 *
941 * Used for clock aliases that are needed on some OMAPs, but not others
942 */
943struct clk dummy_ck = {
944 .name = "dummy",
945 .ops = &clkops_null,
946};
947
948/*
949 *
950 */
951
952#ifdef CONFIG_OMAP_RESET_CLOCKS
953/*
954 * Disable any unused clocks left on by the bootloader
955 */
956static int __init clk_disable_unused(void)
957{
958 struct clk *ck;
959 unsigned long flags;
960
961 pr_info("clock: disabling unused clocks to save power\n");
962
963 spin_lock_irqsave(&clockfw_lock, flags);
964 list_for_each_entry(ck, &clocks, node) {
965 if (ck->ops == &clkops_null)
966 continue;
967
968 if (ck->usecount > 0 || !ck->enable_reg)
969 continue;
970
971 omap1_clk_disable_unused(ck);
972 }
973 spin_unlock_irqrestore(&clockfw_lock, flags);
974
975 return 0;
976}
977late_initcall(clk_disable_unused);
978late_initcall(omap_clk_enable_autoidle_all);
979#endif
980
981#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
982/*
983 * debugfs support to trace clock tree hierarchy and attributes
984 */
985
986#include <linux/debugfs.h>
987#include <linux/seq_file.h>
988
989static struct dentry *clk_debugfs_root;
990
991static int clk_dbg_show_summary(struct seq_file *s, void *unused)
992{
993 struct clk *c;
994 struct clk *pa;
995
996 mutex_lock(&clocks_mutex);
997 seq_printf(s, "%-30s %-30s %-10s %s\n",
998 "clock-name", "parent-name", "rate", "use-count");
999
1000 list_for_each_entry(c, &clocks, node) {
1001 pa = c->parent;
1002 seq_printf(s, "%-30s %-30s %-10lu %d\n",
1003 c->name, pa ? pa->name : "none", c->rate,
1004 c->usecount);
1005 }
1006 mutex_unlock(&clocks_mutex);
1007
1008 return 0;
1009}
1010
1011static int clk_dbg_open(struct inode *inode, struct file *file)
1012{
1013 return single_open(file, clk_dbg_show_summary, inode->i_private);
1014}
1015
1016static const struct file_operations debug_clock_fops = {
1017 .open = clk_dbg_open,
1018 .read = seq_read,
1019 .llseek = seq_lseek,
1020 .release = single_release,
1021};
1022
1023static int clk_debugfs_register_one(struct clk *c)
1024{
1025 int err;
1026 struct dentry *d;
1027 struct clk *pa = c->parent;
1028
1029 d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root);
1030 if (!d)
1031 return -ENOMEM;
1032 c->dent = d;
1033
1034 d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
1035 if (!d) {
1036 err = -ENOMEM;
1037 goto err_out;
1038 }
1039 d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
1040 if (!d) {
1041 err = -ENOMEM;
1042 goto err_out;
1043 }
1044 d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
1045 if (!d) {
1046 err = -ENOMEM;
1047 goto err_out;
1048 }
1049 return 0;
1050
1051err_out:
1052 debugfs_remove_recursive(c->dent);
1053 return err;
1054}
1055
1056static int clk_debugfs_register(struct clk *c)
1057{
1058 int err;
1059 struct clk *pa = c->parent;
1060
1061 if (pa && !pa->dent) {
1062 err = clk_debugfs_register(pa);
1063 if (err)
1064 return err;
1065 }
1066
1067 if (!c->dent) {
1068 err = clk_debugfs_register_one(c);
1069 if (err)
1070 return err;
1071 }
1072 return 0;
1073}
1074
1075static int __init clk_debugfs_init(void)
1076{
1077 struct clk *c;
1078 struct dentry *d;
1079 int err;
1080
1081 d = debugfs_create_dir("clock", NULL);
1082 if (!d)
1083 return -ENOMEM;
1084 clk_debugfs_root = d;
1085
1086 list_for_each_entry(c, &clocks, node) {
1087 err = clk_debugfs_register(c);
1088 if (err)
1089 goto err_out;
1090 }
1091
1092 d = debugfs_create_file("summary", S_IRUGO,
1093 d, NULL, &debug_clock_fops);
1094 if (!d)
1095 return -ENOMEM;
1096
1097 return 0;
1098err_out:
1099 debugfs_remove_recursive(clk_debugfs_root);
1100 return err;
1101}
1102late_initcall(clk_debugfs_init);
1103
1104#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index 3d04f4f67676..1e4918a3a5ee 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -14,8 +14,184 @@
14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H 14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H
15 15
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/list.h>
17 18
18#include <plat/clock.h> 19#include <linux/clkdev.h>
20
21struct module;
22struct clk;
23
24struct omap_clk {
25 u16 cpu;
26 struct clk_lookup lk;
27};
28
29#define CLK(dev, con, ck, cp) \
30 { \
31 .cpu = cp, \
32 .lk = { \
33 .dev_id = dev, \
34 .con_id = con, \
35 .clk = ck, \
36 }, \
37 }
38
39/* Platform flags for the clkdev-OMAP integration code */
40#define CK_310 (1 << 0)
41#define CK_7XX (1 << 1) /* 7xx, 850 */
42#define CK_1510 (1 << 2)
43#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */
44#define CK_1710 (1 << 4) /* 1710 extra for rate selection */
45
46
47/* Temporary, needed during the common clock framework conversion */
48#define __clk_get_name(clk) (clk->name)
49#define __clk_get_parent(clk) (clk->parent)
50#define __clk_get_rate(clk) (clk->rate)
51
52/**
53 * struct clkops - some clock function pointers
54 * @enable: fn ptr that enables the current clock in hardware
55 * @disable: fn ptr that enables the current clock in hardware
56 * @find_idlest: function returning the IDLEST register for the clock's IP blk
57 * @find_companion: function returning the "companion" clk reg for the clock
58 * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
59 * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
60 *
61 * A "companion" clk is an accompanying clock to the one being queried
62 * that must be enabled for the IP module connected to the clock to
63 * become accessible by the hardware. Neither @find_idlest nor
64 * @find_companion should be needed; that information is IP
65 * block-specific; the hwmod code has been created to handle this, but
66 * until hwmod data is ready and drivers have been converted to use PM
67 * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
68 * @find_companion must, unfortunately, remain.
69 */
70struct clkops {
71 int (*enable)(struct clk *);
72 void (*disable)(struct clk *);
73 void (*find_idlest)(struct clk *, void __iomem **,
74 u8 *, u8 *);
75 void (*find_companion)(struct clk *, void __iomem **,
76 u8 *);
77 void (*allow_idle)(struct clk *);
78 void (*deny_idle)(struct clk *);
79};
80
81/*
82 * struct clk.flags possibilities
83 *
84 * XXX document the rest of the clock flags here
85 *
86 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
87 * bits share the same register. This flag allows the
88 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
89 * should be used. This is a temporary solution - a better approach
90 * would be to associate clock type-specific data with the clock,
91 * similar to the struct dpll_data approach.
92 */
93#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
94#define CLOCK_IDLE_CONTROL (1 << 1)
95#define CLOCK_NO_IDLE_PARENT (1 << 2)
96#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
97#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
98#define CLOCK_CLKOUTX2 (1 << 5)
99
100/**
101 * struct clk - OMAP struct clk
102 * @node: list_head connecting this clock into the full clock list
103 * @ops: struct clkops * for this clock
104 * @name: the name of the clock in the hardware (used in hwmod data and debug)
105 * @parent: pointer to this clock's parent struct clk
106 * @children: list_head connecting to the child clks' @sibling list_heads
107 * @sibling: list_head connecting this clk to its parent clk's @children
108 * @rate: current clock rate
109 * @enable_reg: register to write to enable the clock (see @enable_bit)
110 * @recalc: fn ptr that returns the clock's current rate
111 * @set_rate: fn ptr that can change the clock's current rate
112 * @round_rate: fn ptr that can round the clock's current rate
113 * @init: fn ptr to do clock-specific initialization
114 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
115 * @usecount: number of users that have requested this clock to be enabled
116 * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
117 * @flags: see "struct clk.flags possibilities" above
118 * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
119 * @src_offset: bitshift for source selection bitfield (OMAP1 only)
120 *
121 * XXX @rate_offset, @src_offset should probably be removed and OMAP1
122 * clock code converted to use clksel.
123 *
124 * XXX @usecount is poorly named. It should be "enable_count" or
125 * something similar. "users" in the description refers to kernel
126 * code (core code or drivers) that have called clk_enable() and not
127 * yet called clk_disable(); the usecount of parent clocks is also
128 * incremented by the clock code when clk_enable() is called on child
129 * clocks and decremented by the clock code when clk_disable() is
130 * called on child clocks.
131 *
132 * XXX @clkdm, @usecount, @children, @sibling should be marked for
133 * internal use only.
134 *
135 * @children and @sibling are used to optimize parent-to-child clock
136 * tree traversals. (child-to-parent traversals use @parent.)
137 *
138 * XXX The notion of the clock's current rate probably needs to be
139 * separated from the clock's target rate.
140 */
141struct clk {
142 struct list_head node;
143 const struct clkops *ops;
144 const char *name;
145 struct clk *parent;
146 struct list_head children;
147 struct list_head sibling; /* node for children */
148 unsigned long rate;
149 void __iomem *enable_reg;
150 unsigned long (*recalc)(struct clk *);
151 int (*set_rate)(struct clk *, unsigned long);
152 long (*round_rate)(struct clk *, unsigned long);
153 void (*init)(struct clk *);
154 u8 enable_bit;
155 s8 usecount;
156 u8 fixed_div;
157 u8 flags;
158 u8 rate_offset;
159 u8 src_offset;
160#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
161 struct dentry *dent; /* For visible tree hierarchy */
162#endif
163};
164
165struct clk_functions {
166 int (*clk_enable)(struct clk *clk);
167 void (*clk_disable)(struct clk *clk);
168 long (*clk_round_rate)(struct clk *clk, unsigned long rate);
169 int (*clk_set_rate)(struct clk *clk, unsigned long rate);
170 int (*clk_set_parent)(struct clk *clk, struct clk *parent);
171 void (*clk_allow_idle)(struct clk *clk);
172 void (*clk_deny_idle)(struct clk *clk);
173 void (*clk_disable_unused)(struct clk *clk);
174};
175
176extern int mpurate;
177
178extern int clk_init(struct clk_functions *custom_clocks);
179extern void clk_preinit(struct clk *clk);
180extern int clk_register(struct clk *clk);
181extern void clk_reparent(struct clk *child, struct clk *parent);
182extern void clk_unregister(struct clk *clk);
183extern void propagate_rate(struct clk *clk);
184extern void recalculate_root_clocks(void);
185extern unsigned long followparent_recalc(struct clk *clk);
186extern void clk_enable_init_clocks(void);
187unsigned long omap_fixed_divisor_recalc(struct clk *clk);
188extern struct clk *omap_clk_get_by_name(const char *name);
189extern int omap_clk_enable_autoidle_all(void);
190extern int omap_clk_disable_autoidle_all(void);
191
192extern const struct clkops clkops_null;
193
194extern struct clk dummy_ck;
19 195
20int omap1_clk_init(void); 196int omap1_clk_init(void);
21void omap1_clk_late_init(void); 197void omap1_clk_late_init(void);
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index 9b45f4b0ee22..cb7c6ae2e3fc 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -22,16 +22,14 @@
22 22
23#include <asm/mach-types.h> /* for machine_is_* */ 23#include <asm/mach-types.h> /* for machine_is_* */
24 24
25#include <plat/clock.h> 25#include "soc.h"
26#include <plat/cpu.h>
27#include <plat/clkdev_omap.h>
28#include <plat/sram.h> /* for omap_sram_reprogram_clock() */
29 26
30#include <mach/hardware.h> 27#include <mach/hardware.h>
31#include <mach/usb.h> /* for OTG_BASE */ 28#include <mach/usb.h> /* for OTG_BASE */
32 29
33#include "iomap.h" 30#include "iomap.h"
34#include "clock.h" 31#include "clock.h"
32#include "sram.h"
35 33
36/* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */ 34/* Some ARM_IDLECT1 bit shifts - used in struct arm_idlect1_clk */
37#define IDL_CLKOUT_ARM_SHIFT 12 35#define IDL_CLKOUT_ARM_SHIFT 12
@@ -765,14 +763,6 @@ static struct omap_clk omap_clks[] = {
765 * init 763 * init
766 */ 764 */
767 765
768static struct clk_functions omap1_clk_functions = {
769 .clk_enable = omap1_clk_enable,
770 .clk_disable = omap1_clk_disable,
771 .clk_round_rate = omap1_clk_round_rate,
772 .clk_set_rate = omap1_clk_set_rate,
773 .clk_disable_unused = omap1_clk_disable_unused,
774};
775
776static void __init omap1_show_rates(void) 766static void __init omap1_show_rates(void)
777{ 767{
778 pr_notice("Clocking rate (xtal/DPLL1/MPU): %ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n", 768 pr_notice("Clocking rate (xtal/DPLL1/MPU): %ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
@@ -803,8 +793,6 @@ int __init omap1_clk_init(void)
803 if (!cpu_is_omap15xx()) 793 if (!cpu_is_omap15xx())
804 omap_writew(0, SOFT_REQ_REG2); 794 omap_writew(0, SOFT_REQ_REG2);
805 795
806 clk_init(&omap1_clk_functions);
807
808 /* By default all idlect1 clocks are allowed to idle */ 796 /* By default all idlect1 clocks are allowed to idle */
809 arm_idlect1_mask = ~0; 797 arm_idlect1_mask = ~0;
810 798
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index c2552b24f9f2..b53e0854422f 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -26,8 +26,10 @@
26#ifndef __ARCH_ARM_MACH_OMAP1_COMMON_H 26#ifndef __ARCH_ARM_MACH_OMAP1_COMMON_H
27#define __ARCH_ARM_MACH_OMAP1_COMMON_H 27#define __ARCH_ARM_MACH_OMAP1_COMMON_H
28 28
29#include <plat/common.h>
30#include <linux/mtd/mtd.h> 29#include <linux/mtd/mtd.h>
30#include <linux/i2c-omap.h>
31
32#include <plat/i2c.h>
31 33
32#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 34#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
33void omap7xx_map_io(void); 35void omap7xx_map_io(void);
@@ -38,6 +40,7 @@ static inline void omap7xx_map_io(void)
38#endif 40#endif
39 41
40#ifdef CONFIG_ARCH_OMAP15XX 42#ifdef CONFIG_ARCH_OMAP15XX
43void omap1510_fpga_init_irq(void);
41void omap15xx_map_io(void); 44void omap15xx_map_io(void);
42#else 45#else
43static inline void omap15xx_map_io(void) 46static inline void omap15xx_map_io(void)
@@ -90,4 +93,6 @@ extern int ocpi_enable(void);
90static inline int ocpi_enable(void) { return 0; } 93static inline int ocpi_enable(void) { return 0; }
91#endif 94#endif
92 95
96extern u32 omap1_get_reset_sources(void);
97
93#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */ 98#endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index d3fec92c54cb..0af635205e8a 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -17,12 +17,12 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
19 19
20#include <linux/platform_data/omap-wd-timer.h>
21
20#include <asm/mach/map.h> 22#include <asm/mach/map.h>
21 23
22#include <plat/tc.h> 24#include <mach/tc.h>
23#include <mach/mux.h> 25#include <mach/mux.h>
24#include <plat/dma.h>
25#include <plat/mmc.h>
26 26
27#include <mach/omap7xx.h> 27#include <mach/omap7xx.h>
28#include <mach/camera.h> 28#include <mach/camera.h>
@@ -30,6 +30,9 @@
30 30
31#include "common.h" 31#include "common.h"
32#include "clock.h" 32#include "clock.h"
33#include "dma.h"
34#include "mmc.h"
35#include "sram.h"
33 36
34#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE) 37#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
35 38
@@ -175,6 +178,13 @@ static int __init omap_mmc_add(const char *name, int id, unsigned long base,
175 res[3].name = "tx"; 178 res[3].name = "tx";
176 res[3].flags = IORESOURCE_DMA; 179 res[3].flags = IORESOURCE_DMA;
177 180
181 if (cpu_is_omap7xx())
182 data->slots[0].features = MMC_OMAP7XX;
183 if (cpu_is_omap15xx())
184 data->slots[0].features = MMC_OMAP15XX;
185 if (cpu_is_omap16xx())
186 data->slots[0].features = MMC_OMAP16XX;
187
178 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); 188 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
179 if (ret == 0) 189 if (ret == 0)
180 ret = platform_device_add_data(pdev, data, sizeof(*data)); 190 ret = platform_device_add_data(pdev, data, sizeof(*data));
@@ -439,18 +449,31 @@ static struct resource wdt_resources[] = {
439}; 449};
440 450
441static struct platform_device omap_wdt_device = { 451static struct platform_device omap_wdt_device = {
442 .name = "omap_wdt", 452 .name = "omap_wdt",
443 .id = -1, 453 .id = -1,
444 .num_resources = ARRAY_SIZE(wdt_resources), 454 .num_resources = ARRAY_SIZE(wdt_resources),
445 .resource = wdt_resources, 455 .resource = wdt_resources,
446}; 456};
447 457
448static int __init omap_init_wdt(void) 458static int __init omap_init_wdt(void)
449{ 459{
460 struct omap_wd_timer_platform_data pdata;
461 int ret;
462
450 if (!cpu_is_omap16xx()) 463 if (!cpu_is_omap16xx())
451 return -ENODEV; 464 return -ENODEV;
452 465
453 return platform_device_register(&omap_wdt_device); 466 pdata.read_reset_sources = omap1_get_reset_sources;
467
468 ret = platform_device_register(&omap_wdt_device);
469 if (!ret) {
470 ret = platform_device_add_data(&omap_wdt_device, &pdata,
471 sizeof(pdata));
472 if (ret)
473 platform_device_del(&omap_wdt_device);
474 }
475
476 return ret;
454} 477}
455subsys_initcall(omap_init_wdt); 478subsys_initcall(omap_init_wdt);
456#endif 479#endif
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c
index 29007fef84cd..978aed85d328 100644
--- a/arch/arm/mach-omap1/dma.c
+++ b/arch/arm/mach-omap1/dma.c
@@ -25,11 +25,13 @@
25#include <linux/device.h> 25#include <linux/device.h>
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include <plat/dma.h> 28#include <plat-omap/dma-omap.h>
29#include <plat/tc.h> 29#include <mach/tc.h>
30 30
31#include <mach/irqs.h> 31#include <mach/irqs.h>
32 32
33#include "dma.h"
34
33#define OMAP1_DMA_BASE (0xfffed800) 35#define OMAP1_DMA_BASE (0xfffed800)
34#define OMAP1_LOGICAL_DMA_CH_COUNT 17 36#define OMAP1_LOGICAL_DMA_CH_COUNT 17
35#define OMAP1_DMA_STRIDE 0x40 37#define OMAP1_DMA_STRIDE 0x40
@@ -319,6 +321,9 @@ static int __init omap1_system_dma_init(void)
319 d->dev_caps = ENABLE_1510_MODE; 321 d->dev_caps = ENABLE_1510_MODE;
320 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; 322 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
321 323
324 if (cpu_is_omap16xx())
325 d->dev_caps = ENABLE_16XX_MODE;
326
322 d->dev_caps |= SRC_PORT; 327 d->dev_caps |= SRC_PORT;
323 d->dev_caps |= DST_PORT; 328 d->dev_caps |= DST_PORT;
324 d->dev_caps |= SRC_INDEX; 329 d->dev_caps |= SRC_INDEX;
diff --git a/arch/arm/mach-omap1/dma.h b/arch/arm/mach-omap1/dma.h
new file mode 100644
index 000000000000..da6345dab03f
--- /dev/null
+++ b/arch/arm/mach-omap1/dma.h
@@ -0,0 +1,83 @@
1/*
2 * OMAP1 DMA channel definitions
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#ifndef __OMAP1_DMA_CHANNEL_H
20#define __OMAP1_DMA_CHANNEL_H
21
22/* DMA channels for omap1 */
23#define OMAP_DMA_NO_DEVICE 0
24#define OMAP_DMA_MCSI1_TX 1
25#define OMAP_DMA_MCSI1_RX 2
26#define OMAP_DMA_I2C_RX 3
27#define OMAP_DMA_I2C_TX 4
28#define OMAP_DMA_EXT_NDMA_REQ 5
29#define OMAP_DMA_EXT_NDMA_REQ2 6
30#define OMAP_DMA_UWIRE_TX 7
31#define OMAP_DMA_MCBSP1_TX 8
32#define OMAP_DMA_MCBSP1_RX 9
33#define OMAP_DMA_MCBSP3_TX 10
34#define OMAP_DMA_MCBSP3_RX 11
35#define OMAP_DMA_UART1_TX 12
36#define OMAP_DMA_UART1_RX 13
37#define OMAP_DMA_UART2_TX 14
38#define OMAP_DMA_UART2_RX 15
39#define OMAP_DMA_MCBSP2_TX 16
40#define OMAP_DMA_MCBSP2_RX 17
41#define OMAP_DMA_UART3_TX 18
42#define OMAP_DMA_UART3_RX 19
43#define OMAP_DMA_CAMERA_IF_RX 20
44#define OMAP_DMA_MMC_TX 21
45#define OMAP_DMA_MMC_RX 22
46#define OMAP_DMA_NAND 23
47#define OMAP_DMA_IRQ_LCD_LINE 24
48#define OMAP_DMA_MEMORY_STICK 25
49#define OMAP_DMA_USB_W2FC_RX0 26
50#define OMAP_DMA_USB_W2FC_RX1 27
51#define OMAP_DMA_USB_W2FC_RX2 28
52#define OMAP_DMA_USB_W2FC_TX0 29
53#define OMAP_DMA_USB_W2FC_TX1 30
54#define OMAP_DMA_USB_W2FC_TX2 31
55
56/* These are only for 1610 */
57#define OMAP_DMA_CRYPTO_DES_IN 32
58#define OMAP_DMA_SPI_TX 33
59#define OMAP_DMA_SPI_RX 34
60#define OMAP_DMA_CRYPTO_HASH 35
61#define OMAP_DMA_CCP_ATTN 36
62#define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37
63#define OMAP_DMA_CMT_APE_TX_CHAN_0 38
64#define OMAP_DMA_CMT_APE_RV_CHAN_0 39
65#define OMAP_DMA_CMT_APE_TX_CHAN_1 40
66#define OMAP_DMA_CMT_APE_RV_CHAN_1 41
67#define OMAP_DMA_CMT_APE_TX_CHAN_2 42
68#define OMAP_DMA_CMT_APE_RV_CHAN_2 43
69#define OMAP_DMA_CMT_APE_TX_CHAN_3 44
70#define OMAP_DMA_CMT_APE_RV_CHAN_3 45
71#define OMAP_DMA_CMT_APE_TX_CHAN_4 46
72#define OMAP_DMA_CMT_APE_RV_CHAN_4 47
73#define OMAP_DMA_CMT_APE_TX_CHAN_5 48
74#define OMAP_DMA_CMT_APE_RV_CHAN_5 49
75#define OMAP_DMA_CMT_APE_TX_CHAN_6 50
76#define OMAP_DMA_CMT_APE_RV_CHAN_6 51
77#define OMAP_DMA_CMT_APE_TX_CHAN_7 52
78#define OMAP_DMA_CMT_APE_RV_CHAN_7 53
79#define OMAP_DMA_MMC2_TX 54
80#define OMAP_DMA_MMC2_RX 55
81#define OMAP_DMA_CRYPTO_DES_OUT 56
82
83#endif /* __OMAP1_DMA_CHANNEL_H */
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index 73ae6169aa4a..b3fb531af94e 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -10,7 +10,7 @@
10#include <linux/mtd/mtd.h> 10#include <linux/mtd/mtd.h>
11#include <linux/mtd/map.h> 11#include <linux/mtd/map.h>
12 12
13#include <plat/tc.h> 13#include <mach/tc.h>
14#include <mach/flash.h> 14#include <mach/flash.h>
15 15
16#include <mach/hardware.h> 16#include <mach/hardware.h>
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 29ec50fc688d..8bd71b2d0967 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -27,11 +27,11 @@
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
29 29
30#include <plat/fpga.h>
31
32#include <mach/hardware.h> 30#include <mach/hardware.h>
33 31
34#include "iomap.h" 32#include "iomap.h"
33#include "common.h"
34#include "fpga.h"
35 35
36static void fpga_mask_irq(struct irq_data *d) 36static void fpga_mask_irq(struct irq_data *d)
37{ 37{
diff --git a/arch/arm/mach-omap1/fpga.h b/arch/arm/mach-omap1/fpga.h
new file mode 100644
index 000000000000..4b4307a80e48
--- /dev/null
+++ b/arch/arm/mach-omap1/fpga.h
@@ -0,0 +1,52 @@
1/*
2 * Interrupt handler for OMAP-1510 FPGA
3 *
4 * Copyright (C) 2001 RidgeRun, Inc.
5 * Author: Greg Lonnon <glonnon@ridgerun.com>
6 *
7 * Copyright (C) 2002 MontaVista Software, Inc.
8 *
9 * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
10 * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#ifndef __ASM_ARCH_OMAP_FPGA_H
18#define __ASM_ARCH_OMAP_FPGA_H
19
20/*
21 * ---------------------------------------------------------------------------
22 * H2/P2 Debug board FPGA
23 * ---------------------------------------------------------------------------
24 */
25/* maps in the FPGA registers and the ETHR registers */
26#define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */
27#define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */
28#define H2P2_DBG_FPGA_START 0x04000000 /* PA */
29
30#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300)
31#define H2P2_DBG_FPGA_FPGA_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */
32#define H2P2_DBG_FPGA_BOARD_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */
33#define H2P2_DBG_FPGA_GPIO IOMEM(H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */
34#define H2P2_DBG_FPGA_LEDS IOMEM(H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */
35#define H2P2_DBG_FPGA_MISC_INPUTS IOMEM(H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */
36#define H2P2_DBG_FPGA_LAN_STATUS IOMEM(H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */
37#define H2P2_DBG_FPGA_LAN_RESET IOMEM(H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */
38
39/* LEDs definition on debug board (16 LEDs, all physically green) */
40#define H2P2_DBG_FPGA_LED_GREEN (1 << 15)
41#define H2P2_DBG_FPGA_LED_AMBER (1 << 14)
42#define H2P2_DBG_FPGA_LED_RED (1 << 13)
43#define H2P2_DBG_FPGA_LED_BLUE (1 << 12)
44/* cpu0 load-meter LEDs */
45#define H2P2_DBG_FPGA_LOAD_METER (1 << 0) // A bit of fun on our board ...
46#define H2P2_DBG_FPGA_LOAD_METER_SIZE 11
47#define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
48
49#define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0)
50#define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1)
51
52#endif
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
index 98e6f39224a4..02b3eb2e201c 100644
--- a/arch/arm/mach-omap1/gpio15xx.c
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -19,6 +19,8 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_data/gpio-omap.h> 20#include <linux/platform_data/gpio-omap.h>
21 21
22#include <mach/irqs.h>
23
22#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE 24#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
23#define OMAP1510_GPIO_BASE 0xFFFCE000 25#define OMAP1510_GPIO_BASE 0xFFFCE000
24 26
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 33f419236b17..b9952a258d82 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -19,6 +19,8 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_data/gpio-omap.h> 20#include <linux/platform_data/gpio-omap.h>
21 21
22#include <mach/irqs.h>
23
22#define OMAP1610_GPIO1_BASE 0xfffbe400 24#define OMAP1610_GPIO1_BASE 0xfffbe400
23#define OMAP1610_GPIO2_BASE 0xfffbec00 25#define OMAP1610_GPIO2_BASE 0xfffbec00
24#define OMAP1610_GPIO3_BASE 0xfffbb400 26#define OMAP1610_GPIO3_BASE 0xfffbb400
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
index 958ce9acee95..f5819b2b7cbe 100644
--- a/arch/arm/mach-omap1/gpio7xx.c
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -19,6 +19,8 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_data/gpio-omap.h> 20#include <linux/platform_data/gpio-omap.h>
21 21
22#include <mach/irqs.h>
23
22#define OMAP7XX_GPIO1_BASE 0xfffbc000 24#define OMAP7XX_GPIO1_BASE 0xfffbc000
23#define OMAP7XX_GPIO2_BASE 0xfffbc800 25#define OMAP7XX_GPIO2_BASE 0xfffbc800
24#define OMAP7XX_GPIO3_BASE 0xfffbd000 26#define OMAP7XX_GPIO3_BASE 0xfffbd000
diff --git a/arch/arm/mach-omap1/i2c.c b/arch/arm/mach-omap1/i2c.c
index a0551a6d7451..faca808cb3d9 100644
--- a/arch/arm/mach-omap1/i2c.c
+++ b/arch/arm/mach-omap1/i2c.c
@@ -19,11 +19,25 @@
19 * 19 *
20 */ 20 */
21 21
22#include <plat/i2c.h> 22#include <linux/i2c-omap.h>
23#include <mach/mux.h> 23#include <mach/mux.h>
24#include <plat/cpu.h> 24#include "soc.h"
25
26#include <plat/i2c.h>
27
28#define OMAP_I2C_SIZE 0x3f
29#define OMAP1_I2C_BASE 0xfffb3800
30#define OMAP1_INT_I2C (32 + 4)
31
32static const char name[] = "omap_i2c";
25 33
26void __init omap1_i2c_mux_pins(int bus_id) 34static struct resource i2c_resources[2] = {
35};
36
37static struct platform_device omap_i2c_devices[1] = {
38};
39
40static void __init omap1_i2c_mux_pins(int bus_id)
27{ 41{
28 if (cpu_is_omap7xx()) { 42 if (cpu_is_omap7xx()) {
29 omap_cfg_reg(I2C_7XX_SDA); 43 omap_cfg_reg(I2C_7XX_SDA);
@@ -33,3 +47,47 @@ void __init omap1_i2c_mux_pins(int bus_id)
33 omap_cfg_reg(I2C_SCL); 47 omap_cfg_reg(I2C_SCL);
34 } 48 }
35} 49}
50
51int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *pdata,
52 int bus_id)
53{
54 struct platform_device *pdev;
55 struct resource *res;
56
57 if (bus_id > 1)
58 return -EINVAL;
59
60 omap1_i2c_mux_pins(bus_id);
61
62 pdev = &omap_i2c_devices[bus_id - 1];
63 pdev->id = bus_id;
64 pdev->name = name;
65 pdev->num_resources = ARRAY_SIZE(i2c_resources);
66 res = i2c_resources;
67 res[0].start = OMAP1_I2C_BASE;
68 res[0].end = res[0].start + OMAP_I2C_SIZE;
69 res[0].flags = IORESOURCE_MEM;
70 res[1].start = OMAP1_INT_I2C;
71 res[1].flags = IORESOURCE_IRQ;
72 pdev->resource = res;
73
74 /* all OMAP1 have IP version 1 register set */
75 pdata->rev = OMAP_I2C_IP_VERSION_1;
76
77 /* all OMAP1 I2C are implemented like this */
78 pdata->flags = OMAP_I2C_FLAG_NO_FIFO |
79 OMAP_I2C_FLAG_SIMPLE_CLOCK |
80 OMAP_I2C_FLAG_16BIT_DATA_REG |
81 OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK;
82
83 /* how the cpu bus is wired up differs for 7xx only */
84
85 if (cpu_is_omap7xx())
86 pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_1;
87 else
88 pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_2;
89
90 pdev->dev.platform_data = pdata;
91
92 return platform_device_register(pdev);
93}
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index a1b846aacdaf..52de382fc804 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -17,7 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <asm/system_info.h> 18#include <asm/system_info.h>
19 19
20#include <plat/cpu.h> 20#include "soc.h"
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23 23
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index 2b36a281dc84..5c1a26c9f490 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -13,7 +13,7 @@
13 13
14#include <linux/serial_reg.h> 14#include <linux/serial_reg.h>
15 15
16#include <plat/serial.h> 16#include "serial.h"
17 17
18 .pushsection .data 18 .pushsection .data
19omap_uart_phys: .word 0x0 19omap_uart_phys: .word 0x0
diff --git a/arch/arm/mach-omap1/include/mach/entry-macro.S b/arch/arm/mach-omap1/include/mach/entry-macro.S
index 88f08cab1717..78a8c6c24764 100644
--- a/arch/arm/mach-omap1/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap1/include/mach/entry-macro.S
@@ -13,8 +13,6 @@
13#include <mach/hardware.h> 13#include <mach/hardware.h>
14#include <mach/irqs.h> 14#include <mach/irqs.h>
15 15
16#include "../../iomap.h"
17
18 .macro get_irqnr_preamble, base, tmp 16 .macro get_irqnr_preamble, base, tmp
19 .endm 17 .endm
20 18
diff --git a/arch/arm/mach-omap1/include/mach/gpio.h b/arch/arm/mach-omap1/include/mach/gpio.h
deleted file mode 100644
index ebf86c0f4f46..000000000000
--- a/arch/arm/mach-omap1/include/mach/gpio.h
+++ /dev/null
@@ -1,3 +0,0 @@
1/*
2 * arch/arm/mach-omap1/include/mach/gpio.h
3 */
diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h
index 84248d250adb..5875a5098d35 100644
--- a/arch/arm/mach-omap1/include/mach/hardware.h
+++ b/arch/arm/mach-omap1/include/mach/hardware.h
@@ -39,7 +39,7 @@
39#include <asm/sizes.h> 39#include <asm/sizes.h>
40#ifndef __ASSEMBLER__ 40#ifndef __ASSEMBLER__
41#include <asm/types.h> 41#include <asm/types.h>
42#include <plat/cpu.h> 42#include <mach/soc.h>
43 43
44/* 44/*
45 * NOTE: Please use ioremap + __raw_read/write where possible instead of these 45 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
@@ -51,7 +51,7 @@ extern void omap_writeb(u8 v, u32 pa);
51extern void omap_writew(u16 v, u32 pa); 51extern void omap_writew(u16 v, u32 pa);
52extern void omap_writel(u32 v, u32 pa); 52extern void omap_writel(u32 v, u32 pa);
53 53
54#include <plat/tc.h> 54#include <mach/tc.h>
55 55
56/* Almost all documentation for chip and board memory maps assumes 56/* Almost all documentation for chip and board memory maps assumes
57 * BM is clear. Most devel boards have a switch to control booting 57 * BM is clear. Most devel boards have a switch to control booting
@@ -72,7 +72,10 @@ static inline u32 omap_cs3_phys(void)
72 72
73#endif /* ifndef __ASSEMBLER__ */ 73#endif /* ifndef __ASSEMBLER__ */
74 74
75#include <plat/serial.h> 75#define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */
76#define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET)
77
78#include <mach/serial.h>
76 79
77/* 80/*
78 * --------------------------------------------------------------------------- 81 * ---------------------------------------------------------------------------
diff --git a/arch/arm/mach-omap1/include/mach/memory.h b/arch/arm/mach-omap1/include/mach/memory.h
index 901082def9bd..3c2530523111 100644
--- a/arch/arm/mach-omap1/include/mach/memory.h
+++ b/arch/arm/mach-omap1/include/mach/memory.h
@@ -19,7 +19,7 @@
19 * because of the strncmp(). 19 * because of the strncmp().
20 */ 20 */
21#if defined(CONFIG_ARCH_OMAP15XX) && !defined(__ASSEMBLER__) 21#if defined(CONFIG_ARCH_OMAP15XX) && !defined(__ASSEMBLER__)
22#include <plat/cpu.h> 22#include <mach/soc.h>
23 23
24/* 24/*
25 * OMAP-1510 Local Bus address offset 25 * OMAP-1510 Local Bus address offset
diff --git a/arch/arm/mach-omap1/include/mach/omap1510.h b/arch/arm/mach-omap1/include/mach/omap1510.h
index 8fe05d6137c0..3d235244bf5c 100644
--- a/arch/arm/mach-omap1/include/mach/omap1510.h
+++ b/arch/arm/mach-omap1/include/mach/omap1510.h
@@ -45,5 +45,118 @@
45 45
46#define OMAP1510_DSP_MMU_BASE (0xfffed200) 46#define OMAP1510_DSP_MMU_BASE (0xfffed200)
47 47
48/*
49 * ---------------------------------------------------------------------------
50 * OMAP-1510 FPGA
51 * ---------------------------------------------------------------------------
52 */
53#define OMAP1510_FPGA_BASE 0xE8000000 /* VA */
54#define OMAP1510_FPGA_SIZE SZ_4K
55#define OMAP1510_FPGA_START 0x08000000 /* PA */
56
57/* Revision */
58#define OMAP1510_FPGA_REV_LOW IOMEM(OMAP1510_FPGA_BASE + 0x0)
59#define OMAP1510_FPGA_REV_HIGH IOMEM(OMAP1510_FPGA_BASE + 0x1)
60#define OMAP1510_FPGA_LCD_PANEL_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x2)
61#define OMAP1510_FPGA_LED_DIGIT IOMEM(OMAP1510_FPGA_BASE + 0x3)
62#define INNOVATOR_FPGA_HID_SPI IOMEM(OMAP1510_FPGA_BASE + 0x4)
63#define OMAP1510_FPGA_POWER IOMEM(OMAP1510_FPGA_BASE + 0x5)
64
65/* Interrupt status */
66#define OMAP1510_FPGA_ISR_LO IOMEM(OMAP1510_FPGA_BASE + 0x6)
67#define OMAP1510_FPGA_ISR_HI IOMEM(OMAP1510_FPGA_BASE + 0x7)
68
69/* Interrupt mask */
70#define OMAP1510_FPGA_IMR_LO IOMEM(OMAP1510_FPGA_BASE + 0x8)
71#define OMAP1510_FPGA_IMR_HI IOMEM(OMAP1510_FPGA_BASE + 0x9)
72
73/* Reset registers */
74#define OMAP1510_FPGA_HOST_RESET IOMEM(OMAP1510_FPGA_BASE + 0xa)
75#define OMAP1510_FPGA_RST IOMEM(OMAP1510_FPGA_BASE + 0xb)
76
77#define OMAP1510_FPGA_AUDIO IOMEM(OMAP1510_FPGA_BASE + 0xc)
78#define OMAP1510_FPGA_DIP IOMEM(OMAP1510_FPGA_BASE + 0xe)
79#define OMAP1510_FPGA_FPGA_IO IOMEM(OMAP1510_FPGA_BASE + 0xf)
80#define OMAP1510_FPGA_UART1 IOMEM(OMAP1510_FPGA_BASE + 0x14)
81#define OMAP1510_FPGA_UART2 IOMEM(OMAP1510_FPGA_BASE + 0x15)
82#define OMAP1510_FPGA_OMAP1510_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x16)
83#define OMAP1510_FPGA_BOARD_REV IOMEM(OMAP1510_FPGA_BASE + 0x18)
84#define INNOVATOR_FPGA_CAM_USB_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20c)
85#define OMAP1510P1_PPT_DATA IOMEM(OMAP1510_FPGA_BASE + 0x100)
86#define OMAP1510P1_PPT_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x101)
87#define OMAP1510P1_PPT_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x102)
88
89#define OMAP1510_FPGA_TOUCHSCREEN IOMEM(OMAP1510_FPGA_BASE + 0x204)
90
91#define INNOVATOR_FPGA_INFO IOMEM(OMAP1510_FPGA_BASE + 0x205)
92#define INNOVATOR_FPGA_LCD_BRIGHT_LO IOMEM(OMAP1510_FPGA_BASE + 0x206)
93#define INNOVATOR_FPGA_LCD_BRIGHT_HI IOMEM(OMAP1510_FPGA_BASE + 0x207)
94#define INNOVATOR_FPGA_LED_GRN_LO IOMEM(OMAP1510_FPGA_BASE + 0x208)
95#define INNOVATOR_FPGA_LED_GRN_HI IOMEM(OMAP1510_FPGA_BASE + 0x209)
96#define INNOVATOR_FPGA_LED_RED_LO IOMEM(OMAP1510_FPGA_BASE + 0x20a)
97#define INNOVATOR_FPGA_LED_RED_HI IOMEM(OMAP1510_FPGA_BASE + 0x20b)
98#define INNOVATOR_FPGA_EXP_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20d)
99#define INNOVATOR_FPGA_ISR2 IOMEM(OMAP1510_FPGA_BASE + 0x20e)
100#define INNOVATOR_FPGA_IMR2 IOMEM(OMAP1510_FPGA_BASE + 0x210)
101
102#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300)
103
104/*
105 * Power up Giga UART driver, turn on HID clock.
106 * Turn off BT power, since we're not using it and it
107 * draws power.
108 */
109#define OMAP1510_FPGA_RESET_VALUE 0x42
110
111#define OMAP1510_FPGA_PCR_IF_PD0 (1 << 7)
112#define OMAP1510_FPGA_PCR_COM2_EN (1 << 6)
113#define OMAP1510_FPGA_PCR_COM1_EN (1 << 5)
114#define OMAP1510_FPGA_PCR_EXP_PD0 (1 << 4)
115#define OMAP1510_FPGA_PCR_EXP_PD1 (1 << 3)
116#define OMAP1510_FPGA_PCR_48MHZ_CLK (1 << 2)
117#define OMAP1510_FPGA_PCR_4MHZ_CLK (1 << 1)
118#define OMAP1510_FPGA_PCR_RSRVD_BIT0 (1 << 0)
119
120/*
121 * Innovator/OMAP1510 FPGA HID register bit definitions
122 */
123#define OMAP1510_FPGA_HID_SCLK (1<<0) /* output */
124#define OMAP1510_FPGA_HID_MOSI (1<<1) /* output */
125#define OMAP1510_FPGA_HID_nSS (1<<2) /* output 0/1 chip idle/select */
126#define OMAP1510_FPGA_HID_nHSUS (1<<3) /* output 0/1 host active/suspended */
127#define OMAP1510_FPGA_HID_MISO (1<<4) /* input */
128#define OMAP1510_FPGA_HID_ATN (1<<5) /* input 0/1 chip idle/ATN */
129#define OMAP1510_FPGA_HID_rsrvd (1<<6)
130#define OMAP1510_FPGA_HID_RESETn (1<<7) /* output - 0/1 USAR reset/run */
131
132/* The FPGA IRQ is cascaded through GPIO_13 */
133#define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13)
134
135/* IRQ Numbers for interrupts muxed through the FPGA */
136#define OMAP1510_INT_FPGA_ATN (OMAP_FPGA_IRQ_BASE + 0)
137#define OMAP1510_INT_FPGA_ACK (OMAP_FPGA_IRQ_BASE + 1)
138#define OMAP1510_INT_FPGA2 (OMAP_FPGA_IRQ_BASE + 2)
139#define OMAP1510_INT_FPGA3 (OMAP_FPGA_IRQ_BASE + 3)
140#define OMAP1510_INT_FPGA4 (OMAP_FPGA_IRQ_BASE + 4)
141#define OMAP1510_INT_FPGA5 (OMAP_FPGA_IRQ_BASE + 5)
142#define OMAP1510_INT_FPGA6 (OMAP_FPGA_IRQ_BASE + 6)
143#define OMAP1510_INT_FPGA7 (OMAP_FPGA_IRQ_BASE + 7)
144#define OMAP1510_INT_FPGA8 (OMAP_FPGA_IRQ_BASE + 8)
145#define OMAP1510_INT_FPGA9 (OMAP_FPGA_IRQ_BASE + 9)
146#define OMAP1510_INT_FPGA10 (OMAP_FPGA_IRQ_BASE + 10)
147#define OMAP1510_INT_FPGA11 (OMAP_FPGA_IRQ_BASE + 11)
148#define OMAP1510_INT_FPGA12 (OMAP_FPGA_IRQ_BASE + 12)
149#define OMAP1510_INT_ETHER (OMAP_FPGA_IRQ_BASE + 13)
150#define OMAP1510_INT_FPGAUART1 (OMAP_FPGA_IRQ_BASE + 14)
151#define OMAP1510_INT_FPGAUART2 (OMAP_FPGA_IRQ_BASE + 15)
152#define OMAP1510_INT_FPGA_TS (OMAP_FPGA_IRQ_BASE + 16)
153#define OMAP1510_INT_FPGA17 (OMAP_FPGA_IRQ_BASE + 17)
154#define OMAP1510_INT_FPGA_CAM (OMAP_FPGA_IRQ_BASE + 18)
155#define OMAP1510_INT_FPGA_RTC_A (OMAP_FPGA_IRQ_BASE + 19)
156#define OMAP1510_INT_FPGA_RTC_B (OMAP_FPGA_IRQ_BASE + 20)
157#define OMAP1510_INT_FPGA_CD (OMAP_FPGA_IRQ_BASE + 21)
158#define OMAP1510_INT_FPGA22 (OMAP_FPGA_IRQ_BASE + 22)
159#define OMAP1510_INT_FPGA23 (OMAP_FPGA_IRQ_BASE + 23)
160
48#endif /* __ASM_ARCH_OMAP15XX_H */ 161#endif /* __ASM_ARCH_OMAP15XX_H */
49 162
diff --git a/arch/arm/mach-omap1/include/mach/serial.h b/arch/arm/mach-omap1/include/mach/serial.h
new file mode 100644
index 000000000000..2ce6a2db470b
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/serial.h
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2009 Texas Instruments
3 * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
4 *
5 * This program is distributed in the hope that it will be useful,
6 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8 * GNU General Public License for more details.
9 */
10
11#ifndef __ASM_ARCH_SERIAL_H
12#define __ASM_ARCH_SERIAL_H
13
14#include <linux/init.h>
15
16/*
17 * Memory entry used for the DEBUG_LL UART configuration, relative to
18 * start of RAM. See also uncompress.h and debug-macro.S.
19 *
20 * Note that using a memory location for storing the UART configuration
21 * has at least two limitations:
22 *
23 * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
24 * uncompress code could then partially overwrite itself
25 * 2. We assume printascii is called at least once before paging_init,
26 * and addruart has a chance to read OMAP_UART_INFO
27 */
28#define OMAP_UART_INFO_OFS 0x3ffc
29
30/* OMAP1 serial ports */
31#define OMAP1_UART1_BASE 0xfffb0000
32#define OMAP1_UART2_BASE 0xfffb0800
33#define OMAP1_UART3_BASE 0xfffb9800
34
35#define OMAP_PORT_SHIFT 2
36#define OMAP7XX_PORT_SHIFT 0
37
38#define OMAP1510_BASE_BAUD (12000000/16)
39#define OMAP16XX_BASE_BAUD (48000000/16)
40
41/*
42 * DEBUG_LL port encoding stored into the UART1 scratchpad register by
43 * decomp_setup in uncompress.h
44 */
45#define OMAP1UART1 11
46#define OMAP1UART2 12
47#define OMAP1UART3 13
48
49#ifndef __ASSEMBLER__
50extern void omap_serial_init(void);
51#endif
52
53#endif
diff --git a/arch/arm/mach-omap1/include/mach/soc.h b/arch/arm/mach-omap1/include/mach/soc.h
new file mode 100644
index 000000000000..6cf9c1cc2bef
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/soc.h
@@ -0,0 +1,229 @@
1/*
2 * OMAP cpu type detection
3 *
4 * Copyright (C) 2004, 2008 Nokia Corporation
5 *
6 * Copyright (C) 2009-11 Texas Instruments.
7 *
8 * Written by Tony Lindgren <tony.lindgren@nokia.com>
9 *
10 * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28#ifndef __ASM_ARCH_OMAP_CPU_H
29#define __ASM_ARCH_OMAP_CPU_H
30
31#ifndef __ASSEMBLY__
32
33#include <linux/bitops.h>
34
35/*
36 * Test if multicore OMAP support is needed
37 */
38#undef MULTI_OMAP1
39#undef OMAP_NAME
40
41#ifdef CONFIG_ARCH_OMAP730
42# ifdef OMAP_NAME
43# undef MULTI_OMAP1
44# define MULTI_OMAP1
45# else
46# define OMAP_NAME omap730
47# endif
48#endif
49#ifdef CONFIG_ARCH_OMAP850
50# ifdef OMAP_NAME
51# undef MULTI_OMAP1
52# define MULTI_OMAP1
53# else
54# define OMAP_NAME omap850
55# endif
56#endif
57#ifdef CONFIG_ARCH_OMAP15XX
58# ifdef OMAP_NAME
59# undef MULTI_OMAP1
60# define MULTI_OMAP1
61# else
62# define OMAP_NAME omap1510
63# endif
64#endif
65#ifdef CONFIG_ARCH_OMAP16XX
66# ifdef OMAP_NAME
67# undef MULTI_OMAP1
68# define MULTI_OMAP1
69# else
70# define OMAP_NAME omap16xx
71# endif
72#endif
73
74/*
75 * omap_rev bits:
76 * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
77 * CPU revision (See _REV_ defined in cpu.h) [15:08]
78 * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00]
79 */
80unsigned int omap_rev(void);
81
82/*
83 * Get the CPU revision for OMAP devices
84 */
85#define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
86
87/*
88 * Macros to group OMAP into cpu classes.
89 * These can be used in most places.
90 * cpu_is_omap7xx(): True for OMAP730, OMAP850
91 * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310
92 * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710
93 */
94#define GET_OMAP_CLASS (omap_rev() & 0xff)
95
96#define IS_OMAP_CLASS(class, id) \
97static inline int is_omap ##class (void) \
98{ \
99 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
100}
101
102#define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
103
104#define IS_OMAP_SUBCLASS(subclass, id) \
105static inline int is_omap ##subclass (void) \
106{ \
107 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
108}
109
110IS_OMAP_CLASS(7xx, 0x07)
111IS_OMAP_CLASS(15xx, 0x15)
112IS_OMAP_CLASS(16xx, 0x16)
113
114#define cpu_is_omap7xx() 0
115#define cpu_is_omap15xx() 0
116#define cpu_is_omap16xx() 0
117
118#if defined(MULTI_OMAP1)
119# if defined(CONFIG_ARCH_OMAP730)
120# undef cpu_is_omap7xx
121# define cpu_is_omap7xx() is_omap7xx()
122# endif
123# if defined(CONFIG_ARCH_OMAP850)
124# undef cpu_is_omap7xx
125# define cpu_is_omap7xx() is_omap7xx()
126# endif
127# if defined(CONFIG_ARCH_OMAP15XX)
128# undef cpu_is_omap15xx
129# define cpu_is_omap15xx() is_omap15xx()
130# endif
131# if defined(CONFIG_ARCH_OMAP16XX)
132# undef cpu_is_omap16xx
133# define cpu_is_omap16xx() is_omap16xx()
134# endif
135#else
136# if defined(CONFIG_ARCH_OMAP730)
137# undef cpu_is_omap7xx
138# define cpu_is_omap7xx() 1
139# endif
140# if defined(CONFIG_ARCH_OMAP850)
141# undef cpu_is_omap7xx
142# define cpu_is_omap7xx() 1
143# endif
144# if defined(CONFIG_ARCH_OMAP15XX)
145# undef cpu_is_omap15xx
146# define cpu_is_omap15xx() 1
147# endif
148# if defined(CONFIG_ARCH_OMAP16XX)
149# undef cpu_is_omap16xx
150# define cpu_is_omap16xx() 1
151# endif
152#endif
153
154/*
155 * Macros to detect individual cpu types.
156 * These are only rarely needed.
157 * cpu_is_omap310(): True for OMAP310
158 * cpu_is_omap1510(): True for OMAP1510
159 * cpu_is_omap1610(): True for OMAP1610
160 * cpu_is_omap1611(): True for OMAP1611
161 * cpu_is_omap5912(): True for OMAP5912
162 * cpu_is_omap1621(): True for OMAP1621
163 * cpu_is_omap1710(): True for OMAP1710
164 */
165#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
166
167#define IS_OMAP_TYPE(type, id) \
168static inline int is_omap ##type (void) \
169{ \
170 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
171}
172
173IS_OMAP_TYPE(310, 0x0310)
174IS_OMAP_TYPE(1510, 0x1510)
175IS_OMAP_TYPE(1610, 0x1610)
176IS_OMAP_TYPE(1611, 0x1611)
177IS_OMAP_TYPE(5912, 0x1611)
178IS_OMAP_TYPE(1621, 0x1621)
179IS_OMAP_TYPE(1710, 0x1710)
180
181#define cpu_is_omap310() 0
182#define cpu_is_omap1510() 0
183#define cpu_is_omap1610() 0
184#define cpu_is_omap5912() 0
185#define cpu_is_omap1611() 0
186#define cpu_is_omap1621() 0
187#define cpu_is_omap1710() 0
188
189/* These are needed to compile common code */
190#ifdef CONFIG_ARCH_OMAP1
191#define cpu_is_omap242x() 0
192#define cpu_is_omap2430() 0
193#define cpu_is_omap243x() 0
194#define cpu_is_omap24xx() 0
195#define cpu_is_omap34xx() 0
196#define cpu_is_omap44xx() 0
197#define soc_is_omap54xx() 0
198#define soc_is_am33xx() 0
199#define cpu_class_is_omap1() 1
200#define cpu_class_is_omap2() 0
201#endif
202
203/*
204 * Whether we have MULTI_OMAP1 or not, we still need to distinguish
205 * between 310 vs. 1510 and 1611B/5912 vs. 1710.
206 */
207
208#if defined(CONFIG_ARCH_OMAP15XX)
209# undef cpu_is_omap310
210# undef cpu_is_omap1510
211# define cpu_is_omap310() is_omap310()
212# define cpu_is_omap1510() is_omap1510()
213#endif
214
215#if defined(CONFIG_ARCH_OMAP16XX)
216# undef cpu_is_omap1610
217# undef cpu_is_omap1611
218# undef cpu_is_omap5912
219# undef cpu_is_omap1621
220# undef cpu_is_omap1710
221# define cpu_is_omap1610() is_omap1610()
222# define cpu_is_omap1611() is_omap1611()
223# define cpu_is_omap5912() is_omap5912()
224# define cpu_is_omap1621() is_omap1621()
225# define cpu_is_omap1710() is_omap1710()
226#endif
227
228#endif /* __ASSEMBLY__ */
229#endif
diff --git a/arch/arm/plat-omap/include/plat/tc.h b/arch/arm/mach-omap1/include/mach/tc.h
index 1b4b2da86203..1b4b2da86203 100644
--- a/arch/arm/plat-omap/include/plat/tc.h
+++ b/arch/arm/mach-omap1/include/mach/tc.h
diff --git a/arch/arm/mach-omap1/include/mach/uncompress.h b/arch/arm/mach-omap1/include/mach/uncompress.h
index 0ff22dc075c7..ad6fbe7d83f2 100644
--- a/arch/arm/mach-omap1/include/mach/uncompress.h
+++ b/arch/arm/mach-omap1/include/mach/uncompress.h
@@ -1,5 +1,122 @@
1/* 1/*
2 * arch/arm/mach-omap1/include/mach/uncompress.h 2 * arch/arm/plat-omap/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
10 *
11 * Rewritten by:
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
14 *
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
3 */ 18 */
4 19
5#include <plat/uncompress.h> 20#include <linux/types.h>
21#include <linux/serial_reg.h>
22
23#include <asm/memory.h>
24#include <asm/mach-types.h>
25
26#include "serial.h"
27
28#define MDR1_MODE_MASK 0x07
29
30volatile u8 *uart_base;
31int uart_shift;
32
33/*
34 * Store the DEBUG_LL uart number into memory.
35 * See also debug-macro.S, and serial.c for related code.
36 */
37static void set_omap_uart_info(unsigned char port)
38{
39 /*
40 * Get address of some.bss variable and round it down
41 * a la CONFIG_AUTO_ZRELADDR.
42 */
43 u32 ram_start = (u32)&uart_shift & 0xf8000000;
44 u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
45 *uart_info = port;
46}
47
48static void putc(int c)
49{
50 if (!uart_base)
51 return;
52
53 /* Check for UART 16x mode */
54 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
55 return;
56
57 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
58 barrier();
59 uart_base[UART_TX << uart_shift] = c;
60}
61
62static inline void flush(void)
63{
64}
65
66/*
67 * Macros to configure UART1 and debug UART
68 */
69#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
70 if (machine_is_##mach()) { \
71 uart_base = (volatile u8 *)(dbg_uart); \
72 uart_shift = (dbg_shft); \
73 port = (dbg_id); \
74 set_omap_uart_info(port); \
75 break; \
76 }
77
78#define DEBUG_LL_OMAP7XX(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
80 OMAP1UART##p)
81
82#define DEBUG_LL_OMAP1(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
84 OMAP1UART##p)
85
86static inline void arch_decomp_setup(void)
87{
88 int port = 0;
89
90 /*
91 * Initialize the port based on the machine ID from the bootloader.
92 * Note that we're using macros here instead of switch statement
93 * as machine_is functions are optimized out for the boards that
94 * are not selected.
95 */
96 do {
97 /* omap7xx/8xx based boards using UART1 with shift 0 */
98 DEBUG_LL_OMAP7XX(1, herald);
99 DEBUG_LL_OMAP7XX(1, omap_perseus2);
100
101 /* omap15xx/16xx based boards using UART1 */
102 DEBUG_LL_OMAP1(1, ams_delta);
103 DEBUG_LL_OMAP1(1, nokia770);
104 DEBUG_LL_OMAP1(1, omap_h2);
105 DEBUG_LL_OMAP1(1, omap_h3);
106 DEBUG_LL_OMAP1(1, omap_innovator);
107 DEBUG_LL_OMAP1(1, omap_osk);
108 DEBUG_LL_OMAP1(1, omap_palmte);
109 DEBUG_LL_OMAP1(1, omap_palmz71);
110
111 /* omap15xx/16xx based boards using UART2 */
112 DEBUG_LL_OMAP1(2, omap_palmtt);
113
114 /* omap15xx/16xx based boards using UART3 */
115 DEBUG_LL_OMAP1(3, sx1);
116 } while (0);
117}
118
119/*
120 * nothing to do
121 */
122#define arch_decomp_wdog()
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 6a5baab1f4cb..5a3b80617a11 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -17,8 +17,8 @@
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18 18
19#include <mach/mux.h> 19#include <mach/mux.h>
20#include <plat/tc.h> 20#include <mach/tc.h>
21#include <plat/dma.h> 21#include <plat-omap/dma-omap.h>
22 22
23#include "iomap.h" 23#include "iomap.h"
24#include "common.h" 24#include "common.h"
@@ -134,7 +134,6 @@ void __init omap1_init_early(void)
134 */ 134 */
135 omap1_clk_init(); 135 omap1_clk_init();
136 omap1_mux_init(); 136 omap1_mux_init();
137 omap_init_consistent_dma_size();
138} 137}
139 138
140void __init omap1_init_late(void) 139void __init omap1_init_late(void)
diff --git a/arch/arm/mach-omap1/iomap.h b/arch/arm/mach-omap1/iomap.h
index 330c4716b028..f4e2d7a21365 100644
--- a/arch/arm/mach-omap1/iomap.h
+++ b/arch/arm/mach-omap1/iomap.h
@@ -22,9 +22,6 @@
22 * 675 Mass Ave, Cambridge, MA 02139, USA. 22 * 675 Mass Ave, Cambridge, MA 02139, USA.
23 */ 23 */
24 24
25#define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */
26#define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET)
27
28/* 25/*
29 * ---------------------------------------------------------------------------- 26 * ----------------------------------------------------------------------------
30 * Omap1 specific IO mapping 27 * Omap1 specific IO mapping
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index 6995fb6a3345..122ef67939a2 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -45,7 +45,7 @@
45#include <asm/irq.h> 45#include <asm/irq.h>
46#include <asm/mach/irq.h> 46#include <asm/mach/irq.h>
47 47
48#include <plat/cpu.h> 48#include "soc.h"
49 49
50#include <mach/hardware.h> 50#include <mach/hardware.h>
51 51
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
index ed42628611bc..7ed8c1857d56 100644
--- a/arch/arm/mach-omap1/lcd_dma.c
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -27,11 +27,13 @@
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <linux/io.h> 28#include <linux/io.h>
29 29
30#include <plat/dma.h> 30#include <plat-omap/dma-omap.h>
31 31
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/lcdc.h> 33#include <mach/lcdc.h>
34 34
35#include "dma.h"
36
35int omap_lcd_dma_running(void) 37int omap_lcd_dma_running(void)
36{ 38{
37 /* 39 /*
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index bdc2e7541adb..c6d8fdf92e9c 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -19,14 +19,15 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21 21
22#include <plat/dma.h> 22#include <plat-omap/dma-omap.h>
23#include <mach/mux.h> 23#include <mach/mux.h>
24#include <plat/cpu.h> 24#include "soc.h"
25#include <linux/platform_data/asoc-ti-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
29#include "iomap.h" 29#include "iomap.h"
30#include "dma.h"
30 31
31#define DPS_RSTCT2_PER_EN (1 << 0) 32#define DPS_RSTCT2_PER_EN (1 << 0)
32#define DSP_RSTCT2_WD_PER_EN (1 << 1) 33#define DSP_RSTCT2_WD_PER_EN (1 << 1)
diff --git a/arch/arm/mach-omap1/mmc.h b/arch/arm/mach-omap1/mmc.h
new file mode 100644
index 000000000000..39c2b13de884
--- /dev/null
+++ b/arch/arm/mach-omap1/mmc.h
@@ -0,0 +1,18 @@
1#include <linux/mmc/host.h>
2#include <linux/platform_data/mmc-omap.h>
3
4#define OMAP15XX_NR_MMC 1
5#define OMAP16XX_NR_MMC 2
6#define OMAP1_MMC_SIZE 0x080
7#define OMAP1_MMC1_BASE 0xfffb7800
8#define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */
9
10#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
11void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
12 int nr_controllers);
13#else
14static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
15 int nr_controllers)
16{
17}
18#endif
diff --git a/arch/arm/mach-omap1/opp_data.c b/arch/arm/mach-omap1/opp_data.c
index 9cd4ddb51397..8dcebe6d8882 100644
--- a/arch/arm/mach-omap1/opp_data.c
+++ b/arch/arm/mach-omap1/opp_data.c
@@ -10,7 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#include <plat/clkdev_omap.h> 13#include "clock.h"
14#include "opp.h" 14#include "opp.h"
15 15
16/*------------------------------------------------------------------------- 16/*-------------------------------------------------------------------------
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 47ec16155483..66d663a6ef3a 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -44,23 +44,23 @@
44#include <linux/io.h> 44#include <linux/io.h>
45#include <linux/atomic.h> 45#include <linux/atomic.h>
46 46
47#include <asm/fncpy.h>
47#include <asm/system_misc.h> 48#include <asm/system_misc.h>
48#include <asm/irq.h> 49#include <asm/irq.h>
49#include <asm/mach/time.h> 50#include <asm/mach/time.h>
50#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
51 52
52#include <plat/cpu.h> 53#include <mach/tc.h>
53#include <plat/clock.h>
54#include <plat/sram.h>
55#include <plat/tc.h>
56#include <mach/mux.h> 54#include <mach/mux.h>
57#include <plat/dma.h> 55#include <plat-omap/dma-omap.h>
58#include <plat/dmtimer.h> 56#include <plat/dmtimer.h>
59 57
60#include <mach/irqs.h> 58#include <mach/irqs.h>
61 59
62#include "iomap.h" 60#include "iomap.h"
61#include "clock.h"
63#include "pm.h" 62#include "pm.h"
63#include "sram.h"
64 64
65static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 65static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
66static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; 66static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 7868e75ad077..3f2d39672393 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -19,8 +19,7 @@
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/err.h> 20#include <linux/err.h>
21 21
22#include <plat/omap_device.h> 22#include "soc.h"
23#include <plat/omap-pm.h>
24 23
25#ifdef CONFIG_PM_RUNTIME 24#ifdef CONFIG_PM_RUNTIME
26static int omap1_pm_runtime_suspend(struct device *dev) 25static int omap1_pm_runtime_suspend(struct device *dev)
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
index b17709103866..5eebd7e889d0 100644
--- a/arch/arm/mach-omap1/reset.c
+++ b/arch/arm/mach-omap1/reset.c
@@ -4,12 +4,24 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/io.h> 5#include <linux/io.h>
6 6
7#include <plat/prcm.h>
8
9#include <mach/hardware.h> 7#include <mach/hardware.h>
10 8
9#include "iomap.h"
11#include "common.h" 10#include "common.h"
12 11
12/* ARM_SYSST bit shifts related to SoC reset sources */
13#define ARM_SYSST_POR_SHIFT 5
14#define ARM_SYSST_EXT_RST_SHIFT 4
15#define ARM_SYSST_ARM_WDRST_SHIFT 2
16#define ARM_SYSST_GLOB_SWRST_SHIFT 1
17
18/* Standardized reset source bits (across all OMAP SoCs) */
19#define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT 0
20#define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT 1
21#define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
22#define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5
23
24
13void omap1_restart(char mode, const char *cmd) 25void omap1_restart(char mode, const char *cmd)
14{ 26{
15 /* 27 /*
@@ -23,3 +35,28 @@ void omap1_restart(char mode, const char *cmd)
23 35
24 omap_writew(1, ARM_RSTCT1); 36 omap_writew(1, ARM_RSTCT1);
25} 37}
38
39/**
40 * omap1_get_reset_sources - return the source of the SoC's last reset
41 *
42 * Returns bits that represent the last reset source for the SoC. The
43 * format is standardized across OMAPs for use by the OMAP watchdog.
44 */
45u32 omap1_get_reset_sources(void)
46{
47 u32 ret = 0;
48 u16 rs;
49
50 rs = __raw_readw(OMAP1_IO_ADDRESS(ARM_SYSST));
51
52 if (rs & (1 << ARM_SYSST_POR_SHIFT))
53 ret |= 1 << OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT;
54 if (rs & (1 << ARM_SYSST_EXT_RST_SHIFT))
55 ret |= 1 << OMAP_EXTWARM_RST_SRC_ID_SHIFT;
56 if (rs & (1 << ARM_SYSST_ARM_WDRST_SHIFT))
57 ret |= 1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT;
58 if (rs & (1 << ARM_SYSST_GLOB_SWRST_SHIFT))
59 ret |= 1 << OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT;
60
61 return ret;
62}
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index b9d6834af835..d1ac08016f0b 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -23,7 +23,6 @@
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <mach/mux.h> 25#include <mach/mux.h>
26#include <plat/fpga.h>
27 26
28#include "pm.h" 27#include "pm.h"
29 28
diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
index 0e628743bd03..a908c51839a4 100644
--- a/arch/arm/mach-omap1/sleep.S
+++ b/arch/arm/mach-omap1/sleep.S
@@ -36,6 +36,8 @@
36 36
37#include <asm/assembler.h> 37#include <asm/assembler.h>
38 38
39#include <mach/hardware.h>
40
39#include "iomap.h" 41#include "iomap.h"
40#include "pm.h" 42#include "pm.h"
41 43
diff --git a/arch/arm/mach-omap1/soc.h b/arch/arm/mach-omap1/soc.h
new file mode 100644
index 000000000000..69daf0187b1d
--- /dev/null
+++ b/arch/arm/mach-omap1/soc.h
@@ -0,0 +1,4 @@
1/*
2 * We can move mach/soc.h here once the drivers are fixed
3 */
4#include <mach/soc.h>
diff --git a/arch/arm/mach-omap1/sram-init.c b/arch/arm/mach-omap1/sram-init.c
new file mode 100644
index 000000000000..6431b0f862ce
--- /dev/null
+++ b/arch/arm/mach-omap1/sram-init.c
@@ -0,0 +1,76 @@
1/*
2 * OMAP SRAM detection and management
3 *
4 * Copyright (C) 2005 Nokia Corporation
5 * Written by Tony Lindgren <tony@atomide.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/io.h>
16
17#include <asm/fncpy.h>
18#include <asm/tlb.h>
19#include <asm/cacheflush.h>
20
21#include <asm/mach/map.h>
22
23#include "soc.h"
24#include "sram.h"
25
26#define OMAP1_SRAM_PA 0x20000000
27#define SRAM_BOOTLOADER_SZ 0x80
28
29/*
30 * The amount of SRAM depends on the core type.
31 * Note that we cannot try to test for SRAM here because writes
32 * to secure SRAM will hang the system. Also the SRAM is not
33 * yet mapped at this point.
34 */
35static void __init omap_detect_and_map_sram(void)
36{
37 unsigned long omap_sram_skip = SRAM_BOOTLOADER_SZ;
38 unsigned long omap_sram_start = OMAP1_SRAM_PA;
39 unsigned long omap_sram_size;
40
41 if (cpu_is_omap7xx())
42 omap_sram_size = 0x32000; /* 200K */
43 else if (cpu_is_omap15xx())
44 omap_sram_size = 0x30000; /* 192K */
45 else if (cpu_is_omap1610() || cpu_is_omap1611() ||
46 cpu_is_omap1621() || cpu_is_omap1710())
47 omap_sram_size = 0x4000; /* 16K */
48 else {
49 pr_err("Could not detect SRAM size\n");
50 omap_sram_size = 0x4000;
51 }
52
53 omap_map_sram(omap_sram_start, omap_sram_size,
54 omap_sram_skip, 1);
55}
56
57static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl);
58
59void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl)
60{
61 BUG_ON(!_omap_sram_reprogram_clock);
62 /* On 730, bit 13 must always be 1 */
63 if (cpu_is_omap7xx())
64 ckctl |= 0x2000;
65 _omap_sram_reprogram_clock(dpllctl, ckctl);
66}
67
68int __init omap_sram_init(void)
69{
70 omap_detect_and_map_sram();
71 _omap_sram_reprogram_clock =
72 omap_sram_push(omap1_sram_reprogram_clock,
73 omap1_sram_reprogram_clock_sz);
74
75 return 0;
76}
diff --git a/arch/arm/mach-omap1/sram.h b/arch/arm/mach-omap1/sram.h
new file mode 100644
index 000000000000..d5a6c8362301
--- /dev/null
+++ b/arch/arm/mach-omap1/sram.h
@@ -0,0 +1,7 @@
1#include <plat/sram.h>
2
3extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
4
5/* Do not use these */
6extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
7extern unsigned long omap1_sram_reprogram_clock_sz;
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 74529549130c..89368195bf08 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -50,6 +50,7 @@
50#include <asm/mach/irq.h> 50#include <asm/mach/irq.h>
51#include <asm/mach/time.h> 51#include <asm/mach/time.h>
52 52
53#include <plat/counter-32k.h>
53#include <plat/dmtimer.h> 54#include <plat/dmtimer.h>
54 55
55#include <mach/hardware.h> 56#include <mach/hardware.h>
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index 84267edd9421..104fed366b8f 100644
--- a/arch/arm/mach-omap1/usb.c
+++ b/arch/arm/mach-omap1/usb.c
@@ -301,7 +301,7 @@ static inline void otg_device_init(struct omap_usb_config *pdata)
301 301
302#endif 302#endif
303 303
304u32 __init omap1_usb0_init(unsigned nwires, unsigned is_device) 304static u32 __init omap1_usb0_init(unsigned nwires, unsigned is_device)
305{ 305{
306 u32 syscon1 = 0; 306 u32 syscon1 = 0;
307 307
@@ -409,7 +409,7 @@ u32 __init omap1_usb0_init(unsigned nwires, unsigned is_device)
409 return syscon1 << 16; 409 return syscon1 << 16;
410} 410}
411 411
412u32 __init omap1_usb1_init(unsigned nwires) 412static u32 __init omap1_usb1_init(unsigned nwires)
413{ 413{
414 u32 syscon1 = 0; 414 u32 syscon1 = 0;
415 415
@@ -475,7 +475,7 @@ bad:
475 return syscon1 << 20; 475 return syscon1 << 20;
476} 476}
477 477
478u32 __init omap1_usb2_init(unsigned nwires, unsigned alt_pingroup) 478static u32 __init omap1_usb2_init(unsigned nwires, unsigned alt_pingroup)
479{ 479{
480 u32 syscon1 = 0; 480 u32 syscon1 = 0;
481 481
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fe40d9e488c9..78cbb8c5992e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -4,30 +4,37 @@
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 omap_hwmod.o 7 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
8 8 omap_device.o sram.o
9# INTCPS IP block support - XXX should be moved to drivers/ 9
10obj-$(CONFIG_ARCH_OMAP2) += irq.o 10omap-2-3-common = irq.o
11obj-$(CONFIG_ARCH_OMAP3) += irq.o 11hwmod-common = omap_hwmod.o \
12obj-$(CONFIG_SOC_AM33XX) += irq.o 12 omap_hwmod_common_data.o
13 13clock-common = clock.o clock_common_data.o \
14# Secure monitor API support 14 clkt_dpll.o clkt_clksel.o
15obj-$(CONFIG_ARCH_OMAP3) += omap-smc.o omap-secure.o 15secure-common = omap-smc.o omap-secure.o
16obj-$(CONFIG_ARCH_OMAP4) += omap-smc.o omap-secure.o 16
17obj-$(CONFIG_SOC_OMAP5) += omap-smc.o omap-secure.o 17obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
18obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
19obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common)
20obj-$(CONFIG_SOC_AM33XX) += irq.o $(hwmod-common)
21obj-$(CONFIG_SOC_OMAP5) += prm44xx.o $(hwmod-common) $(secure-common)
18 22
19ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) 23ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
20obj-y += mcbsp.o 24obj-y += mcbsp.o
21endif 25endif
22 26
23obj-$(CONFIG_TWL4030_CORE) += omap_twl.o 27obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
28obj-$(CONFIG_SOC_HAS_OMAP2_SDRC) += sdrc.o
24 29
25# SMP support ONLY available for OMAP4 30# SMP support ONLY available for OMAP4
26 31
27obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o 32obj-$(CONFIG_SMP) += omap-smp.o omap-headsmp.o
28obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o 33obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o
29obj-$(CONFIG_ARCH_OMAP4) += omap4-common.o omap-wakeupgen.o 34omap-4-5-common = omap4-common.o omap-wakeupgen.o \
30obj-$(CONFIG_SOC_OMAP5) += omap4-common.o omap-wakeupgen.o 35 sleep44xx.o
36obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-common)
37obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-common)
31 38
32plus_sec := $(call as-instr,.arch_extension sec,+sec) 39plus_sec := $(call as-instr,.arch_extension sec,+sec)
33AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec) 40AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec)
@@ -43,6 +50,11 @@ AFLAGS_sram242x.o :=-Wa,-march=armv6
43AFLAGS_sram243x.o :=-Wa,-march=armv6 50AFLAGS_sram243x.o :=-Wa,-march=armv6
44AFLAGS_sram34xx.o :=-Wa,-march=armv7-a 51AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
45 52
53# Restart code (OMAP4/5 currently in omap4-common.c)
54obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o
55obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o
56obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o
57
46# Pin multiplexing 58# Pin multiplexing
47obj-$(CONFIG_SOC_OMAP2420) += mux2420.o 59obj-$(CONFIG_SOC_OMAP2420) += mux2420.o
48obj-$(CONFIG_SOC_OMAP2430) += mux2430.o 60obj-$(CONFIG_SOC_OMAP2430) += mux2430.o
@@ -52,7 +64,6 @@ obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o
52# SMS/SDRC 64# SMS/SDRC
53obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o 65obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
54# obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o 66# obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o
55obj-$(CONFIG_SOC_HAS_OMAP2_SDRC) += sdrc.o
56 67
57# OPP table initialization 68# OPP table initialization
58ifeq ($(CONFIG_PM_OPP),y) 69ifeq ($(CONFIG_PM_OPP),y)
@@ -63,15 +74,16 @@ endif
63 74
64# Power Management 75# Power Management
65ifeq ($(CONFIG_PM),y) 76ifeq ($(CONFIG_PM),y)
66obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o sleep24xx.o 77obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
78obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o
67obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o 79obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o
68obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o 80obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o
69obj-$(CONFIG_ARCH_OMAP4) += sleep44xx.o 81obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o
70obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o sleep44xx.o
71obj-$(CONFIG_PM_DEBUG) += pm-debug.o 82obj-$(CONFIG_PM_DEBUG) += pm-debug.o
83obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-noop.o
72 84
73obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o 85obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o
74obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o 86obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o
75 87
76AFLAGS_sleep24xx.o :=-Wa,-march=armv6 88AFLAGS_sleep24xx.o :=-Wa,-march=armv6
77AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec) 89AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec)
@@ -83,76 +95,82 @@ endif
83endif 95endif
84 96
85ifeq ($(CONFIG_CPU_IDLE),y) 97ifeq ($(CONFIG_CPU_IDLE),y)
86obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o 98obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o
87obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o 99obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o
88endif 100endif
89 101
90# PRCM 102# PRCM
91obj-y += prcm.o prm_common.o 103obj-y += prm_common.o cm_common.o
92obj-$(CONFIG_ARCH_OMAP2) += cm2xxx_3xxx.o prm2xxx_3xxx.o 104obj-$(CONFIG_ARCH_OMAP2) += prm2xxx_3xxx.o prm2xxx.o cm2xxx.o
93obj-$(CONFIG_ARCH_OMAP3) += cm2xxx_3xxx.o prm2xxx_3xxx.o 105obj-$(CONFIG_ARCH_OMAP3) += prm2xxx_3xxx.o prm3xxx.o cm3xxx.o
94obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o 106obj-$(CONFIG_ARCH_OMAP3) += vc3xxx_data.o vp3xxx_data.o
95obj-$(CONFIG_SOC_AM33XX) += prm33xx.o cm33xx.o 107obj-$(CONFIG_SOC_AM33XX) += prm33xx.o cm33xx.o
96omap-prcm-4-5-common = cminst44xx.o cm44xx.o prm44xx.o \ 108omap-prcm-4-5-common = cminst44xx.o cm44xx.o prm44xx.o \
97 prcm_mpu44xx.o prminst44xx.o \ 109 prcm_mpu44xx.o prminst44xx.o \
98 vc44xx_data.o vp44xx_data.o \ 110 vc44xx_data.o vp44xx_data.o
99 prm44xx.o
100obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common) 111obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common)
101obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common) 112obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common)
102 113
103# OMAP voltage domains 114# OMAP voltage domains
104obj-y += voltage.o vc.o vp.o 115voltagedomain-common := voltage.o vc.o vp.o
116obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common)
105obj-$(CONFIG_ARCH_OMAP2) += voltagedomains2xxx_data.o 117obj-$(CONFIG_ARCH_OMAP2) += voltagedomains2xxx_data.o
118obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common)
106obj-$(CONFIG_ARCH_OMAP3) += voltagedomains3xxx_data.o 119obj-$(CONFIG_ARCH_OMAP3) += voltagedomains3xxx_data.o
120obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common)
107obj-$(CONFIG_ARCH_OMAP4) += voltagedomains44xx_data.o 121obj-$(CONFIG_ARCH_OMAP4) += voltagedomains44xx_data.o
108obj-$(CONFIG_SOC_AM33XX) += voltagedomains33xx_data.o 122obj-$(CONFIG_SOC_AM33XX) += $(voltagedomain-common)
123obj-$(CONFIG_SOC_AM33XX) += voltagedomains33xx_data.o
124obj-$(CONFIG_SOC_OMAP5) += $(voltagedomain-common)
109 125
110# OMAP powerdomain framework 126# OMAP powerdomain framework
111obj-y += powerdomain.o powerdomain-common.o 127powerdomain-common += powerdomain.o powerdomain-common.o
128obj-$(CONFIG_ARCH_OMAP2) += $(powerdomain-common)
112obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_data.o 129obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_data.o
113obj-$(CONFIG_ARCH_OMAP2) += powerdomain2xxx_3xxx.o
114obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_3xxx_data.o 130obj-$(CONFIG_ARCH_OMAP2) += powerdomains2xxx_3xxx_data.o
115obj-$(CONFIG_ARCH_OMAP3) += powerdomain2xxx_3xxx.o 131obj-$(CONFIG_ARCH_OMAP3) += $(powerdomain-common)
116obj-$(CONFIG_ARCH_OMAP3) += powerdomains3xxx_data.o 132obj-$(CONFIG_ARCH_OMAP3) += powerdomains3xxx_data.o
117obj-$(CONFIG_ARCH_OMAP3) += powerdomains2xxx_3xxx_data.o 133obj-$(CONFIG_ARCH_OMAP3) += powerdomains2xxx_3xxx_data.o
118obj-$(CONFIG_ARCH_OMAP4) += powerdomain44xx.o 134obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common)
119obj-$(CONFIG_ARCH_OMAP4) += powerdomains44xx_data.o 135obj-$(CONFIG_ARCH_OMAP4) += powerdomains44xx_data.o
120obj-$(CONFIG_SOC_AM33XX) += powerdomain33xx.o 136obj-$(CONFIG_SOC_AM33XX) += $(powerdomain-common)
121obj-$(CONFIG_SOC_AM33XX) += powerdomains33xx_data.o 137obj-$(CONFIG_SOC_AM33XX) += powerdomains33xx_data.o
122obj-$(CONFIG_SOC_OMAP5) += powerdomain44xx.o 138obj-$(CONFIG_SOC_OMAP5) += $(powerdomain-common)
123 139
124# PRCM clockdomain control 140# PRCM clockdomain control
125obj-y += clockdomain.o 141clockdomain-common += clockdomain.o
126obj-$(CONFIG_ARCH_OMAP2) += clockdomain2xxx_3xxx.o 142obj-$(CONFIG_ARCH_OMAP2) += $(clockdomain-common)
127obj-$(CONFIG_ARCH_OMAP2) += clockdomains2xxx_3xxx_data.o 143obj-$(CONFIG_ARCH_OMAP2) += clockdomains2xxx_3xxx_data.o
128obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o 144obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o
129obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o 145obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o
130obj-$(CONFIG_ARCH_OMAP3) += clockdomain2xxx_3xxx.o 146obj-$(CONFIG_ARCH_OMAP3) += $(clockdomain-common)
131obj-$(CONFIG_ARCH_OMAP3) += clockdomains2xxx_3xxx_data.o 147obj-$(CONFIG_ARCH_OMAP3) += clockdomains2xxx_3xxx_data.o
132obj-$(CONFIG_ARCH_OMAP3) += clockdomains3xxx_data.o 148obj-$(CONFIG_ARCH_OMAP3) += clockdomains3xxx_data.o
133obj-$(CONFIG_ARCH_OMAP4) += clockdomain44xx.o 149obj-$(CONFIG_ARCH_OMAP4) += $(clockdomain-common)
134obj-$(CONFIG_ARCH_OMAP4) += clockdomains44xx_data.o 150obj-$(CONFIG_ARCH_OMAP4) += clockdomains44xx_data.o
135obj-$(CONFIG_SOC_AM33XX) += clockdomain33xx.o 151obj-$(CONFIG_SOC_AM33XX) += $(clockdomain-common)
136obj-$(CONFIG_SOC_AM33XX) += clockdomains33xx_data.o 152obj-$(CONFIG_SOC_AM33XX) += clockdomains33xx_data.o
137obj-$(CONFIG_SOC_OMAP5) += clockdomain44xx.o 153obj-$(CONFIG_SOC_OMAP5) += $(clockdomain-common)
138 154
139# Clock framework 155# Clock framework
140obj-y += clock.o clock_common_data.o \ 156obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o
141 clkt_dpll.o clkt_clksel.o 157obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_sys.o
142obj-$(CONFIG_ARCH_OMAP2) += clock2xxx.o 158obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o
143obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o clkt2xxx_sys.o
144obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o 159obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o
145obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_apll.o clkt2xxx_osc.o 160obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_apll.o clkt2xxx_osc.o
146obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o clkt_iclk.o 161obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o clkt_iclk.o
147obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o 162obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o
148obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o 163obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o
149obj-$(CONFIG_ARCH_OMAP3) += clock3xxx.o 164obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o
150obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o 165obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o
151obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o clkt_iclk.o 166obj-$(CONFIG_ARCH_OMAP3) += clock3517.o clock36xx.o
152obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o clock3xxx_data.o 167obj-$(CONFIG_ARCH_OMAP3) += dpll3xxx.o clock3xxx_data.o
153obj-$(CONFIG_ARCH_OMAP4) += clock44xx_data.o 168obj-$(CONFIG_ARCH_OMAP3) += clkt_iclk.o
169obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o
154obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o 170obj-$(CONFIG_ARCH_OMAP4) += dpll3xxx.o dpll44xx.o
155obj-$(CONFIG_SOC_AM33XX) += dpll3xxx.o clock33xx_data.o 171obj-$(CONFIG_SOC_AM33XX) += $(clock-common) dpll3xxx.o
172obj-$(CONFIG_SOC_AM33XX) += clock33xx_data.o
173obj-$(CONFIG_SOC_OMAP5) += $(clock-common)
156obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o 174obj-$(CONFIG_SOC_OMAP5) += dpll3xxx.o dpll44xx.o
157 175
158# OMAP2 clock rate set data (old "OPP" data) 176# OMAP2 clock rate set data (old "OPP" data)
@@ -160,7 +178,6 @@ obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o
160obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o 178obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o
161 179
162# hwmod data 180# hwmod data
163obj-y += omap_hwmod_common_data.o
164obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o 181obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o
165obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_ipblock_data.o 182obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_ipblock_data.o
166obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_interconnect_data.o 183obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_interconnect_data.o
@@ -206,10 +223,10 @@ obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
206obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o 223obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
207obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o 224obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
208obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o 225obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
209obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o 226obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o
210obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o 227obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o
211obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o 228obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o
212obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o 229obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o
213obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o 230obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o
214obj-$(CONFIG_MACH_OVERO) += board-overo.o 231obj-$(CONFIG_MACH_OVERO) += board-overo.o
215obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o 232obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o
diff --git a/arch/arm/mach-omap2/am33xx.h b/arch/arm/mach-omap2/am33xx.h
index 06c19bb7bca6..43296c1af9ee 100644
--- a/arch/arm/mach-omap2/am33xx.h
+++ b/arch/arm/mach-omap2/am33xx.h
@@ -21,5 +21,6 @@
21#define AM33XX_SCM_BASE 0x44E10000 21#define AM33XX_SCM_BASE 0x44E10000
22#define AM33XX_CTRL_BASE AM33XX_SCM_BASE 22#define AM33XX_CTRL_BASE AM33XX_SCM_BASE
23#define AM33XX_PRCM_BASE 0x44E00000 23#define AM33XX_PRCM_BASE 0x44E00000
24#define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + 0x3FC)
24 25
25#endif /* __ASM_ARCH_AM33XX_H */ 26#endif /* __ASM_ARCH_AM33XX_H */
diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c
index d0c54c573d34..af11dcdb7e2c 100644
--- a/arch/arm/mach-omap2/am35xx-emac.c
+++ b/arch/arm/mach-omap2/am35xx-emac.c
@@ -18,7 +18,7 @@
18#include <linux/err.h> 18#include <linux/err.h>
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 "omap_device.h"
22#include "am35xx.h" 22#include "am35xx.h"
23#include "control.h" 23#include "control.h"
24#include "am35xx-emac.h" 24#include "am35xx-emac.h"
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 95b384d54f8a..4815ea6f8f5d 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -28,14 +28,12 @@
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30 30
31#include <mach/hardware.h>
32#include <asm/mach-types.h> 31#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
35 34
36#include "common.h" 35#include "common.h"
37#include <plat/gpmc.h> 36#include "gpmc.h"
38#include <plat/usb.h>
39#include "gpmc-smc91x.h" 37#include "gpmc-smc91x.h"
40 38
41#include <video/omapdss.h> 39#include <video/omapdss.h>
@@ -287,5 +285,5 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
287 .init_machine = omap_2430sdp_init, 285 .init_machine = omap_2430sdp_init,
288 .init_late = omap2430_init_late, 286 .init_late = omap2430_init_late,
289 .timer = &omap2_timer, 287 .timer = &omap2_timer,
290 .restart = omap_prcm_restart, 288 .restart = omap2xxx_restart,
291MACHINE_END 289MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 96cd3693e1ae..6601754f9512 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -30,15 +30,15 @@
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32 32
33#include <plat/usb.h>
34#include "common.h" 33#include "common.h"
35#include <plat/dma.h> 34#include <plat-omap/dma-omap.h>
36#include <plat/gpmc.h>
37#include <video/omapdss.h> 35#include <video/omapdss.h>
38#include <video/omap-panel-tfp410.h> 36#include <video/omap-panel-tfp410.h>
39 37
38#include "gpmc.h"
40#include "gpmc-smc91x.h" 39#include "gpmc-smc91x.h"
41 40
41#include "soc.h"
42#include "board-flash.h" 42#include "board-flash.h"
43#include "mux.h" 43#include "mux.h"
44#include "sdram-qimonda-hyb18m512160af-6.h" 44#include "sdram-qimonda-hyb18m512160af-6.h"
@@ -597,5 +597,5 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
597 .init_machine = omap_3430sdp_init, 597 .init_machine = omap_3430sdp_init,
598 .init_late = omap3430_init_late, 598 .init_late = omap3430_init_late,
599 .timer = &omap3_timer, 599 .timer = &omap3_timer,
600 .restart = omap_prcm_restart, 600 .restart = omap3xxx_restart,
601MACHINE_END 601MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index fc224ad86747..050aaa771254 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -18,9 +18,8 @@
18 18
19#include "common.h" 19#include "common.h"
20#include "gpmc-smc91x.h" 20#include "gpmc-smc91x.h"
21#include <plat/usb.h>
22 21
23#include <mach/board-zoom.h> 22#include "board-zoom.h"
24 23
25#include "board-flash.h" 24#include "board-flash.h"
26#include "mux.h" 25#include "mux.h"
@@ -213,5 +212,5 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
213 .init_machine = omap_sdp_init, 212 .init_machine = omap_sdp_init,
214 .init_late = omap3630_init_late, 213 .init_late = omap3630_init_late,
215 .timer = &omap3_timer, 214 .timer = &omap3_timer,
216 .restart = omap_prcm_restart, 215 .restart = omap3xxx_restart,
217MACHINE_END 216MACHINE_END
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 3669c120c7e8..85dfa71e0dc6 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -27,6 +27,7 @@
27#include <linux/leds.h> 27#include <linux/leds.h>
28#include <linux/leds_pwm.h> 28#include <linux/leds_pwm.h>
29#include <linux/platform_data/omap4-keypad.h> 29#include <linux/platform_data/omap4-keypad.h>
30#include <linux/usb/musb.h>
30 31
31#include <asm/hardware/gic.h> 32#include <asm/hardware/gic.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -34,8 +35,6 @@
34#include <asm/mach/map.h> 35#include <asm/mach/map.h>
35 36
36#include "common.h" 37#include "common.h"
37#include <plat/usb.h>
38#include <plat/mmc.h>
39#include "omap4-keypad.h" 38#include "omap4-keypad.h"
40#include <video/omapdss.h> 39#include <video/omapdss.h>
41#include <video/omap-panel-nokia-dsi.h> 40#include <video/omap-panel-nokia-dsi.h>
@@ -45,6 +44,7 @@
45 44
46#include "soc.h" 45#include "soc.h"
47#include "mux.h" 46#include "mux.h"
47#include "mmc.h"
48#include "hsmmc.h" 48#include "hsmmc.h"
49#include "control.h" 49#include "control.h"
50#include "common-board-devices.h" 50#include "common-board-devices.h"
@@ -881,5 +881,5 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
881 .init_machine = omap_4430sdp_init, 881 .init_machine = omap_4430sdp_init,
882 .init_late = omap4430_init_late, 882 .init_late = omap4430_init_late,
883 .timer = &omap4_timer, 883 .timer = &omap4_timer,
884 .restart = omap_prcm_restart, 884 .restart = omap44xx_restart,
885MACHINE_END 885MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 318feadb1d6e..51b96a1206d1 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -26,7 +26,6 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include "common.h" 28#include "common.h"
29#include <plat/usb.h>
30 29
31#include "am35xx-emac.h" 30#include "am35xx-emac.h"
32#include "mux.h" 31#include "mux.h"
@@ -94,5 +93,5 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
94 .init_machine = am3517_crane_init, 93 .init_machine = am3517_crane_init,
95 .init_late = am35xx_init_late, 94 .init_late = am35xx_init_late,
96 .timer = &omap3_timer, 95 .timer = &omap3_timer,
97 .restart = omap_prcm_restart, 96 .restart = omap3xxx_restart,
98MACHINE_END 97MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index e16289755f2e..4be58fd071f6 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -25,6 +25,7 @@
25#include <linux/can/platform/ti_hecc.h> 25#include <linux/can/platform/ti_hecc.h>
26#include <linux/davinci_emac.h> 26#include <linux/davinci_emac.h>
27#include <linux/mmc/host.h> 27#include <linux/mmc/host.h>
28#include <linux/usb/musb.h>
28#include <linux/platform_data/gpio-omap.h> 29#include <linux/platform_data/gpio-omap.h>
29 30
30#include "am35xx.h" 31#include "am35xx.h"
@@ -33,7 +34,6 @@
33#include <asm/mach/map.h> 34#include <asm/mach/map.h>
34 35
35#include "common.h" 36#include "common.h"
36#include <plat/usb.h>
37#include <video/omapdss.h> 37#include <video/omapdss.h>
38#include <video/omap-panel-generic-dpi.h> 38#include <video/omap-panel-generic-dpi.h>
39#include <video/omap-panel-tfp410.h> 39#include <video/omap-panel-tfp410.h>
@@ -393,5 +393,5 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
393 .init_machine = am3517_evm_init, 393 .init_machine = am3517_evm_init,
394 .init_late = am35xx_init_late, 394 .init_late = am35xx_init_late,
395 .timer = &omap3_timer, 395 .timer = &omap3_timer,
396 .restart = omap_prcm_restart, 396 .restart = omap3xxx_restart,
397MACHINE_END 397MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index cea3abace815..5d0a61f54165 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -28,14 +28,14 @@
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/smc91x.h> 29#include <linux/smc91x.h>
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31#include <linux/platform_data/leds-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/flash.h> 35#include <asm/mach/flash.h>
35 36
36#include <plat/led.h>
37#include "common.h" 37#include "common.h"
38#include <plat/gpmc.h> 38#include "gpmc.h"
39 39
40#include <video/omapdss.h> 40#include <video/omapdss.h>
41#include <video/omap-panel-generic-dpi.h> 41#include <video/omap-panel-generic-dpi.h>
@@ -338,5 +338,5 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
338 .init_machine = omap_apollon_init, 338 .init_machine = omap_apollon_init,
339 .init_late = omap2420_init_late, 339 .init_late = omap2420_init_late,
340 .timer = &omap2_timer, 340 .timer = &omap2_timer,
341 .restart = omap_prcm_restart, 341 .restart = omap2xxx_restart,
342MACHINE_END 342MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 376d26eb601c..c8e37dc00892 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -38,21 +38,19 @@
38#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
39#include <asm/mach/map.h> 39#include <asm/mach/map.h>
40 40
41#include "common.h"
42#include <linux/platform_data/mtd-nand-omap2.h> 41#include <linux/platform_data/mtd-nand-omap2.h>
43#include <plat/gpmc.h>
44#include <plat/usb.h>
45#include <video/omapdss.h> 42#include <video/omapdss.h>
46#include <video/omap-panel-generic-dpi.h> 43#include <video/omap-panel-generic-dpi.h>
47#include <video/omap-panel-tfp410.h> 44#include <video/omap-panel-tfp410.h>
48#include <linux/platform_data/spi-omap2-mcspi.h> 45#include <linux/platform_data/spi-omap2-mcspi.h>
49 46
50#include <mach/hardware.h> 47#include "common.h"
51
52#include "mux.h" 48#include "mux.h"
53#include "sdram-micron-mt46h32m32lf-6.h" 49#include "sdram-micron-mt46h32m32lf-6.h"
54#include "hsmmc.h" 50#include "hsmmc.h"
55#include "common-board-devices.h" 51#include "common-board-devices.h"
52#include "gpmc.h"
53#include "gpmc-nand.h"
56 54
57#define CM_T35_GPIO_PENDOWN 57 55#define CM_T35_GPIO_PENDOWN 57
58#define SB_T35_USB_HUB_RESET_GPIO 167 56#define SB_T35_USB_HUB_RESET_GPIO 167
@@ -181,7 +179,7 @@ static struct omap_nand_platform_data cm_t35_nand_data = {
181 179
182static void __init cm_t35_init_nand(void) 180static void __init cm_t35_init_nand(void)
183{ 181{
184 if (gpmc_nand_init(&cm_t35_nand_data) < 0) 182 if (gpmc_nand_init(&cm_t35_nand_data, NULL) < 0)
185 pr_err("CM-T35: Unable to register NAND device\n"); 183 pr_err("CM-T35: Unable to register NAND device\n");
186} 184}
187#else 185#else
@@ -753,18 +751,18 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
753 .init_machine = cm_t35_init, 751 .init_machine = cm_t35_init,
754 .init_late = omap35xx_init_late, 752 .init_late = omap35xx_init_late,
755 .timer = &omap3_timer, 753 .timer = &omap3_timer,
756 .restart = omap_prcm_restart, 754 .restart = omap3xxx_restart,
757MACHINE_END 755MACHINE_END
758 756
759MACHINE_START(CM_T3730, "Compulab CM-T3730") 757MACHINE_START(CM_T3730, "Compulab CM-T3730")
760 .atag_offset = 0x100, 758 .atag_offset = 0x100,
761 .reserve = omap_reserve, 759 .reserve = omap_reserve,
762 .map_io = omap3_map_io, 760 .map_io = omap3_map_io,
763 .init_early = omap3630_init_early, 761 .init_early = omap3630_init_early,
764 .init_irq = omap3_init_irq, 762 .init_irq = omap3_init_irq,
765 .handle_irq = omap3_intc_handle_irq, 763 .handle_irq = omap3_intc_handle_irq,
766 .init_machine = cm_t3730_init, 764 .init_machine = cm_t3730_init,
767 .init_late = omap3630_init_late, 765 .init_late = omap3630_init_late,
768 .timer = &omap3_timer, 766 .timer = &omap3_timer,
769 .restart = omap_prcm_restart, 767 .restart = omap3xxx_restart,
770MACHINE_END 768MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 59c0a45f75b0..699caec8f9e2 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -39,9 +39,8 @@
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/usb.h>
43#include <linux/platform_data/mtd-nand-omap2.h> 42#include <linux/platform_data/mtd-nand-omap2.h>
44#include <plat/gpmc.h> 43#include "gpmc.h"
45 44
46#include "am35xx.h" 45#include "am35xx.h"
47 46
@@ -49,6 +48,7 @@
49#include "control.h" 48#include "control.h"
50#include "common-board-devices.h" 49#include "common-board-devices.h"
51#include "am35xx-emac.h" 50#include "am35xx-emac.h"
51#include "gpmc-nand.h"
52 52
53#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) 53#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
54static struct gpio_led cm_t3517_leds[] = { 54static struct gpio_led cm_t3517_leds[] = {
@@ -240,7 +240,7 @@ static struct omap_nand_platform_data cm_t3517_nand_data = {
240 240
241static void __init cm_t3517_init_nand(void) 241static void __init cm_t3517_init_nand(void)
242{ 242{
243 if (gpmc_nand_init(&cm_t3517_nand_data) < 0) 243 if (gpmc_nand_init(&cm_t3517_nand_data, NULL) < 0)
244 pr_err("CM-T3517: NAND initialization failed\n"); 244 pr_err("CM-T3517: NAND initialization failed\n");
245} 245}
246#else 246#else
@@ -298,5 +298,5 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
298 .init_machine = cm_t3517_init, 298 .init_machine = cm_t3517_init,
299 .init_late = am35xx_init_late, 299 .init_late = am35xx_init_late,
300 .timer = &omap3_timer, 300 .timer = &omap3_timer,
301 .restart = omap_prcm_restart, 301 .restart = omap3xxx_restart,
302MACHINE_END 302MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 1fd161e934c7..7667eb749522 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -39,9 +39,8 @@
39#include <asm/mach/flash.h> 39#include <asm/mach/flash.h>
40 40
41#include "common.h" 41#include "common.h"
42#include <plat/gpmc.h> 42#include "gpmc.h"
43#include <linux/platform_data/mtd-nand-omap2.h> 43#include <linux/platform_data/mtd-nand-omap2.h>
44#include <plat/usb.h>
45#include <video/omapdss.h> 44#include <video/omapdss.h>
46#include <video/omap-panel-generic-dpi.h> 45#include <video/omap-panel-generic-dpi.h>
47#include <video/omap-panel-tfp410.h> 46#include <video/omap-panel-tfp410.h>
@@ -55,8 +54,11 @@
55#include "sdram-micron-mt46h32m32lf-6.h" 54#include "sdram-micron-mt46h32m32lf-6.h"
56#include "mux.h" 55#include "mux.h"
57#include "hsmmc.h" 56#include "hsmmc.h"
57#include "board-flash.h"
58#include "common-board-devices.h" 58#include "common-board-devices.h"
59 59
60#define NAND_CS 0
61
60#define OMAP_DM9000_GPIO_IRQ 25 62#define OMAP_DM9000_GPIO_IRQ 25
61#define OMAP3_DEVKIT_TS_GPIO 27 63#define OMAP3_DEVKIT_TS_GPIO 27
62 64
@@ -621,8 +623,9 @@ static void __init devkit8000_init(void)
621 623
622 usb_musb_init(NULL); 624 usb_musb_init(NULL);
623 usbhs_init(&usbhs_bdata); 625 usbhs_init(&usbhs_bdata);
624 omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions, 626 board_nand_init(devkit8000_nand_partitions,
625 ARRAY_SIZE(devkit8000_nand_partitions)); 627 ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS,
628 NAND_BUSWIDTH_16, NULL);
626 omap_twl4030_audio_init("omap3beagle"); 629 omap_twl4030_audio_init("omap3beagle");
627 630
628 /* Ensure SDRC pins are mux'd for self-refresh */ 631 /* Ensure SDRC pins are mux'd for self-refresh */
@@ -640,5 +643,5 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
640 .init_machine = devkit8000_init, 643 .init_machine = devkit8000_init,
641 .init_late = omap35xx_init_late, 644 .init_late = omap35xx_init_late,
642 .timer = &omap3_secure_timer, 645 .timer = &omap3_secure_timer,
643 .restart = omap_prcm_restart, 646 .restart = omap3xxx_restart,
644MACHINE_END 647MACHINE_END
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index e642acf9cad0..c33adea0247c 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -17,14 +17,14 @@
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <plat/cpu.h>
21#include <plat/gpmc.h>
22#include <linux/platform_data/mtd-nand-omap2.h> 20#include <linux/platform_data/mtd-nand-omap2.h>
23#include <linux/platform_data/mtd-onenand-omap2.h> 21#include <linux/platform_data/mtd-onenand-omap2.h>
24#include <plat/tc.h>
25 22
23#include "soc.h"
26#include "common.h" 24#include "common.h"
27#include "board-flash.h" 25#include "board-flash.h"
26#include "gpmc-onenand.h"
27#include "gpmc-nand.h"
28 28
29#define REG_FPGA_REV 0x10 29#define REG_FPGA_REV 0x10
30#define REG_FPGA_DIP_SWITCH_INPUT2 0x60 30#define REG_FPGA_DIP_SWITCH_INPUT2 0x60
@@ -104,36 +104,35 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
104 defined(CONFIG_MTD_NAND_OMAP2_MODULE) 104 defined(CONFIG_MTD_NAND_OMAP2_MODULE)
105 105
106/* Note that all values in this struct are in nanoseconds */ 106/* Note that all values in this struct are in nanoseconds */
107static struct gpmc_timings nand_timings = { 107struct gpmc_timings nand_default_timings[1] = {
108 {
109 .sync_clk = 0,
108 110
109 .sync_clk = 0, 111 .cs_on = 0,
112 .cs_rd_off = 36,
113 .cs_wr_off = 36,
110 114
111 .cs_on = 0, 115 .adv_on = 6,
112 .cs_rd_off = 36, 116 .adv_rd_off = 24,
113 .cs_wr_off = 36, 117 .adv_wr_off = 36,
114 118
115 .adv_on = 6, 119 .we_off = 30,
116 .adv_rd_off = 24, 120 .oe_off = 48,
117 .adv_wr_off = 36,
118 121
119 .we_off = 30, 122 .access = 54,
120 .oe_off = 48, 123 .rd_cycle = 72,
124 .wr_cycle = 72,
121 125
122 .access = 54, 126 .wr_access = 30,
123 .rd_cycle = 72, 127 .wr_data_mux_bus = 0,
124 .wr_cycle = 72, 128 },
125
126 .wr_access = 30,
127 .wr_data_mux_bus = 0,
128}; 129};
129 130
130static struct omap_nand_platform_data board_nand_data = { 131static struct omap_nand_platform_data board_nand_data;
131 .gpmc_t = &nand_timings,
132};
133 132
134void 133void
135__init board_nand_init(struct mtd_partition *nand_parts, 134__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs,
136 u8 nr_parts, u8 cs, int nand_type) 135 int nand_type, struct gpmc_timings *gpmc_t)
137{ 136{
138 board_nand_data.cs = cs; 137 board_nand_data.cs = cs;
139 board_nand_data.parts = nand_parts; 138 board_nand_data.parts = nand_parts;
@@ -141,7 +140,7 @@ __init board_nand_init(struct mtd_partition *nand_parts,
141 board_nand_data.devsize = nand_type; 140 board_nand_data.devsize = nand_type;
142 141
143 board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT; 142 board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
144 gpmc_nand_init(&board_nand_data); 143 gpmc_nand_init(&board_nand_data, gpmc_t);
145} 144}
146#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ 145#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
147 146
@@ -238,5 +237,6 @@ void __init board_flash_init(struct flash_partitions partition_info[],
238 pr_err("NAND: Unable to find configuration in GPMC\n"); 237 pr_err("NAND: Unable to find configuration in GPMC\n");
239 else 238 else
240 board_nand_init(partition_info[2].parts, 239 board_nand_init(partition_info[2].parts,
241 partition_info[2].nr_parts, nandcs, nand_type); 240 partition_info[2].nr_parts, nandcs,
241 nand_type, nand_default_timings);
242} 242}
diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
index c44b70d52021..2fb5d41a9fae 100644
--- a/arch/arm/mach-omap2/board-flash.h
+++ b/arch/arm/mach-omap2/board-flash.h
@@ -12,7 +12,7 @@
12 */ 12 */
13#include <linux/mtd/mtd.h> 13#include <linux/mtd/mtd.h>
14#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
15#include <plat/gpmc.h> 15#include "gpmc.h"
16 16
17#define PDC_NOR 1 17#define PDC_NOR 1
18#define PDC_NAND 2 18#define PDC_NAND 2
@@ -40,12 +40,14 @@ static inline void board_flash_init(struct flash_partitions part[],
40#if defined(CONFIG_MTD_NAND_OMAP2) || \ 40#if defined(CONFIG_MTD_NAND_OMAP2) || \
41 defined(CONFIG_MTD_NAND_OMAP2_MODULE) 41 defined(CONFIG_MTD_NAND_OMAP2_MODULE)
42extern void board_nand_init(struct mtd_partition *nand_parts, 42extern void board_nand_init(struct mtd_partition *nand_parts,
43 u8 nr_parts, u8 cs, int nand_type); 43 u8 nr_parts, u8 cs, int nand_type, struct gpmc_timings *gpmc_t);
44extern struct gpmc_timings nand_default_timings[];
44#else 45#else
45static inline void board_nand_init(struct mtd_partition *nand_parts, 46static inline void board_nand_init(struct mtd_partition *nand_parts,
46 u8 nr_parts, u8 cs, int nand_type) 47 u8 nr_parts, u8 cs, int nand_type, struct gpmc_timings *gpmc_t)
47{ 48{
48} 49}
50#define nand_default_timings NULL
49#endif 51#endif
50 52
51#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 53#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 601ecdfb1cf9..f0715a369c44 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -57,7 +57,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
57 .init_machine = omap_generic_init, 57 .init_machine = omap_generic_init,
58 .timer = &omap2_timer, 58 .timer = &omap2_timer,
59 .dt_compat = omap242x_boards_compat, 59 .dt_compat = omap242x_boards_compat,
60 .restart = omap_prcm_restart, 60 .restart = omap2xxx_restart,
61MACHINE_END 61MACHINE_END
62#endif 62#endif
63 63
@@ -76,7 +76,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
76 .init_machine = omap_generic_init, 76 .init_machine = omap_generic_init,
77 .timer = &omap2_timer, 77 .timer = &omap2_timer,
78 .dt_compat = omap243x_boards_compat, 78 .dt_compat = omap243x_boards_compat,
79 .restart = omap_prcm_restart, 79 .restart = omap2xxx_restart,
80MACHINE_END 80MACHINE_END
81#endif 81#endif
82 82
@@ -95,7 +95,24 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
95 .init_machine = omap_generic_init, 95 .init_machine = omap_generic_init,
96 .timer = &omap3_timer, 96 .timer = &omap3_timer,
97 .dt_compat = omap3_boards_compat, 97 .dt_compat = omap3_boards_compat,
98 .restart = omap_prcm_restart, 98 .restart = omap3xxx_restart,
99MACHINE_END
100
101static const char *omap3_gp_boards_compat[] __initdata = {
102 "ti,omap3-beagle",
103 NULL,
104};
105
106DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
107 .reserve = omap_reserve,
108 .map_io = omap3_map_io,
109 .init_early = omap3430_init_early,
110 .init_irq = omap_intc_of_init,
111 .handle_irq = omap3_intc_handle_irq,
112 .init_machine = omap_generic_init,
113 .timer = &omap3_secure_timer,
114 .dt_compat = omap3_gp_boards_compat,
115 .restart = omap3xxx_restart,
99MACHINE_END 116MACHINE_END
100#endif 117#endif
101 118
@@ -134,7 +151,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
134 .init_late = omap4430_init_late, 151 .init_late = omap4430_init_late,
135 .timer = &omap4_timer, 152 .timer = &omap4_timer,
136 .dt_compat = omap4_boards_compat, 153 .dt_compat = omap4_boards_compat,
137 .restart = omap_prcm_restart, 154 .restart = omap44xx_restart,
138MACHINE_END 155MACHINE_END
139#endif 156#endif
140 157
@@ -154,6 +171,6 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
154 .init_machine = omap_generic_init, 171 .init_machine = omap_generic_init,
155 .timer = &omap5_timer, 172 .timer = &omap5_timer,
156 .dt_compat = omap5_boards_compat, 173 .dt_compat = omap5_boards_compat,
157 .restart = omap_prcm_restart, 174 .restart = omap44xx_restart,
158MACHINE_END 175MACHINE_END
159#endif 176#endif
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 8d04bf851af4..b626dbe6f7bc 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -26,15 +26,14 @@
26#include <linux/clk.h> 26#include <linux/clk.h>
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/input/matrix_keypad.h> 28#include <linux/input/matrix_keypad.h>
29#include <linux/mfd/menelaus.h>
29 30
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 33#include <asm/mach/map.h>
33 34
34#include <plat/menelaus.h> 35#include <plat-omap/dma-omap.h>
35#include <plat/dma.h> 36#include <plat/debug-devices.h>
36#include <plat/gpmc.h>
37#include "debug-devices.h"
38 37
39#include <video/omapdss.h> 38#include <video/omapdss.h>
40#include <video/omap-panel-generic-dpi.h> 39#include <video/omap-panel-generic-dpi.h>
@@ -42,6 +41,7 @@
42#include "common.h" 41#include "common.h"
43#include "mux.h" 42#include "mux.h"
44#include "control.h" 43#include "control.h"
44#include "gpmc.h"
45 45
46#define H4_FLASH_CS 0 46#define H4_FLASH_CS 0
47#define H4_SMC91X_CS 1 47#define H4_SMC91X_CS 1
@@ -386,5 +386,5 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
386 .init_machine = omap_h4_init, 386 .init_machine = omap_h4_init,
387 .init_late = omap2420_init_late, 387 .init_late = omap2420_init_late,
388 .timer = &omap2_timer, 388 .timer = &omap2_timer,
389 .restart = omap_prcm_restart, 389 .restart = omap2xxx_restart,
390MACHINE_END 390MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 48d5e41dfbfa..cea5d5292628 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -29,20 +29,19 @@
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31 31
32#include "common.h"
33#include <plat/gpmc.h>
34#include <plat/usb.h>
35
36#include <video/omapdss.h> 32#include <video/omapdss.h>
37#include <video/omap-panel-tfp410.h> 33#include <video/omap-panel-tfp410.h>
38#include <linux/platform_data/mtd-onenand-omap2.h> 34#include <linux/platform_data/mtd-onenand-omap2.h>
39 35
36#include "common.h"
37#include "gpmc.h"
40#include "mux.h" 38#include "mux.h"
41#include "hsmmc.h" 39#include "hsmmc.h"
42#include "sdram-numonyx-m65kxxxxam.h" 40#include "sdram-numonyx-m65kxxxxam.h"
43#include "common-board-devices.h" 41#include "common-board-devices.h"
44#include "board-flash.h" 42#include "board-flash.h"
45#include "control.h" 43#include "control.h"
44#include "gpmc-onenand.h"
46 45
47#define IGEP2_SMSC911X_CS 5 46#define IGEP2_SMSC911X_CS 5
48#define IGEP2_SMSC911X_GPIO 176 47#define IGEP2_SMSC911X_GPIO 176
@@ -175,7 +174,7 @@ static void __init igep_flash_init(void)
175 pr_info("IGEP: initializing NAND memory device\n"); 174 pr_info("IGEP: initializing NAND memory device\n");
176 board_nand_init(igep_flash_partitions, 175 board_nand_init(igep_flash_partitions,
177 ARRAY_SIZE(igep_flash_partitions), 176 ARRAY_SIZE(igep_flash_partitions),
178 0, NAND_BUSWIDTH_16); 177 0, NAND_BUSWIDTH_16, nand_default_timings);
179 } else if (mux == IGEP_SYSBOOT_ONENAND) { 178 } else if (mux == IGEP_SYSBOOT_ONENAND) {
180 pr_info("IGEP: initializing OneNAND memory device\n"); 179 pr_info("IGEP: initializing OneNAND memory device\n");
181 board_onenand_init(igep_flash_partitions, 180 board_onenand_init(igep_flash_partitions,
@@ -652,7 +651,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
652 .init_machine = igep_init, 651 .init_machine = igep_init,
653 .init_late = omap35xx_init_late, 652 .init_late = omap35xx_init_late,
654 .timer = &omap3_timer, 653 .timer = &omap3_timer,
655 .restart = omap_prcm_restart, 654 .restart = omap3xxx_restart,
656MACHINE_END 655MACHINE_END
657 656
658MACHINE_START(IGEP0030, "IGEP OMAP3 module") 657MACHINE_START(IGEP0030, "IGEP OMAP3 module")
@@ -665,5 +664,5 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
665 .init_machine = igep_init, 664 .init_machine = igep_init,
666 .init_late = omap35xx_init_late, 665 .init_late = omap35xx_init_late,
667 .timer = &omap3_timer, 666 .timer = &omap3_timer,
668 .restart = omap_prcm_restart, 667 .restart = omap3xxx_restart,
669MACHINE_END 668MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index ee8c3cfb95b3..0869f4f3d3e1 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -35,9 +35,8 @@
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36 36
37#include "common.h" 37#include "common.h"
38#include <plat/gpmc.h> 38#include "board-zoom.h"
39#include <mach/board-zoom.h> 39#include "gpmc.h"
40#include <plat/usb.h>
41#include "gpmc-smsc911x.h" 40#include "gpmc-smsc911x.h"
42 41
43#include <video/omapdss.h> 42#include <video/omapdss.h>
@@ -420,8 +419,8 @@ static void __init omap_ldp_init(void)
420 omap_serial_init(); 419 omap_serial_init();
421 omap_sdrc_init(NULL, NULL); 420 omap_sdrc_init(NULL, NULL);
422 usb_musb_init(NULL); 421 usb_musb_init(NULL);
423 board_nand_init(ldp_nand_partitions, 422 board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions),
424 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); 423 ZOOM_NAND_CS, 0, nand_default_timings);
425 424
426 omap_hsmmc_init(mmc); 425 omap_hsmmc_init(mmc);
427 ldp_display_init(); 426 ldp_display_init();
@@ -437,5 +436,5 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
437 .init_machine = omap_ldp_init, 436 .init_machine = omap_ldp_init,
438 .init_late = omap3430_init_late, 437 .init_late = omap3430_init_late,
439 .timer = &omap3_timer, 438 .timer = &omap3_timer,
440 .restart = omap_prcm_restart, 439 .restart = omap3xxx_restart,
441MACHINE_END 440MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index d95f727ca39a..a4e167c55c1d 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -22,16 +22,17 @@
22#include <linux/usb/musb.h> 22#include <linux/usb/musb.h>
23#include <linux/platform_data/spi-omap2-mcspi.h> 23#include <linux/platform_data/spi-omap2-mcspi.h>
24#include <linux/platform_data/mtd-onenand-omap2.h> 24#include <linux/platform_data/mtd-onenand-omap2.h>
25#include <linux/mfd/menelaus.h>
25#include <sound/tlv320aic3x.h> 26#include <sound/tlv320aic3x.h>
26 27
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
29 30
30#include "common.h" 31#include "common.h"
31#include <plat/menelaus.h> 32#include "mmc.h"
32#include <plat/mmc.h>
33 33
34#include "mux.h" 34#include "mux.h"
35#include "gpmc-onenand.h"
35 36
36#define TUSB6010_ASYNC_CS 1 37#define TUSB6010_ASYNC_CS 1
37#define TUSB6010_SYNC_CS 4 38#define TUSB6010_SYNC_CS 4
@@ -689,7 +690,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
689 .init_machine = n8x0_init_machine, 690 .init_machine = n8x0_init_machine,
690 .init_late = omap2420_init_late, 691 .init_late = omap2420_init_late,
691 .timer = &omap2_timer, 692 .timer = &omap2_timer,
692 .restart = omap_prcm_restart, 693 .restart = omap2xxx_restart,
693MACHINE_END 694MACHINE_END
694 695
695MACHINE_START(NOKIA_N810, "Nokia N810") 696MACHINE_START(NOKIA_N810, "Nokia N810")
@@ -702,7 +703,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
702 .init_machine = n8x0_init_machine, 703 .init_machine = n8x0_init_machine,
703 .init_late = omap2420_init_late, 704 .init_late = omap2420_init_late,
704 .timer = &omap2_timer, 705 .timer = &omap2_timer,
705 .restart = omap_prcm_restart, 706 .restart = omap2xxx_restart,
706MACHINE_END 707MACHINE_END
707 708
708MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") 709MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
@@ -715,5 +716,5 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
715 .init_machine = n8x0_init_machine, 716 .init_machine = n8x0_init_machine,
716 .init_late = omap2420_init_late, 717 .init_late = omap2420_init_late,
717 .timer = &omap2_timer, 718 .timer = &omap2_timer,
718 .restart = omap_prcm_restart, 719 .restart = omap2xxx_restart,
719MACHINE_END 720MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index d41ab98890ff..22c483d5dfa8 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -39,19 +39,22 @@
39#include <asm/mach/map.h> 39#include <asm/mach/map.h>
40#include <asm/mach/flash.h> 40#include <asm/mach/flash.h>
41 41
42#include "common.h"
43#include <video/omapdss.h> 42#include <video/omapdss.h>
44#include <video/omap-panel-tfp410.h> 43#include <video/omap-panel-tfp410.h>
45#include <plat/gpmc.h>
46#include <linux/platform_data/mtd-nand-omap2.h> 44#include <linux/platform_data/mtd-nand-omap2.h>
47#include <plat/usb.h>
48#include <plat/omap_device.h>
49 45
46#include "common.h"
47#include "omap_device.h"
48#include "gpmc.h"
49#include "soc.h"
50#include "mux.h" 50#include "mux.h"
51#include "hsmmc.h" 51#include "hsmmc.h"
52#include "pm.h" 52#include "pm.h"
53#include "board-flash.h"
53#include "common-board-devices.h" 54#include "common-board-devices.h"
54 55
56#define NAND_CS 0
57
55/* 58/*
56 * OMAP3 Beagle revision 59 * OMAP3 Beagle revision
57 * Run time detection of Beagle revision is done by reading GPIO. 60 * Run time detection of Beagle revision is done by reading GPIO.
@@ -518,8 +521,9 @@ static void __init omap3_beagle_init(void)
518 521
519 usb_musb_init(NULL); 522 usb_musb_init(NULL);
520 usbhs_init(&usbhs_bdata); 523 usbhs_init(&usbhs_bdata);
521 omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, 524 board_nand_init(omap3beagle_nand_partitions,
522 ARRAY_SIZE(omap3beagle_nand_partitions)); 525 ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
526 NAND_BUSWIDTH_16, NULL);
523 omap_twl4030_audio_init("omap3beagle"); 527 omap_twl4030_audio_init("omap3beagle");
524 528
525 /* Ensure msecure is mux'd to be able to set the RTC. */ 529 /* Ensure msecure is mux'd to be able to set the RTC. */
@@ -541,5 +545,5 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
541 .init_machine = omap3_beagle_init, 545 .init_machine = omap3_beagle_init,
542 .init_late = omap3_init_late, 546 .init_late = omap3_init_late,
543 .timer = &omap3_secure_timer, 547 .timer = &omap3_secure_timer,
544 .restart = omap_prcm_restart, 548 .restart = omap3xxx_restart,
545MACHINE_END 549MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index b9b776b6c954..54647d6286b4 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -32,6 +32,7 @@
32#include <linux/spi/ads7846.h> 32#include <linux/spi/ads7846.h>
33#include <linux/i2c/twl.h> 33#include <linux/i2c/twl.h>
34#include <linux/usb/otg.h> 34#include <linux/usb/otg.h>
35#include <linux/usb/musb.h>
35#include <linux/usb/nop-usb-xceiv.h> 36#include <linux/usb/nop-usb-xceiv.h>
36#include <linux/smsc911x.h> 37#include <linux/smsc911x.h>
37 38
@@ -45,17 +46,20 @@
45#include <asm/mach/arch.h> 46#include <asm/mach/arch.h>
46#include <asm/mach/map.h> 47#include <asm/mach/map.h>
47 48
48#include <plat/usb.h>
49#include <linux/platform_data/mtd-nand-omap2.h> 49#include <linux/platform_data/mtd-nand-omap2.h>
50#include "common.h" 50#include "common.h"
51#include <linux/platform_data/spi-omap2-mcspi.h> 51#include <linux/platform_data/spi-omap2-mcspi.h>
52#include <video/omapdss.h> 52#include <video/omapdss.h>
53#include <video/omap-panel-tfp410.h> 53#include <video/omap-panel-tfp410.h>
54 54
55#include "soc.h"
55#include "mux.h" 56#include "mux.h"
56#include "sdram-micron-mt46h32m32lf-6.h" 57#include "sdram-micron-mt46h32m32lf-6.h"
57#include "hsmmc.h" 58#include "hsmmc.h"
58#include "common-board-devices.h" 59#include "common-board-devices.h"
60#include "board-flash.h"
61
62#define NAND_CS 0
59 63
60#define OMAP3_EVM_TS_GPIO 175 64#define OMAP3_EVM_TS_GPIO 175
61#define OMAP3_EVM_EHCI_VBUS 22 65#define OMAP3_EVM_EHCI_VBUS 22
@@ -731,8 +735,9 @@ static void __init omap3_evm_init(void)
731 } 735 }
732 usb_musb_init(&musb_board_data); 736 usb_musb_init(&musb_board_data);
733 usbhs_init(&usbhs_bdata); 737 usbhs_init(&usbhs_bdata);
734 omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions, 738 board_nand_init(omap3evm_nand_partitions,
735 ARRAY_SIZE(omap3evm_nand_partitions)); 739 ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS,
740 NAND_BUSWIDTH_16, NULL);
736 741
737 omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL); 742 omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
738 omap3evm_init_smsc911x(); 743 omap3evm_init_smsc911x();
@@ -752,5 +757,5 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
752 .init_machine = omap3_evm_init, 757 .init_machine = omap3_evm_init,
753 .init_late = omap35xx_init_late, 758 .init_late = omap35xx_init_late,
754 .timer = &omap3_timer, 759 .timer = &omap3_timer,
755 .restart = omap_prcm_restart, 760 .restart = omap3xxx_restart,
756MACHINE_END 761MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 7bd8253b5d1d..2a065ba6eb58 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -34,16 +34,13 @@
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 "gpmc-smsc911x.h"
38#include <plat/gpmc.h>
39#include <plat/sdrc.h>
40#include <plat/usb.h>
41
42#include "common.h" 37#include "common.h"
43#include "mux.h" 38#include "mux.h"
44#include "hsmmc.h" 39#include "hsmmc.h"
45#include "control.h" 40#include "control.h"
46#include "common-board-devices.h" 41#include "common-board-devices.h"
42#include "gpmc.h"
43#include "gpmc-smsc911x.h"
47 44
48#define OMAP3LOGIC_SMSC911X_CS 1 45#define OMAP3LOGIC_SMSC911X_CS 1
49 46
@@ -235,7 +232,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
235 .init_machine = omap3logic_init, 232 .init_machine = omap3logic_init,
236 .init_late = omap35xx_init_late, 233 .init_late = omap35xx_init_late,
237 .timer = &omap3_timer, 234 .timer = &omap3_timer,
238 .restart = omap_prcm_restart, 235 .restart = omap3xxx_restart,
239MACHINE_END 236MACHINE_END
240 237
241MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") 238MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
@@ -248,5 +245,5 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
248 .init_machine = omap3logic_init, 245 .init_machine = omap3logic_init,
249 .init_late = omap35xx_init_late, 246 .init_late = omap35xx_init_late,
250 .timer = &omap3_timer, 247 .timer = &omap3_timer,
251 .restart = omap_prcm_restart, 248 .restart = omap3xxx_restart,
252MACHINE_END 249MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 00a1f4ae6e44..a53a6683c1b8 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -42,7 +42,6 @@
42#include <asm/mach/map.h> 42#include <asm/mach/map.h>
43 43
44#include "common.h" 44#include "common.h"
45#include <plat/usb.h>
46#include <video/omapdss.h> 45#include <video/omapdss.h>
47#include <linux/platform_data/mtd-nand-omap2.h> 46#include <linux/platform_data/mtd-nand-omap2.h>
48 47
@@ -50,6 +49,7 @@
50#include "sdram-micron-mt46h32m32lf-6.h" 49#include "sdram-micron-mt46h32m32lf-6.h"
51#include "hsmmc.h" 50#include "hsmmc.h"
52#include "common-board-devices.h" 51#include "common-board-devices.h"
52#include "gpmc-nand.h"
53 53
54#define PANDORA_WIFI_IRQ_GPIO 21 54#define PANDORA_WIFI_IRQ_GPIO 21
55#define PANDORA_WIFI_NRESET_GPIO 23 55#define PANDORA_WIFI_NRESET_GPIO 23
@@ -602,7 +602,7 @@ static void __init omap3pandora_init(void)
602 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); 602 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
603 usbhs_init(&usbhs_bdata); 603 usbhs_init(&usbhs_bdata);
604 usb_musb_init(NULL); 604 usb_musb_init(NULL);
605 gpmc_nand_init(&pandora_nand_data); 605 gpmc_nand_init(&pandora_nand_data, NULL);
606 606
607 /* Ensure SDRC pins are mux'd for self-refresh */ 607 /* Ensure SDRC pins are mux'd for self-refresh */
608 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 608 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
@@ -619,5 +619,5 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
619 .init_machine = omap3pandora_init, 619 .init_machine = omap3pandora_init,
620 .init_late = omap35xx_init_late, 620 .init_late = omap35xx_init_late,
621 .timer = &omap3_timer, 621 .timer = &omap3_timer,
622 .restart = omap_prcm_restart, 622 .restart = omap3xxx_restart,
623MACHINE_END 623MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 731235eb319e..d8638b3b4f94 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -40,9 +40,8 @@
40#include <asm/mach/flash.h> 40#include <asm/mach/flash.h>
41 41
42#include "common.h" 42#include "common.h"
43#include <plat/gpmc.h> 43#include "gpmc.h"
44#include <linux/platform_data/mtd-nand-omap2.h> 44#include <linux/platform_data/mtd-nand-omap2.h>
45#include <plat/usb.h>
46#include <video/omapdss.h> 45#include <video/omapdss.h>
47#include <video/omap-panel-generic-dpi.h> 46#include <video/omap-panel-generic-dpi.h>
48#include <video/omap-panel-tfp410.h> 47#include <video/omap-panel-tfp410.h>
@@ -428,5 +427,5 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
428 .init_machine = omap3_stalker_init, 427 .init_machine = omap3_stalker_init,
429 .init_late = omap35xx_init_late, 428 .init_late = omap35xx_init_late,
430 .timer = &omap3_secure_timer, 429 .timer = &omap3_secure_timer,
431 .restart = omap_prcm_restart, 430 .restart = omap3xxx_restart,
432MACHINE_END 431MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 944ffc436577..263cb9cfbf37 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -44,12 +44,12 @@
44#include <asm/system_info.h> 44#include <asm/system_info.h>
45 45
46#include "common.h" 46#include "common.h"
47#include <plat/gpmc.h> 47#include "gpmc.h"
48#include <linux/platform_data/mtd-nand-omap2.h> 48#include <linux/platform_data/mtd-nand-omap2.h>
49#include <plat/usb.h>
50 49
51#include "mux.h" 50#include "mux.h"
52#include "hsmmc.h" 51#include "hsmmc.h"
52#include "board-flash.h"
53#include "common-board-devices.h" 53#include "common-board-devices.h"
54 54
55#include <asm/setup.h> 55#include <asm/setup.h>
@@ -59,6 +59,8 @@
59#define TB_BL_PWM_TIMER 9 59#define TB_BL_PWM_TIMER 9
60#define TB_KILL_POWER_GPIO 168 60#define TB_KILL_POWER_GPIO 168
61 61
62#define NAND_CS 0
63
62static unsigned long touchbook_revision; 64static unsigned long touchbook_revision;
63 65
64static struct mtd_partition omap3touchbook_nand_partitions[] = { 66static struct mtd_partition omap3touchbook_nand_partitions[] = {
@@ -365,8 +367,9 @@ static void __init omap3_touchbook_init(void)
365 omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata); 367 omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
366 usb_musb_init(NULL); 368 usb_musb_init(NULL);
367 usbhs_init(&usbhs_bdata); 369 usbhs_init(&usbhs_bdata);
368 omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions, 370 board_nand_init(omap3touchbook_nand_partitions,
369 ARRAY_SIZE(omap3touchbook_nand_partitions)); 371 ARRAY_SIZE(omap3touchbook_nand_partitions), NAND_CS,
372 NAND_BUSWIDTH_16, NULL);
370 373
371 /* Ensure SDRC pins are mux'd for self-refresh */ 374 /* Ensure SDRC pins are mux'd for self-refresh */
372 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 375 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
@@ -384,5 +387,5 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
384 .init_machine = omap3_touchbook_init, 387 .init_machine = omap3_touchbook_init,
385 .init_late = omap3430_init_late, 388 .init_late = omap3430_init_late,
386 .timer = &omap3_secure_timer, 389 .timer = &omap3_secure_timer,
387 .restart = omap_prcm_restart, 390 .restart = omap3xxx_restart,
388MACHINE_END 391MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index bfcd397e233c..12a3a24d5bb5 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -29,6 +29,7 @@
29#include <linux/regulator/machine.h> 29#include <linux/regulator/machine.h>
30#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
31#include <linux/ti_wilink_st.h> 31#include <linux/ti_wilink_st.h>
32#include <linux/usb/musb.h>
32#include <linux/wl12xx.h> 33#include <linux/wl12xx.h>
33#include <linux/platform_data/omap-abe-twl6040.h> 34#include <linux/platform_data/omap-abe-twl6040.h>
34 35
@@ -38,12 +39,11 @@
38#include <asm/mach/map.h> 39#include <asm/mach/map.h>
39#include <video/omapdss.h> 40#include <video/omapdss.h>
40 41
41#include "common.h"
42#include <plat/usb.h>
43#include <plat/mmc.h>
44#include <video/omap-panel-tfp410.h> 42#include <video/omap-panel-tfp410.h>
45 43
44#include "common.h"
46#include "soc.h" 45#include "soc.h"
46#include "mmc.h"
47#include "hsmmc.h" 47#include "hsmmc.h"
48#include "control.h" 48#include "control.h"
49#include "mux.h" 49#include "mux.h"
@@ -524,5 +524,5 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
524 .init_machine = omap4_panda_init, 524 .init_machine = omap4_panda_init,
525 .init_late = omap4430_init_late, 525 .init_late = omap4430_init_late,
526 .timer = &omap4_timer, 526 .timer = &omap4_timer,
527 .restart = omap_prcm_restart, 527 .restart = omap44xx_restart,
528MACHINE_END 528MACHINE_END
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index b700685762b5..140b73094aff 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -49,14 +49,17 @@
49#include <video/omapdss.h> 49#include <video/omapdss.h>
50#include <video/omap-panel-generic-dpi.h> 50#include <video/omap-panel-generic-dpi.h>
51#include <video/omap-panel-tfp410.h> 51#include <video/omap-panel-tfp410.h>
52#include <plat/gpmc.h>
53#include <plat/usb.h>
54 52
53#include "common.h"
55#include "mux.h" 54#include "mux.h"
56#include "sdram-micron-mt46h32m32lf-6.h" 55#include "sdram-micron-mt46h32m32lf-6.h"
56#include "gpmc.h"
57#include "hsmmc.h" 57#include "hsmmc.h"
58#include "board-flash.h"
58#include "common-board-devices.h" 59#include "common-board-devices.h"
59 60
61#define NAND_CS 0
62
60#define OVERO_GPIO_BT_XGATE 15 63#define OVERO_GPIO_BT_XGATE 15
61#define OVERO_GPIO_W2W_NRESET 16 64#define OVERO_GPIO_W2W_NRESET 16
62#define OVERO_GPIO_PENDOWN 114 65#define OVERO_GPIO_PENDOWN 114
@@ -495,8 +498,8 @@ static void __init overo_init(void)
495 omap_serial_init(); 498 omap_serial_init();
496 omap_sdrc_init(mt46h32m32lf6_sdrc_params, 499 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
497 mt46h32m32lf6_sdrc_params); 500 mt46h32m32lf6_sdrc_params);
498 omap_nand_flash_init(0, overo_nand_partitions, 501 board_nand_init(overo_nand_partitions,
499 ARRAY_SIZE(overo_nand_partitions)); 502 ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
500 usb_musb_init(NULL); 503 usb_musb_init(NULL);
501 usbhs_init(&usbhs_bdata); 504 usbhs_init(&usbhs_bdata);
502 overo_spi_init(); 505 overo_spi_init();
@@ -550,5 +553,5 @@ MACHINE_START(OVERO, "Gumstix Overo")
550 .init_machine = overo_init, 553 .init_machine = overo_init,
551 .init_late = omap35xx_init_late, 554 .init_late = omap35xx_init_late,
552 .timer = &omap3_timer, 555 .timer = &omap3_timer,
553 .restart = omap_prcm_restart, 556 .restart = omap3xxx_restart,
554MACHINE_END 557MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 45997bfbcbd2..cbcb1b2dc31f 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -22,17 +22,14 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <plat/i2c.h>
26#include <plat/mmc.h>
27#include <plat/usb.h>
28#include <plat/gpmc.h>
29#include "common.h" 25#include "common.h"
30#include <plat/serial.h>
31
32#include "mux.h" 26#include "mux.h"
27#include "gpmc.h"
28#include "mmc.h"
33#include "hsmmc.h" 29#include "hsmmc.h"
34#include "sdram-nokia.h" 30#include "sdram-nokia.h"
35#include "common-board-devices.h" 31#include "common-board-devices.h"
32#include "gpmc-onenand.h"
36 33
37static struct regulator_consumer_supply rm680_vemmc_consumers[] = { 34static struct regulator_consumer_supply rm680_vemmc_consumers[] = {
38 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), 35 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
@@ -151,7 +148,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
151 .init_machine = rm680_init, 148 .init_machine = rm680_init,
152 .init_late = omap3630_init_late, 149 .init_late = omap3630_init_late,
153 .timer = &omap3_timer, 150 .timer = &omap3_timer,
154 .restart = omap_prcm_restart, 151 .restart = omap3xxx_restart,
155MACHINE_END 152MACHINE_END
156 153
157MACHINE_START(NOKIA_RM696, "Nokia RM-696 board") 154MACHINE_START(NOKIA_RM696, "Nokia RM-696 board")
@@ -164,5 +161,5 @@ MACHINE_START(NOKIA_RM696, "Nokia RM-696 board")
164 .init_machine = rm680_init, 161 .init_machine = rm680_init,
165 .init_late = omap3630_init_late, 162 .init_late = omap3630_init_late,
166 .timer = &omap3_timer, 163 .timer = &omap3_timer,
167 .restart = omap_prcm_restart, 164 .restart = omap3xxx_restart,
168MACHINE_END 165MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 020e03c95bfe..07005fe40a2a 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -31,9 +31,7 @@
31#include <asm/system_info.h> 31#include <asm/system_info.h>
32 32
33#include "common.h" 33#include "common.h"
34#include <plat/dma.h> 34#include <plat-omap/dma-omap.h>
35#include <plat/gpmc.h>
36#include <plat/omap-pm.h>
37#include "gpmc-smc91x.h" 35#include "gpmc-smc91x.h"
38 36
39#include "board-rx51.h" 37#include "board-rx51.h"
@@ -52,8 +50,11 @@
52#endif 50#endif
53 51
54#include "mux.h" 52#include "mux.h"
53#include "omap-pm.h"
55#include "hsmmc.h" 54#include "hsmmc.h"
56#include "common-board-devices.h" 55#include "common-board-devices.h"
56#include "gpmc.h"
57#include "gpmc-onenand.h"
57 58
58#define SYSTEM_REV_B_USES_VAUX3 0x1699 59#define SYSTEM_REV_B_USES_VAUX3 0x1699
59#define SYSTEM_REV_S_USES_VAUX3 0x8 60#define SYSTEM_REV_S_USES_VAUX3 0x8
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 7bbb05d9689b..bf8f74b0ce3e 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -17,18 +17,18 @@
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/usb/musb.h>
20#include <linux/platform_data/spi-omap2-mcspi.h> 21#include <linux/platform_data/spi-omap2-mcspi.h>
21 22
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <asm/mach/map.h> 25#include <asm/mach/map.h>
25 26
26#include "common.h" 27#include <plat-omap/dma-omap.h>
27#include <plat/dma.h>
28#include <plat/gpmc.h>
29#include <plat/usb.h>
30 28
29#include "common.h"
31#include "mux.h" 30#include "mux.h"
31#include "gpmc.h"
32#include "pm.h" 32#include "pm.h"
33#include "sdram-nokia.h" 33#include "sdram-nokia.h"
34 34
@@ -127,5 +127,5 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
127 .init_machine = rx51_init, 127 .init_machine = rx51_init,
128 .init_late = omap3430_init_late, 128 .init_late = omap3430_init_late,
129 .timer = &omap3_timer, 129 .timer = &omap3_timer,
130 .restart = omap_prcm_restart, 130 .restart = omap3xxx_restart,
131MACHINE_END 131MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index c4f8833b4c3c..1a3e056d63a7 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -14,13 +14,14 @@
14 */ 14 */
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <linux/usb/musb.h>
17 19
18#include <asm/mach-types.h> 20#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
20#include <asm/mach/map.h> 22#include <asm/mach/map.h>
21 23
22#include "common.h" 24#include "common.h"
23#include <plat/usb.h>
24 25
25static struct omap_musb_board_data musb_board_data = { 26static struct omap_musb_board_data musb_board_data = {
26 .set_phy_power = ti81xx_musb_phy_power, 27 .set_phy_power = ti81xx_musb_phy_power,
@@ -45,7 +46,7 @@ MACHINE_START(TI8168EVM, "ti8168evm")
45 .timer = &omap3_timer, 46 .timer = &omap3_timer,
46 .init_machine = ti81xx_evm_init, 47 .init_machine = ti81xx_evm_init,
47 .init_late = ti81xx_init_late, 48 .init_late = ti81xx_init_late,
48 .restart = omap_prcm_restart, 49 .restart = omap44xx_restart,
49MACHINE_END 50MACHINE_END
50 51
51MACHINE_START(TI8148EVM, "ti8148evm") 52MACHINE_START(TI8148EVM, "ti8148evm")
@@ -57,5 +58,5 @@ MACHINE_START(TI8148EVM, "ti8148evm")
57 .timer = &omap3_timer, 58 .timer = &omap3_timer,
58 .init_machine = ti81xx_evm_init, 59 .init_machine = ti81xx_evm_init,
59 .init_late = ti81xx_init_late, 60 .init_late = ti81xx_init_late,
60 .restart = omap_prcm_restart, 61 .restart = omap44xx_restart,
61MACHINE_END 62MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
index afb2278a29f6..42e5f231a799 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/arch/arm/mach-omap2/board-zoom-debugboard.c
@@ -17,10 +17,10 @@
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 19
20#include <plat/gpmc.h> 20#include "gpmc.h"
21#include "gpmc-smsc911x.h" 21#include "gpmc-smsc911x.h"
22 22
23#include <mach/board-zoom.h> 23#include "board-zoom.h"
24 24
25#include "soc.h" 25#include "soc.h"
26#include "common.h" 26#include "common.h"
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index b940ab2259fb..1c7c834a5b5f 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -16,8 +16,9 @@
16#include <linux/spi/spi.h> 16#include <linux/spi/spi.h>
17#include <linux/platform_data/spi-omap2-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 "board-zoom.h"
20 20
21#include "soc.h"
21#include "common.h" 22#include "common.h"
22 23
23#define LCD_PANEL_RESET_GPIO_PROD 96 24#define LCD_PANEL_RESET_GPIO_PROD 96
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index c166fe1fdff9..26e07addc9d7 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -26,9 +26,8 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include "common.h" 28#include "common.h"
29#include <plat/usb.h>
30 29
31#include <mach/board-zoom.h> 30#include "board-zoom.h"
32 31
33#include "mux.h" 32#include "mux.h"
34#include "hsmmc.h" 33#include "hsmmc.h"
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 4994438e1f46..d7fa31e67238 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -22,9 +22,8 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23 23
24#include "common.h" 24#include "common.h"
25#include <plat/usb.h>
26 25
27#include <mach/board-zoom.h> 26#include "board-zoom.h"
28 27
29#include "board-flash.h" 28#include "board-flash.h"
30#include "mux.h" 29#include "mux.h"
@@ -113,8 +112,9 @@ static void __init omap_zoom_init(void)
113 usbhs_init(&usbhs_bdata); 112 usbhs_init(&usbhs_bdata);
114 } 113 }
115 114
116 board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions), 115 board_nand_init(zoom_nand_partitions,
117 ZOOM_NAND_CS, NAND_BUSWIDTH_16); 116 ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS,
117 NAND_BUSWIDTH_16, nand_default_timings);
118 zoom_debugboard_init(); 118 zoom_debugboard_init();
119 zoom_peripherals_init(); 119 zoom_peripherals_init();
120 120
@@ -138,7 +138,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
138 .init_machine = omap_zoom_init, 138 .init_machine = omap_zoom_init,
139 .init_late = omap3430_init_late, 139 .init_late = omap3430_init_late,
140 .timer = &omap3_timer, 140 .timer = &omap3_timer,
141 .restart = omap_prcm_restart, 141 .restart = omap3xxx_restart,
142MACHINE_END 142MACHINE_END
143 143
144MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") 144MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
@@ -151,5 +151,5 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
151 .init_machine = omap_zoom_init, 151 .init_machine = omap_zoom_init,
152 .init_late = omap3630_init_late, 152 .init_late = omap3630_init_late,
153 .timer = &omap3_timer, 153 .timer = &omap3_timer,
154 .restart = omap_prcm_restart, 154 .restart = omap3xxx_restart,
155MACHINE_END 155MACHINE_END
diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h b/arch/arm/mach-omap2/board-zoom.h
index 2e9486940ead..2e9486940ead 100644
--- a/arch/arm/mach-omap2/include/mach/board-zoom.h
+++ b/arch/arm/mach-omap2/board-zoom.h
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c
index c2d15212d64d..8c5b13e7ee61 100644
--- a/arch/arm/mach-omap2/clkt2xxx_apll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_apll.c
@@ -21,12 +21,10 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/clock.h>
25#include <plat/prcm.h>
26 24
27#include "clock.h" 25#include "clock.h"
28#include "clock2xxx.h" 26#include "clock2xxx.h"
29#include "cm2xxx_3xxx.h" 27#include "cm2xxx.h"
30#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
31 29
32/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ 30/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
@@ -38,44 +36,16 @@
38#define APLLS_CLKIN_13MHZ 2 36#define APLLS_CLKIN_13MHZ 2
39#define APLLS_CLKIN_12MHZ 3 37#define APLLS_CLKIN_12MHZ 3
40 38
41void __iomem *cm_idlest_pll;
42
43/* Private functions */ 39/* Private functions */
44 40
45/* Enable an APLL if off */ 41static int _apll96_enable(struct clk *clk)
46static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask)
47{
48 u32 cval, apll_mask;
49
50 apll_mask = EN_APLL_LOCKED << clk->enable_bit;
51
52 cval = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
53
54 if ((cval & apll_mask) == apll_mask)
55 return 0; /* apll already enabled */
56
57 cval &= ~apll_mask;
58 cval |= apll_mask;
59 omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
60
61 omap2_cm_wait_idlest(cm_idlest_pll, status_mask,
62 OMAP24XX_CM_IDLEST_VAL, __clk_get_name(clk));
63
64 /*
65 * REVISIT: Should we return an error code if omap2_wait_clock_ready()
66 * fails?
67 */
68 return 0;
69}
70
71static int omap2_clk_apll96_enable(struct clk *clk)
72{ 42{
73 return omap2_clk_apll_enable(clk, OMAP24XX_ST_96M_APLL_MASK); 43 return omap2xxx_cm_apll96_enable();
74} 44}
75 45
76static int omap2_clk_apll54_enable(struct clk *clk) 46static int _apll54_enable(struct clk *clk)
77{ 47{
78 return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK); 48 return omap2xxx_cm_apll54_enable();
79} 49}
80 50
81static void _apll96_allow_idle(struct clk *clk) 51static void _apll96_allow_idle(struct clk *clk)
@@ -98,28 +68,28 @@ static void _apll54_deny_idle(struct clk *clk)
98 omap2xxx_cm_set_apll54_disable_autoidle(); 68 omap2xxx_cm_set_apll54_disable_autoidle();
99} 69}
100 70
101/* Stop APLL */ 71static void _apll96_disable(struct clk *clk)
102static void omap2_clk_apll_disable(struct clk *clk)
103{ 72{
104 u32 cval; 73 omap2xxx_cm_apll96_disable();
74}
105 75
106 cval = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN); 76static void _apll54_disable(struct clk *clk)
107 cval &= ~(EN_APLL_LOCKED << clk->enable_bit); 77{
108 omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 78 omap2xxx_cm_apll54_disable();
109} 79}
110 80
111/* Public data */ 81/* Public data */
112 82
113const struct clkops clkops_apll96 = { 83const struct clkops clkops_apll96 = {
114 .enable = omap2_clk_apll96_enable, 84 .enable = _apll96_enable,
115 .disable = omap2_clk_apll_disable, 85 .disable = _apll96_disable,
116 .allow_idle = _apll96_allow_idle, 86 .allow_idle = _apll96_allow_idle,
117 .deny_idle = _apll96_deny_idle, 87 .deny_idle = _apll96_deny_idle,
118}; 88};
119 89
120const struct clkops clkops_apll54 = { 90const struct clkops clkops_apll54 = {
121 .enable = omap2_clk_apll54_enable, 91 .enable = _apll54_enable,
122 .disable = omap2_clk_apll_disable, 92 .disable = _apll54_disable,
123 .allow_idle = _apll54_allow_idle, 93 .allow_idle = _apll54_allow_idle,
124 .deny_idle = _apll54_deny_idle, 94 .deny_idle = _apll54_deny_idle,
125}; 95};
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpll.c b/arch/arm/mach-omap2/clkt2xxx_dpll.c
index 1502a7bc20bb..399534c7843b 100644
--- a/arch/arm/mach-omap2/clkt2xxx_dpll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_dpll.c
@@ -14,10 +14,8 @@
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/io.h> 15#include <linux/io.h>
16 16
17#include <plat/clock.h>
18
19#include "clock.h" 17#include "clock.h"
20#include "cm2xxx_3xxx.h" 18#include "cm2xxx.h"
21#include "cm-regbits-24xx.h" 19#include "cm-regbits-24xx.h"
22 20
23/* Private functions */ 21/* Private functions */
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
index 4ae439222085..825e44cdf1cf 100644
--- a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
+++ b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
@@ -25,21 +25,25 @@
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include <plat/clock.h>
29#include <plat/sram.h>
30#include <plat/sdrc.h>
31
32#include "clock.h" 28#include "clock.h"
33#include "clock2xxx.h" 29#include "clock2xxx.h"
34#include "opp2xxx.h" 30#include "opp2xxx.h"
35#include "cm2xxx_3xxx.h" 31#include "cm2xxx.h"
36#include "cm-regbits-24xx.h" 32#include "cm-regbits-24xx.h"
33#include "sdrc.h"
34#include "sram.h"
37 35
38/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ 36/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
39 37
38/*
39 * dpll_core_ck: pointer to the combined dpll_ck + core_ck on OMAP2xxx
40 * (currently defined as "dpll_ck" in the OMAP2xxx clock tree). Set
41 * during dpll_ck init and used later by omap2xxx_clk_get_core_rate().
42 */
43static struct clk *dpll_core_ck;
44
40/** 45/**
41 * omap2xxx_clk_get_core_rate - return the CORE_CLK rate 46 * omap2xxx_clk_get_core_rate - return the CORE_CLK rate
42 * @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck")
43 * 47 *
44 * Returns the CORE_CLK rate. CORE_CLK can have one of three rate 48 * Returns the CORE_CLK rate. CORE_CLK can have one of three rate
45 * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz 49 * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz
@@ -47,12 +51,14 @@
47 * struct clk *dpll_ck, which is a composite clock of dpll_ck and 51 * struct clk *dpll_ck, which is a composite clock of dpll_ck and
48 * core_ck. 52 * core_ck.
49 */ 53 */
50unsigned long omap2xxx_clk_get_core_rate(struct clk *clk) 54unsigned long omap2xxx_clk_get_core_rate(void)
51{ 55{
52 long long core_clk; 56 long long core_clk;
53 u32 v; 57 u32 v;
54 58
55 core_clk = omap2_get_dpll_rate(clk); 59 WARN_ON(!dpll_core_ck);
60
61 core_clk = omap2_get_dpll_rate(dpll_core_ck);
56 62
57 v = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 63 v = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
58 v &= OMAP24XX_CORE_CLK_SRC_MASK; 64 v &= OMAP24XX_CORE_CLK_SRC_MASK;
@@ -100,7 +106,7 @@ static long omap2_dpllcore_round_rate(unsigned long target_rate)
100 106
101unsigned long omap2_dpllcore_recalc(struct clk *clk) 107unsigned long omap2_dpllcore_recalc(struct clk *clk)
102{ 108{
103 return omap2xxx_clk_get_core_rate(clk); 109 return omap2xxx_clk_get_core_rate();
104} 110}
105 111
106int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) 112int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
@@ -110,7 +116,7 @@ int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
110 struct prcm_config tmpset; 116 struct prcm_config tmpset;
111 const struct dpll_data *dd; 117 const struct dpll_data *dd;
112 118
113 cur_rate = omap2xxx_clk_get_core_rate(dclk); 119 cur_rate = omap2xxx_clk_get_core_rate();
114 mult = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 120 mult = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
115 mult &= OMAP24XX_CORE_CLK_SRC_MASK; 121 mult &= OMAP24XX_CORE_CLK_SRC_MASK;
116 122
@@ -171,3 +177,19 @@ int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
171 return 0; 177 return 0;
172} 178}
173 179
180/**
181 * omap2xxx_clkt_dpllcore_init - clk init function for dpll_ck
182 * @clk: struct clk *dpll_ck
183 *
184 * Store a local copy of @clk in dpll_core_ck so other code can query
185 * the core rate without having to clk_get(), which can sleep. Must
186 * only be called once. No return value. XXX If the clock
187 * registration process is ever changed such that dpll_ck is no longer
188 * statically defined, this code may need to change to increment some
189 * kind of use count on dpll_ck.
190 */
191void omap2xxx_clkt_dpllcore_init(struct clk *clk)
192{
193 WARN(dpll_core_ck, "dpll_core_ck already set - should never happen");
194 dpll_core_ck = clk;
195}
diff --git a/arch/arm/mach-omap2/clkt2xxx_osc.c b/arch/arm/mach-omap2/clkt2xxx_osc.c
index c3460928b5e0..e1777371bb5e 100644
--- a/arch/arm/mach-omap2/clkt2xxx_osc.c
+++ b/arch/arm/mach-omap2/clkt2xxx_osc.c
@@ -23,8 +23,6 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <plat/clock.h>
27
28#include "clock.h" 26#include "clock.h"
29#include "clock2xxx.h" 27#include "clock2xxx.h"
30#include "prm2xxx_3xxx.h" 28#include "prm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/clkt2xxx_sys.c b/arch/arm/mach-omap2/clkt2xxx_sys.c
index 8693cfdac49a..46683b3c2461 100644
--- a/arch/arm/mach-omap2/clkt2xxx_sys.c
+++ b/arch/arm/mach-omap2/clkt2xxx_sys.c
@@ -22,8 +22,6 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <plat/clock.h>
26
27#include "clock.h" 25#include "clock.h"
28#include "clock2xxx.h" 26#include "clock2xxx.h"
29#include "prm2xxx_3xxx.h" 27#include "prm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index 3524f0e7b6d5..1c2041fbd718 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2xxx DVFS virtual clock functions 2 * OMAP2xxx DVFS virtual clock functions
3 * 3 *
4 * Copyright (C) 2005-2008 Texas Instruments, Inc. 4 * Copyright (C) 2005-2008, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2004-2010 Nokia Corporation 5 * Copyright (C) 2004-2010 Nokia Corporation
6 * 6 *
7 * Contacts: 7 * Contacts:
@@ -33,20 +33,25 @@
33#include <linux/cpufreq.h> 33#include <linux/cpufreq.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35 35
36#include <plat/clock.h>
37#include <plat/sram.h>
38#include <plat/sdrc.h>
39
40#include "soc.h" 36#include "soc.h"
41#include "clock.h" 37#include "clock.h"
42#include "clock2xxx.h" 38#include "clock2xxx.h"
43#include "opp2xxx.h" 39#include "opp2xxx.h"
44#include "cm2xxx_3xxx.h" 40#include "cm2xxx.h"
45#include "cm-regbits-24xx.h" 41#include "cm-regbits-24xx.h"
42#include "sdrc.h"
43#include "sram.h"
46 44
47const struct prcm_config *curr_prcm_set; 45const struct prcm_config *curr_prcm_set;
48const struct prcm_config *rate_table; 46const struct prcm_config *rate_table;
49 47
48/*
49 * sys_ck_rate: the rate of the external high-frequency clock
50 * oscillator on the board. Set by the SoC-specific clock init code.
51 * Once set during a boot, will not change.
52 */
53static unsigned long sys_ck_rate;
54
50/** 55/**
51 * omap2_table_mpu_recalc - just return the MPU speed 56 * omap2_table_mpu_recalc - just return the MPU speed
52 * @clk: virt_prcm_set struct clk 57 * @clk: virt_prcm_set struct clk
@@ -68,15 +73,14 @@ unsigned long omap2_table_mpu_recalc(struct clk *clk)
68long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) 73long omap2_round_to_table_rate(struct clk *clk, unsigned long rate)
69{ 74{
70 const struct prcm_config *ptr; 75 const struct prcm_config *ptr;
71 long highest_rate, sys_clk_rate; 76 long highest_rate;
72 77
73 highest_rate = -EINVAL; 78 highest_rate = -EINVAL;
74 sys_clk_rate = __clk_get_rate(sclk);
75 79
76 for (ptr = rate_table; ptr->mpu_speed; ptr++) { 80 for (ptr = rate_table; ptr->mpu_speed; ptr++) {
77 if (!(ptr->flags & cpu_mask)) 81 if (!(ptr->flags & cpu_mask))
78 continue; 82 continue;
79 if (ptr->xtal_speed != sys_clk_rate) 83 if (ptr->xtal_speed != sys_ck_rate)
80 continue; 84 continue;
81 85
82 highest_rate = ptr->mpu_speed; 86 highest_rate = ptr->mpu_speed;
@@ -95,15 +99,12 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
95 const struct prcm_config *prcm; 99 const struct prcm_config *prcm;
96 unsigned long found_speed = 0; 100 unsigned long found_speed = 0;
97 unsigned long flags; 101 unsigned long flags;
98 long sys_clk_rate;
99
100 sys_clk_rate = __clk_get_rate(sclk);
101 102
102 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 103 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
103 if (!(prcm->flags & cpu_mask)) 104 if (!(prcm->flags & cpu_mask))
104 continue; 105 continue;
105 106
106 if (prcm->xtal_speed != sys_clk_rate) 107 if (prcm->xtal_speed != sys_ck_rate)
107 continue; 108 continue;
108 109
109 if (prcm->mpu_speed <= rate) { 110 if (prcm->mpu_speed <= rate) {
@@ -119,7 +120,7 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
119 } 120 }
120 121
121 curr_prcm_set = prcm; 122 curr_prcm_set = prcm;
122 cur_rate = omap2xxx_clk_get_core_rate(dclk); 123 cur_rate = omap2xxx_clk_get_core_rate();
123 124
124 if (prcm->dpll_speed == cur_rate / 2) { 125 if (prcm->dpll_speed == cur_rate / 2) {
125 omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1); 126 omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1);
@@ -169,3 +170,50 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
169 170
170 return 0; 171 return 0;
171} 172}
173
174/**
175 * omap2xxx_clkt_vps_check_bootloader_rate - determine which of the rate
176 * table sets matches the current CORE DPLL hardware rate
177 *
178 * Check the MPU rate set by bootloader. Sets the 'curr_prcm_set'
179 * global to point to the active rate set when found; otherwise, sets
180 * it to NULL. No return value;
181 */
182void omap2xxx_clkt_vps_check_bootloader_rates(void)
183{
184 const struct prcm_config *prcm = NULL;
185 unsigned long rate;
186
187 rate = omap2xxx_clk_get_core_rate();
188 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
189 if (!(prcm->flags & cpu_mask))
190 continue;
191 if (prcm->xtal_speed != sys_ck_rate)
192 continue;
193 if (prcm->dpll_speed <= rate)
194 break;
195 }
196 curr_prcm_set = prcm;
197}
198
199/**
200 * omap2xxx_clkt_vps_late_init - store a copy of the sys_ck rate
201 *
202 * Store a copy of the sys_ck rate for later use by the OMAP2xxx DVFS
203 * code. (The sys_ck rate does not -- or rather, must not -- change
204 * during kernel runtime.) Must be called after we have a valid
205 * sys_ck rate, but before the virt_prcm_set clock rate is
206 * recalculated. No return value.
207 */
208void omap2xxx_clkt_vps_late_init(void)
209{
210 struct clk *c;
211
212 c = clk_get(NULL, "sys_ck");
213 if (IS_ERR(c)) {
214 WARN(1, "could not locate sys_ck\n");
215 } else {
216 sys_ck_rate = clk_get_rate(c);
217 clk_put(c);
218 }
219}
diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
index 7c6da2f731dc..6cf298e262f6 100644
--- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
+++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
@@ -21,14 +21,11 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/clock.h>
25#include <plat/sram.h>
26#include <plat/sdrc.h>
27
28#include "clock.h" 24#include "clock.h"
29#include "clock3xxx.h" 25#include "clock3xxx.h"
30#include "clock34xx.h" 26#include "clock34xx.h"
31#include "sdrc.h" 27#include "sdrc.h"
28#include "sram.h"
32 29
33#define CYCLES_PER_MHZ 1000000 30#define CYCLES_PER_MHZ 1000000
34 31
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c
index 3ff22114d702..53646facda45 100644
--- a/arch/arm/mach-omap2/clkt_clksel.c
+++ b/arch/arm/mach-omap2/clkt_clksel.c
@@ -45,8 +45,6 @@
45#include <linux/io.h> 45#include <linux/io.h>
46#include <linux/bug.h> 46#include <linux/bug.h>
47 47
48#include <plat/clock.h>
49
50#include "clock.h" 48#include "clock.h"
51 49
52/* Private functions */ 50/* Private functions */
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index 80411142f482..8463cc356245 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -21,8 +21,6 @@
21 21
22#include <asm/div64.h> 22#include <asm/div64.h>
23 23
24#include <plat/clock.h>
25
26#include "soc.h" 24#include "soc.h"
27#include "clock.h" 25#include "clock.h"
28#include "cm-regbits-24xx.h" 26#include "cm-regbits-24xx.h"
diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/arch/arm/mach-omap2/clkt_iclk.c
index 3d43fba2542f..fe774a09dd0c 100644
--- a/arch/arm/mach-omap2/clkt_iclk.c
+++ b/arch/arm/mach-omap2/clkt_iclk.c
@@ -14,8 +14,6 @@
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/io.h> 15#include <linux/io.h>
16 16
17#include <plat/clock.h>
18#include <plat/prcm.h>
19 17
20#include "clock.h" 18#include "clock.h"
21#include "clock2xxx.h" 19#include "clock2xxx.h"
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 961ac8f7e13d..e381d991092c 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -15,6 +15,7 @@
15#undef DEBUG 15#undef DEBUG
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/export.h>
18#include <linux/list.h> 19#include <linux/list.h>
19#include <linux/errno.h> 20#include <linux/errno.h>
20#include <linux/err.h> 21#include <linux/err.h>
@@ -25,17 +26,24 @@
25 26
26#include <asm/cpu.h> 27#include <asm/cpu.h>
27 28
28#include <plat/clock.h>
29#include <plat/prcm.h>
30 29
31#include <trace/events/power.h> 30#include <trace/events/power.h>
32 31
33#include "soc.h" 32#include "soc.h"
34#include "clockdomain.h" 33#include "clockdomain.h"
35#include "clock.h" 34#include "clock.h"
36#include "cm2xxx_3xxx.h" 35#include "cm.h"
36#include "cm2xxx.h"
37#include "cm3xxx.h"
37#include "cm-regbits-24xx.h" 38#include "cm-regbits-24xx.h"
38#include "cm-regbits-34xx.h" 39#include "cm-regbits-34xx.h"
40#include "common.h"
41
42/*
43 * MAX_MODULE_ENABLE_WAIT: maximum of number of microseconds to wait
44 * for a module to indicate that it is no longer in idle
45 */
46#define MAX_MODULE_ENABLE_WAIT 100000
39 47
40u16 cpu_mask; 48u16 cpu_mask;
41 49
@@ -47,12 +55,50 @@ u16 cpu_mask;
47 */ 55 */
48static bool clkdm_control = true; 56static bool clkdm_control = true;
49 57
58static LIST_HEAD(clocks);
59static DEFINE_MUTEX(clocks_mutex);
60static DEFINE_SPINLOCK(clockfw_lock);
61
50/* 62/*
51 * OMAP2+ specific clock functions 63 * OMAP2+ specific clock functions
52 */ 64 */
53 65
54/* Private functions */ 66/* Private functions */
55 67
68
69/**
70 * _wait_idlest_generic - wait for a module to leave the idle state
71 * @reg: virtual address of module IDLEST register
72 * @mask: value to mask against to determine if the module is active
73 * @idlest: idle state indicator (0 or 1) for the clock
74 * @name: name of the clock (for printk)
75 *
76 * Wait for a module to leave idle, where its idle-status register is
77 * not inside the CM module. Returns 1 if the module left idle
78 * promptly, or 0 if the module did not leave idle before the timeout
79 * elapsed. XXX Deprecated - should be moved into drivers for the
80 * individual IP block that the IDLEST register exists in.
81 */
82static int _wait_idlest_generic(void __iomem *reg, u32 mask, u8 idlest,
83 const char *name)
84{
85 int i = 0, ena = 0;
86
87 ena = (idlest) ? 0 : mask;
88
89 omap_test_timeout(((__raw_readl(reg) & mask) == ena),
90 MAX_MODULE_ENABLE_WAIT, i);
91
92 if (i < MAX_MODULE_ENABLE_WAIT)
93 pr_debug("omap clock: module associated with clock %s ready after %d loops\n",
94 name, i);
95 else
96 pr_err("omap clock: module associated with clock %s didn't enable in %d tries\n",
97 name, MAX_MODULE_ENABLE_WAIT);
98
99 return (i < MAX_MODULE_ENABLE_WAIT) ? 1 : 0;
100};
101
56/** 102/**
57 * _omap2_module_wait_ready - wait for an OMAP module to leave IDLE 103 * _omap2_module_wait_ready - wait for an OMAP module to leave IDLE
58 * @clk: struct clk * belonging to the module 104 * @clk: struct clk * belonging to the module
@@ -66,7 +112,9 @@ static bool clkdm_control = true;
66static void _omap2_module_wait_ready(struct clk *clk) 112static void _omap2_module_wait_ready(struct clk *clk)
67{ 113{
68 void __iomem *companion_reg, *idlest_reg; 114 void __iomem *companion_reg, *idlest_reg;
69 u8 other_bit, idlest_bit, idlest_val; 115 u8 other_bit, idlest_bit, idlest_val, idlest_reg_id;
116 s16 prcm_mod;
117 int r;
70 118
71 /* Not all modules have multiple clocks that their IDLEST depends on */ 119 /* Not all modules have multiple clocks that their IDLEST depends on */
72 if (clk->ops->find_companion) { 120 if (clk->ops->find_companion) {
@@ -77,8 +125,14 @@ static void _omap2_module_wait_ready(struct clk *clk)
77 125
78 clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val); 126 clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val);
79 127
80 omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), idlest_val, 128 r = cm_split_idlest_reg(idlest_reg, &prcm_mod, &idlest_reg_id);
81 __clk_get_name(clk)); 129 if (r) {
130 /* IDLEST register not in the CM module */
131 _wait_idlest_generic(idlest_reg, (1 << idlest_bit), idlest_val,
132 clk->name);
133 } else {
134 cm_wait_module_ready(prcm_mod, idlest_reg_id, idlest_bit);
135 };
82} 136}
83 137
84/* Public functions */ 138/* Public functions */
@@ -512,12 +566,510 @@ void __init omap2_clk_print_new_rates(const char *hfclkin_ck_name,
512 566
513/* Common data */ 567/* Common data */
514 568
515struct clk_functions omap2_clk_functions = { 569int clk_enable(struct clk *clk)
516 .clk_enable = omap2_clk_enable, 570{
517 .clk_disable = omap2_clk_disable, 571 unsigned long flags;
518 .clk_round_rate = omap2_clk_round_rate, 572 int ret;
519 .clk_set_rate = omap2_clk_set_rate, 573
520 .clk_set_parent = omap2_clk_set_parent, 574 if (clk == NULL || IS_ERR(clk))
521 .clk_disable_unused = omap2_clk_disable_unused, 575 return -EINVAL;
576
577 spin_lock_irqsave(&clockfw_lock, flags);
578 ret = omap2_clk_enable(clk);
579 spin_unlock_irqrestore(&clockfw_lock, flags);
580
581 return ret;
582}
583EXPORT_SYMBOL(clk_enable);
584
585void clk_disable(struct clk *clk)
586{
587 unsigned long flags;
588
589 if (clk == NULL || IS_ERR(clk))
590 return;
591
592 spin_lock_irqsave(&clockfw_lock, flags);
593 if (clk->usecount == 0) {
594 pr_err("Trying disable clock %s with 0 usecount\n",
595 clk->name);
596 WARN_ON(1);
597 goto out;
598 }
599
600 omap2_clk_disable(clk);
601
602out:
603 spin_unlock_irqrestore(&clockfw_lock, flags);
604}
605EXPORT_SYMBOL(clk_disable);
606
607unsigned long clk_get_rate(struct clk *clk)
608{
609 unsigned long flags;
610 unsigned long ret;
611
612 if (clk == NULL || IS_ERR(clk))
613 return 0;
614
615 spin_lock_irqsave(&clockfw_lock, flags);
616 ret = clk->rate;
617 spin_unlock_irqrestore(&clockfw_lock, flags);
618
619 return ret;
620}
621EXPORT_SYMBOL(clk_get_rate);
622
623/*
624 * Optional clock functions defined in include/linux/clk.h
625 */
626
627long clk_round_rate(struct clk *clk, unsigned long rate)
628{
629 unsigned long flags;
630 long ret;
631
632 if (clk == NULL || IS_ERR(clk))
633 return 0;
634
635 spin_lock_irqsave(&clockfw_lock, flags);
636 ret = omap2_clk_round_rate(clk, rate);
637 spin_unlock_irqrestore(&clockfw_lock, flags);
638
639 return ret;
640}
641EXPORT_SYMBOL(clk_round_rate);
642
643int clk_set_rate(struct clk *clk, unsigned long rate)
644{
645 unsigned long flags;
646 int ret = -EINVAL;
647
648 if (clk == NULL || IS_ERR(clk))
649 return ret;
650
651 spin_lock_irqsave(&clockfw_lock, flags);
652 ret = omap2_clk_set_rate(clk, rate);
653 if (ret == 0)
654 propagate_rate(clk);
655 spin_unlock_irqrestore(&clockfw_lock, flags);
656
657 return ret;
658}
659EXPORT_SYMBOL(clk_set_rate);
660
661int clk_set_parent(struct clk *clk, struct clk *parent)
662{
663 unsigned long flags;
664 int ret = -EINVAL;
665
666 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
667 return ret;
668
669 spin_lock_irqsave(&clockfw_lock, flags);
670 if (clk->usecount == 0) {
671 ret = omap2_clk_set_parent(clk, parent);
672 if (ret == 0)
673 propagate_rate(clk);
674 } else {
675 ret = -EBUSY;
676 }
677 spin_unlock_irqrestore(&clockfw_lock, flags);
678
679 return ret;
680}
681EXPORT_SYMBOL(clk_set_parent);
682
683struct clk *clk_get_parent(struct clk *clk)
684{
685 return clk->parent;
686}
687EXPORT_SYMBOL(clk_get_parent);
688
689/*
690 * OMAP specific clock functions shared between omap1 and omap2
691 */
692
693int __initdata mpurate;
694
695/*
696 * By default we use the rate set by the bootloader.
697 * You can override this with mpurate= cmdline option.
698 */
699static int __init omap_clk_setup(char *str)
700{
701 get_option(&str, &mpurate);
702
703 if (!mpurate)
704 return 1;
705
706 if (mpurate < 1000)
707 mpurate *= 1000000;
708
709 return 1;
710}
711__setup("mpurate=", omap_clk_setup);
712
713/* Used for clocks that always have same value as the parent clock */
714unsigned long followparent_recalc(struct clk *clk)
715{
716 return clk->parent->rate;
717}
718
719/*
720 * Used for clocks that have the same value as the parent clock,
721 * divided by some factor
722 */
723unsigned long omap_fixed_divisor_recalc(struct clk *clk)
724{
725 WARN_ON(!clk->fixed_div);
726
727 return clk->parent->rate / clk->fixed_div;
728}
729
730void clk_reparent(struct clk *child, struct clk *parent)
731{
732 list_del_init(&child->sibling);
733 if (parent)
734 list_add(&child->sibling, &parent->children);
735 child->parent = parent;
736
737 /* now do the debugfs renaming to reattach the child
738 to the proper parent */
739}
740
741/* Propagate rate to children */
742void propagate_rate(struct clk *tclk)
743{
744 struct clk *clkp;
745
746 list_for_each_entry(clkp, &tclk->children, sibling) {
747 if (clkp->recalc)
748 clkp->rate = clkp->recalc(clkp);
749 propagate_rate(clkp);
750 }
751}
752
753static LIST_HEAD(root_clks);
754
755/**
756 * recalculate_root_clocks - recalculate and propagate all root clocks
757 *
758 * Recalculates all root clocks (clocks with no parent), which if the
759 * clock's .recalc is set correctly, should also propagate their rates.
760 * Called at init.
761 */
762void recalculate_root_clocks(void)
763{
764 struct clk *clkp;
765
766 list_for_each_entry(clkp, &root_clks, sibling) {
767 if (clkp->recalc)
768 clkp->rate = clkp->recalc(clkp);
769 propagate_rate(clkp);
770 }
771}
772
773/**
774 * clk_preinit - initialize any fields in the struct clk before clk init
775 * @clk: struct clk * to initialize
776 *
777 * Initialize any struct clk fields needed before normal clk initialization
778 * can run. No return value.
779 */
780void clk_preinit(struct clk *clk)
781{
782 INIT_LIST_HEAD(&clk->children);
783}
784
785int clk_register(struct clk *clk)
786{
787 if (clk == NULL || IS_ERR(clk))
788 return -EINVAL;
789
790 /*
791 * trap out already registered clocks
792 */
793 if (clk->node.next || clk->node.prev)
794 return 0;
795
796 mutex_lock(&clocks_mutex);
797 if (clk->parent)
798 list_add(&clk->sibling, &clk->parent->children);
799 else
800 list_add(&clk->sibling, &root_clks);
801
802 list_add(&clk->node, &clocks);
803 if (clk->init)
804 clk->init(clk);
805 mutex_unlock(&clocks_mutex);
806
807 return 0;
808}
809EXPORT_SYMBOL(clk_register);
810
811void clk_unregister(struct clk *clk)
812{
813 if (clk == NULL || IS_ERR(clk))
814 return;
815
816 mutex_lock(&clocks_mutex);
817 list_del(&clk->sibling);
818 list_del(&clk->node);
819 mutex_unlock(&clocks_mutex);
820}
821EXPORT_SYMBOL(clk_unregister);
822
823void clk_enable_init_clocks(void)
824{
825 struct clk *clkp;
826
827 list_for_each_entry(clkp, &clocks, node)
828 if (clkp->flags & ENABLE_ON_INIT)
829 clk_enable(clkp);
830}
831
832/**
833 * omap_clk_get_by_name - locate OMAP struct clk by its name
834 * @name: name of the struct clk to locate
835 *
836 * Locate an OMAP struct clk by its name. Assumes that struct clk
837 * names are unique. Returns NULL if not found or a pointer to the
838 * struct clk if found.
839 */
840struct clk *omap_clk_get_by_name(const char *name)
841{
842 struct clk *c;
843 struct clk *ret = NULL;
844
845 mutex_lock(&clocks_mutex);
846
847 list_for_each_entry(c, &clocks, node) {
848 if (!strcmp(c->name, name)) {
849 ret = c;
850 break;
851 }
852 }
853
854 mutex_unlock(&clocks_mutex);
855
856 return ret;
857}
858
859int omap_clk_enable_autoidle_all(void)
860{
861 struct clk *c;
862 unsigned long flags;
863
864 spin_lock_irqsave(&clockfw_lock, flags);
865
866 list_for_each_entry(c, &clocks, node)
867 if (c->ops->allow_idle)
868 c->ops->allow_idle(c);
869
870 spin_unlock_irqrestore(&clockfw_lock, flags);
871
872 return 0;
873}
874
875int omap_clk_disable_autoidle_all(void)
876{
877 struct clk *c;
878 unsigned long flags;
879
880 spin_lock_irqsave(&clockfw_lock, flags);
881
882 list_for_each_entry(c, &clocks, node)
883 if (c->ops->deny_idle)
884 c->ops->deny_idle(c);
885
886 spin_unlock_irqrestore(&clockfw_lock, flags);
887
888 return 0;
889}
890
891/*
892 * Low level helpers
893 */
894static int clkll_enable_null(struct clk *clk)
895{
896 return 0;
897}
898
899static void clkll_disable_null(struct clk *clk)
900{
901}
902
903const struct clkops clkops_null = {
904 .enable = clkll_enable_null,
905 .disable = clkll_disable_null,
906};
907
908/*
909 * Dummy clock
910 *
911 * Used for clock aliases that are needed on some OMAPs, but not others
912 */
913struct clk dummy_ck = {
914 .name = "dummy",
915 .ops = &clkops_null,
916};
917
918/*
919 *
920 */
921
922#ifdef CONFIG_OMAP_RESET_CLOCKS
923/*
924 * Disable any unused clocks left on by the bootloader
925 */
926static int __init clk_disable_unused(void)
927{
928 struct clk *ck;
929 unsigned long flags;
930
931 pr_info("clock: disabling unused clocks to save power\n");
932
933 spin_lock_irqsave(&clockfw_lock, flags);
934 list_for_each_entry(ck, &clocks, node) {
935 if (ck->ops == &clkops_null)
936 continue;
937
938 if (ck->usecount > 0 || !ck->enable_reg)
939 continue;
940
941 omap2_clk_disable_unused(ck);
942 }
943 spin_unlock_irqrestore(&clockfw_lock, flags);
944
945 return 0;
946}
947late_initcall(clk_disable_unused);
948late_initcall(omap_clk_enable_autoidle_all);
949#endif
950
951#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
952/*
953 * debugfs support to trace clock tree hierarchy and attributes
954 */
955
956#include <linux/debugfs.h>
957#include <linux/seq_file.h>
958
959static struct dentry *clk_debugfs_root;
960
961static int clk_dbg_show_summary(struct seq_file *s, void *unused)
962{
963 struct clk *c;
964 struct clk *pa;
965
966 mutex_lock(&clocks_mutex);
967 seq_printf(s, "%-30s %-30s %-10s %s\n",
968 "clock-name", "parent-name", "rate", "use-count");
969
970 list_for_each_entry(c, &clocks, node) {
971 pa = c->parent;
972 seq_printf(s, "%-30s %-30s %-10lu %d\n",
973 c->name, pa ? pa->name : "none", c->rate,
974 c->usecount);
975 }
976 mutex_unlock(&clocks_mutex);
977
978 return 0;
979}
980
981static int clk_dbg_open(struct inode *inode, struct file *file)
982{
983 return single_open(file, clk_dbg_show_summary, inode->i_private);
984}
985
986static const struct file_operations debug_clock_fops = {
987 .open = clk_dbg_open,
988 .read = seq_read,
989 .llseek = seq_lseek,
990 .release = single_release,
522}; 991};
523 992
993static int clk_debugfs_register_one(struct clk *c)
994{
995 int err;
996 struct dentry *d;
997 struct clk *pa = c->parent;
998
999 d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root);
1000 if (!d)
1001 return -ENOMEM;
1002 c->dent = d;
1003
1004 d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
1005 if (!d) {
1006 err = -ENOMEM;
1007 goto err_out;
1008 }
1009 d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
1010 if (!d) {
1011 err = -ENOMEM;
1012 goto err_out;
1013 }
1014 d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
1015 if (!d) {
1016 err = -ENOMEM;
1017 goto err_out;
1018 }
1019 return 0;
1020
1021err_out:
1022 debugfs_remove_recursive(c->dent);
1023 return err;
1024}
1025
1026static int clk_debugfs_register(struct clk *c)
1027{
1028 int err;
1029 struct clk *pa = c->parent;
1030
1031 if (pa && !pa->dent) {
1032 err = clk_debugfs_register(pa);
1033 if (err)
1034 return err;
1035 }
1036
1037 if (!c->dent) {
1038 err = clk_debugfs_register_one(c);
1039 if (err)
1040 return err;
1041 }
1042 return 0;
1043}
1044
1045static int __init clk_debugfs_init(void)
1046{
1047 struct clk *c;
1048 struct dentry *d;
1049 int err;
1050
1051 d = debugfs_create_dir("clock", NULL);
1052 if (!d)
1053 return -ENOMEM;
1054 clk_debugfs_root = d;
1055
1056 list_for_each_entry(c, &clocks, node) {
1057 err = clk_debugfs_register(c);
1058 if (err)
1059 goto err_out;
1060 }
1061
1062 d = debugfs_create_file("summary", S_IRUGO,
1063 d, NULL, &debug_clock_fops);
1064 if (!d)
1065 return -ENOMEM;
1066
1067 return 0;
1068err_out:
1069 debugfs_remove_recursive(clk_debugfs_root);
1070 return err;
1071}
1072late_initcall(clk_debugfs_init);
1073
1074#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
1075
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 35ec5f3d9a73..ff9789bc0fd1 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -17,8 +17,323 @@
17#define __ARCH_ARM_MACH_OMAP2_CLOCK_H 17#define __ARCH_ARM_MACH_OMAP2_CLOCK_H
18 18
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/list.h>
21
22#include <linux/clkdev.h>
23
24struct omap_clk {
25 u16 cpu;
26 struct clk_lookup lk;
27};
28
29#define CLK(dev, con, ck, cp) \
30 { \
31 .cpu = cp, \
32 .lk = { \
33 .dev_id = dev, \
34 .con_id = con, \
35 .clk = ck, \
36 }, \
37 }
38
39/* Platform flags for the clkdev-OMAP integration code */
40#define CK_242X (1 << 0)
41#define CK_243X (1 << 1) /* 243x, 253x */
42#define CK_3430ES1 (1 << 2) /* 34xxES1 only */
43#define CK_3430ES2PLUS (1 << 3) /* 34xxES2, ES3, non-Sitara 35xx only */
44#define CK_AM35XX (1 << 4) /* Sitara AM35xx */
45#define CK_36XX (1 << 5) /* 36xx/37xx-specific clocks */
46#define CK_443X (1 << 6)
47#define CK_TI816X (1 << 7)
48#define CK_446X (1 << 8)
49#define CK_AM33XX (1 << 9) /* AM33xx specific clocks */
50
51
52#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS)
53#define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX)
54
55struct module;
56struct clk;
57struct clockdomain;
58
59/* Temporary, needed during the common clock framework conversion */
60#define __clk_get_name(clk) (clk->name)
61#define __clk_get_parent(clk) (clk->parent)
62#define __clk_get_rate(clk) (clk->rate)
63
64/**
65 * struct clkops - some clock function pointers
66 * @enable: fn ptr that enables the current clock in hardware
67 * @disable: fn ptr that enables the current clock in hardware
68 * @find_idlest: function returning the IDLEST register for the clock's IP blk
69 * @find_companion: function returning the "companion" clk reg for the clock
70 * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
71 * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
72 *
73 * A "companion" clk is an accompanying clock to the one being queried
74 * that must be enabled for the IP module connected to the clock to
75 * become accessible by the hardware. Neither @find_idlest nor
76 * @find_companion should be needed; that information is IP
77 * block-specific; the hwmod code has been created to handle this, but
78 * until hwmod data is ready and drivers have been converted to use PM
79 * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
80 * @find_companion must, unfortunately, remain.
81 */
82struct clkops {
83 int (*enable)(struct clk *);
84 void (*disable)(struct clk *);
85 void (*find_idlest)(struct clk *, void __iomem **,
86 u8 *, u8 *);
87 void (*find_companion)(struct clk *, void __iomem **,
88 u8 *);
89 void (*allow_idle)(struct clk *);
90 void (*deny_idle)(struct clk *);
91};
92
93/* struct clksel_rate.flags possibilities */
94#define RATE_IN_242X (1 << 0)
95#define RATE_IN_243X (1 << 1)
96#define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */
97#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
98#define RATE_IN_36XX (1 << 4)
99#define RATE_IN_4430 (1 << 5)
100#define RATE_IN_TI816X (1 << 6)
101#define RATE_IN_4460 (1 << 7)
102#define RATE_IN_AM33XX (1 << 8)
103#define RATE_IN_TI814X (1 << 9)
104
105#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
106#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
107#define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX)
108#define RATE_IN_44XX (RATE_IN_4430 | RATE_IN_4460)
109
110/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
111#define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
112
113
114/**
115 * struct clksel_rate - register bitfield values corresponding to clk divisors
116 * @val: register bitfield value (shifted to bit 0)
117 * @div: clock divisor corresponding to @val
118 * @flags: (see "struct clksel_rate.flags possibilities" above)
119 *
120 * @val should match the value of a read from struct clk.clksel_reg
121 * AND'ed with struct clk.clksel_mask, shifted right to bit 0.
122 *
123 * @div is the divisor that should be applied to the parent clock's rate
124 * to produce the current clock's rate.
125 */
126struct clksel_rate {
127 u32 val;
128 u8 div;
129 u16 flags;
130};
131
132/**
133 * struct clksel - available parent clocks, and a pointer to their divisors
134 * @parent: struct clk * to a possible parent clock
135 * @rates: available divisors for this parent clock
136 *
137 * A struct clksel is always associated with one or more struct clks
138 * and one or more struct clksel_rates.
139 */
140struct clksel {
141 struct clk *parent;
142 const struct clksel_rate *rates;
143};
144
145/**
146 * struct dpll_data - DPLL registers and integration data
147 * @mult_div1_reg: register containing the DPLL M and N bitfields
148 * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
149 * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
150 * @clk_bypass: struct clk pointer to the clock's bypass clock input
151 * @clk_ref: struct clk pointer to the clock's reference clock input
152 * @control_reg: register containing the DPLL mode bitfield
153 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
154 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
155 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
156 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
157 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
158 * @min_divider: minimum valid non-bypass divider value (actual)
159 * @max_divider: maximum valid non-bypass divider value (actual)
160 * @modes: possible values of @enable_mask
161 * @autoidle_reg: register containing the DPLL autoidle mode bitfield
162 * @idlest_reg: register containing the DPLL idle status bitfield
163 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
164 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
165 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
166 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
167 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
168 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
169 * @flags: DPLL type/features (see below)
170 *
171 * Possible values for @flags:
172 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
173 *
174 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
175 *
176 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
177 * correct to only have one @clk_bypass pointer.
178 *
179 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
180 * @last_rounded_n) should be separated from the runtime-fixed fields
181 * and placed into a different structure, so that the runtime-fixed data
182 * can be placed into read-only space.
183 */
184struct dpll_data {
185 void __iomem *mult_div1_reg;
186 u32 mult_mask;
187 u32 div1_mask;
188 struct clk *clk_bypass;
189 struct clk *clk_ref;
190 void __iomem *control_reg;
191 u32 enable_mask;
192 unsigned long last_rounded_rate;
193 u16 last_rounded_m;
194 u16 max_multiplier;
195 u8 last_rounded_n;
196 u8 min_divider;
197 u16 max_divider;
198 u8 modes;
199 void __iomem *autoidle_reg;
200 void __iomem *idlest_reg;
201 u32 autoidle_mask;
202 u32 freqsel_mask;
203 u32 idlest_mask;
204 u32 dco_mask;
205 u32 sddiv_mask;
206 u8 auto_recal_bit;
207 u8 recal_en_bit;
208 u8 recal_st_bit;
209 u8 flags;
210};
211
212/*
213 * struct clk.flags possibilities
214 *
215 * XXX document the rest of the clock flags here
216 *
217 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
218 * bits share the same register. This flag allows the
219 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
220 * should be used. This is a temporary solution - a better approach
221 * would be to associate clock type-specific data with the clock,
222 * similar to the struct dpll_data approach.
223 */
224#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
225#define CLOCK_IDLE_CONTROL (1 << 1)
226#define CLOCK_NO_IDLE_PARENT (1 << 2)
227#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
228#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
229#define CLOCK_CLKOUTX2 (1 << 5)
230
231/**
232 * struct clk - OMAP struct clk
233 * @node: list_head connecting this clock into the full clock list
234 * @ops: struct clkops * for this clock
235 * @name: the name of the clock in the hardware (used in hwmod data and debug)
236 * @parent: pointer to this clock's parent struct clk
237 * @children: list_head connecting to the child clks' @sibling list_heads
238 * @sibling: list_head connecting this clk to its parent clk's @children
239 * @rate: current clock rate
240 * @enable_reg: register to write to enable the clock (see @enable_bit)
241 * @recalc: fn ptr that returns the clock's current rate
242 * @set_rate: fn ptr that can change the clock's current rate
243 * @round_rate: fn ptr that can round the clock's current rate
244 * @init: fn ptr to do clock-specific initialization
245 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
246 * @usecount: number of users that have requested this clock to be enabled
247 * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
248 * @flags: see "struct clk.flags possibilities" above
249 * @clksel_reg: for clksel clks, register va containing src/divisor select
250 * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
251 * @clksel: for clksel clks, pointer to struct clksel for this clock
252 * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
253 * @clkdm_name: clockdomain name that this clock is contained in
254 * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
255 * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
256 * @src_offset: bitshift for source selection bitfield (OMAP1 only)
257 *
258 * XXX @rate_offset, @src_offset should probably be removed and OMAP1
259 * clock code converted to use clksel.
260 *
261 * XXX @usecount is poorly named. It should be "enable_count" or
262 * something similar. "users" in the description refers to kernel
263 * code (core code or drivers) that have called clk_enable() and not
264 * yet called clk_disable(); the usecount of parent clocks is also
265 * incremented by the clock code when clk_enable() is called on child
266 * clocks and decremented by the clock code when clk_disable() is
267 * called on child clocks.
268 *
269 * XXX @clkdm, @usecount, @children, @sibling should be marked for
270 * internal use only.
271 *
272 * @children and @sibling are used to optimize parent-to-child clock
273 * tree traversals. (child-to-parent traversals use @parent.)
274 *
275 * XXX The notion of the clock's current rate probably needs to be
276 * separated from the clock's target rate.
277 */
278struct clk {
279 struct list_head node;
280 const struct clkops *ops;
281 const char *name;
282 struct clk *parent;
283 struct list_head children;
284 struct list_head sibling; /* node for children */
285 unsigned long rate;
286 void __iomem *enable_reg;
287 unsigned long (*recalc)(struct clk *);
288 int (*set_rate)(struct clk *, unsigned long);
289 long (*round_rate)(struct clk *, unsigned long);
290 void (*init)(struct clk *);
291 u8 enable_bit;
292 s8 usecount;
293 u8 fixed_div;
294 u8 flags;
295 void __iomem *clksel_reg;
296 u32 clksel_mask;
297 const struct clksel *clksel;
298 struct dpll_data *dpll_data;
299 const char *clkdm_name;
300 struct clockdomain *clkdm;
301#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
302 struct dentry *dent; /* For visible tree hierarchy */
303#endif
304};
305
306struct clk_functions {
307 int (*clk_enable)(struct clk *clk);
308 void (*clk_disable)(struct clk *clk);
309 long (*clk_round_rate)(struct clk *clk, unsigned long rate);
310 int (*clk_set_rate)(struct clk *clk, unsigned long rate);
311 int (*clk_set_parent)(struct clk *clk, struct clk *parent);
312 void (*clk_allow_idle)(struct clk *clk);
313 void (*clk_deny_idle)(struct clk *clk);
314 void (*clk_disable_unused)(struct clk *clk);
315};
316
317extern int mpurate;
318
319extern int clk_init(struct clk_functions *custom_clocks);
320extern void clk_preinit(struct clk *clk);
321extern int clk_register(struct clk *clk);
322extern void clk_reparent(struct clk *child, struct clk *parent);
323extern void clk_unregister(struct clk *clk);
324extern void propagate_rate(struct clk *clk);
325extern void recalculate_root_clocks(void);
326extern unsigned long followparent_recalc(struct clk *clk);
327extern void clk_enable_init_clocks(void);
328unsigned long omap_fixed_divisor_recalc(struct clk *clk);
329extern struct clk *omap_clk_get_by_name(const char *name);
330extern int omap_clk_enable_autoidle_all(void);
331extern int omap_clk_disable_autoidle_all(void);
332
333extern const struct clkops clkops_null;
334
335extern struct clk dummy_ck;
20 336
21#include <plat/clock.h>
22 337
23/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ 338/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */
24#define CORE_CLK_SRC_32K 0x0 339#define CORE_CLK_SRC_32K 0x0
@@ -94,33 +409,6 @@ extern void omap2_clkt_iclk_deny_idle(struct clk *clk);
94u32 omap2_get_dpll_rate(struct clk *clk); 409u32 omap2_get_dpll_rate(struct clk *clk);
95void omap2_init_dpll_parent(struct clk *clk); 410void omap2_init_dpll_parent(struct clk *clk);
96 411
97int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name);
98
99
100#ifdef CONFIG_ARCH_OMAP2
101void omap2xxx_clk_prepare_for_reboot(void);
102#else
103static inline void omap2xxx_clk_prepare_for_reboot(void)
104{
105}
106#endif
107
108#ifdef CONFIG_ARCH_OMAP3
109void omap3_clk_prepare_for_reboot(void);
110#else
111static inline void omap3_clk_prepare_for_reboot(void)
112{
113}
114#endif
115
116#ifdef CONFIG_ARCH_OMAP4
117void omap4_clk_prepare_for_reboot(void);
118#else
119static inline void omap4_clk_prepare_for_reboot(void)
120{
121}
122#endif
123
124int omap2_dflt_clk_enable(struct clk *clk); 412int omap2_dflt_clk_enable(struct clk *clk);
125void omap2_dflt_clk_disable(struct clk *clk); 413void omap2_dflt_clk_disable(struct clk *clk);
126void omap2_clk_dflt_find_companion(struct clk *clk, void __iomem **other_reg, 414void omap2_clk_dflt_find_companion(struct clk *clk, void __iomem **other_reg,
@@ -139,7 +427,6 @@ extern const struct clkops clkops_dummy;
139extern const struct clkops clkops_omap2_dflt; 427extern const struct clkops clkops_omap2_dflt;
140 428
141extern struct clk_functions omap2_clk_functions; 429extern struct clk_functions omap2_clk_functions;
142extern struct clk *vclk, *sclk;
143 430
144extern const struct clksel_rate gpt_32k_rates[]; 431extern const struct clksel_rate gpt_32k_rates[];
145extern const struct clksel_rate gpt_sys_rates[]; 432extern const struct clksel_rate gpt_sys_rates[];
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index c3cde1a2b6de..608874b651e8 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2420 clock data 2 * OMAP2420 clock data
3 * 3 *
4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 4 * Copyright (C) 2005-2009, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2004-2011 Nokia Corporation 5 * Copyright (C) 2004-2011 Nokia Corporation
6 * 6 *
7 * Contacts: 7 * Contacts:
@@ -18,14 +18,12 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/list.h> 19#include <linux/list.h>
20 20
21#include <plat/clkdev_omap.h>
22
23#include "soc.h" 21#include "soc.h"
24#include "iomap.h" 22#include "iomap.h"
25#include "clock.h" 23#include "clock.h"
26#include "clock2xxx.h" 24#include "clock2xxx.h"
27#include "opp2xxx.h" 25#include "opp2xxx.h"
28#include "cm2xxx_3xxx.h" 26#include "cm2xxx.h"
29#include "prm2xxx_3xxx.h" 27#include "prm2xxx_3xxx.h"
30#include "prm-regbits-24xx.h" 28#include "prm-regbits-24xx.h"
31#include "cm-regbits-24xx.h" 29#include "cm-regbits-24xx.h"
@@ -126,6 +124,7 @@ static struct clk dpll_ck = {
126 .name = "dpll_ck", 124 .name = "dpll_ck",
127 .ops = &clkops_omap2xxx_dpll_ops, 125 .ops = &clkops_omap2xxx_dpll_ops,
128 .parent = &sys_ck, /* Can be func_32k also */ 126 .parent = &sys_ck, /* Can be func_32k also */
127 .init = &omap2xxx_clkt_dpllcore_init,
129 .dpll_data = &dpll_dd, 128 .dpll_data = &dpll_dd,
130 .clkdm_name = "wkup_clkdm", 129 .clkdm_name = "wkup_clkdm",
131 .recalc = &omap2_dpllcore_recalc, 130 .recalc = &omap2_dpllcore_recalc,
@@ -1926,17 +1925,12 @@ static struct omap_clk omap2420_clks[] = {
1926 1925
1927int __init omap2420_clk_init(void) 1926int __init omap2420_clk_init(void)
1928{ 1927{
1929 const struct prcm_config *prcm;
1930 struct omap_clk *c; 1928 struct omap_clk *c;
1931 u32 clkrate;
1932 1929
1933 prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL; 1930 prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL;
1934 cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST);
1935 cpu_mask = RATE_IN_242X; 1931 cpu_mask = RATE_IN_242X;
1936 rate_table = omap2420_rate_table; 1932 rate_table = omap2420_rate_table;
1937 1933
1938 clk_init(&omap2_clk_functions);
1939
1940 for (c = omap2420_clks; c < omap2420_clks + ARRAY_SIZE(omap2420_clks); 1934 for (c = omap2420_clks; c < omap2420_clks + ARRAY_SIZE(omap2420_clks);
1941 c++) 1935 c++)
1942 clk_preinit(c->lk.clk); 1936 clk_preinit(c->lk.clk);
@@ -1953,20 +1947,13 @@ int __init omap2420_clk_init(void)
1953 omap2_init_clk_clkdm(c->lk.clk); 1947 omap2_init_clk_clkdm(c->lk.clk);
1954 } 1948 }
1955 1949
1950 omap2xxx_clkt_vps_late_init();
1951
1956 /* Disable autoidle on all clocks; let the PM code enable it later */ 1952 /* Disable autoidle on all clocks; let the PM code enable it later */
1957 omap_clk_disable_autoidle_all(); 1953 omap_clk_disable_autoidle_all();
1958 1954
1959 /* Check the MPU rate set by bootloader */ 1955 /* XXX Can this be done from the virt_prcm_set clk init function? */
1960 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); 1956 omap2xxx_clkt_vps_check_bootloader_rates();
1961 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
1962 if (!(prcm->flags & cpu_mask))
1963 continue;
1964 if (prcm->xtal_speed != sys_ck.rate)
1965 continue;
1966 if (prcm->dpll_speed <= clkrate)
1967 break;
1968 }
1969 curr_prcm_set = prcm;
1970 1957
1971 recalculate_root_clocks(); 1958 recalculate_root_clocks();
1972 1959
@@ -1980,11 +1967,6 @@ int __init omap2420_clk_init(void)
1980 */ 1967 */
1981 clk_enable_init_clocks(); 1968 clk_enable_init_clocks();
1982 1969
1983 /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
1984 vclk = clk_get(NULL, "virt_prcm_set");
1985 sclk = clk_get(NULL, "sys_ck");
1986 dclk = clk_get(NULL, "dpll_ck");
1987
1988 return 0; 1970 return 0;
1989} 1971}
1990 1972
diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c
index a8e326177466..e37df538bcd3 100644
--- a/arch/arm/mach-omap2/clock2430.c
+++ b/arch/arm/mach-omap2/clock2430.c
@@ -21,13 +21,11 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/clock.h>
25
26#include "soc.h" 24#include "soc.h"
27#include "iomap.h" 25#include "iomap.h"
28#include "clock.h" 26#include "clock.h"
29#include "clock2xxx.h" 27#include "clock2xxx.h"
30#include "cm2xxx_3xxx.h" 28#include "cm2xxx.h"
31#include "cm-regbits-24xx.h" 29#include "cm-regbits-24xx.h"
32 30
33/** 31/**
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index 22404fe435e7..b179b6ef4329 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2430 clock data 2 * OMAP2430 clock data
3 * 3 *
4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 4 * Copyright (C) 2005-2009, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2004-2011 Nokia Corporation 5 * Copyright (C) 2004-2011 Nokia Corporation
6 * 6 *
7 * Contacts: 7 * Contacts:
@@ -17,14 +17,12 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/list.h> 18#include <linux/list.h>
19 19
20#include <plat/clkdev_omap.h>
21
22#include "soc.h" 20#include "soc.h"
23#include "iomap.h" 21#include "iomap.h"
24#include "clock.h" 22#include "clock.h"
25#include "clock2xxx.h" 23#include "clock2xxx.h"
26#include "opp2xxx.h" 24#include "opp2xxx.h"
27#include "cm2xxx_3xxx.h" 25#include "cm2xxx.h"
28#include "prm2xxx_3xxx.h" 26#include "prm2xxx_3xxx.h"
29#include "prm-regbits-24xx.h" 27#include "prm-regbits-24xx.h"
30#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
@@ -125,6 +123,7 @@ static struct clk dpll_ck = {
125 .name = "dpll_ck", 123 .name = "dpll_ck",
126 .ops = &clkops_omap2xxx_dpll_ops, 124 .ops = &clkops_omap2xxx_dpll_ops,
127 .parent = &sys_ck, /* Can be func_32k also */ 125 .parent = &sys_ck, /* Can be func_32k also */
126 .init = &omap2xxx_clkt_dpllcore_init,
128 .dpll_data = &dpll_dd, 127 .dpll_data = &dpll_dd,
129 .clkdm_name = "wkup_clkdm", 128 .clkdm_name = "wkup_clkdm",
130 .recalc = &omap2_dpllcore_recalc, 129 .recalc = &omap2_dpllcore_recalc,
@@ -2025,17 +2024,12 @@ static struct omap_clk omap2430_clks[] = {
2025 2024
2026int __init omap2430_clk_init(void) 2025int __init omap2430_clk_init(void)
2027{ 2026{
2028 const struct prcm_config *prcm;
2029 struct omap_clk *c; 2027 struct omap_clk *c;
2030 u32 clkrate;
2031 2028
2032 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL; 2029 prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL;
2033 cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST);
2034 cpu_mask = RATE_IN_243X; 2030 cpu_mask = RATE_IN_243X;
2035 rate_table = omap2430_rate_table; 2031 rate_table = omap2430_rate_table;
2036 2032
2037 clk_init(&omap2_clk_functions);
2038
2039 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks); 2033 for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks);
2040 c++) 2034 c++)
2041 clk_preinit(c->lk.clk); 2035 clk_preinit(c->lk.clk);
@@ -2052,20 +2046,13 @@ int __init omap2430_clk_init(void)
2052 omap2_init_clk_clkdm(c->lk.clk); 2046 omap2_init_clk_clkdm(c->lk.clk);
2053 } 2047 }
2054 2048
2049 omap2xxx_clkt_vps_late_init();
2050
2055 /* Disable autoidle on all clocks; let the PM code enable it later */ 2051 /* Disable autoidle on all clocks; let the PM code enable it later */
2056 omap_clk_disable_autoidle_all(); 2052 omap_clk_disable_autoidle_all();
2057 2053
2058 /* Check the MPU rate set by bootloader */ 2054 /* XXX Can this be done from the virt_prcm_set clk init function? */
2059 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); 2055 omap2xxx_clkt_vps_check_bootloader_rates();
2060 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
2061 if (!(prcm->flags & cpu_mask))
2062 continue;
2063 if (prcm->xtal_speed != sys_ck.rate)
2064 continue;
2065 if (prcm->dpll_speed <= clkrate)
2066 break;
2067 }
2068 curr_prcm_set = prcm;
2069 2056
2070 recalculate_root_clocks(); 2057 recalculate_root_clocks();
2071 2058
@@ -2079,11 +2066,6 @@ int __init omap2430_clk_init(void)
2079 */ 2066 */
2080 clk_enable_init_clocks(); 2067 clk_enable_init_clocks();
2081 2068
2082 /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
2083 vclk = clk_get(NULL, "virt_prcm_set");
2084 sclk = clk_get(NULL, "sys_ck");
2085 dclk = clk_get(NULL, "dpll_ck");
2086
2087 return 0; 2069 return 0;
2088} 2070}
2089 2071
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c
index e92be1fc1a00..5f7faeb4c19b 100644
--- a/arch/arm/mach-omap2/clock2xxx.c
+++ b/arch/arm/mach-omap2/clock2xxx.c
@@ -22,35 +22,17 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <plat/clock.h>
26
27#include "soc.h" 25#include "soc.h"
28#include "clock.h" 26#include "clock.h"
29#include "clock2xxx.h" 27#include "clock2xxx.h"
30#include "cm.h" 28#include "cm.h"
31#include "cm-regbits-24xx.h" 29#include "cm-regbits-24xx.h"
32 30
33struct clk *vclk, *sclk, *dclk;
34
35/* 31/*
36 * Omap24xx specific clock functions 32 * Omap24xx specific clock functions
37 */ 33 */
38 34
39/* 35/*
40 * Set clocks for bypass mode for reboot to work.
41 */
42void omap2xxx_clk_prepare_for_reboot(void)
43{
44 u32 rate;
45
46 if (vclk == NULL || sclk == NULL)
47 return;
48
49 rate = clk_get_rate(sclk);
50 clk_set_rate(vclk, rate);
51}
52
53/*
54 * Switch the MPU rate if specified on cmdline. We cannot do this 36 * Switch the MPU rate if specified on cmdline. We cannot do this
55 * early until cmdline is parsed. XXX This should be removed from the 37 * early until cmdline is parsed. XXX This should be removed from the
56 * clock code and handled by the OPP layer code in the near future. 38 * clock code and handled by the OPP layer code in the near future.
diff --git a/arch/arm/mach-omap2/clock2xxx.h b/arch/arm/mach-omap2/clock2xxx.h
index cb6df8ca9e4a..ce809c913b6f 100644
--- a/arch/arm/mach-omap2/clock2xxx.h
+++ b/arch/arm/mach-omap2/clock2xxx.h
@@ -15,10 +15,13 @@ unsigned long omap2xxx_sys_clk_recalc(struct clk *clk);
15unsigned long omap2_osc_clk_recalc(struct clk *clk); 15unsigned long omap2_osc_clk_recalc(struct clk *clk);
16unsigned long omap2_dpllcore_recalc(struct clk *clk); 16unsigned long omap2_dpllcore_recalc(struct clk *clk);
17int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); 17int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate);
18unsigned long omap2xxx_clk_get_core_rate(struct clk *clk); 18unsigned long omap2xxx_clk_get_core_rate(void);
19u32 omap2xxx_get_apll_clkin(void); 19u32 omap2xxx_get_apll_clkin(void);
20u32 omap2xxx_get_sysclkdiv(void); 20u32 omap2xxx_get_sysclkdiv(void);
21void omap2xxx_clk_prepare_for_reboot(void); 21void omap2xxx_clk_prepare_for_reboot(void);
22void omap2xxx_clkt_dpllcore_init(struct clk *clk);
23void omap2xxx_clkt_vps_check_bootloader_rates(void);
24void omap2xxx_clkt_vps_late_init(void);
22 25
23#ifdef CONFIG_SOC_OMAP2420 26#ifdef CONFIG_SOC_OMAP2420
24int omap2420_clk_init(void); 27int omap2420_clk_init(void);
@@ -32,9 +35,7 @@ int omap2430_clk_init(void);
32#define omap2430_clk_init() do { } while(0) 35#define omap2430_clk_init() do { } while(0)
33#endif 36#endif
34 37
35extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; 38extern void __iomem *prcm_clksrc_ctrl;
36
37extern struct clk *dclk;
38 39
39extern const struct clkops clkops_omap2430_i2chs_wait; 40extern const struct clkops clkops_omap2430_i2chs_wait;
40extern const struct clkops clkops_oscck; 41extern const struct clkops clkops_oscck;
diff --git a/arch/arm/mach-omap2/clock33xx_data.c b/arch/arm/mach-omap2/clock33xx_data.c
index 1a45d6bd2539..17e3de51bcba 100644
--- a/arch/arm/mach-omap2/clock33xx_data.c
+++ b/arch/arm/mach-omap2/clock33xx_data.c
@@ -17,9 +17,8 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <plat/clkdev_omap.h>
21 20
22#include "am33xx.h" 21#include "soc.h"
23#include "iomap.h" 22#include "iomap.h"
24#include "control.h" 23#include "control.h"
25#include "clock.h" 24#include "clock.h"
@@ -1087,8 +1086,6 @@ int __init am33xx_clk_init(void)
1087 cpu_clkflg = CK_AM33XX; 1086 cpu_clkflg = CK_AM33XX;
1088 } 1087 }
1089 1088
1090 clk_init(&omap2_clk_functions);
1091
1092 for (c = am33xx_clks; c < am33xx_clks + ARRAY_SIZE(am33xx_clks); c++) 1089 for (c = am33xx_clks; c < am33xx_clks + ARRAY_SIZE(am33xx_clks); c++)
1093 clk_preinit(c->lk.clk); 1090 clk_preinit(c->lk.clk);
1094 1091
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 1fc96b9ee330..e41819ba7482 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -21,11 +21,9 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/clock.h>
25
26#include "clock.h" 24#include "clock.h"
27#include "clock34xx.h" 25#include "clock34xx.h"
28#include "cm2xxx_3xxx.h" 26#include "cm3xxx.h"
29#include "cm-regbits-34xx.h" 27#include "cm-regbits-34xx.h"
30 28
31/** 29/**
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c
index 2e97d08f0e56..622ea0502610 100644
--- a/arch/arm/mach-omap2/clock3517.c
+++ b/arch/arm/mach-omap2/clock3517.c
@@ -21,11 +21,9 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/clock.h>
25
26#include "clock.h" 24#include "clock.h"
27#include "clock3517.h" 25#include "clock3517.h"
28#include "cm2xxx_3xxx.h" 26#include "cm3xxx.h"
29#include "cm-regbits-34xx.h" 27#include "cm-regbits-34xx.h"
30 28
31/* 29/*
diff --git a/arch/arm/mach-omap2/clock36xx.c b/arch/arm/mach-omap2/clock36xx.c
index 0c5e25ed8879..0e1e9e4e2fa4 100644
--- a/arch/arm/mach-omap2/clock36xx.c
+++ b/arch/arm/mach-omap2/clock36xx.c
@@ -22,8 +22,6 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <plat/clock.h>
26
27#include "clock.h" 25#include "clock.h"
28#include "clock36xx.h" 26#include "clock36xx.h"
29 27
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index 83bb01427d40..3e8aca2b1b61 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -21,8 +21,6 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/clock.h>
25
26#include "soc.h" 24#include "soc.h"
27#include "clock.h" 25#include "clock.h"
28#include "clock3xxx.h" 26#include "clock3xxx.h"
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 1f42c9d5ecf3..6cca19953950 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -21,8 +21,6 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <plat/clkdev_omap.h>
25
26#include "soc.h" 24#include "soc.h"
27#include "iomap.h" 25#include "iomap.h"
28#include "clock.h" 26#include "clock.h"
@@ -30,7 +28,7 @@
30#include "clock34xx.h" 28#include "clock34xx.h"
31#include "clock36xx.h" 29#include "clock36xx.h"
32#include "clock3517.h" 30#include "clock3517.h"
33#include "cm2xxx_3xxx.h" 31#include "cm3xxx.h"
34#include "cm-regbits-34xx.h" 32#include "cm-regbits-34xx.h"
35#include "prm2xxx_3xxx.h" 33#include "prm2xxx_3xxx.h"
36#include "prm-regbits-34xx.h" 34#include "prm-regbits-34xx.h"
@@ -3573,8 +3571,6 @@ int __init omap3xxx_clk_init(void)
3573 else 3571 else
3574 dpll4_dd = dpll4_dd_34xx; 3572 dpll4_dd = dpll4_dd_34xx;
3575 3573
3576 clk_init(&omap2_clk_functions);
3577
3578 for (c = omap3xxx_clks; c < omap3xxx_clks + ARRAY_SIZE(omap3xxx_clks); 3574 for (c = omap3xxx_clks; c < omap3xxx_clks + ARRAY_SIZE(omap3xxx_clks);
3579 c++) 3575 c++)
3580 clk_preinit(c->lk.clk); 3576 clk_preinit(c->lk.clk);
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 6efc30c961a5..2a450c9b9a7b 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -28,8 +28,6 @@
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/io.h> 29#include <linux/io.h>
30 30
31#include <plat/clkdev_omap.h>
32
33#include "soc.h" 31#include "soc.h"
34#include "iomap.h" 32#include "iomap.h"
35#include "clock.h" 33#include "clock.h"
@@ -3366,8 +3364,6 @@ int __init omap4xxx_clk_init(void)
3366 return 0; 3364 return 0;
3367 } 3365 }
3368 3366
3369 clk_init(&omap2_clk_functions);
3370
3371 /* 3367 /*
3372 * Must stay commented until all OMAP SoC drivers are 3368 * Must stay commented until all OMAP SoC drivers are
3373 * converted to runtime PM, or drivers may start crashing 3369 * converted to runtime PM, or drivers may start crashing
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 512e79a842cb..64e50465a4b5 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -27,7 +27,8 @@
27 27
28#include <linux/bitops.h> 28#include <linux/bitops.h>
29 29
30#include <plat/clock.h> 30#include "soc.h"
31#include "clock.h"
31#include "clockdomain.h" 32#include "clockdomain.h"
32 33
33/* clkdm_list contains all registered struct clockdomains */ 34/* clkdm_list contains all registered struct clockdomains */
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index 629576be7444..bc42446e23ab 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -18,9 +18,8 @@
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19 19
20#include "powerdomain.h" 20#include "powerdomain.h"
21#include <plat/clock.h> 21#include "clock.h"
22#include <plat/omap_hwmod.h> 22#include "omap_hwmod.h"
23#include <plat/cpu.h>
24 23
25/* 24/*
26 * Clockdomain flags 25 * Clockdomain flags
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
deleted file mode 100644
index 70294f54e35a..000000000000
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ /dev/null
@@ -1,339 +0,0 @@
1/*
2 * OMAP2 and OMAP3 clockdomain control
3 *
4 * Copyright (C) 2008-2010 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Derived from mach-omap2/clockdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/types.h>
16#include <plat/prcm.h>
17#include "prm.h"
18#include "prm2xxx_3xxx.h"
19#include "cm.h"
20#include "cm2xxx_3xxx.h"
21#include "cm-regbits-24xx.h"
22#include "cm-regbits-34xx.h"
23#include "prm-regbits-24xx.h"
24#include "clockdomain.h"
25
26static int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1,
27 struct clockdomain *clkdm2)
28{
29 omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit),
30 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
31 return 0;
32}
33
34static int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1,
35 struct clockdomain *clkdm2)
36{
37 omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
38 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
39 return 0;
40}
41
42static int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1,
43 struct clockdomain *clkdm2)
44{
45 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
46 PM_WKDEP, (1 << clkdm2->dep_bit));
47}
48
49static int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
50{
51 struct clkdm_dep *cd;
52 u32 mask = 0;
53
54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
55 if (!cd->clkdm)
56 continue; /* only happens if data is erroneous */
57
58 /* PRM accesses are slow, so minimize them */
59 mask |= 1 << cd->clkdm->dep_bit;
60 atomic_set(&cd->wkdep_usecount, 0);
61 }
62
63 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
64 PM_WKDEP);
65 return 0;
66}
67
68static int omap3_clkdm_add_sleepdep(struct clockdomain *clkdm1,
69 struct clockdomain *clkdm2)
70{
71 omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit),
72 clkdm1->pwrdm.ptr->prcm_offs,
73 OMAP3430_CM_SLEEPDEP);
74 return 0;
75}
76
77static int omap3_clkdm_del_sleepdep(struct clockdomain *clkdm1,
78 struct clockdomain *clkdm2)
79{
80 omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
81 clkdm1->pwrdm.ptr->prcm_offs,
82 OMAP3430_CM_SLEEPDEP);
83 return 0;
84}
85
86static int omap3_clkdm_read_sleepdep(struct clockdomain *clkdm1,
87 struct clockdomain *clkdm2)
88{
89 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
90 OMAP3430_CM_SLEEPDEP, (1 << clkdm2->dep_bit));
91}
92
93static int omap3_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
94{
95 struct clkdm_dep *cd;
96 u32 mask = 0;
97
98 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) {
99 if (!cd->clkdm)
100 continue; /* only happens if data is erroneous */
101
102 /* PRM accesses are slow, so minimize them */
103 mask |= 1 << cd->clkdm->dep_bit;
104 atomic_set(&cd->sleepdep_usecount, 0);
105 }
106 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
107 OMAP3430_CM_SLEEPDEP);
108 return 0;
109}
110
111static int omap2_clkdm_sleep(struct clockdomain *clkdm)
112{
113 omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
114 clkdm->pwrdm.ptr->prcm_offs,
115 OMAP2_PM_PWSTCTRL);
116 return 0;
117}
118
119static int omap2_clkdm_wakeup(struct clockdomain *clkdm)
120{
121 omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
122 clkdm->pwrdm.ptr->prcm_offs,
123 OMAP2_PM_PWSTCTRL);
124 return 0;
125}
126
127static void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
128{
129 if (atomic_read(&clkdm->usecount) > 0)
130 _clkdm_add_autodeps(clkdm);
131
132 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
133 clkdm->clktrctrl_mask);
134}
135
136static void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
137{
138 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
139 clkdm->clktrctrl_mask);
140
141 if (atomic_read(&clkdm->usecount) > 0)
142 _clkdm_del_autodeps(clkdm);
143}
144
145static void _enable_hwsup(struct clockdomain *clkdm)
146{
147 if (cpu_is_omap24xx())
148 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
149 clkdm->clktrctrl_mask);
150 else if (cpu_is_omap34xx())
151 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
152 clkdm->clktrctrl_mask);
153}
154
155static void _disable_hwsup(struct clockdomain *clkdm)
156{
157 if (cpu_is_omap24xx())
158 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
159 clkdm->clktrctrl_mask);
160 else if (cpu_is_omap34xx())
161 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
162 clkdm->clktrctrl_mask);
163}
164
165static int omap3_clkdm_sleep(struct clockdomain *clkdm)
166{
167 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
168 clkdm->clktrctrl_mask);
169 return 0;
170}
171
172static int omap3_clkdm_wakeup(struct clockdomain *clkdm)
173{
174 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
175 clkdm->clktrctrl_mask);
176 return 0;
177}
178
179static int omap2_clkdm_clk_enable(struct clockdomain *clkdm)
180{
181 bool hwsup = false;
182
183 if (!clkdm->clktrctrl_mask)
184 return 0;
185
186 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
187 clkdm->clktrctrl_mask);
188
189 if (hwsup) {
190 /* Disable HW transitions when we are changing deps */
191 _disable_hwsup(clkdm);
192 _clkdm_add_autodeps(clkdm);
193 _enable_hwsup(clkdm);
194 } else {
195 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
196 omap2_clkdm_wakeup(clkdm);
197 }
198
199 return 0;
200}
201
202static int omap2_clkdm_clk_disable(struct clockdomain *clkdm)
203{
204 bool hwsup = false;
205
206 if (!clkdm->clktrctrl_mask)
207 return 0;
208
209 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
210 clkdm->clktrctrl_mask);
211
212 if (hwsup) {
213 /* Disable HW transitions when we are changing deps */
214 _disable_hwsup(clkdm);
215 _clkdm_del_autodeps(clkdm);
216 _enable_hwsup(clkdm);
217 } else {
218 if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)
219 omap2_clkdm_sleep(clkdm);
220 }
221
222 return 0;
223}
224
225static void omap3_clkdm_allow_idle(struct clockdomain *clkdm)
226{
227 if (atomic_read(&clkdm->usecount) > 0)
228 _clkdm_add_autodeps(clkdm);
229
230 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
231 clkdm->clktrctrl_mask);
232}
233
234static void omap3_clkdm_deny_idle(struct clockdomain *clkdm)
235{
236 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
237 clkdm->clktrctrl_mask);
238
239 if (atomic_read(&clkdm->usecount) > 0)
240 _clkdm_del_autodeps(clkdm);
241}
242
243static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm)
244{
245 bool hwsup = false;
246
247 if (!clkdm->clktrctrl_mask)
248 return 0;
249
250 /*
251 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
252 * more details on the unpleasant problem this is working
253 * around
254 */
255 if ((clkdm->flags & CLKDM_MISSING_IDLE_REPORTING) &&
256 (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) {
257 omap3_clkdm_wakeup(clkdm);
258 return 0;
259 }
260
261 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
262 clkdm->clktrctrl_mask);
263
264 if (hwsup) {
265 /* Disable HW transitions when we are changing deps */
266 _disable_hwsup(clkdm);
267 _clkdm_add_autodeps(clkdm);
268 _enable_hwsup(clkdm);
269 } else {
270 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
271 omap3_clkdm_wakeup(clkdm);
272 }
273
274 return 0;
275}
276
277static int omap3xxx_clkdm_clk_disable(struct clockdomain *clkdm)
278{
279 bool hwsup = false;
280
281 if (!clkdm->clktrctrl_mask)
282 return 0;
283
284 /*
285 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
286 * more details on the unpleasant problem this is working
287 * around
288 */
289 if (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING &&
290 !(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) {
291 _enable_hwsup(clkdm);
292 return 0;
293 }
294
295 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
296 clkdm->clktrctrl_mask);
297
298 if (hwsup) {
299 /* Disable HW transitions when we are changing deps */
300 _disable_hwsup(clkdm);
301 _clkdm_del_autodeps(clkdm);
302 _enable_hwsup(clkdm);
303 } else {
304 if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)
305 omap3_clkdm_sleep(clkdm);
306 }
307
308 return 0;
309}
310
311struct clkdm_ops omap2_clkdm_operations = {
312 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
313 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
314 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
315 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
316 .clkdm_sleep = omap2_clkdm_sleep,
317 .clkdm_wakeup = omap2_clkdm_wakeup,
318 .clkdm_allow_idle = omap2_clkdm_allow_idle,
319 .clkdm_deny_idle = omap2_clkdm_deny_idle,
320 .clkdm_clk_enable = omap2_clkdm_clk_enable,
321 .clkdm_clk_disable = omap2_clkdm_clk_disable,
322};
323
324struct clkdm_ops omap3_clkdm_operations = {
325 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
326 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
327 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
328 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
329 .clkdm_add_sleepdep = omap3_clkdm_add_sleepdep,
330 .clkdm_del_sleepdep = omap3_clkdm_del_sleepdep,
331 .clkdm_read_sleepdep = omap3_clkdm_read_sleepdep,
332 .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps,
333 .clkdm_sleep = omap3_clkdm_sleep,
334 .clkdm_wakeup = omap3_clkdm_wakeup,
335 .clkdm_allow_idle = omap3_clkdm_allow_idle,
336 .clkdm_deny_idle = omap3_clkdm_deny_idle,
337 .clkdm_clk_enable = omap3xxx_clkdm_clk_enable,
338 .clkdm_clk_disable = omap3xxx_clkdm_clk_disable,
339};
diff --git a/arch/arm/mach-omap2/clockdomain33xx.c b/arch/arm/mach-omap2/clockdomain33xx.c
deleted file mode 100644
index aca6388fad76..000000000000
--- a/arch/arm/mach-omap2/clockdomain33xx.c
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * AM33XX clockdomain control
3 *
4 * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
5 * Vaibhav Hiremath <hvaibhav@ti.com>
6 *
7 * Derived from mach-omap2/clockdomain44xx.c written by Rajendra Nayak
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/kernel.h>
20
21#include "clockdomain.h"
22#include "cm33xx.h"
23
24
25static int am33xx_clkdm_sleep(struct clockdomain *clkdm)
26{
27 am33xx_cm_clkdm_force_sleep(clkdm->cm_inst, clkdm->clkdm_offs);
28 return 0;
29}
30
31static int am33xx_clkdm_wakeup(struct clockdomain *clkdm)
32{
33 am33xx_cm_clkdm_force_wakeup(clkdm->cm_inst, clkdm->clkdm_offs);
34 return 0;
35}
36
37static void am33xx_clkdm_allow_idle(struct clockdomain *clkdm)
38{
39 am33xx_cm_clkdm_enable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
40}
41
42static void am33xx_clkdm_deny_idle(struct clockdomain *clkdm)
43{
44 am33xx_cm_clkdm_disable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
45}
46
47static int am33xx_clkdm_clk_enable(struct clockdomain *clkdm)
48{
49 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
50 return am33xx_clkdm_wakeup(clkdm);
51
52 return 0;
53}
54
55static int am33xx_clkdm_clk_disable(struct clockdomain *clkdm)
56{
57 bool hwsup = false;
58
59 hwsup = am33xx_cm_is_clkdm_in_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
60
61 if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP))
62 am33xx_clkdm_sleep(clkdm);
63
64 return 0;
65}
66
67struct clkdm_ops am33xx_clkdm_operations = {
68 .clkdm_sleep = am33xx_clkdm_sleep,
69 .clkdm_wakeup = am33xx_clkdm_wakeup,
70 .clkdm_allow_idle = am33xx_clkdm_allow_idle,
71 .clkdm_deny_idle = am33xx_clkdm_deny_idle,
72 .clkdm_clk_enable = am33xx_clkdm_clk_enable,
73 .clkdm_clk_disable = am33xx_clkdm_clk_disable,
74};
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c
deleted file mode 100644
index 6fc6155625bc..000000000000
--- a/arch/arm/mach-omap2/clockdomain44xx.c
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 * OMAP4 clockdomain control
3 *
4 * Copyright (C) 2008-2010 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Derived from mach-omap2/clockdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include "clockdomain.h"
17#include "cminst44xx.h"
18#include "cm44xx.h"
19
20static int omap4_clkdm_add_wkup_sleep_dep(struct clockdomain *clkdm1,
21 struct clockdomain *clkdm2)
22{
23 omap4_cminst_set_inst_reg_bits((1 << clkdm2->dep_bit),
24 clkdm1->prcm_partition,
25 clkdm1->cm_inst, clkdm1->clkdm_offs +
26 OMAP4_CM_STATICDEP);
27 return 0;
28}
29
30static int omap4_clkdm_del_wkup_sleep_dep(struct clockdomain *clkdm1,
31 struct clockdomain *clkdm2)
32{
33 omap4_cminst_clear_inst_reg_bits((1 << clkdm2->dep_bit),
34 clkdm1->prcm_partition,
35 clkdm1->cm_inst, clkdm1->clkdm_offs +
36 OMAP4_CM_STATICDEP);
37 return 0;
38}
39
40static int omap4_clkdm_read_wkup_sleep_dep(struct clockdomain *clkdm1,
41 struct clockdomain *clkdm2)
42{
43 return omap4_cminst_read_inst_reg_bits(clkdm1->prcm_partition,
44 clkdm1->cm_inst, clkdm1->clkdm_offs +
45 OMAP4_CM_STATICDEP,
46 (1 << clkdm2->dep_bit));
47}
48
49static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)
50{
51 struct clkdm_dep *cd;
52 u32 mask = 0;
53
54 if (!clkdm->prcm_partition)
55 return 0;
56
57 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
58 if (!cd->clkdm)
59 continue; /* only happens if data is erroneous */
60
61 mask |= 1 << cd->clkdm->dep_bit;
62 atomic_set(&cd->wkdep_usecount, 0);
63 }
64
65 omap4_cminst_clear_inst_reg_bits(mask, clkdm->prcm_partition,
66 clkdm->cm_inst, clkdm->clkdm_offs +
67 OMAP4_CM_STATICDEP);
68 return 0;
69}
70
71static int omap4_clkdm_sleep(struct clockdomain *clkdm)
72{
73 omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
74 clkdm->cm_inst, clkdm->clkdm_offs);
75 return 0;
76}
77
78static int omap4_clkdm_wakeup(struct clockdomain *clkdm)
79{
80 omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition,
81 clkdm->cm_inst, clkdm->clkdm_offs);
82 return 0;
83}
84
85static void omap4_clkdm_allow_idle(struct clockdomain *clkdm)
86{
87 omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
88 clkdm->cm_inst, clkdm->clkdm_offs);
89}
90
91static void omap4_clkdm_deny_idle(struct clockdomain *clkdm)
92{
93 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
94 omap4_clkdm_wakeup(clkdm);
95 else
96 omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition,
97 clkdm->cm_inst,
98 clkdm->clkdm_offs);
99}
100
101static int omap4_clkdm_clk_enable(struct clockdomain *clkdm)
102{
103 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
104 return omap4_clkdm_wakeup(clkdm);
105
106 return 0;
107}
108
109static int omap4_clkdm_clk_disable(struct clockdomain *clkdm)
110{
111 bool hwsup = false;
112
113 if (!clkdm->prcm_partition)
114 return 0;
115
116 /*
117 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
118 * more details on the unpleasant problem this is working
119 * around
120 */
121 if (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING &&
122 !(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) {
123 omap4_clkdm_allow_idle(clkdm);
124 return 0;
125 }
126
127 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
128 clkdm->cm_inst, clkdm->clkdm_offs);
129
130 if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP))
131 omap4_clkdm_sleep(clkdm);
132
133 return 0;
134}
135
136struct clkdm_ops omap4_clkdm_operations = {
137 .clkdm_add_wkdep = omap4_clkdm_add_wkup_sleep_dep,
138 .clkdm_del_wkdep = omap4_clkdm_del_wkup_sleep_dep,
139 .clkdm_read_wkdep = omap4_clkdm_read_wkup_sleep_dep,
140 .clkdm_clear_all_wkdeps = omap4_clkdm_clear_all_wkup_sleep_deps,
141 .clkdm_add_sleepdep = omap4_clkdm_add_wkup_sleep_dep,
142 .clkdm_del_sleepdep = omap4_clkdm_del_wkup_sleep_dep,
143 .clkdm_read_sleepdep = omap4_clkdm_read_wkup_sleep_dep,
144 .clkdm_clear_all_sleepdeps = omap4_clkdm_clear_all_wkup_sleep_deps,
145 .clkdm_sleep = omap4_clkdm_sleep,
146 .clkdm_wakeup = omap4_clkdm_wakeup,
147 .clkdm_allow_idle = omap4_clkdm_allow_idle,
148 .clkdm_deny_idle = omap4_clkdm_deny_idle,
149 .clkdm_clk_enable = omap4_clkdm_clk_enable,
150 .clkdm_clk_disable = omap4_clkdm_clk_disable,
151};
diff --git a/arch/arm/mach-omap2/clockdomains2420_data.c b/arch/arm/mach-omap2/clockdomains2420_data.c
index 5c741852fac0..7e76becf3a4a 100644
--- a/arch/arm/mach-omap2/clockdomains2420_data.c
+++ b/arch/arm/mach-omap2/clockdomains2420_data.c
@@ -35,6 +35,7 @@
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/io.h> 36#include <linux/io.h>
37 37
38#include "soc.h"
38#include "clockdomain.h" 39#include "clockdomain.h"
39#include "prm2xxx_3xxx.h" 40#include "prm2xxx_3xxx.h"
40#include "cm2xxx_3xxx.h" 41#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/clockdomains2430_data.c b/arch/arm/mach-omap2/clockdomains2430_data.c
index f09617555e15..b923007e45d0 100644
--- a/arch/arm/mach-omap2/clockdomains2430_data.c
+++ b/arch/arm/mach-omap2/clockdomains2430_data.c
@@ -35,6 +35,7 @@
35#include <linux/kernel.h> 35#include <linux/kernel.h>
36#include <linux/io.h> 36#include <linux/io.h>
37 37
38#include "soc.h"
38#include "clockdomain.h" 39#include "clockdomain.h"
39#include "prm2xxx_3xxx.h" 40#include "prm2xxx_3xxx.h"
40#include "cm2xxx_3xxx.h" 41#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/clockdomains3xxx_data.c b/arch/arm/mach-omap2/clockdomains3xxx_data.c
index 933a35cd124a..e6b91e552d3d 100644
--- a/arch/arm/mach-omap2/clockdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/clockdomains3xxx_data.c
@@ -33,6 +33,7 @@
33#include <linux/kernel.h> 33#include <linux/kernel.h>
34#include <linux/io.h> 34#include <linux/io.h>
35 35
36#include "soc.h"
36#include "clockdomain.h" 37#include "clockdomain.h"
37#include "prm2xxx_3xxx.h" 38#include "prm2xxx_3xxx.h"
38#include "cm2xxx_3xxx.h" 39#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h
index 686290437568..11eaf16880c4 100644
--- a/arch/arm/mach-omap2/cm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-24xx.h
@@ -333,7 +333,9 @@
333#define OMAP24XX_EN_DPLL_MASK (0x3 << 0) 333#define OMAP24XX_EN_DPLL_MASK (0x3 << 0)
334 334
335/* CM_IDLEST_CKGEN */ 335/* CM_IDLEST_CKGEN */
336#define OMAP24XX_ST_54M_APLL_SHIFT 9
336#define OMAP24XX_ST_54M_APLL_MASK (1 << 9) 337#define OMAP24XX_ST_54M_APLL_MASK (1 << 9)
338#define OMAP24XX_ST_96M_APLL_SHIFT 8
337#define OMAP24XX_ST_96M_APLL_MASK (1 << 8) 339#define OMAP24XX_ST_96M_APLL_MASK (1 << 8)
338#define OMAP24XX_ST_54M_CLK_MASK (1 << 6) 340#define OMAP24XX_ST_54M_CLK_MASK (1 << 6)
339#define OMAP24XX_ST_12M_CLK_MASK (1 << 5) 341#define OMAP24XX_ST_12M_CLK_MASK (1 << 5)
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index f24e3f7a2bbc..93473f9a551c 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2+ Clock Management prototypes 2 * OMAP2+ Clock Management prototypes
3 * 3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2009 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley
@@ -22,6 +22,12 @@
22 */ 22 */
23#define MAX_MODULE_READY_TIME 2000 23#define MAX_MODULE_READY_TIME 2000
24 24
25# ifndef __ASSEMBLER__
26extern void __iomem *cm_base;
27extern void __iomem *cm2_base;
28extern void omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2);
29# endif
30
25/* 31/*
26 * MAX_MODULE_DISABLE_TIME: max duration in microseconds to wait for 32 * MAX_MODULE_DISABLE_TIME: max duration in microseconds to wait for
27 * the PRCM to request that a module enter the inactive state in the 33 * the PRCM to request that a module enter the inactive state in the
@@ -33,4 +39,26 @@
33 */ 39 */
34#define MAX_MODULE_DISABLE_TIME 5000 40#define MAX_MODULE_DISABLE_TIME 5000
35 41
42# ifndef __ASSEMBLER__
43
44/**
45 * struct cm_ll_data - fn ptrs to per-SoC CM function implementations
46 * @split_idlest_reg: ptr to the SoC CM-specific split_idlest_reg impl
47 * @wait_module_ready: ptr to the SoC CM-specific wait_module_ready impl
48 */
49struct cm_ll_data {
50 int (*split_idlest_reg)(void __iomem *idlest_reg, s16 *prcm_inst,
51 u8 *idlest_reg_id);
52 int (*wait_module_ready)(s16 prcm_mod, u8 idlest_id, u8 idlest_shift);
53};
54
55extern int cm_split_idlest_reg(void __iomem *idlest_reg, s16 *prcm_inst,
56 u8 *idlest_reg_id);
57extern int cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift);
58
59extern int cm_register(struct cm_ll_data *cld);
60extern int cm_unregister(struct cm_ll_data *cld);
61
62# endif
63
36#endif 64#endif
diff --git a/arch/arm/mach-omap2/cm2xxx.c b/arch/arm/mach-omap2/cm2xxx.c
new file mode 100644
index 000000000000..db650690e9d0
--- /dev/null
+++ b/arch/arm/mach-omap2/cm2xxx.c
@@ -0,0 +1,381 @@
1/*
2 * OMAP2xxx CM module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Copyright (C) 2008-2010, 2012 Texas Instruments, Inc.
6 * Paul Walmsley
7 * Rajendra Nayak <rnayak@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <linux/delay.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/io.h>
20
21#include "soc.h"
22#include "iomap.h"
23#include "common.h"
24#include "prm2xxx.h"
25#include "cm.h"
26#include "cm2xxx.h"
27#include "cm-regbits-24xx.h"
28#include "clockdomain.h"
29
30/* CM_AUTOIDLE_PLL.AUTO_* bit values for DPLLs */
31#define DPLL_AUTOIDLE_DISABLE 0x0
32#define OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP 0x3
33
34/* CM_AUTOIDLE_PLL.AUTO_* bit values for APLLs (OMAP2xxx only) */
35#define OMAP2XXX_APLL_AUTOIDLE_DISABLE 0x0
36#define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3
37
38/* CM_IDLEST_PLL bit value offset for APLLs (OMAP2xxx only) */
39#define EN_APLL_LOCKED 3
40
41static const u8 omap2xxx_cm_idlest_offs[] = {
42 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3, OMAP24XX_CM_IDLEST4
43};
44
45/*
46 *
47 */
48
49static void _write_clktrctrl(u8 c, s16 module, u32 mask)
50{
51 u32 v;
52
53 v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL);
54 v &= ~mask;
55 v |= c << __ffs(mask);
56 omap2_cm_write_mod_reg(v, module, OMAP2_CM_CLKSTCTRL);
57}
58
59bool omap2xxx_cm_is_clkdm_in_hwsup(s16 module, u32 mask)
60{
61 u32 v;
62
63 v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL);
64 v &= mask;
65 v >>= __ffs(mask);
66
67 return (v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0;
68}
69
70void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask)
71{
72 _write_clktrctrl(OMAP24XX_CLKSTCTRL_ENABLE_AUTO, module, mask);
73}
74
75void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask)
76{
77 _write_clktrctrl(OMAP24XX_CLKSTCTRL_DISABLE_AUTO, module, mask);
78}
79
80/*
81 * DPLL autoidle control
82 */
83
84static void _omap2xxx_set_dpll_autoidle(u8 m)
85{
86 u32 v;
87
88 v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
89 v &= ~OMAP24XX_AUTO_DPLL_MASK;
90 v |= m << OMAP24XX_AUTO_DPLL_SHIFT;
91 omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE);
92}
93
94void omap2xxx_cm_set_dpll_disable_autoidle(void)
95{
96 _omap2xxx_set_dpll_autoidle(OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP);
97}
98
99void omap2xxx_cm_set_dpll_auto_low_power_stop(void)
100{
101 _omap2xxx_set_dpll_autoidle(DPLL_AUTOIDLE_DISABLE);
102}
103
104/*
105 * APLL control
106 */
107
108static void _omap2xxx_set_apll_autoidle(u8 m, u32 mask)
109{
110 u32 v;
111
112 v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
113 v &= ~mask;
114 v |= m << __ffs(mask);
115 omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE);
116}
117
118void omap2xxx_cm_set_apll54_disable_autoidle(void)
119{
120 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP,
121 OMAP24XX_AUTO_54M_MASK);
122}
123
124void omap2xxx_cm_set_apll54_auto_low_power_stop(void)
125{
126 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE,
127 OMAP24XX_AUTO_54M_MASK);
128}
129
130void omap2xxx_cm_set_apll96_disable_autoidle(void)
131{
132 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP,
133 OMAP24XX_AUTO_96M_MASK);
134}
135
136void omap2xxx_cm_set_apll96_auto_low_power_stop(void)
137{
138 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE,
139 OMAP24XX_AUTO_96M_MASK);
140}
141
142/* Enable an APLL if off */
143static int _omap2xxx_apll_enable(u8 enable_bit, u8 status_bit)
144{
145 u32 v, m;
146
147 m = EN_APLL_LOCKED << enable_bit;
148
149 v = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
150 if (v & m)
151 return 0; /* apll already enabled */
152
153 v |= m;
154 omap2_cm_write_mod_reg(v, PLL_MOD, CM_CLKEN);
155
156 omap2xxx_cm_wait_module_ready(PLL_MOD, 1, status_bit);
157
158 /*
159 * REVISIT: Should we return an error code if
160 * omap2xxx_cm_wait_module_ready() fails?
161 */
162 return 0;
163}
164
165/* Stop APLL */
166static void _omap2xxx_apll_disable(u8 enable_bit)
167{
168 u32 v;
169
170 v = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
171 v &= ~(EN_APLL_LOCKED << enable_bit);
172 omap2_cm_write_mod_reg(v, PLL_MOD, CM_CLKEN);
173}
174
175/* Enable an APLL if off */
176int omap2xxx_cm_apll54_enable(void)
177{
178 return _omap2xxx_apll_enable(OMAP24XX_EN_54M_PLL_SHIFT,
179 OMAP24XX_ST_54M_APLL_SHIFT);
180}
181
182/* Enable an APLL if off */
183int omap2xxx_cm_apll96_enable(void)
184{
185 return _omap2xxx_apll_enable(OMAP24XX_EN_96M_PLL_SHIFT,
186 OMAP24XX_ST_96M_APLL_SHIFT);
187}
188
189/* Stop APLL */
190void omap2xxx_cm_apll54_disable(void)
191{
192 _omap2xxx_apll_disable(OMAP24XX_EN_54M_PLL_SHIFT);
193}
194
195/* Stop APLL */
196void omap2xxx_cm_apll96_disable(void)
197{
198 _omap2xxx_apll_disable(OMAP24XX_EN_96M_PLL_SHIFT);
199}
200
201/**
202 * omap2xxx_cm_split_idlest_reg - split CM_IDLEST reg addr into its components
203 * @idlest_reg: CM_IDLEST* virtual address
204 * @prcm_inst: pointer to an s16 to return the PRCM instance offset
205 * @idlest_reg_id: pointer to a u8 to return the CM_IDLESTx register ID
206 *
207 * XXX This function is only needed until absolute register addresses are
208 * removed from the OMAP struct clk records.
209 */
210int omap2xxx_cm_split_idlest_reg(void __iomem *idlest_reg, s16 *prcm_inst,
211 u8 *idlest_reg_id)
212{
213 unsigned long offs;
214 u8 idlest_offs;
215 int i;
216
217 if (idlest_reg < cm_base || idlest_reg > (cm_base + 0x0fff))
218 return -EINVAL;
219
220 idlest_offs = (unsigned long)idlest_reg & 0xff;
221 for (i = 0; i < ARRAY_SIZE(omap2xxx_cm_idlest_offs); i++) {
222 if (idlest_offs == omap2xxx_cm_idlest_offs[i]) {
223 *idlest_reg_id = i + 1;
224 break;
225 }
226 }
227
228 if (i == ARRAY_SIZE(omap2xxx_cm_idlest_offs))
229 return -EINVAL;
230
231 offs = idlest_reg - cm_base;
232 offs &= 0xff00;
233 *prcm_inst = offs;
234
235 return 0;
236}
237
238/*
239 *
240 */
241
242/**
243 * omap2xxx_cm_wait_module_ready - wait for a module to leave idle or standby
244 * @prcm_mod: PRCM module offset
245 * @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3)
246 * @idlest_shift: shift of the bit in the CM_IDLEST* register to check
247 *
248 * Wait for the PRCM to indicate that the module identified by
249 * (@prcm_mod, @idlest_id, @idlest_shift) is clocked. Return 0 upon
250 * success or -EBUSY if the module doesn't enable in time.
251 */
252int omap2xxx_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
253{
254 int ena = 0, i = 0;
255 u8 cm_idlest_reg;
256 u32 mask;
257
258 if (!idlest_id || (idlest_id > ARRAY_SIZE(omap2xxx_cm_idlest_offs)))
259 return -EINVAL;
260
261 cm_idlest_reg = omap2xxx_cm_idlest_offs[idlest_id - 1];
262
263 mask = 1 << idlest_shift;
264 ena = mask;
265
266 omap_test_timeout(((omap2_cm_read_mod_reg(prcm_mod, cm_idlest_reg) &
267 mask) == ena), MAX_MODULE_READY_TIME, i);
268
269 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
270}
271
272/* Clockdomain low-level functions */
273
274static void omap2xxx_clkdm_allow_idle(struct clockdomain *clkdm)
275{
276 if (atomic_read(&clkdm->usecount) > 0)
277 _clkdm_add_autodeps(clkdm);
278
279 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
280 clkdm->clktrctrl_mask);
281}
282
283static void omap2xxx_clkdm_deny_idle(struct clockdomain *clkdm)
284{
285 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
286 clkdm->clktrctrl_mask);
287
288 if (atomic_read(&clkdm->usecount) > 0)
289 _clkdm_del_autodeps(clkdm);
290}
291
292static int omap2xxx_clkdm_clk_enable(struct clockdomain *clkdm)
293{
294 bool hwsup = false;
295
296 if (!clkdm->clktrctrl_mask)
297 return 0;
298
299 hwsup = omap2xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
300 clkdm->clktrctrl_mask);
301
302 if (hwsup) {
303 /* Disable HW transitions when we are changing deps */
304 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
305 clkdm->clktrctrl_mask);
306 _clkdm_add_autodeps(clkdm);
307 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
308 clkdm->clktrctrl_mask);
309 } else {
310 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
311 omap2xxx_clkdm_wakeup(clkdm);
312 }
313
314 return 0;
315}
316
317static int omap2xxx_clkdm_clk_disable(struct clockdomain *clkdm)
318{
319 bool hwsup = false;
320
321 if (!clkdm->clktrctrl_mask)
322 return 0;
323
324 hwsup = omap2xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
325 clkdm->clktrctrl_mask);
326
327 if (hwsup) {
328 /* Disable HW transitions when we are changing deps */
329 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
330 clkdm->clktrctrl_mask);
331 _clkdm_del_autodeps(clkdm);
332 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
333 clkdm->clktrctrl_mask);
334 } else {
335 if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)
336 omap2xxx_clkdm_sleep(clkdm);
337 }
338
339 return 0;
340}
341
342struct clkdm_ops omap2_clkdm_operations = {
343 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
344 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
345 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
346 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
347 .clkdm_sleep = omap2xxx_clkdm_sleep,
348 .clkdm_wakeup = omap2xxx_clkdm_wakeup,
349 .clkdm_allow_idle = omap2xxx_clkdm_allow_idle,
350 .clkdm_deny_idle = omap2xxx_clkdm_deny_idle,
351 .clkdm_clk_enable = omap2xxx_clkdm_clk_enable,
352 .clkdm_clk_disable = omap2xxx_clkdm_clk_disable,
353};
354
355/*
356 *
357 */
358
359static struct cm_ll_data omap2xxx_cm_ll_data = {
360 .split_idlest_reg = &omap2xxx_cm_split_idlest_reg,
361 .wait_module_ready = &omap2xxx_cm_wait_module_ready,
362};
363
364int __init omap2xxx_cm_init(void)
365{
366 if (!cpu_is_omap24xx())
367 return 0;
368
369 return cm_register(&omap2xxx_cm_ll_data);
370}
371
372static void __exit omap2xxx_cm_exit(void)
373{
374 if (!cpu_is_omap24xx())
375 return;
376
377 /* Should never happen */
378 WARN(cm_unregister(&omap2xxx_cm_ll_data),
379 "%s: cm_ll_data function pointer mismatch\n", __func__);
380}
381__exitcall(omap2xxx_cm_exit);
diff --git a/arch/arm/mach-omap2/cm2xxx.h b/arch/arm/mach-omap2/cm2xxx.h
new file mode 100644
index 000000000000..4cbb39b051d2
--- /dev/null
+++ b/arch/arm/mach-omap2/cm2xxx.h
@@ -0,0 +1,70 @@
1/*
2 * OMAP2xxx Clock Management (CM) register definitions
3 *
4 * Copyright (C) 2007-2009, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation
6 * Paul Walmsley
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 * The CM hardware modules on the OMAP2/3 are quite similar to each
13 * other. The CM modules/instances on OMAP4 are quite different, so
14 * they are handled in a separate file.
15 */
16#ifndef __ARCH_ASM_MACH_OMAP2_CM2XXX_H
17#define __ARCH_ASM_MACH_OMAP2_CM2XXX_H
18
19#include "prcm-common.h"
20#include "cm2xxx_3xxx.h"
21
22#define OMAP2420_CM_REGADDR(module, reg) \
23 OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
24#define OMAP2430_CM_REGADDR(module, reg) \
25 OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
26
27/*
28 * Module specific CM register offsets from CM_BASE + domain offset
29 * Use cm_{read,write}_mod_reg() with these registers.
30 * These register offsets generally appear in more than one PRCM submodule.
31 */
32
33/* OMAP2-specific register offsets */
34
35#define OMAP24XX_CM_FCLKEN2 0x0004
36#define OMAP24XX_CM_ICLKEN4 0x001c
37#define OMAP24XX_CM_AUTOIDLE4 0x003c
38#define OMAP24XX_CM_IDLEST4 0x002c
39
40/* CM_IDLEST bit field values to indicate deasserted IdleReq */
41
42#define OMAP24XX_CM_IDLEST_VAL 0
43
44
45/* Clock management domain register get/set */
46
47#ifndef __ASSEMBLER__
48
49extern void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask);
50extern void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
51
52extern void omap2xxx_cm_set_dpll_disable_autoidle(void);
53extern void omap2xxx_cm_set_dpll_auto_low_power_stop(void);
54
55extern void omap2xxx_cm_set_apll54_disable_autoidle(void);
56extern void omap2xxx_cm_set_apll54_auto_low_power_stop(void);
57extern void omap2xxx_cm_set_apll96_disable_autoidle(void);
58extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void);
59
60extern bool omap2xxx_cm_is_clkdm_in_hwsup(s16 module, u32 mask);
61extern int omap2xxx_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id,
62 u8 idlest_shift);
63extern int omap2xxx_cm_split_idlest_reg(void __iomem *idlest_reg,
64 s16 *prcm_inst, u8 *idlest_reg_id);
65
66extern int __init omap2xxx_cm_init(void);
67
68#endif
69
70#endif
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h
index 57b2f3c2fbf3..98e6b3c9cd9b 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -16,28 +16,7 @@
16#ifndef __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H 16#ifndef __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H
17#define __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H 17#define __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H
18 18
19#include "prcm-common.h" 19#include "cm.h"
20
21#define OMAP2420_CM_REGADDR(module, reg) \
22 OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
23#define OMAP2430_CM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
25#define OMAP34XX_CM_REGADDR(module, reg) \
26 OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
27
28
29/*
30 * OMAP3-specific global CM registers
31 * Use cm_{read,write}_reg() with these registers.
32 * These registers appear once per CM module.
33 */
34
35#define OMAP3430_CM_REVISION OMAP34XX_CM_REGADDR(OCP_MOD, 0x0000)
36#define OMAP3430_CM_SYSCONFIG OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
37#define OMAP3430_CM_POLCTRL OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
38
39#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
40#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
41 20
42/* 21/*
43 * Module specific CM register offsets from CM_BASE + domain offset 22 * Module specific CM register offsets from CM_BASE + domain offset
@@ -57,6 +36,7 @@
57#define CM_IDLEST 0x0020 36#define CM_IDLEST 0x0020
58#define CM_IDLEST1 CM_IDLEST 37#define CM_IDLEST1 CM_IDLEST
59#define CM_IDLEST2 0x0024 38#define CM_IDLEST2 0x0024
39#define OMAP2430_CM_IDLEST3 0x0028
60#define CM_AUTOIDLE 0x0030 40#define CM_AUTOIDLE 0x0030
61#define CM_AUTOIDLE1 CM_AUTOIDLE 41#define CM_AUTOIDLE1 CM_AUTOIDLE
62#define CM_AUTOIDLE2 0x0034 42#define CM_AUTOIDLE2 0x0034
@@ -66,70 +46,60 @@
66#define CM_CLKSEL2 0x0044 46#define CM_CLKSEL2 0x0044
67#define OMAP2_CM_CLKSTCTRL 0x0048 47#define OMAP2_CM_CLKSTCTRL 0x0048
68 48
69/* OMAP2-specific register offsets */ 49#ifndef __ASSEMBLER__
70
71#define OMAP24XX_CM_FCLKEN2 0x0004
72#define OMAP24XX_CM_ICLKEN4 0x001c
73#define OMAP24XX_CM_AUTOIDLE4 0x003c
74#define OMAP24XX_CM_IDLEST4 0x002c
75
76#define OMAP2430_CM_IDLEST3 0x0028
77
78/* OMAP3-specific register offsets */
79
80#define OMAP3430_CM_CLKEN_PLL 0x0004
81#define OMAP3430ES2_CM_CLKEN2 0x0004
82#define OMAP3430ES2_CM_FCLKEN3 0x0008
83#define OMAP3430_CM_IDLEST_PLL CM_IDLEST2
84#define OMAP3430_CM_AUTOIDLE_PLL CM_AUTOIDLE2
85#define OMAP3430ES2_CM_AUTOIDLE2_PLL CM_AUTOIDLE2
86#define OMAP3430_CM_CLKSEL1 CM_CLKSEL
87#define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL
88#define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2
89#define OMAP3430_CM_SLEEPDEP CM_CLKSEL2
90#define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL
91#define OMAP3430_CM_CLKSTST 0x004c
92#define OMAP3430ES2_CM_CLKSEL4 0x004c
93#define OMAP3430ES2_CM_CLKSEL5 0x0050
94#define OMAP3430_CM_CLKSEL2_EMU 0x0050
95#define OMAP3430_CM_CLKSEL3_EMU 0x0054
96 50
51#include <linux/io.h>
97 52
98/* CM_IDLEST bit field values to indicate deasserted IdleReq */ 53static inline u32 omap2_cm_read_mod_reg(s16 module, u16 idx)
54{
55 return __raw_readl(cm_base + module + idx);
56}
99 57
100#define OMAP24XX_CM_IDLEST_VAL 0 58static inline void omap2_cm_write_mod_reg(u32 val, s16 module, u16 idx)
101#define OMAP34XX_CM_IDLEST_VAL 1 59{
60 __raw_writel(val, cm_base + module + idx);
61}
102 62
63/* Read-modify-write a register in a CM module. Caller must lock */
64static inline u32 omap2_cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module,
65 s16 idx)
66{
67 u32 v;
103 68
104/* Clock management domain register get/set */ 69 v = omap2_cm_read_mod_reg(module, idx);
70 v &= ~mask;
71 v |= bits;
72 omap2_cm_write_mod_reg(v, module, idx);
105 73
106#ifndef __ASSEMBLER__ 74 return v;
75}
107 76
108extern u32 omap2_cm_read_mod_reg(s16 module, u16 idx); 77/* Read a CM register, AND it, and shift the result down to bit 0 */
109extern void omap2_cm_write_mod_reg(u32 val, s16 module, u16 idx); 78static inline u32 omap2_cm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
110extern u32 omap2_cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx); 79{
80 u32 v;
111 81
112extern int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, 82 v = omap2_cm_read_mod_reg(domain, idx);
113 u8 idlest_shift); 83 v &= mask;
114extern u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx); 84 v >>= __ffs(mask);
115extern u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx);
116 85
117extern bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask); 86 return v;
118extern void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask); 87}
119extern void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
120 88
121extern void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask); 89static inline u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
122extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask); 90{
123extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask); 91 return omap2_cm_rmw_mod_reg_bits(bits, bits, module, idx);
124extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask); 92}
125 93
126extern void omap2xxx_cm_set_dpll_disable_autoidle(void); 94static inline u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
127extern void omap2xxx_cm_set_dpll_auto_low_power_stop(void); 95{
96 return omap2_cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
97}
128 98
129extern void omap2xxx_cm_set_apll54_disable_autoidle(void); 99extern int omap2xxx_cm_apll54_enable(void);
130extern void omap2xxx_cm_set_apll54_auto_low_power_stop(void); 100extern void omap2xxx_cm_apll54_disable(void);
131extern void omap2xxx_cm_set_apll96_disable_autoidle(void); 101extern int omap2xxx_cm_apll96_enable(void);
132extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void); 102extern void omap2xxx_cm_apll96_disable(void);
133 103
134#endif 104#endif
135 105
@@ -146,11 +116,4 @@ extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void);
146/* CM_IDLEST_GFX */ 116/* CM_IDLEST_GFX */
147#define OMAP_ST_GFX_MASK (1 << 0) 117#define OMAP_ST_GFX_MASK (1 << 0)
148 118
149
150/* Function prototypes */
151# ifndef __ASSEMBLER__
152extern void omap3_cm_save_context(void);
153extern void omap3_cm_restore_context(void);
154# endif
155
156#endif 119#endif
diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c
index 13f56eafef03..058ce3c0873e 100644
--- a/arch/arm/mach-omap2/cm33xx.c
+++ b/arch/arm/mach-omap2/cm33xx.c
@@ -22,8 +22,7 @@
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <plat/common.h> 25#include "clockdomain.h"
26
27#include "cm.h" 26#include "cm.h"
28#include "cm33xx.h" 27#include "cm33xx.h"
29#include "cm-regbits-34xx.h" 28#include "cm-regbits-34xx.h"
@@ -311,3 +310,58 @@ void am33xx_cm_module_disable(u16 inst, s16 cdoffs, u16 clkctrl_offs)
311 v &= ~AM33XX_MODULEMODE_MASK; 310 v &= ~AM33XX_MODULEMODE_MASK;
312 am33xx_cm_write_reg(v, inst, clkctrl_offs); 311 am33xx_cm_write_reg(v, inst, clkctrl_offs);
313} 312}
313
314/*
315 * Clockdomain low-level functions
316 */
317
318static int am33xx_clkdm_sleep(struct clockdomain *clkdm)
319{
320 am33xx_cm_clkdm_force_sleep(clkdm->cm_inst, clkdm->clkdm_offs);
321 return 0;
322}
323
324static int am33xx_clkdm_wakeup(struct clockdomain *clkdm)
325{
326 am33xx_cm_clkdm_force_wakeup(clkdm->cm_inst, clkdm->clkdm_offs);
327 return 0;
328}
329
330static void am33xx_clkdm_allow_idle(struct clockdomain *clkdm)
331{
332 am33xx_cm_clkdm_enable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
333}
334
335static void am33xx_clkdm_deny_idle(struct clockdomain *clkdm)
336{
337 am33xx_cm_clkdm_disable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
338}
339
340static int am33xx_clkdm_clk_enable(struct clockdomain *clkdm)
341{
342 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
343 return am33xx_clkdm_wakeup(clkdm);
344
345 return 0;
346}
347
348static int am33xx_clkdm_clk_disable(struct clockdomain *clkdm)
349{
350 bool hwsup = false;
351
352 hwsup = am33xx_cm_is_clkdm_in_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
353
354 if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP))
355 am33xx_clkdm_sleep(clkdm);
356
357 return 0;
358}
359
360struct clkdm_ops am33xx_clkdm_operations = {
361 .clkdm_sleep = am33xx_clkdm_sleep,
362 .clkdm_wakeup = am33xx_clkdm_wakeup,
363 .clkdm_allow_idle = am33xx_clkdm_allow_idle,
364 .clkdm_deny_idle = am33xx_clkdm_deny_idle,
365 .clkdm_clk_enable = am33xx_clkdm_clk_enable,
366 .clkdm_clk_disable = am33xx_clkdm_clk_disable,
367};
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm3xxx.c
index 7f07ab02a5b3..c2086f2e86b6 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/cm3xxx.c
@@ -1,8 +1,10 @@
1/* 1/*
2 * OMAP2/3 CM module functions 2 * OMAP3xxx CM module functions
3 * 3 *
4 * Copyright (C) 2009 Nokia Corporation 4 * Copyright (C) 2009 Nokia Corporation
5 * Copyright (C) 2008-2010, 2012 Texas Instruments, Inc.
5 * Paul Walmsley 6 * Paul Walmsley
7 * Rajendra Nayak <rnayak@ti.com>
6 * 8 *
7 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
@@ -12,8 +14,6 @@
12#include <linux/kernel.h> 14#include <linux/kernel.h>
13#include <linux/types.h> 15#include <linux/types.h>
14#include <linux/delay.h> 16#include <linux/delay.h>
15#include <linux/spinlock.h>
16#include <linux/list.h>
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
@@ -21,56 +21,16 @@
21#include "soc.h" 21#include "soc.h"
22#include "iomap.h" 22#include "iomap.h"
23#include "common.h" 23#include "common.h"
24#include "prm2xxx_3xxx.h"
24#include "cm.h" 25#include "cm.h"
25#include "cm2xxx_3xxx.h" 26#include "cm3xxx.h"
26#include "cm-regbits-24xx.h"
27#include "cm-regbits-34xx.h" 27#include "cm-regbits-34xx.h"
28#include "clockdomain.h"
28 29
29/* CM_AUTOIDLE_PLL.AUTO_* bit values for DPLLs */ 30static const u8 omap3xxx_cm_idlest_offs[] = {
30#define DPLL_AUTOIDLE_DISABLE 0x0 31 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
31#define OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP 0x3
32
33/* CM_AUTOIDLE_PLL.AUTO_* bit values for APLLs (OMAP2xxx only) */
34#define OMAP2XXX_APLL_AUTOIDLE_DISABLE 0x0
35#define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3
36
37static const u8 cm_idlest_offs[] = {
38 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3, OMAP24XX_CM_IDLEST4
39}; 32};
40 33
41u32 omap2_cm_read_mod_reg(s16 module, u16 idx)
42{
43 return __raw_readl(cm_base + module + idx);
44}
45
46void omap2_cm_write_mod_reg(u32 val, s16 module, u16 idx)
47{
48 __raw_writel(val, cm_base + module + idx);
49}
50
51/* Read-modify-write a register in a CM module. Caller must lock */
52u32 omap2_cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
53{
54 u32 v;
55
56 v = omap2_cm_read_mod_reg(module, idx);
57 v &= ~mask;
58 v |= bits;
59 omap2_cm_write_mod_reg(v, module, idx);
60
61 return v;
62}
63
64u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
65{
66 return omap2_cm_rmw_mod_reg_bits(bits, bits, module, idx);
67}
68
69u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
70{
71 return omap2_cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
72}
73
74/* 34/*
75 * 35 *
76 */ 36 */
@@ -85,33 +45,15 @@ static void _write_clktrctrl(u8 c, s16 module, u32 mask)
85 omap2_cm_write_mod_reg(v, module, OMAP2_CM_CLKSTCTRL); 45 omap2_cm_write_mod_reg(v, module, OMAP2_CM_CLKSTCTRL);
86} 46}
87 47
88bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask) 48bool omap3xxx_cm_is_clkdm_in_hwsup(s16 module, u32 mask)
89{ 49{
90 u32 v; 50 u32 v;
91 bool ret = 0;
92
93 BUG_ON(!cpu_is_omap24xx() && !cpu_is_omap34xx());
94 51
95 v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL); 52 v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL);
96 v &= mask; 53 v &= mask;
97 v >>= __ffs(mask); 54 v >>= __ffs(mask);
98 55
99 if (cpu_is_omap24xx()) 56 return (v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0;
100 ret = (v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0;
101 else
102 ret = (v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0;
103
104 return ret;
105}
106
107void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask)
108{
109 _write_clktrctrl(OMAP24XX_CLKSTCTRL_ENABLE_AUTO, module, mask);
110}
111
112void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask)
113{
114 _write_clktrctrl(OMAP24XX_CLKSTCTRL_DISABLE_AUTO, module, mask);
115} 57}
116 58
117void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask) 59void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask)
@@ -135,109 +77,247 @@ void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask)
135} 77}
136 78
137/* 79/*
138 * DPLL autoidle control 80 *
139 */ 81 */
140 82
141static void _omap2xxx_set_dpll_autoidle(u8 m) 83/**
84 * omap3xxx_cm_wait_module_ready - wait for a module to leave idle or standby
85 * @prcm_mod: PRCM module offset
86 * @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3)
87 * @idlest_shift: shift of the bit in the CM_IDLEST* register to check
88 *
89 * Wait for the PRCM to indicate that the module identified by
90 * (@prcm_mod, @idlest_id, @idlest_shift) is clocked. Return 0 upon
91 * success or -EBUSY if the module doesn't enable in time.
92 */
93int omap3xxx_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
142{ 94{
143 u32 v; 95 int ena = 0, i = 0;
96 u8 cm_idlest_reg;
97 u32 mask;
144 98
145 v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); 99 if (!idlest_id || (idlest_id > ARRAY_SIZE(omap3xxx_cm_idlest_offs)))
146 v &= ~OMAP24XX_AUTO_DPLL_MASK; 100 return -EINVAL;
147 v |= m << OMAP24XX_AUTO_DPLL_SHIFT;
148 omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE);
149}
150 101
151void omap2xxx_cm_set_dpll_disable_autoidle(void) 102 cm_idlest_reg = omap3xxx_cm_idlest_offs[idlest_id - 1];
152{ 103
153 _omap2xxx_set_dpll_autoidle(OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP); 104 mask = 1 << idlest_shift;
105 ena = 0;
106
107 omap_test_timeout(((omap2_cm_read_mod_reg(prcm_mod, cm_idlest_reg) &
108 mask) == ena), MAX_MODULE_READY_TIME, i);
109
110 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
154} 111}
155 112
156void omap2xxx_cm_set_dpll_auto_low_power_stop(void) 113/**
114 * omap3xxx_cm_split_idlest_reg - split CM_IDLEST reg addr into its components
115 * @idlest_reg: CM_IDLEST* virtual address
116 * @prcm_inst: pointer to an s16 to return the PRCM instance offset
117 * @idlest_reg_id: pointer to a u8 to return the CM_IDLESTx register ID
118 *
119 * XXX This function is only needed until absolute register addresses are
120 * removed from the OMAP struct clk records.
121 */
122int omap3xxx_cm_split_idlest_reg(void __iomem *idlest_reg, s16 *prcm_inst,
123 u8 *idlest_reg_id)
157{ 124{
158 _omap2xxx_set_dpll_autoidle(DPLL_AUTOIDLE_DISABLE); 125 unsigned long offs;
126 u8 idlest_offs;
127 int i;
128
129 if (idlest_reg < (cm_base + OMAP3430_IVA2_MOD) ||
130 idlest_reg > (cm_base + 0x1ffff))
131 return -EINVAL;
132
133 idlest_offs = (unsigned long)idlest_reg & 0xff;
134 for (i = 0; i < ARRAY_SIZE(omap3xxx_cm_idlest_offs); i++) {
135 if (idlest_offs == omap3xxx_cm_idlest_offs[i]) {
136 *idlest_reg_id = i + 1;
137 break;
138 }
139 }
140
141 if (i == ARRAY_SIZE(omap3xxx_cm_idlest_offs))
142 return -EINVAL;
143
144 offs = idlest_reg - cm_base;
145 offs &= 0xff00;
146 *prcm_inst = offs;
147
148 return 0;
159} 149}
160 150
161/* 151/* Clockdomain low-level operations */
162 * APLL autoidle control
163 */
164 152
165static void _omap2xxx_set_apll_autoidle(u8 m, u32 mask) 153static int omap3xxx_clkdm_add_sleepdep(struct clockdomain *clkdm1,
154 struct clockdomain *clkdm2)
166{ 155{
167 u32 v; 156 omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit),
157 clkdm1->pwrdm.ptr->prcm_offs,
158 OMAP3430_CM_SLEEPDEP);
159 return 0;
160}
168 161
169 v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); 162static int omap3xxx_clkdm_del_sleepdep(struct clockdomain *clkdm1,
170 v &= ~mask; 163 struct clockdomain *clkdm2)
171 v |= m << __ffs(mask); 164{
172 omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE); 165 omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
166 clkdm1->pwrdm.ptr->prcm_offs,
167 OMAP3430_CM_SLEEPDEP);
168 return 0;
173} 169}
174 170
175void omap2xxx_cm_set_apll54_disable_autoidle(void) 171static int omap3xxx_clkdm_read_sleepdep(struct clockdomain *clkdm1,
172 struct clockdomain *clkdm2)
176{ 173{
177 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP, 174 return omap2_cm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
178 OMAP24XX_AUTO_54M_MASK); 175 OMAP3430_CM_SLEEPDEP,
176 (1 << clkdm2->dep_bit));
179} 177}
180 178
181void omap2xxx_cm_set_apll54_auto_low_power_stop(void) 179static int omap3xxx_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
182{ 180{
183 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE, 181 struct clkdm_dep *cd;
184 OMAP24XX_AUTO_54M_MASK); 182 u32 mask = 0;
183
184 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) {
185 if (!cd->clkdm)
186 continue; /* only happens if data is erroneous */
187
188 mask |= 1 << cd->clkdm->dep_bit;
189 atomic_set(&cd->sleepdep_usecount, 0);
190 }
191 omap2_cm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
192 OMAP3430_CM_SLEEPDEP);
193 return 0;
185} 194}
186 195
187void omap2xxx_cm_set_apll96_disable_autoidle(void) 196static int omap3xxx_clkdm_sleep(struct clockdomain *clkdm)
188{ 197{
189 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP, 198 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
190 OMAP24XX_AUTO_96M_MASK); 199 clkdm->clktrctrl_mask);
200 return 0;
191} 201}
192 202
193void omap2xxx_cm_set_apll96_auto_low_power_stop(void) 203static int omap3xxx_clkdm_wakeup(struct clockdomain *clkdm)
194{ 204{
195 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE, 205 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
196 OMAP24XX_AUTO_96M_MASK); 206 clkdm->clktrctrl_mask);
207 return 0;
197} 208}
198 209
199/* 210static void omap3xxx_clkdm_allow_idle(struct clockdomain *clkdm)
200 * 211{
201 */ 212 if (atomic_read(&clkdm->usecount) > 0)
213 _clkdm_add_autodeps(clkdm);
202 214
203/** 215 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
204 * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby 216 clkdm->clktrctrl_mask);
205 * @prcm_mod: PRCM module offset 217}
206 * @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3) 218
207 * @idlest_shift: shift of the bit in the CM_IDLEST* register to check 219static void omap3xxx_clkdm_deny_idle(struct clockdomain *clkdm)
208 *
209 * XXX document
210 */
211int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
212{ 220{
213 int ena = 0, i = 0; 221 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
214 u8 cm_idlest_reg; 222 clkdm->clktrctrl_mask);
215 u32 mask;
216 223
217 if (!idlest_id || (idlest_id > ARRAY_SIZE(cm_idlest_offs))) 224 if (atomic_read(&clkdm->usecount) > 0)
218 return -EINVAL; 225 _clkdm_del_autodeps(clkdm);
226}
219 227
220 cm_idlest_reg = cm_idlest_offs[idlest_id - 1]; 228static int omap3xxx_clkdm_clk_enable(struct clockdomain *clkdm)
229{
230 bool hwsup = false;
221 231
222 mask = 1 << idlest_shift; 232 if (!clkdm->clktrctrl_mask)
233 return 0;
223 234
224 if (cpu_is_omap24xx()) 235 /*
225 ena = mask; 236 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
226 else if (cpu_is_omap34xx()) 237 * more details on the unpleasant problem this is working
227 ena = 0; 238 * around
228 else 239 */
229 BUG(); 240 if ((clkdm->flags & CLKDM_MISSING_IDLE_REPORTING) &&
241 (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) {
242 omap3xxx_clkdm_wakeup(clkdm);
243 return 0;
244 }
245
246 hwsup = omap3xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
247 clkdm->clktrctrl_mask);
248
249 if (hwsup) {
250 /* Disable HW transitions when we are changing deps */
251 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
252 clkdm->clktrctrl_mask);
253 _clkdm_add_autodeps(clkdm);
254 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
255 clkdm->clktrctrl_mask);
256 } else {
257 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
258 omap3xxx_clkdm_wakeup(clkdm);
259 }
260
261 return 0;
262}
230 263
231 omap_test_timeout(((omap2_cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena), 264static int omap3xxx_clkdm_clk_disable(struct clockdomain *clkdm)
232 MAX_MODULE_READY_TIME, i); 265{
266 bool hwsup = false;
233 267
234 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; 268 if (!clkdm->clktrctrl_mask)
269 return 0;
270
271 /*
272 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
273 * more details on the unpleasant problem this is working
274 * around
275 */
276 if (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING &&
277 !(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) {
278 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
279 clkdm->clktrctrl_mask);
280 return 0;
281 }
282
283 hwsup = omap3xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
284 clkdm->clktrctrl_mask);
285
286 if (hwsup) {
287 /* Disable HW transitions when we are changing deps */
288 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
289 clkdm->clktrctrl_mask);
290 _clkdm_del_autodeps(clkdm);
291 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
292 clkdm->clktrctrl_mask);
293 } else {
294 if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)
295 omap3xxx_clkdm_sleep(clkdm);
296 }
297
298 return 0;
235} 299}
236 300
301struct clkdm_ops omap3_clkdm_operations = {
302 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
303 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
304 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
305 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
306 .clkdm_add_sleepdep = omap3xxx_clkdm_add_sleepdep,
307 .clkdm_del_sleepdep = omap3xxx_clkdm_del_sleepdep,
308 .clkdm_read_sleepdep = omap3xxx_clkdm_read_sleepdep,
309 .clkdm_clear_all_sleepdeps = omap3xxx_clkdm_clear_all_sleepdeps,
310 .clkdm_sleep = omap3xxx_clkdm_sleep,
311 .clkdm_wakeup = omap3xxx_clkdm_wakeup,
312 .clkdm_allow_idle = omap3xxx_clkdm_allow_idle,
313 .clkdm_deny_idle = omap3xxx_clkdm_deny_idle,
314 .clkdm_clk_enable = omap3xxx_clkdm_clk_enable,
315 .clkdm_clk_disable = omap3xxx_clkdm_clk_disable,
316};
317
237/* 318/*
238 * Context save/restore code - OMAP3 only 319 * Context save/restore code - OMAP3 only
239 */ 320 */
240#ifdef CONFIG_ARCH_OMAP3
241struct omap3_cm_regs { 321struct omap3_cm_regs {
242 u32 iva2_cm_clksel1; 322 u32 iva2_cm_clksel1;
243 u32 iva2_cm_clksel2; 323 u32 iva2_cm_clksel2;
@@ -555,4 +635,31 @@ void omap3_cm_restore_context(void)
555 omap2_cm_write_mod_reg(cm_context.cm_clkout_ctrl, OMAP3430_CCR_MOD, 635 omap2_cm_write_mod_reg(cm_context.cm_clkout_ctrl, OMAP3430_CCR_MOD,
556 OMAP3_CM_CLKOUT_CTRL_OFFSET); 636 OMAP3_CM_CLKOUT_CTRL_OFFSET);
557} 637}
558#endif 638
639/*
640 *
641 */
642
643static struct cm_ll_data omap3xxx_cm_ll_data = {
644 .split_idlest_reg = &omap3xxx_cm_split_idlest_reg,
645 .wait_module_ready = &omap3xxx_cm_wait_module_ready,
646};
647
648int __init omap3xxx_cm_init(void)
649{
650 if (!cpu_is_omap34xx())
651 return 0;
652
653 return cm_register(&omap3xxx_cm_ll_data);
654}
655
656static void __exit omap3xxx_cm_exit(void)
657{
658 if (!cpu_is_omap34xx())
659 return;
660
661 /* Should never happen */
662 WARN(cm_unregister(&omap3xxx_cm_ll_data),
663 "%s: cm_ll_data function pointer mismatch\n", __func__);
664}
665__exitcall(omap3xxx_cm_exit);
diff --git a/arch/arm/mach-omap2/cm3xxx.h b/arch/arm/mach-omap2/cm3xxx.h
new file mode 100644
index 000000000000..e8e146f4a43f
--- /dev/null
+++ b/arch/arm/mach-omap2/cm3xxx.h
@@ -0,0 +1,91 @@
1/*
2 * OMAP2/3 Clock Management (CM) register definitions
3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation
6 * Paul Walmsley
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 * The CM hardware modules on the OMAP2/3 are quite similar to each
13 * other. The CM modules/instances on OMAP4 are quite different, so
14 * they are handled in a separate file.
15 */
16#ifndef __ARCH_ASM_MACH_OMAP2_CM3XXX_H
17#define __ARCH_ASM_MACH_OMAP2_CM3XXX_H
18
19#include "prcm-common.h"
20#include "cm2xxx_3xxx.h"
21
22#define OMAP34XX_CM_REGADDR(module, reg) \
23 OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
24
25
26/*
27 * OMAP3-specific global CM registers
28 * Use cm_{read,write}_reg() with these registers.
29 * These registers appear once per CM module.
30 */
31
32#define OMAP3430_CM_REVISION OMAP34XX_CM_REGADDR(OCP_MOD, 0x0000)
33#define OMAP3430_CM_SYSCONFIG OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
34#define OMAP3430_CM_POLCTRL OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
35
36#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
37#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
38
39/*
40 * Module specific CM register offsets from CM_BASE + domain offset
41 * Use cm_{read,write}_mod_reg() with these registers.
42 * These register offsets generally appear in more than one PRCM submodule.
43 */
44
45/* OMAP3-specific register offsets */
46
47#define OMAP3430_CM_CLKEN_PLL 0x0004
48#define OMAP3430ES2_CM_CLKEN2 0x0004
49#define OMAP3430ES2_CM_FCLKEN3 0x0008
50#define OMAP3430_CM_IDLEST_PLL CM_IDLEST2
51#define OMAP3430_CM_AUTOIDLE_PLL CM_AUTOIDLE2
52#define OMAP3430ES2_CM_AUTOIDLE2_PLL CM_AUTOIDLE2
53#define OMAP3430_CM_CLKSEL1 CM_CLKSEL
54#define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL
55#define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2
56#define OMAP3430_CM_SLEEPDEP CM_CLKSEL2
57#define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL
58#define OMAP3430_CM_CLKSTST 0x004c
59#define OMAP3430ES2_CM_CLKSEL4 0x004c
60#define OMAP3430ES2_CM_CLKSEL5 0x0050
61#define OMAP3430_CM_CLKSEL2_EMU 0x0050
62#define OMAP3430_CM_CLKSEL3_EMU 0x0054
63
64
65/* CM_IDLEST bit field values to indicate deasserted IdleReq */
66
67#define OMAP34XX_CM_IDLEST_VAL 1
68
69
70#ifndef __ASSEMBLER__
71
72extern void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask);
73extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
74extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask);
75extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask);
76
77extern bool omap3xxx_cm_is_clkdm_in_hwsup(s16 module, u32 mask);
78extern int omap3xxx_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id,
79 u8 idlest_shift);
80
81extern int omap3xxx_cm_split_idlest_reg(void __iomem *idlest_reg,
82 s16 *prcm_inst, u8 *idlest_reg_id);
83
84extern void omap3_cm_save_context(void);
85extern void omap3_cm_restore_context(void);
86
87extern int __init omap3xxx_cm_init(void);
88
89#endif
90
91#endif
diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c
new file mode 100644
index 000000000000..40b3b5a84458
--- /dev/null
+++ b/arch/arm/mach-omap2/cm_common.c
@@ -0,0 +1,140 @@
1/*
2 * OMAP2+ common Clock Management (CM) IP block functions
3 *
4 * Copyright (C) 2012 Texas Instruments, Inc.
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * XXX This code should eventually be moved to a CM driver.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/errno.h>
17
18#include "cm2xxx.h"
19#include "cm3xxx.h"
20#include "cm44xx.h"
21#include "common.h"
22
23/*
24 * cm_ll_data: function pointers to SoC-specific implementations of
25 * common CM functions
26 */
27static struct cm_ll_data null_cm_ll_data;
28static struct cm_ll_data *cm_ll_data = &null_cm_ll_data;
29
30/* cm_base: base virtual address of the CM IP block */
31void __iomem *cm_base;
32
33/* cm2_base: base virtual address of the CM2 IP block (OMAP44xx only) */
34void __iomem *cm2_base;
35
36/**
37 * omap2_set_globals_cm - set the CM/CM2 base addresses (for early use)
38 * @cm: CM base virtual address
39 * @cm2: CM2 base virtual address (if present on the booted SoC)
40 *
41 * XXX Will be replaced when the PRM/CM drivers are completed.
42 */
43void __init omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2)
44{
45 cm_base = cm;
46 cm2_base = cm2;
47}
48
49/**
50 * cm_split_idlest_reg - split CM_IDLEST reg addr into its components
51 * @idlest_reg: CM_IDLEST* virtual address
52 * @prcm_inst: pointer to an s16 to return the PRCM instance offset
53 * @idlest_reg_id: pointer to a u8 to return the CM_IDLESTx register ID
54 *
55 * Given an absolute CM_IDLEST register address @idlest_reg, passes
56 * the PRCM instance offset and IDLEST register ID back to the caller
57 * via the @prcm_inst and @idlest_reg_id. Returns -EINVAL upon error,
58 * or 0 upon success. XXX This function is only needed until absolute
59 * register addresses are removed from the OMAP struct clk records.
60 */
61int cm_split_idlest_reg(void __iomem *idlest_reg, s16 *prcm_inst,
62 u8 *idlest_reg_id)
63{
64 if (!cm_ll_data->split_idlest_reg) {
65 WARN_ONCE(1, "cm: %s: no low-level function defined\n",
66 __func__);
67 return -EINVAL;
68 }
69
70 return cm_ll_data->split_idlest_reg(idlest_reg, prcm_inst,
71 idlest_reg_id);
72}
73
74/**
75 * cm_wait_module_ready - wait for a module to leave idle or standby
76 * @prcm_mod: PRCM module offset
77 * @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3)
78 * @idlest_shift: shift of the bit in the CM_IDLEST* register to check
79 *
80 * Wait for the PRCM to indicate that the module identified by
81 * (@prcm_mod, @idlest_id, @idlest_shift) is clocked. Return 0 upon
82 * success, -EBUSY if the module doesn't enable in time, or -EINVAL if
83 * no per-SoC wait_module_ready() function pointer has been registered
84 * or if the idlest register is unknown on the SoC.
85 */
86int cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
87{
88 if (!cm_ll_data->wait_module_ready) {
89 WARN_ONCE(1, "cm: %s: no low-level function defined\n",
90 __func__);
91 return -EINVAL;
92 }
93
94 return cm_ll_data->wait_module_ready(prcm_mod, idlest_id, idlest_shift);
95}
96
97/**
98 * cm_register - register per-SoC low-level data with the CM
99 * @cld: low-level per-SoC OMAP CM data & function pointers to register
100 *
101 * Register per-SoC low-level OMAP CM data and function pointers with
102 * the OMAP CM common interface. The caller must keep the data
103 * pointed to by @cld valid until it calls cm_unregister() and
104 * it returns successfully. Returns 0 upon success, -EINVAL if @cld
105 * is NULL, or -EEXIST if cm_register() has already been called
106 * without an intervening cm_unregister().
107 */
108int cm_register(struct cm_ll_data *cld)
109{
110 if (!cld)
111 return -EINVAL;
112
113 if (cm_ll_data != &null_cm_ll_data)
114 return -EEXIST;
115
116 cm_ll_data = cld;
117
118 return 0;
119}
120
121/**
122 * cm_unregister - unregister per-SoC low-level data & function pointers
123 * @cld: low-level per-SoC OMAP CM data & function pointers to unregister
124 *
125 * Unregister per-SoC low-level OMAP CM data and function pointers
126 * that were previously registered with cm_register(). The
127 * caller may not destroy any of the data pointed to by @cld until
128 * this function returns successfully. Returns 0 upon success, or
129 * -EINVAL if @cld is NULL or if @cld does not match the struct
130 * cm_ll_data * previously registered by cm_register().
131 */
132int cm_unregister(struct cm_ll_data *cld)
133{
134 if (!cld || cm_ll_data != cld)
135 return -EINVAL;
136
137 cm_ll_data = &null_cm_ll_data;
138
139 return 0;
140}
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index 1894015ff04b..7f9a464f01e9 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -2,8 +2,9 @@
2 * OMAP4 CM instance functions 2 * OMAP4 CM instance functions
3 * 3 *
4 * Copyright (C) 2009 Nokia Corporation 4 * Copyright (C) 2009 Nokia Corporation
5 * Copyright (C) 2011 Texas Instruments, Inc. 5 * Copyright (C) 2008-2011 Texas Instruments, Inc.
6 * Paul Walmsley 6 * Paul Walmsley
7 * Rajendra Nayak <rnayak@ti.com>
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
@@ -22,6 +23,7 @@
22 23
23#include "iomap.h" 24#include "iomap.h"
24#include "common.h" 25#include "common.h"
26#include "clockdomain.h"
25#include "cm.h" 27#include "cm.h"
26#include "cm1_44xx.h" 28#include "cm1_44xx.h"
27#include "cm2_44xx.h" 29#include "cm2_44xx.h"
@@ -343,3 +345,141 @@ void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs,
343 v &= ~OMAP4430_MODULEMODE_MASK; 345 v &= ~OMAP4430_MODULEMODE_MASK;
344 omap4_cminst_write_inst_reg(v, part, inst, clkctrl_offs); 346 omap4_cminst_write_inst_reg(v, part, inst, clkctrl_offs);
345} 347}
348
349/*
350 * Clockdomain low-level functions
351 */
352
353static int omap4_clkdm_add_wkup_sleep_dep(struct clockdomain *clkdm1,
354 struct clockdomain *clkdm2)
355{
356 omap4_cminst_set_inst_reg_bits((1 << clkdm2->dep_bit),
357 clkdm1->prcm_partition,
358 clkdm1->cm_inst, clkdm1->clkdm_offs +
359 OMAP4_CM_STATICDEP);
360 return 0;
361}
362
363static int omap4_clkdm_del_wkup_sleep_dep(struct clockdomain *clkdm1,
364 struct clockdomain *clkdm2)
365{
366 omap4_cminst_clear_inst_reg_bits((1 << clkdm2->dep_bit),
367 clkdm1->prcm_partition,
368 clkdm1->cm_inst, clkdm1->clkdm_offs +
369 OMAP4_CM_STATICDEP);
370 return 0;
371}
372
373static int omap4_clkdm_read_wkup_sleep_dep(struct clockdomain *clkdm1,
374 struct clockdomain *clkdm2)
375{
376 return omap4_cminst_read_inst_reg_bits(clkdm1->prcm_partition,
377 clkdm1->cm_inst,
378 clkdm1->clkdm_offs +
379 OMAP4_CM_STATICDEP,
380 (1 << clkdm2->dep_bit));
381}
382
383static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)
384{
385 struct clkdm_dep *cd;
386 u32 mask = 0;
387
388 if (!clkdm->prcm_partition)
389 return 0;
390
391 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
392 if (!cd->clkdm)
393 continue; /* only happens if data is erroneous */
394
395 mask |= 1 << cd->clkdm->dep_bit;
396 atomic_set(&cd->wkdep_usecount, 0);
397 }
398
399 omap4_cminst_clear_inst_reg_bits(mask, clkdm->prcm_partition,
400 clkdm->cm_inst, clkdm->clkdm_offs +
401 OMAP4_CM_STATICDEP);
402 return 0;
403}
404
405static int omap4_clkdm_sleep(struct clockdomain *clkdm)
406{
407 omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
408 clkdm->cm_inst, clkdm->clkdm_offs);
409 return 0;
410}
411
412static int omap4_clkdm_wakeup(struct clockdomain *clkdm)
413{
414 omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition,
415 clkdm->cm_inst, clkdm->clkdm_offs);
416 return 0;
417}
418
419static void omap4_clkdm_allow_idle(struct clockdomain *clkdm)
420{
421 omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
422 clkdm->cm_inst, clkdm->clkdm_offs);
423}
424
425static void omap4_clkdm_deny_idle(struct clockdomain *clkdm)
426{
427 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
428 omap4_clkdm_wakeup(clkdm);
429 else
430 omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition,
431 clkdm->cm_inst,
432 clkdm->clkdm_offs);
433}
434
435static int omap4_clkdm_clk_enable(struct clockdomain *clkdm)
436{
437 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
438 return omap4_clkdm_wakeup(clkdm);
439
440 return 0;
441}
442
443static int omap4_clkdm_clk_disable(struct clockdomain *clkdm)
444{
445 bool hwsup = false;
446
447 if (!clkdm->prcm_partition)
448 return 0;
449
450 /*
451 * The CLKDM_MISSING_IDLE_REPORTING flag documentation has
452 * more details on the unpleasant problem this is working
453 * around
454 */
455 if (clkdm->flags & CLKDM_MISSING_IDLE_REPORTING &&
456 !(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) {
457 omap4_clkdm_allow_idle(clkdm);
458 return 0;
459 }
460
461 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
462 clkdm->cm_inst, clkdm->clkdm_offs);
463
464 if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP))
465 omap4_clkdm_sleep(clkdm);
466
467 return 0;
468}
469
470struct clkdm_ops omap4_clkdm_operations = {
471 .clkdm_add_wkdep = omap4_clkdm_add_wkup_sleep_dep,
472 .clkdm_del_wkdep = omap4_clkdm_del_wkup_sleep_dep,
473 .clkdm_read_wkdep = omap4_clkdm_read_wkup_sleep_dep,
474 .clkdm_clear_all_wkdeps = omap4_clkdm_clear_all_wkup_sleep_deps,
475 .clkdm_add_sleepdep = omap4_clkdm_add_wkup_sleep_dep,
476 .clkdm_del_sleepdep = omap4_clkdm_del_wkup_sleep_dep,
477 .clkdm_read_sleepdep = omap4_clkdm_read_wkup_sleep_dep,
478 .clkdm_clear_all_sleepdeps = omap4_clkdm_clear_all_wkup_sleep_deps,
479 .clkdm_sleep = omap4_clkdm_sleep,
480 .clkdm_wakeup = omap4_clkdm_wakeup,
481 .clkdm_allow_idle = omap4_clkdm_allow_idle,
482 .clkdm_deny_idle = omap4_clkdm_deny_idle,
483 .clkdm_clk_enable = omap4_clkdm_clk_enable,
484 .clkdm_clk_disable = omap4_clkdm_clk_disable,
485};
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h
index d69fdefef985..bd7bab889745 100644
--- a/arch/arm/mach-omap2/cminst44xx.h
+++ b/arch/arm/mach-omap2/cminst44xx.h
@@ -38,4 +38,6 @@ extern u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst,
38extern u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx, 38extern u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx,
39 u32 mask); 39 u32 mask);
40 40
41extern void omap_cm_base_init(void);
42
41#endif 43#endif
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index 48daac2581b4..ad856092c06a 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -25,7 +25,6 @@
25#include <linux/spi/ads7846.h> 25#include <linux/spi/ads7846.h>
26 26
27#include <linux/platform_data/spi-omap2-mcspi.h> 27#include <linux/platform_data/spi-omap2-mcspi.h>
28#include <linux/platform_data/mtd-nand-omap2.h>
29 28
30#include "common.h" 29#include "common.h"
31#include "common-board-devices.h" 30#include "common-board-devices.h"
@@ -96,48 +95,3 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
96{ 95{
97} 96}
98#endif 97#endif
99
100#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
101static struct omap_nand_platform_data nand_data;
102
103void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
104 int nr_parts)
105{
106 u8 cs = 0;
107 u8 nandcs = GPMC_CS_NUM + 1;
108
109 /* find out the chip-select on which NAND exists */
110 while (cs < GPMC_CS_NUM) {
111 u32 ret = 0;
112 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
113
114 if ((ret & 0xC00) == 0x800) {
115 printk(KERN_INFO "Found NAND on CS%d\n", cs);
116 if (nandcs > GPMC_CS_NUM)
117 nandcs = cs;
118 }
119 cs++;
120 }
121
122 if (nandcs > GPMC_CS_NUM) {
123 pr_info("NAND: Unable to find configuration in GPMC\n");
124 return;
125 }
126
127 if (nandcs < GPMC_CS_NUM) {
128 nand_data.cs = nandcs;
129 nand_data.parts = parts;
130 nand_data.nr_parts = nr_parts;
131 nand_data.devsize = options;
132
133 printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
134 if (gpmc_nand_init(&nand_data) < 0)
135 printk(KERN_ERR "Unable to register NAND device\n");
136 }
137}
138#else
139void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
140 int nr_parts)
141{
142}
143#endif
diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h
index a0b4a42836ab..72bb41b3fd25 100644
--- a/arch/arm/mach-omap2/common-board-devices.h
+++ b/arch/arm/mach-omap2/common-board-devices.h
@@ -10,6 +10,5 @@ struct ads7846_platform_data;
10 10
11void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, 11void omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce,
12 struct ads7846_platform_data *board_pdata); 12 struct ads7846_platform_data *board_pdata);
13void omap_nand_flash_init(int opts, struct mtd_partition *parts, int n_parts);
14 13
15#endif /* __OMAP_COMMON_BOARD_DEVICES__ */ 14#endif /* __OMAP_COMMON_BOARD_DEVICES__ */
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 17950c6e130b..5c2fd4863b2b 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -14,189 +14,26 @@
14 */ 14 */
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/clk.h> 17#include <linux/platform_data/dsp-omap.h>
18#include <linux/io.h>
19 18
20#include <plat/clock.h> 19#include <plat/vram.h>
21 20
22#include "soc.h"
23#include "iomap.h"
24#include "common.h" 21#include "common.h"
25#include "sdrc.h" 22#include "omap-secure.h"
26#include "control.h"
27
28/* Global address base setup code */
29
30static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
31{
32 omap2_set_globals_tap(omap2_globals);
33 omap2_set_globals_sdrc(omap2_globals);
34 omap2_set_globals_control(omap2_globals);
35 omap2_set_globals_prcm(omap2_globals);
36}
37
38#if defined(CONFIG_SOC_OMAP2420)
39
40static struct omap_globals omap242x_globals = {
41 .class = OMAP242X_CLASS,
42 .tap = OMAP2_L4_IO_ADDRESS(0x48014000),
43 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE),
44 .sms = OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE),
45 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE),
46 .prm = OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
47 .cm = OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
48};
49
50void __init omap2_set_globals_242x(void)
51{
52 __omap2_set_globals(&omap242x_globals);
53}
54
55void __init omap242x_map_io(void)
56{
57 omap242x_map_common_io();
58}
59#endif
60
61#if defined(CONFIG_SOC_OMAP2430)
62
63static struct omap_globals omap243x_globals = {
64 .class = OMAP243X_CLASS,
65 .tap = OMAP2_L4_IO_ADDRESS(0x4900a000),
66 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE),
67 .sms = OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE),
68 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
69 .prm = OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
70 .cm = OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
71};
72
73void __init omap2_set_globals_243x(void)
74{
75 __omap2_set_globals(&omap243x_globals);
76}
77
78void __init omap243x_map_io(void)
79{
80 omap243x_map_common_io();
81}
82#endif
83
84#if defined(CONFIG_ARCH_OMAP3)
85
86static struct omap_globals omap3_globals = {
87 .class = OMAP343X_CLASS,
88 .tap = OMAP2_L4_IO_ADDRESS(0x4830A000),
89 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
90 .sms = OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE),
91 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
92 .prm = OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
93 .cm = OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
94};
95
96void __init omap2_set_globals_3xxx(void)
97{
98 __omap2_set_globals(&omap3_globals);
99}
100
101void __init omap3_map_io(void)
102{
103 omap34xx_map_common_io();
104}
105 23
106/* 24/*
107 * Adjust TAP register base such that omap3_check_revision accesses the correct 25 * Stub function for OMAP2 so that common files
108 * TI81XX register for checking device ID (it adds 0x204 to tap base while 26 * continue to build when custom builds are used
109 * TI81XX DEVICE ID register is at offset 0x600 from control base).
110 */ 27 */
111#define TI81XX_TAP_BASE (TI81XX_CTRL_BASE + \ 28int __weak omap_secure_ram_reserve_memblock(void)
112 TI81XX_CONTROL_DEVICE_ID - 0x204)
113
114static struct omap_globals ti81xx_globals = {
115 .class = OMAP343X_CLASS,
116 .tap = OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE),
117 .ctrl = OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
118 .prm = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
119 .cm = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
120};
121
122void __init omap2_set_globals_ti81xx(void)
123{
124 __omap2_set_globals(&ti81xx_globals);
125}
126
127void __init ti81xx_map_io(void)
128{
129 omapti81xx_map_common_io();
130}
131#endif
132
133#if defined(CONFIG_SOC_AM33XX)
134#define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + \
135 TI81XX_CONTROL_DEVICE_ID - 0x204)
136
137static struct omap_globals am33xx_globals = {
138 .class = AM335X_CLASS,
139 .tap = AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE),
140 .ctrl = AM33XX_L4_WK_IO_ADDRESS(AM33XX_CTRL_BASE),
141 .prm = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE),
142 .cm = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE),
143};
144
145void __init omap2_set_globals_am33xx(void)
146{
147 __omap2_set_globals(&am33xx_globals);
148}
149
150void __init am33xx_map_io(void)
151{
152 omapam33xx_map_common_io();
153}
154#endif
155
156#if defined(CONFIG_ARCH_OMAP4)
157static struct omap_globals omap4_globals = {
158 .class = OMAP443X_CLASS,
159 .tap = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
160 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
161 .ctrl_pad = OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE),
162 .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
163 .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
164 .cm2 = OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
165 .prcm_mpu = OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE),
166};
167
168void __init omap2_set_globals_443x(void)
169{
170 __omap2_set_globals(&omap4_globals);
171}
172
173void __init omap4_map_io(void)
174{
175 omap44xx_map_common_io();
176}
177#endif
178
179#if defined(CONFIG_SOC_OMAP5)
180static struct omap_globals omap5_globals = {
181 .class = OMAP54XX_CLASS,
182 .tap = OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE),
183 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE),
184 .ctrl_pad = OMAP2_L4_IO_ADDRESS(OMAP54XX_CTRL_BASE),
185 .prm = OMAP2_L4_IO_ADDRESS(OMAP54XX_PRM_BASE),
186 .cm = OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_AON_BASE),
187 .cm2 = OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE),
188 .prcm_mpu = OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE),
189};
190
191void __init omap2_set_globals_5xxx(void)
192{ 29{
193 omap2_set_globals_tap(&omap5_globals); 30 return 0;
194 omap2_set_globals_control(&omap5_globals);
195 omap2_set_globals_prcm(&omap5_globals);
196} 31}
197 32
198void __init omap5_map_io(void) 33void __init omap_reserve(void)
199{ 34{
200 omap5_map_common_io(); 35 omap_vram_reserve_sdram_memblock();
36 omap_dsp_reserve_sdram_memblock();
37 omap_secure_ram_reserve_memblock();
38 omap_barrier_reserve_memblock();
201} 39}
202#endif
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 7045e4d61ac3..08c586451f93 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -28,63 +28,18 @@
28 28
29#include <linux/irq.h> 29#include <linux/irq.h>
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <linux/i2c.h>
31#include <linux/i2c/twl.h> 32#include <linux/i2c/twl.h>
33#include <linux/i2c-omap.h>
32 34
33#include <asm/proc-fns.h> 35#include <asm/proc-fns.h>
34 36
35#include <plat/cpu.h> 37#include "i2c.h"
36#include <plat/serial.h> 38#include "serial.h"
37#include <plat/common.h>
38 39
39#define OMAP_INTC_START NR_IRQS 40#include "usb.h"
40
41#ifdef CONFIG_SOC_OMAP2420
42extern void omap242x_map_common_io(void);
43#else
44static inline void omap242x_map_common_io(void)
45{
46}
47#endif
48
49#ifdef CONFIG_SOC_OMAP2430
50extern void omap243x_map_common_io(void);
51#else
52static inline void omap243x_map_common_io(void)
53{
54}
55#endif
56
57#ifdef CONFIG_ARCH_OMAP3
58extern void omap34xx_map_common_io(void);
59#else
60static inline void omap34xx_map_common_io(void)
61{
62}
63#endif
64
65#ifdef CONFIG_SOC_TI81XX
66extern void omapti81xx_map_common_io(void);
67#else
68static inline void omapti81xx_map_common_io(void)
69{
70}
71#endif
72 41
73#ifdef CONFIG_SOC_AM33XX 42#define OMAP_INTC_START NR_IRQS
74extern void omapam33xx_map_common_io(void);
75#else
76static inline void omapam33xx_map_common_io(void)
77{
78}
79#endif
80
81#ifdef CONFIG_ARCH_OMAP4
82extern void omap44xx_map_common_io(void);
83#else
84static inline void omap44xx_map_common_io(void)
85{
86}
87#endif
88 43
89#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP2) 44#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP2)
90int omap2_pm_init(void); 45int omap2_pm_init(void);
@@ -122,14 +77,6 @@ static inline int omap_mux_late_init(void)
122} 77}
123#endif 78#endif
124 79
125#ifdef CONFIG_SOC_OMAP5
126extern void omap5_map_common_io(void);
127#else
128static inline void omap5_map_common_io(void)
129{
130}
131#endif
132
133extern void omap2_init_common_infrastructure(void); 80extern void omap2_init_common_infrastructure(void);
134 81
135extern struct sys_timer omap2_timer; 82extern struct sys_timer omap2_timer;
@@ -162,52 +109,43 @@ void am35xx_init_late(void);
162void ti81xx_init_late(void); 109void ti81xx_init_late(void);
163void omap4430_init_late(void); 110void omap4430_init_late(void);
164int omap2_common_pm_late_init(void); 111int omap2_common_pm_late_init(void);
165void omap_prcm_restart(char, const char *);
166 112
167/* 113#if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
168 * IO bases for various OMAP processors 114void omap2xxx_restart(char mode, const char *cmd);
169 * Except the tap base, rest all the io bases 115#else
170 * listed are physical addresses. 116static inline void omap2xxx_restart(char mode, const char *cmd)
171 */ 117{
172struct omap_globals { 118}
173 u32 class; /* OMAP class to detect */ 119#endif
174 void __iomem *tap; /* Control module ID code */ 120
175 void __iomem *sdrc; /* SDRAM Controller */ 121#ifdef CONFIG_ARCH_OMAP3
176 void __iomem *sms; /* SDRAM Memory Scheduler */ 122void omap3xxx_restart(char mode, const char *cmd);
177 void __iomem *ctrl; /* System Control Module */ 123#else
178 void __iomem *ctrl_pad; /* PAD Control Module */ 124static inline void omap3xxx_restart(char mode, const char *cmd)
179 void __iomem *prm; /* Power and Reset Management */ 125{
180 void __iomem *cm; /* Clock Management */ 126}
181 void __iomem *cm2; 127#endif
182 void __iomem *prcm_mpu; 128
183}; 129#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
184 130void omap44xx_restart(char mode, const char *cmd);
185void omap2_set_globals_242x(void);
186void omap2_set_globals_243x(void);
187void omap2_set_globals_3xxx(void);
188void omap2_set_globals_443x(void);
189void omap2_set_globals_5xxx(void);
190void omap2_set_globals_ti81xx(void);
191void omap2_set_globals_am33xx(void);
192
193/* These get called from omap2_set_globals_xxxx(), do not call these */
194void omap2_set_globals_tap(struct omap_globals *);
195#if defined(CONFIG_SOC_HAS_OMAP2_SDRC)
196void omap2_set_globals_sdrc(struct omap_globals *);
197#else 131#else
198static inline void omap2_set_globals_sdrc(struct omap_globals *omap2_globals) 132static inline void omap44xx_restart(char mode, const char *cmd)
199{ } 133{
134}
200#endif 135#endif
201void omap2_set_globals_control(struct omap_globals *); 136
202void omap2_set_globals_prcm(struct omap_globals *); 137/* This gets called from mach-omap2/io.c, do not call this */
203 138void __init omap2_set_globals_tap(u32 class, void __iomem *tap);
204void omap242x_map_io(void); 139
205void omap243x_map_io(void); 140void __init omap242x_map_io(void);
206void omap3_map_io(void); 141void __init omap243x_map_io(void);
207void am33xx_map_io(void); 142void __init omap3_map_io(void);
208void omap4_map_io(void); 143void __init am33xx_map_io(void);
209void omap5_map_io(void); 144void __init omap4_map_io(void);
210void ti81xx_map_io(void); 145void __init omap5_map_io(void);
146void __init ti81xx_map_io(void);
147
148/* omap_barriers_init() is OMAP4 only */
211void omap_barriers_init(void); 149void omap_barriers_init(void);
212 150
213/** 151/**
@@ -338,6 +276,10 @@ extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
338 struct omap_sdrc_params *sdrc_cs1); 276 struct omap_sdrc_params *sdrc_cs1);
339struct omap2_hsmmc_info; 277struct omap2_hsmmc_info;
340extern int omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers); 278extern int omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers);
279extern void omap_reserve(void);
280
281struct omap_hwmod;
282extern int omap_dss_reset(struct omap_hwmod *);
341 283
342#endif /* __ASSEMBLER__ */ 284#endif /* __ASSEMBLER__ */
343#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ 285#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index d1ff8399a222..2adb2683f074 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3 System Control Module register access 2 * OMAP2/3 System Control Module register access
3 * 3 *
4 * Copyright (C) 2007 Texas Instruments, Inc. 4 * Copyright (C) 2007, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2007 Nokia Corporation 5 * Copyright (C) 2007 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley
@@ -15,15 +15,13 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <plat/sdrc.h>
19
20#include "soc.h" 18#include "soc.h"
21#include "iomap.h" 19#include "iomap.h"
22#include "common.h" 20#include "common.h"
23#include "cm-regbits-34xx.h" 21#include "cm-regbits-34xx.h"
24#include "prm-regbits-34xx.h" 22#include "prm-regbits-34xx.h"
25#include "prm2xxx_3xxx.h" 23#include "prm3xxx.h"
26#include "cm2xxx_3xxx.h" 24#include "cm3xxx.h"
27#include "sdrc.h" 25#include "sdrc.h"
28#include "pm.h" 26#include "pm.h"
29#include "control.h" 27#include "control.h"
@@ -149,13 +147,11 @@ static struct omap3_control_regs control_context;
149#define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg)) 147#define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg))
150#define OMAP4_CTRL_PAD_REGADDR(reg) (omap4_ctrl_pad_base + (reg)) 148#define OMAP4_CTRL_PAD_REGADDR(reg) (omap4_ctrl_pad_base + (reg))
151 149
152void __init omap2_set_globals_control(struct omap_globals *omap2_globals) 150void __init omap2_set_globals_control(void __iomem *ctrl,
151 void __iomem *ctrl_pad)
153{ 152{
154 if (omap2_globals->ctrl) 153 omap2_ctrl_base = ctrl;
155 omap2_ctrl_base = omap2_globals->ctrl; 154 omap4_ctrl_pad_base = ctrl_pad;
156
157 if (omap2_globals->ctrl_pad)
158 omap4_ctrl_pad_base = omap2_globals->ctrl_pad;
159} 155}
160 156
161void __iomem *omap_ctrl_base_get(void) 157void __iomem *omap_ctrl_base_get(void)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index a89e8256fd0e..4ca8747b3cc9 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -414,6 +414,8 @@ extern void omap_ctrl_write_dsp_boot_addr(u32 bootaddr);
414extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode); 414extern void omap_ctrl_write_dsp_boot_mode(u8 bootmode);
415extern void omap3630_ctrl_disable_rta(void); 415extern void omap3630_ctrl_disable_rta(void);
416extern int omap3_ctrl_save_padconf(void); 416extern int omap3_ctrl_save_padconf(void);
417extern void omap2_set_globals_control(void __iomem *ctrl,
418 void __iomem *ctrl_pad);
417#else 419#else
418#define omap_ctrl_base_get() 0 420#define omap_ctrl_base_get() 0
419#define omap_ctrl_readb(x) 0 421#define omap_ctrl_readb(x) 0
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index bc2756959be5..bca7a8885703 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -27,7 +27,6 @@
27#include <linux/export.h> 27#include <linux/export.h>
28#include <linux/cpu_pm.h> 28#include <linux/cpu_pm.h>
29 29
30#include <plat/prcm.h>
31#include "powerdomain.h" 30#include "powerdomain.h"
32#include "clockdomain.h" 31#include "clockdomain.h"
33 32
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index c72b5a727720..d2215e9873a5 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -24,10 +24,11 @@
24#include <asm/mach-types.h> 24#include <asm/mach-types.h>
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26 26
27#include <plat-omap/dma-omap.h>
28
27#include "iomap.h" 29#include "iomap.h"
28#include <plat/dma.h> 30#include "omap_hwmod.h"
29#include <plat/omap_hwmod.h> 31#include "omap_device.h"
30#include <plat/omap_device.h>
31#include "omap4-keypad.h" 32#include "omap4-keypad.h"
32 33
33#include "soc.h" 34#include "soc.h"
@@ -35,6 +36,7 @@
35#include "mux.h" 36#include "mux.h"
36#include "control.h" 37#include "control.h"
37#include "devices.h" 38#include "devices.h"
39#include "dma.h"
38 40
39#define L3_MODULES_MAX_LEN 12 41#define L3_MODULES_MAX_LEN 12
40#define L3_MODULES 3 42#define L3_MODULES 3
@@ -723,29 +725,3 @@ static int __init omap2_init_devices(void)
723 return 0; 725 return 0;
724} 726}
725arch_initcall(omap2_init_devices); 727arch_initcall(omap2_init_devices);
726
727#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
728static int __init omap_init_wdt(void)
729{
730 int id = -1;
731 struct platform_device *pdev;
732 struct omap_hwmod *oh;
733 char *oh_name = "wd_timer2";
734 char *dev_name = "omap_wdt";
735
736 if (!cpu_class_is_omap2() || of_have_populated_dt())
737 return 0;
738
739 oh = omap_hwmod_lookup(oh_name);
740 if (!oh) {
741 pr_err("Could not look up wd_timer%d hwmod\n", id);
742 return -EINVAL;
743 }
744
745 pdev = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0);
746 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
747 dev_name, oh->name);
748 return 0;
749}
750subsys_initcall(omap_init_wdt);
751#endif
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 1011995f150a..38ba58c97628 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -25,15 +25,17 @@
25#include <linux/delay.h> 25#include <linux/delay.h>
26 26
27#include <video/omapdss.h> 27#include <video/omapdss.h>
28#include <plat/omap_hwmod.h> 28#include "omap_hwmod.h"
29#include <plat/omap_device.h> 29#include "omap_device.h"
30#include <plat/omap-pm.h> 30#include "omap-pm.h"
31#include "common.h" 31#include "common.h"
32 32
33#include "soc.h"
33#include "iomap.h" 34#include "iomap.h"
34#include "mux.h" 35#include "mux.h"
35#include "control.h" 36#include "control.h"
36#include "display.h" 37#include "display.h"
38#include "prm.h"
37 39
38#define DISPC_CONTROL 0x0040 40#define DISPC_CONTROL 0x0040
39#define DISPC_CONTROL2 0x0238 41#define DISPC_CONTROL2 0x0238
@@ -284,6 +286,35 @@ err:
284 return ERR_PTR(r); 286 return ERR_PTR(r);
285} 287}
286 288
289static enum omapdss_version __init omap_display_get_version(void)
290{
291 if (cpu_is_omap24xx())
292 return OMAPDSS_VER_OMAP24xx;
293 else if (cpu_is_omap3630())
294 return OMAPDSS_VER_OMAP3630;
295 else if (cpu_is_omap34xx()) {
296 if (soc_is_am35xx()) {
297 return OMAPDSS_VER_AM35xx;
298 } else {
299 if (omap_rev() < OMAP3430_REV_ES3_0)
300 return OMAPDSS_VER_OMAP34xx_ES1;
301 else
302 return OMAPDSS_VER_OMAP34xx_ES3;
303 }
304 } else if (omap_rev() == OMAP4430_REV_ES1_0)
305 return OMAPDSS_VER_OMAP4430_ES1;
306 else if (omap_rev() == OMAP4430_REV_ES2_0 ||
307 omap_rev() == OMAP4430_REV_ES2_1 ||
308 omap_rev() == OMAP4430_REV_ES2_2)
309 return OMAPDSS_VER_OMAP4430_ES2;
310 else if (cpu_is_omap44xx())
311 return OMAPDSS_VER_OMAP4;
312 else if (soc_is_omap54xx())
313 return OMAPDSS_VER_OMAP5;
314 else
315 return OMAPDSS_VER_UNKNOWN;
316}
317
287int __init omap_display_init(struct omap_dss_board_info *board_data) 318int __init omap_display_init(struct omap_dss_board_info *board_data)
288{ 319{
289 int r = 0; 320 int r = 0;
@@ -291,9 +322,18 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
291 int i, oh_count; 322 int i, oh_count;
292 const struct omap_dss_hwmod_data *curr_dss_hwmod; 323 const struct omap_dss_hwmod_data *curr_dss_hwmod;
293 struct platform_device *dss_pdev; 324 struct platform_device *dss_pdev;
325 enum omapdss_version ver;
294 326
295 /* create omapdss device */ 327 /* create omapdss device */
296 328
329 ver = omap_display_get_version();
330
331 if (ver == OMAPDSS_VER_UNKNOWN) {
332 pr_err("DSS not supported on this SoC\n");
333 return -ENODEV;
334 }
335
336 board_data->version = ver;
297 board_data->dsi_enable_pads = omap_dsi_enable_pads; 337 board_data->dsi_enable_pads = omap_dsi_enable_pads;
298 board_data->dsi_disable_pads = omap_dsi_disable_pads; 338 board_data->dsi_disable_pads = omap_dsi_disable_pads;
299 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count; 339 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
@@ -473,7 +513,6 @@ static void dispc_disable_outputs(void)
473 } 513 }
474} 514}
475 515
476#define MAX_MODULE_SOFTRESET_WAIT 10000
477int omap_dss_reset(struct omap_hwmod *oh) 516int omap_dss_reset(struct omap_hwmod *oh)
478{ 517{
479 struct omap_hwmod_opt_clk *oc; 518 struct omap_hwmod_opt_clk *oc;
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index ff75abe60af2..e5aba58da5d2 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -28,9 +28,11 @@
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/device.h> 29#include <linux/device.h>
30 30
31#include <plat/omap_hwmod.h> 31#include <plat-omap/dma-omap.h>
32#include <plat/omap_device.h> 32
33#include <plat/dma.h> 33#include "soc.h"
34#include "omap_hwmod.h"
35#include "omap_device.h"
34 36
35#define OMAP2_DMA_STRIDE 0x60 37#define OMAP2_DMA_STRIDE 0x60
36 38
@@ -274,6 +276,9 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
274 return -ENOMEM; 276 return -ENOMEM;
275 } 277 }
276 278
279 if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
280 d->dev_caps |= HS_CHANNELS_RESERVED;
281
277 /* Check the capabilities register for descriptor loading feature */ 282 /* Check the capabilities register for descriptor loading feature */
278 if (dma_read(CAPS_0, 0) & DMA_HAS_DESCRIPTOR_CAPS) 283 if (dma_read(CAPS_0, 0) & DMA_HAS_DESCRIPTOR_CAPS)
279 dma_common_ch_end = CCDN; 284 dma_common_ch_end = CCDN;
diff --git a/arch/arm/mach-omap2/dma.h b/arch/arm/mach-omap2/dma.h
new file mode 100644
index 000000000000..eba80dbc5218
--- /dev/null
+++ b/arch/arm/mach-omap2/dma.h
@@ -0,0 +1,131 @@
1/*
2 * OMAP2PLUS DMA channel definitions
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#ifndef __OMAP2PLUS_DMA_CHANNEL_H
20#define __OMAP2PLUS_DMA_CHANNEL_H
21
22
23/* DMA channels for 24xx */
24#define OMAP24XX_DMA_NO_DEVICE 0
25#define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */
26#define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */
27#define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */
28#define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */
29#define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */
30#define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */
31#define OMAP242X_DMA_VLYNQ_TX 7 /* S_DMA_6 */
32#define OMAP24XX_DMA_EXT_DMAREQ2 7 /* S_DMA_6 */
33#define OMAP24XX_DMA_CWT 8 /* S_DMA_7 */
34#define OMAP24XX_DMA_AES_TX 9 /* S_DMA_8 */
35#define OMAP24XX_DMA_AES_RX 10 /* S_DMA_9 */
36#define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */
37#define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */
38#define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */
39#define OMAP34XX_DMA_SHA2MD5_RX 13 /* S_DMA_12 */
40#define OMAP242X_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */
41#define OMAP242X_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */
42#define OMAP242X_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */
43#define OMAP242X_DMA_EAC_AC_RD 17 /* S_DMA_16 */
44#define OMAP242X_DMA_EAC_AC_WR 18 /* S_DMA_17 */
45#define OMAP242X_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */
46#define OMAP242X_DMA_EAC_MD_UL_WR 20 /* S_DMA_19 */
47#define OMAP242X_DMA_EAC_MD_DL_RD 21 /* S_DMA_20 */
48#define OMAP242X_DMA_EAC_MD_DL_WR 22 /* S_DMA_21 */
49#define OMAP242X_DMA_EAC_BT_UL_RD 23 /* S_DMA_22 */
50#define OMAP242X_DMA_EAC_BT_UL_WR 24 /* S_DMA_23 */
51#define OMAP242X_DMA_EAC_BT_DL_RD 25 /* S_DMA_24 */
52#define OMAP242X_DMA_EAC_BT_DL_WR 26 /* S_DMA_25 */
53#define OMAP243X_DMA_EXT_DMAREQ3 14 /* S_DMA_13 */
54#define OMAP24XX_DMA_SPI3_TX0 15 /* S_DMA_14 */
55#define OMAP24XX_DMA_SPI3_RX0 16 /* S_DMA_15 */
56#define OMAP24XX_DMA_MCBSP3_TX 17 /* S_DMA_16 */
57#define OMAP24XX_DMA_MCBSP3_RX 18 /* S_DMA_17 */
58#define OMAP24XX_DMA_MCBSP4_TX 19 /* S_DMA_18 */
59#define OMAP24XX_DMA_MCBSP4_RX 20 /* S_DMA_19 */
60#define OMAP24XX_DMA_MCBSP5_TX 21 /* S_DMA_20 */
61#define OMAP24XX_DMA_MCBSP5_RX 22 /* S_DMA_21 */
62#define OMAP24XX_DMA_SPI3_TX1 23 /* S_DMA_22 */
63#define OMAP24XX_DMA_SPI3_RX1 24 /* S_DMA_23 */
64#define OMAP243X_DMA_EXT_DMAREQ4 25 /* S_DMA_24 */
65#define OMAP243X_DMA_EXT_DMAREQ5 26 /* S_DMA_25 */
66#define OMAP34XX_DMA_I2C3_TX 25 /* S_DMA_24 */
67#define OMAP34XX_DMA_I2C3_RX 26 /* S_DMA_25 */
68#define OMAP24XX_DMA_I2C1_TX 27 /* S_DMA_26 */
69#define OMAP24XX_DMA_I2C1_RX 28 /* S_DMA_27 */
70#define OMAP24XX_DMA_I2C2_TX 29 /* S_DMA_28 */
71#define OMAP24XX_DMA_I2C2_RX 30 /* S_DMA_29 */
72#define OMAP24XX_DMA_MCBSP1_TX 31 /* S_DMA_30 */
73#define OMAP24XX_DMA_MCBSP1_RX 32 /* S_DMA_31 */
74#define OMAP24XX_DMA_MCBSP2_TX 33 /* S_DMA_32 */
75#define OMAP24XX_DMA_MCBSP2_RX 34 /* S_DMA_33 */
76#define OMAP24XX_DMA_SPI1_TX0 35 /* S_DMA_34 */
77#define OMAP24XX_DMA_SPI1_RX0 36 /* S_DMA_35 */
78#define OMAP24XX_DMA_SPI1_TX1 37 /* S_DMA_36 */
79#define OMAP24XX_DMA_SPI1_RX1 38 /* S_DMA_37 */
80#define OMAP24XX_DMA_SPI1_TX2 39 /* S_DMA_38 */
81#define OMAP24XX_DMA_SPI1_RX2 40 /* S_DMA_39 */
82#define OMAP24XX_DMA_SPI1_TX3 41 /* S_DMA_40 */
83#define OMAP24XX_DMA_SPI1_RX3 42 /* S_DMA_41 */
84#define OMAP24XX_DMA_SPI2_TX0 43 /* S_DMA_42 */
85#define OMAP24XX_DMA_SPI2_RX0 44 /* S_DMA_43 */
86#define OMAP24XX_DMA_SPI2_TX1 45 /* S_DMA_44 */
87#define OMAP24XX_DMA_SPI2_RX1 46 /* S_DMA_45 */
88#define OMAP24XX_DMA_MMC2_TX 47 /* S_DMA_46 */
89#define OMAP24XX_DMA_MMC2_RX 48 /* S_DMA_47 */
90#define OMAP24XX_DMA_UART1_TX 49 /* S_DMA_48 */
91#define OMAP24XX_DMA_UART1_RX 50 /* S_DMA_49 */
92#define OMAP24XX_DMA_UART2_TX 51 /* S_DMA_50 */
93#define OMAP24XX_DMA_UART2_RX 52 /* S_DMA_51 */
94#define OMAP24XX_DMA_UART3_TX 53 /* S_DMA_52 */
95#define OMAP24XX_DMA_UART3_RX 54 /* S_DMA_53 */
96#define OMAP24XX_DMA_USB_W2FC_TX0 55 /* S_DMA_54 */
97#define OMAP24XX_DMA_USB_W2FC_RX0 56 /* S_DMA_55 */
98#define OMAP24XX_DMA_USB_W2FC_TX1 57 /* S_DMA_56 */
99#define OMAP24XX_DMA_USB_W2FC_RX1 58 /* S_DMA_57 */
100#define OMAP24XX_DMA_USB_W2FC_TX2 59 /* S_DMA_58 */
101#define OMAP24XX_DMA_USB_W2FC_RX2 60 /* S_DMA_59 */
102#define OMAP24XX_DMA_MMC1_TX 61 /* S_DMA_60 */
103#define OMAP24XX_DMA_MMC1_RX 62 /* S_DMA_61 */
104#define OMAP24XX_DMA_MS 63 /* S_DMA_62 */
105#define OMAP242X_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */
106#define OMAP243X_DMA_EXT_DMAREQ6 64 /* S_DMA_63 */
107#define OMAP34XX_DMA_EXT_DMAREQ3 64 /* S_DMA_63 */
108#define OMAP34XX_DMA_AES2_TX 65 /* S_DMA_64 */
109#define OMAP34XX_DMA_AES2_RX 66 /* S_DMA_65 */
110#define OMAP34XX_DMA_DES2_TX 67 /* S_DMA_66 */
111#define OMAP34XX_DMA_DES2_RX 68 /* S_DMA_67 */
112#define OMAP34XX_DMA_SHA1MD5_RX 69 /* S_DMA_68 */
113#define OMAP34XX_DMA_SPI4_TX0 70 /* S_DMA_69 */
114#define OMAP34XX_DMA_SPI4_RX0 71 /* S_DMA_70 */
115#define OMAP34XX_DSS_DMA0 72 /* S_DMA_71 */
116#define OMAP34XX_DSS_DMA1 73 /* S_DMA_72 */
117#define OMAP34XX_DSS_DMA2 74 /* S_DMA_73 */
118#define OMAP34XX_DSS_DMA3 75 /* S_DMA_74 */
119#define OMAP34XX_DMA_MMC3_TX 77 /* S_DMA_76 */
120#define OMAP34XX_DMA_MMC3_RX 78 /* S_DMA_77 */
121#define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */
122#define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */
123
124#define OMAP36XX_DMA_UART4_TX 81 /* S_DMA_80 */
125#define OMAP36XX_DMA_UART4_RX 82 /* S_DMA_81 */
126
127/* Only for AM35xx */
128#define AM35XX_DMA_UART4_TX 54
129#define AM35XX_DMA_UART4_RX 55
130
131#endif /* __OMAP2PLUS_DMA_CHANNEL_H */
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index 814e1808e158..eacf51f2bc27 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -28,8 +28,6 @@
28#include <linux/bitops.h> 28#include <linux/bitops.h>
29#include <linux/clkdev.h> 29#include <linux/clkdev.h>
30 30
31#include <plat/clock.h>
32
33#include "soc.h" 31#include "soc.h"
34#include "clock.h" 32#include "clock.h"
35#include "cm2xxx_3xxx.h" 33#include "cm2xxx_3xxx.h"
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c
index 09d0ccccb861..5854da168a9c 100644
--- a/arch/arm/mach-omap2/dpll44xx.c
+++ b/arch/arm/mach-omap2/dpll44xx.c
@@ -15,8 +15,6 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17 17
18#include <plat/clock.h>
19
20#include "soc.h" 18#include "soc.h"
21#include "clock.h" 19#include "clock.h"
22#include "clock44xx.h" 20#include "clock44xx.h"
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
index 72e0f01b715c..6282cc826613 100644
--- a/arch/arm/mach-omap2/drm.c
+++ b/arch/arm/mach-omap2/drm.c
@@ -24,8 +24,8 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26 26
27#include <plat/omap_device.h> 27#include "omap_device.h"
28#include <plat/omap_hwmod.h> 28#include "omap_hwmod.h"
29 29
30#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE) 30#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
31 31
diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c
index 98388109f22a..b155500e84a8 100644
--- a/arch/arm/mach-omap2/dsp.c
+++ b/arch/arm/mach-omap2/dsp.c
@@ -27,7 +27,7 @@
27#include "cm2xxx_3xxx.h" 27#include "cm2xxx_3xxx.h"
28#include "prm2xxx_3xxx.h" 28#include "prm2xxx_3xxx.h"
29#ifdef CONFIG_BRIDGE_DVFS 29#ifdef CONFIG_BRIDGE_DVFS
30#include <plat/omap-pm.h> 30#include "omap-pm.h"
31#endif 31#endif
32 32
33#include <linux/platform_data/dsp-omap.h> 33#include <linux/platform_data/dsp-omap.h>
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index d1058f16fb40..399acabc3d0b 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -23,9 +23,9 @@
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/platform_data/gpio-omap.h> 24#include <linux/platform_data/gpio-omap.h>
25 25
26#include <plat/omap_hwmod.h> 26#include "omap_hwmod.h"
27#include <plat/omap_device.h> 27#include "omap_device.h"
28#include <plat/omap-pm.h> 28#include "omap-pm.h"
29 29
30#include "powerdomain.h" 30#include "powerdomain.h"
31 31
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 4acf497faeb3..8607735b3ab3 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -17,9 +17,12 @@
17 17
18#include <asm/mach/flash.h> 18#include <asm/mach/flash.h>
19 19
20#include <plat/gpmc.h> 20#include "gpmc.h"
21
22#include "soc.h" 21#include "soc.h"
22#include "gpmc-nand.h"
23
24/* minimum size for IO mapping */
25#define NAND_IO_SIZE 4
23 26
24static struct resource gpmc_nand_resource[] = { 27static struct resource gpmc_nand_resource[] = {
25 { 28 {
@@ -40,41 +43,36 @@ static struct platform_device gpmc_nand_device = {
40 .resource = gpmc_nand_resource, 43 .resource = gpmc_nand_resource,
41}; 44};
42 45
43static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data) 46static int omap2_nand_gpmc_retime(
47 struct omap_nand_platform_data *gpmc_nand_data,
48 struct gpmc_timings *gpmc_t)
44{ 49{
45 struct gpmc_timings t; 50 struct gpmc_timings t;
46 int err; 51 int err;
47 52
48 if (!gpmc_nand_data->gpmc_t)
49 return 0;
50
51 memset(&t, 0, sizeof(t)); 53 memset(&t, 0, sizeof(t));
52 t.sync_clk = gpmc_nand_data->gpmc_t->sync_clk; 54 t.sync_clk = gpmc_t->sync_clk;
53 t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on); 55 t.cs_on = gpmc_round_ns_to_ticks(gpmc_t->cs_on);
54 t.adv_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->adv_on); 56 t.adv_on = gpmc_round_ns_to_ticks(gpmc_t->adv_on);
55 57
56 /* Read */ 58 /* Read */
57 t.adv_rd_off = gpmc_round_ns_to_ticks( 59 t.adv_rd_off = gpmc_round_ns_to_ticks(gpmc_t->adv_rd_off);
58 gpmc_nand_data->gpmc_t->adv_rd_off);
59 t.oe_on = t.adv_on; 60 t.oe_on = t.adv_on;
60 t.access = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->access); 61 t.access = gpmc_round_ns_to_ticks(gpmc_t->access);
61 t.oe_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->oe_off); 62 t.oe_off = gpmc_round_ns_to_ticks(gpmc_t->oe_off);
62 t.cs_rd_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_rd_off); 63 t.cs_rd_off = gpmc_round_ns_to_ticks(gpmc_t->cs_rd_off);
63 t.rd_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->rd_cycle); 64 t.rd_cycle = gpmc_round_ns_to_ticks(gpmc_t->rd_cycle);
64 65
65 /* Write */ 66 /* Write */
66 t.adv_wr_off = gpmc_round_ns_to_ticks( 67 t.adv_wr_off = gpmc_round_ns_to_ticks(gpmc_t->adv_wr_off);
67 gpmc_nand_data->gpmc_t->adv_wr_off);
68 t.we_on = t.oe_on; 68 t.we_on = t.oe_on;
69 if (cpu_is_omap34xx()) { 69 if (cpu_is_omap34xx()) {
70 t.wr_data_mux_bus = gpmc_round_ns_to_ticks( 70 t.wr_data_mux_bus = gpmc_round_ns_to_ticks(gpmc_t->wr_data_mux_bus);
71 gpmc_nand_data->gpmc_t->wr_data_mux_bus); 71 t.wr_access = gpmc_round_ns_to_ticks(gpmc_t->wr_access);
72 t.wr_access = gpmc_round_ns_to_ticks(
73 gpmc_nand_data->gpmc_t->wr_access);
74 } 72 }
75 t.we_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->we_off); 73 t.we_off = gpmc_round_ns_to_ticks(gpmc_t->we_off);
76 t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off); 74 t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_t->cs_wr_off);
77 t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); 75 t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_t->wr_cycle);
78 76
79 /* Configure GPMC */ 77 /* Configure GPMC */
80 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16) 78 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
@@ -91,7 +89,29 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data
91 return 0; 89 return 0;
92} 90}
93 91
94int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data) 92static bool __init gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
93{
94 /* support only OMAP3 class */
95 if (!cpu_is_omap34xx()) {
96 pr_err("BCH ecc is not supported on this CPU\n");
97 return 0;
98 }
99
100 /*
101 * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1.
102 * Other chips may be added if confirmed to work.
103 */
104 if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) &&
105 (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) {
106 pr_err("BCH 4-bit mode is not supported on this CPU\n");
107 return 0;
108 }
109
110 return 1;
111}
112
113int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
114 struct gpmc_timings *gpmc_t)
95{ 115{
96 int err = 0; 116 int err = 0;
97 struct device *dev = &gpmc_nand_device.dev; 117 struct device *dev = &gpmc_nand_device.dev;
@@ -112,11 +132,13 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
112 gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE); 132 gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE);
113 gpmc_nand_resource[2].start = 133 gpmc_nand_resource[2].start =
114 gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT); 134 gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT);
115 /* Set timings in GPMC */ 135
116 err = omap2_nand_gpmc_retime(gpmc_nand_data); 136 if (gpmc_t) {
117 if (err < 0) { 137 err = omap2_nand_gpmc_retime(gpmc_nand_data, gpmc_t);
118 dev_err(dev, "Unable to set gpmc timings: %d\n", err); 138 if (err < 0) {
119 return err; 139 dev_err(dev, "Unable to set gpmc timings: %d\n", err);
140 return err;
141 }
120 } 142 }
121 143
122 /* Enable RD PIN Monitoring Reg */ 144 /* Enable RD PIN Monitoring Reg */
@@ -126,6 +148,9 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data)
126 148
127 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs); 149 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
128 150
151 if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt))
152 return -EINVAL;
153
129 err = platform_device_register(&gpmc_nand_device); 154 err = platform_device_register(&gpmc_nand_device);
130 if (err < 0) { 155 if (err < 0) {
131 dev_err(dev, "Unable to register NAND device\n"); 156 dev_err(dev, "Unable to register NAND device\n");
diff --git a/arch/arm/mach-omap2/gpmc-nand.h b/arch/arm/mach-omap2/gpmc-nand.h
new file mode 100644
index 000000000000..d59e1281e851
--- /dev/null
+++ b/arch/arm/mach-omap2/gpmc-nand.h
@@ -0,0 +1,27 @@
1/*
2 * arch/arm/mach-omap2/gpmc-nand.h
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#ifndef __OMAP2_GPMC_NAND_H
11#define __OMAP2_GPMC_NAND_H
12
13#include "gpmc.h"
14#include <linux/platform_data/mtd-nand-omap2.h>
15
16#if IS_ENABLED(CONFIG_MTD_NAND_OMAP2)
17extern int gpmc_nand_init(struct omap_nand_platform_data *d,
18 struct gpmc_timings *gpmc_t);
19#else
20static inline int gpmc_nand_init(struct omap_nand_platform_data *d,
21 struct gpmc_timings *gpmc_t)
22{
23 return 0;
24}
25#endif
26
27#endif
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 916716e1da3b..d102183ed9a5 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -16,15 +16,25 @@
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#include <linux/platform_data/mtd-onenand-omap2.h>
19#include <linux/err.h>
19 20
20#include <asm/mach/flash.h> 21#include <asm/mach/flash.h>
21 22
22#include <plat/gpmc.h> 23#include "gpmc.h"
23
24#include "soc.h" 24#include "soc.h"
25#include "gpmc-onenand.h"
25 26
26#define ONENAND_IO_SIZE SZ_128K 27#define ONENAND_IO_SIZE SZ_128K
27 28
29#define ONENAND_FLAG_SYNCREAD (1 << 0)
30#define ONENAND_FLAG_SYNCWRITE (1 << 1)
31#define ONENAND_FLAG_HF (1 << 2)
32#define ONENAND_FLAG_VHF (1 << 3)
33
34static unsigned onenand_flags;
35static unsigned latency;
36static int fclk_offset;
37
28static struct omap_onenand_platform_data *gpmc_onenand_data; 38static struct omap_onenand_platform_data *gpmc_onenand_data;
29 39
30static struct resource gpmc_onenand_resource = { 40static struct resource gpmc_onenand_resource = {
@@ -38,11 +48,9 @@ static struct platform_device gpmc_onenand_device = {
38 .resource = &gpmc_onenand_resource, 48 .resource = &gpmc_onenand_resource,
39}; 49};
40 50
41static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) 51static struct gpmc_timings omap2_onenand_calc_async_timings(void)
42{ 52{
43 struct gpmc_timings t; 53 struct gpmc_timings t;
44 u32 reg;
45 int err;
46 54
47 const int t_cer = 15; 55 const int t_cer = 15;
48 const int t_avdp = 12; 56 const int t_avdp = 12;
@@ -55,11 +63,6 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
55 const int t_wpl = 40; 63 const int t_wpl = 40;
56 const int t_wph = 30; 64 const int t_wph = 30;
57 65
58 /* Ensure sync read and sync write are disabled */
59 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
60 reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
61 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
62
63 memset(&t, 0, sizeof(t)); 66 memset(&t, 0, sizeof(t));
64 t.sync_clk = 0; 67 t.sync_clk = 0;
65 t.cs_on = 0; 68 t.cs_on = 0;
@@ -86,25 +89,30 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
86 t.cs_wr_off = t.we_off + gpmc_round_ns_to_ticks(t_wph); 89 t.cs_wr_off = t.we_off + gpmc_round_ns_to_ticks(t_wph);
87 t.wr_cycle = t.cs_wr_off + gpmc_round_ns_to_ticks(t_cez); 90 t.wr_cycle = t.cs_wr_off + gpmc_round_ns_to_ticks(t_cez);
88 91
92 return t;
93}
94
95static int gpmc_set_async_mode(int cs, struct gpmc_timings *t)
96{
89 /* Configure GPMC for asynchronous read */ 97 /* Configure GPMC for asynchronous read */
90 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, 98 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
91 GPMC_CONFIG1_DEVICESIZE_16 | 99 GPMC_CONFIG1_DEVICESIZE_16 |
92 GPMC_CONFIG1_MUXADDDATA); 100 GPMC_CONFIG1_MUXADDDATA);
93 101
94 err = gpmc_cs_set_timings(cs, &t); 102 return gpmc_cs_set_timings(cs, t);
95 if (err) 103}
96 return err; 104
105static void omap2_onenand_set_async_mode(void __iomem *onenand_base)
106{
107 u32 reg;
97 108
98 /* Ensure sync read and sync write are disabled */ 109 /* Ensure sync read and sync write are disabled */
99 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1); 110 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
100 reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE; 111 reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
101 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); 112 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
102
103 return 0;
104} 113}
105 114
106static void set_onenand_cfg(void __iomem *onenand_base, int latency, 115static void set_onenand_cfg(void __iomem *onenand_base)
107 int sync_read, int sync_write, int hf, int vhf)
108{ 116{
109 u32 reg; 117 u32 reg;
110 118
@@ -112,19 +120,19 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency,
112 reg &= ~((0x7 << ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7 << 9)); 120 reg &= ~((0x7 << ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7 << 9));
113 reg |= (latency << ONENAND_SYS_CFG1_BRL_SHIFT) | 121 reg |= (latency << ONENAND_SYS_CFG1_BRL_SHIFT) |
114 ONENAND_SYS_CFG1_BL_16; 122 ONENAND_SYS_CFG1_BL_16;
115 if (sync_read) 123 if (onenand_flags & ONENAND_FLAG_SYNCREAD)
116 reg |= ONENAND_SYS_CFG1_SYNC_READ; 124 reg |= ONENAND_SYS_CFG1_SYNC_READ;
117 else 125 else
118 reg &= ~ONENAND_SYS_CFG1_SYNC_READ; 126 reg &= ~ONENAND_SYS_CFG1_SYNC_READ;
119 if (sync_write) 127 if (onenand_flags & ONENAND_FLAG_SYNCWRITE)
120 reg |= ONENAND_SYS_CFG1_SYNC_WRITE; 128 reg |= ONENAND_SYS_CFG1_SYNC_WRITE;
121 else 129 else
122 reg &= ~ONENAND_SYS_CFG1_SYNC_WRITE; 130 reg &= ~ONENAND_SYS_CFG1_SYNC_WRITE;
123 if (hf) 131 if (onenand_flags & ONENAND_FLAG_HF)
124 reg |= ONENAND_SYS_CFG1_HF; 132 reg |= ONENAND_SYS_CFG1_HF;
125 else 133 else
126 reg &= ~ONENAND_SYS_CFG1_HF; 134 reg &= ~ONENAND_SYS_CFG1_HF;
127 if (vhf) 135 if (onenand_flags & ONENAND_FLAG_VHF)
128 reg |= ONENAND_SYS_CFG1_VHF; 136 reg |= ONENAND_SYS_CFG1_VHF;
129 else 137 else
130 reg &= ~ONENAND_SYS_CFG1_VHF; 138 reg &= ~ONENAND_SYS_CFG1_VHF;
@@ -132,21 +140,10 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency,
132} 140}
133 141
134static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg, 142static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg,
135 void __iomem *onenand_base, bool *clk_dep) 143 void __iomem *onenand_base)
136{ 144{
137 u16 ver = readw(onenand_base + ONENAND_REG_VERSION_ID); 145 u16 ver = readw(onenand_base + ONENAND_REG_VERSION_ID);
138 int freq = 0; 146 int freq;
139
140 if (cfg->get_freq) {
141 struct onenand_freq_info fi;
142
143 fi.maf_id = readw(onenand_base + ONENAND_REG_MANUFACTURER_ID);
144 fi.dev_id = readw(onenand_base + ONENAND_REG_DEVICE_ID);
145 fi.ver_id = ver;
146 freq = cfg->get_freq(&fi, clk_dep);
147 if (freq)
148 return freq;
149 }
150 147
151 switch ((ver >> 4) & 0xf) { 148 switch ((ver >> 4) & 0xf) {
152 case 0: 149 case 0:
@@ -172,9 +169,9 @@ static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg,
172 return freq; 169 return freq;
173} 170}
174 171
175static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, 172static struct gpmc_timings
176 void __iomem *onenand_base, 173omap2_onenand_calc_sync_timings(struct omap_onenand_platform_data *cfg,
177 int *freq_ptr) 174 int freq)
178{ 175{
179 struct gpmc_timings t; 176 struct gpmc_timings t;
180 const int t_cer = 15; 177 const int t_cer = 15;
@@ -184,29 +181,15 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
184 const int t_wpl = 40; 181 const int t_wpl = 40;
185 const int t_wph = 30; 182 const int t_wph = 30;
186 int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo; 183 int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
187 int div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency;
188 int first_time = 0, hf = 0, vhf = 0, sync_read = 0, sync_write = 0;
189 int err, ticks_cez;
190 int cs = cfg->cs, freq = *freq_ptr;
191 u32 reg; 184 u32 reg;
192 bool clk_dep = false; 185 int div, fclk_offset_ns, gpmc_clk_ns;
186 int ticks_cez;
187 int cs = cfg->cs;
193 188
194 if (cfg->flags & ONENAND_SYNC_READ) { 189 if (cfg->flags & ONENAND_SYNC_READ)
195 sync_read = 1; 190 onenand_flags = ONENAND_FLAG_SYNCREAD;
196 } else if (cfg->flags & ONENAND_SYNC_READWRITE) { 191 else if (cfg->flags & ONENAND_SYNC_READWRITE)
197 sync_read = 1; 192 onenand_flags = ONENAND_FLAG_SYNCREAD | ONENAND_FLAG_SYNCWRITE;
198 sync_write = 1;
199 } else
200 return omap2_onenand_set_async_mode(cs, onenand_base);
201
202 if (!freq) {
203 /* Very first call freq is not known */
204 err = omap2_onenand_set_async_mode(cs, onenand_base);
205 if (err)
206 return err;
207 freq = omap2_onenand_get_freq(cfg, onenand_base, &clk_dep);
208 first_time = 1;
209 }
210 193
211 switch (freq) { 194 switch (freq) {
212 case 104: 195 case 104:
@@ -244,44 +227,31 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
244 t_ach = 9; 227 t_ach = 9;
245 t_aavdh = 7; 228 t_aavdh = 7;
246 t_rdyo = 15; 229 t_rdyo = 15;
247 sync_write = 0; 230 onenand_flags &= ~ONENAND_FLAG_SYNCWRITE;
248 break; 231 break;
249 } 232 }
250 233
251 div = gpmc_cs_calc_divider(cs, min_gpmc_clk_period); 234 div = gpmc_calc_divider(min_gpmc_clk_period);
252 gpmc_clk_ns = gpmc_ticks_to_ns(div); 235 gpmc_clk_ns = gpmc_ticks_to_ns(div);
253 if (gpmc_clk_ns < 15) /* >66Mhz */ 236 if (gpmc_clk_ns < 15) /* >66Mhz */
254 hf = 1; 237 onenand_flags |= ONENAND_FLAG_HF;
238 else
239 onenand_flags &= ~ONENAND_FLAG_HF;
255 if (gpmc_clk_ns < 12) /* >83Mhz */ 240 if (gpmc_clk_ns < 12) /* >83Mhz */
256 vhf = 1; 241 onenand_flags |= ONENAND_FLAG_VHF;
257 if (vhf) 242 else
243 onenand_flags &= ~ONENAND_FLAG_VHF;
244 if (onenand_flags & ONENAND_FLAG_VHF)
258 latency = 8; 245 latency = 8;
259 else if (hf) 246 else if (onenand_flags & ONENAND_FLAG_HF)
260 latency = 6; 247 latency = 6;
261 else if (gpmc_clk_ns >= 25) /* 40 MHz*/ 248 else if (gpmc_clk_ns >= 25) /* 40 MHz*/
262 latency = 3; 249 latency = 3;
263 else 250 else
264 latency = 4; 251 latency = 4;
265 252
266 if (clk_dep) { 253 /* Set synchronous read timings */
267 if (gpmc_clk_ns < 12) { /* >83Mhz */ 254 memset(&t, 0, sizeof(t));
268 t_ces = 3;
269 t_avds = 4;
270 } else if (gpmc_clk_ns < 15) { /* >66Mhz */
271 t_ces = 5;
272 t_avds = 4;
273 } else if (gpmc_clk_ns < 25) { /* >40Mhz */
274 t_ces = 6;
275 t_avds = 5;
276 } else {
277 t_ces = 7;
278 t_avds = 7;
279 }
280 }
281
282 if (first_time)
283 set_onenand_cfg(onenand_base, latency,
284 sync_read, sync_write, hf, vhf);
285 255
286 if (div == 1) { 256 if (div == 1) {
287 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2); 257 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2);
@@ -307,8 +277,6 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
307 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG4, reg); 277 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG4, reg);
308 } 278 }
309 279
310 /* Set synchronous read timings */
311 memset(&t, 0, sizeof(t));
312 t.sync_clk = min_gpmc_clk_period; 280 t.sync_clk = min_gpmc_clk_period;
313 t.cs_on = 0; 281 t.cs_on = 0;
314 t.adv_on = 0; 282 t.adv_on = 0;
@@ -330,7 +298,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
330 ticks_cez); 298 ticks_cez);
331 299
332 /* Write */ 300 /* Write */
333 if (sync_write) { 301 if (onenand_flags & ONENAND_FLAG_SYNCWRITE) {
334 t.adv_wr_off = t.adv_rd_off; 302 t.adv_wr_off = t.adv_rd_off;
335 t.we_on = 0; 303 t.we_on = 0;
336 t.we_off = t.cs_rd_off; 304 t.we_off = t.cs_rd_off;
@@ -355,6 +323,14 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
355 } 323 }
356 } 324 }
357 325
326 return t;
327}
328
329static int gpmc_set_sync_mode(int cs, struct gpmc_timings *t)
330{
331 unsigned sync_read = onenand_flags & ONENAND_FLAG_SYNCREAD;
332 unsigned sync_write = onenand_flags & ONENAND_FLAG_SYNCWRITE;
333
358 /* Configure GPMC for synchronous read */ 334 /* Configure GPMC for synchronous read */
359 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, 335 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
360 GPMC_CONFIG1_WRAPBURST_SUPP | 336 GPMC_CONFIG1_WRAPBURST_SUPP |
@@ -371,11 +347,45 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
371 GPMC_CONFIG1_DEVICETYPE_NOR | 347 GPMC_CONFIG1_DEVICETYPE_NOR |
372 GPMC_CONFIG1_MUXADDDATA); 348 GPMC_CONFIG1_MUXADDDATA);
373 349
374 err = gpmc_cs_set_timings(cs, &t); 350 return gpmc_cs_set_timings(cs, t);
375 if (err) 351}
376 return err; 352
353static int omap2_onenand_setup_async(void __iomem *onenand_base)
354{
355 struct gpmc_timings t;
356 int ret;
357
358 omap2_onenand_set_async_mode(onenand_base);
377 359
378 set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf, vhf); 360 t = omap2_onenand_calc_async_timings();
361
362 ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t);
363 if (IS_ERR_VALUE(ret))
364 return ret;
365
366 omap2_onenand_set_async_mode(onenand_base);
367
368 return 0;
369}
370
371static int omap2_onenand_setup_sync(void __iomem *onenand_base, int *freq_ptr)
372{
373 int ret, freq = *freq_ptr;
374 struct gpmc_timings t;
375
376 if (!freq) {
377 /* Very first call freq is not known */
378 freq = omap2_onenand_get_freq(gpmc_onenand_data, onenand_base);
379 set_onenand_cfg(onenand_base);
380 }
381
382 t = omap2_onenand_calc_sync_timings(gpmc_onenand_data, freq);
383
384 ret = gpmc_set_sync_mode(gpmc_onenand_data->cs, &t);
385 if (IS_ERR_VALUE(ret))
386 return ret;
387
388 set_onenand_cfg(onenand_base);
379 389
380 *freq_ptr = freq; 390 *freq_ptr = freq;
381 391
@@ -385,15 +395,22 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
385static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr) 395static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
386{ 396{
387 struct device *dev = &gpmc_onenand_device.dev; 397 struct device *dev = &gpmc_onenand_device.dev;
398 unsigned l = ONENAND_SYNC_READ | ONENAND_SYNC_READWRITE;
399 int ret;
388 400
389 /* Set sync timings in GPMC */ 401 ret = omap2_onenand_setup_async(onenand_base);
390 if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, 402 if (ret) {
391 freq_ptr) < 0) { 403 dev_err(dev, "unable to set to async mode\n");
392 dev_err(dev, "Unable to set synchronous mode\n"); 404 return ret;
393 return -EINVAL;
394 } 405 }
395 406
396 return 0; 407 if (!(gpmc_onenand_data->flags & l))
408 return 0;
409
410 ret = omap2_onenand_setup_sync(onenand_base, freq_ptr);
411 if (ret)
412 dev_err(dev, "unable to set to sync mode\n");
413 return ret;
397} 414}
398 415
399void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) 416void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
@@ -411,6 +428,11 @@ void __init gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
411 gpmc_onenand_data->flags |= ONENAND_SYNC_READ; 428 gpmc_onenand_data->flags |= ONENAND_SYNC_READ;
412 } 429 }
413 430
431 if (cpu_is_omap34xx())
432 gpmc_onenand_data->flags |= ONENAND_IN_OMAP34XX;
433 else
434 gpmc_onenand_data->flags &= ~ONENAND_IN_OMAP34XX;
435
414 err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE, 436 err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE,
415 (unsigned long *)&gpmc_onenand_resource.start); 437 (unsigned long *)&gpmc_onenand_resource.start);
416 if (err < 0) { 438 if (err < 0) {
diff --git a/arch/arm/mach-omap2/gpmc-onenand.h b/arch/arm/mach-omap2/gpmc-onenand.h
new file mode 100644
index 000000000000..216f23a8b45c
--- /dev/null
+++ b/arch/arm/mach-omap2/gpmc-onenand.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/mach-omap2/gpmc-onenand.h
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#ifndef __OMAP2_GPMC_ONENAND_H
11#define __OMAP2_GPMC_ONENAND_H
12
13#include <linux/platform_data/mtd-onenand-omap2.h>
14
15#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
16extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
17#else
18#define board_onenand_data NULL
19static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
20{
21}
22#endif
23
24#endif
diff --git a/arch/arm/mach-omap2/gpmc-smc91x.c b/arch/arm/mach-omap2/gpmc-smc91x.c
index 565475310374..6eed907d594c 100644
--- a/arch/arm/mach-omap2/gpmc-smc91x.c
+++ b/arch/arm/mach-omap2/gpmc-smc91x.c
@@ -17,7 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/smc91x.h> 18#include <linux/smc91x.h>
19 19
20#include <plat/gpmc.h> 20#include "gpmc.h"
21#include "gpmc-smc91x.h" 21#include "gpmc-smc91x.h"
22 22
23#include "soc.h" 23#include "soc.h"
diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c
index 249a0b440cd6..ef990118d32b 100644
--- a/arch/arm/mach-omap2/gpmc-smsc911x.c
+++ b/arch/arm/mach-omap2/gpmc-smsc911x.c
@@ -20,7 +20,7 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/smsc911x.h> 21#include <linux/smsc911x.h>
22 22
23#include <plat/gpmc.h> 23#include "gpmc.h"
24#include "gpmc-smsc911x.h" 24#include "gpmc-smsc911x.h"
25 25
26static struct resource gpmc_smsc911x_resources[] = { 26static struct resource gpmc_smsc911x_resources[] = {
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 92b5718fa722..bf6117c32f4b 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -26,16 +26,14 @@
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28 28
29#include <asm/mach-types.h> 29#include <linux/platform_data/mtd-nand-omap2.h>
30#include <plat/gpmc.h>
31 30
32#include <plat/cpu.h> 31#include <asm/mach-types.h>
33#include <plat/gpmc.h>
34#include <plat/sdrc.h>
35#include <plat/omap_device.h>
36 32
37#include "soc.h" 33#include "soc.h"
38#include "common.h" 34#include "common.h"
35#include "omap_device.h"
36#include "gpmc.h"
39 37
40#define DEVICE_NAME "omap-gpmc" 38#define DEVICE_NAME "omap-gpmc"
41 39
@@ -59,6 +57,9 @@
59#define GPMC_ECC_SIZE_CONFIG 0x1fc 57#define GPMC_ECC_SIZE_CONFIG 0x1fc
60#define GPMC_ECC1_RESULT 0x200 58#define GPMC_ECC1_RESULT 0x200
61#define GPMC_ECC_BCH_RESULT_0 0x240 /* not available on OMAP2 */ 59#define GPMC_ECC_BCH_RESULT_0 0x240 /* not available on OMAP2 */
60#define GPMC_ECC_BCH_RESULT_1 0x244 /* not available on OMAP2 */
61#define GPMC_ECC_BCH_RESULT_2 0x248 /* not available on OMAP2 */
62#define GPMC_ECC_BCH_RESULT_3 0x24c /* not available on OMAP2 */
62 63
63/* GPMC ECC control settings */ 64/* GPMC ECC control settings */
64#define GPMC_ECC_CTRL_ECCCLEAR 0x100 65#define GPMC_ECC_CTRL_ECCCLEAR 0x100
@@ -75,6 +76,7 @@
75 76
76#define GPMC_CS0_OFFSET 0x60 77#define GPMC_CS0_OFFSET 0x60
77#define GPMC_CS_SIZE 0x30 78#define GPMC_CS_SIZE 0x30
79#define GPMC_BCH_SIZE 0x10
78 80
79#define GPMC_MEM_START 0x00000000 81#define GPMC_MEM_START 0x00000000
80#define GPMC_MEM_END 0x3FFFFFFF 82#define GPMC_MEM_END 0x3FFFFFFF
@@ -137,7 +139,6 @@ static struct resource gpmc_mem_root;
137static struct resource gpmc_cs_mem[GPMC_CS_NUM]; 139static struct resource gpmc_cs_mem[GPMC_CS_NUM];
138static DEFINE_SPINLOCK(gpmc_mem_lock); 140static DEFINE_SPINLOCK(gpmc_mem_lock);
139static unsigned int gpmc_cs_map; /* flag for cs which are initialized */ 141static unsigned int gpmc_cs_map; /* flag for cs which are initialized */
140static int gpmc_ecc_used = -EINVAL; /* cs using ecc engine */
141static struct device *gpmc_dev; 142static struct device *gpmc_dev;
142static int gpmc_irq; 143static int gpmc_irq;
143static resource_size_t phys_base, mem_size; 144static resource_size_t phys_base, mem_size;
@@ -158,22 +159,6 @@ static u32 gpmc_read_reg(int idx)
158 return __raw_readl(gpmc_base + idx); 159 return __raw_readl(gpmc_base + idx);
159} 160}
160 161
161static void gpmc_cs_write_byte(int cs, int idx, u8 val)
162{
163 void __iomem *reg_addr;
164
165 reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
166 __raw_writeb(val, reg_addr);
167}
168
169static u8 gpmc_cs_read_byte(int cs, int idx)
170{
171 void __iomem *reg_addr;
172
173 reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
174 return __raw_readb(reg_addr);
175}
176
177void gpmc_cs_write_reg(int cs, int idx, u32 val) 162void gpmc_cs_write_reg(int cs, int idx, u32 val)
178{ 163{
179 void __iomem *reg_addr; 164 void __iomem *reg_addr;
@@ -288,7 +273,7 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit,
288 return -1 273 return -1
289#endif 274#endif
290 275
291int gpmc_cs_calc_divider(int cs, unsigned int sync_clk) 276int gpmc_calc_divider(unsigned int sync_clk)
292{ 277{
293 int div; 278 int div;
294 u32 l; 279 u32 l;
@@ -308,7 +293,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
308 int div; 293 int div;
309 u32 l; 294 u32 l;
310 295
311 div = gpmc_cs_calc_divider(cs, t->sync_clk); 296 div = gpmc_calc_divider(t->sync_clk);
312 if (div < 0) 297 if (div < 0)
313 return div; 298 return div;
314 299
@@ -509,44 +494,6 @@ void gpmc_cs_free(int cs)
509EXPORT_SYMBOL(gpmc_cs_free); 494EXPORT_SYMBOL(gpmc_cs_free);
510 495
511/** 496/**
512 * gpmc_read_status - read access request to get the different gpmc status
513 * @cmd: command type
514 * @return status
515 */
516int gpmc_read_status(int cmd)
517{
518 int status = -EINVAL;
519 u32 regval = 0;
520
521 switch (cmd) {
522 case GPMC_GET_IRQ_STATUS:
523 status = gpmc_read_reg(GPMC_IRQSTATUS);
524 break;
525
526 case GPMC_PREFETCH_FIFO_CNT:
527 regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
528 status = GPMC_PREFETCH_STATUS_FIFO_CNT(regval);
529 break;
530
531 case GPMC_PREFETCH_COUNT:
532 regval = gpmc_read_reg(GPMC_PREFETCH_STATUS);
533 status = GPMC_PREFETCH_STATUS_COUNT(regval);
534 break;
535
536 case GPMC_STATUS_BUFFER:
537 regval = gpmc_read_reg(GPMC_STATUS);
538 /* 1 : buffer is available to write */
539 status = regval & GPMC_STATUS_BUFF_EMPTY;
540 break;
541
542 default:
543 printk(KERN_ERR "gpmc_read_status: Not supported\n");
544 }
545 return status;
546}
547EXPORT_SYMBOL(gpmc_read_status);
548
549/**
550 * gpmc_cs_configure - write request to configure gpmc 497 * gpmc_cs_configure - write request to configure gpmc
551 * @cs: chip select number 498 * @cs: chip select number
552 * @cmd: command type 499 * @cmd: command type
@@ -614,121 +561,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
614} 561}
615EXPORT_SYMBOL(gpmc_cs_configure); 562EXPORT_SYMBOL(gpmc_cs_configure);
616 563
617/**
618 * gpmc_nand_read - nand specific read access request
619 * @cs: chip select number
620 * @cmd: command type
621 */
622int gpmc_nand_read(int cs, int cmd)
623{
624 int rval = -EINVAL;
625
626 switch (cmd) {
627 case GPMC_NAND_DATA:
628 rval = gpmc_cs_read_byte(cs, GPMC_CS_NAND_DATA);
629 break;
630
631 default:
632 printk(KERN_ERR "gpmc_read_nand_ctrl: Not supported\n");
633 }
634 return rval;
635}
636EXPORT_SYMBOL(gpmc_nand_read);
637
638/**
639 * gpmc_nand_write - nand specific write request
640 * @cs: chip select number
641 * @cmd: command type
642 * @wval: value to write
643 */
644int gpmc_nand_write(int cs, int cmd, int wval)
645{
646 int err = 0;
647
648 switch (cmd) {
649 case GPMC_NAND_COMMAND:
650 gpmc_cs_write_byte(cs, GPMC_CS_NAND_COMMAND, wval);
651 break;
652
653 case GPMC_NAND_ADDRESS:
654 gpmc_cs_write_byte(cs, GPMC_CS_NAND_ADDRESS, wval);
655 break;
656
657 case GPMC_NAND_DATA:
658 gpmc_cs_write_byte(cs, GPMC_CS_NAND_DATA, wval);
659
660 default:
661 printk(KERN_ERR "gpmc_write_nand_ctrl: Not supported\n");
662 err = -EINVAL;
663 }
664 return err;
665}
666EXPORT_SYMBOL(gpmc_nand_write);
667
668
669
670/**
671 * gpmc_prefetch_enable - configures and starts prefetch transfer
672 * @cs: cs (chip select) number
673 * @fifo_th: fifo threshold to be used for read/ write
674 * @dma_mode: dma mode enable (1) or disable (0)
675 * @u32_count: number of bytes to be transferred
676 * @is_write: prefetch read(0) or write post(1) mode
677 */
678int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
679 unsigned int u32_count, int is_write)
680{
681
682 if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) {
683 pr_err("gpmc: fifo threshold is not supported\n");
684 return -1;
685 } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
686 /* Set the amount of bytes to be prefetched */
687 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
688
689 /* Set dma/mpu mode, the prefetch read / post write and
690 * enable the engine. Set which cs is has requested for.
691 */
692 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) |
693 PREFETCH_FIFOTHRESHOLD(fifo_th) |
694 ENABLE_PREFETCH |
695 (dma_mode << DMA_MPU_MODE) |
696 (0x1 & is_write)));
697
698 /* Start the prefetch engine */
699 gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x1);
700 } else {
701 return -EBUSY;
702 }
703
704 return 0;
705}
706EXPORT_SYMBOL(gpmc_prefetch_enable);
707
708/**
709 * gpmc_prefetch_reset - disables and stops the prefetch engine
710 */
711int gpmc_prefetch_reset(int cs)
712{
713 u32 config1;
714
715 /* check if the same module/cs is trying to reset */
716 config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1);
717 if (((config1 >> CS_NUM_SHIFT) & 0x7) != cs)
718 return -EINVAL;
719
720 /* Stop the PFPW engine */
721 gpmc_write_reg(GPMC_PREFETCH_CONTROL, 0x0);
722
723 /* Reset/disable the PFPW engine */
724 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, 0x0);
725
726 return 0;
727}
728EXPORT_SYMBOL(gpmc_prefetch_reset);
729
730void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs) 564void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
731{ 565{
566 int i;
567
732 reg->gpmc_status = gpmc_base + GPMC_STATUS; 568 reg->gpmc_status = gpmc_base + GPMC_STATUS;
733 reg->gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET + 569 reg->gpmc_nand_command = gpmc_base + GPMC_CS0_OFFSET +
734 GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs; 570 GPMC_CS_NAND_COMMAND + GPMC_CS_SIZE * cs;
@@ -744,7 +580,17 @@ void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
744 reg->gpmc_ecc_control = gpmc_base + GPMC_ECC_CONTROL; 580 reg->gpmc_ecc_control = gpmc_base + GPMC_ECC_CONTROL;
745 reg->gpmc_ecc_size_config = gpmc_base + GPMC_ECC_SIZE_CONFIG; 581 reg->gpmc_ecc_size_config = gpmc_base + GPMC_ECC_SIZE_CONFIG;
746 reg->gpmc_ecc1_result = gpmc_base + GPMC_ECC1_RESULT; 582 reg->gpmc_ecc1_result = gpmc_base + GPMC_ECC1_RESULT;
747 reg->gpmc_bch_result0 = gpmc_base + GPMC_ECC_BCH_RESULT_0; 583
584 for (i = 0; i < GPMC_BCH_NUM_REMAINDER; i++) {
585 reg->gpmc_bch_result0[i] = gpmc_base + GPMC_ECC_BCH_RESULT_0 +
586 GPMC_BCH_SIZE * i;
587 reg->gpmc_bch_result1[i] = gpmc_base + GPMC_ECC_BCH_RESULT_1 +
588 GPMC_BCH_SIZE * i;
589 reg->gpmc_bch_result2[i] = gpmc_base + GPMC_ECC_BCH_RESULT_2 +
590 GPMC_BCH_SIZE * i;
591 reg->gpmc_bch_result3[i] = gpmc_base + GPMC_ECC_BCH_RESULT_3 +
592 GPMC_BCH_SIZE * i;
593 }
748} 594}
749 595
750int gpmc_get_client_irq(unsigned irq_config) 596int gpmc_get_client_irq(unsigned irq_config)
@@ -1093,267 +939,3 @@ void omap3_gpmc_restore_context(void)
1093 } 939 }
1094} 940}
1095#endif /* CONFIG_ARCH_OMAP3 */ 941#endif /* CONFIG_ARCH_OMAP3 */
1096
1097/**
1098 * gpmc_enable_hwecc - enable hardware ecc functionality
1099 * @cs: chip select number
1100 * @mode: read/write mode
1101 * @dev_width: device bus width(1 for x16, 0 for x8)
1102 * @ecc_size: bytes for which ECC will be generated
1103 */
1104int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size)
1105{
1106 unsigned int val;
1107
1108 /* check if ecc module is in used */
1109 if (gpmc_ecc_used != -EINVAL)
1110 return -EINVAL;
1111
1112 gpmc_ecc_used = cs;
1113
1114 /* clear ecc and enable bits */
1115 gpmc_write_reg(GPMC_ECC_CONTROL,
1116 GPMC_ECC_CTRL_ECCCLEAR |
1117 GPMC_ECC_CTRL_ECCREG1);
1118
1119 /* program ecc and result sizes */
1120 val = ((((ecc_size >> 1) - 1) << 22) | (0x0000000F));
1121 gpmc_write_reg(GPMC_ECC_SIZE_CONFIG, val);
1122
1123 switch (mode) {
1124 case GPMC_ECC_READ:
1125 case GPMC_ECC_WRITE:
1126 gpmc_write_reg(GPMC_ECC_CONTROL,
1127 GPMC_ECC_CTRL_ECCCLEAR |
1128 GPMC_ECC_CTRL_ECCREG1);
1129 break;
1130 case GPMC_ECC_READSYN:
1131 gpmc_write_reg(GPMC_ECC_CONTROL,
1132 GPMC_ECC_CTRL_ECCCLEAR |
1133 GPMC_ECC_CTRL_ECCDISABLE);
1134 break;
1135 default:
1136 printk(KERN_INFO "Error: Unrecognized Mode[%d]!\n", mode);
1137 break;
1138 }
1139
1140 /* (ECC 16 or 8 bit col) | ( CS ) | ECC Enable */
1141 val = (dev_width << 7) | (cs << 1) | (0x1);
1142 gpmc_write_reg(GPMC_ECC_CONFIG, val);
1143 return 0;
1144}
1145EXPORT_SYMBOL_GPL(gpmc_enable_hwecc);
1146
1147/**
1148 * gpmc_calculate_ecc - generate non-inverted ecc bytes
1149 * @cs: chip select number
1150 * @dat: data pointer over which ecc is computed
1151 * @ecc_code: ecc code buffer
1152 *
1153 * Using non-inverted ECC is considered ugly since writing a blank
1154 * page (padding) will clear the ECC bytes. This is not a problem as long
1155 * no one is trying to write data on the seemingly unused page. Reading
1156 * an erased page will produce an ECC mismatch between generated and read
1157 * ECC bytes that has to be dealt with separately.
1158 */
1159int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code)
1160{
1161 unsigned int val = 0x0;
1162
1163 if (gpmc_ecc_used != cs)
1164 return -EINVAL;
1165
1166 /* read ecc result */
1167 val = gpmc_read_reg(GPMC_ECC1_RESULT);
1168 *ecc_code++ = val; /* P128e, ..., P1e */
1169 *ecc_code++ = val >> 16; /* P128o, ..., P1o */
1170 /* P2048o, P1024o, P512o, P256o, P2048e, P1024e, P512e, P256e */
1171 *ecc_code++ = ((val >> 8) & 0x0f) | ((val >> 20) & 0xf0);
1172
1173 gpmc_ecc_used = -EINVAL;
1174 return 0;
1175}
1176EXPORT_SYMBOL_GPL(gpmc_calculate_ecc);
1177
1178#ifdef CONFIG_ARCH_OMAP3
1179
1180/**
1181 * gpmc_init_hwecc_bch - initialize hardware BCH ecc functionality
1182 * @cs: chip select number
1183 * @nsectors: how many 512-byte sectors to process
1184 * @nerrors: how many errors to correct per sector (4 or 8)
1185 *
1186 * This function must be executed before any call to gpmc_enable_hwecc_bch.
1187 */
1188int gpmc_init_hwecc_bch(int cs, int nsectors, int nerrors)
1189{
1190 /* check if ecc module is in use */
1191 if (gpmc_ecc_used != -EINVAL)
1192 return -EINVAL;
1193
1194 /* support only OMAP3 class */
1195 if (!cpu_is_omap34xx()) {
1196 printk(KERN_ERR "BCH ecc is not supported on this CPU\n");
1197 return -EINVAL;
1198 }
1199
1200 /*
1201 * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1.
1202 * Other chips may be added if confirmed to work.
1203 */
1204 if ((nerrors == 4) &&
1205 (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) {
1206 printk(KERN_ERR "BCH 4-bit mode is not supported on this CPU\n");
1207 return -EINVAL;
1208 }
1209
1210 /* sanity check */
1211 if (nsectors > 8) {
1212 printk(KERN_ERR "BCH cannot process %d sectors (max is 8)\n",
1213 nsectors);
1214 return -EINVAL;
1215 }
1216
1217 return 0;
1218}
1219EXPORT_SYMBOL_GPL(gpmc_init_hwecc_bch);
1220
1221/**
1222 * gpmc_enable_hwecc_bch - enable hardware BCH ecc functionality
1223 * @cs: chip select number
1224 * @mode: read/write mode
1225 * @dev_width: device bus width(1 for x16, 0 for x8)
1226 * @nsectors: how many 512-byte sectors to process
1227 * @nerrors: how many errors to correct per sector (4 or 8)
1228 */
1229int gpmc_enable_hwecc_bch(int cs, int mode, int dev_width, int nsectors,
1230 int nerrors)
1231{
1232 unsigned int val;
1233
1234 /* check if ecc module is in use */
1235 if (gpmc_ecc_used != -EINVAL)
1236 return -EINVAL;
1237
1238 gpmc_ecc_used = cs;
1239
1240 /* clear ecc and enable bits */
1241 gpmc_write_reg(GPMC_ECC_CONTROL, 0x1);
1242
1243 /*
1244 * When using BCH, sector size is hardcoded to 512 bytes.
1245 * Here we are using wrapping mode 6 both for reading and writing, with:
1246 * size0 = 0 (no additional protected byte in spare area)
1247 * size1 = 32 (skip 32 nibbles = 16 bytes per sector in spare area)
1248 */
1249 gpmc_write_reg(GPMC_ECC_SIZE_CONFIG, (32 << 22) | (0 << 12));
1250
1251 /* BCH configuration */
1252 val = ((1 << 16) | /* enable BCH */
1253 (((nerrors == 8) ? 1 : 0) << 12) | /* 8 or 4 bits */
1254 (0x06 << 8) | /* wrap mode = 6 */
1255 (dev_width << 7) | /* bus width */
1256 (((nsectors-1) & 0x7) << 4) | /* number of sectors */
1257 (cs << 1) | /* ECC CS */
1258 (0x1)); /* enable ECC */
1259
1260 gpmc_write_reg(GPMC_ECC_CONFIG, val);
1261 gpmc_write_reg(GPMC_ECC_CONTROL, 0x101);
1262 return 0;
1263}
1264EXPORT_SYMBOL_GPL(gpmc_enable_hwecc_bch);
1265
1266/**
1267 * gpmc_calculate_ecc_bch4 - Generate 7 ecc bytes per sector of 512 data bytes
1268 * @cs: chip select number
1269 * @dat: The pointer to data on which ecc is computed
1270 * @ecc: The ecc output buffer
1271 */
1272int gpmc_calculate_ecc_bch4(int cs, const u_char *dat, u_char *ecc)
1273{
1274 int i;
1275 unsigned long nsectors, reg, val1, val2;
1276
1277 if (gpmc_ecc_used != cs)
1278 return -EINVAL;
1279
1280 nsectors = ((gpmc_read_reg(GPMC_ECC_CONFIG) >> 4) & 0x7) + 1;
1281
1282 for (i = 0; i < nsectors; i++) {
1283
1284 reg = GPMC_ECC_BCH_RESULT_0 + 16*i;
1285
1286 /* Read hw-computed remainder */
1287 val1 = gpmc_read_reg(reg + 0);
1288 val2 = gpmc_read_reg(reg + 4);
1289
1290 /*
1291 * Add constant polynomial to remainder, in order to get an ecc
1292 * sequence of 0xFFs for a buffer filled with 0xFFs; and
1293 * left-justify the resulting polynomial.
1294 */
1295 *ecc++ = 0x28 ^ ((val2 >> 12) & 0xFF);
1296 *ecc++ = 0x13 ^ ((val2 >> 4) & 0xFF);
1297 *ecc++ = 0xcc ^ (((val2 & 0xF) << 4)|((val1 >> 28) & 0xF));
1298 *ecc++ = 0x39 ^ ((val1 >> 20) & 0xFF);
1299 *ecc++ = 0x96 ^ ((val1 >> 12) & 0xFF);
1300 *ecc++ = 0xac ^ ((val1 >> 4) & 0xFF);
1301 *ecc++ = 0x7f ^ ((val1 & 0xF) << 4);
1302 }
1303
1304 gpmc_ecc_used = -EINVAL;
1305 return 0;
1306}
1307EXPORT_SYMBOL_GPL(gpmc_calculate_ecc_bch4);
1308
1309/**
1310 * gpmc_calculate_ecc_bch8 - Generate 13 ecc bytes per block of 512 data bytes
1311 * @cs: chip select number
1312 * @dat: The pointer to data on which ecc is computed
1313 * @ecc: The ecc output buffer
1314 */
1315int gpmc_calculate_ecc_bch8(int cs, const u_char *dat, u_char *ecc)
1316{
1317 int i;
1318 unsigned long nsectors, reg, val1, val2, val3, val4;
1319
1320 if (gpmc_ecc_used != cs)
1321 return -EINVAL;
1322
1323 nsectors = ((gpmc_read_reg(GPMC_ECC_CONFIG) >> 4) & 0x7) + 1;
1324
1325 for (i = 0; i < nsectors; i++) {
1326
1327 reg = GPMC_ECC_BCH_RESULT_0 + 16*i;
1328
1329 /* Read hw-computed remainder */
1330 val1 = gpmc_read_reg(reg + 0);
1331 val2 = gpmc_read_reg(reg + 4);
1332 val3 = gpmc_read_reg(reg + 8);
1333 val4 = gpmc_read_reg(reg + 12);
1334
1335 /*
1336 * Add constant polynomial to remainder, in order to get an ecc
1337 * sequence of 0xFFs for a buffer filled with 0xFFs.
1338 */
1339 *ecc++ = 0xef ^ (val4 & 0xFF);
1340 *ecc++ = 0x51 ^ ((val3 >> 24) & 0xFF);
1341 *ecc++ = 0x2e ^ ((val3 >> 16) & 0xFF);
1342 *ecc++ = 0x09 ^ ((val3 >> 8) & 0xFF);
1343 *ecc++ = 0xed ^ (val3 & 0xFF);
1344 *ecc++ = 0x93 ^ ((val2 >> 24) & 0xFF);
1345 *ecc++ = 0x9a ^ ((val2 >> 16) & 0xFF);
1346 *ecc++ = 0xc2 ^ ((val2 >> 8) & 0xFF);
1347 *ecc++ = 0x97 ^ (val2 & 0xFF);
1348 *ecc++ = 0x79 ^ ((val1 >> 24) & 0xFF);
1349 *ecc++ = 0xe5 ^ ((val1 >> 16) & 0xFF);
1350 *ecc++ = 0x24 ^ ((val1 >> 8) & 0xFF);
1351 *ecc++ = 0xb5 ^ (val1 & 0xFF);
1352 }
1353
1354 gpmc_ecc_used = -EINVAL;
1355 return 0;
1356}
1357EXPORT_SYMBOL_GPL(gpmc_calculate_ecc_bch8);
1358
1359#endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/mach-omap2/gpmc.h
index 2e6e2597178c..79f4dfc2adb3 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/mach-omap2/gpmc.h
@@ -11,6 +11,8 @@
11#ifndef __OMAP2_GPMC_H 11#ifndef __OMAP2_GPMC_H
12#define __OMAP2_GPMC_H 12#define __OMAP2_GPMC_H
13 13
14#include <linux/platform_data/mtd-nand-omap2.h>
15
14/* Maximum Number of Chip Selects */ 16/* Maximum Number of Chip Selects */
15#define GPMC_CS_NUM 8 17#define GPMC_CS_NUM 8
16 18
@@ -32,15 +34,6 @@
32#define GPMC_SET_IRQ_STATUS 0x00000004 34#define GPMC_SET_IRQ_STATUS 0x00000004
33#define GPMC_CONFIG_WP 0x00000005 35#define GPMC_CONFIG_WP 0x00000005
34 36
35#define GPMC_GET_IRQ_STATUS 0x00000006
36#define GPMC_PREFETCH_FIFO_CNT 0x00000007 /* bytes available in FIFO for r/w */
37#define GPMC_PREFETCH_COUNT 0x00000008 /* remaining bytes to be read/write*/
38#define GPMC_STATUS_BUFFER 0x00000009 /* 1: buffer is available to write */
39
40#define GPMC_NAND_COMMAND 0x0000000a
41#define GPMC_NAND_ADDRESS 0x0000000b
42#define GPMC_NAND_DATA 0x0000000c
43
44#define GPMC_ENABLE_IRQ 0x0000000d 37#define GPMC_ENABLE_IRQ 0x0000000d
45 38
46/* ECC commands */ 39/* ECC commands */
@@ -76,25 +69,10 @@
76#define GPMC_DEVICETYPE_NOR 0 69#define GPMC_DEVICETYPE_NOR 0
77#define GPMC_DEVICETYPE_NAND 2 70#define GPMC_DEVICETYPE_NAND 2
78#define GPMC_CONFIG_WRITEPROTECT 0x00000010 71#define GPMC_CONFIG_WRITEPROTECT 0x00000010
79#define GPMC_STATUS_BUFF_EMPTY 0x00000001
80#define WR_RD_PIN_MONITORING 0x00600000 72#define WR_RD_PIN_MONITORING 0x00600000
81#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F)
82#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff)
83#define GPMC_IRQ_FIFOEVENTENABLE 0x01 73#define GPMC_IRQ_FIFOEVENTENABLE 0x01
84#define GPMC_IRQ_COUNT_EVENT 0x02 74#define GPMC_IRQ_COUNT_EVENT 0x02
85 75
86#define PREFETCH_FIFOTHRESHOLD_MAX 0x40
87#define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8)
88
89enum omap_ecc {
90 /* 1-bit ecc: stored at end of spare area */
91 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
92 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
93 /* 1-bit ecc: stored at beginning of spare area as romcode */
94 OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
95 OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
96 OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
97};
98 76
99/* 77/*
100 * Note that all values in this struct are in nanoseconds except sync_clk 78 * Note that all values in this struct are in nanoseconds except sync_clk
@@ -133,22 +111,6 @@ struct gpmc_timings {
133 u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */ 111 u16 wr_data_mux_bus; /* WRDATAONADMUXBUS */
134}; 112};
135 113
136struct gpmc_nand_regs {
137 void __iomem *gpmc_status;
138 void __iomem *gpmc_nand_command;
139 void __iomem *gpmc_nand_address;
140 void __iomem *gpmc_nand_data;
141 void __iomem *gpmc_prefetch_config1;
142 void __iomem *gpmc_prefetch_config2;
143 void __iomem *gpmc_prefetch_control;
144 void __iomem *gpmc_prefetch_status;
145 void __iomem *gpmc_ecc_config;
146 void __iomem *gpmc_ecc_control;
147 void __iomem *gpmc_ecc_size_config;
148 void __iomem *gpmc_ecc1_result;
149 void __iomem *gpmc_bch_result0;
150};
151
152extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs); 114extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
153extern int gpmc_get_client_irq(unsigned irq_config); 115extern int gpmc_get_client_irq(unsigned irq_config);
154 116
@@ -160,31 +122,14 @@ extern unsigned long gpmc_get_fclk_period(void);
160 122
161extern void gpmc_cs_write_reg(int cs, int idx, u32 val); 123extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
162extern u32 gpmc_cs_read_reg(int cs, int idx); 124extern u32 gpmc_cs_read_reg(int cs, int idx);
163extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk); 125extern int gpmc_calc_divider(unsigned int sync_clk);
164extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t); 126extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
165extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base); 127extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
166extern void gpmc_cs_free(int cs); 128extern void gpmc_cs_free(int cs);
167extern int gpmc_cs_set_reserved(int cs, int reserved); 129extern int gpmc_cs_set_reserved(int cs, int reserved);
168extern int gpmc_cs_reserved(int cs); 130extern int gpmc_cs_reserved(int cs);
169extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
170 unsigned int u32_count, int is_write);
171extern int gpmc_prefetch_reset(int cs);
172extern void omap3_gpmc_save_context(void); 131extern void omap3_gpmc_save_context(void);
173extern void omap3_gpmc_restore_context(void); 132extern void omap3_gpmc_restore_context(void);
174extern int gpmc_read_status(int cmd);
175extern int gpmc_cs_configure(int cs, int cmd, int wval); 133extern int gpmc_cs_configure(int cs, int cmd, int wval);
176extern int gpmc_nand_read(int cs, int cmd);
177extern int gpmc_nand_write(int cs, int cmd, int wval);
178
179int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size);
180int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code);
181
182#ifdef CONFIG_ARCH_OMAP3
183int gpmc_init_hwecc_bch(int cs, int nsectors, int nerrors);
184int gpmc_enable_hwecc_bch(int cs, int mode, int dev_width, int nsectors,
185 int nerrors);
186int gpmc_calculate_ecc_bch4(int cs, const u_char *dat, u_char *ecc);
187int gpmc_calculate_ecc_bch8(int cs, const u_char *dat, u_char *ecc);
188#endif /* CONFIG_ARCH_OMAP3 */
189 134
190#endif 135#endif
diff --git a/arch/arm/mach-omap2/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c
index e003f2bba30c..ab7bf181a105 100644
--- a/arch/arm/mach-omap2/hdq1w.c
+++ b/arch/arm/mach-omap2/hdq1w.c
@@ -27,15 +27,13 @@
27#include <linux/err.h> 27#include <linux/err.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29 29
30#include <plat/omap_hwmod.h> 30#include "omap_hwmod.h"
31#include <plat/omap_device.h> 31#include "omap_device.h"
32#include "hdq1w.h" 32#include "hdq1w.h"
33 33
34#include "prm.h"
34#include "common.h" 35#include "common.h"
35 36
36/* Maximum microseconds to wait for OMAP module to softreset */
37#define MAX_MODULE_SOFTRESET_WAIT 10000
38
39/** 37/**
40 * omap_hdq1w_reset - reset the OMAP HDQ1W module 38 * omap_hdq1w_reset - reset the OMAP HDQ1W module
41 * @oh: struct omap_hwmod * 39 * @oh: struct omap_hwmod *
diff --git a/arch/arm/mach-omap2/hdq1w.h b/arch/arm/mach-omap2/hdq1w.h
index 0c1efc846d8d..c7e08d2a7a46 100644
--- a/arch/arm/mach-omap2/hdq1w.h
+++ b/arch/arm/mach-omap2/hdq1w.h
@@ -21,7 +21,7 @@
21#ifndef ARCH_ARM_MACH_OMAP2_HDQ1W_H 21#ifndef ARCH_ARM_MACH_OMAP2_HDQ1W_H
22#define ARCH_ARM_MACH_OMAP2_HDQ1W_H 22#define ARCH_ARM_MACH_OMAP2_HDQ1W_H
23 23
24#include <plat/omap_hwmod.h> 24#include "omap_hwmod.h"
25 25
26/* 26/*
27 * XXX A future cleanup patch should modify 27 * XXX A future cleanup patch should modify
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 4d3a6324155f..4a964338992a 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -14,14 +14,14 @@
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <mach/hardware.h>
18#include <linux/platform_data/gpio-omap.h> 17#include <linux/platform_data/gpio-omap.h>
19 18
20#include <plat/mmc.h> 19#include "soc.h"
21#include <plat/omap-pm.h> 20#include "omap_device.h"
22#include <plat/omap_device.h> 21#include "omap-pm.h"
23 22
24#include "mux.h" 23#include "mux.h"
24#include "mmc.h"
25#include "hsmmc.h" 25#include "hsmmc.h"
26#include "control.h" 26#include "control.h"
27 27
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
index 8763c8520dc2..1df9b5feda16 100644
--- a/arch/arm/mach-omap2/hwspinlock.c
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -21,8 +21,8 @@
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/hwspinlock.h> 22#include <linux/hwspinlock.h>
23 23
24#include <plat/omap_hwmod.h> 24#include "omap_hwmod.h"
25#include <plat/omap_device.h> 25#include "omap_device.h"
26 26
27static struct hwspinlock_pdata omap_hwspinlock_pdata __initdata = { 27static struct hwspinlock_pdata omap_hwspinlock_pdata __initdata = {
28 .base_id = 0, 28 .base_id = 0,
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index fc57e67b321f..fbb9b152cd5e 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -19,21 +19,23 @@
19 * 19 *
20 */ 20 */
21 21
22#include <plat/i2c.h> 22#include "soc.h"
23#include "common.h" 23#include "omap_hwmod.h"
24#include <plat/omap_hwmod.h> 24#include "omap_device.h"
25 25
26#include "prm.h"
27#include "common.h"
26#include "mux.h" 28#include "mux.h"
29#include "i2c.h"
27 30
28/* In register I2C_CON, Bit 15 is the I2C enable bit */ 31/* In register I2C_CON, Bit 15 is the I2C enable bit */
29#define I2C_EN BIT(15) 32#define I2C_EN BIT(15)
30#define OMAP2_I2C_CON_OFFSET 0x24 33#define OMAP2_I2C_CON_OFFSET 0x24
31#define OMAP4_I2C_CON_OFFSET 0xA4 34#define OMAP4_I2C_CON_OFFSET 0xA4
32 35
33/* Maximum microseconds to wait for OMAP module to softreset */ 36#define MAX_OMAP_I2C_HWMOD_NAME_LEN 16
34#define MAX_MODULE_SOFTRESET_WAIT 10000
35 37
36void __init omap2_i2c_mux_pins(int bus_id) 38static void __init omap2_i2c_mux_pins(int bus_id)
37{ 39{
38 char mux_name[sizeof("i2c2_scl.i2c2_scl")]; 40 char mux_name[sizeof("i2c2_scl.i2c2_scl")];
39 41
@@ -104,3 +106,62 @@ int omap_i2c_reset(struct omap_hwmod *oh)
104 106
105 return 0; 107 return 0;
106} 108}
109
110static int __init omap_i2c_nr_ports(void)
111{
112 int ports = 0;
113
114 if (cpu_is_omap24xx())
115 ports = 2;
116 else if (cpu_is_omap34xx())
117 ports = 3;
118 else if (cpu_is_omap44xx())
119 ports = 4;
120 return ports;
121}
122
123static const char name[] = "omap_i2c";
124
125int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
126 int bus_id)
127{
128 int l;
129 struct omap_hwmod *oh;
130 struct platform_device *pdev;
131 char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN];
132 struct omap_i2c_bus_platform_data *pdata;
133 struct omap_i2c_dev_attr *dev_attr;
134
135 if (bus_id > omap_i2c_nr_ports())
136 return -EINVAL;
137
138 omap2_i2c_mux_pins(bus_id);
139
140 l = snprintf(oh_name, MAX_OMAP_I2C_HWMOD_NAME_LEN, "i2c%d", bus_id);
141 WARN(l >= MAX_OMAP_I2C_HWMOD_NAME_LEN,
142 "String buffer overflow in I2C%d device setup\n", bus_id);
143 oh = omap_hwmod_lookup(oh_name);
144 if (!oh) {
145 pr_err("Could not look up %s\n", oh_name);
146 return -EEXIST;
147 }
148
149 pdata = i2c_pdata;
150 /*
151 * pass the hwmod class's CPU-specific knowledge of I2C IP revision in
152 * use, and functionality implementation flags, up to the OMAP I2C
153 * driver via platform data
154 */
155 pdata->rev = oh->class->rev;
156
157 dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr;
158 pdata->flags = dev_attr->flags;
159
160 pdev = omap_device_build(name, bus_id, oh, pdata,
161 sizeof(struct omap_i2c_bus_platform_data),
162 NULL, 0, 0);
163 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
164
165 return PTR_RET(pdev);
166}
167
diff --git a/arch/arm/mach-omap2/i2c.h b/arch/arm/mach-omap2/i2c.h
new file mode 100644
index 000000000000..42b6f2e7d190
--- /dev/null
+++ b/arch/arm/mach-omap2/i2c.h
@@ -0,0 +1,42 @@
1/*
2 * Helper module for board specific I2C bus registration
3 *
4 * Copyright (C) 2009 Nokia Corporation.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * 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 St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#include <plat/i2c.h>
23
24#ifndef __MACH_OMAP2_I2C_H
25#define __MACH_OMAP2_I2C_H
26
27/**
28 * i2c_dev_attr - OMAP I2C controller device attributes for omap_hwmod
29 * @fifo_depth: total controller FIFO size (in bytes)
30 * @flags: differences in hardware support capability
31 *
32 * @fifo_depth represents what exists on the hardware, not what is
33 * actually configured at runtime by the device driver.
34 */
35struct omap_i2c_dev_attr {
36 u8 fifo_depth;
37 u32 flags;
38};
39
40int omap_i2c_reset(struct omap_hwmod *oh);
41
42#endif /* __MACH_OMAP2_I2C_H */
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index cf2362ccb234..f1e121502789 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -559,11 +559,12 @@ void __init omap5xxx_check_revision(void)
559 * detect the exact revision later on in omap2_detect_revision() once map_io 559 * detect the exact revision later on in omap2_detect_revision() once map_io
560 * is done. 560 * is done.
561 */ 561 */
562void __init omap2_set_globals_tap(struct omap_globals *omap2_globals) 562void __init omap2_set_globals_tap(u32 class, void __iomem *tap)
563{ 563{
564 omap_revision = omap2_globals->class; 564 omap_revision = class;
565 tap_base = omap2_globals->tap; 565 tap_base = tap;
566 566
567 /* XXX What is this intended to do? */
567 if (cpu_is_omap34xx()) 568 if (cpu_is_omap34xx())
568 tap_prod_id = 0x0210; 569 tap_prod_id = 0x0210;
569 else 570 else
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 93d10de7129f..cfaed13d0040 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -13,7 +13,7 @@
13 13
14#include <linux/serial_reg.h> 14#include <linux/serial_reg.h>
15 15
16#include <plat/serial.h> 16#include <mach/serial.h>
17 17
18#define UART_OFFSET(addr) ((addr) & 0x00ffffff) 18#define UART_OFFSET(addr) ((addr) & 0x00ffffff)
19 19
diff --git a/arch/arm/mach-omap2/include/mach/gpio.h b/arch/arm/mach-omap2/include/mach/gpio.h
deleted file mode 100644
index 5621cc59c9f4..000000000000
--- a/arch/arm/mach-omap2/include/mach/gpio.h
+++ /dev/null
@@ -1,3 +0,0 @@
1/*
2 * arch/arm/mach-omap2/include/mach/gpio.h
3 */
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/mach-omap2/include/mach/serial.h
index 65fce44dce34..70eda00db7a4 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/mach-omap2/include/mach/serial.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/serial.h
3 *
4 * Copyright (C) 2009 Texas Instruments 2 * Copyright (C) 2009 Texas Instruments
5 * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com> 3 * Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * 4 *
@@ -10,11 +8,6 @@
10 * GNU General Public License for more details. 8 * GNU General Public License for more details.
11 */ 9 */
12 10
13#ifndef __ASM_ARCH_SERIAL_H
14#define __ASM_ARCH_SERIAL_H
15
16#include <linux/init.h>
17
18/* 11/*
19 * Memory entry used for the DEBUG_LL UART configuration, relative to 12 * Memory entry used for the DEBUG_LL UART configuration, relative to
20 * start of RAM. See also uncompress.h and debug-macro.S. 13 * start of RAM. See also uncompress.h and debug-macro.S.
@@ -29,11 +22,6 @@
29 */ 22 */
30#define OMAP_UART_INFO_OFS 0x3ffc 23#define OMAP_UART_INFO_OFS 0x3ffc
31 24
32/* OMAP1 serial ports */
33#define OMAP1_UART1_BASE 0xfffb0000
34#define OMAP1_UART2_BASE 0xfffb0800
35#define OMAP1_UART3_BASE 0xfffb9800
36
37/* OMAP2 serial ports */ 25/* OMAP2 serial ports */
38#define OMAP2_UART1_BASE 0x4806a000 26#define OMAP2_UART1_BASE 0x4806a000
39#define OMAP2_UART2_BASE 0x4806c000 27#define OMAP2_UART2_BASE 0x4806c000
@@ -76,20 +64,14 @@
76#define ZOOM_UART_VIRT 0xfa400000 64#define ZOOM_UART_VIRT 0xfa400000
77 65
78#define OMAP_PORT_SHIFT 2 66#define OMAP_PORT_SHIFT 2
79#define OMAP7XX_PORT_SHIFT 0
80#define ZOOM_PORT_SHIFT 1 67#define ZOOM_PORT_SHIFT 1
81 68
82#define OMAP1510_BASE_BAUD (12000000/16)
83#define OMAP16XX_BASE_BAUD (48000000/16)
84#define OMAP24XX_BASE_BAUD (48000000/16) 69#define OMAP24XX_BASE_BAUD (48000000/16)
85 70
86/* 71/*
87 * DEBUG_LL port encoding stored into the UART1 scratchpad register by 72 * DEBUG_LL port encoding stored into the UART1 scratchpad register by
88 * decomp_setup in uncompress.h 73 * decomp_setup in uncompress.h
89 */ 74 */
90#define OMAP1UART1 11
91#define OMAP1UART2 12
92#define OMAP1UART3 13
93#define OMAP2UART1 21 75#define OMAP2UART1 21
94#define OMAP2UART2 22 76#define OMAP2UART2 22
95#define OMAP2UART3 23 77#define OMAP2UART3 23
@@ -109,15 +91,6 @@
109#define OMAP5UART4 OMAP4UART4 91#define OMAP5UART4 OMAP4UART4
110#define ZOOM_UART 95 /* Only on zoom2/3 */ 92#define ZOOM_UART 95 /* Only on zoom2/3 */
111 93
112/* This is only used by 8250.c for omap1510 */
113#define is_omap_port(pt) ({int __ret = 0; \
114 if ((pt)->port.mapbase == OMAP1_UART1_BASE || \
115 (pt)->port.mapbase == OMAP1_UART2_BASE || \
116 (pt)->port.mapbase == OMAP1_UART3_BASE) \
117 __ret = 1; \
118 __ret; \
119 })
120
121#ifndef __ASSEMBLER__ 94#ifndef __ASSEMBLER__
122 95
123struct omap_board_data; 96struct omap_board_data;
@@ -128,5 +101,3 @@ extern void omap_serial_board_init(struct omap_uart_port_info *platform_data);
128extern void omap_serial_init_port(struct omap_board_data *bdata, 101extern void omap_serial_init_port(struct omap_board_data *bdata,
129 struct omap_uart_port_info *platform_data); 102 struct omap_uart_port_info *platform_data);
130#endif 103#endif
131
132#endif
diff --git a/arch/arm/mach-omap2/include/mach/uncompress.h b/arch/arm/mach-omap2/include/mach/uncompress.h
index 78e0557bfd4e..8e3546d3e041 100644
--- a/arch/arm/mach-omap2/include/mach/uncompress.h
+++ b/arch/arm/mach-omap2/include/mach/uncompress.h
@@ -1,5 +1,176 @@
1/* 1/*
2 * arch/arm/mach-omap2/include/mach/uncompress.h 2 * arch/arm/plat-omap/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
10 *
11 * Rewritten by:
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
14 *
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
3 */ 18 */
4 19
5#include <plat/uncompress.h> 20#include <linux/types.h>
21#include <linux/serial_reg.h>
22
23#include <asm/memory.h>
24#include <asm/mach-types.h>
25
26#include <mach/serial.h>
27
28#define MDR1_MODE_MASK 0x07
29
30volatile u8 *uart_base;
31int uart_shift;
32
33/*
34 * Store the DEBUG_LL uart number into memory.
35 * See also debug-macro.S, and serial.c for related code.
36 */
37static void set_omap_uart_info(unsigned char port)
38{
39 /*
40 * Get address of some.bss variable and round it down
41 * a la CONFIG_AUTO_ZRELADDR.
42 */
43 u32 ram_start = (u32)&uart_shift & 0xf8000000;
44 u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
45 *uart_info = port;
46}
47
48static void putc(int c)
49{
50 if (!uart_base)
51 return;
52
53 /* Check for UART 16x mode */
54 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
55 return;
56
57 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
58 barrier();
59 uart_base[UART_TX << uart_shift] = c;
60}
61
62static inline void flush(void)
63{
64}
65
66/*
67 * Macros to configure UART1 and debug UART
68 */
69#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
70 if (machine_is_##mach()) { \
71 uart_base = (volatile u8 *)(dbg_uart); \
72 uart_shift = (dbg_shft); \
73 port = (dbg_id); \
74 set_omap_uart_info(port); \
75 break; \
76 }
77
78#define DEBUG_LL_OMAP2(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
80 OMAP2UART##p)
81
82#define DEBUG_LL_OMAP3(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
84 OMAP3UART##p)
85
86#define DEBUG_LL_OMAP4(p, mach) \
87 _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
88 OMAP4UART##p)
89
90#define DEBUG_LL_OMAP5(p, mach) \
91 _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT, \
92 OMAP5UART##p)
93/* Zoom2/3 shift is different for UART1 and external port */
94#define DEBUG_LL_ZOOM(mach) \
95 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
96
97#define DEBUG_LL_TI81XX(p, mach) \
98 _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
99 TI81XXUART##p)
100
101#define DEBUG_LL_AM33XX(p, mach) \
102 _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
103 AM33XXUART##p)
104
105static inline void arch_decomp_setup(void)
106{
107 int port = 0;
108
109 /*
110 * Initialize the port based on the machine ID from the bootloader.
111 * Note that we're using macros here instead of switch statement
112 * as machine_is functions are optimized out for the boards that
113 * are not selected.
114 */
115 do {
116 /* omap2 based boards using UART1 */
117 DEBUG_LL_OMAP2(1, omap_2430sdp);
118 DEBUG_LL_OMAP2(1, omap_apollon);
119 DEBUG_LL_OMAP2(1, omap_h4);
120
121 /* omap2 based boards using UART3 */
122 DEBUG_LL_OMAP2(3, nokia_n800);
123 DEBUG_LL_OMAP2(3, nokia_n810);
124 DEBUG_LL_OMAP2(3, nokia_n810_wimax);
125
126 /* omap3 based boards using UART1 */
127 DEBUG_LL_OMAP2(1, omap3evm);
128 DEBUG_LL_OMAP3(1, omap_3430sdp);
129 DEBUG_LL_OMAP3(1, omap_3630sdp);
130 DEBUG_LL_OMAP3(1, omap3530_lv_som);
131 DEBUG_LL_OMAP3(1, omap3_torpedo);
132
133 /* omap3 based boards using UART3 */
134 DEBUG_LL_OMAP3(3, cm_t35);
135 DEBUG_LL_OMAP3(3, cm_t3517);
136 DEBUG_LL_OMAP3(3, cm_t3730);
137 DEBUG_LL_OMAP3(3, craneboard);
138 DEBUG_LL_OMAP3(3, devkit8000);
139 DEBUG_LL_OMAP3(3, igep0020);
140 DEBUG_LL_OMAP3(3, igep0030);
141 DEBUG_LL_OMAP3(3, nokia_rm680);
142 DEBUG_LL_OMAP3(3, nokia_rm696);
143 DEBUG_LL_OMAP3(3, nokia_rx51);
144 DEBUG_LL_OMAP3(3, omap3517evm);
145 DEBUG_LL_OMAP3(3, omap3_beagle);
146 DEBUG_LL_OMAP3(3, omap3_pandora);
147 DEBUG_LL_OMAP3(3, omap_ldp);
148 DEBUG_LL_OMAP3(3, overo);
149 DEBUG_LL_OMAP3(3, touchbook);
150
151 /* omap4 based boards using UART3 */
152 DEBUG_LL_OMAP4(3, omap_4430sdp);
153 DEBUG_LL_OMAP4(3, omap4_panda);
154
155 /* omap5 based boards using UART3 */
156 DEBUG_LL_OMAP5(3, omap5_sevm);
157
158 /* zoom2/3 external uart */
159 DEBUG_LL_ZOOM(omap_zoom2);
160 DEBUG_LL_ZOOM(omap_zoom3);
161
162 /* TI8168 base boards using UART3 */
163 DEBUG_LL_TI81XX(3, ti8168evm);
164
165 /* TI8148 base boards using UART1 */
166 DEBUG_LL_TI81XX(1, ti8148evm);
167
168 /* AM33XX base boards using UART1 */
169 DEBUG_LL_AM33XX(1, am335xevm);
170 } while (0);
171}
172
173/*
174 * nothing to do
175 */
176#define arch_decomp_wdog()
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 4234d28dc171..9df757644cce 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -25,14 +25,9 @@
25#include <asm/tlb.h> 25#include <asm/tlb.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include <plat/sram.h> 28#include <plat-omap/dma-omap.h>
29#include <plat/sdrc.h>
30#include <plat/serial.h>
31#include <plat/omap-pm.h>
32#include <plat/omap_hwmod.h>
33#include <plat/multi.h>
34#include <plat/dma.h>
35 29
30#include "omap_hwmod.h"
36#include "soc.h" 31#include "soc.h"
37#include "iomap.h" 32#include "iomap.h"
38#include "voltage.h" 33#include "voltage.h"
@@ -43,6 +38,18 @@
43#include "clock2xxx.h" 38#include "clock2xxx.h"
44#include "clock3xxx.h" 39#include "clock3xxx.h"
45#include "clock44xx.h" 40#include "clock44xx.h"
41#include "omap-pm.h"
42#include "sdrc.h"
43#include "control.h"
44#include "serial.h"
45#include "sram.h"
46#include "cm2xxx.h"
47#include "cm3xxx.h"
48#include "prm.h"
49#include "cm.h"
50#include "prcm_mpu44xx.h"
51#include "prminst44xx.h"
52#include "cminst44xx.h"
46 53
47/* 54/*
48 * The machine specific code may provide the extra mapping besides the 55 * The machine specific code may provide the extra mapping besides the
@@ -265,7 +272,7 @@ static struct map_desc omap54xx_io_desc[] __initdata = {
265#endif 272#endif
266 273
267#ifdef CONFIG_SOC_OMAP2420 274#ifdef CONFIG_SOC_OMAP2420
268void __init omap242x_map_common_io(void) 275void __init omap242x_map_io(void)
269{ 276{
270 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 277 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
271 iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); 278 iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
@@ -273,7 +280,7 @@ void __init omap242x_map_common_io(void)
273#endif 280#endif
274 281
275#ifdef CONFIG_SOC_OMAP2430 282#ifdef CONFIG_SOC_OMAP2430
276void __init omap243x_map_common_io(void) 283void __init omap243x_map_io(void)
277{ 284{
278 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 285 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
279 iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); 286 iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
@@ -281,28 +288,28 @@ void __init omap243x_map_common_io(void)
281#endif 288#endif
282 289
283#ifdef CONFIG_ARCH_OMAP3 290#ifdef CONFIG_ARCH_OMAP3
284void __init omap34xx_map_common_io(void) 291void __init omap3_map_io(void)
285{ 292{
286 iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); 293 iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
287} 294}
288#endif 295#endif
289 296
290#ifdef CONFIG_SOC_TI81XX 297#ifdef CONFIG_SOC_TI81XX
291void __init omapti81xx_map_common_io(void) 298void __init ti81xx_map_io(void)
292{ 299{
293 iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc)); 300 iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc));
294} 301}
295#endif 302#endif
296 303
297#ifdef CONFIG_SOC_AM33XX 304#ifdef CONFIG_SOC_AM33XX
298void __init omapam33xx_map_common_io(void) 305void __init am33xx_map_io(void)
299{ 306{
300 iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc)); 307 iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc));
301} 308}
302#endif 309#endif
303 310
304#ifdef CONFIG_ARCH_OMAP4 311#ifdef CONFIG_ARCH_OMAP4
305void __init omap44xx_map_common_io(void) 312void __init omap4_map_io(void)
306{ 313{
307 iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); 314 iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
308 omap_barriers_init(); 315 omap_barriers_init();
@@ -310,7 +317,7 @@ void __init omap44xx_map_common_io(void)
310#endif 317#endif
311 318
312#ifdef CONFIG_SOC_OMAP5 319#ifdef CONFIG_SOC_OMAP5
313void __init omap5_map_common_io(void) 320void __init omap5_map_io(void)
314{ 321{
315 iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc)); 322 iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc));
316} 323}
@@ -354,11 +361,6 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
354 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); 361 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
355} 362}
356 363
357static void __init omap_common_init_early(void)
358{
359 omap_init_consistent_dma_size();
360}
361
362static void __init omap_hwmod_init_postsetup(void) 364static void __init omap_hwmod_init_postsetup(void)
363{ 365{
364 u8 postsetup_state; 366 u8 postsetup_state;
@@ -377,9 +379,15 @@ static void __init omap_hwmod_init_postsetup(void)
377#ifdef CONFIG_SOC_OMAP2420 379#ifdef CONFIG_SOC_OMAP2420
378void __init omap2420_init_early(void) 380void __init omap2420_init_early(void)
379{ 381{
380 omap2_set_globals_242x(); 382 omap2_set_globals_tap(OMAP242X_CLASS, OMAP2_L4_IO_ADDRESS(0x48014000));
383 omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE),
384 OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE));
385 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE),
386 NULL);
387 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE));
388 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE), NULL);
381 omap2xxx_check_revision(); 389 omap2xxx_check_revision();
382 omap_common_init_early(); 390 omap2xxx_cm_init();
383 omap2xxx_voltagedomains_init(); 391 omap2xxx_voltagedomains_init();
384 omap242x_powerdomains_init(); 392 omap242x_powerdomains_init();
385 omap242x_clockdomains_init(); 393 omap242x_clockdomains_init();
@@ -399,9 +407,15 @@ void __init omap2420_init_late(void)
399#ifdef CONFIG_SOC_OMAP2430 407#ifdef CONFIG_SOC_OMAP2430
400void __init omap2430_init_early(void) 408void __init omap2430_init_early(void)
401{ 409{
402 omap2_set_globals_243x(); 410 omap2_set_globals_tap(OMAP243X_CLASS, OMAP2_L4_IO_ADDRESS(0x4900a000));
411 omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE),
412 OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE));
413 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
414 NULL);
415 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE));
416 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE), NULL);
403 omap2xxx_check_revision(); 417 omap2xxx_check_revision();
404 omap_common_init_early(); 418 omap2xxx_cm_init();
405 omap2xxx_voltagedomains_init(); 419 omap2xxx_voltagedomains_init();
406 omap243x_powerdomains_init(); 420 omap243x_powerdomains_init();
407 omap243x_clockdomains_init(); 421 omap243x_clockdomains_init();
@@ -425,10 +439,16 @@ void __init omap2430_init_late(void)
425#ifdef CONFIG_ARCH_OMAP3 439#ifdef CONFIG_ARCH_OMAP3
426void __init omap3_init_early(void) 440void __init omap3_init_early(void)
427{ 441{
428 omap2_set_globals_3xxx(); 442 omap2_set_globals_tap(OMAP343X_CLASS, OMAP2_L4_IO_ADDRESS(0x4830A000));
443 omap2_set_globals_sdrc(OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
444 OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE));
445 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
446 NULL);
447 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE));
448 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), NULL);
429 omap3xxx_check_revision(); 449 omap3xxx_check_revision();
430 omap3xxx_check_features(); 450 omap3xxx_check_features();
431 omap_common_init_early(); 451 omap3xxx_cm_init();
432 omap3xxx_voltagedomains_init(); 452 omap3xxx_voltagedomains_init();
433 omap3xxx_powerdomains_init(); 453 omap3xxx_powerdomains_init();
434 omap3xxx_clockdomains_init(); 454 omap3xxx_clockdomains_init();
@@ -459,10 +479,14 @@ void __init am35xx_init_early(void)
459 479
460void __init ti81xx_init_early(void) 480void __init ti81xx_init_early(void)
461{ 481{
462 omap2_set_globals_ti81xx(); 482 omap2_set_globals_tap(OMAP343X_CLASS,
483 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
484 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
485 NULL);
486 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
487 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
463 omap3xxx_check_revision(); 488 omap3xxx_check_revision();
464 ti81xx_check_features(); 489 ti81xx_check_features();
465 omap_common_init_early();
466 omap3xxx_voltagedomains_init(); 490 omap3xxx_voltagedomains_init();
467 omap3xxx_powerdomains_init(); 491 omap3xxx_powerdomains_init();
468 omap3xxx_clockdomains_init(); 492 omap3xxx_clockdomains_init();
@@ -517,10 +541,14 @@ void __init ti81xx_init_late(void)
517#ifdef CONFIG_SOC_AM33XX 541#ifdef CONFIG_SOC_AM33XX
518void __init am33xx_init_early(void) 542void __init am33xx_init_early(void)
519{ 543{
520 omap2_set_globals_am33xx(); 544 omap2_set_globals_tap(AM335X_CLASS,
545 AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE));
546 omap2_set_globals_control(AM33XX_L4_WK_IO_ADDRESS(AM33XX_CTRL_BASE),
547 NULL);
548 omap2_set_globals_prm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE));
549 omap2_set_globals_cm(AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE), NULL);
521 omap3xxx_check_revision(); 550 omap3xxx_check_revision();
522 ti81xx_check_features(); 551 ti81xx_check_features();
523 omap_common_init_early();
524 am33xx_voltagedomains_init(); 552 am33xx_voltagedomains_init();
525 am33xx_powerdomains_init(); 553 am33xx_powerdomains_init();
526 am33xx_clockdomains_init(); 554 am33xx_clockdomains_init();
@@ -533,10 +561,18 @@ void __init am33xx_init_early(void)
533#ifdef CONFIG_ARCH_OMAP4 561#ifdef CONFIG_ARCH_OMAP4
534void __init omap4430_init_early(void) 562void __init omap4430_init_early(void)
535{ 563{
536 omap2_set_globals_443x(); 564 omap2_set_globals_tap(OMAP443X_CLASS,
565 OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE));
566 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
567 OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE));
568 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE));
569 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
570 OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE));
571 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE));
572 omap_prm_base_init();
573 omap_cm_base_init();
537 omap4xxx_check_revision(); 574 omap4xxx_check_revision();
538 omap4xxx_check_features(); 575 omap4xxx_check_features();
539 omap_common_init_early();
540 omap44xx_voltagedomains_init(); 576 omap44xx_voltagedomains_init();
541 omap44xx_powerdomains_init(); 577 omap44xx_powerdomains_init();
542 omap44xx_clockdomains_init(); 578 omap44xx_clockdomains_init();
@@ -556,9 +592,17 @@ void __init omap4430_init_late(void)
556#ifdef CONFIG_SOC_OMAP5 592#ifdef CONFIG_SOC_OMAP5
557void __init omap5_init_early(void) 593void __init omap5_init_early(void)
558{ 594{
559 omap2_set_globals_5xxx(); 595 omap2_set_globals_tap(OMAP54XX_CLASS,
596 OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE));
597 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE),
598 OMAP2_L4_IO_ADDRESS(OMAP54XX_CTRL_BASE));
599 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRM_BASE));
600 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_AON_BASE),
601 OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE));
602 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
603 omap_prm_base_init();
604 omap_cm_base_init();
560 omap5xxx_check_revision(); 605 omap5xxx_check_revision();
561 omap_common_init_early();
562} 606}
563#endif 607#endif
564 608
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 37f8f948047b..bf496510eb5e 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -19,16 +19,17 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/platform_data/asoc-ti-mcbsp.h> 21#include <linux/platform_data/asoc-ti-mcbsp.h>
22
23#include <plat/dma.h>
24#include <plat/omap_device.h>
25#include <linux/pm_runtime.h> 22#include <linux/pm_runtime.h>
26 23
24#include <plat-omap/dma-omap.h>
25
26#include "omap_device.h"
27
27/* 28/*
28 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle. 29 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle.
29 * Sidetone needs non-gated ICLK and sidetone autoidle is broken. 30 * Sidetone needs non-gated ICLK and sidetone autoidle is broken.
30 */ 31 */
31#include "cm2xxx_3xxx.h" 32#include "cm3xxx.h"
32#include "cm-regbits-34xx.h" 33#include "cm-regbits-34xx.h"
33 34
34static int omap3_enable_st_clock(unsigned int id, bool enable) 35static int omap3_enable_st_clock(unsigned int id, bool enable)
diff --git a/arch/arm/mach-omap2/mmc.h b/arch/arm/mach-omap2/mmc.h
new file mode 100644
index 000000000000..0cd4b089da9c
--- /dev/null
+++ b/arch/arm/mach-omap2/mmc.h
@@ -0,0 +1,23 @@
1#include <linux/mmc/host.h>
2#include <linux/platform_data/mmc-omap.h>
3
4#define OMAP24XX_NR_MMC 2
5#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE
6#define OMAP2_MMC1_BASE 0x4809c000
7
8#define OMAP4_MMC_REG_OFFSET 0x100
9
10#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
11void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
12#else
13static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
14{
15}
16#endif
17
18struct omap_hwmod;
19int omap_msdi_reset(struct omap_hwmod *oh);
20
21/* called from board-specific card detection service routine */
22extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
23 int is_closed);
diff --git a/arch/arm/mach-omap2/msdi.c b/arch/arm/mach-omap2/msdi.c
index 9e57b4aadb06..aafdd4ca9f4f 100644
--- a/arch/arm/mach-omap2/msdi.c
+++ b/arch/arm/mach-omap2/msdi.c
@@ -25,13 +25,13 @@
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/platform_data/gpio-omap.h> 26#include <linux/platform_data/gpio-omap.h>
27 27
28#include <plat/omap_hwmod.h> 28#include "prm.h"
29#include <plat/omap_device.h>
30#include <plat/mmc.h>
31
32#include "common.h" 29#include "common.h"
33#include "control.h" 30#include "control.h"
31#include "omap_hwmod.h"
32#include "omap_device.h"
34#include "mux.h" 33#include "mux.h"
34#include "mmc.h"
35 35
36/* 36/*
37 * MSDI_CON_OFFSET: offset in bytes of the MSDI IP block's CON register 37 * MSDI_CON_OFFSET: offset in bytes of the MSDI IP block's CON register
@@ -44,9 +44,6 @@
44#define MSDI_CON_CLKD_MASK (0x3f << 0) 44#define MSDI_CON_CLKD_MASK (0x3f << 0)
45#define MSDI_CON_CLKD_SHIFT 0 45#define MSDI_CON_CLKD_SHIFT 0
46 46
47/* Maximum microseconds to wait for OMAP module to softreset */
48#define MAX_MODULE_SOFTRESET_WAIT 10000
49
50/* MSDI_TARGET_RESET_CLKD: clock divisor to use throughout the reset */ 47/* MSDI_TARGET_RESET_CLKD: clock divisor to use throughout the reset */
51#define MSDI_TARGET_RESET_CLKD 0x3ff 48#define MSDI_TARGET_RESET_CLKD 0x3ff
52 49
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 701e17cba468..26126343d6ac 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -36,8 +36,9 @@
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37 37
38 38
39#include <plat/omap_hwmod.h> 39#include "omap_hwmod.h"
40 40
41#include "soc.h"
41#include "control.h" 42#include "control.h"
42#include "mux.h" 43#include "mux.h"
43#include "prm.h" 44#include "prm.h"
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
index ff4e6a0e9c7c..3f5fd7e3549d 100644
--- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
+++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
@@ -50,6 +50,7 @@
50#include <asm/suspend.h> 50#include <asm/suspend.h>
51#include <asm/hardware/cache-l2x0.h> 51#include <asm/hardware/cache-l2x0.h>
52 52
53#include "soc.h"
53#include "common.h" 54#include "common.h"
54#include "omap44xx.h" 55#include "omap44xx.h"
55#include "omap4-sar-layout.h" 56#include "omap4-sar-layout.h"
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/mach-omap2/omap-pm-noop.c
index 9722f418ae1f..6a3be2bebddb 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/mach-omap2/omap-pm-noop.c
@@ -22,9 +22,8 @@
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25/* Interface documentation is in mach/omap-pm.h */ 25#include "omap_device.h"
26#include <plat/omap-pm.h> 26#include "omap-pm.h"
27#include <plat/omap_device.h>
28 27
29static bool off_mode_enabled; 28static bool off_mode_enabled;
30static int dummy_context_loss_counter; 29static int dummy_context_loss_counter;
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h b/arch/arm/mach-omap2/omap-pm.h
index 67faa7b8fe92..67faa7b8fe92 100644
--- a/arch/arm/plat-omap/include/plat/omap-pm.h
+++ b/arch/arm/mach-omap2/omap-pm.h
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
index e089e4d1ae38..b970440cffca 100644
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -18,7 +18,6 @@
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <asm/memblock.h> 19#include <asm/memblock.h>
20 20
21#include <plat/omap-secure.h>
22#include "omap-secure.h" 21#include "omap-secure.h"
23 22
24static phys_addr_t omap_secure_memblock_base; 23static phys_addr_t omap_secure_memblock_base;
diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h
index c90a43589abe..0e729170c46b 100644
--- a/arch/arm/mach-omap2/omap-secure.h
+++ b/arch/arm/mach-omap2/omap-secure.h
@@ -52,6 +52,13 @@ extern u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs,
52 u32 arg1, u32 arg2, u32 arg3, u32 arg4); 52 u32 arg1, u32 arg2, u32 arg3, u32 arg4);
53extern u32 omap_smc2(u32 id, u32 falg, u32 pargs); 53extern u32 omap_smc2(u32 id, u32 falg, u32 pargs);
54extern phys_addr_t omap_secure_ram_mempool_base(void); 54extern phys_addr_t omap_secure_ram_mempool_base(void);
55extern int omap_secure_ram_reserve_memblock(void);
55 56
57#ifdef CONFIG_OMAP4_ERRATA_I688
58extern int omap_barrier_reserve_memblock(void);
59#else
60static inline void omap_barrier_reserve_memblock(void)
61{ }
62#endif
56#endif /* __ASSEMBLER__ */ 63#endif /* __ASSEMBLER__ */
57#endif /* OMAP_ARCH_OMAP_SECURE_H */ 64#endif /* OMAP_ARCH_OMAP_SECURE_H */
diff --git a/arch/arm/mach-omap2/omap2-restart.c b/arch/arm/mach-omap2/omap2-restart.c
new file mode 100644
index 000000000000..be6bc89ab1e8
--- /dev/null
+++ b/arch/arm/mach-omap2/omap2-restart.c
@@ -0,0 +1,65 @@
1/*
2 * omap2-restart.c - code common to all OMAP2xxx machines.
3 *
4 * Copyright (C) 2012 Texas Instruments
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/clk.h>
14#include <linux/io.h>
15
16#include "common.h"
17#include "prm2xxx.h"
18
19/*
20 * reset_virt_prcm_set_ck, reset_sys_ck: pointers to the virt_prcm_set
21 * clock and the sys_ck. Used during the reset process
22 */
23static struct clk *reset_virt_prcm_set_ck, *reset_sys_ck;
24
25/* Reboot handling */
26
27/**
28 * omap2xxx_restart - Set DPLL to bypass mode for reboot to work
29 *
30 * Set the DPLL to bypass so that reboot completes successfully. No
31 * return value.
32 */
33void omap2xxx_restart(char mode, const char *cmd)
34{
35 u32 rate;
36
37 rate = clk_get_rate(reset_sys_ck);
38 clk_set_rate(reset_virt_prcm_set_ck, rate);
39
40 /* XXX Should save the cmd argument for use after the reboot */
41
42 omap2xxx_prm_dpll_reset(); /* never returns */
43 while (1);
44}
45
46/**
47 * omap2xxx_common_look_up_clks_for_reset - look up clocks needed for restart
48 *
49 * Some clocks need to be looked up in advance for the SoC restart
50 * operation to work - see omap2xxx_restart(). Returns -EINVAL upon
51 * error or 0 upon success.
52 */
53static int __init omap2xxx_common_look_up_clks_for_reset(void)
54{
55 reset_virt_prcm_set_ck = clk_get(NULL, "virt_prcm_set");
56 if (IS_ERR(reset_virt_prcm_set_ck))
57 return -EINVAL;
58
59 reset_sys_ck = clk_get(NULL, "sys_ck");
60 if (IS_ERR(reset_sys_ck))
61 return -EINVAL;
62
63 return 0;
64}
65core_initcall(omap2xxx_common_look_up_clks_for_reset);
diff --git a/arch/arm/mach-omap2/omap3-restart.c b/arch/arm/mach-omap2/omap3-restart.c
new file mode 100644
index 000000000000..923c582189e5
--- /dev/null
+++ b/arch/arm/mach-omap2/omap3-restart.c
@@ -0,0 +1,36 @@
1/*
2 * omap3-restart.c - Code common to all OMAP3xxx machines.
3 *
4 * Copyright (C) 2009, 2012 Texas Instruments
5 * Copyright (C) 2010 Nokia Corporation
6 * Tony Lindgren <tony@atomide.com>
7 * Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/kernel.h>
14#include <linux/init.h>
15
16#include "iomap.h"
17#include "common.h"
18#include "control.h"
19#include "prm3xxx.h"
20
21/* Global address base setup code */
22
23/**
24 * omap3xxx_restart - trigger a software restart of the SoC
25 * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
26 * @cmd: passed from the userspace program rebooting the system (if provided)
27 *
28 * Resets the SoC. For @cmd, see the 'reboot' syscall in
29 * kernel/sys.c. No return value.
30 */
31void omap3xxx_restart(char mode, const char *cmd)
32{
33 omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
34 omap3xxx_prm_dpll3_reset(); /* never returns */
35 while (1);
36}
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index e1f289748c5d..5695885ea340 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -25,16 +25,17 @@
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26#include <asm/memblock.h> 26#include <asm/memblock.h>
27 27
28#include <plat/sram.h>
29#include <plat/omap-secure.h>
30#include <plat/mmc.h>
31
32#include "omap-wakeupgen.h" 28#include "omap-wakeupgen.h"
33
34#include "soc.h" 29#include "soc.h"
30#include "iomap.h"
35#include "common.h" 31#include "common.h"
32#include "mmc.h"
36#include "hsmmc.h" 33#include "hsmmc.h"
34#include "prminst44xx.h"
35#include "prcm_mpu44xx.h"
37#include "omap4-sar-layout.h" 36#include "omap4-sar-layout.h"
37#include "omap-secure.h"
38#include "sram.h"
38 39
39#ifdef CONFIG_CACHE_L2X0 40#ifdef CONFIG_CACHE_L2X0
40static void __iomem *l2cache_base; 41static void __iomem *l2cache_base;
@@ -281,3 +282,19 @@ int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
281 return 0; 282 return 0;
282} 283}
283#endif 284#endif
285
286/**
287 * omap44xx_restart - trigger a software restart of the SoC
288 * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
289 * @cmd: passed from the userspace program rebooting the system (if provided)
290 *
291 * Resets the SoC. For @cmd, see the 'reboot' syscall in
292 * kernel/sys.c. No return value.
293 */
294void omap44xx_restart(char mode, const char *cmd)
295{
296 /* XXX Should save 'cmd' into scratchpad for use after reboot */
297 omap4_prminst_global_warm_sw_reset(); /* never returns */
298 while (1);
299}
300
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 7a7d1f2a65e9..0ef934fec364 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -89,9 +89,8 @@
89#include <linux/of.h> 89#include <linux/of.h>
90#include <linux/notifier.h> 90#include <linux/notifier.h>
91 91
92#include <plat/omap_device.h> 92#include "omap_device.h"
93#include <plat/omap_hwmod.h> 93#include "omap_hwmod.h"
94#include <plat/clock.h>
95 94
96/* These parameters are passed to _omap_device_{de,}activate() */ 95/* These parameters are passed to _omap_device_{de,}activate() */
97#define USE_WAKEUP_LAT 0 96#define USE_WAKEUP_LAT 0
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/mach-omap2/omap_device.h
index 106f50665804..0933c599bf89 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/mach-omap2/omap_device.h
@@ -34,7 +34,7 @@
34#include <linux/kernel.h> 34#include <linux/kernel.h>
35#include <linux/platform_device.h> 35#include <linux/platform_device.h>
36 36
37#include <plat/omap_hwmod.h> 37#include "omap_hwmod.h"
38 38
39extern struct dev_pm_domain omap_device_pm_domain; 39extern struct dev_pm_domain omap_device_pm_domain;
40 40
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 87cc6d058de2..b3b00f43dd7c 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -139,27 +139,25 @@
139#include <linux/slab.h> 139#include <linux/slab.h>
140#include <linux/bootmem.h> 140#include <linux/bootmem.h>
141 141
142#include <plat/clock.h> 142#include "clock.h"
143#include <plat/omap_hwmod.h> 143#include "omap_hwmod.h"
144#include <plat/prcm.h>
145 144
146#include "soc.h" 145#include "soc.h"
147#include "common.h" 146#include "common.h"
148#include "clockdomain.h" 147#include "clockdomain.h"
149#include "powerdomain.h" 148#include "powerdomain.h"
150#include "cm2xxx_3xxx.h" 149#include "cm2xxx.h"
150#include "cm3xxx.h"
151#include "cminst44xx.h" 151#include "cminst44xx.h"
152#include "cm33xx.h" 152#include "cm33xx.h"
153#include "prm2xxx_3xxx.h" 153#include "prm.h"
154#include "prm3xxx.h"
154#include "prm44xx.h" 155#include "prm44xx.h"
155#include "prm33xx.h" 156#include "prm33xx.h"
156#include "prminst44xx.h" 157#include "prminst44xx.h"
157#include "mux.h" 158#include "mux.h"
158#include "pm.h" 159#include "pm.h"
159 160
160/* Maximum microseconds to wait for OMAP module to softreset */
161#define MAX_MODULE_SOFTRESET_WAIT 10000
162
163/* Name of the OMAP hwmod for the MPU */ 161/* Name of the OMAP hwmod for the MPU */
164#define MPU_INITIATOR_NAME "mpu" 162#define MPU_INITIATOR_NAME "mpu"
165 163
@@ -2095,7 +2093,8 @@ static int _enable(struct omap_hwmod *oh)
2095 _enable_sysc(oh); 2093 _enable_sysc(oh);
2096 } 2094 }
2097 } else { 2095 } else {
2098 _omap4_disable_module(oh); 2096 if (soc_ops.disable_module)
2097 soc_ops.disable_module(oh);
2099 _disable_clocks(oh); 2098 _disable_clocks(oh);
2100 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", 2099 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n",
2101 oh->name, r); 2100 oh->name, r);
@@ -2703,7 +2702,34 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois)
2703/* Static functions intended only for use in soc_ops field function pointers */ 2702/* Static functions intended only for use in soc_ops field function pointers */
2704 2703
2705/** 2704/**
2706 * _omap2_wait_target_ready - wait for a module to leave slave idle 2705 * _omap2xxx_wait_target_ready - wait for a module to leave slave idle
2706 * @oh: struct omap_hwmod *
2707 *
2708 * Wait for a module @oh to leave slave idle. Returns 0 if the module
2709 * does not have an IDLEST bit or if the module successfully leaves
2710 * slave idle; otherwise, pass along the return value of the
2711 * appropriate *_cm*_wait_module_ready() function.
2712 */
2713static int _omap2xxx_wait_target_ready(struct omap_hwmod *oh)
2714{
2715 if (!oh)
2716 return -EINVAL;
2717
2718 if (oh->flags & HWMOD_NO_IDLEST)
2719 return 0;
2720
2721 if (!_find_mpu_rt_port(oh))
2722 return 0;
2723
2724 /* XXX check module SIDLEMODE, hardreset status, enabled clocks */
2725
2726 return omap2xxx_cm_wait_module_ready(oh->prcm.omap2.module_offs,
2727 oh->prcm.omap2.idlest_reg_id,
2728 oh->prcm.omap2.idlest_idle_bit);
2729}
2730
2731/**
2732 * _omap3xxx_wait_target_ready - wait for a module to leave slave idle
2707 * @oh: struct omap_hwmod * 2733 * @oh: struct omap_hwmod *
2708 * 2734 *
2709 * Wait for a module @oh to leave slave idle. Returns 0 if the module 2735 * Wait for a module @oh to leave slave idle. Returns 0 if the module
@@ -2711,7 +2737,7 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois)
2711 * slave idle; otherwise, pass along the return value of the 2737 * slave idle; otherwise, pass along the return value of the
2712 * appropriate *_cm*_wait_module_ready() function. 2738 * appropriate *_cm*_wait_module_ready() function.
2713 */ 2739 */
2714static int _omap2_wait_target_ready(struct omap_hwmod *oh) 2740static int _omap3xxx_wait_target_ready(struct omap_hwmod *oh)
2715{ 2741{
2716 if (!oh) 2742 if (!oh)
2717 return -EINVAL; 2743 return -EINVAL;
@@ -2724,9 +2750,9 @@ static int _omap2_wait_target_ready(struct omap_hwmod *oh)
2724 2750
2725 /* XXX check module SIDLEMODE, hardreset status, enabled clocks */ 2751 /* XXX check module SIDLEMODE, hardreset status, enabled clocks */
2726 2752
2727 return omap2_cm_wait_module_ready(oh->prcm.omap2.module_offs, 2753 return omap3xxx_cm_wait_module_ready(oh->prcm.omap2.module_offs,
2728 oh->prcm.omap2.idlest_reg_id, 2754 oh->prcm.omap2.idlest_reg_id,
2729 oh->prcm.omap2.idlest_idle_bit); 2755 oh->prcm.omap2.idlest_idle_bit);
2730} 2756}
2731 2757
2732/** 2758/**
@@ -3994,8 +4020,13 @@ int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx)
3994 */ 4020 */
3995void __init omap_hwmod_init(void) 4021void __init omap_hwmod_init(void)
3996{ 4022{
3997 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 4023 if (cpu_is_omap24xx()) {
3998 soc_ops.wait_target_ready = _omap2_wait_target_ready; 4024 soc_ops.wait_target_ready = _omap2xxx_wait_target_ready;
4025 soc_ops.assert_hardreset = _omap2_assert_hardreset;
4026 soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
4027 soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
4028 } else if (cpu_is_omap34xx()) {
4029 soc_ops.wait_target_ready = _omap3xxx_wait_target_ready;
3999 soc_ops.assert_hardreset = _omap2_assert_hardreset; 4030 soc_ops.assert_hardreset = _omap2_assert_hardreset;
4000 soc_ops.deassert_hardreset = _omap2_deassert_hardreset; 4031 soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
4001 soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted; 4032 soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 1db029438022..87a3c5b7aa74 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -35,7 +35,6 @@
35#include <linux/list.h> 35#include <linux/list.h>
36#include <linux/ioport.h> 36#include <linux/ioport.h>
37#include <linux/spinlock.h> 37#include <linux/spinlock.h>
38#include <plat/cpu.h>
39 38
40struct omap_device; 39struct omap_device;
41 40
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b5db6007c523..a8b3368dca3d 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -12,21 +12,24 @@
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
16#include <linux/i2c-omap.h>
15#include <linux/platform_data/spi-omap2-mcspi.h> 17#include <linux/platform_data/spi-omap2-mcspi.h>
16 18
17#include <plat/omap_hwmod.h> 19#include <plat-omap/dma-omap.h>
18#include <plat/dma.h>
19#include <plat/serial.h>
20#include <plat/i2c.h>
21#include <plat/dmtimer.h> 20#include <plat/dmtimer.h>
21
22#include "omap_hwmod.h"
22#include "l3_2xxx.h" 23#include "l3_2xxx.h"
23#include "l4_2xxx.h" 24#include "l4_2xxx.h"
24#include <plat/mmc.h>
25 25
26#include "omap_hwmod_common_data.h" 26#include "omap_hwmod_common_data.h"
27 27
28#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
29#include "prm-regbits-24xx.h" 29#include "prm-regbits-24xx.h"
30#include "i2c.h"
31#include "mmc.h"
32#include "serial.h"
30#include "wd_timer.h" 33#include "wd_timer.h"
31 34
32/* 35/*
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index c455e41b0237..dc768c50e523 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -12,21 +12,23 @@
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
16#include <linux/i2c-omap.h>
15#include <linux/platform_data/asoc-ti-mcbsp.h> 17#include <linux/platform_data/asoc-ti-mcbsp.h>
16#include <linux/platform_data/spi-omap2-mcspi.h> 18#include <linux/platform_data/spi-omap2-mcspi.h>
17 19
18#include <plat/omap_hwmod.h> 20#include <plat-omap/dma-omap.h>
19#include <plat/dma.h>
20#include <plat/serial.h>
21#include <plat/i2c.h>
22#include <plat/dmtimer.h> 21#include <plat/dmtimer.h>
23#include <plat/mmc.h> 22
23#include "omap_hwmod.h"
24#include "mmc.h"
24#include "l3_2xxx.h" 25#include "l3_2xxx.h"
25 26
26#include "soc.h" 27#include "soc.h"
27#include "omap_hwmod_common_data.h" 28#include "omap_hwmod_common_data.h"
28#include "prm-regbits-24xx.h" 29#include "prm-regbits-24xx.h"
29#include "cm-regbits-24xx.h" 30#include "cm-regbits-24xx.h"
31#include "i2c.h"
30#include "wd_timer.h" 32#include "wd_timer.h"
31 33
32/* 34/*
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c
index cbb4ef6544ad..0413daba2dba 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c
@@ -13,8 +13,7 @@
13 */ 13 */
14#include <asm/sizes.h> 14#include <asm/sizes.h>
15 15
16#include <plat/omap_hwmod.h> 16#include "omap_hwmod.h"
17#include <plat/serial.h>
18 17
19#include "omap_hwmod_common_data.h" 18#include "omap_hwmod_common_data.h"
20 19
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 8851bbb6bb24..40d6c93d9853 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
@@ -9,13 +9,14 @@
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12#include <plat/omap_hwmod.h> 12
13#include <plat/serial.h> 13#include <plat-omap/dma-omap.h>
14#include <plat/dma.h> 14
15#include <plat/common.h> 15#include "omap_hwmod.h"
16#include "hdq1w.h" 16#include "hdq1w.h"
17 17
18#include "omap_hwmod_common_data.h" 18#include "omap_hwmod_common_data.h"
19#include "dma.h"
19 20
20/* UART */ 21/* UART */
21 22
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 1a1287d62648..47901a5e76de 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_interconnect_data.c
@@ -13,10 +13,10 @@
13 */ 13 */
14#include <asm/sizes.h> 14#include <asm/sizes.h>
15 15
16#include <plat/omap_hwmod.h> 16#include "omap_hwmod.h"
17#include <plat/serial.h>
18#include "l3_2xxx.h" 17#include "l3_2xxx.h"
19#include "l4_2xxx.h" 18#include "l4_2xxx.h"
19#include "serial.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 bd9220ed5ab9..a0116d08cf45 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
@@ -8,13 +8,13 @@
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 <plat/omap_hwmod.h> 11
12#include <plat/serial.h>
13#include <linux/platform_data/gpio-omap.h> 12#include <linux/platform_data/gpio-omap.h>
14#include <plat/dma.h> 13#include <plat-omap/dma-omap.h>
15#include <plat/dmtimer.h> 14#include <plat/dmtimer.h>
16#include <linux/platform_data/spi-omap2-mcspi.h> 15#include <linux/platform_data/spi-omap2-mcspi.h>
17 16
17#include "omap_hwmod.h"
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"
20#include "prm-regbits-24xx.h" 20#include "prm-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 59d5c1cd316d..ad8d43b33273 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -14,13 +14,11 @@
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 */ 15 */
16 16
17#include <plat/omap_hwmod.h> 17#include <linux/i2c-omap.h>
18#include <plat/cpu.h> 18
19#include "omap_hwmod.h"
19#include <linux/platform_data/gpio-omap.h> 20#include <linux/platform_data/gpio-omap.h>
20#include <linux/platform_data/spi-omap2-mcspi.h> 21#include <linux/platform_data/spi-omap2-mcspi.h>
21#include <plat/dma.h>
22#include <plat/mmc.h>
23#include <plat/i2c.h>
24 22
25#include "omap_hwmod_common_data.h" 23#include "omap_hwmod_common_data.h"
26 24
@@ -28,6 +26,8 @@
28#include "cm33xx.h" 26#include "cm33xx.h"
29#include "prm33xx.h" 27#include "prm33xx.h"
30#include "prm-regbits-33xx.h" 28#include "prm-regbits-33xx.h"
29#include "i2c.h"
30#include "mmc.h"
31 31
32/* 32/*
33 * IP blocks 33 * IP blocks
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index f67b7ee07dd4..abe66ced903f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -14,16 +14,14 @@
14 * 14 *
15 * XXX these should be marked initdata for multi-OMAP kernels 15 * XXX these should be marked initdata for multi-OMAP kernels
16 */ 16 */
17
18#include <linux/i2c-omap.h>
17#include <linux/power/smartreflex.h> 19#include <linux/power/smartreflex.h>
18#include <linux/platform_data/gpio-omap.h> 20#include <linux/platform_data/gpio-omap.h>
19 21
20#include <plat/omap_hwmod.h> 22#include <plat-omap/dma-omap.h>
21#include <plat/dma.h>
22#include <plat/serial.h>
23#include "l3_3xxx.h" 23#include "l3_3xxx.h"
24#include "l4_3xxx.h" 24#include "l4_3xxx.h"
25#include <plat/i2c.h>
26#include <plat/mmc.h>
27#include <linux/platform_data/asoc-ti-mcbsp.h> 25#include <linux/platform_data/asoc-ti-mcbsp.h>
28#include <linux/platform_data/spi-omap2-mcspi.h> 26#include <linux/platform_data/spi-omap2-mcspi.h>
29#include <plat/dmtimer.h> 27#include <plat/dmtimer.h>
@@ -32,10 +30,16 @@
32#include "am35xx.h" 30#include "am35xx.h"
33 31
34#include "soc.h" 32#include "soc.h"
33#include "omap_hwmod.h"
35#include "omap_hwmod_common_data.h" 34#include "omap_hwmod_common_data.h"
36#include "prm-regbits-34xx.h" 35#include "prm-regbits-34xx.h"
37#include "cm-regbits-34xx.h" 36#include "cm-regbits-34xx.h"
37
38#include "dma.h"
39#include "i2c.h"
40#include "mmc.h"
38#include "wd_timer.h" 41#include "wd_timer.h"
42#include "serial.h"
39 43
40/* 44/*
41 * OMAP3xxx hardware module integration data 45 * OMAP3xxx hardware module integration data
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 0b1249e00398..b80bbf607ef8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -21,23 +21,24 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/platform_data/gpio-omap.h> 22#include <linux/platform_data/gpio-omap.h>
23#include <linux/power/smartreflex.h> 23#include <linux/power/smartreflex.h>
24#include <linux/platform_data/omap_ocp2scp.h> 24#include <linux/i2c-omap.h>
25
26#include <plat-omap/dma-omap.h>
25 27
26#include <plat/omap_hwmod.h> 28#include <linux/platform_data/omap_ocp2scp.h>
27#include <plat/i2c.h>
28#include <plat/dma.h>
29#include <linux/platform_data/spi-omap2-mcspi.h> 29#include <linux/platform_data/spi-omap2-mcspi.h>
30#include <linux/platform_data/asoc-ti-mcbsp.h> 30#include <linux/platform_data/asoc-ti-mcbsp.h>
31#include <plat/mmc.h>
32#include <plat/dmtimer.h> 31#include <plat/dmtimer.h>
33#include <plat/common.h>
34#include <plat/iommu.h> 32#include <plat/iommu.h>
35 33
34#include "omap_hwmod.h"
36#include "omap_hwmod_common_data.h" 35#include "omap_hwmod_common_data.h"
37#include "cm1_44xx.h" 36#include "cm1_44xx.h"
38#include "cm2_44xx.h" 37#include "cm2_44xx.h"
39#include "prm44xx.h" 38#include "prm44xx.h"
40#include "prm-regbits-44xx.h" 39#include "prm-regbits-44xx.h"
40#include "i2c.h"
41#include "mmc.h"
41#include "wd_timer.h" 42#include "wd_timer.h"
42 43
43/* Base offset for all OMAP4 interrupts external to MPUSS */ 44/* Base offset for all OMAP4 interrupts external to MPUSS */
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.c b/arch/arm/mach-omap2/omap_hwmod_common_data.c
index 9f1ccdc8cc8c..79d623b83e49 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_common_data.c
@@ -16,7 +16,7 @@
16 * data and their integration with other OMAP modules and Linux. 16 * data and their integration with other OMAP modules and Linux.
17 */ 17 */
18 18
19#include <plat/omap_hwmod.h> 19#include "omap_hwmod.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_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h
index 2bc8f1705d4a..cfcce299177c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h
@@ -13,7 +13,7 @@
13#ifndef __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H 13#ifndef __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H
14#define __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H 14#define __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H
15 15
16#include <plat/omap_hwmod.h> 16#include "omap_hwmod.h"
17 17
18#include "common.h" 18#include "common.h"
19#include "display.h" 19#include "display.h"
diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h
index c784c12f98a1..7e437bf6024c 100644
--- a/arch/arm/mach-omap2/omap_opp_data.h
+++ b/arch/arm/mach-omap2/omap_opp_data.h
@@ -19,7 +19,7 @@
19#ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H 19#ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
20#define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H 20#define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
21 21
22#include <plat/omap_hwmod.h> 22#include "omap_hwmod.h"
23 23
24#include "voltage.h" 24#include "voltage.h"
25 25
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index d992db8ff0b0..4d76a3ca5bf3 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -27,11 +27,11 @@
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/err.h> 28#include <linux/err.h>
29#include <linux/usb.h> 29#include <linux/usb.h>
30 30#include <linux/usb/musb.h>
31#include <plat/usb.h>
32 31
33#include "soc.h" 32#include "soc.h"
34#include "control.h" 33#include "control.h"
34#include "usb.h"
35 35
36void am35x_musb_reset(void) 36void am35x_musb_reset(void)
37{ 37{
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
index f515a1a056d5..2bf35dc091be 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -18,6 +18,7 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/i2c/twl.h> 19#include <linux/i2c/twl.h>
20 20
21#include "soc.h"
21#include "voltage.h" 22#include "voltage.h"
22 23
23#include "pm.h" 24#include "pm.h"
diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c
index 58e16aef40bb..bd41d59a7cab 100644
--- a/arch/arm/mach-omap2/opp.c
+++ b/arch/arm/mach-omap2/opp.c
@@ -20,7 +20,7 @@
20#include <linux/opp.h> 20#include <linux/opp.h>
21#include <linux/cpu.h> 21#include <linux/cpu.h>
22 22
23#include <plat/omap_device.h> 23#include "omap_device.h"
24 24
25#include "omap_opp_data.h" 25#include "omap_opp_data.h"
26 26
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index 75cef5f67a8a..62772e0e0d69 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -19,6 +19,7 @@
19 */ 19 */
20#include <linux/module.h> 20#include <linux/module.h>
21 21
22#include "soc.h"
22#include "control.h" 23#include "control.h"
23#include "omap_opp_data.h" 24#include "omap_opp_data.h"
24#include "pm.h" 25#include "pm.h"
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 46092cd806fa..3cf4fdfd7ab0 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -27,12 +27,13 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29 29
30#include <plat/clock.h> 30#include "clock.h"
31#include "powerdomain.h" 31#include "powerdomain.h"
32#include "clockdomain.h" 32#include "clockdomain.h"
33#include <plat/dmtimer.h> 33#include <plat/dmtimer.h>
34#include <plat/omap-pm.h> 34#include "omap-pm.h"
35 35
36#include "soc.h"
36#include "cm2xxx_3xxx.h" 37#include "cm2xxx_3xxx.h"
37#include "prm2xxx_3xxx.h" 38#include "prm2xxx_3xxx.h"
38#include "pm.h" 39#include "pm.h"
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index ea61c32957bd..331478f9b864 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -20,10 +20,11 @@
20 20
21#include <asm/system_misc.h> 21#include <asm/system_misc.h>
22 22
23#include <plat/omap-pm.h> 23#include "omap-pm.h"
24#include <plat/omap_device.h> 24#include "omap_device.h"
25#include "common.h" 25#include "common.h"
26 26
27#include "soc.h"
27#include "prcm-common.h" 28#include "prcm-common.h"
28#include "voltage.h" 29#include "voltage.h"
29#include "powerdomain.h" 30#include "powerdomain.h"
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index 8af6cd6ac331..13e1f4303989 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -31,21 +31,24 @@
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/platform_data/gpio-omap.h> 32#include <linux/platform_data/gpio-omap.h>
33 33
34#include <asm/fncpy.h>
35
34#include <asm/mach/time.h> 36#include <asm/mach/time.h>
35#include <asm/mach/irq.h> 37#include <asm/mach/irq.h>
36#include <asm/mach-types.h> 38#include <asm/mach-types.h>
37#include <asm/system_misc.h> 39#include <asm/system_misc.h>
38 40
39#include <plat/clock.h> 41#include <plat-omap/dma-omap.h>
40#include <plat/sram.h>
41#include <plat/dma.h>
42 42
43#include "soc.h"
43#include "common.h" 44#include "common.h"
44#include "prm2xxx_3xxx.h" 45#include "clock.h"
46#include "prm2xxx.h"
45#include "prm-regbits-24xx.h" 47#include "prm-regbits-24xx.h"
46#include "cm2xxx_3xxx.h" 48#include "cm2xxx.h"
47#include "cm-regbits-24xx.h" 49#include "cm-regbits-24xx.h"
48#include "sdrc.h" 50#include "sdrc.h"
51#include "sram.h"
49#include "pm.h" 52#include "pm.h"
50#include "control.h" 53#include "control.h"
51#include "powerdomain.h" 54#include "powerdomain.h"
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 3a904de4313e..770320061422 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -32,25 +32,24 @@
32 32
33#include <trace/events/power.h> 33#include <trace/events/power.h>
34 34
35#include <asm/fncpy.h>
35#include <asm/suspend.h> 36#include <asm/suspend.h>
36#include <asm/system_misc.h> 37#include <asm/system_misc.h>
37 38
38#include <plat/sram.h>
39#include "clockdomain.h" 39#include "clockdomain.h"
40#include "powerdomain.h" 40#include "powerdomain.h"
41#include <plat/sdrc.h> 41#include <plat-omap/dma-omap.h>
42#include <plat/prcm.h>
43#include <plat/gpmc.h>
44#include <plat/dma.h>
45 42
43#include "soc.h"
46#include "common.h" 44#include "common.h"
47#include "cm2xxx_3xxx.h" 45#include "cm3xxx.h"
48#include "cm-regbits-34xx.h" 46#include "cm-regbits-34xx.h"
47#include "gpmc.h"
49#include "prm-regbits-34xx.h" 48#include "prm-regbits-34xx.h"
50 49#include "prm3xxx.h"
51#include "prm2xxx_3xxx.h"
52#include "pm.h" 50#include "pm.h"
53#include "sdrc.h" 51#include "sdrc.h"
52#include "sram.h"
54#include "control.h" 53#include "control.h"
55 54
56/* pm34xx errata defined in pm.h */ 55/* pm34xx errata defined in pm.h */
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 04922d149068..7da75aed1514 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -18,6 +18,7 @@
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <asm/system_misc.h> 19#include <asm/system_misc.h>
20 20
21#include "soc.h"
21#include "common.h" 22#include "common.h"
22#include "clockdomain.h" 23#include "clockdomain.h"
23#include "powerdomain.h" 24#include "powerdomain.h"
diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
index 2a791766283d..3cf79b54ce61 100644
--- a/arch/arm/mach-omap2/pmu.c
+++ b/arch/arm/mach-omap2/pmu.c
@@ -15,8 +15,9 @@
15 15
16#include <asm/pmu.h> 16#include <asm/pmu.h>
17 17
18#include <plat/omap_hwmod.h> 18#include "soc.h"
19#include <plat/omap_device.h> 19#include "omap_hwmod.h"
20#include "omap_device.h"
20 21
21static char *omap2_pmu_oh_names[] = {"mpu"}; 22static char *omap2_pmu_oh_names[] = {"mpu"};
22static char *omap3_pmu_oh_names[] = {"mpu", "debugss"}; 23static char *omap3_pmu_oh_names[] = {"mpu", "debugss"};
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 1678a3284233..dea62a9aad07 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -29,8 +29,6 @@
29 29
30#include <asm/cpu.h> 30#include <asm/cpu.h>
31 31
32#include <plat/prcm.h>
33
34#include "powerdomain.h" 32#include "powerdomain.h"
35#include "clockdomain.h" 33#include "clockdomain.h"
36 34
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index baee90608d11..5277d56eb37f 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -22,8 +22,6 @@
22 22
23#include <linux/atomic.h> 23#include <linux/atomic.h>
24 24
25#include <plat/cpu.h>
26
27#include "voltage.h" 25#include "voltage.h"
28 26
29/* Powerdomain basic power states */ 27/* Powerdomain basic power states */
diff --git a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
deleted file mode 100644
index 3950ccfe5f4a..000000000000
--- a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
+++ /dev/null
@@ -1,242 +0,0 @@
1/*
2 * OMAP2 and OMAP3 powerdomain control
3 *
4 * Copyright (C) 2009-2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation
6 *
7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/io.h>
16#include <linux/errno.h>
17#include <linux/delay.h>
18#include <linux/bug.h>
19
20#include <plat/prcm.h>
21
22#include "powerdomain.h"
23#include "prm.h"
24#include "prm-regbits-24xx.h"
25#include "prm-regbits-34xx.h"
26
27
28/* Common functions across OMAP2 and OMAP3 */
29static int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
30{
31 omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
32 (pwrst << OMAP_POWERSTATE_SHIFT),
33 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
34 return 0;
35}
36
37static int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
38{
39 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
40 OMAP2_PM_PWSTCTRL,
41 OMAP_POWERSTATE_MASK);
42}
43
44static int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm)
45{
46 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
47 OMAP2_PM_PWSTST,
48 OMAP_POWERSTATEST_MASK);
49}
50
51static int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
52 u8 pwrst)
53{
54 u32 m;
55
56 m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
57
58 omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
59 OMAP2_PM_PWSTCTRL);
60
61 return 0;
62}
63
64static int omap2_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
65 u8 pwrst)
66{
67 u32 m;
68
69 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
70
71 omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
72 OMAP2_PM_PWSTCTRL);
73
74 return 0;
75}
76
77static int omap2_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
78{
79 u32 m;
80
81 m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
82
83 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
84 m);
85}
86
87static int omap2_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
88{
89 u32 m;
90
91 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
92
93 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
94 OMAP2_PM_PWSTCTRL, m);
95}
96
97static int omap2_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
98{
99 u32 v;
100
101 v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
102 omap2_prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
103 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
104
105 return 0;
106}
107
108static int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm)
109{
110 u32 c = 0;
111
112 /*
113 * REVISIT: pwrdm_wait_transition() may be better implemented
114 * via a callback and a periodic timer check -- how long do we expect
115 * powerdomain transitions to take?
116 */
117
118 /* XXX Is this udelay() value meaningful? */
119 while ((omap2_prm_read_mod_reg(pwrdm->prcm_offs, OMAP2_PM_PWSTST) &
120 OMAP_INTRANSITION_MASK) &&
121 (c++ < PWRDM_TRANSITION_BAILOUT))
122 udelay(1);
123
124 if (c > PWRDM_TRANSITION_BAILOUT) {
125 pr_err("powerdomain: %s: waited too long to complete transition\n",
126 pwrdm->name);
127 return -EAGAIN;
128 }
129
130 pr_debug("powerdomain: completed transition in %d loops\n", c);
131
132 return 0;
133}
134
135/* Applicable only for OMAP3. Not supported on OMAP2 */
136static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
137{
138 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
139 OMAP3430_PM_PREPWSTST,
140 OMAP3430_LASTPOWERSTATEENTERED_MASK);
141}
142
143static int omap3_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
144{
145 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
146 OMAP2_PM_PWSTST,
147 OMAP3430_LOGICSTATEST_MASK);
148}
149
150static int omap3_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
151{
152 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
153 OMAP2_PM_PWSTCTRL,
154 OMAP3430_LOGICSTATEST_MASK);
155}
156
157static int omap3_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
158{
159 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
160 OMAP3430_PM_PREPWSTST,
161 OMAP3430_LASTLOGICSTATEENTERED_MASK);
162}
163
164static int omap3_get_mem_bank_lastmemst_mask(u8 bank)
165{
166 switch (bank) {
167 case 0:
168 return OMAP3430_LASTMEM1STATEENTERED_MASK;
169 case 1:
170 return OMAP3430_LASTMEM2STATEENTERED_MASK;
171 case 2:
172 return OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_MASK;
173 case 3:
174 return OMAP3430_LASTL2FLATMEMSTATEENTERED_MASK;
175 default:
176 WARN_ON(1); /* should never happen */
177 return -EEXIST;
178 }
179 return 0;
180}
181
182static int omap3_pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
183{
184 u32 m;
185
186 m = omap3_get_mem_bank_lastmemst_mask(bank);
187
188 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
189 OMAP3430_PM_PREPWSTST, m);
190}
191
192static int omap3_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
193{
194 omap2_prm_write_mod_reg(0, pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST);
195 return 0;
196}
197
198static int omap3_pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
199{
200 return omap2_prm_rmw_mod_reg_bits(0,
201 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
202 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
203}
204
205static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
206{
207 return omap2_prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
208 0, pwrdm->prcm_offs,
209 OMAP2_PM_PWSTCTRL);
210}
211
212struct pwrdm_ops omap2_pwrdm_operations = {
213 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst,
214 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst,
215 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst,
216 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
217 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
218 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
219 .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst,
220 .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst,
221 .pwrdm_wait_transition = omap2_pwrdm_wait_transition,
222};
223
224struct pwrdm_ops omap3_pwrdm_operations = {
225 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst,
226 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst,
227 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst,
228 .pwrdm_read_prev_pwrst = omap3_pwrdm_read_prev_pwrst,
229 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
230 .pwrdm_read_logic_pwrst = omap3_pwrdm_read_logic_pwrst,
231 .pwrdm_read_logic_retst = omap3_pwrdm_read_logic_retst,
232 .pwrdm_read_prev_logic_pwrst = omap3_pwrdm_read_prev_logic_pwrst,
233 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
234 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
235 .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst,
236 .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst,
237 .pwrdm_read_prev_mem_pwrst = omap3_pwrdm_read_prev_mem_pwrst,
238 .pwrdm_clear_all_prev_pwrst = omap3_pwrdm_clear_all_prev_pwrst,
239 .pwrdm_enable_hdwr_sar = omap3_pwrdm_enable_hdwr_sar,
240 .pwrdm_disable_hdwr_sar = omap3_pwrdm_disable_hdwr_sar,
241 .pwrdm_wait_transition = omap2_pwrdm_wait_transition,
242};
diff --git a/arch/arm/mach-omap2/powerdomain33xx.c b/arch/arm/mach-omap2/powerdomain33xx.c
deleted file mode 100644
index 67c5663899b6..000000000000
--- a/arch/arm/mach-omap2/powerdomain33xx.c
+++ /dev/null
@@ -1,229 +0,0 @@
1/*
2 * AM33XX Powerdomain control
3 *
4 * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Derived from mach-omap2/powerdomain44xx.c written by Rajendra Nayak
7 * <rnayak@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/io.h>
20#include <linux/errno.h>
21#include <linux/delay.h>
22
23#include <plat/prcm.h>
24
25#include "powerdomain.h"
26#include "prm33xx.h"
27#include "prm-regbits-33xx.h"
28
29
30static int am33xx_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
31{
32 am33xx_prm_rmw_reg_bits(OMAP_POWERSTATE_MASK,
33 (pwrst << OMAP_POWERSTATE_SHIFT),
34 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
35 return 0;
36}
37
38static int am33xx_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
39{
40 u32 v;
41
42 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
43 v &= OMAP_POWERSTATE_MASK;
44 v >>= OMAP_POWERSTATE_SHIFT;
45
46 return v;
47}
48
49static int am33xx_pwrdm_read_pwrst(struct powerdomain *pwrdm)
50{
51 u32 v;
52
53 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
54 v &= OMAP_POWERSTATEST_MASK;
55 v >>= OMAP_POWERSTATEST_SHIFT;
56
57 return v;
58}
59
60static int am33xx_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
61{
62 u32 v;
63
64 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
65 v &= AM33XX_LASTPOWERSTATEENTERED_MASK;
66 v >>= AM33XX_LASTPOWERSTATEENTERED_SHIFT;
67
68 return v;
69}
70
71static int am33xx_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
72{
73 am33xx_prm_rmw_reg_bits(AM33XX_LOWPOWERSTATECHANGE_MASK,
74 (1 << AM33XX_LOWPOWERSTATECHANGE_SHIFT),
75 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
76 return 0;
77}
78
79static int am33xx_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
80{
81 am33xx_prm_rmw_reg_bits(AM33XX_LASTPOWERSTATEENTERED_MASK,
82 AM33XX_LASTPOWERSTATEENTERED_MASK,
83 pwrdm->prcm_offs, pwrdm->pwrstst_offs);
84 return 0;
85}
86
87static int am33xx_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
88{
89 u32 m;
90
91 m = pwrdm->logicretstate_mask;
92 if (!m)
93 return -EINVAL;
94
95 am33xx_prm_rmw_reg_bits(m, (pwrst << __ffs(m)),
96 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
97
98 return 0;
99}
100
101static int am33xx_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
102{
103 u32 v;
104
105 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
106 v &= AM33XX_LOGICSTATEST_MASK;
107 v >>= AM33XX_LOGICSTATEST_SHIFT;
108
109 return v;
110}
111
112static int am33xx_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
113{
114 u32 v, m;
115
116 m = pwrdm->logicretstate_mask;
117 if (!m)
118 return -EINVAL;
119
120 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
121 v &= m;
122 v >>= __ffs(m);
123
124 return v;
125}
126
127static int am33xx_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
128 u8 pwrst)
129{
130 u32 m;
131
132 m = pwrdm->mem_on_mask[bank];
133 if (!m)
134 return -EINVAL;
135
136 am33xx_prm_rmw_reg_bits(m, (pwrst << __ffs(m)),
137 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
138
139 return 0;
140}
141
142static int am33xx_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
143 u8 pwrst)
144{
145 u32 m;
146
147 m = pwrdm->mem_ret_mask[bank];
148 if (!m)
149 return -EINVAL;
150
151 am33xx_prm_rmw_reg_bits(m, (pwrst << __ffs(m)),
152 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
153
154 return 0;
155}
156
157static int am33xx_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
158{
159 u32 m, v;
160
161 m = pwrdm->mem_pwrst_mask[bank];
162 if (!m)
163 return -EINVAL;
164
165 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
166 v &= m;
167 v >>= __ffs(m);
168
169 return v;
170}
171
172static int am33xx_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
173{
174 u32 m, v;
175
176 m = pwrdm->mem_retst_mask[bank];
177 if (!m)
178 return -EINVAL;
179
180 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
181 v &= m;
182 v >>= __ffs(m);
183
184 return v;
185}
186
187static int am33xx_pwrdm_wait_transition(struct powerdomain *pwrdm)
188{
189 u32 c = 0;
190
191 /*
192 * REVISIT: pwrdm_wait_transition() may be better implemented
193 * via a callback and a periodic timer check -- how long do we expect
194 * powerdomain transitions to take?
195 */
196
197 /* XXX Is this udelay() value meaningful? */
198 while ((am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs)
199 & OMAP_INTRANSITION_MASK) &&
200 (c++ < PWRDM_TRANSITION_BAILOUT))
201 udelay(1);
202
203 if (c > PWRDM_TRANSITION_BAILOUT) {
204 pr_err("powerdomain: %s: waited too long to complete transition\n",
205 pwrdm->name);
206 return -EAGAIN;
207 }
208
209 pr_debug("powerdomain: completed transition in %d loops\n", c);
210
211 return 0;
212}
213
214struct pwrdm_ops am33xx_pwrdm_operations = {
215 .pwrdm_set_next_pwrst = am33xx_pwrdm_set_next_pwrst,
216 .pwrdm_read_next_pwrst = am33xx_pwrdm_read_next_pwrst,
217 .pwrdm_read_pwrst = am33xx_pwrdm_read_pwrst,
218 .pwrdm_read_prev_pwrst = am33xx_pwrdm_read_prev_pwrst,
219 .pwrdm_set_logic_retst = am33xx_pwrdm_set_logic_retst,
220 .pwrdm_read_logic_pwrst = am33xx_pwrdm_read_logic_pwrst,
221 .pwrdm_read_logic_retst = am33xx_pwrdm_read_logic_retst,
222 .pwrdm_clear_all_prev_pwrst = am33xx_pwrdm_clear_all_prev_pwrst,
223 .pwrdm_set_lowpwrstchange = am33xx_pwrdm_set_lowpwrstchange,
224 .pwrdm_read_mem_pwrst = am33xx_pwrdm_read_mem_pwrst,
225 .pwrdm_read_mem_retst = am33xx_pwrdm_read_mem_retst,
226 .pwrdm_set_mem_onst = am33xx_pwrdm_set_mem_onst,
227 .pwrdm_set_mem_retst = am33xx_pwrdm_set_mem_retst,
228 .pwrdm_wait_transition = am33xx_pwrdm_wait_transition,
229};
diff --git a/arch/arm/mach-omap2/powerdomain44xx.c b/arch/arm/mach-omap2/powerdomain44xx.c
deleted file mode 100644
index aceb4f464c9b..000000000000
--- a/arch/arm/mach-omap2/powerdomain44xx.c
+++ /dev/null
@@ -1,285 +0,0 @@
1/*
2 * OMAP4 powerdomain control
3 *
4 * Copyright (C) 2009-2010, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation
6 *
7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/io.h>
16#include <linux/errno.h>
17#include <linux/delay.h>
18#include <linux/bug.h>
19
20#include "powerdomain.h"
21#include <plat/prcm.h>
22#include "prm2xxx_3xxx.h"
23#include "prm44xx.h"
24#include "prminst44xx.h"
25#include "prm-regbits-44xx.h"
26
27static int omap4_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
28{
29 omap4_prminst_rmw_inst_reg_bits(OMAP_POWERSTATE_MASK,
30 (pwrst << OMAP_POWERSTATE_SHIFT),
31 pwrdm->prcm_partition,
32 pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
33 return 0;
34}
35
36static int omap4_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
37{
38 u32 v;
39
40 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
41 OMAP4_PM_PWSTCTRL);
42 v &= OMAP_POWERSTATE_MASK;
43 v >>= OMAP_POWERSTATE_SHIFT;
44
45 return v;
46}
47
48static int omap4_pwrdm_read_pwrst(struct powerdomain *pwrdm)
49{
50 u32 v;
51
52 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
53 OMAP4_PM_PWSTST);
54 v &= OMAP_POWERSTATEST_MASK;
55 v >>= OMAP_POWERSTATEST_SHIFT;
56
57 return v;
58}
59
60static int omap4_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
61{
62 u32 v;
63
64 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
65 OMAP4_PM_PWSTST);
66 v &= OMAP4430_LASTPOWERSTATEENTERED_MASK;
67 v >>= OMAP4430_LASTPOWERSTATEENTERED_SHIFT;
68
69 return v;
70}
71
72static int omap4_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
73{
74 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LOWPOWERSTATECHANGE_MASK,
75 (1 << OMAP4430_LOWPOWERSTATECHANGE_SHIFT),
76 pwrdm->prcm_partition,
77 pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
78 return 0;
79}
80
81static int omap4_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
82{
83 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LASTPOWERSTATEENTERED_MASK,
84 OMAP4430_LASTPOWERSTATEENTERED_MASK,
85 pwrdm->prcm_partition,
86 pwrdm->prcm_offs, OMAP4_PM_PWSTST);
87 return 0;
88}
89
90static int omap4_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
91{
92 u32 v;
93
94 v = pwrst << __ffs(OMAP4430_LOGICRETSTATE_MASK);
95 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LOGICRETSTATE_MASK, v,
96 pwrdm->prcm_partition, pwrdm->prcm_offs,
97 OMAP4_PM_PWSTCTRL);
98
99 return 0;
100}
101
102static int omap4_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
103 u8 pwrst)
104{
105 u32 m;
106
107 m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
108
109 omap4_prminst_rmw_inst_reg_bits(m, (pwrst << __ffs(m)),
110 pwrdm->prcm_partition, pwrdm->prcm_offs,
111 OMAP4_PM_PWSTCTRL);
112
113 return 0;
114}
115
116static int omap4_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
117 u8 pwrst)
118{
119 u32 m;
120
121 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
122
123 omap4_prminst_rmw_inst_reg_bits(m, (pwrst << __ffs(m)),
124 pwrdm->prcm_partition, pwrdm->prcm_offs,
125 OMAP4_PM_PWSTCTRL);
126
127 return 0;
128}
129
130static int omap4_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
131{
132 u32 v;
133
134 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
135 OMAP4_PM_PWSTST);
136 v &= OMAP4430_LOGICSTATEST_MASK;
137 v >>= OMAP4430_LOGICSTATEST_SHIFT;
138
139 return v;
140}
141
142static int omap4_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
143{
144 u32 v;
145
146 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
147 OMAP4_PM_PWSTCTRL);
148 v &= OMAP4430_LOGICRETSTATE_MASK;
149 v >>= OMAP4430_LOGICRETSTATE_SHIFT;
150
151 return v;
152}
153
154/**
155 * omap4_pwrdm_read_prev_logic_pwrst - read the previous logic powerstate
156 * @pwrdm: struct powerdomain * to read the state for
157 *
158 * Reads the previous logic powerstate for a powerdomain. This
159 * function must determine the previous logic powerstate by first
160 * checking the previous powerstate for the domain. If that was OFF,
161 * then logic has been lost. If previous state was RETENTION, the
162 * function reads the setting for the next retention logic state to
163 * see the actual value. In every other case, the logic is
164 * retained. Returns either PWRDM_POWER_OFF or PWRDM_POWER_RET
165 * depending whether the logic was retained or not.
166 */
167static int omap4_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
168{
169 int state;
170
171 state = omap4_pwrdm_read_prev_pwrst(pwrdm);
172
173 if (state == PWRDM_POWER_OFF)
174 return PWRDM_POWER_OFF;
175
176 if (state != PWRDM_POWER_RET)
177 return PWRDM_POWER_RET;
178
179 return omap4_pwrdm_read_logic_retst(pwrdm);
180}
181
182static int omap4_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
183{
184 u32 m, v;
185
186 m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
187
188 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
189 OMAP4_PM_PWSTST);
190 v &= m;
191 v >>= __ffs(m);
192
193 return v;
194}
195
196static int omap4_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
197{
198 u32 m, v;
199
200 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
201
202 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
203 OMAP4_PM_PWSTCTRL);
204 v &= m;
205 v >>= __ffs(m);
206
207 return v;
208}
209
210/**
211 * omap4_pwrdm_read_prev_mem_pwrst - reads the previous memory powerstate
212 * @pwrdm: struct powerdomain * to read mem powerstate for
213 * @bank: memory bank index
214 *
215 * Reads the previous memory powerstate for a powerdomain. This
216 * function must determine the previous memory powerstate by first
217 * checking the previous powerstate for the domain. If that was OFF,
218 * then logic has been lost. If previous state was RETENTION, the
219 * function reads the setting for the next memory retention state to
220 * see the actual value. In every other case, the logic is
221 * retained. Returns either PWRDM_POWER_OFF or PWRDM_POWER_RET
222 * depending whether logic was retained or not.
223 */
224static int omap4_pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
225{
226 int state;
227
228 state = omap4_pwrdm_read_prev_pwrst(pwrdm);
229
230 if (state == PWRDM_POWER_OFF)
231 return PWRDM_POWER_OFF;
232
233 if (state != PWRDM_POWER_RET)
234 return PWRDM_POWER_RET;
235
236 return omap4_pwrdm_read_mem_retst(pwrdm, bank);
237}
238
239static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm)
240{
241 u32 c = 0;
242
243 /*
244 * REVISIT: pwrdm_wait_transition() may be better implemented
245 * via a callback and a periodic timer check -- how long do we expect
246 * powerdomain transitions to take?
247 */
248
249 /* XXX Is this udelay() value meaningful? */
250 while ((omap4_prminst_read_inst_reg(pwrdm->prcm_partition,
251 pwrdm->prcm_offs,
252 OMAP4_PM_PWSTST) &
253 OMAP_INTRANSITION_MASK) &&
254 (c++ < PWRDM_TRANSITION_BAILOUT))
255 udelay(1);
256
257 if (c > PWRDM_TRANSITION_BAILOUT) {
258 pr_err("powerdomain: %s: waited too long to complete transition\n",
259 pwrdm->name);
260 return -EAGAIN;
261 }
262
263 pr_debug("powerdomain: completed transition in %d loops\n", c);
264
265 return 0;
266}
267
268struct pwrdm_ops omap4_pwrdm_operations = {
269 .pwrdm_set_next_pwrst = omap4_pwrdm_set_next_pwrst,
270 .pwrdm_read_next_pwrst = omap4_pwrdm_read_next_pwrst,
271 .pwrdm_read_pwrst = omap4_pwrdm_read_pwrst,
272 .pwrdm_read_prev_pwrst = omap4_pwrdm_read_prev_pwrst,
273 .pwrdm_set_lowpwrstchange = omap4_pwrdm_set_lowpwrstchange,
274 .pwrdm_clear_all_prev_pwrst = omap4_pwrdm_clear_all_prev_pwrst,
275 .pwrdm_set_logic_retst = omap4_pwrdm_set_logic_retst,
276 .pwrdm_read_logic_pwrst = omap4_pwrdm_read_logic_pwrst,
277 .pwrdm_read_prev_logic_pwrst = omap4_pwrdm_read_prev_logic_pwrst,
278 .pwrdm_read_logic_retst = omap4_pwrdm_read_logic_retst,
279 .pwrdm_read_mem_pwrst = omap4_pwrdm_read_mem_pwrst,
280 .pwrdm_read_mem_retst = omap4_pwrdm_read_mem_retst,
281 .pwrdm_read_prev_mem_pwrst = omap4_pwrdm_read_prev_mem_pwrst,
282 .pwrdm_set_mem_onst = omap4_pwrdm_set_mem_onst,
283 .pwrdm_set_mem_retst = omap4_pwrdm_set_mem_retst,
284 .pwrdm_wait_transition = omap4_pwrdm_wait_transition,
285};
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c
index 2385c1f009ee..ba520d4f7c7b 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c
@@ -14,6 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17#include "soc.h"
17#include "powerdomain.h" 18#include "powerdomain.h"
18#include "powerdomains2xxx_3xxx_data.h" 19#include "powerdomains2xxx_3xxx_data.h"
19 20
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 72df97482cc0..c7d355fafd24 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -406,11 +406,6 @@
406#define OMAP3430_EN_CORE_MASK (1 << 0) 406#define OMAP3430_EN_CORE_MASK (1 << 0)
407 407
408 408
409/*
410 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
411 * submodule to exit hardreset
412 */
413#define MAX_MODULE_HARDRESET_WAIT 10000
414 409
415/* 410/*
416 * Maximum time(us) it takes to output the signal WUCLKOUT of the last 411 * Maximum time(us) it takes to output the signal WUCLKOUT of the last
@@ -419,24 +414,7 @@
419 * microseconds on OMAP4, so this timeout may be too high. 414 * microseconds on OMAP4, so this timeout may be too high.
420 */ 415 */
421#define MAX_IOPAD_LATCH_TIME 100 416#define MAX_IOPAD_LATCH_TIME 100
422
423# ifndef __ASSEMBLER__ 417# ifndef __ASSEMBLER__
424extern void __iomem *prm_base;
425extern void __iomem *cm_base;
426extern void __iomem *cm2_base;
427extern void __iomem *prcm_mpu_base;
428
429#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
430extern void omap_prm_base_init(void);
431extern void omap_cm_base_init(void);
432#else
433static inline void omap_prm_base_init(void)
434{
435}
436static inline void omap_cm_base_init(void)
437{
438}
439#endif
440 418
441/** 419/**
442 * struct omap_prcm_irq - describes a PRCM interrupt bit 420 * struct omap_prcm_irq - describes a PRCM interrupt bit
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
deleted file mode 100644
index 0f51e034e0aa..000000000000
--- a/arch/arm/mach-omap2/prcm.c
+++ /dev/null
@@ -1,188 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap2/prcm.c
3 *
4 * OMAP 24xx Power Reset and Clock Management (PRCM) functions
5 *
6 * Copyright (C) 2005 Nokia Corporation
7 *
8 * Written by Tony Lindgren <tony.lindgren@nokia.com>
9 *
10 * Copyright (C) 2007 Texas Instruments, Inc.
11 * Rajendra Nayak <rnayak@ti.com>
12 *
13 * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc.
14 * Upgraded with OMAP4 support by Abhijit Pagare <abhijitpagare@ti.com>
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
19 */
20
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/clk.h>
24#include <linux/io.h>
25#include <linux/delay.h>
26#include <linux/export.h>
27
28#include "common.h"
29#include <plat/prcm.h>
30
31#include "clock.h"
32#include "clock2xxx.h"
33#include "cm2xxx_3xxx.h"
34#include "prm2xxx_3xxx.h"
35#include "prm44xx.h"
36#include "prminst44xx.h"
37#include "cminst44xx.h"
38#include "prm-regbits-24xx.h"
39#include "prm-regbits-44xx.h"
40#include "control.h"
41
42void __iomem *prm_base;
43void __iomem *cm_base;
44void __iomem *cm2_base;
45void __iomem *prcm_mpu_base;
46
47#define MAX_MODULE_ENABLE_WAIT 100000
48
49u32 omap_prcm_get_reset_sources(void)
50{
51 /* XXX This presumably needs modification for 34XX */
52 if (cpu_is_omap24xx() || cpu_is_omap34xx())
53 return omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f;
54 if (cpu_is_omap44xx())
55 return omap2_prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f;
56
57 return 0;
58}
59EXPORT_SYMBOL(omap_prcm_get_reset_sources);
60
61/* Resets clock rates and reboots the system. Only called from system.h */
62void omap_prcm_restart(char mode, const char *cmd)
63{
64 s16 prcm_offs = 0;
65
66 if (cpu_is_omap24xx()) {
67 omap2xxx_clk_prepare_for_reboot();
68
69 prcm_offs = WKUP_MOD;
70 } else if (cpu_is_omap34xx()) {
71 prcm_offs = OMAP3430_GR_MOD;
72 omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
73 } else if (cpu_is_omap44xx()) {
74 omap4_prminst_global_warm_sw_reset(); /* never returns */
75 } else {
76 WARN_ON(1);
77 }
78
79 /*
80 * As per Errata i520, in some cases, user will not be able to
81 * access DDR memory after warm-reset.
82 * This situation occurs while the warm-reset happens during a read
83 * access to DDR memory. In that particular condition, DDR memory
84 * does not respond to a corrupted read command due to the warm
85 * reset occurrence but SDRC is waiting for read completion.
86 * SDRC is not sensitive to the warm reset, but the interconnect is
87 * reset on the fly, thus causing a misalignment between SDRC logic,
88 * interconnect logic and DDR memory state.
89 * WORKAROUND:
90 * Steps to perform before a Warm reset is trigged:
91 * 1. enable self-refresh on idle request
92 * 2. put SDRC in idle
93 * 3. wait until SDRC goes to idle
94 * 4. generate SW reset (Global SW reset)
95 *
96 * Steps to be performed after warm reset occurs (in bootloader):
97 * if HW warm reset is the source, apply below steps before any
98 * accesses to SDRAM:
99 * 1. Reset SMS and SDRC and wait till reset is complete
100 * 2. Re-initialize SMS, SDRC and memory
101 *
102 * NOTE: Above work around is required only if arch reset is implemented
103 * using Global SW reset(GLOBAL_SW_RST). DPLL3 reset does not need
104 * the WA since it resets SDRC as well as part of cold reset.
105 */
106
107 /* XXX should be moved to some OMAP2/3 specific code */
108 omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, prcm_offs,
109 OMAP2_RM_RSTCTRL);
110 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */
111}
112
113/**
114 * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness
115 * @reg: physical address of module IDLEST register
116 * @mask: value to mask against to determine if the module is active
117 * @idlest: idle state indicator (0 or 1) for the clock
118 * @name: name of the clock (for printk)
119 *
120 * Returns 1 if the module indicated readiness in time, or 0 if it
121 * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds.
122 *
123 * XXX This function is deprecated. It should be removed once the
124 * hwmod conversion is complete.
125 */
126int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
127 const char *name)
128{
129 int i = 0;
130 int ena = 0;
131
132 if (idlest)
133 ena = 0;
134 else
135 ena = mask;
136
137 /* Wait for lock */
138 omap_test_timeout(((__raw_readl(reg) & mask) == ena),
139 MAX_MODULE_ENABLE_WAIT, i);
140
141 if (i < MAX_MODULE_ENABLE_WAIT)
142 pr_debug("cm: Module associated with clock %s ready after %d loops\n",
143 name, i);
144 else
145 pr_err("cm: Module associated with clock %s didn't enable in %d tries\n",
146 name, MAX_MODULE_ENABLE_WAIT);
147
148 return (i < MAX_MODULE_ENABLE_WAIT) ? 1 : 0;
149};
150
151void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals)
152{
153 if (omap2_globals->prm)
154 prm_base = omap2_globals->prm;
155 if (omap2_globals->cm)
156 cm_base = omap2_globals->cm;
157 if (omap2_globals->cm2)
158 cm2_base = omap2_globals->cm2;
159 if (omap2_globals->prcm_mpu)
160 prcm_mpu_base = omap2_globals->prcm_mpu;
161
162 if (cpu_is_omap44xx() || soc_is_omap54xx()) {
163 omap_prm_base_init();
164 omap_cm_base_init();
165 }
166}
167
168/*
169 * Stubbed functions so that common files continue to build when
170 * custom builds are used
171 * XXX These are temporary and should be removed at the earliest possible
172 * opportunity
173 */
174int __weak omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs,
175 u16 clkctrl_offs)
176{
177 return 0;
178}
179
180void __weak omap4_cminst_module_enable(u8 mode, u8 part, u16 inst,
181 s16 cdoffs, u16 clkctrl_offs)
182{
183}
184
185void __weak omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs,
186 u16 clkctrl_offs)
187{
188}
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.c b/arch/arm/mach-omap2/prcm_mpu44xx.c
index 928dbd4f20ed..c30e44a7fab0 100644
--- a/arch/arm/mach-omap2/prcm_mpu44xx.c
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.c
@@ -20,6 +20,12 @@
20#include "prcm_mpu44xx.h" 20#include "prcm_mpu44xx.h"
21#include "cm-regbits-44xx.h" 21#include "cm-regbits-44xx.h"
22 22
23/*
24 * prcm_mpu_base: the virtual address of the start of the PRCM_MPU IP
25 * block registers
26 */
27void __iomem *prcm_mpu_base;
28
23/* PRCM_MPU low-level functions */ 29/* PRCM_MPU low-level functions */
24 30
25u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg) 31u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg)
@@ -43,3 +49,14 @@ u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
43 49
44 return v; 50 return v;
45} 51}
52
53/**
54 * omap2_set_globals_prcm_mpu - set the MPU PRCM base address (for early use)
55 * @prcm_mpu: PRCM_MPU base virtual address
56 *
57 * XXX Will be replaced when the PRM/CM drivers are completed.
58 */
59void __init omap2_set_globals_prcm_mpu(void __iomem *prcm_mpu)
60{
61 prcm_mpu_base = prcm_mpu;
62}
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h
index 8a6e250f04b5..884af7bb4afd 100644
--- a/arch/arm/mach-omap2/prcm_mpu44xx.h
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP44xx PRCM MPU instance offset macros 2 * OMAP44xx PRCM MPU instance offset macros
3 * 3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. 4 * Copyright (C) 2010, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
6 * 6 *
7 * Paul Walmsley (paul@pwsan.com) 7 * Paul Walmsley (paul@pwsan.com)
@@ -25,6 +25,12 @@
25#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H 25#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
26#define __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H 26#define __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
27 27
28#include "common.h"
29
30# ifndef __ASSEMBLER__
31extern void __iomem *prcm_mpu_base;
32# endif
33
28#define OMAP4430_PRCM_MPU_BASE 0x48243000 34#define OMAP4430_PRCM_MPU_BASE 0x48243000
29 35
30#define OMAP44XX_PRCM_MPU_REGADDR(inst, reg) \ 36#define OMAP44XX_PRCM_MPU_REGADDR(inst, reg) \
@@ -98,6 +104,7 @@ extern u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 idx);
98extern void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 idx); 104extern void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 idx);
99extern u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, 105extern u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst,
100 s16 idx); 106 s16 idx);
107extern void __init omap2_set_globals_prcm_mpu(void __iomem *prcm_mpu);
101# endif 108# endif
102 109
103#endif 110#endif
diff --git a/arch/arm/mach-omap2/prm-regbits-24xx.h b/arch/arm/mach-omap2/prm-regbits-24xx.h
index 6ac966103f34..638da6dd41c3 100644
--- a/arch/arm/mach-omap2/prm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-24xx.h
@@ -14,7 +14,7 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#include "prm2xxx_3xxx.h" 17#include "prm2xxx.h"
18 18
19/* Bits shared between registers */ 19/* Bits shared between registers */
20 20
@@ -209,9 +209,13 @@
209 209
210/* RM_RSTST_WKUP specific bits */ 210/* RM_RSTST_WKUP specific bits */
211/* 2430 calls EXTWMPU_RST "EXTWARM_RST" and GLOBALWMPU_RST "GLOBALWARM_RST" */ 211/* 2430 calls EXTWMPU_RST "EXTWARM_RST" and GLOBALWMPU_RST "GLOBALWARM_RST" */
212#define OMAP24XX_EXTWMPU_RST_SHIFT 6
212#define OMAP24XX_EXTWMPU_RST_MASK (1 << 6) 213#define OMAP24XX_EXTWMPU_RST_MASK (1 << 6)
214#define OMAP24XX_SECU_WD_RST_SHIFT 5
213#define OMAP24XX_SECU_WD_RST_MASK (1 << 5) 215#define OMAP24XX_SECU_WD_RST_MASK (1 << 5)
216#define OMAP24XX_MPU_WD_RST_SHIFT 4
214#define OMAP24XX_MPU_WD_RST_MASK (1 << 4) 217#define OMAP24XX_MPU_WD_RST_MASK (1 << 4)
218#define OMAP24XX_SECU_VIOL_RST_SHIFT 3
215#define OMAP24XX_SECU_VIOL_RST_MASK (1 << 3) 219#define OMAP24XX_SECU_VIOL_RST_MASK (1 << 3)
216 220
217/* PM_WKEN_WKUP specific bits */ 221/* PM_WKEN_WKUP specific bits */
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h
index 64c087af6a8b..838b594d4e13 100644
--- a/arch/arm/mach-omap2/prm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-34xx.h
@@ -14,7 +14,7 @@
14#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H 14#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
15 15
16 16
17#include "prm2xxx_3xxx.h" 17#include "prm3xxx.h"
18 18
19/* Shared register bits */ 19/* Shared register bits */
20 20
@@ -509,15 +509,25 @@
509#define OMAP3430_RSTTIME1_MASK (0xff << 0) 509#define OMAP3430_RSTTIME1_MASK (0xff << 0)
510 510
511/* PRM_RSTST */ 511/* PRM_RSTST */
512#define OMAP3430_ICECRUSHER_RST_SHIFT 10
512#define OMAP3430_ICECRUSHER_RST_MASK (1 << 10) 513#define OMAP3430_ICECRUSHER_RST_MASK (1 << 10)
514#define OMAP3430_ICEPICK_RST_SHIFT 9
513#define OMAP3430_ICEPICK_RST_MASK (1 << 9) 515#define OMAP3430_ICEPICK_RST_MASK (1 << 9)
516#define OMAP3430_VDD2_VOLTAGE_MANAGER_RST_SHIFT 8
514#define OMAP3430_VDD2_VOLTAGE_MANAGER_RST_MASK (1 << 8) 517#define OMAP3430_VDD2_VOLTAGE_MANAGER_RST_MASK (1 << 8)
518#define OMAP3430_VDD1_VOLTAGE_MANAGER_RST_SHIFT 7
515#define OMAP3430_VDD1_VOLTAGE_MANAGER_RST_MASK (1 << 7) 519#define OMAP3430_VDD1_VOLTAGE_MANAGER_RST_MASK (1 << 7)
520#define OMAP3430_EXTERNAL_WARM_RST_SHIFT 6
516#define OMAP3430_EXTERNAL_WARM_RST_MASK (1 << 6) 521#define OMAP3430_EXTERNAL_WARM_RST_MASK (1 << 6)
522#define OMAP3430_SECURE_WD_RST_SHIFT 5
517#define OMAP3430_SECURE_WD_RST_MASK (1 << 5) 523#define OMAP3430_SECURE_WD_RST_MASK (1 << 5)
524#define OMAP3430_MPU_WD_RST_SHIFT 4
518#define OMAP3430_MPU_WD_RST_MASK (1 << 4) 525#define OMAP3430_MPU_WD_RST_MASK (1 << 4)
526#define OMAP3430_SECURITY_VIOL_RST_SHIFT 3
519#define OMAP3430_SECURITY_VIOL_RST_MASK (1 << 3) 527#define OMAP3430_SECURITY_VIOL_RST_MASK (1 << 3)
528#define OMAP3430_GLOBAL_SW_RST_SHIFT 1
520#define OMAP3430_GLOBAL_SW_RST_MASK (1 << 1) 529#define OMAP3430_GLOBAL_SW_RST_MASK (1 << 1)
530#define OMAP3430_GLOBAL_COLD_RST_SHIFT 0
521#define OMAP3430_GLOBAL_COLD_RST_MASK (1 << 0) 531#define OMAP3430_GLOBAL_COLD_RST_MASK (1 << 0)
522 532
523/* PRM_VOLTCTRL */ 533/* PRM_VOLTCTRL */
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 39d562169d18..a1a266ce90da 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions 2 * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions
3 * 3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
6 * 6 *
7 * Paul Walmsley 7 * Paul Walmsley
@@ -15,6 +15,28 @@
15 15
16#include "prcm-common.h" 16#include "prcm-common.h"
17 17
18# ifndef __ASSEMBLER__
19extern void __iomem *prm_base;
20extern void omap2_set_globals_prm(void __iomem *prm);
21# endif
22
23
24/*
25 * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
26 * module to softreset
27 */
28#define MAX_MODULE_SOFTRESET_WAIT 10000
29
30/*
31 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
32 * submodule to exit hardreset
33 */
34#define MAX_MODULE_HARDRESET_WAIT 10000
35
36/*
37 * Register bitfields
38 */
39
18/* 40/*
19 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP 41 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP
20 * 42 *
@@ -52,5 +74,58 @@
52#define OMAP_POWERSTATE_SHIFT 0 74#define OMAP_POWERSTATE_SHIFT 0
53#define OMAP_POWERSTATE_MASK (0x3 << 0) 75#define OMAP_POWERSTATE_MASK (0x3 << 0)
54 76
77/*
78 * Standardized OMAP reset source bits
79 *
80 * To the extent these happen to match the hardware register bit
81 * shifts, it's purely coincidental. Used by omap-wdt.c.
82 * OMAP_UNKNOWN_RST_SRC_ID_SHIFT is a special value, used whenever
83 * there are any bits remaining in the global PRM_RSTST register that
84 * haven't been identified, or when the PRM code for the current SoC
85 * doesn't know how to interpret the register.
86 */
87#define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT 0
88#define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT 1
89#define OMAP_SECU_VIOL_RST_SRC_ID_SHIFT 2
90#define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
91#define OMAP_SECU_WD_RST_SRC_ID_SHIFT 4
92#define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5
93#define OMAP_VDD_MPU_VM_RST_SRC_ID_SHIFT 6
94#define OMAP_VDD_IVA_VM_RST_SRC_ID_SHIFT 7
95#define OMAP_VDD_CORE_VM_RST_SRC_ID_SHIFT 8
96#define OMAP_ICEPICK_RST_SRC_ID_SHIFT 9
97#define OMAP_ICECRUSHER_RST_SRC_ID_SHIFT 10
98#define OMAP_C2C_RST_SRC_ID_SHIFT 11
99#define OMAP_UNKNOWN_RST_SRC_ID_SHIFT 12
100
101#ifndef __ASSEMBLER__
102
103/**
104 * struct prm_reset_src_map - map register bitshifts to standard bitshifts
105 * @reg_shift: bitshift in the PRM reset source register
106 * @std_shift: bitshift equivalent in the standard reset source list
107 *
108 * The fields are signed because -1 is used as a terminator.
109 */
110struct prm_reset_src_map {
111 s8 reg_shift;
112 s8 std_shift;
113};
114
115/**
116 * struct prm_ll_data - fn ptrs to per-SoC PRM function implementations
117 * @read_reset_sources: ptr to the Soc PRM-specific get_reset_source impl
118 */
119struct prm_ll_data {
120 u32 (*read_reset_sources)(void);
121};
122
123extern int prm_register(struct prm_ll_data *pld);
124extern int prm_unregister(struct prm_ll_data *pld);
125
126extern u32 prm_read_reset_sources(void);
127
128#endif
129
55 130
56#endif 131#endif
diff --git a/arch/arm/mach-omap2/prm2xxx.c b/arch/arm/mach-omap2/prm2xxx.c
new file mode 100644
index 000000000000..bf24fc47603b
--- /dev/null
+++ b/arch/arm/mach-omap2/prm2xxx.c
@@ -0,0 +1,139 @@
1/*
2 * OMAP2xxx PRM module functions
3 *
4 * Copyright (C) 2010-2012 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation
6 * Benoît Cousson
7 * Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/err.h>
18#include <linux/io.h>
19#include <linux/irq.h>
20
21#include "common.h"
22#include <plat/cpu.h>
23
24#include "vp.h"
25#include "powerdomain.h"
26#include "clockdomain.h"
27#include "prm2xxx.h"
28#include "cm2xxx_3xxx.h"
29#include "prm-regbits-24xx.h"
30
31/*
32 * omap2xxx_prm_reset_src_map - map from bits in the PRM_RSTST_WKUP
33 * hardware register (which are specific to the OMAP2xxx SoCs) to
34 * reset source ID bit shifts (which is an OMAP SoC-independent
35 * enumeration)
36 */
37static struct prm_reset_src_map omap2xxx_prm_reset_src_map[] = {
38 { OMAP_GLOBALCOLD_RST_SHIFT, OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT },
39 { OMAP_GLOBALWARM_RST_SHIFT, OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT },
40 { OMAP24XX_SECU_VIOL_RST_SHIFT, OMAP_SECU_VIOL_RST_SRC_ID_SHIFT },
41 { OMAP24XX_MPU_WD_RST_SHIFT, OMAP_MPU_WD_RST_SRC_ID_SHIFT },
42 { OMAP24XX_SECU_WD_RST_SHIFT, OMAP_SECU_WD_RST_SRC_ID_SHIFT },
43 { OMAP24XX_EXTWMPU_RST_SHIFT, OMAP_EXTWARM_RST_SRC_ID_SHIFT },
44 { -1, -1 },
45};
46
47/**
48 * omap2xxx_prm_read_reset_sources - return the last SoC reset source
49 *
50 * Return a u32 representing the last reset sources of the SoC. The
51 * returned reset source bits are standardized across OMAP SoCs.
52 */
53static u32 omap2xxx_prm_read_reset_sources(void)
54{
55 struct prm_reset_src_map *p;
56 u32 r = 0;
57 u32 v;
58
59 v = omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST);
60
61 p = omap2xxx_prm_reset_src_map;
62 while (p->reg_shift >= 0 && p->std_shift >= 0) {
63 if (v & (1 << p->reg_shift))
64 r |= 1 << p->std_shift;
65 p++;
66 }
67
68 return r;
69}
70
71/**
72 * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC
73 *
74 * Set the DPLL reset bit, which should reboot the SoC. This is the
75 * recommended way to restart the SoC. No return value.
76 */
77void omap2xxx_prm_dpll_reset(void)
78{
79 omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, WKUP_MOD,
80 OMAP2_RM_RSTCTRL);
81 /* OCP barrier */
82 omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTCTRL);
83}
84
85int omap2xxx_clkdm_sleep(struct clockdomain *clkdm)
86{
87 omap2_prm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
88 clkdm->pwrdm.ptr->prcm_offs,
89 OMAP2_PM_PWSTCTRL);
90 return 0;
91}
92
93int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm)
94{
95 omap2_prm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
96 clkdm->pwrdm.ptr->prcm_offs,
97 OMAP2_PM_PWSTCTRL);
98 return 0;
99}
100
101struct pwrdm_ops omap2_pwrdm_operations = {
102 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst,
103 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst,
104 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst,
105 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
106 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
107 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
108 .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst,
109 .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst,
110 .pwrdm_wait_transition = omap2_pwrdm_wait_transition,
111};
112
113/*
114 *
115 */
116
117static struct prm_ll_data omap2xxx_prm_ll_data = {
118 .read_reset_sources = &omap2xxx_prm_read_reset_sources,
119};
120
121static int __init omap2xxx_prm_init(void)
122{
123 if (!cpu_is_omap24xx())
124 return 0;
125
126 return prm_register(&omap2xxx_prm_ll_data);
127}
128subsys_initcall(omap2xxx_prm_init);
129
130static void __exit omap2xxx_prm_exit(void)
131{
132 if (!cpu_is_omap24xx())
133 return;
134
135 /* Should never happen */
136 WARN(prm_unregister(&omap2xxx_prm_ll_data),
137 "%s: prm_ll_data function pointer mismatch\n", __func__);
138}
139__exitcall(omap2xxx_prm_exit);
diff --git a/arch/arm/mach-omap2/prm2xxx.h b/arch/arm/mach-omap2/prm2xxx.h
new file mode 100644
index 000000000000..fe8a14f190ab
--- /dev/null
+++ b/arch/arm/mach-omap2/prm2xxx.h
@@ -0,0 +1,134 @@
1/*
2 * OMAP2xxx Power/Reset Management (PRM) register definitions
3 *
4 * Copyright (C) 2007-2009, 2011-2012 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Paul Walmsley
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 * The PRM hardware modules on the OMAP2/3 are quite similar to each
13 * other. The PRM on OMAP4 has a new register layout, and is handled
14 * in a separate file.
15 */
16#ifndef __ARCH_ARM_MACH_OMAP2_PRM2XXX_H
17#define __ARCH_ARM_MACH_OMAP2_PRM2XXX_H
18
19#include "prcm-common.h"
20#include "prm.h"
21#include "prm2xxx_3xxx.h"
22
23#define OMAP2420_PRM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
25#define OMAP2430_PRM_REGADDR(module, reg) \
26 OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
27
28/*
29 * OMAP2-specific global PRM registers
30 * Use __raw_{read,write}l() with these registers.
31 *
32 * With a few exceptions, these are the register names beginning with
33 * PRCM_* on 24xx. (The exceptions are the IRQSTATUS and IRQENABLE
34 * bits.)
35 *
36 */
37
38#define OMAP2_PRCM_REVISION_OFFSET 0x0000
39#define OMAP2420_PRCM_REVISION OMAP2420_PRM_REGADDR(OCP_MOD, 0x0000)
40#define OMAP2_PRCM_SYSCONFIG_OFFSET 0x0010
41#define OMAP2420_PRCM_SYSCONFIG OMAP2420_PRM_REGADDR(OCP_MOD, 0x0010)
42
43#define OMAP2_PRCM_IRQSTATUS_MPU_OFFSET 0x0018
44#define OMAP2420_PRCM_IRQSTATUS_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x0018)
45#define OMAP2_PRCM_IRQENABLE_MPU_OFFSET 0x001c
46#define OMAP2420_PRCM_IRQENABLE_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x001c)
47
48#define OMAP2_PRCM_VOLTCTRL_OFFSET 0x0050
49#define OMAP2420_PRCM_VOLTCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0050)
50#define OMAP2_PRCM_VOLTST_OFFSET 0x0054
51#define OMAP2420_PRCM_VOLTST OMAP2420_PRM_REGADDR(OCP_MOD, 0x0054)
52#define OMAP2_PRCM_CLKSRC_CTRL_OFFSET 0x0060
53#define OMAP2420_PRCM_CLKSRC_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0060)
54#define OMAP2_PRCM_CLKOUT_CTRL_OFFSET 0x0070
55#define OMAP2420_PRCM_CLKOUT_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0070)
56#define OMAP2_PRCM_CLKEMUL_CTRL_OFFSET 0x0078
57#define OMAP2420_PRCM_CLKEMUL_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0078)
58#define OMAP2_PRCM_CLKCFG_CTRL_OFFSET 0x0080
59#define OMAP2420_PRCM_CLKCFG_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0080)
60#define OMAP2_PRCM_CLKCFG_STATUS_OFFSET 0x0084
61#define OMAP2420_PRCM_CLKCFG_STATUS OMAP2420_PRM_REGADDR(OCP_MOD, 0x0084)
62#define OMAP2_PRCM_VOLTSETUP_OFFSET 0x0090
63#define OMAP2420_PRCM_VOLTSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0090)
64#define OMAP2_PRCM_CLKSSETUP_OFFSET 0x0094
65#define OMAP2420_PRCM_CLKSSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0094)
66#define OMAP2_PRCM_POLCTRL_OFFSET 0x0098
67#define OMAP2420_PRCM_POLCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0098)
68
69#define OMAP2430_PRCM_REVISION OMAP2430_PRM_REGADDR(OCP_MOD, 0x0000)
70#define OMAP2430_PRCM_SYSCONFIG OMAP2430_PRM_REGADDR(OCP_MOD, 0x0010)
71
72#define OMAP2430_PRCM_IRQSTATUS_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x0018)
73#define OMAP2430_PRCM_IRQENABLE_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x001c)
74
75#define OMAP2430_PRCM_VOLTCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0050)
76#define OMAP2430_PRCM_VOLTST OMAP2430_PRM_REGADDR(OCP_MOD, 0x0054)
77#define OMAP2430_PRCM_CLKSRC_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0060)
78#define OMAP2430_PRCM_CLKOUT_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0070)
79#define OMAP2430_PRCM_CLKEMUL_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0078)
80#define OMAP2430_PRCM_CLKCFG_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0080)
81#define OMAP2430_PRCM_CLKCFG_STATUS OMAP2430_PRM_REGADDR(OCP_MOD, 0x0084)
82#define OMAP2430_PRCM_VOLTSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0090)
83#define OMAP2430_PRCM_CLKSSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0094)
84#define OMAP2430_PRCM_POLCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0098)
85
86/*
87 * Module specific PRM register offsets from PRM_BASE + domain offset
88 *
89 * Use prm_{read,write}_mod_reg() with these registers.
90 *
91 * With a few exceptions, these are the register names beginning with
92 * {PM,RM}_* on both OMAP2/3 SoC families.. (The exceptions are the
93 * IRQSTATUS and IRQENABLE bits.)
94 */
95
96/* Register offsets appearing on both OMAP2 and OMAP3 */
97
98#define OMAP2_RM_RSTCTRL 0x0050
99#define OMAP2_RM_RSTTIME 0x0054
100#define OMAP2_RM_RSTST 0x0058
101#define OMAP2_PM_PWSTCTRL 0x00e0
102#define OMAP2_PM_PWSTST 0x00e4
103
104#define PM_WKEN 0x00a0
105#define PM_WKEN1 PM_WKEN
106#define PM_WKST 0x00b0
107#define PM_WKST1 PM_WKST
108#define PM_WKDEP 0x00c8
109#define PM_EVGENCTRL 0x00d4
110#define PM_EVGENONTIM 0x00d8
111#define PM_EVGENOFFTIM 0x00dc
112
113/* OMAP2xxx specific register offsets */
114#define OMAP24XX_PM_WKEN2 0x00a4
115#define OMAP24XX_PM_WKST2 0x00b4
116
117#define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
118#define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
119#define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8
120#define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc
121
122#ifndef __ASSEMBLER__
123/* Function prototypes */
124extern int omap2xxx_clkdm_sleep(struct clockdomain *clkdm);
125extern int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm);
126
127extern void omap2xxx_prm_dpll_reset(void);
128
129extern int __init prm2xxx_init(void);
130extern int __exit prm2xxx_exit(void);
131
132#endif
133
134#endif
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index 9529984d8d2b..30517f5af707 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -15,82 +15,12 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/irq.h>
19 18
20#include <plat/prcm.h>
21
22#include "soc.h"
23#include "common.h" 19#include "common.h"
24#include "vp.h" 20#include "powerdomain.h"
25
26#include "prm2xxx_3xxx.h" 21#include "prm2xxx_3xxx.h"
27#include "cm2xxx_3xxx.h"
28#include "prm-regbits-24xx.h" 22#include "prm-regbits-24xx.h"
29#include "prm-regbits-34xx.h" 23#include "clockdomain.h"
30
31static const struct omap_prcm_irq omap3_prcm_irqs[] = {
32 OMAP_PRCM_IRQ("wkup", 0, 0),
33 OMAP_PRCM_IRQ("io", 9, 1),
34};
35
36static struct omap_prcm_irq_setup omap3_prcm_irq_setup = {
37 .ack = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
38 .mask = OMAP3_PRM_IRQENABLE_MPU_OFFSET,
39 .nr_regs = 1,
40 .irqs = omap3_prcm_irqs,
41 .nr_irqs = ARRAY_SIZE(omap3_prcm_irqs),
42 .irq = 11 + OMAP_INTC_START,
43 .read_pending_irqs = &omap3xxx_prm_read_pending_irqs,
44 .ocp_barrier = &omap3xxx_prm_ocp_barrier,
45 .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen,
46 .restore_irqen = &omap3xxx_prm_restore_irqen,
47};
48
49u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
50{
51 return __raw_readl(prm_base + module + idx);
52}
53
54void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx)
55{
56 __raw_writel(val, prm_base + module + idx);
57}
58
59/* Read-modify-write a register in a PRM module. Caller must lock */
60u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
61{
62 u32 v;
63
64 v = omap2_prm_read_mod_reg(module, idx);
65 v &= ~mask;
66 v |= bits;
67 omap2_prm_write_mod_reg(v, module, idx);
68
69 return v;
70}
71
72/* Read a PRM register, AND it, and shift the result down to bit 0 */
73u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
74{
75 u32 v;
76
77 v = omap2_prm_read_mod_reg(domain, idx);
78 v &= mask;
79 v >>= __ffs(mask);
80
81 return v;
82}
83
84u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
85{
86 return omap2_prm_rmw_mod_reg_bits(bits, bits, module, idx);
87}
88
89u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
90{
91 return omap2_prm_rmw_mod_reg_bits(bits, 0x0, module, idx);
92}
93
94 24
95/** 25/**
96 * omap2_prm_is_hardreset_asserted - read the HW reset line state of 26 * omap2_prm_is_hardreset_asserted - read the HW reset line state of
@@ -104,9 +34,6 @@ u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
104 */ 34 */
105int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift) 35int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift)
106{ 36{
107 if (!(cpu_is_omap24xx() || cpu_is_omap34xx()))
108 return -EINVAL;
109
110 return omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, 37 return omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL,
111 (1 << shift)); 38 (1 << shift));
112} 39}
@@ -127,9 +54,6 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
127{ 54{
128 u32 mask; 55 u32 mask;
129 56
130 if (!(cpu_is_omap24xx() || cpu_is_omap34xx()))
131 return -EINVAL;
132
133 mask = 1 << shift; 57 mask = 1 << shift;
134 omap2_prm_rmw_mod_reg_bits(mask, mask, prm_mod, OMAP2_RM_RSTCTRL); 58 omap2_prm_rmw_mod_reg_bits(mask, mask, prm_mod, OMAP2_RM_RSTCTRL);
135 59
@@ -156,9 +80,6 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)
156 u32 rst, st; 80 u32 rst, st;
157 int c; 81 int c;
158 82
159 if (!(cpu_is_omap24xx() || cpu_is_omap34xx()))
160 return -EINVAL;
161
162 rst = 1 << rst_shift; 83 rst = 1 << rst_shift;
163 st = 1 << st_shift; 84 st = 1 << st_shift;
164 85
@@ -178,188 +99,155 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)
178 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; 99 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
179} 100}
180 101
181/* PRM VP */
182
183/*
184 * struct omap3_vp - OMAP3 VP register access description.
185 * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg
186 */
187struct omap3_vp {
188 u32 tranxdone_status;
189};
190
191static struct omap3_vp omap3_vp[] = {
192 [OMAP3_VP_VDD_MPU_ID] = {
193 .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK,
194 },
195 [OMAP3_VP_VDD_CORE_ID] = {
196 .tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK,
197 },
198};
199
200#define MAX_VP_ID ARRAY_SIZE(omap3_vp);
201
202u32 omap3_prm_vp_check_txdone(u8 vp_id)
203{
204 struct omap3_vp *vp = &omap3_vp[vp_id];
205 u32 irqstatus;
206 102
207 irqstatus = omap2_prm_read_mod_reg(OCP_MOD, 103/* Powerdomain low-level functions */
208 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
209 return irqstatus & vp->tranxdone_status;
210}
211 104
212void omap3_prm_vp_clear_txdone(u8 vp_id) 105/* Common functions across OMAP2 and OMAP3 */
106int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
213{ 107{
214 struct omap3_vp *vp = &omap3_vp[vp_id]; 108 omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
215 109 (pwrst << OMAP_POWERSTATE_SHIFT),
216 omap2_prm_write_mod_reg(vp->tranxdone_status, 110 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
217 OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 111 return 0;
218} 112}
219 113
220u32 omap3_prm_vcvp_read(u8 offset) 114int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
221{ 115{
222 return omap2_prm_read_mod_reg(OMAP3430_GR_MOD, offset); 116 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
117 OMAP2_PM_PWSTCTRL,
118 OMAP_POWERSTATE_MASK);
223} 119}
224 120
225void omap3_prm_vcvp_write(u32 val, u8 offset) 121int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm)
226{ 122{
227 omap2_prm_write_mod_reg(val, OMAP3430_GR_MOD, offset); 123 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
124 OMAP2_PM_PWSTST,
125 OMAP_POWERSTATEST_MASK);
228} 126}
229 127
230u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset) 128int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
129 u8 pwrst)
231{ 130{
232 return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset); 131 u32 m;
132
133 m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
134
135 omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
136 OMAP2_PM_PWSTCTRL);
137
138 return 0;
233} 139}
234 140
235/** 141int omap2_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
236 * omap3xxx_prm_read_pending_irqs - read pending PRM MPU IRQs into @events 142 u8 pwrst)
237 * @events: ptr to a u32, preallocated by caller
238 *
239 * Read PRM_IRQSTATUS_MPU bits, AND'ed with the currently-enabled PRM
240 * MPU IRQs, and store the result into the u32 pointed to by @events.
241 * No return value.
242 */
243void omap3xxx_prm_read_pending_irqs(unsigned long *events)
244{ 143{
245 u32 mask, st; 144 u32 m;
145
146 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
246 147
247 /* XXX Can the mask read be avoided (e.g., can it come from RAM?) */ 148 omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
248 mask = omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); 149 OMAP2_PM_PWSTCTRL);
249 st = omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
250 150
251 events[0] = mask & st; 151 return 0;
252} 152}
253 153
254/** 154int omap2_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
255 * omap3xxx_prm_ocp_barrier - force buffered MPU writes to the PRM to complete
256 *
257 * Force any buffered writes to the PRM IP block to complete. Needed
258 * by the PRM IRQ handler, which reads and writes directly to the IP
259 * block, to avoid race conditions after acknowledging or clearing IRQ
260 * bits. No return value.
261 */
262void omap3xxx_prm_ocp_barrier(void)
263{ 155{
264 omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_REVISION_OFFSET); 156 u32 m;
157
158 m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
159
160 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
161 m);
265} 162}
266 163
267/** 164int omap2_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
268 * omap3xxx_prm_save_and_clear_irqen - save/clear PRM_IRQENABLE_MPU reg
269 * @saved_mask: ptr to a u32 array to save IRQENABLE bits
270 *
271 * Save the PRM_IRQENABLE_MPU register to @saved_mask. @saved_mask
272 * must be allocated by the caller. Intended to be used in the PRM
273 * interrupt handler suspend callback. The OCP barrier is needed to
274 * ensure the write to disable PRM interrupts reaches the PRM before
275 * returning; otherwise, spurious interrupts might occur. No return
276 * value.
277 */
278void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask)
279{ 165{
280 saved_mask[0] = omap2_prm_read_mod_reg(OCP_MOD, 166 u32 m;
281 OMAP3_PRM_IRQENABLE_MPU_OFFSET); 167
282 omap2_prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); 168 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
283 169
284 /* OCP barrier */ 170 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
285 omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_REVISION_OFFSET); 171 OMAP2_PM_PWSTCTRL, m);
286} 172}
287 173
288/** 174int omap2_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
289 * omap3xxx_prm_restore_irqen - set PRM_IRQENABLE_MPU register from args
290 * @saved_mask: ptr to a u32 array of IRQENABLE bits saved previously
291 *
292 * Restore the PRM_IRQENABLE_MPU register from @saved_mask. Intended
293 * to be used in the PRM interrupt handler resume callback to restore
294 * values saved by omap3xxx_prm_save_and_clear_irqen(). No OCP
295 * barrier should be needed here; any pending PRM interrupts will fire
296 * once the writes reach the PRM. No return value.
297 */
298void omap3xxx_prm_restore_irqen(u32 *saved_mask)
299{ 175{
300 omap2_prm_write_mod_reg(saved_mask[0], OCP_MOD, 176 u32 v;
301 OMAP3_PRM_IRQENABLE_MPU_OFFSET); 177
178 v = pwrst << __ffs(OMAP_LOGICRETSTATE_MASK);
179 omap2_prm_rmw_mod_reg_bits(OMAP_LOGICRETSTATE_MASK, v, pwrdm->prcm_offs,
180 OMAP2_PM_PWSTCTRL);
181
182 return 0;
302} 183}
303 184
304/** 185int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm)
305 * omap3xxx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
306 *
307 * Clear any previously-latched I/O wakeup events and ensure that the
308 * I/O wakeup gates are aligned with the current mux settings. Works
309 * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then
310 * deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No
311 * return value.
312 */
313void omap3xxx_prm_reconfigure_io_chain(void)
314{ 186{
315 int i = 0; 187 u32 c = 0;
316 188
317 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, 189 /*
318 PM_WKEN); 190 * REVISIT: pwrdm_wait_transition() may be better implemented
191 * via a callback and a periodic timer check -- how long do we expect
192 * powerdomain transitions to take?
193 */
319 194
320 omap_test_timeout(omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST) & 195 /* XXX Is this udelay() value meaningful? */
321 OMAP3430_ST_IO_CHAIN_MASK, 196 while ((omap2_prm_read_mod_reg(pwrdm->prcm_offs, OMAP2_PM_PWSTST) &
322 MAX_IOPAD_LATCH_TIME, i); 197 OMAP_INTRANSITION_MASK) &&
323 if (i == MAX_IOPAD_LATCH_TIME) 198 (c++ < PWRDM_TRANSITION_BAILOUT))
324 pr_warn("PRM: I/O chain clock line assertion timed out\n"); 199 udelay(1);
325 200
326 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, 201 if (c > PWRDM_TRANSITION_BAILOUT) {
327 PM_WKEN); 202 pr_err("powerdomain: %s: waited too long to complete transition\n",
203 pwrdm->name);
204 return -EAGAIN;
205 }
328 206
329 omap2_prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK, WKUP_MOD, 207 pr_debug("powerdomain: completed transition in %d loops\n", c);
330 PM_WKST);
331 208
332 omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST); 209 return 0;
333} 210}
334 211
335/** 212int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1,
336 * omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches 213 struct clockdomain *clkdm2)
337 * 214{
338 * Activates the I/O wakeup event latches and allows events logged by 215 omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit),
339 * those latches to signal a wakeup event to the PRCM. For I/O 216 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
340 * wakeups to occur, WAKEUPENABLE bits must be set in the pad mux 217 return 0;
341 * registers, and omap3xxx_prm_reconfigure_io_chain() must be called. 218}
342 * No return value. 219
343 */ 220int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1,
344static void __init omap3xxx_prm_enable_io_wakeup(void) 221 struct clockdomain *clkdm2)
222{
223 omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
224 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
225 return 0;
226}
227
228int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1,
229 struct clockdomain *clkdm2)
345{ 230{
346 if (omap3_has_io_wakeup()) 231 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
347 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, 232 PM_WKDEP, (1 << clkdm2->dep_bit));
348 PM_WKEN);
349} 233}
350 234
351static int __init omap3xxx_prcm_init(void) 235int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
352{ 236{
353 int ret = 0; 237 struct clkdm_dep *cd;
354 238 u32 mask = 0;
355 if (cpu_is_omap34xx()) { 239
356 omap3xxx_prm_enable_io_wakeup(); 240 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
357 ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); 241 if (!cd->clkdm)
358 if (!ret) 242 continue; /* only happens if data is erroneous */
359 irq_set_status_flags(omap_prcm_event_to_irq("io"), 243
360 IRQ_NOAUTOEN); 244 /* PRM accesses are slow, so minimize them */
245 mask |= 1 << cd->clkdm->dep_bit;
246 atomic_set(&cd->wkdep_usecount, 0);
361 } 247 }
362 248
363 return ret; 249 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
250 PM_WKDEP);
251 return 0;
364} 252}
365subsys_initcall(omap3xxx_prcm_init); 253
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h
index c19d249b4816..78532d6fecd7 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3 Power/Reset Management (PRM) register definitions 2 * OMAP2xxx/3xxx-common Power/Reset Management (PRM) register definitions
3 * 3 *
4 * Copyright (C) 2007-2009, 2011 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009, 2011-2012 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation 5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Paul Walmsley 6 * Paul Walmsley
7 * 7 *
@@ -19,160 +19,6 @@
19#include "prcm-common.h" 19#include "prcm-common.h"
20#include "prm.h" 20#include "prm.h"
21 21
22#define OMAP2420_PRM_REGADDR(module, reg) \
23 OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
24#define OMAP2430_PRM_REGADDR(module, reg) \
25 OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
26#define OMAP34XX_PRM_REGADDR(module, reg) \
27 OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
28
29
30/*
31 * OMAP2-specific global PRM registers
32 * Use __raw_{read,write}l() with these registers.
33 *
34 * With a few exceptions, these are the register names beginning with
35 * PRCM_* on 24xx. (The exceptions are the IRQSTATUS and IRQENABLE
36 * bits.)
37 *
38 */
39
40#define OMAP2_PRCM_REVISION_OFFSET 0x0000
41#define OMAP2420_PRCM_REVISION OMAP2420_PRM_REGADDR(OCP_MOD, 0x0000)
42#define OMAP2_PRCM_SYSCONFIG_OFFSET 0x0010
43#define OMAP2420_PRCM_SYSCONFIG OMAP2420_PRM_REGADDR(OCP_MOD, 0x0010)
44
45#define OMAP2_PRCM_IRQSTATUS_MPU_OFFSET 0x0018
46#define OMAP2420_PRCM_IRQSTATUS_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x0018)
47#define OMAP2_PRCM_IRQENABLE_MPU_OFFSET 0x001c
48#define OMAP2420_PRCM_IRQENABLE_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x001c)
49
50#define OMAP2_PRCM_VOLTCTRL_OFFSET 0x0050
51#define OMAP2420_PRCM_VOLTCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0050)
52#define OMAP2_PRCM_VOLTST_OFFSET 0x0054
53#define OMAP2420_PRCM_VOLTST OMAP2420_PRM_REGADDR(OCP_MOD, 0x0054)
54#define OMAP2_PRCM_CLKSRC_CTRL_OFFSET 0x0060
55#define OMAP2420_PRCM_CLKSRC_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0060)
56#define OMAP2_PRCM_CLKOUT_CTRL_OFFSET 0x0070
57#define OMAP2420_PRCM_CLKOUT_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0070)
58#define OMAP2_PRCM_CLKEMUL_CTRL_OFFSET 0x0078
59#define OMAP2420_PRCM_CLKEMUL_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0078)
60#define OMAP2_PRCM_CLKCFG_CTRL_OFFSET 0x0080
61#define OMAP2420_PRCM_CLKCFG_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0080)
62#define OMAP2_PRCM_CLKCFG_STATUS_OFFSET 0x0084
63#define OMAP2420_PRCM_CLKCFG_STATUS OMAP2420_PRM_REGADDR(OCP_MOD, 0x0084)
64#define OMAP2_PRCM_VOLTSETUP_OFFSET 0x0090
65#define OMAP2420_PRCM_VOLTSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0090)
66#define OMAP2_PRCM_CLKSSETUP_OFFSET 0x0094
67#define OMAP2420_PRCM_CLKSSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0094)
68#define OMAP2_PRCM_POLCTRL_OFFSET 0x0098
69#define OMAP2420_PRCM_POLCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0098)
70
71#define OMAP2430_PRCM_REVISION OMAP2430_PRM_REGADDR(OCP_MOD, 0x0000)
72#define OMAP2430_PRCM_SYSCONFIG OMAP2430_PRM_REGADDR(OCP_MOD, 0x0010)
73
74#define OMAP2430_PRCM_IRQSTATUS_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x0018)
75#define OMAP2430_PRCM_IRQENABLE_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x001c)
76
77#define OMAP2430_PRCM_VOLTCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0050)
78#define OMAP2430_PRCM_VOLTST OMAP2430_PRM_REGADDR(OCP_MOD, 0x0054)
79#define OMAP2430_PRCM_CLKSRC_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0060)
80#define OMAP2430_PRCM_CLKOUT_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0070)
81#define OMAP2430_PRCM_CLKEMUL_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0078)
82#define OMAP2430_PRCM_CLKCFG_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0080)
83#define OMAP2430_PRCM_CLKCFG_STATUS OMAP2430_PRM_REGADDR(OCP_MOD, 0x0084)
84#define OMAP2430_PRCM_VOLTSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0090)
85#define OMAP2430_PRCM_CLKSSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0094)
86#define OMAP2430_PRCM_POLCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0098)
87
88/*
89 * OMAP3-specific global PRM registers
90 * Use __raw_{read,write}l() with these registers.
91 *
92 * With a few exceptions, these are the register names beginning with
93 * PRM_* on 34xx. (The exceptions are the IRQSTATUS and IRQENABLE
94 * bits.)
95 */
96
97#define OMAP3_PRM_REVISION_OFFSET 0x0004
98#define OMAP3430_PRM_REVISION OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0004)
99#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014
100#define OMAP3430_PRM_SYSCONFIG OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0014)
101
102#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018
103#define OMAP3430_PRM_IRQSTATUS_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0018)
104#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c
105#define OMAP3430_PRM_IRQENABLE_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x001c)
106
107
108#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020
109#define OMAP3430_PRM_VC_SMPS_SA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
110#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024
111#define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
112#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028
113#define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
114#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c
115#define OMAP3430_PRM_VC_CMD_VAL_0 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
116#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030
117#define OMAP3430_PRM_VC_CMD_VAL_1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
118#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034
119#define OMAP3430_PRM_VC_CH_CONF OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
120#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038
121#define OMAP3430_PRM_VC_I2C_CFG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
122#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c
123#define OMAP3430_PRM_VC_BYPASS_VAL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
124#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050
125#define OMAP3430_PRM_RSTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
126#define OMAP3_PRM_RSTTIME_OFFSET 0x0054
127#define OMAP3430_PRM_RSTTIME OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
128#define OMAP3_PRM_RSTST_OFFSET 0x0058
129#define OMAP3430_PRM_RSTST OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
130#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060
131#define OMAP3430_PRM_VOLTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
132#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064
133#define OMAP3430_PRM_SRAM_PCHARGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
134#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070
135#define OMAP3430_PRM_CLKSRC_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
136#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090
137#define OMAP3430_PRM_VOLTSETUP1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
138#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094
139#define OMAP3430_PRM_VOLTOFFSET OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
140#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098
141#define OMAP3430_PRM_CLKSETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
142#define OMAP3_PRM_POLCTRL_OFFSET 0x009c
143#define OMAP3430_PRM_POLCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
144#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0
145#define OMAP3430_PRM_VOLTSETUP2 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
146#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0
147#define OMAP3430_PRM_VP1_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
148#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4
149#define OMAP3430_PRM_VP1_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
150#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8
151#define OMAP3430_PRM_VP1_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
152#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc
153#define OMAP3430_PRM_VP1_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
154#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0
155#define OMAP3430_PRM_VP1_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
156#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4
157#define OMAP3430_PRM_VP1_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
158#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0
159#define OMAP3430_PRM_VP2_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
160#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4
161#define OMAP3430_PRM_VP2_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
162#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8
163#define OMAP3430_PRM_VP2_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
164#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc
165#define OMAP3430_PRM_VP2_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
166#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0
167#define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
168#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4
169#define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
170
171#define OMAP3_PRM_CLKSEL_OFFSET 0x0040
172#define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
173#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070
174#define OMAP3430_PRM_CLKOUT_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
175
176/* 22/*
177 * Module specific PRM register offsets from PRM_BASE + domain offset 23 * Module specific PRM register offsets from PRM_BASE + domain offset
178 * 24 *
@@ -200,66 +46,83 @@
200#define PM_EVGENONTIM 0x00d8 46#define PM_EVGENONTIM 0x00d8
201#define PM_EVGENOFFTIM 0x00dc 47#define PM_EVGENOFFTIM 0x00dc
202 48
203/* OMAP2xxx specific register offsets */
204#define OMAP24XX_PM_WKEN2 0x00a4
205#define OMAP24XX_PM_WKST2 0x00b4
206
207#define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
208#define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
209#define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8
210#define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc
211 49
212/* OMAP3 specific register offsets */ 50#ifndef __ASSEMBLER__
213#define OMAP3430ES2_PM_WKEN3 0x00f0
214#define OMAP3430ES2_PM_WKST3 0x00b8
215
216#define OMAP3430_PM_MPUGRPSEL 0x00a4
217#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
218#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8
219
220#define OMAP3430_PM_IVAGRPSEL 0x00a8
221#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL
222#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4
223
224#define OMAP3430_PM_PREPWSTST 0x00e8
225
226#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8
227#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
228 51
52#include <linux/io.h>
53#include "powerdomain.h"
229 54
230#ifndef __ASSEMBLER__
231/* Power/reset management domain register get/set */ 55/* Power/reset management domain register get/set */
232extern u32 omap2_prm_read_mod_reg(s16 module, u16 idx); 56static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
233extern void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx); 57{
234extern u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx); 58 return __raw_readl(prm_base + module + idx);
235extern u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx); 59}
236extern u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx); 60
237extern u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask); 61static inline void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx)
62{
63 __raw_writel(val, prm_base + module + idx);
64}
65
66/* Read-modify-write a register in a PRM module. Caller must lock */
67static inline u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module,
68 s16 idx)
69{
70 u32 v;
71
72 v = omap2_prm_read_mod_reg(module, idx);
73 v &= ~mask;
74 v |= bits;
75 omap2_prm_write_mod_reg(v, module, idx);
76
77 return v;
78}
79
80/* Read a PRM register, AND it, and shift the result down to bit 0 */
81static inline u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
82{
83 u32 v;
84
85 v = omap2_prm_read_mod_reg(domain, idx);
86 v &= mask;
87 v >>= __ffs(mask);
88
89 return v;
90}
91
92static inline u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
93{
94 return omap2_prm_rmw_mod_reg_bits(bits, bits, module, idx);
95}
96
97static inline u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
98{
99 return omap2_prm_rmw_mod_reg_bits(bits, 0x0, module, idx);
100}
238 101
239/* These omap2_ PRM functions apply to both OMAP2 and 3 */ 102/* These omap2_ PRM functions apply to both OMAP2 and 3 */
240extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift); 103extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
241extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); 104extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
242extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift); 105extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift);
243 106
244/* OMAP3-specific VP functions */ 107extern int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst);
245u32 omap3_prm_vp_check_txdone(u8 vp_id); 108extern int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm);
246void omap3_prm_vp_clear_txdone(u8 vp_id); 109extern int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm);
247 110extern int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
248/* 111 u8 pwrst);
249 * OMAP3 access functions for voltage controller (VC) and 112extern int omap2_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
250 * voltage proccessor (VP) in the PRM. 113 u8 pwrst);
251 */ 114extern int omap2_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank);
252extern u32 omap3_prm_vcvp_read(u8 offset); 115extern int omap2_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank);
253extern void omap3_prm_vcvp_write(u32 val, u8 offset); 116extern int omap2_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst);
254extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); 117extern int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm);
255 118
256extern void omap3xxx_prm_reconfigure_io_chain(void); 119extern int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1,
257 120 struct clockdomain *clkdm2);
258/* PRM interrupt-related functions */ 121extern int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1,
259extern void omap3xxx_prm_read_pending_irqs(unsigned long *events); 122 struct clockdomain *clkdm2);
260extern void omap3xxx_prm_ocp_barrier(void); 123extern int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1,
261extern void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask); 124 struct clockdomain *clkdm2);
262extern void omap3xxx_prm_restore_irqen(u32 *saved_mask); 125extern int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm);
263 126
264#endif /* __ASSEMBLER */ 127#endif /* __ASSEMBLER */
265 128
@@ -348,7 +211,9 @@ extern void omap3xxx_prm_restore_irqen(u32 *saved_mask);
348 * 211 *
349 * 3430: RM_RSTST_CORE, RM_RSTST_EMU 212 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
350 */ 213 */
214#define OMAP_GLOBALWARM_RST_SHIFT 1
351#define OMAP_GLOBALWARM_RST_MASK (1 << 1) 215#define OMAP_GLOBALWARM_RST_MASK (1 << 1)
216#define OMAP_GLOBALCOLD_RST_SHIFT 0
352#define OMAP_GLOBALCOLD_RST_MASK (1 << 0) 217#define OMAP_GLOBALCOLD_RST_MASK (1 << 0)
353 218
354/* 219/*
@@ -376,11 +241,4 @@ extern void omap3xxx_prm_restore_irqen(u32 *saved_mask);
376#define OMAP_LOGICRETSTATE_MASK (1 << 2) 241#define OMAP_LOGICRETSTATE_MASK (1 << 2)
377 242
378 243
379/*
380 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
381 * submodule to exit hardreset
382 */
383#define MAX_MODULE_HARDRESET_WAIT 10000
384
385
386#endif 244#endif
diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c
index e7dbb6cf1255..1ac73883f891 100644
--- a/arch/arm/mach-omap2/prm33xx.c
+++ b/arch/arm/mach-omap2/prm33xx.c
@@ -19,9 +19,8 @@
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <plat/common.h>
23
24#include "common.h" 22#include "common.h"
23#include "powerdomain.h"
25#include "prm33xx.h" 24#include "prm33xx.h"
26#include "prm-regbits-33xx.h" 25#include "prm-regbits-33xx.h"
27 26
@@ -133,3 +132,204 @@ int am33xx_prm_deassert_hardreset(u8 shift, s16 inst,
133 132
134 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; 133 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
135} 134}
135
136static int am33xx_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
137{
138 am33xx_prm_rmw_reg_bits(OMAP_POWERSTATE_MASK,
139 (pwrst << OMAP_POWERSTATE_SHIFT),
140 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
141 return 0;
142}
143
144static int am33xx_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
145{
146 u32 v;
147
148 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
149 v &= OMAP_POWERSTATE_MASK;
150 v >>= OMAP_POWERSTATE_SHIFT;
151
152 return v;
153}
154
155static int am33xx_pwrdm_read_pwrst(struct powerdomain *pwrdm)
156{
157 u32 v;
158
159 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
160 v &= OMAP_POWERSTATEST_MASK;
161 v >>= OMAP_POWERSTATEST_SHIFT;
162
163 return v;
164}
165
166static int am33xx_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
167{
168 u32 v;
169
170 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
171 v &= AM33XX_LASTPOWERSTATEENTERED_MASK;
172 v >>= AM33XX_LASTPOWERSTATEENTERED_SHIFT;
173
174 return v;
175}
176
177static int am33xx_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
178{
179 am33xx_prm_rmw_reg_bits(AM33XX_LOWPOWERSTATECHANGE_MASK,
180 (1 << AM33XX_LOWPOWERSTATECHANGE_SHIFT),
181 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
182 return 0;
183}
184
185static int am33xx_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
186{
187 am33xx_prm_rmw_reg_bits(AM33XX_LASTPOWERSTATEENTERED_MASK,
188 AM33XX_LASTPOWERSTATEENTERED_MASK,
189 pwrdm->prcm_offs, pwrdm->pwrstst_offs);
190 return 0;
191}
192
193static int am33xx_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
194{
195 u32 m;
196
197 m = pwrdm->logicretstate_mask;
198 if (!m)
199 return -EINVAL;
200
201 am33xx_prm_rmw_reg_bits(m, (pwrst << __ffs(m)),
202 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
203
204 return 0;
205}
206
207static int am33xx_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
208{
209 u32 v;
210
211 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
212 v &= AM33XX_LOGICSTATEST_MASK;
213 v >>= AM33XX_LOGICSTATEST_SHIFT;
214
215 return v;
216}
217
218static int am33xx_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
219{
220 u32 v, m;
221
222 m = pwrdm->logicretstate_mask;
223 if (!m)
224 return -EINVAL;
225
226 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
227 v &= m;
228 v >>= __ffs(m);
229
230 return v;
231}
232
233static int am33xx_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
234 u8 pwrst)
235{
236 u32 m;
237
238 m = pwrdm->mem_on_mask[bank];
239 if (!m)
240 return -EINVAL;
241
242 am33xx_prm_rmw_reg_bits(m, (pwrst << __ffs(m)),
243 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
244
245 return 0;
246}
247
248static int am33xx_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
249 u8 pwrst)
250{
251 u32 m;
252
253 m = pwrdm->mem_ret_mask[bank];
254 if (!m)
255 return -EINVAL;
256
257 am33xx_prm_rmw_reg_bits(m, (pwrst << __ffs(m)),
258 pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
259
260 return 0;
261}
262
263static int am33xx_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
264{
265 u32 m, v;
266
267 m = pwrdm->mem_pwrst_mask[bank];
268 if (!m)
269 return -EINVAL;
270
271 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
272 v &= m;
273 v >>= __ffs(m);
274
275 return v;
276}
277
278static int am33xx_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
279{
280 u32 m, v;
281
282 m = pwrdm->mem_retst_mask[bank];
283 if (!m)
284 return -EINVAL;
285
286 v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstctrl_offs);
287 v &= m;
288 v >>= __ffs(m);
289
290 return v;
291}
292
293static int am33xx_pwrdm_wait_transition(struct powerdomain *pwrdm)
294{
295 u32 c = 0;
296
297 /*
298 * REVISIT: pwrdm_wait_transition() may be better implemented
299 * via a callback and a periodic timer check -- how long do we expect
300 * powerdomain transitions to take?
301 */
302
303 /* XXX Is this udelay() value meaningful? */
304 while ((am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs)
305 & OMAP_INTRANSITION_MASK) &&
306 (c++ < PWRDM_TRANSITION_BAILOUT))
307 udelay(1);
308
309 if (c > PWRDM_TRANSITION_BAILOUT) {
310 pr_err("powerdomain: %s: waited too long to complete transition\n",
311 pwrdm->name);
312 return -EAGAIN;
313 }
314
315 pr_debug("powerdomain: completed transition in %d loops\n", c);
316
317 return 0;
318}
319
320struct pwrdm_ops am33xx_pwrdm_operations = {
321 .pwrdm_set_next_pwrst = am33xx_pwrdm_set_next_pwrst,
322 .pwrdm_read_next_pwrst = am33xx_pwrdm_read_next_pwrst,
323 .pwrdm_read_pwrst = am33xx_pwrdm_read_pwrst,
324 .pwrdm_read_prev_pwrst = am33xx_pwrdm_read_prev_pwrst,
325 .pwrdm_set_logic_retst = am33xx_pwrdm_set_logic_retst,
326 .pwrdm_read_logic_pwrst = am33xx_pwrdm_read_logic_pwrst,
327 .pwrdm_read_logic_retst = am33xx_pwrdm_read_logic_retst,
328 .pwrdm_clear_all_prev_pwrst = am33xx_pwrdm_clear_all_prev_pwrst,
329 .pwrdm_set_lowpwrstchange = am33xx_pwrdm_set_lowpwrstchange,
330 .pwrdm_read_mem_pwrst = am33xx_pwrdm_read_mem_pwrst,
331 .pwrdm_read_mem_retst = am33xx_pwrdm_read_mem_retst,
332 .pwrdm_set_mem_onst = am33xx_pwrdm_set_mem_onst,
333 .pwrdm_set_mem_retst = am33xx_pwrdm_set_mem_retst,
334 .pwrdm_wait_transition = am33xx_pwrdm_wait_transition,
335};
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
new file mode 100644
index 000000000000..b86116cf0db9
--- /dev/null
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -0,0 +1,417 @@
1/*
2 * OMAP3xxx PRM module functions
3 *
4 * Copyright (C) 2010-2012 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation
6 * Benoît Cousson
7 * Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/errno.h>
17#include <linux/err.h>
18#include <linux/io.h>
19#include <linux/irq.h>
20
21#include "common.h"
22#include <plat/cpu.h>
23
24#include "vp.h"
25#include "powerdomain.h"
26#include "prm3xxx.h"
27#include "prm2xxx_3xxx.h"
28#include "cm2xxx_3xxx.h"
29#include "prm-regbits-34xx.h"
30
31static const struct omap_prcm_irq omap3_prcm_irqs[] = {
32 OMAP_PRCM_IRQ("wkup", 0, 0),
33 OMAP_PRCM_IRQ("io", 9, 1),
34};
35
36static struct omap_prcm_irq_setup omap3_prcm_irq_setup = {
37 .ack = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
38 .mask = OMAP3_PRM_IRQENABLE_MPU_OFFSET,
39 .nr_regs = 1,
40 .irqs = omap3_prcm_irqs,
41 .nr_irqs = ARRAY_SIZE(omap3_prcm_irqs),
42 .irq = 11 + OMAP_INTC_START,
43 .read_pending_irqs = &omap3xxx_prm_read_pending_irqs,
44 .ocp_barrier = &omap3xxx_prm_ocp_barrier,
45 .save_and_clear_irqen = &omap3xxx_prm_save_and_clear_irqen,
46 .restore_irqen = &omap3xxx_prm_restore_irqen,
47};
48
49/*
50 * omap3_prm_reset_src_map - map from bits in the PRM_RSTST hardware
51 * register (which are specific to OMAP3xxx SoCs) to reset source ID
52 * bit shifts (which is an OMAP SoC-independent enumeration)
53 */
54static struct prm_reset_src_map omap3xxx_prm_reset_src_map[] = {
55 { OMAP3430_GLOBAL_COLD_RST_SHIFT, OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT },
56 { OMAP3430_GLOBAL_SW_RST_SHIFT, OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT },
57 { OMAP3430_SECURITY_VIOL_RST_SHIFT, OMAP_SECU_VIOL_RST_SRC_ID_SHIFT },
58 { OMAP3430_MPU_WD_RST_SHIFT, OMAP_MPU_WD_RST_SRC_ID_SHIFT },
59 { OMAP3430_SECURE_WD_RST_SHIFT, OMAP_MPU_WD_RST_SRC_ID_SHIFT },
60 { OMAP3430_EXTERNAL_WARM_RST_SHIFT, OMAP_EXTWARM_RST_SRC_ID_SHIFT },
61 { OMAP3430_VDD1_VOLTAGE_MANAGER_RST_SHIFT,
62 OMAP_VDD_MPU_VM_RST_SRC_ID_SHIFT },
63 { OMAP3430_VDD2_VOLTAGE_MANAGER_RST_SHIFT,
64 OMAP_VDD_CORE_VM_RST_SRC_ID_SHIFT },
65 { OMAP3430_ICEPICK_RST_SHIFT, OMAP_ICEPICK_RST_SRC_ID_SHIFT },
66 { OMAP3430_ICECRUSHER_RST_SHIFT, OMAP_ICECRUSHER_RST_SRC_ID_SHIFT },
67 { -1, -1 },
68};
69
70/* PRM VP */
71
72/*
73 * struct omap3_vp - OMAP3 VP register access description.
74 * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg
75 */
76struct omap3_vp {
77 u32 tranxdone_status;
78};
79
80static struct omap3_vp omap3_vp[] = {
81 [OMAP3_VP_VDD_MPU_ID] = {
82 .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK,
83 },
84 [OMAP3_VP_VDD_CORE_ID] = {
85 .tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK,
86 },
87};
88
89#define MAX_VP_ID ARRAY_SIZE(omap3_vp);
90
91u32 omap3_prm_vp_check_txdone(u8 vp_id)
92{
93 struct omap3_vp *vp = &omap3_vp[vp_id];
94 u32 irqstatus;
95
96 irqstatus = omap2_prm_read_mod_reg(OCP_MOD,
97 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
98 return irqstatus & vp->tranxdone_status;
99}
100
101void omap3_prm_vp_clear_txdone(u8 vp_id)
102{
103 struct omap3_vp *vp = &omap3_vp[vp_id];
104
105 omap2_prm_write_mod_reg(vp->tranxdone_status,
106 OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
107}
108
109u32 omap3_prm_vcvp_read(u8 offset)
110{
111 return omap2_prm_read_mod_reg(OMAP3430_GR_MOD, offset);
112}
113
114void omap3_prm_vcvp_write(u32 val, u8 offset)
115{
116 omap2_prm_write_mod_reg(val, OMAP3430_GR_MOD, offset);
117}
118
119u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
120{
121 return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset);
122}
123
124/**
125 * omap3xxx_prm_dpll3_reset - use DPLL3 reset to reboot the OMAP SoC
126 *
127 * Set the DPLL3 reset bit, which should reboot the SoC. This is the
128 * recommended way to restart the SoC, considering Errata i520. No
129 * return value.
130 */
131void omap3xxx_prm_dpll3_reset(void)
132{
133 omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, OMAP3430_GR_MOD,
134 OMAP2_RM_RSTCTRL);
135 /* OCP barrier */
136 omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP2_RM_RSTCTRL);
137}
138
139/**
140 * omap3xxx_prm_read_pending_irqs - read pending PRM MPU IRQs into @events
141 * @events: ptr to a u32, preallocated by caller
142 *
143 * Read PRM_IRQSTATUS_MPU bits, AND'ed with the currently-enabled PRM
144 * MPU IRQs, and store the result into the u32 pointed to by @events.
145 * No return value.
146 */
147void omap3xxx_prm_read_pending_irqs(unsigned long *events)
148{
149 u32 mask, st;
150
151 /* XXX Can the mask read be avoided (e.g., can it come from RAM?) */
152 mask = omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
153 st = omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
154
155 events[0] = mask & st;
156}
157
158/**
159 * omap3xxx_prm_ocp_barrier - force buffered MPU writes to the PRM to complete
160 *
161 * Force any buffered writes to the PRM IP block to complete. Needed
162 * by the PRM IRQ handler, which reads and writes directly to the IP
163 * block, to avoid race conditions after acknowledging or clearing IRQ
164 * bits. No return value.
165 */
166void omap3xxx_prm_ocp_barrier(void)
167{
168 omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_REVISION_OFFSET);
169}
170
171/**
172 * omap3xxx_prm_save_and_clear_irqen - save/clear PRM_IRQENABLE_MPU reg
173 * @saved_mask: ptr to a u32 array to save IRQENABLE bits
174 *
175 * Save the PRM_IRQENABLE_MPU register to @saved_mask. @saved_mask
176 * must be allocated by the caller. Intended to be used in the PRM
177 * interrupt handler suspend callback. The OCP barrier is needed to
178 * ensure the write to disable PRM interrupts reaches the PRM before
179 * returning; otherwise, spurious interrupts might occur. No return
180 * value.
181 */
182void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask)
183{
184 saved_mask[0] = omap2_prm_read_mod_reg(OCP_MOD,
185 OMAP3_PRM_IRQENABLE_MPU_OFFSET);
186 omap2_prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
187
188 /* OCP barrier */
189 omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_REVISION_OFFSET);
190}
191
192/**
193 * omap3xxx_prm_restore_irqen - set PRM_IRQENABLE_MPU register from args
194 * @saved_mask: ptr to a u32 array of IRQENABLE bits saved previously
195 *
196 * Restore the PRM_IRQENABLE_MPU register from @saved_mask. Intended
197 * to be used in the PRM interrupt handler resume callback to restore
198 * values saved by omap3xxx_prm_save_and_clear_irqen(). No OCP
199 * barrier should be needed here; any pending PRM interrupts will fire
200 * once the writes reach the PRM. No return value.
201 */
202void omap3xxx_prm_restore_irqen(u32 *saved_mask)
203{
204 omap2_prm_write_mod_reg(saved_mask[0], OCP_MOD,
205 OMAP3_PRM_IRQENABLE_MPU_OFFSET);
206}
207
208/**
209 * omap3xxx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
210 *
211 * Clear any previously-latched I/O wakeup events and ensure that the
212 * I/O wakeup gates are aligned with the current mux settings. Works
213 * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then
214 * deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No
215 * return value.
216 */
217void omap3xxx_prm_reconfigure_io_chain(void)
218{
219 int i = 0;
220
221 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD,
222 PM_WKEN);
223
224 omap_test_timeout(omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST) &
225 OMAP3430_ST_IO_CHAIN_MASK,
226 MAX_IOPAD_LATCH_TIME, i);
227 if (i == MAX_IOPAD_LATCH_TIME)
228 pr_warn("PRM: I/O chain clock line assertion timed out\n");
229
230 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD,
231 PM_WKEN);
232
233 omap2_prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK, WKUP_MOD,
234 PM_WKST);
235
236 omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST);
237}
238
239/**
240 * omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches
241 *
242 * Activates the I/O wakeup event latches and allows events logged by
243 * those latches to signal a wakeup event to the PRCM. For I/O
244 * wakeups to occur, WAKEUPENABLE bits must be set in the pad mux
245 * registers, and omap3xxx_prm_reconfigure_io_chain() must be called.
246 * No return value.
247 */
248static void __init omap3xxx_prm_enable_io_wakeup(void)
249{
250 if (omap3_has_io_wakeup())
251 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
252 PM_WKEN);
253}
254
255/**
256 * omap3xxx_prm_read_reset_sources - return the last SoC reset source
257 *
258 * Return a u32 representing the last reset sources of the SoC. The
259 * returned reset source bits are standardized across OMAP SoCs.
260 */
261static u32 omap3xxx_prm_read_reset_sources(void)
262{
263 struct prm_reset_src_map *p;
264 u32 r = 0;
265 u32 v;
266
267 v = omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST);
268
269 p = omap3xxx_prm_reset_src_map;
270 while (p->reg_shift >= 0 && p->std_shift >= 0) {
271 if (v & (1 << p->reg_shift))
272 r |= 1 << p->std_shift;
273 p++;
274 }
275
276 return r;
277}
278
279/* Powerdomain low-level functions */
280
281/* Applicable only for OMAP3. Not supported on OMAP2 */
282static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
283{
284 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
285 OMAP3430_PM_PREPWSTST,
286 OMAP3430_LASTPOWERSTATEENTERED_MASK);
287}
288
289static int omap3_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
290{
291 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
292 OMAP2_PM_PWSTST,
293 OMAP3430_LOGICSTATEST_MASK);
294}
295
296static int omap3_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
297{
298 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
299 OMAP2_PM_PWSTCTRL,
300 OMAP3430_LOGICSTATEST_MASK);
301}
302
303static int omap3_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
304{
305 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
306 OMAP3430_PM_PREPWSTST,
307 OMAP3430_LASTLOGICSTATEENTERED_MASK);
308}
309
310static int omap3_get_mem_bank_lastmemst_mask(u8 bank)
311{
312 switch (bank) {
313 case 0:
314 return OMAP3430_LASTMEM1STATEENTERED_MASK;
315 case 1:
316 return OMAP3430_LASTMEM2STATEENTERED_MASK;
317 case 2:
318 return OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_MASK;
319 case 3:
320 return OMAP3430_LASTL2FLATMEMSTATEENTERED_MASK;
321 default:
322 WARN_ON(1); /* should never happen */
323 return -EEXIST;
324 }
325 return 0;
326}
327
328static int omap3_pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
329{
330 u32 m;
331
332 m = omap3_get_mem_bank_lastmemst_mask(bank);
333
334 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
335 OMAP3430_PM_PREPWSTST, m);
336}
337
338static int omap3_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
339{
340 omap2_prm_write_mod_reg(0, pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST);
341 return 0;
342}
343
344static int omap3_pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
345{
346 return omap2_prm_rmw_mod_reg_bits(0,
347 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
348 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
349}
350
351static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
352{
353 return omap2_prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
354 0, pwrdm->prcm_offs,
355 OMAP2_PM_PWSTCTRL);
356}
357
358struct pwrdm_ops omap3_pwrdm_operations = {
359 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst,
360 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst,
361 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst,
362 .pwrdm_read_prev_pwrst = omap3_pwrdm_read_prev_pwrst,
363 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
364 .pwrdm_read_logic_pwrst = omap3_pwrdm_read_logic_pwrst,
365 .pwrdm_read_logic_retst = omap3_pwrdm_read_logic_retst,
366 .pwrdm_read_prev_logic_pwrst = omap3_pwrdm_read_prev_logic_pwrst,
367 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
368 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
369 .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst,
370 .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst,
371 .pwrdm_read_prev_mem_pwrst = omap3_pwrdm_read_prev_mem_pwrst,
372 .pwrdm_clear_all_prev_pwrst = omap3_pwrdm_clear_all_prev_pwrst,
373 .pwrdm_enable_hdwr_sar = omap3_pwrdm_enable_hdwr_sar,
374 .pwrdm_disable_hdwr_sar = omap3_pwrdm_disable_hdwr_sar,
375 .pwrdm_wait_transition = omap2_pwrdm_wait_transition,
376};
377
378/*
379 *
380 */
381
382static struct prm_ll_data omap3xxx_prm_ll_data = {
383 .read_reset_sources = &omap3xxx_prm_read_reset_sources,
384};
385
386static int __init omap3xxx_prm_init(void)
387{
388 int ret;
389
390 if (!cpu_is_omap34xx())
391 return 0;
392
393 ret = prm_register(&omap3xxx_prm_ll_data);
394 if (ret)
395 return ret;
396
397 omap3xxx_prm_enable_io_wakeup();
398 ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
399 if (!ret)
400 irq_set_status_flags(omap_prcm_event_to_irq("io"),
401 IRQ_NOAUTOEN);
402
403
404 return ret;
405}
406subsys_initcall(omap3xxx_prm_init);
407
408static void __exit omap3xxx_prm_exit(void)
409{
410 if (!cpu_is_omap34xx())
411 return;
412
413 /* Should never happen */
414 WARN(prm_unregister(&omap3xxx_prm_ll_data),
415 "%s: prm_ll_data function pointer mismatch\n", __func__);
416}
417__exitcall(omap3xxx_prm_exit);
diff --git a/arch/arm/mach-omap2/prm3xxx.h b/arch/arm/mach-omap2/prm3xxx.h
new file mode 100644
index 000000000000..10cd41a8129e
--- /dev/null
+++ b/arch/arm/mach-omap2/prm3xxx.h
@@ -0,0 +1,162 @@
1/*
2 * OMAP3xxx Power/Reset Management (PRM) register definitions
3 *
4 * Copyright (C) 2007-2009, 2011-2012 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Paul Walmsley
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 * The PRM hardware modules on the OMAP2/3 are quite similar to each
13 * other. The PRM on OMAP4 has a new register layout, and is handled
14 * in a separate file.
15 */
16#ifndef __ARCH_ARM_MACH_OMAP2_PRM3XXX_H
17#define __ARCH_ARM_MACH_OMAP2_PRM3XXX_H
18
19#include "prcm-common.h"
20#include "prm.h"
21#include "prm2xxx_3xxx.h"
22
23#define OMAP34XX_PRM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
25
26
27/*
28 * OMAP3-specific global PRM registers
29 * Use __raw_{read,write}l() with these registers.
30 *
31 * With a few exceptions, these are the register names beginning with
32 * PRM_* on 34xx. (The exceptions are the IRQSTATUS and IRQENABLE
33 * bits.)
34 */
35
36#define OMAP3_PRM_REVISION_OFFSET 0x0004
37#define OMAP3430_PRM_REVISION OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0004)
38#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014
39#define OMAP3430_PRM_SYSCONFIG OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0014)
40
41#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018
42#define OMAP3430_PRM_IRQSTATUS_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0018)
43#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c
44#define OMAP3430_PRM_IRQENABLE_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x001c)
45
46
47#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020
48#define OMAP3430_PRM_VC_SMPS_SA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
49#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024
50#define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
51#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028
52#define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
53#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c
54#define OMAP3430_PRM_VC_CMD_VAL_0 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
55#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030
56#define OMAP3430_PRM_VC_CMD_VAL_1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
57#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034
58#define OMAP3430_PRM_VC_CH_CONF OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
59#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038
60#define OMAP3430_PRM_VC_I2C_CFG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
61#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c
62#define OMAP3430_PRM_VC_BYPASS_VAL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
63#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050
64#define OMAP3430_PRM_RSTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
65#define OMAP3_PRM_RSTTIME_OFFSET 0x0054
66#define OMAP3430_PRM_RSTTIME OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
67#define OMAP3_PRM_RSTST_OFFSET 0x0058
68#define OMAP3430_PRM_RSTST OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
69#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060
70#define OMAP3430_PRM_VOLTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
71#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064
72#define OMAP3430_PRM_SRAM_PCHARGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
73#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070
74#define OMAP3430_PRM_CLKSRC_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
75#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090
76#define OMAP3430_PRM_VOLTSETUP1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
77#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094
78#define OMAP3430_PRM_VOLTOFFSET OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
79#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098
80#define OMAP3430_PRM_CLKSETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
81#define OMAP3_PRM_POLCTRL_OFFSET 0x009c
82#define OMAP3430_PRM_POLCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
83#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0
84#define OMAP3430_PRM_VOLTSETUP2 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
85#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0
86#define OMAP3430_PRM_VP1_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
87#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4
88#define OMAP3430_PRM_VP1_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
89#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8
90#define OMAP3430_PRM_VP1_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
91#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc
92#define OMAP3430_PRM_VP1_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
93#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0
94#define OMAP3430_PRM_VP1_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
95#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4
96#define OMAP3430_PRM_VP1_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
97#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0
98#define OMAP3430_PRM_VP2_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
99#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4
100#define OMAP3430_PRM_VP2_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
101#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8
102#define OMAP3430_PRM_VP2_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
103#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc
104#define OMAP3430_PRM_VP2_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
105#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0
106#define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
107#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4
108#define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
109
110#define OMAP3_PRM_CLKSEL_OFFSET 0x0040
111#define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
112#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070
113#define OMAP3430_PRM_CLKOUT_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
114
115/* OMAP3 specific register offsets */
116#define OMAP3430ES2_PM_WKEN3 0x00f0
117#define OMAP3430ES2_PM_WKST3 0x00b8
118
119#define OMAP3430_PM_MPUGRPSEL 0x00a4
120#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
121#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8
122
123#define OMAP3430_PM_IVAGRPSEL 0x00a8
124#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL
125#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4
126
127#define OMAP3430_PM_PREPWSTST 0x00e8
128
129#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8
130#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
131
132
133#ifndef __ASSEMBLER__
134
135/* OMAP3-specific VP functions */
136u32 omap3_prm_vp_check_txdone(u8 vp_id);
137void omap3_prm_vp_clear_txdone(u8 vp_id);
138
139/*
140 * OMAP3 access functions for voltage controller (VC) and
141 * voltage proccessor (VP) in the PRM.
142 */
143extern u32 omap3_prm_vcvp_read(u8 offset);
144extern void omap3_prm_vcvp_write(u32 val, u8 offset);
145extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
146
147extern void omap3xxx_prm_reconfigure_io_chain(void);
148
149/* PRM interrupt-related functions */
150extern void omap3xxx_prm_read_pending_irqs(unsigned long *events);
151extern void omap3xxx_prm_ocp_barrier(void);
152extern void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask);
153extern void omap3xxx_prm_restore_irqen(u32 *saved_mask);
154
155extern void omap3xxx_prm_dpll3_reset(void);
156
157extern u32 omap3xxx_prm_get_reset_sources(void);
158
159#endif /* __ASSEMBLER */
160
161
162#endif
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index f0c4d5f4a174..6d3467af205d 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -1,10 +1,11 @@
1/* 1/*
2 * OMAP4 PRM module functions 2 * OMAP4 PRM module functions
3 * 3 *
4 * Copyright (C) 2011 Texas Instruments, Inc. 4 * Copyright (C) 2011-2012 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
6 * Benoît Cousson 6 * Benoît Cousson
7 * Paul Walmsley 7 * Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
8 * 9 *
9 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -17,7 +18,6 @@
17#include <linux/err.h> 18#include <linux/err.h>
18#include <linux/io.h> 19#include <linux/io.h>
19 20
20#include <plat/prcm.h>
21 21
22#include "soc.h" 22#include "soc.h"
23#include "iomap.h" 23#include "iomap.h"
@@ -27,6 +27,9 @@
27#include "prm-regbits-44xx.h" 27#include "prm-regbits-44xx.h"
28#include "prcm44xx.h" 28#include "prcm44xx.h"
29#include "prminst44xx.h" 29#include "prminst44xx.h"
30#include "powerdomain.h"
31
32/* Static data */
30 33
31static const struct omap_prcm_irq omap4_prcm_irqs[] = { 34static const struct omap_prcm_irq omap4_prcm_irqs[] = {
32 OMAP_PRCM_IRQ("wkup", 0, 0), 35 OMAP_PRCM_IRQ("wkup", 0, 0),
@@ -46,6 +49,33 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
46 .restore_irqen = &omap44xx_prm_restore_irqen, 49 .restore_irqen = &omap44xx_prm_restore_irqen,
47}; 50};
48 51
52/*
53 * omap44xx_prm_reset_src_map - map from bits in the PRM_RSTST
54 * hardware register (which are specific to OMAP44xx SoCs) to reset
55 * source ID bit shifts (which is an OMAP SoC-independent
56 * enumeration)
57 */
58static struct prm_reset_src_map omap44xx_prm_reset_src_map[] = {
59 { OMAP4430_RST_GLOBAL_WARM_SW_SHIFT,
60 OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT },
61 { OMAP4430_RST_GLOBAL_COLD_SW_SHIFT,
62 OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT },
63 { OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT,
64 OMAP_SECU_VIOL_RST_SRC_ID_SHIFT },
65 { OMAP4430_MPU_WDT_RST_SHIFT, OMAP_MPU_WD_RST_SRC_ID_SHIFT },
66 { OMAP4430_SECURE_WDT_RST_SHIFT, OMAP_SECU_WD_RST_SRC_ID_SHIFT },
67 { OMAP4430_EXTERNAL_WARM_RST_SHIFT, OMAP_EXTWARM_RST_SRC_ID_SHIFT },
68 { OMAP4430_VDD_MPU_VOLT_MGR_RST_SHIFT,
69 OMAP_VDD_MPU_VM_RST_SRC_ID_SHIFT },
70 { OMAP4430_VDD_IVA_VOLT_MGR_RST_SHIFT,
71 OMAP_VDD_IVA_VM_RST_SRC_ID_SHIFT },
72 { OMAP4430_VDD_CORE_VOLT_MGR_RST_SHIFT,
73 OMAP_VDD_CORE_VM_RST_SRC_ID_SHIFT },
74 { OMAP4430_ICEPICK_RST_SHIFT, OMAP_ICEPICK_RST_SRC_ID_SHIFT },
75 { OMAP4430_C2C_RST_SHIFT, OMAP_C2C_RST_SRC_ID_SHIFT },
76 { -1, -1 },
77};
78
49/* PRM low-level functions */ 79/* PRM low-level functions */
50 80
51/* Read a register in a CM/PRM instance in the PRM module */ 81/* Read a register in a CM/PRM instance in the PRM module */
@@ -291,12 +321,324 @@ static void __init omap44xx_prm_enable_io_wakeup(void)
291 OMAP4_PRM_IO_PMCTRL_OFFSET); 321 OMAP4_PRM_IO_PMCTRL_OFFSET);
292} 322}
293 323
294static int __init omap4xxx_prcm_init(void) 324/**
325 * omap44xx_prm_read_reset_sources - return the last SoC reset source
326 *
327 * Return a u32 representing the last reset sources of the SoC. The
328 * returned reset source bits are standardized across OMAP SoCs.
329 */
330static u32 omap44xx_prm_read_reset_sources(void)
331{
332 struct prm_reset_src_map *p;
333 u32 r = 0;
334 u32 v;
335
336 v = omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST,
337 OMAP4_RM_RSTST);
338
339 p = omap44xx_prm_reset_src_map;
340 while (p->reg_shift >= 0 && p->std_shift >= 0) {
341 if (v & (1 << p->reg_shift))
342 r |= 1 << p->std_shift;
343 p++;
344 }
345
346 return r;
347}
348
349/* Powerdomain low-level functions */
350
351static int omap4_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
352{
353 omap4_prminst_rmw_inst_reg_bits(OMAP_POWERSTATE_MASK,
354 (pwrst << OMAP_POWERSTATE_SHIFT),
355 pwrdm->prcm_partition,
356 pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
357 return 0;
358}
359
360static int omap4_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
361{
362 u32 v;
363
364 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
365 OMAP4_PM_PWSTCTRL);
366 v &= OMAP_POWERSTATE_MASK;
367 v >>= OMAP_POWERSTATE_SHIFT;
368
369 return v;
370}
371
372static int omap4_pwrdm_read_pwrst(struct powerdomain *pwrdm)
373{
374 u32 v;
375
376 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
377 OMAP4_PM_PWSTST);
378 v &= OMAP_POWERSTATEST_MASK;
379 v >>= OMAP_POWERSTATEST_SHIFT;
380
381 return v;
382}
383
384static int omap4_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
385{
386 u32 v;
387
388 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
389 OMAP4_PM_PWSTST);
390 v &= OMAP4430_LASTPOWERSTATEENTERED_MASK;
391 v >>= OMAP4430_LASTPOWERSTATEENTERED_SHIFT;
392
393 return v;
394}
395
396static int omap4_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
397{
398 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LOWPOWERSTATECHANGE_MASK,
399 (1 << OMAP4430_LOWPOWERSTATECHANGE_SHIFT),
400 pwrdm->prcm_partition,
401 pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
402 return 0;
403}
404
405static int omap4_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
406{
407 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LASTPOWERSTATEENTERED_MASK,
408 OMAP4430_LASTPOWERSTATEENTERED_MASK,
409 pwrdm->prcm_partition,
410 pwrdm->prcm_offs, OMAP4_PM_PWSTST);
411 return 0;
412}
413
414static int omap4_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
415{
416 u32 v;
417
418 v = pwrst << __ffs(OMAP4430_LOGICRETSTATE_MASK);
419 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LOGICRETSTATE_MASK, v,
420 pwrdm->prcm_partition, pwrdm->prcm_offs,
421 OMAP4_PM_PWSTCTRL);
422
423 return 0;
424}
425
426static int omap4_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
427 u8 pwrst)
428{
429 u32 m;
430
431 m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
432
433 omap4_prminst_rmw_inst_reg_bits(m, (pwrst << __ffs(m)),
434 pwrdm->prcm_partition, pwrdm->prcm_offs,
435 OMAP4_PM_PWSTCTRL);
436
437 return 0;
438}
439
440static int omap4_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
441 u8 pwrst)
442{
443 u32 m;
444
445 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
446
447 omap4_prminst_rmw_inst_reg_bits(m, (pwrst << __ffs(m)),
448 pwrdm->prcm_partition, pwrdm->prcm_offs,
449 OMAP4_PM_PWSTCTRL);
450
451 return 0;
452}
453
454static int omap4_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
455{
456 u32 v;
457
458 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
459 OMAP4_PM_PWSTST);
460 v &= OMAP4430_LOGICSTATEST_MASK;
461 v >>= OMAP4430_LOGICSTATEST_SHIFT;
462
463 return v;
464}
465
466static int omap4_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
295{ 467{
296 if (cpu_is_omap44xx()) { 468 u32 v;
297 omap44xx_prm_enable_io_wakeup(); 469
298 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); 470 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
471 OMAP4_PM_PWSTCTRL);
472 v &= OMAP4430_LOGICRETSTATE_MASK;
473 v >>= OMAP4430_LOGICRETSTATE_SHIFT;
474
475 return v;
476}
477
478/**
479 * omap4_pwrdm_read_prev_logic_pwrst - read the previous logic powerstate
480 * @pwrdm: struct powerdomain * to read the state for
481 *
482 * Reads the previous logic powerstate for a powerdomain. This
483 * function must determine the previous logic powerstate by first
484 * checking the previous powerstate for the domain. If that was OFF,
485 * then logic has been lost. If previous state was RETENTION, the
486 * function reads the setting for the next retention logic state to
487 * see the actual value. In every other case, the logic is
488 * retained. Returns either PWRDM_POWER_OFF or PWRDM_POWER_RET
489 * depending whether the logic was retained or not.
490 */
491static int omap4_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
492{
493 int state;
494
495 state = omap4_pwrdm_read_prev_pwrst(pwrdm);
496
497 if (state == PWRDM_POWER_OFF)
498 return PWRDM_POWER_OFF;
499
500 if (state != PWRDM_POWER_RET)
501 return PWRDM_POWER_RET;
502
503 return omap4_pwrdm_read_logic_retst(pwrdm);
504}
505
506static int omap4_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
507{
508 u32 m, v;
509
510 m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
511
512 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
513 OMAP4_PM_PWSTST);
514 v &= m;
515 v >>= __ffs(m);
516
517 return v;
518}
519
520static int omap4_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
521{
522 u32 m, v;
523
524 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
525
526 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
527 OMAP4_PM_PWSTCTRL);
528 v &= m;
529 v >>= __ffs(m);
530
531 return v;
532}
533
534/**
535 * omap4_pwrdm_read_prev_mem_pwrst - reads the previous memory powerstate
536 * @pwrdm: struct powerdomain * to read mem powerstate for
537 * @bank: memory bank index
538 *
539 * Reads the previous memory powerstate for a powerdomain. This
540 * function must determine the previous memory powerstate by first
541 * checking the previous powerstate for the domain. If that was OFF,
542 * then logic has been lost. If previous state was RETENTION, the
543 * function reads the setting for the next memory retention state to
544 * see the actual value. In every other case, the logic is
545 * retained. Returns either PWRDM_POWER_OFF or PWRDM_POWER_RET
546 * depending whether logic was retained or not.
547 */
548static int omap4_pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
549{
550 int state;
551
552 state = omap4_pwrdm_read_prev_pwrst(pwrdm);
553
554 if (state == PWRDM_POWER_OFF)
555 return PWRDM_POWER_OFF;
556
557 if (state != PWRDM_POWER_RET)
558 return PWRDM_POWER_RET;
559
560 return omap4_pwrdm_read_mem_retst(pwrdm, bank);
561}
562
563static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm)
564{
565 u32 c = 0;
566
567 /*
568 * REVISIT: pwrdm_wait_transition() may be better implemented
569 * via a callback and a periodic timer check -- how long do we expect
570 * powerdomain transitions to take?
571 */
572
573 /* XXX Is this udelay() value meaningful? */
574 while ((omap4_prminst_read_inst_reg(pwrdm->prcm_partition,
575 pwrdm->prcm_offs,
576 OMAP4_PM_PWSTST) &
577 OMAP_INTRANSITION_MASK) &&
578 (c++ < PWRDM_TRANSITION_BAILOUT))
579 udelay(1);
580
581 if (c > PWRDM_TRANSITION_BAILOUT) {
582 pr_err("powerdomain: %s: waited too long to complete transition\n",
583 pwrdm->name);
584 return -EAGAIN;
299 } 585 }
586
587 pr_debug("powerdomain: completed transition in %d loops\n", c);
588
300 return 0; 589 return 0;
301} 590}
302subsys_initcall(omap4xxx_prcm_init); 591
592struct pwrdm_ops omap4_pwrdm_operations = {
593 .pwrdm_set_next_pwrst = omap4_pwrdm_set_next_pwrst,
594 .pwrdm_read_next_pwrst = omap4_pwrdm_read_next_pwrst,
595 .pwrdm_read_pwrst = omap4_pwrdm_read_pwrst,
596 .pwrdm_read_prev_pwrst = omap4_pwrdm_read_prev_pwrst,
597 .pwrdm_set_lowpwrstchange = omap4_pwrdm_set_lowpwrstchange,
598 .pwrdm_clear_all_prev_pwrst = omap4_pwrdm_clear_all_prev_pwrst,
599 .pwrdm_set_logic_retst = omap4_pwrdm_set_logic_retst,
600 .pwrdm_read_logic_pwrst = omap4_pwrdm_read_logic_pwrst,
601 .pwrdm_read_prev_logic_pwrst = omap4_pwrdm_read_prev_logic_pwrst,
602 .pwrdm_read_logic_retst = omap4_pwrdm_read_logic_retst,
603 .pwrdm_read_mem_pwrst = omap4_pwrdm_read_mem_pwrst,
604 .pwrdm_read_mem_retst = omap4_pwrdm_read_mem_retst,
605 .pwrdm_read_prev_mem_pwrst = omap4_pwrdm_read_prev_mem_pwrst,
606 .pwrdm_set_mem_onst = omap4_pwrdm_set_mem_onst,
607 .pwrdm_set_mem_retst = omap4_pwrdm_set_mem_retst,
608 .pwrdm_wait_transition = omap4_pwrdm_wait_transition,
609};
610
611/*
612 * XXX document
613 */
614static struct prm_ll_data omap44xx_prm_ll_data = {
615 .read_reset_sources = &omap44xx_prm_read_reset_sources,
616};
617
618static int __init omap44xx_prm_init(void)
619{
620 int ret;
621
622 if (!cpu_is_omap44xx())
623 return 0;
624
625 ret = prm_register(&omap44xx_prm_ll_data);
626 if (ret)
627 return ret;
628
629 omap44xx_prm_enable_io_wakeup();
630
631 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
632}
633subsys_initcall(omap44xx_prm_init);
634
635static void __exit omap44xx_prm_exit(void)
636{
637 if (!cpu_is_omap44xx())
638 return;
639
640 /* Should never happen */
641 WARN(prm_unregister(&omap44xx_prm_ll_data),
642 "%s: prm_ll_data function pointer mismatch\n", __func__);
643}
644__exitcall(omap44xx_prm_exit);
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h
index ee72ae6bd8c9..c8e1accdc90e 100644
--- a/arch/arm/mach-omap2/prm44xx.h
+++ b/arch/arm/mach-omap2/prm44xx.h
@@ -771,6 +771,8 @@ extern void omap44xx_prm_ocp_barrier(void);
771extern void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask); 771extern void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask);
772extern void omap44xx_prm_restore_irqen(u32 *saved_mask); 772extern void omap44xx_prm_restore_irqen(u32 *saved_mask);
773 773
774extern u32 omap44xx_prm_get_reset_sources(void);
775
774# endif 776# endif
775 777
776#endif 778#endif
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 6b4d332be2f6..f596e1e91ffd 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -24,11 +24,11 @@
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26 26
27#include <plat/common.h>
28#include <plat/prcm.h>
29
30#include "prm2xxx_3xxx.h" 27#include "prm2xxx_3xxx.h"
28#include "prm2xxx.h"
29#include "prm3xxx.h"
31#include "prm44xx.h" 30#include "prm44xx.h"
31#include "common.h"
32 32
33/* 33/*
34 * OMAP_PRCM_MAX_NR_PENDING_REG: maximum number of PRM_IRQ*_MPU regs 34 * OMAP_PRCM_MAX_NR_PENDING_REG: maximum number of PRM_IRQ*_MPU regs
@@ -53,6 +53,16 @@ static struct irq_chip_generic **prcm_irq_chips;
53 */ 53 */
54static struct omap_prcm_irq_setup *prcm_irq_setup; 54static struct omap_prcm_irq_setup *prcm_irq_setup;
55 55
56/* prm_base: base virtual address of the PRM IP block */
57void __iomem *prm_base;
58
59/*
60 * prm_ll_data: function pointers to SoC-specific implementations of
61 * common PRM functions
62 */
63static struct prm_ll_data null_prm_ll_data;
64static struct prm_ll_data *prm_ll_data = &null_prm_ll_data;
65
56/* Private functions */ 66/* Private functions */
57 67
58/* 68/*
@@ -319,64 +329,82 @@ err:
319 return -ENOMEM; 329 return -ENOMEM;
320} 330}
321 331
322/* 332/**
323 * Stubbed functions so that common files continue to build when 333 * omap2_set_globals_prm - set the PRM base address (for early use)
324 * custom builds are used 334 * @prm: PRM base virtual address
325 * XXX These are temporary and should be removed at the earliest possible 335 *
326 * opportunity 336 * XXX Will be replaced when the PRM/CM drivers are completed.
327 */ 337 */
328u32 __weak omap2_prm_read_mod_reg(s16 module, u16 idx) 338void __init omap2_set_globals_prm(void __iomem *prm)
329{ 339{
330 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); 340 prm_base = prm;
331 return 0;
332} 341}
333 342
334void __weak omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx) 343/**
344 * prm_read_reset_sources - return the sources of the SoC's last reset
345 *
346 * Return a u32 bitmask representing the reset sources that caused the
347 * SoC to reset. The low-level per-SoC functions called by this
348 * function remap the SoC-specific reset source bits into an
349 * OMAP-common set of reset source bits, defined in
350 * arch/arm/mach-omap2/prm.h. Returns the standardized reset source
351 * u32 bitmask from the hardware upon success, or returns (1 <<
352 * OMAP_UNKNOWN_RST_SRC_ID_SHIFT) if no low-level read_reset_sources()
353 * function was registered.
354 */
355u32 prm_read_reset_sources(void)
335{ 356{
336 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); 357 u32 ret = 1 << OMAP_UNKNOWN_RST_SRC_ID_SHIFT;
337}
338 358
339u32 __weak omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, 359 if (prm_ll_data->read_reset_sources)
340 s16 module, s16 idx) 360 ret = prm_ll_data->read_reset_sources();
341{ 361 else
342 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); 362 WARN_ONCE(1, "prm: %s: no mapping function defined for reset sources\n", __func__);
343 return 0;
344}
345 363
346u32 __weak omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx) 364 return ret;
347{
348 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n");
349 return 0;
350} 365}
351 366
352u32 __weak omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) 367/**
368 * prm_register - register per-SoC low-level data with the PRM
369 * @pld: low-level per-SoC OMAP PRM data & function pointers to register
370 *
371 * Register per-SoC low-level OMAP PRM data and function pointers with
372 * the OMAP PRM common interface. The caller must keep the data
373 * pointed to by @pld valid until it calls prm_unregister() and
374 * it returns successfully. Returns 0 upon success, -EINVAL if @pld
375 * is NULL, or -EEXIST if prm_register() has already been called
376 * without an intervening prm_unregister().
377 */
378int prm_register(struct prm_ll_data *pld)
353{ 379{
354 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); 380 if (!pld)
355 return 0; 381 return -EINVAL;
356}
357 382
358u32 __weak omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask) 383 if (prm_ll_data != &null_prm_ll_data)
359{ 384 return -EEXIST;
360 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n");
361 return 0;
362}
363 385
364int __weak omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift) 386 prm_ll_data = pld;
365{
366 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n");
367 return 0;
368}
369 387
370int __weak omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
371{
372 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n");
373 return 0; 388 return 0;
374} 389}
375 390
376int __weak omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, 391/**
377 u8 st_shift) 392 * prm_unregister - unregister per-SoC low-level data & function pointers
393 * @pld: low-level per-SoC OMAP PRM data & function pointers to unregister
394 *
395 * Unregister per-SoC low-level OMAP PRM data and function pointers
396 * that were previously registered with prm_register(). The
397 * caller may not destroy any of the data pointed to by @pld until
398 * this function returns successfully. Returns 0 upon success, or
399 * -EINVAL if @pld is NULL or if @pld does not match the struct
400 * prm_ll_data * previously registered by prm_register().
401 */
402int prm_unregister(struct prm_ll_data *pld)
378{ 403{
379 WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); 404 if (!pld || prm_ll_data != pld)
405 return -EINVAL;
406
407 prm_ll_data = &null_prm_ll_data;
408
380 return 0; 409 return 0;
381} 410}
382
diff --git a/arch/arm/mach-omap2/prminst44xx.h b/arch/arm/mach-omap2/prminst44xx.h
index 46f2efb36596..a2ede2d65481 100644
--- a/arch/arm/mach-omap2/prminst44xx.h
+++ b/arch/arm/mach-omap2/prminst44xx.h
@@ -30,4 +30,6 @@ extern int omap4_prminst_assert_hardreset(u8 shift, u8 part, s16 inst,
30extern int omap4_prminst_deassert_hardreset(u8 shift, u8 part, s16 inst, 30extern int omap4_prminst_deassert_hardreset(u8 shift, u8 part, s16 inst,
31 u16 rstctrl_offs); 31 u16 rstctrl_offs);
32 32
33extern void omap_prm_base_init(void);
34
33#endif 35#endif
diff --git a/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h b/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
index 8bfaf342a028..1ee58c281a31 100644
--- a/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
+++ b/arch/arm/mach-omap2/sdram-hynix-h8mbx00u0mer-0em.h
@@ -11,7 +11,7 @@
11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM 11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM
12#define __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM 12#define __ARCH_ARM_MACH_OMAP2_SDRAM_HYNIX_H8MBX00U0MER0EM
13 13
14#include <plat/sdrc.h> 14#include "sdrc.h"
15 15
16/* Hynix H8MBX00U0MER-0EM */ 16/* Hynix H8MBX00U0MER-0EM */
17static struct omap_sdrc_params h8mbx00u0mer0em_sdrc_params[] = { 17static struct omap_sdrc_params h8mbx00u0mer0em_sdrc_params[] = {
diff --git a/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h b/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
index a391b4939f74..85cccc004c06 100644
--- a/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
+++ b/arch/arm/mach-omap2/sdram-micron-mt46h32m32lf-6.h
@@ -14,7 +14,7 @@
14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF 14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
15#define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF 15#define ARCH_ARM_MACH_OMAP2_SDRAM_MICRON_MT46H32M32LF
16 16
17#include <plat/sdrc.h> 17#include "sdrc.h"
18 18
19/* Micron MT46H32M32LF-6 */ 19/* Micron MT46H32M32LF-6 */
20/* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */ 20/* XXX Using ARE = 0x1 (no autorefresh burst) -- can this be changed? */
diff --git a/arch/arm/mach-omap2/sdram-nokia.c b/arch/arm/mach-omap2/sdram-nokia.c
index 845c4fd2b125..0fa7ffa9b5ed 100644
--- a/arch/arm/mach-omap2/sdram-nokia.c
+++ b/arch/arm/mach-omap2/sdram-nokia.c
@@ -18,10 +18,8 @@
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include "common.h" 20#include "common.h"
21#include <plat/clock.h>
22#include <plat/sdrc.h>
23
24#include "sdram-nokia.h" 21#include "sdram-nokia.h"
22#include "sdrc.h"
25 23
26/* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */ 24/* In picoseconds, except for tREF (ns), tXP, tCKE, tWTR (clks) */
27struct sdram_timings { 25struct sdram_timings {
diff --git a/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h b/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h
index cd4352917022..003f7bf4e2e3 100644
--- a/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h
+++ b/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h
@@ -11,7 +11,7 @@
11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM 11#ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM
12#define __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM 12#define __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM
13 13
14#include <plat/sdrc.h> 14#include "sdrc.h"
15 15
16/* Numonyx M65KXXXXAM */ 16/* Numonyx M65KXXXXAM */
17static struct omap_sdrc_params m65kxxxxam_sdrc_params[] = { 17static struct omap_sdrc_params m65kxxxxam_sdrc_params[] = {
diff --git a/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h b/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
index 0e518a72831f..8dc3de5ebb5b 100644
--- a/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
+++ b/arch/arm/mach-omap2/sdram-qimonda-hyb18m512160af-6.h
@@ -14,7 +14,7 @@
14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6 14#ifndef ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
15#define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6 15#define ARCH_ARM_MACH_OMAP2_SDRAM_QIMONDA_HYB18M512160AF6
16 16
17#include <plat/sdrc.h> 17#include "sdrc.h"
18 18
19/* Qimonda HYB18M512160AF-6 */ 19/* Qimonda HYB18M512160AF-6 */
20static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = { 20static struct omap_sdrc_params hyb18m512160af6_sdrc_params[] = {
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index e3d345f46409..dae7e4804a48 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -24,10 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include "common.h" 26#include "common.h"
27#include <plat/clock.h> 27#include "clock.h"
28#include <plat/sram.h>
29
30#include <plat/sdrc.h>
31#include "sdrc.h" 28#include "sdrc.h"
32 29
33static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1; 30static struct omap_sdrc_params *sdrc_init_params_cs0, *sdrc_init_params_cs1;
@@ -115,12 +112,10 @@ int omap2_sdrc_get_params(unsigned long r,
115} 112}
116 113
117 114
118void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals) 115void __init omap2_set_globals_sdrc(void __iomem *sdrc, void __iomem *sms)
119{ 116{
120 if (omap2_globals->sdrc) 117 omap2_sdrc_base = sdrc;
121 omap2_sdrc_base = omap2_globals->sdrc; 118 omap2_sms_base = sms;
122 if (omap2_globals->sms)
123 omap2_sms_base = omap2_globals->sms;
124} 119}
125 120
126/** 121/**
@@ -160,19 +155,3 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
160 sdrc_write_reg(l, SDRC_POWER); 155 sdrc_write_reg(l, SDRC_POWER);
161 omap2_sms_save_context(); 156 omap2_sms_save_context();
162} 157}
163
164void omap2_sms_write_rot_control(u32 val, unsigned ctx)
165{
166 sms_write_reg(val, SMS_ROT_CONTROL(ctx));
167}
168
169void omap2_sms_write_rot_size(u32 val, unsigned ctx)
170{
171 sms_write_reg(val, SMS_ROT_SIZE(ctx));
172}
173
174void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx)
175{
176 sms_write_reg(val, SMS_ROT_PHYSICAL_BA(ctx));
177}
178
diff --git a/arch/arm/mach-omap2/sdrc.h b/arch/arm/mach-omap2/sdrc.h
index b3f83799e6cf..446aa13511fd 100644
--- a/arch/arm/mach-omap2/sdrc.h
+++ b/arch/arm/mach-omap2/sdrc.h
@@ -2,12 +2,14 @@
2#define __ARCH_ARM_MACH_OMAP2_SDRC_H 2#define __ARCH_ARM_MACH_OMAP2_SDRC_H
3 3
4/* 4/*
5 * OMAP2 SDRC register definitions 5 * OMAP2/3 SDRC/SMS macros and prototypes
6 * 6 *
7 * Copyright (C) 2007 Texas Instruments, Inc. 7 * Copyright (C) 2007-2008, 2012 Texas Instruments, Inc.
8 * Copyright (C) 2007 Nokia Corporation 8 * Copyright (C) 2007-2008 Nokia Corporation
9 * 9 *
10 * Written by Paul Walmsley 10 * Paul Walmsley
11 * Tony Lindgren
12 * Richard Woodruff
11 * 13 *
12 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 15 * it under the terms of the GNU General Public License version 2 as
@@ -15,8 +17,6 @@
15 */ 17 */
16#undef DEBUG 18#undef DEBUG
17 19
18#include <plat/sdrc.h>
19
20#ifndef __ASSEMBLER__ 20#ifndef __ASSEMBLER__
21 21
22#include <linux/io.h> 22#include <linux/io.h>
@@ -50,6 +50,60 @@ static inline u32 sms_read_reg(u16 reg)
50{ 50{
51 return __raw_readl(OMAP_SMS_REGADDR(reg)); 51 return __raw_readl(OMAP_SMS_REGADDR(reg));
52} 52}
53
54extern void omap2_set_globals_sdrc(void __iomem *sdrc, void __iomem *sms);
55
56
57/**
58 * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate
59 * @rate: SDRC clock rate (in Hz)
60 * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate
61 * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate
62 * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate
63 * @mr: Value to program to SDRC_MR for this rate
64 *
65 * This structure holds a pre-computed set of register values for the
66 * SDRC for a given SDRC clock rate and SDRAM chip. These are
67 * intended to be pre-computed and specified in an array in the board-*.c
68 * files. The structure is keyed off the 'rate' field.
69 */
70struct omap_sdrc_params {
71 unsigned long rate;
72 u32 actim_ctrla;
73 u32 actim_ctrlb;
74 u32 rfr_ctrl;
75 u32 mr;
76};
77
78#ifdef CONFIG_SOC_HAS_OMAP2_SDRC
79void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
80 struct omap_sdrc_params *sdrc_cs1);
81#else
82static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
83 struct omap_sdrc_params *sdrc_cs1) {};
84#endif
85
86int omap2_sdrc_get_params(unsigned long r,
87 struct omap_sdrc_params **sdrc_cs0,
88 struct omap_sdrc_params **sdrc_cs1);
89void omap2_sms_save_context(void);
90void omap2_sms_restore_context(void);
91
92struct memory_timings {
93 u32 m_type; /* ddr = 1, sdr = 0 */
94 u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */
95 u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */
96 u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */
97 u32 base_cs; /* base chip select to use for calculations */
98};
99
100extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode);
101struct omap_sdrc_params *rx51_get_sdram_timings(void);
102
103u32 omap2xxx_sdrc_dll_is_unlocked(void);
104u32 omap2xxx_sdrc_reprogram(u32 level, u32 force);
105
106
53#else 107#else
54#define OMAP242X_SDRC_REGADDR(reg) \ 108#define OMAP242X_SDRC_REGADDR(reg) \
55 OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg)) 109 OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE + (reg))
@@ -57,6 +111,7 @@ static inline u32 sms_read_reg(u16 reg)
57 OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE + (reg)) 111 OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE + (reg))
58#define OMAP34XX_SDRC_REGADDR(reg) \ 112#define OMAP34XX_SDRC_REGADDR(reg) \
59 OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE + (reg)) 113 OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE + (reg))
114
60#endif /* __ASSEMBLER__ */ 115#endif /* __ASSEMBLER__ */
61 116
62/* Minimum frequency that the SDRC DLL can lock at */ 117/* Minimum frequency that the SDRC DLL can lock at */
@@ -74,4 +129,85 @@ static inline u32 sms_read_reg(u16 reg)
74 */ 129 */
75#define SDRC_MPURATE_LOOPS 96 130#define SDRC_MPURATE_LOOPS 96
76 131
132/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
133
134#define SDRC_SYSCONFIG 0x010
135#define SDRC_CS_CFG 0x040
136#define SDRC_SHARING 0x044
137#define SDRC_ERR_TYPE 0x04C
138#define SDRC_DLLA_CTRL 0x060
139#define SDRC_DLLA_STATUS 0x064
140#define SDRC_DLLB_CTRL 0x068
141#define SDRC_DLLB_STATUS 0x06C
142#define SDRC_POWER 0x070
143#define SDRC_MCFG_0 0x080
144#define SDRC_MR_0 0x084
145#define SDRC_EMR2_0 0x08c
146#define SDRC_ACTIM_CTRL_A_0 0x09c
147#define SDRC_ACTIM_CTRL_B_0 0x0a0
148#define SDRC_RFR_CTRL_0 0x0a4
149#define SDRC_MANUAL_0 0x0a8
150#define SDRC_MCFG_1 0x0B0
151#define SDRC_MR_1 0x0B4
152#define SDRC_EMR2_1 0x0BC
153#define SDRC_ACTIM_CTRL_A_1 0x0C4
154#define SDRC_ACTIM_CTRL_B_1 0x0C8
155#define SDRC_RFR_CTRL_1 0x0D4
156#define SDRC_MANUAL_1 0x0D8
157
158#define SDRC_POWER_AUTOCOUNT_SHIFT 8
159#define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
160#define SDRC_POWER_CLKCTRL_SHIFT 4
161#define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
162#define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
163
164/*
165 * These values represent the number of memory clock cycles between
166 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192
167 * rows per device, and include a subtraction of a 50 cycle window in the
168 * event that the autorefresh command is delayed due to other SDRC activity.
169 * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
170 * counter reaches 0.
171 *
172 * These represent optimal values for common parts, it won't work for all.
173 * As long as you scale down, most parameters are still work, they just
174 * become sub-optimal. The RFR value goes in the opposite direction. If you
175 * don't adjust it down as your clock period increases the refresh interval
176 * will not be met. Setting all parameters for complete worst case may work,
177 * but may cut memory performance by 2x. Due to errata the DLLs need to be
178 * unlocked and their value needs run time calibration. A dynamic call is
179 * need for that as no single right value exists acorss production samples.
180 *
181 * Only the FULL speed values are given. Current code is such that rate
182 * changes must be made at DPLLoutx2. The actual value adjustment for low
183 * frequency operation will be handled by omap_set_performance()
184 *
185 * By having the boot loader boot up in the fastest L4 speed available likely
186 * will result in something which you can switch between.
187 */
188#define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1)
189#define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
190#define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
191#define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
192#define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
193
194
195/*
196 * SMS register access
197 */
198
199#define OMAP242X_SMS_REGADDR(reg) \
200 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
201#define OMAP243X_SMS_REGADDR(reg) \
202 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
203#define OMAP343X_SMS_REGADDR(reg) \
204 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
205
206/* SMS register offsets - read/write with sms_{read,write}_reg() */
207
208#define SMS_SYSCONFIG 0x010
209/* REVISIT: fill in other SMS registers here */
210
211
212
77#endif 213#endif
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 73e55e485329..907291714643 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -24,16 +24,13 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <plat/clock.h>
28#include <plat/sram.h>
29#include <plat/sdrc.h>
30
31#include "soc.h" 27#include "soc.h"
32#include "iomap.h" 28#include "iomap.h"
33#include "common.h" 29#include "common.h"
34#include "prm2xxx_3xxx.h" 30#include "prm2xxx.h"
35#include "clock.h" 31#include "clock.h"
36#include "sdrc.h" 32#include "sdrc.h"
33#include "sram.h"
37 34
38/* Memory timing, DLL mode flags */ 35/* Memory timing, DLL mode flags */
39#define M_DDR 1 36#define M_DDR 1
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index a507cd6cf4f1..aa30a3c20883 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -28,19 +28,20 @@
28#include <linux/console.h> 28#include <linux/console.h>
29 29
30#include <plat/omap-serial.h> 30#include <plat/omap-serial.h>
31#include "common.h" 31#include <plat-omap/dma-omap.h>
32#include <plat/dma.h>
33#include <plat/omap_hwmod.h>
34#include <plat/omap_device.h>
35#include <plat/omap-pm.h>
36#include <plat/serial.h>
37 32
33#include "common.h"
34#include "omap_hwmod.h"
35#include "omap_device.h"
36#include "omap-pm.h"
37#include "soc.h"
38#include "prm2xxx_3xxx.h" 38#include "prm2xxx_3xxx.h"
39#include "pm.h" 39#include "pm.h"
40#include "cm2xxx_3xxx.h" 40#include "cm2xxx_3xxx.h"
41#include "prm-regbits-34xx.h" 41#include "prm-regbits-34xx.h"
42#include "control.h" 42#include "control.h"
43#include "mux.h" 43#include "mux.h"
44#include "serial.h"
44 45
45/* 46/*
46 * NOTE: By default the serial auto_suspend timeout is disabled as it causes 47 * NOTE: By default the serial auto_suspend timeout is disabled as it causes
diff --git a/arch/arm/mach-omap2/serial.h b/arch/arm/mach-omap2/serial.h
new file mode 100644
index 000000000000..c4014f013df0
--- /dev/null
+++ b/arch/arm/mach-omap2/serial.h
@@ -0,0 +1 @@
#include <mach/serial.h>
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 506987979c1c..d1dedc8195ed 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -26,13 +26,12 @@
26 26
27#include <asm/assembler.h> 27#include <asm/assembler.h>
28 28
29#include <plat/sram.h>
30
31#include "omap34xx.h" 29#include "omap34xx.h"
32#include "iomap.h" 30#include "iomap.h"
33#include "cm2xxx_3xxx.h" 31#include "cm3xxx.h"
34#include "prm2xxx_3xxx.h" 32#include "prm3xxx.h"
35#include "sdrc.h" 33#include "sdrc.h"
34#include "sram.h"
36#include "control.h" 35#include "control.h"
37 36
38/* 37/*
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index fc9b96daf851..070096496e20 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -1,7 +1,473 @@
1#include <plat/cpu.h> 1/*
2 * OMAP cpu type detection
3 *
4 * Copyright (C) 2004, 2008 Nokia Corporation
5 *
6 * Copyright (C) 2009-11 Texas Instruments.
7 *
8 * Written by Tony Lindgren <tony.lindgren@nokia.com>
9 *
10 * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
2#include "omap24xx.h" 28#include "omap24xx.h"
3#include "omap34xx.h" 29#include "omap34xx.h"
4#include "omap44xx.h" 30#include "omap44xx.h"
5#include "ti81xx.h" 31#include "ti81xx.h"
6#include "am33xx.h" 32#include "am33xx.h"
7#include "omap54xx.h" 33#include "omap54xx.h"
34
35#ifndef __ASSEMBLY__
36
37#include <linux/bitops.h>
38
39/*
40 * Test if multicore OMAP support is needed
41 */
42#undef MULTI_OMAP2
43#undef OMAP_NAME
44
45#ifdef CONFIG_SOC_OMAP2420
46# ifdef OMAP_NAME
47# undef MULTI_OMAP2
48# define MULTI_OMAP2
49# else
50# define OMAP_NAME omap2420
51# endif
52#endif
53#ifdef CONFIG_SOC_OMAP2430
54# ifdef OMAP_NAME
55# undef MULTI_OMAP2
56# define MULTI_OMAP2
57# else
58# define OMAP_NAME omap2430
59# endif
60#endif
61#ifdef CONFIG_ARCH_OMAP3
62# ifdef OMAP_NAME
63# undef MULTI_OMAP2
64# define MULTI_OMAP2
65# else
66# define OMAP_NAME omap3
67# endif
68#endif
69#ifdef CONFIG_ARCH_OMAP4
70# ifdef OMAP_NAME
71# undef MULTI_OMAP2
72# define MULTI_OMAP2
73# else
74# define OMAP_NAME omap4
75# endif
76#endif
77
78#ifdef CONFIG_SOC_OMAP5
79# ifdef OMAP_NAME
80# undef MULTI_OMAP2
81# define MULTI_OMAP2
82# else
83# define OMAP_NAME omap5
84# endif
85#endif
86
87#ifdef CONFIG_SOC_AM33XX
88# ifdef OMAP_NAME
89# undef MULTI_OMAP2
90# define MULTI_OMAP2
91# else
92# define OMAP_NAME am33xx
93# endif
94#endif
95
96/*
97 * Omap device type i.e. EMU/HS/TST/GP/BAD
98 */
99#define OMAP2_DEVICE_TYPE_TEST 0
100#define OMAP2_DEVICE_TYPE_EMU 1
101#define OMAP2_DEVICE_TYPE_SEC 2
102#define OMAP2_DEVICE_TYPE_GP 3
103#define OMAP2_DEVICE_TYPE_BAD 4
104
105int omap_type(void);
106
107/*
108 * omap_rev bits:
109 * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
110 * CPU revision (See _REV_ defined in cpu.h) [15:08]
111 * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00]
112 */
113unsigned int omap_rev(void);
114
115/*
116 * Get the CPU revision for OMAP devices
117 */
118#define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
119
120/*
121 * Macros to group OMAP into cpu classes.
122 * These can be used in most places.
123 * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
124 * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423
125 * cpu_is_omap243x(): True for OMAP2430
126 * cpu_is_omap343x(): True for OMAP3430
127 * cpu_is_omap443x(): True for OMAP4430
128 * cpu_is_omap446x(): True for OMAP4460
129 * cpu_is_omap447x(): True for OMAP4470
130 * soc_is_omap543x(): True for OMAP5430, OMAP5432
131 */
132#define GET_OMAP_CLASS (omap_rev() & 0xff)
133
134#define IS_OMAP_CLASS(class, id) \
135static inline int is_omap ##class (void) \
136{ \
137 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
138}
139
140#define GET_AM_CLASS ((omap_rev() >> 24) & 0xff)
141
142#define IS_AM_CLASS(class, id) \
143static inline int is_am ##class (void) \
144{ \
145 return (GET_AM_CLASS == (id)) ? 1 : 0; \
146}
147
148#define GET_TI_CLASS ((omap_rev() >> 24) & 0xff)
149
150#define IS_TI_CLASS(class, id) \
151static inline int is_ti ##class (void) \
152{ \
153 return (GET_TI_CLASS == (id)) ? 1 : 0; \
154}
155
156#define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
157
158#define IS_OMAP_SUBCLASS(subclass, id) \
159static inline int is_omap ##subclass (void) \
160{ \
161 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
162}
163
164#define IS_TI_SUBCLASS(subclass, id) \
165static inline int is_ti ##subclass (void) \
166{ \
167 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
168}
169
170#define IS_AM_SUBCLASS(subclass, id) \
171static inline int is_am ##subclass (void) \
172{ \
173 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
174}
175
176IS_OMAP_CLASS(24xx, 0x24)
177IS_OMAP_CLASS(34xx, 0x34)
178IS_OMAP_CLASS(44xx, 0x44)
179IS_AM_CLASS(35xx, 0x35)
180IS_OMAP_CLASS(54xx, 0x54)
181IS_AM_CLASS(33xx, 0x33)
182
183IS_TI_CLASS(81xx, 0x81)
184
185IS_OMAP_SUBCLASS(242x, 0x242)
186IS_OMAP_SUBCLASS(243x, 0x243)
187IS_OMAP_SUBCLASS(343x, 0x343)
188IS_OMAP_SUBCLASS(363x, 0x363)
189IS_OMAP_SUBCLASS(443x, 0x443)
190IS_OMAP_SUBCLASS(446x, 0x446)
191IS_OMAP_SUBCLASS(447x, 0x447)
192IS_OMAP_SUBCLASS(543x, 0x543)
193
194IS_TI_SUBCLASS(816x, 0x816)
195IS_TI_SUBCLASS(814x, 0x814)
196IS_AM_SUBCLASS(335x, 0x335)
197
198#define cpu_is_omap24xx() 0
199#define cpu_is_omap242x() 0
200#define cpu_is_omap243x() 0
201#define cpu_is_omap34xx() 0
202#define cpu_is_omap343x() 0
203#define cpu_is_ti81xx() 0
204#define cpu_is_ti816x() 0
205#define cpu_is_ti814x() 0
206#define soc_is_am35xx() 0
207#define soc_is_am33xx() 0
208#define soc_is_am335x() 0
209#define cpu_is_omap44xx() 0
210#define cpu_is_omap443x() 0
211#define cpu_is_omap446x() 0
212#define cpu_is_omap447x() 0
213#define soc_is_omap54xx() 0
214#define soc_is_omap543x() 0
215
216#if defined(MULTI_OMAP2)
217# if defined(CONFIG_ARCH_OMAP2)
218# undef cpu_is_omap24xx
219# define cpu_is_omap24xx() is_omap24xx()
220# endif
221# if defined (CONFIG_SOC_OMAP2420)
222# undef cpu_is_omap242x
223# define cpu_is_omap242x() is_omap242x()
224# endif
225# if defined (CONFIG_SOC_OMAP2430)
226# undef cpu_is_omap243x
227# define cpu_is_omap243x() is_omap243x()
228# endif
229# if defined(CONFIG_ARCH_OMAP3)
230# undef cpu_is_omap34xx
231# undef cpu_is_omap343x
232# define cpu_is_omap34xx() is_omap34xx()
233# define cpu_is_omap343x() is_omap343x()
234# endif
235#else
236# if defined(CONFIG_ARCH_OMAP2)
237# undef cpu_is_omap24xx
238# define cpu_is_omap24xx() 1
239# endif
240# if defined(CONFIG_SOC_OMAP2420)
241# undef cpu_is_omap242x
242# define cpu_is_omap242x() 1
243# endif
244# if defined(CONFIG_SOC_OMAP2430)
245# undef cpu_is_omap243x
246# define cpu_is_omap243x() 1
247# endif
248# if defined(CONFIG_ARCH_OMAP3)
249# undef cpu_is_omap34xx
250# define cpu_is_omap34xx() 1
251# endif
252# if defined(CONFIG_SOC_OMAP3430)
253# undef cpu_is_omap343x
254# define cpu_is_omap343x() 1
255# endif
256#endif
257
258/*
259 * Macros to detect individual cpu types.
260 * These are only rarely needed.
261 * cpu_is_omap2420(): True for OMAP2420
262 * cpu_is_omap2422(): True for OMAP2422
263 * cpu_is_omap2423(): True for OMAP2423
264 * cpu_is_omap2430(): True for OMAP2430
265 * cpu_is_omap3430(): True for OMAP3430
266 */
267#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
268
269#define IS_OMAP_TYPE(type, id) \
270static inline int is_omap ##type (void) \
271{ \
272 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
273}
274
275IS_OMAP_TYPE(2420, 0x2420)
276IS_OMAP_TYPE(2422, 0x2422)
277IS_OMAP_TYPE(2423, 0x2423)
278IS_OMAP_TYPE(2430, 0x2430)
279IS_OMAP_TYPE(3430, 0x3430)
280
281#define cpu_is_omap2420() 0
282#define cpu_is_omap2422() 0
283#define cpu_is_omap2423() 0
284#define cpu_is_omap2430() 0
285#define cpu_is_omap3430() 0
286#define cpu_is_omap3630() 0
287#define soc_is_omap5430() 0
288
289/* These are needed for the common code */
290#ifdef CONFIG_ARCH_OMAP2PLUS
291#define cpu_is_omap7xx() 0
292#define cpu_is_omap15xx() 0
293#define cpu_is_omap16xx() 0
294#define cpu_is_omap1510() 0
295#define cpu_is_omap1610() 0
296#define cpu_is_omap1611() 0
297#define cpu_is_omap1621() 0
298#define cpu_is_omap1710() 0
299#define cpu_class_is_omap1() 0
300#define cpu_class_is_omap2() 1
301#endif
302
303#if defined(CONFIG_ARCH_OMAP2)
304# undef cpu_is_omap2420
305# undef cpu_is_omap2422
306# undef cpu_is_omap2423
307# undef cpu_is_omap2430
308# define cpu_is_omap2420() is_omap2420()
309# define cpu_is_omap2422() is_omap2422()
310# define cpu_is_omap2423() is_omap2423()
311# define cpu_is_omap2430() is_omap2430()
312#endif
313
314#if defined(CONFIG_ARCH_OMAP3)
315# undef cpu_is_omap3430
316# undef cpu_is_ti81xx
317# undef cpu_is_ti816x
318# undef cpu_is_ti814x
319# undef soc_is_am35xx
320# define cpu_is_omap3430() is_omap3430()
321# undef cpu_is_omap3630
322# define cpu_is_omap3630() is_omap363x()
323# define cpu_is_ti81xx() is_ti81xx()
324# define cpu_is_ti816x() is_ti816x()
325# define cpu_is_ti814x() is_ti814x()
326# define soc_is_am35xx() is_am35xx()
327#endif
328
329# if defined(CONFIG_SOC_AM33XX)
330# undef soc_is_am33xx
331# undef soc_is_am335x
332# define soc_is_am33xx() is_am33xx()
333# define soc_is_am335x() is_am335x()
334#endif
335
336# if defined(CONFIG_ARCH_OMAP4)
337# undef cpu_is_omap44xx
338# undef cpu_is_omap443x
339# undef cpu_is_omap446x
340# undef cpu_is_omap447x
341# define cpu_is_omap44xx() is_omap44xx()
342# define cpu_is_omap443x() is_omap443x()
343# define cpu_is_omap446x() is_omap446x()
344# define cpu_is_omap447x() is_omap447x()
345# endif
346
347# if defined(CONFIG_SOC_OMAP5)
348# undef soc_is_omap54xx
349# undef soc_is_omap543x
350# define soc_is_omap54xx() is_omap54xx()
351# define soc_is_omap543x() is_omap543x()
352#endif
353
354/* Various silicon revisions for omap2 */
355#define OMAP242X_CLASS 0x24200024
356#define OMAP2420_REV_ES1_0 OMAP242X_CLASS
357#define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (0x1 << 8))
358
359#define OMAP243X_CLASS 0x24300024
360#define OMAP2430_REV_ES1_0 OMAP243X_CLASS
361
362#define OMAP343X_CLASS 0x34300034
363#define OMAP3430_REV_ES1_0 OMAP343X_CLASS
364#define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (0x1 << 8))
365#define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (0x2 << 8))
366#define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (0x3 << 8))
367#define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (0x4 << 8))
368#define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (0x5 << 8))
369
370#define OMAP363X_CLASS 0x36300034
371#define OMAP3630_REV_ES1_0 OMAP363X_CLASS
372#define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8))
373#define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8))
374
375#define TI816X_CLASS 0x81600034
376#define TI8168_REV_ES1_0 TI816X_CLASS
377#define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8))
378
379#define TI814X_CLASS 0x81400034
380#define TI8148_REV_ES1_0 TI814X_CLASS
381#define TI8148_REV_ES2_0 (TI814X_CLASS | (0x1 << 8))
382#define TI8148_REV_ES2_1 (TI814X_CLASS | (0x2 << 8))
383
384#define AM35XX_CLASS 0x35170034
385#define AM35XX_REV_ES1_0 AM35XX_CLASS
386#define AM35XX_REV_ES1_1 (AM35XX_CLASS | (0x1 << 8))
387
388#define AM335X_CLASS 0x33500033
389#define AM335X_REV_ES1_0 AM335X_CLASS
390
391#define OMAP443X_CLASS 0x44300044
392#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
393#define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8))
394#define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8))
395#define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8))
396#define OMAP4430_REV_ES2_3 (OMAP443X_CLASS | (0x23 << 8))
397
398#define OMAP446X_CLASS 0x44600044
399#define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8))
400#define OMAP4460_REV_ES1_1 (OMAP446X_CLASS | (0x11 << 8))
401
402#define OMAP447X_CLASS 0x44700044
403#define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8))
404
405#define OMAP54XX_CLASS 0x54000054
406#define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8))
407#define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8))
408
409void omap2xxx_check_revision(void);
410void omap3xxx_check_revision(void);
411void omap4xxx_check_revision(void);
412void omap5xxx_check_revision(void);
413void omap3xxx_check_features(void);
414void ti81xx_check_features(void);
415void omap4xxx_check_features(void);
416
417/*
418 * Runtime detection of OMAP3 features
419 *
420 * OMAP3_HAS_IO_CHAIN_CTRL: Some later members of the OMAP3 chip
421 * family have OS-level control over the I/O chain clock. This is
422 * to avoid a window during which wakeups could potentially be lost
423 * during powerdomain transitions. If this bit is set, it
424 * indicates that the chip does support OS-level control of this
425 * feature.
426 */
427extern u32 omap_features;
428
429#define OMAP3_HAS_L2CACHE BIT(0)
430#define OMAP3_HAS_IVA BIT(1)
431#define OMAP3_HAS_SGX BIT(2)
432#define OMAP3_HAS_NEON BIT(3)
433#define OMAP3_HAS_ISP BIT(4)
434#define OMAP3_HAS_192MHZ_CLK BIT(5)
435#define OMAP3_HAS_IO_WAKEUP BIT(6)
436#define OMAP3_HAS_SDRC BIT(7)
437#define OMAP3_HAS_IO_CHAIN_CTRL BIT(8)
438#define OMAP4_HAS_MPU_1GHZ BIT(9)
439#define OMAP4_HAS_MPU_1_2GHZ BIT(10)
440#define OMAP4_HAS_MPU_1_5GHZ BIT(11)
441
442
443#define OMAP3_HAS_FEATURE(feat,flag) \
444static inline unsigned int omap3_has_ ##feat(void) \
445{ \
446 return omap_features & OMAP3_HAS_ ##flag; \
447} \
448
449OMAP3_HAS_FEATURE(l2cache, L2CACHE)
450OMAP3_HAS_FEATURE(sgx, SGX)
451OMAP3_HAS_FEATURE(iva, IVA)
452OMAP3_HAS_FEATURE(neon, NEON)
453OMAP3_HAS_FEATURE(isp, ISP)
454OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
455OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
456OMAP3_HAS_FEATURE(sdrc, SDRC)
457OMAP3_HAS_FEATURE(io_chain_ctrl, IO_CHAIN_CTRL)
458
459/*
460 * Runtime detection of OMAP4 features
461 */
462#define OMAP4_HAS_FEATURE(feat, flag) \
463static inline unsigned int omap4_has_ ##feat(void) \
464{ \
465 return omap_features & OMAP4_HAS_ ##flag; \
466} \
467
468OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
469OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ)
470OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
471
472#endif /* __ASSEMBLY__ */
473
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index f8217a5a4a26..b0e77a407047 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -23,8 +23,8 @@
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <plat/omap_device.h> 26#include "soc.h"
27 27#include "omap_device.h"
28#include "voltage.h" 28#include "voltage.h"
29#include "control.h" 29#include "control.h"
30#include "pm.h" 30#include "pm.h"
diff --git a/arch/arm/mach-omap2/sram.c b/arch/arm/mach-omap2/sram.c
new file mode 100644
index 000000000000..0ff0f068bea8
--- /dev/null
+++ b/arch/arm/mach-omap2/sram.c
@@ -0,0 +1,305 @@
1/*
2 *
3 * OMAP SRAM detection and management
4 *
5 * Copyright (C) 2005 Nokia Corporation
6 * Written by Tony Lindgren <tony@atomide.com>
7 *
8 * Copyright (C) 2009-2012 Texas Instruments
9 * Added OMAP4/5 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
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/kernel.h>
18#include <linux/init.h>
19#include <linux/io.h>
20
21#include <asm/fncpy.h>
22#include <asm/tlb.h>
23#include <asm/cacheflush.h>
24
25#include <asm/mach/map.h>
26
27#include "soc.h"
28#include "iomap.h"
29#include "prm2xxx_3xxx.h"
30#include "sdrc.h"
31#include "sram.h"
32
33#define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800)
34#define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000)
35#ifdef CONFIG_OMAP4_ERRATA_I688
36#define OMAP4_SRAM_PUB_PA OMAP4_SRAM_PA
37#else
38#define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000)
39#endif
40#define OMAP5_SRAM_PA 0x40300000
41
42#define SRAM_BOOTLOADER_SZ 0x00
43
44#define OMAP24XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68005048)
45#define OMAP24XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68005050)
46#define OMAP24XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68005058)
47
48#define OMAP34XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68012848)
49#define OMAP34XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68012850)
50#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)
51#define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880)
52#define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048)
53
54#define GP_DEVICE 0x300
55
56#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1)))
57
58static unsigned long omap_sram_start;
59static unsigned long omap_sram_skip;
60static unsigned long omap_sram_size;
61
62/*
63 * Depending on the target RAMFS firewall setup, the public usable amount of
64 * SRAM varies. The default accessible size for all device types is 2k. A GP
65 * device allows ARM11 but not other initiators for full size. This
66 * functionality seems ok until some nice security API happens.
67 */
68static int is_sram_locked(void)
69{
70 if (OMAP2_DEVICE_TYPE_GP == omap_type()) {
71 /* RAMFW: R/W access to all initiators for all qualifier sets */
72 if (cpu_is_omap242x()) {
73 __raw_writel(0xFF, OMAP24XX_VA_REQINFOPERM0); /* all q-vects */
74 __raw_writel(0xCFDE, OMAP24XX_VA_READPERM0); /* all i-read */
75 __raw_writel(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */
76 }
77 if (cpu_is_omap34xx()) {
78 __raw_writel(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */
79 __raw_writel(0xFFFF, OMAP34XX_VA_READPERM0); /* all i-read */
80 __raw_writel(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */
81 __raw_writel(0x0, OMAP34XX_VA_ADDR_MATCH2);
82 __raw_writel(0xFFFFFFFF, OMAP34XX_VA_SMS_RG_ATT0);
83 }
84 return 0;
85 } else
86 return 1; /* assume locked with no PPA or security driver */
87}
88
89/*
90 * The amount of SRAM depends on the core type.
91 * Note that we cannot try to test for SRAM here because writes
92 * to secure SRAM will hang the system. Also the SRAM is not
93 * yet mapped at this point.
94 */
95static void __init omap_detect_sram(void)
96{
97 omap_sram_skip = SRAM_BOOTLOADER_SZ;
98 if (is_sram_locked()) {
99 if (cpu_is_omap34xx()) {
100 omap_sram_start = OMAP3_SRAM_PUB_PA;
101 if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) ||
102 (omap_type() == OMAP2_DEVICE_TYPE_SEC)) {
103 omap_sram_size = 0x7000; /* 28K */
104 omap_sram_skip += SZ_16K;
105 } else {
106 omap_sram_size = 0x8000; /* 32K */
107 }
108 } else if (cpu_is_omap44xx()) {
109 omap_sram_start = OMAP4_SRAM_PUB_PA;
110 omap_sram_size = 0xa000; /* 40K */
111 } else if (soc_is_omap54xx()) {
112 omap_sram_start = OMAP5_SRAM_PA;
113 omap_sram_size = SZ_128K; /* 128KB */
114 } else {
115 omap_sram_start = OMAP2_SRAM_PUB_PA;
116 omap_sram_size = 0x800; /* 2K */
117 }
118 } else {
119 if (soc_is_am33xx()) {
120 omap_sram_start = AM33XX_SRAM_PA;
121 omap_sram_size = 0x10000; /* 64K */
122 } else if (cpu_is_omap34xx()) {
123 omap_sram_start = OMAP3_SRAM_PA;
124 omap_sram_size = 0x10000; /* 64K */
125 } else if (cpu_is_omap44xx()) {
126 omap_sram_start = OMAP4_SRAM_PA;
127 omap_sram_size = 0xe000; /* 56K */
128 } else if (soc_is_omap54xx()) {
129 omap_sram_start = OMAP5_SRAM_PA;
130 omap_sram_size = SZ_128K; /* 128KB */
131 } else {
132 omap_sram_start = OMAP2_SRAM_PA;
133 if (cpu_is_omap242x())
134 omap_sram_size = 0xa0000; /* 640K */
135 else if (cpu_is_omap243x())
136 omap_sram_size = 0x10000; /* 64K */
137 }
138 }
139}
140
141/*
142 * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early.
143 */
144static void __init omap2_map_sram(void)
145{
146 int cached = 1;
147
148#ifdef CONFIG_OMAP4_ERRATA_I688
149 if (cpu_is_omap44xx()) {
150 omap_sram_start += PAGE_SIZE;
151 omap_sram_size -= SZ_16K;
152 }
153#endif
154 if (cpu_is_omap34xx()) {
155 /*
156 * SRAM must be marked as non-cached on OMAP3 since the
157 * CORE DPLL M2 divider change code (in SRAM) runs with the
158 * SDRAM controller disabled, and if it is marked cached,
159 * the ARM may attempt to write cache lines back to SDRAM
160 * which will cause the system to hang.
161 */
162 cached = 0;
163 }
164
165 omap_map_sram(omap_sram_start, omap_sram_size,
166 omap_sram_skip, cached);
167}
168
169static void (*_omap2_sram_ddr_init)(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
170 u32 base_cs, u32 force_unlock);
171
172void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
173 u32 base_cs, u32 force_unlock)
174{
175 BUG_ON(!_omap2_sram_ddr_init);
176 _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl,
177 base_cs, force_unlock);
178}
179
180static void (*_omap2_sram_reprogram_sdrc)(u32 perf_level, u32 dll_val,
181 u32 mem_type);
182
183void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type)
184{
185 BUG_ON(!_omap2_sram_reprogram_sdrc);
186 _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type);
187}
188
189static u32 (*_omap2_set_prcm)(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
190
191u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass)
192{
193 BUG_ON(!_omap2_set_prcm);
194 return _omap2_set_prcm(dpll_ctrl_val, sdrc_rfr_val, bypass);
195}
196
197#ifdef CONFIG_SOC_OMAP2420
198static int __init omap242x_sram_init(void)
199{
200 _omap2_sram_ddr_init = omap_sram_push(omap242x_sram_ddr_init,
201 omap242x_sram_ddr_init_sz);
202
203 _omap2_sram_reprogram_sdrc = omap_sram_push(omap242x_sram_reprogram_sdrc,
204 omap242x_sram_reprogram_sdrc_sz);
205
206 _omap2_set_prcm = omap_sram_push(omap242x_sram_set_prcm,
207 omap242x_sram_set_prcm_sz);
208
209 return 0;
210}
211#else
212static inline int omap242x_sram_init(void)
213{
214 return 0;
215}
216#endif
217
218#ifdef CONFIG_SOC_OMAP2430
219static int __init omap243x_sram_init(void)
220{
221 _omap2_sram_ddr_init = omap_sram_push(omap243x_sram_ddr_init,
222 omap243x_sram_ddr_init_sz);
223
224 _omap2_sram_reprogram_sdrc = omap_sram_push(omap243x_sram_reprogram_sdrc,
225 omap243x_sram_reprogram_sdrc_sz);
226
227 _omap2_set_prcm = omap_sram_push(omap243x_sram_set_prcm,
228 omap243x_sram_set_prcm_sz);
229
230 return 0;
231}
232#else
233static inline int omap243x_sram_init(void)
234{
235 return 0;
236}
237#endif
238
239#ifdef CONFIG_ARCH_OMAP3
240
241static u32 (*_omap3_sram_configure_core_dpll)(
242 u32 m2, u32 unlock_dll, u32 f, u32 inc,
243 u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
244 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
245 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
246 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
247
248u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc,
249 u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
250 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
251 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
252 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1)
253{
254 BUG_ON(!_omap3_sram_configure_core_dpll);
255 return _omap3_sram_configure_core_dpll(
256 m2, unlock_dll, f, inc,
257 sdrc_rfr_ctrl_0, sdrc_actim_ctrl_a_0,
258 sdrc_actim_ctrl_b_0, sdrc_mr_0,
259 sdrc_rfr_ctrl_1, sdrc_actim_ctrl_a_1,
260 sdrc_actim_ctrl_b_1, sdrc_mr_1);
261}
262
263void omap3_sram_restore_context(void)
264{
265 omap_sram_reset();
266
267 _omap3_sram_configure_core_dpll =
268 omap_sram_push(omap3_sram_configure_core_dpll,
269 omap3_sram_configure_core_dpll_sz);
270 omap_push_sram_idle();
271}
272
273static inline int omap34xx_sram_init(void)
274{
275 omap3_sram_restore_context();
276 return 0;
277}
278#else
279static inline int omap34xx_sram_init(void)
280{
281 return 0;
282}
283#endif /* CONFIG_ARCH_OMAP3 */
284
285static inline int am33xx_sram_init(void)
286{
287 return 0;
288}
289
290int __init omap_sram_init(void)
291{
292 omap_detect_sram();
293 omap2_map_sram();
294
295 if (cpu_is_omap242x())
296 omap242x_sram_init();
297 else if (cpu_is_omap2430())
298 omap243x_sram_init();
299 else if (soc_is_am33xx())
300 am33xx_sram_init();
301 else if (cpu_is_omap34xx())
302 omap34xx_sram_init();
303
304 return 0;
305}
diff --git a/arch/arm/mach-omap2/sram.h b/arch/arm/mach-omap2/sram.h
new file mode 100644
index 000000000000..ca7277c2a9ee
--- /dev/null
+++ b/arch/arm/mach-omap2/sram.h
@@ -0,0 +1,83 @@
1/*
2 * Interface for functions that need to be run in internal SRAM
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __ASSEMBLY__
10#include <plat/sram.h>
11
12extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
13 u32 base_cs, u32 force_unlock);
14extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
15 u32 mem_type);
16extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
17
18extern u32 omap3_configure_core_dpll(
19 u32 m2, u32 unlock_dll, u32 f, u32 inc,
20 u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
21 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
22 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
23 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
24extern void omap3_sram_restore_context(void);
25
26/* Do not use these */
27extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
28extern unsigned long omap24xx_sram_reprogram_clock_sz;
29
30extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
31 u32 base_cs, u32 force_unlock);
32extern unsigned long omap242x_sram_ddr_init_sz;
33
34extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
35 int bypass);
36extern unsigned long omap242x_sram_set_prcm_sz;
37
38extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
39 u32 mem_type);
40extern unsigned long omap242x_sram_reprogram_sdrc_sz;
41
42
43extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
44 u32 base_cs, u32 force_unlock);
45extern unsigned long omap243x_sram_ddr_init_sz;
46
47extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
48 int bypass);
49extern unsigned long omap243x_sram_set_prcm_sz;
50
51extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
52 u32 mem_type);
53extern unsigned long omap243x_sram_reprogram_sdrc_sz;
54
55extern u32 omap3_sram_configure_core_dpll(
56 u32 m2, u32 unlock_dll, u32 f, u32 inc,
57 u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
58 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
59 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
60 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
61extern unsigned long omap3_sram_configure_core_dpll_sz;
62
63#ifdef CONFIG_PM
64extern void omap_push_sram_idle(void);
65#else
66static inline void omap_push_sram_idle(void) {}
67#endif /* CONFIG_PM */
68
69#endif /* __ASSEMBLY__ */
70
71/*
72 * OMAP2+: define the SRAM PA addresses.
73 * Used by the SRAM management code and the idle sleep code.
74 */
75#define OMAP2_SRAM_PA 0x40200000
76#define OMAP3_SRAM_PA 0x40200000
77#ifdef CONFIG_OMAP4_ERRATA_I688
78#define OMAP4_SRAM_PA 0x40304000
79#define OMAP4_SRAM_VA 0xfe404000
80#else
81#define OMAP4_SRAM_PA 0x40300000
82#endif
83#define AM33XX_SRAM_PA 0x40300000
diff --git a/arch/arm/mach-omap2/sram242x.S b/arch/arm/mach-omap2/sram242x.S
index 8f7326cd435b..680a7c56cc3e 100644
--- a/arch/arm/mach-omap2/sram242x.S
+++ b/arch/arm/mach-omap2/sram242x.S
@@ -34,8 +34,8 @@
34 34
35#include "soc.h" 35#include "soc.h"
36#include "iomap.h" 36#include "iomap.h"
37#include "prm2xxx_3xxx.h" 37#include "prm2xxx.h"
38#include "cm2xxx_3xxx.h" 38#include "cm2xxx.h"
39#include "sdrc.h" 39#include "sdrc.h"
40 40
41 .text 41 .text
diff --git a/arch/arm/mach-omap2/sram243x.S b/arch/arm/mach-omap2/sram243x.S
index b140d6578529..a1e9edd673f4 100644
--- a/arch/arm/mach-omap2/sram243x.S
+++ b/arch/arm/mach-omap2/sram243x.S
@@ -34,8 +34,8 @@
34 34
35#include "soc.h" 35#include "soc.h"
36#include "iomap.h" 36#include "iomap.h"
37#include "prm2xxx_3xxx.h" 37#include "prm2xxx.h"
38#include "cm2xxx_3xxx.h" 38#include "cm2xxx.h"
39#include "sdrc.h" 39#include "sdrc.h"
40 40
41 .text 41 .text
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index 2d0ceaa23fb8..1446331b576a 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -32,7 +32,7 @@
32#include "soc.h" 32#include "soc.h"
33#include "iomap.h" 33#include "iomap.h"
34#include "sdrc.h" 34#include "sdrc.h"
35#include "cm2xxx_3xxx.h" 35#include "cm3xxx.h"
36 36
37/* 37/*
38 * This file needs be built unconditionally as ARM to interoperate correctly 38 * This file needs be built unconditionally as ARM to interoperate correctly
diff --git a/arch/arm/mach-omap2/ti81xx.h b/arch/arm/mach-omap2/ti81xx.h
index 8f9843f78422..a1e6caf0dba6 100644
--- a/arch/arm/mach-omap2/ti81xx.h
+++ b/arch/arm/mach-omap2/ti81xx.h
@@ -22,6 +22,15 @@
22#define TI81XX_CTRL_BASE TI81XX_SCM_BASE 22#define TI81XX_CTRL_BASE TI81XX_SCM_BASE
23#define TI81XX_PRCM_BASE 0x48180000 23#define TI81XX_PRCM_BASE 0x48180000
24 24
25/*
26 * Adjust TAP register base such that omap3_check_revision accesses the correct
27 * TI81XX register for checking device ID (it adds 0x204 to tap base while
28 * TI81XX DEVICE ID register is at offset 0x600 from control base).
29 */
30#define TI81XX_TAP_BASE (TI81XX_CTRL_BASE + \
31 TI81XX_CONTROL_DEVICE_ID - 0x204)
32
33
25#define TI81XX_ARM_INTC_BASE 0x48200000 34#define TI81XX_ARM_INTC_BASE 0x48200000
26 35
27#endif /* __ASM_ARCH_TI81XX_H */ 36#endif /* __ASM_ARCH_TI81XX_H */
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 69e46631a7cd..684d2fc3d485 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -37,16 +37,19 @@
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#include <linux/of.h>
40#include <linux/of_address.h>
41#include <linux/of_irq.h>
40 42
41#include <asm/mach/time.h> 43#include <asm/mach/time.h>
42#include <asm/smp_twd.h> 44#include <asm/smp_twd.h>
43#include <asm/sched_clock.h> 45#include <asm/sched_clock.h>
44 46
45#include <asm/arch_timer.h> 47#include <asm/arch_timer.h>
46#include <plat/omap_hwmod.h> 48#include "omap_hwmod.h"
47#include <plat/omap_device.h> 49#include "omap_device.h"
50#include <plat/counter-32k.h>
48#include <plat/dmtimer.h> 51#include <plat/dmtimer.h>
49#include <plat/omap-pm.h> 52#include "omap-pm.h"
50 53
51#include "soc.h" 54#include "soc.h"
52#include "common.h" 55#include "common.h"
@@ -66,11 +69,13 @@
66#define OMAP3_CLKEV_SOURCE OMAP3_32K_SOURCE 69#define OMAP3_CLKEV_SOURCE OMAP3_32K_SOURCE
67#define OMAP4_CLKEV_SOURCE OMAP4_32K_SOURCE 70#define OMAP4_CLKEV_SOURCE OMAP4_32K_SOURCE
68#define OMAP3_SECURE_TIMER 12 71#define OMAP3_SECURE_TIMER 12
72#define TIMER_PROP_SECURE "ti,timer-secure"
69#else 73#else
70#define OMAP2_CLKEV_SOURCE OMAP2_MPU_SOURCE 74#define OMAP2_CLKEV_SOURCE OMAP2_MPU_SOURCE
71#define OMAP3_CLKEV_SOURCE OMAP3_MPU_SOURCE 75#define OMAP3_CLKEV_SOURCE OMAP3_MPU_SOURCE
72#define OMAP4_CLKEV_SOURCE OMAP4_MPU_SOURCE 76#define OMAP4_CLKEV_SOURCE OMAP4_MPU_SOURCE
73#define OMAP3_SECURE_TIMER 1 77#define OMAP3_SECURE_TIMER 1
78#define TIMER_PROP_SECURE "ti,timer-alwon"
74#endif 79#endif
75 80
76#define REALTIME_COUNTER_BASE 0x48243200 81#define REALTIME_COUNTER_BASE 0x48243200
@@ -144,36 +149,141 @@ static struct clock_event_device clockevent_gpt = {
144 .set_mode = omap2_gp_timer_set_mode, 149 .set_mode = omap2_gp_timer_set_mode,
145}; 150};
146 151
152static struct property device_disabled = {
153 .name = "status",
154 .length = sizeof("disabled"),
155 .value = "disabled",
156};
157
158static struct of_device_id omap_timer_match[] __initdata = {
159 { .compatible = "ti,omap2-timer", },
160 { }
161};
162
163static struct of_device_id omap_counter_match[] __initdata = {
164 { .compatible = "ti,omap-counter32k", },
165 { }
166};
167
168/**
169 * omap_get_timer_dt - get a timer using device-tree
170 * @match - device-tree match structure for matching a device type
171 * @property - optional timer property to match
172 *
173 * Helper function to get a timer during early boot using device-tree for use
174 * as kernel system timer. Optionally, the property argument can be used to
175 * select a timer with a specific property. Once a timer is found then mark
176 * the timer node in device-tree as disabled, to prevent the kernel from
177 * registering this timer as a platform device and so no one else can use it.
178 */
179static struct device_node * __init omap_get_timer_dt(struct of_device_id *match,
180 const char *property)
181{
182 struct device_node *np;
183
184 for_each_matching_node(np, match) {
185 if (!of_device_is_available(np)) {
186 of_node_put(np);
187 continue;
188 }
189
190 if (property && !of_get_property(np, property, NULL)) {
191 of_node_put(np);
192 continue;
193 }
194
195 prom_add_property(np, &device_disabled);
196 return np;
197 }
198
199 return NULL;
200}
201
202/**
203 * omap_dmtimer_init - initialisation function when device tree is used
204 *
205 * For secure OMAP3 devices, timers with device type "timer-secure" cannot
206 * be used by the kernel as they are reserved. Therefore, to prevent the
207 * kernel registering these devices remove them dynamically from the device
208 * tree on boot.
209 */
210void __init omap_dmtimer_init(void)
211{
212 struct device_node *np;
213
214 if (!cpu_is_omap34xx())
215 return;
216
217 /* If we are a secure device, remove any secure timer nodes */
218 if ((omap_type() != OMAP2_DEVICE_TYPE_GP)) {
219 np = omap_get_timer_dt(omap_timer_match, "ti,timer-secure");
220 if (np)
221 of_node_put(np);
222 }
223}
224
147static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, 225static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
148 int gptimer_id, 226 int gptimer_id,
149 const char *fck_source) 227 const char *fck_source,
228 const char *property)
150{ 229{
151 char name[10]; /* 10 = sizeof("gptXX_Xck0") */ 230 char name[10]; /* 10 = sizeof("gptXX_Xck0") */
231 const char *oh_name;
232 struct device_node *np;
152 struct omap_hwmod *oh; 233 struct omap_hwmod *oh;
153 struct resource irq_rsrc, mem_rsrc; 234 struct resource irq_rsrc, mem_rsrc;
154 size_t size; 235 size_t size;
155 int res = 0; 236 int res = 0;
156 int r; 237 int r;
157 238
158 sprintf(name, "timer%d", gptimer_id); 239 if (of_have_populated_dt()) {
159 omap_hwmod_setup_one(name); 240 np = omap_get_timer_dt(omap_timer_match, NULL);
160 oh = omap_hwmod_lookup(name); 241 if (!np)
242 return -ENODEV;
243
244 of_property_read_string_index(np, "ti,hwmods", 0, &oh_name);
245 if (!oh_name)
246 return -ENODEV;
247
248 timer->irq = irq_of_parse_and_map(np, 0);
249 if (!timer->irq)
250 return -ENXIO;
251
252 timer->io_base = of_iomap(np, 0);
253
254 of_node_put(np);
255 } else {
256 if (omap_dm_timer_reserve_systimer(gptimer_id))
257 return -ENODEV;
258
259 sprintf(name, "timer%d", gptimer_id);
260 oh_name = name;
261 }
262
263 omap_hwmod_setup_one(oh_name);
264 oh = omap_hwmod_lookup(oh_name);
265
161 if (!oh) 266 if (!oh)
162 return -ENODEV; 267 return -ENODEV;
163 268
164 r = omap_hwmod_get_resource_byname(oh, IORESOURCE_IRQ, NULL, &irq_rsrc); 269 if (!of_have_populated_dt()) {
165 if (r) 270 r = omap_hwmod_get_resource_byname(oh, IORESOURCE_IRQ, NULL,
166 return -ENXIO; 271 &irq_rsrc);
167 timer->irq = irq_rsrc.start; 272 if (r)
168 273 return -ENXIO;
169 r = omap_hwmod_get_resource_byname(oh, IORESOURCE_MEM, NULL, &mem_rsrc); 274 timer->irq = irq_rsrc.start;
170 if (r) 275
171 return -ENXIO; 276 r = omap_hwmod_get_resource_byname(oh, IORESOURCE_MEM, NULL,
172 timer->phys_base = mem_rsrc.start; 277 &mem_rsrc);
173 size = mem_rsrc.end - mem_rsrc.start; 278 if (r)
279 return -ENXIO;
280 timer->phys_base = mem_rsrc.start;
281 size = mem_rsrc.end - mem_rsrc.start;
282
283 /* Static mapping, never released */
284 timer->io_base = ioremap(timer->phys_base, size);
285 }
174 286
175 /* Static mapping, never released */
176 timer->io_base = ioremap(timer->phys_base, size);
177 if (!timer->io_base) 287 if (!timer->io_base)
178 return -ENXIO; 288 return -ENXIO;
179 289
@@ -184,9 +294,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
184 294
185 omap_hwmod_enable(oh); 295 omap_hwmod_enable(oh);
186 296
187 if (omap_dm_timer_reserve_systimer(gptimer_id)) 297 /* FIXME: Need to remove hard-coded test on timer ID */
188 return -ENODEV;
189
190 if (gptimer_id != 12) { 298 if (gptimer_id != 12) {
191 struct clk *src; 299 struct clk *src;
192 300
@@ -196,8 +304,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
196 } else { 304 } else {
197 res = __omap_dm_timer_set_source(timer->fclk, src); 305 res = __omap_dm_timer_set_source(timer->fclk, src);
198 if (IS_ERR_VALUE(res)) 306 if (IS_ERR_VALUE(res))
199 pr_warning("%s: timer%i cannot set source\n", 307 pr_warn("%s: %s cannot set source\n",
200 __func__, gptimer_id); 308 __func__, oh->name);
201 clk_put(src); 309 clk_put(src);
202 } 310 }
203 } 311 }
@@ -213,11 +321,12 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
213} 321}
214 322
215static void __init omap2_gp_clockevent_init(int gptimer_id, 323static void __init omap2_gp_clockevent_init(int gptimer_id,
216 const char *fck_source) 324 const char *fck_source,
325 const char *property)
217{ 326{
218 int res; 327 int res;
219 328
220 res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source); 329 res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source, property);
221 BUG_ON(res); 330 BUG_ON(res);
222 331
223 omap2_gp_timer_irq.dev_id = &clkev; 332 omap2_gp_timer_irq.dev_id = &clkev;
@@ -274,11 +383,26 @@ static u32 notrace dmtimer_read_sched_clock(void)
274static int __init omap2_sync32k_clocksource_init(void) 383static int __init omap2_sync32k_clocksource_init(void)
275{ 384{
276 int ret; 385 int ret;
386 struct device_node *np = NULL;
277 struct omap_hwmod *oh; 387 struct omap_hwmod *oh;
278 void __iomem *vbase; 388 void __iomem *vbase;
279 const char *oh_name = "counter_32k"; 389 const char *oh_name = "counter_32k";
280 390
281 /* 391 /*
392 * If device-tree is present, then search the DT blob
393 * to see if the 32kHz counter is supported.
394 */
395 if (of_have_populated_dt()) {
396 np = omap_get_timer_dt(omap_counter_match, NULL);
397 if (!np)
398 return -ENODEV;
399
400 of_property_read_string_index(np, "ti,hwmods", 0, &oh_name);
401 if (!oh_name)
402 return -ENODEV;
403 }
404
405 /*
282 * First check hwmod data is available for sync32k counter 406 * First check hwmod data is available for sync32k counter
283 */ 407 */
284 oh = omap_hwmod_lookup(oh_name); 408 oh = omap_hwmod_lookup(oh_name);
@@ -287,7 +411,13 @@ static int __init omap2_sync32k_clocksource_init(void)
287 411
288 omap_hwmod_setup_one(oh_name); 412 omap_hwmod_setup_one(oh_name);
289 413
290 vbase = omap_hwmod_get_mpu_rt_va(oh); 414 if (np) {
415 vbase = of_iomap(np, 0);
416 of_node_put(np);
417 } else {
418 vbase = omap_hwmod_get_mpu_rt_va(oh);
419 }
420
291 if (!vbase) { 421 if (!vbase) {
292 pr_warn("%s: failed to get counter_32k resource\n", __func__); 422 pr_warn("%s: failed to get counter_32k resource\n", __func__);
293 return -ENXIO; 423 return -ENXIO;
@@ -321,7 +451,7 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
321{ 451{
322 int res; 452 int res;
323 453
324 res = omap_dm_timer_init_one(&clksrc, gptimer_id, fck_source); 454 res = omap_dm_timer_init_one(&clksrc, gptimer_id, fck_source, NULL);
325 BUG_ON(res); 455 BUG_ON(res);
326 456
327 __omap_dm_timer_load_start(&clksrc, 457 __omap_dm_timer_load_start(&clksrc,
@@ -433,11 +563,12 @@ static inline void __init realtime_counter_init(void)
433{} 563{}
434#endif 564#endif
435 565
436#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src, \ 566#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
437 clksrc_nr, clksrc_src) \ 567 clksrc_nr, clksrc_src) \
438static void __init omap##name##_timer_init(void) \ 568static void __init omap##name##_timer_init(void) \
439{ \ 569{ \
440 omap2_gp_clockevent_init((clkev_nr), clkev_src); \ 570 omap_dmtimer_init(); \
571 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
441 omap2_clocksource_init((clksrc_nr), clksrc_src); \ 572 omap2_clocksource_init((clksrc_nr), clksrc_src); \
442} 573}
443 574
@@ -447,20 +578,23 @@ struct sys_timer omap##name##_timer = { \
447}; 578};
448 579
449#ifdef CONFIG_ARCH_OMAP2 580#ifdef CONFIG_ARCH_OMAP2
450OMAP_SYS_TIMER_INIT(2, 1, OMAP2_CLKEV_SOURCE, 2, OMAP2_MPU_SOURCE) 581OMAP_SYS_TIMER_INIT(2, 1, OMAP2_CLKEV_SOURCE, "ti,timer-alwon",
582 2, OMAP2_MPU_SOURCE)
451OMAP_SYS_TIMER(2) 583OMAP_SYS_TIMER(2)
452#endif 584#endif
453 585
454#ifdef CONFIG_ARCH_OMAP3 586#ifdef CONFIG_ARCH_OMAP3
455OMAP_SYS_TIMER_INIT(3, 1, OMAP3_CLKEV_SOURCE, 2, OMAP3_MPU_SOURCE) 587OMAP_SYS_TIMER_INIT(3, 1, OMAP3_CLKEV_SOURCE, "ti,timer-alwon",
588 2, OMAP3_MPU_SOURCE)
456OMAP_SYS_TIMER(3) 589OMAP_SYS_TIMER(3)
457OMAP_SYS_TIMER_INIT(3_secure, OMAP3_SECURE_TIMER, OMAP3_CLKEV_SOURCE, 590OMAP_SYS_TIMER_INIT(3_secure, OMAP3_SECURE_TIMER, OMAP3_CLKEV_SOURCE,
458 2, OMAP3_MPU_SOURCE) 591 TIMER_PROP_SECURE, 2, OMAP3_MPU_SOURCE)
459OMAP_SYS_TIMER(3_secure) 592OMAP_SYS_TIMER(3_secure)
460#endif 593#endif
461 594
462#ifdef CONFIG_SOC_AM33XX 595#ifdef CONFIG_SOC_AM33XX
463OMAP_SYS_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, 2, OMAP4_MPU_SOURCE) 596OMAP_SYS_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon",
597 2, OMAP4_MPU_SOURCE)
464OMAP_SYS_TIMER(3_am33xx) 598OMAP_SYS_TIMER(3_am33xx)
465#endif 599#endif
466 600
@@ -472,7 +606,7 @@ static DEFINE_TWD_LOCAL_TIMER(twd_local_timer,
472 606
473static void __init omap4_timer_init(void) 607static void __init omap4_timer_init(void)
474{ 608{
475 omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE); 609 omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE, "ti,timer-alwon");
476 omap2_clocksource_init(2, OMAP4_MPU_SOURCE); 610 omap2_clocksource_init(2, OMAP4_MPU_SOURCE);
477#ifdef CONFIG_LOCAL_TIMERS 611#ifdef CONFIG_LOCAL_TIMERS
478 /* Local timers are not supprted on OMAP4430 ES1.0 */ 612 /* Local timers are not supprted on OMAP4430 ES1.0 */
@@ -498,7 +632,7 @@ static void __init omap5_timer_init(void)
498{ 632{
499 int err; 633 int err;
500 634
501 omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE); 635 omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE, "ti,timer-alwon");
502 omap2_clocksource_init(2, OMAP4_MPU_SOURCE); 636 omap2_clocksource_init(2, OMAP4_MPU_SOURCE);
503 realtime_counter_init(); 637 realtime_counter_init();
504 638
@@ -559,6 +693,8 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
559 if (timer_dev_attr) 693 if (timer_dev_attr)
560 pdata->timer_capability = timer_dev_attr->timer_capability; 694 pdata->timer_capability = timer_dev_attr->timer_capability;
561 695
696 pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
697
562 pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata), 698 pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
563 NULL, 0, 0); 699 NULL, 0, 0);
564 700
@@ -583,6 +719,10 @@ static int __init omap2_dm_timer_init(void)
583{ 719{
584 int ret; 720 int ret;
585 721
722 /* If dtb is there, the devices will be created dynamically */
723 if (of_have_populated_dt())
724 return -ENODEV;
725
586 ret = omap_hwmod_for_each_by_class("timer", omap_timer_init, NULL); 726 ret = omap_hwmod_for_each_by_class("timer", omap_timer_init, NULL);
587 if (unlikely(ret)) { 727 if (unlikely(ret)) {
588 pr_err("%s: device registration failed.\n", __func__); 728 pr_err("%s: device registration failed.\n", __func__);
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 44c42057b61c..3fa2bdb44106 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -26,9 +26,6 @@
26#include <linux/regulator/machine.h> 26#include <linux/regulator/machine.h>
27#include <linux/regulator/fixed.h> 27#include <linux/regulator/fixed.h>
28 28
29#include <plat/i2c.h>
30#include <plat/usb.h>
31
32#include "soc.h" 29#include "soc.h"
33#include "twl-common.h" 30#include "twl-common.h"
34#include "pm.h" 31#include "pm.h"
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 3c434498e12e..d1dbe125b34f 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -25,10 +25,10 @@
25 25
26#include <asm/io.h> 26#include <asm/io.h>
27 27
28#include <plat/usb.h> 28#include "soc.h"
29#include <plat/omap_device.h> 29#include "omap_device.h"
30
31#include "mux.h" 30#include "mux.h"
31#include "usb.h"
32 32
33#ifdef CONFIG_MFD_OMAP_USB_HOST 33#ifdef CONFIG_MFD_OMAP_USB_HOST
34 34
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 51da21cb78f1..7b33b375fe77 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -25,12 +25,10 @@
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/usb/musb.h> 26#include <linux/usb/musb.h>
27 27
28#include <plat/usb.h> 28#include "omap_device.h"
29#include <plat/omap_device.h> 29#include "soc.h"
30
31#include "am35xx.h"
32
33#include "mux.h" 30#include "mux.h"
31#include "usb.h"
34 32
35static struct musb_hdrc_config musb_config = { 33static struct musb_hdrc_config musb_config = {
36 .multipoint = 1, 34 .multipoint = 1,
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
index 805bea6edf17..a8795ff19e6d 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -15,10 +15,11 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/export.h> 17#include <linux/export.h>
18#include <linux/platform_data/usb-omap.h>
18 19
19#include <linux/usb/musb.h> 20#include <linux/usb/musb.h>
20 21
21#include <plat/gpmc.h> 22#include "gpmc.h"
22 23
23#include "mux.h" 24#include "mux.h"
24 25
diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
new file mode 100644
index 000000000000..9b986ead7c45
--- /dev/null
+++ b/arch/arm/mach-omap2/usb.h
@@ -0,0 +1,82 @@
1#include <linux/platform_data/usb-omap.h>
2
3/* AM35x */
4/* USB 2.0 PHY Control */
5#define CONF2_PHY_GPIOMODE (1 << 23)
6#define CONF2_OTGMODE (3 << 14)
7#define CONF2_NO_OVERRIDE (0 << 14)
8#define CONF2_FORCE_HOST (1 << 14)
9#define CONF2_FORCE_DEVICE (2 << 14)
10#define CONF2_FORCE_HOST_VBUS_LOW (3 << 14)
11#define CONF2_SESENDEN (1 << 13)
12#define CONF2_VBDTCTEN (1 << 12)
13#define CONF2_REFFREQ_24MHZ (2 << 8)
14#define CONF2_REFFREQ_26MHZ (7 << 8)
15#define CONF2_REFFREQ_13MHZ (6 << 8)
16#define CONF2_REFFREQ (0xf << 8)
17#define CONF2_PHYCLKGD (1 << 7)
18#define CONF2_VBUSSENSE (1 << 6)
19#define CONF2_PHY_PLLON (1 << 5)
20#define CONF2_RESET (1 << 4)
21#define CONF2_PHYPWRDN (1 << 3)
22#define CONF2_OTGPWRDN (1 << 2)
23#define CONF2_DATPOL (1 << 1)
24
25/* TI81XX specific definitions */
26#define USBCTRL0 0x620
27#define USBSTAT0 0x624
28
29/* TI816X PHY controls bits */
30#define TI816X_USBPHY0_NORMAL_MODE (1 << 0)
31#define TI816X_USBPHY_REFCLK_OSC (1 << 8)
32
33/* TI814X PHY controls bits */
34#define USBPHY_CM_PWRDN (1 << 0)
35#define USBPHY_OTG_PWRDN (1 << 1)
36#define USBPHY_CHGDET_DIS (1 << 2)
37#define USBPHY_CHGDET_RSTRT (1 << 3)
38#define USBPHY_SRCONDM (1 << 4)
39#define USBPHY_SINKONDP (1 << 5)
40#define USBPHY_CHGISINK_EN (1 << 6)
41#define USBPHY_CHGVSRC_EN (1 << 7)
42#define USBPHY_DMPULLUP (1 << 8)
43#define USBPHY_DPPULLUP (1 << 9)
44#define USBPHY_CDET_EXTCTL (1 << 10)
45#define USBPHY_GPIO_MODE (1 << 12)
46#define USBPHY_DPOPBUFCTL (1 << 13)
47#define USBPHY_DMOPBUFCTL (1 << 14)
48#define USBPHY_DPINPUT (1 << 15)
49#define USBPHY_DMINPUT (1 << 16)
50#define USBPHY_DPGPIO_PD (1 << 17)
51#define USBPHY_DMGPIO_PD (1 << 18)
52#define USBPHY_OTGVDET_EN (1 << 19)
53#define USBPHY_OTGSESSEND_EN (1 << 20)
54#define USBPHY_DATA_POLARITY (1 << 23)
55
56struct usbhs_omap_board_data {
57 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
58
59 /* have to be valid if phy_reset is true and portx is in phy mode */
60 int reset_gpio_port[OMAP3_HS_USB_PORTS];
61
62 /* Set this to true for ES2.x silicon */
63 unsigned es2_compatibility:1;
64
65 unsigned phy_reset:1;
66
67 /*
68 * Regulators for USB PHYs.
69 * Each PHY can have a separate regulator.
70 */
71 struct regulator *regulator[OMAP3_HS_USB_PORTS];
72};
73
74extern void usb_musb_init(struct omap_musb_board_data *board_data);
75extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
76
77extern void am35x_musb_reset(void);
78extern void am35x_musb_phy_power(u8 on);
79extern void am35x_musb_clear_irq(void);
80extern void am35x_set_mode(u8 musb_mode);
81extern void ti81xx_musb_phy_power(u8 on);
82
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c
index b2f1c67043a2..7c2b4ed38f02 100644
--- a/arch/arm/mach-omap2/wd_timer.c
+++ b/arch/arm/mach-omap2/wd_timer.c
@@ -1,6 +1,8 @@
1/* 1/*
2 * OMAP2+ MPU WD_TIMER-specific code 2 * OMAP2+ MPU WD_TIMER-specific code
3 * 3 *
4 * Copyright (C) 2012 Texas Instruments, Inc.
5 *
4 * 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
5 * 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
6 * the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
@@ -11,10 +13,14 @@
11#include <linux/io.h> 13#include <linux/io.h>
12#include <linux/err.h> 14#include <linux/err.h>
13 15
14#include <plat/omap_hwmod.h> 16#include <linux/platform_data/omap-wd-timer.h>
15 17
18#include "omap_hwmod.h"
19#include "omap_device.h"
16#include "wd_timer.h" 20#include "wd_timer.h"
17#include "common.h" 21#include "common.h"
22#include "prm.h"
23#include "soc.h"
18 24
19/* 25/*
20 * In order to avoid any assumptions from bootloader regarding WDT 26 * In order to avoid any assumptions from bootloader regarding WDT
@@ -26,9 +32,6 @@
26#define OMAP_WDT_WPS 0x34 32#define OMAP_WDT_WPS 0x34
27#define OMAP_WDT_SPR 0x48 33#define OMAP_WDT_SPR 0x48
28 34
29/* Maximum microseconds to wait for OMAP module to softreset */
30#define MAX_MODULE_SOFTRESET_WAIT 10000
31
32int omap2_wd_timer_disable(struct omap_hwmod *oh) 35int omap2_wd_timer_disable(struct omap_hwmod *oh)
33{ 36{
34 void __iomem *base; 37 void __iomem *base;
@@ -99,3 +102,32 @@ int omap2_wd_timer_reset(struct omap_hwmod *oh)
99 return (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 102 return (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT :
100 omap2_wd_timer_disable(oh); 103 omap2_wd_timer_disable(oh);
101} 104}
105
106static int __init omap_init_wdt(void)
107{
108 int id = -1;
109 struct platform_device *pdev;
110 struct omap_hwmod *oh;
111 char *oh_name = "wd_timer2";
112 char *dev_name = "omap_wdt";
113 struct omap_wd_timer_platform_data pdata;
114
115 if (!cpu_class_is_omap2() || of_have_populated_dt())
116 return 0;
117
118 oh = omap_hwmod_lookup(oh_name);
119 if (!oh) {
120 pr_err("Could not look up wd_timer%d hwmod\n", id);
121 return -EINVAL;
122 }
123
124 pdata.read_reset_sources = prm_read_reset_sources;
125
126 pdev = omap_device_build(dev_name, id, oh, &pdata,
127 sizeof(struct omap_wd_timer_platform_data),
128 NULL, 0, 0);
129 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
130 dev_name, oh->name);
131 return 0;
132}
133subsys_initcall(omap_init_wdt);
diff --git a/arch/arm/mach-omap2/wd_timer.h b/arch/arm/mach-omap2/wd_timer.h
index f6bbba73b535..a78f81034a9f 100644
--- a/arch/arm/mach-omap2/wd_timer.h
+++ b/arch/arm/mach-omap2/wd_timer.h
@@ -10,7 +10,7 @@
10#ifndef __ARCH_ARM_MACH_OMAP2_WD_TIMER_H 10#ifndef __ARCH_ARM_MACH_OMAP2_WD_TIMER_H
11#define __ARCH_ARM_MACH_OMAP2_WD_TIMER_H 11#define __ARCH_ARM_MACH_OMAP2_WD_TIMER_H
12 12
13#include <plat/omap_hwmod.h> 13#include "omap_hwmod.h"
14 14
15extern int omap2_wd_timer_disable(struct omap_hwmod *oh); 15extern int omap2_wd_timer_disable(struct omap_hwmod *oh);
16extern int omap2_wd_timer_reset(struct omap_hwmod *oh); 16extern int omap2_wd_timer_reset(struct omap_hwmod *oh);
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 9aa653b3eb32..6cc23cc83509 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -12,10 +12,12 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o
12obj-$(CONFIG_CPU_IDLE) += sleep.o 12obj-$(CONFIG_CPU_IDLE) += sleep.o
13obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks.o 13obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks.o
14obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks_data.o 14obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_clocks_data.o
15obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_speedo.o
15obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o 16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o
16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-t20.o 17obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-t20.o
17obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o 18obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks.o
18obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks_data.o 19obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_clocks_data.o
20obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30_speedo.o
19obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-t30.o 21obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-t30.o
20obj-$(CONFIG_SMP) += platsmp.o headsmp.o 22obj-$(CONFIG_SMP) += platsmp.o headsmp.o
21obj-$(CONFIG_SMP) += reset.o 23obj-$(CONFIG_SMP) += reset.o
diff --git a/arch/arm/mach-tegra/apbio.c b/arch/arm/mach-tegra/apbio.c
index b5015d0f1912..d091675ba376 100644
--- a/arch/arm/mach-tegra/apbio.c
+++ b/arch/arm/mach-tegra/apbio.c
@@ -15,7 +15,6 @@
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <mach/iomap.h>
19#include <linux/of.h> 18#include <linux/of.h>
20#include <linux/dmaengine.h> 19#include <linux/dmaengine.h>
21#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
@@ -24,9 +23,8 @@
24#include <linux/sched.h> 23#include <linux/sched.h>
25#include <linux/mutex.h> 24#include <linux/mutex.h>
26 25
27#include <mach/dma.h>
28
29#include "apbio.h" 26#include "apbio.h"
27#include "iomap.h"
30 28
31#if defined(CONFIG_TEGRA20_APB_DMA) 29#if defined(CONFIG_TEGRA20_APB_DMA)
32static DEFINE_MUTEX(tegra_apb_dma_lock); 30static DEFINE_MUTEX(tegra_apb_dma_lock);
@@ -71,7 +69,6 @@ bool tegra_apb_dma_init(void)
71 69
72 dma_sconfig.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 70 dma_sconfig.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
73 dma_sconfig.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 71 dma_sconfig.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
74 dma_sconfig.slave_id = TEGRA_DMA_REQ_SEL_CNTR;
75 dma_sconfig.src_maxburst = 1; 72 dma_sconfig.src_maxburst = 1;
76 dma_sconfig.dst_maxburst = 1; 73 dma_sconfig.dst_maxburst = 1;
77 74
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index aa5325cd1c42..734d9cc87f2e 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -40,12 +40,10 @@
40#include <asm/mach/time.h> 40#include <asm/mach/time.h>
41#include <asm/setup.h> 41#include <asm/setup.h>
42 42
43#include <mach/iomap.h>
44#include <mach/irqs.h>
45
46#include "board.h" 43#include "board.h"
47#include "clock.h" 44#include "clock.h"
48#include "common.h" 45#include "common.h"
46#include "iomap.h"
49 47
50struct tegra_ehci_platform_data tegra_ehci1_pdata = { 48struct tegra_ehci_platform_data tegra_ehci1_pdata = {
51 .operating_mode = TEGRA_USB_OTG, 49 .operating_mode = TEGRA_USB_OTG,
@@ -91,6 +89,17 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
91 &tegra_ehci3_pdata), 89 &tegra_ehci3_pdata),
92 OF_DEV_AUXDATA("nvidia,tegra20-apbdma", TEGRA_APB_DMA_BASE, "tegra-apbdma", NULL), 90 OF_DEV_AUXDATA("nvidia,tegra20-apbdma", TEGRA_APB_DMA_BASE, "tegra-apbdma", NULL),
93 OF_DEV_AUXDATA("nvidia,tegra20-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL), 91 OF_DEV_AUXDATA("nvidia,tegra20-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL),
92 OF_DEV_AUXDATA("nvidia,tegra20-sflash", 0x7000c380, "spi", NULL),
93 OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000D400, "spi_tegra.0", NULL),
94 OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000D600, "spi_tegra.1", NULL),
95 OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000D800, "spi_tegra.2", NULL),
96 OF_DEV_AUXDATA("nvidia,tegra20-slink", 0x7000DA00, "spi_tegra.3", NULL),
97 OF_DEV_AUXDATA("nvidia,tegra20-host1x", 0x50000000, "host1x", NULL),
98 OF_DEV_AUXDATA("nvidia,tegra20-dc", 0x54200000, "tegradc.0", NULL),
99 OF_DEV_AUXDATA("nvidia,tegra20-dc", 0x54240000, "tegradc.1", NULL),
100 OF_DEV_AUXDATA("nvidia,tegra20-hdmi", 0x54280000, "hdmi", NULL),
101 OF_DEV_AUXDATA("nvidia,tegra20-dsi", 0x54300000, "dsi", NULL),
102 OF_DEV_AUXDATA("nvidia,tegra20-tvo", 0x542c0000, "tvo", NULL),
94 {} 103 {}
95}; 104};
96 105
@@ -104,8 +113,20 @@ static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
104 { "pll_a", "pll_p_out1", 56448000, true }, 113 { "pll_a", "pll_p_out1", 56448000, true },
105 { "pll_a_out0", "pll_a", 11289600, true }, 114 { "pll_a_out0", "pll_a", 11289600, true },
106 { "cdev1", NULL, 0, true }, 115 { "cdev1", NULL, 0, true },
116 { "blink", "clk_32k", 32768, true },
107 { "i2s1", "pll_a_out0", 11289600, false}, 117 { "i2s1", "pll_a_out0", 11289600, false},
108 { "i2s2", "pll_a_out0", 11289600, false}, 118 { "i2s2", "pll_a_out0", 11289600, false},
119 { "sdmmc1", "pll_p", 48000000, false},
120 { "sdmmc3", "pll_p", 48000000, false},
121 { "sdmmc4", "pll_p", 48000000, false},
122 { "spi", "pll_p", 20000000, false },
123 { "sbc1", "pll_p", 100000000, false },
124 { "sbc2", "pll_p", 100000000, false },
125 { "sbc3", "pll_p", 100000000, false },
126 { "sbc4", "pll_p", 100000000, false },
127 { "host1x", "pll_c", 150000000, false },
128 { "disp1", "pll_p", 600000000, false },
129 { "disp2", "pll_p", 600000000, false },
109 { NULL, NULL, 0, 0}, 130 { NULL, NULL, 0, 0},
110}; 131};
111 132
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 5e92a81f9a2e..6497d1236b08 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -33,11 +33,10 @@
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/hardware/gic.h> 34#include <asm/hardware/gic.h>
35 35
36#include <mach/iomap.h>
37
38#include "board.h" 36#include "board.h"
39#include "clock.h" 37#include "clock.h"
40#include "common.h" 38#include "common.h"
39#include "iomap.h"
41 40
42struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = { 41struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
43 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", 0x78000000, "sdhci-tegra.0", NULL), 42 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", 0x78000000, "sdhci-tegra.0", NULL),
@@ -52,6 +51,18 @@ struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
52 OF_DEV_AUXDATA("nvidia,tegra30-ahub", 0x70080000, "tegra30-ahub", NULL), 51 OF_DEV_AUXDATA("nvidia,tegra30-ahub", 0x70080000, "tegra30-ahub", NULL),
53 OF_DEV_AUXDATA("nvidia,tegra30-apbdma", 0x6000a000, "tegra-apbdma", NULL), 52 OF_DEV_AUXDATA("nvidia,tegra30-apbdma", 0x6000a000, "tegra-apbdma", NULL),
54 OF_DEV_AUXDATA("nvidia,tegra30-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL), 53 OF_DEV_AUXDATA("nvidia,tegra30-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL),
54 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000D400, "spi_tegra.0", NULL),
55 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000D600, "spi_tegra.1", NULL),
56 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000D800, "spi_tegra.2", NULL),
57 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000DA00, "spi_tegra.3", NULL),
58 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000DC00, "spi_tegra.4", NULL),
59 OF_DEV_AUXDATA("nvidia,tegra30-slink", 0x7000DE00, "spi_tegra.5", NULL),
60 OF_DEV_AUXDATA("nvidia,tegra30-host1x", 0x50000000, "host1x", NULL),
61 OF_DEV_AUXDATA("nvidia,tegra30-dc", 0x54200000, "tegradc.0", NULL),
62 OF_DEV_AUXDATA("nvidia,tegra30-dc", 0x54240000, "tegradc.1", NULL),
63 OF_DEV_AUXDATA("nvidia,tegra30-hdmi", 0x54280000, "hdmi", NULL),
64 OF_DEV_AUXDATA("nvidia,tegra30-dsi", 0x54300000, "dsi", NULL),
65 OF_DEV_AUXDATA("nvidia,tegra30-tvo", 0x542c0000, "tvo", NULL),
55 {} 66 {}
56}; 67};
57 68
@@ -62,11 +73,24 @@ static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
62 { "pll_a_out0", "pll_a", 11289600, true }, 73 { "pll_a_out0", "pll_a", 11289600, true },
63 { "extern1", "pll_a_out0", 0, true }, 74 { "extern1", "pll_a_out0", 0, true },
64 { "clk_out_1", "extern1", 0, true }, 75 { "clk_out_1", "extern1", 0, true },
76 { "blink", "clk_32k", 32768, true },
65 { "i2s0", "pll_a_out0", 11289600, false}, 77 { "i2s0", "pll_a_out0", 11289600, false},
66 { "i2s1", "pll_a_out0", 11289600, false}, 78 { "i2s1", "pll_a_out0", 11289600, false},
67 { "i2s2", "pll_a_out0", 11289600, false}, 79 { "i2s2", "pll_a_out0", 11289600, false},
68 { "i2s3", "pll_a_out0", 11289600, false}, 80 { "i2s3", "pll_a_out0", 11289600, false},
69 { "i2s4", "pll_a_out0", 11289600, false}, 81 { "i2s4", "pll_a_out0", 11289600, false},
82 { "sdmmc1", "pll_p", 48000000, false},
83 { "sdmmc3", "pll_p", 48000000, false},
84 { "sdmmc4", "pll_p", 48000000, false},
85 { "sbc1", "pll_p", 100000000, false},
86 { "sbc2", "pll_p", 100000000, false},
87 { "sbc3", "pll_p", 100000000, false},
88 { "sbc4", "pll_p", 100000000, false},
89 { "sbc5", "pll_p", 100000000, false},
90 { "sbc6", "pll_p", 100000000, false},
91 { "host1x", "pll_c", 150000000, false},
92 { "disp1", "pll_p", 600000000, false},
93 { "disp2", "pll_p", 600000000, false},
70 { NULL, NULL, 0, 0}, 94 { NULL, NULL, 0, 0},
71}; 95};
72 96
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index fd82085eca5d..867bf8bf5561 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -27,8 +27,6 @@
27#include <linux/seq_file.h> 27#include <linux/seq_file.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29 29
30#include <mach/clk.h>
31
32#include "board.h" 30#include "board.h"
33#include "clock.h" 31#include "clock.h"
34#include "tegra_cpu_car.h" 32#include "tegra_cpu_car.h"
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 0b0a5f556d34..3e03e5f15c14 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -26,13 +26,13 @@
26#include <asm/hardware/cache-l2x0.h> 26#include <asm/hardware/cache-l2x0.h>
27#include <asm/hardware/gic.h> 27#include <asm/hardware/gic.h>
28 28
29#include <mach/iomap.h>
30#include <mach/powergate.h> 29#include <mach/powergate.h>
31 30
32#include "board.h" 31#include "board.h"
33#include "clock.h" 32#include "clock.h"
34#include "common.h" 33#include "common.h"
35#include "fuse.h" 34#include "fuse.h"
35#include "iomap.h"
36#include "pmc.h" 36#include "pmc.h"
37#include "apbio.h" 37#include "apbio.h"
38#include "sleep.h" 38#include "sleep.h"
@@ -104,25 +104,26 @@ static __initdata struct tegra_clk_init_table tegra30_clk_init_table[] = {
104 { "clk_m", NULL, 0, true }, 104 { "clk_m", NULL, 0, true },
105 { "pll_p", "clk_m", 408000000, true }, 105 { "pll_p", "clk_m", 408000000, true },
106 { "pll_p_out1", "pll_p", 9600000, true }, 106 { "pll_p_out1", "pll_p", 9600000, true },
107 { "pll_p_out4", "pll_p", 102000000, true },
108 { "sclk", "pll_p_out4", 102000000, true },
109 { "hclk", "sclk", 102000000, true },
110 { "pclk", "hclk", 51000000, true },
107 { NULL, NULL, 0, 0}, 111 { NULL, NULL, 0, 0},
108}; 112};
109#endif 113#endif
110 114
111 115
112static void __init tegra_init_cache(u32 tag_latency, u32 data_latency) 116static void __init tegra_init_cache(void)
113{ 117{
114#ifdef CONFIG_CACHE_L2X0 118#ifdef CONFIG_CACHE_L2X0
115 void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000; 119 void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000;
116 u32 aux_ctrl, cache_type; 120 u32 aux_ctrl, cache_type;
117 121
118 writel_relaxed(tag_latency, p + L2X0_TAG_LATENCY_CTRL);
119 writel_relaxed(data_latency, p + L2X0_DATA_LATENCY_CTRL);
120
121 cache_type = readl(p + L2X0_CACHE_TYPE); 122 cache_type = readl(p + L2X0_CACHE_TYPE);
122 aux_ctrl = (cache_type & 0x700) << (17-8); 123 aux_ctrl = (cache_type & 0x700) << (17-8);
123 aux_ctrl |= 0x6C000001; 124 aux_ctrl |= 0x7C400001;
124 125
125 l2x0_init(p, aux_ctrl, 0x8200c3fe); 126 l2x0_of_init(aux_ctrl, 0x8200c3fe);
126#endif 127#endif
127 128
128} 129}
@@ -134,7 +135,7 @@ void __init tegra20_init_early(void)
134 tegra_init_fuse(); 135 tegra_init_fuse();
135 tegra2_init_clocks(); 136 tegra2_init_clocks();
136 tegra_clk_init_from_table(tegra20_clk_init_table); 137 tegra_clk_init_from_table(tegra20_clk_init_table);
137 tegra_init_cache(0x331, 0x441); 138 tegra_init_cache();
138 tegra_pmc_init(); 139 tegra_pmc_init();
139 tegra_powergate_init(); 140 tegra_powergate_init();
140 tegra20_hotplug_init(); 141 tegra20_hotplug_init();
@@ -147,7 +148,7 @@ void __init tegra30_init_early(void)
147 tegra_init_fuse(); 148 tegra_init_fuse();
148 tegra30_init_clocks(); 149 tegra30_init_clocks();
149 tegra_clk_init_from_table(tegra30_clk_init_table); 150 tegra_clk_init_from_table(tegra30_clk_init_table);
150 tegra_init_cache(0x441, 0x551); 151 tegra_init_cache();
151 tegra_pmc_init(); 152 tegra_pmc_init();
152 tegra_powergate_init(); 153 tegra_powergate_init();
153 tegra30_hotplug_init(); 154 tegra30_hotplug_init();
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index 627bf0f4262e..a74d3c7d2e26 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -30,9 +30,6 @@
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/suspend.h> 31#include <linux/suspend.h>
32 32
33
34#include <mach/clk.h>
35
36/* Frequency table index must be sequential starting at 0 */ 33/* Frequency table index must be sequential starting at 0 */
37static struct cpufreq_frequency_table freq_table[] = { 34static struct cpufreq_frequency_table freq_table[] = {
38 { 0, 216000 }, 35 { 0, 216000 },
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index 566e2f88899b..9a6f051b382e 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -29,8 +29,6 @@
29 29
30#include <asm/proc-fns.h> 30#include <asm/proc-fns.h>
31 31
32#include <mach/iomap.h>
33
34static int tegra_idle_enter_lp3(struct cpuidle_device *dev, 32static int tegra_idle_enter_lp3(struct cpuidle_device *dev,
35 struct cpuidle_driver *drv, int index); 33 struct cpuidle_driver *drv, int index);
36 34
diff --git a/arch/arm/mach-tegra/flowctrl.c b/arch/arm/mach-tegra/flowctrl.c
index f07488e0bd32..ffaa286a71e1 100644
--- a/arch/arm/mach-tegra/flowctrl.c
+++ b/arch/arm/mach-tegra/flowctrl.c
@@ -22,9 +22,8 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <mach/iomap.h>
26
27#include "flowctrl.h" 25#include "flowctrl.h"
26#include "iomap.h"
28 27
29u8 flowctrl_offset_halt_cpu[] = { 28u8 flowctrl_offset_halt_cpu[] = {
30 FLOW_CTRL_HALT_CPU0_EVENTS, 29 FLOW_CTRL_HALT_CPU0_EVENTS,
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
index 0b7db174a5de..8121742711fe 100644
--- a/arch/arm/mach-tegra/fuse.c
+++ b/arch/arm/mach-tegra/fuse.c
@@ -21,22 +21,28 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/export.h> 22#include <linux/export.h>
23 23
24#include <mach/iomap.h>
25
26#include "fuse.h" 24#include "fuse.h"
25#include "iomap.h"
27#include "apbio.h" 26#include "apbio.h"
28 27
29#define FUSE_UID_LOW 0x108 28#define FUSE_UID_LOW 0x108
30#define FUSE_UID_HIGH 0x10c 29#define FUSE_UID_HIGH 0x10c
31#define FUSE_SKU_INFO 0x110 30#define FUSE_SKU_INFO 0x110
32#define FUSE_SPARE_BIT 0x200 31
32#define TEGRA20_FUSE_SPARE_BIT 0x200
33#define TEGRA30_FUSE_SPARE_BIT 0x244
33 34
34int tegra_sku_id; 35int tegra_sku_id;
35int tegra_cpu_process_id; 36int tegra_cpu_process_id;
36int tegra_core_process_id; 37int tegra_core_process_id;
37int tegra_chip_id; 38int tegra_chip_id;
39int tegra_cpu_speedo_id; /* only exist in Tegra30 and later */
40int tegra_soc_speedo_id;
38enum tegra_revision tegra_revision; 41enum tegra_revision tegra_revision;
39 42
43static int tegra_fuse_spare_bit;
44static void (*tegra_init_speedo_data)(void);
45
40/* The BCT to use at boot is specified by board straps that can be read 46/* The BCT to use at boot is specified by board straps that can be read
41 * through a APB misc register and decoded. 2 bits, i.e. 4 possible BCTs. 47 * through a APB misc register and decoded. 2 bits, i.e. 4 possible BCTs.
42 */ 48 */
@@ -57,14 +63,14 @@ static const char *tegra_revision_name[TEGRA_REVISION_MAX] = {
57 [TEGRA_REVISION_A04] = "A04", 63 [TEGRA_REVISION_A04] = "A04",
58}; 64};
59 65
60static inline u32 tegra_fuse_readl(unsigned long offset) 66u32 tegra_fuse_readl(unsigned long offset)
61{ 67{
62 return tegra_apb_readl(TEGRA_FUSE_BASE + offset); 68 return tegra_apb_readl(TEGRA_FUSE_BASE + offset);
63} 69}
64 70
65static inline bool get_spare_fuse(int bit) 71bool tegra_spare_fuse(int bit)
66{ 72{
67 return tegra_fuse_readl(FUSE_SPARE_BIT + bit * 4); 73 return tegra_fuse_readl(tegra_fuse_spare_bit + bit * 4);
68} 74}
69 75
70static enum tegra_revision tegra_get_revision(u32 id) 76static enum tegra_revision tegra_get_revision(u32 id)
@@ -78,7 +84,7 @@ static enum tegra_revision tegra_get_revision(u32 id)
78 return TEGRA_REVISION_A02; 84 return TEGRA_REVISION_A02;
79 case 3: 85 case 3:
80 if (tegra_chip_id == TEGRA20 && 86 if (tegra_chip_id == TEGRA20 &&
81 (get_spare_fuse(18) || get_spare_fuse(19))) 87 (tegra_spare_fuse(18) || tegra_spare_fuse(19)))
82 return TEGRA_REVISION_A03p; 88 return TEGRA_REVISION_A03p;
83 else 89 else
84 return TEGRA_REVISION_A03; 90 return TEGRA_REVISION_A03;
@@ -89,6 +95,16 @@ static enum tegra_revision tegra_get_revision(u32 id)
89 } 95 }
90} 96}
91 97
98static void tegra_get_process_id(void)
99{
100 u32 reg;
101
102 reg = tegra_fuse_readl(tegra_fuse_spare_bit);
103 tegra_cpu_process_id = (reg >> 6) & 3;
104 reg = tegra_fuse_readl(tegra_fuse_spare_bit);
105 tegra_core_process_id = (reg >> 12) & 3;
106}
107
92void tegra_init_fuse(void) 108void tegra_init_fuse(void)
93{ 109{
94 u32 id; 110 u32 id;
@@ -100,19 +116,29 @@ void tegra_init_fuse(void)
100 reg = tegra_fuse_readl(FUSE_SKU_INFO); 116 reg = tegra_fuse_readl(FUSE_SKU_INFO);
101 tegra_sku_id = reg & 0xFF; 117 tegra_sku_id = reg & 0xFF;
102 118
103 reg = tegra_fuse_readl(FUSE_SPARE_BIT);
104 tegra_cpu_process_id = (reg >> 6) & 3;
105
106 reg = tegra_fuse_readl(FUSE_SPARE_BIT);
107 tegra_core_process_id = (reg >> 12) & 3;
108
109 reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT); 119 reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT);
110 tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT; 120 tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT;
111 121
112 id = readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804); 122 id = readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804);
113 tegra_chip_id = (id >> 8) & 0xff; 123 tegra_chip_id = (id >> 8) & 0xff;
114 124
125 switch (tegra_chip_id) {
126 case TEGRA20:
127 tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT;
128 tegra_init_speedo_data = &tegra20_init_speedo_data;
129 break;
130 case TEGRA30:
131 tegra_fuse_spare_bit = TEGRA30_FUSE_SPARE_BIT;
132 tegra_init_speedo_data = &tegra30_init_speedo_data;
133 break;
134 default:
135 pr_warn("Tegra: unknown chip id %d\n", tegra_chip_id);
136 tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT;
137 tegra_init_speedo_data = &tegra_get_process_id;
138 }
139
115 tegra_revision = tegra_get_revision(id); 140 tegra_revision = tegra_get_revision(id);
141 tegra_init_speedo_data();
116 142
117 pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n", 143 pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n",
118 tegra_revision_name[tegra_revision], 144 tegra_revision_name[tegra_revision],
diff --git a/arch/arm/mach-tegra/fuse.h b/arch/arm/mach-tegra/fuse.h
index d2107b2cb85a..ff1383dd61a7 100644
--- a/arch/arm/mach-tegra/fuse.h
+++ b/arch/arm/mach-tegra/fuse.h
@@ -42,11 +42,27 @@ extern int tegra_sku_id;
42extern int tegra_cpu_process_id; 42extern int tegra_cpu_process_id;
43extern int tegra_core_process_id; 43extern int tegra_core_process_id;
44extern int tegra_chip_id; 44extern int tegra_chip_id;
45extern int tegra_cpu_speedo_id; /* only exist in Tegra30 and later */
46extern int tegra_soc_speedo_id;
45extern enum tegra_revision tegra_revision; 47extern enum tegra_revision tegra_revision;
46 48
47extern int tegra_bct_strapping; 49extern int tegra_bct_strapping;
48 50
49unsigned long long tegra_chip_uid(void); 51unsigned long long tegra_chip_uid(void);
50void tegra_init_fuse(void); 52void tegra_init_fuse(void);
53bool tegra_spare_fuse(int bit);
54u32 tegra_fuse_readl(unsigned long offset);
55
56#ifdef CONFIG_ARCH_TEGRA_2x_SOC
57void tegra20_init_speedo_data(void);
58#else
59static inline void tegra20_init_speedo_data(void) {}
60#endif
61
62#ifdef CONFIG_ARCH_TEGRA_3x_SOC
63void tegra30_init_speedo_data(void);
64#else
65static inline void tegra30_init_speedo_data(void) {}
66#endif
51 67
52#endif 68#endif
diff --git a/arch/arm/mach-tegra/headsmp.S b/arch/arm/mach-tegra/headsmp.S
index 6addc78cb6b2..93f0370cc95b 100644
--- a/arch/arm/mach-tegra/headsmp.S
+++ b/arch/arm/mach-tegra/headsmp.S
@@ -3,9 +3,8 @@
3 3
4#include <asm/cache.h> 4#include <asm/cache.h>
5 5
6#include <mach/iomap.h>
7
8#include "flowctrl.h" 6#include "flowctrl.h"
7#include "iomap.h"
9#include "reset.h" 8#include "reset.h"
10#include "sleep.h" 9#include "sleep.h"
11 10
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S
index 8ce0661b8a3d..44ca7b1d8b8a 100644
--- a/arch/arm/mach-tegra/include/mach/debug-macro.S
+++ b/arch/arm/mach-tegra/include/mach/debug-macro.S
@@ -26,8 +26,8 @@
26 26
27#include <linux/serial_reg.h> 27#include <linux/serial_reg.h>
28 28
29#include <mach/iomap.h> 29#include "../../iomap.h"
30#include <mach/irammap.h> 30#include "../../irammap.h"
31 31
32 .macro addruart, rp, rv, tmp 32 .macro addruart, rp, rv, tmp
33 adr \rp, 99f @ actual addr of 99f 33 adr \rp, 99f @ actual addr of 99f
diff --git a/arch/arm/mach-tegra/include/mach/dma.h b/arch/arm/mach-tegra/include/mach/dma.h
deleted file mode 100644
index 3081cc6dda3b..000000000000
--- a/arch/arm/mach-tegra/include/mach/dma.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * arch/arm/mach-tegra/include/mach/dma.h
3 *
4 * Copyright (c) 2008-2009, NVIDIA Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef __MACH_TEGRA_DMA_H
22#define __MACH_TEGRA_DMA_H
23
24#include <linux/list.h>
25
26#define TEGRA_DMA_REQ_SEL_CNTR 0
27#define TEGRA_DMA_REQ_SEL_I2S_2 1
28#define TEGRA_DMA_REQ_SEL_I2S_1 2
29#define TEGRA_DMA_REQ_SEL_SPD_I 3
30#define TEGRA_DMA_REQ_SEL_UI_I 4
31#define TEGRA_DMA_REQ_SEL_MIPI 5
32#define TEGRA_DMA_REQ_SEL_I2S2_2 6
33#define TEGRA_DMA_REQ_SEL_I2S2_1 7
34#define TEGRA_DMA_REQ_SEL_UARTA 8
35#define TEGRA_DMA_REQ_SEL_UARTB 9
36#define TEGRA_DMA_REQ_SEL_UARTC 10
37#define TEGRA_DMA_REQ_SEL_SPI 11
38#define TEGRA_DMA_REQ_SEL_AC97 12
39#define TEGRA_DMA_REQ_SEL_ACMODEM 13
40#define TEGRA_DMA_REQ_SEL_SL4B 14
41#define TEGRA_DMA_REQ_SEL_SL2B1 15
42#define TEGRA_DMA_REQ_SEL_SL2B2 16
43#define TEGRA_DMA_REQ_SEL_SL2B3 17
44#define TEGRA_DMA_REQ_SEL_SL2B4 18
45#define TEGRA_DMA_REQ_SEL_UARTD 19
46#define TEGRA_DMA_REQ_SEL_UARTE 20
47#define TEGRA_DMA_REQ_SEL_I2C 21
48#define TEGRA_DMA_REQ_SEL_I2C2 22
49#define TEGRA_DMA_REQ_SEL_I2C3 23
50#define TEGRA_DMA_REQ_SEL_DVC_I2C 24
51#define TEGRA_DMA_REQ_SEL_OWR 25
52#define TEGRA_DMA_REQ_SEL_INVALID 31
53
54#endif
diff --git a/arch/arm/mach-tegra/include/mach/powergate.h b/arch/arm/mach-tegra/include/mach/powergate.h
index 4752b1a68f35..06763fe7529d 100644
--- a/arch/arm/mach-tegra/include/mach/powergate.h
+++ b/arch/arm/mach-tegra/include/mach/powergate.h
@@ -20,6 +20,8 @@
20#ifndef _MACH_TEGRA_POWERGATE_H_ 20#ifndef _MACH_TEGRA_POWERGATE_H_
21#define _MACH_TEGRA_POWERGATE_H_ 21#define _MACH_TEGRA_POWERGATE_H_
22 22
23struct clk;
24
23#define TEGRA_POWERGATE_CPU 0 25#define TEGRA_POWERGATE_CPU 0
24#define TEGRA_POWERGATE_3D 1 26#define TEGRA_POWERGATE_3D 1
25#define TEGRA_POWERGATE_VENC 2 27#define TEGRA_POWERGATE_VENC 2
diff --git a/arch/arm/mach-tegra/include/mach/tegra-ahb.h b/arch/arm/mach-tegra/include/mach/tegra-ahb.h
deleted file mode 100644
index e0f8c84b1d8c..000000000000
--- a/arch/arm/mach-tegra/include/mach/tegra-ahb.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13
14#ifndef __MACH_TEGRA_AHB_H__
15#define __MACH_TEGRA_AHB_H__
16
17extern int tegra_ahb_enable_smmu(struct device_node *ahb);
18
19#endif /* __MACH_TEGRA_AHB_H__ */
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 937c4c50219e..27725750ca3e 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -28,8 +28,8 @@
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/serial_reg.h> 29#include <linux/serial_reg.h>
30 30
31#include <mach/iomap.h> 31#include "../../iomap.h"
32#include <mach/irammap.h> 32#include "../../irammap.h"
33 33
34#define BIT(x) (1 << (x)) 34#define BIT(x) (1 << (x))
35#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) 35#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
diff --git a/arch/arm/mach-tegra/io.c b/arch/arm/mach-tegra/io.c
index 58b4baf9c483..7d09f301b3a1 100644
--- a/arch/arm/mach-tegra/io.c
+++ b/arch/arm/mach-tegra/io.c
@@ -26,9 +26,9 @@
26 26
27#include <asm/page.h> 27#include <asm/page.h>
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <mach/iomap.h>
30 29
31#include "board.h" 30#include "board.h"
31#include "iomap.h"
32 32
33static struct map_desc tegra_io_desc[] __initdata = { 33static struct map_desc tegra_io_desc[] __initdata = {
34 { 34 {
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/iomap.h
index fee3a94c4549..53151030a07d 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/iomap.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-tegra/include/mach/iomap.h
3 *
4 * Copyright (C) 2010 Google, Inc. 2 * Copyright (C) 2010 Google, Inc.
5 * 3 *
6 * Author: 4 * Author:
diff --git a/arch/arm/mach-tegra/include/mach/irammap.h b/arch/arm/mach-tegra/irammap.h
index 0cbe63261854..0cbe63261854 100644
--- a/arch/arm/mach-tegra/include/mach/irammap.h
+++ b/arch/arm/mach-tegra/irammap.h
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index 2f5bd2db8e1f..b7886f183511 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -25,9 +25,8 @@
25 25
26#include <asm/hardware/gic.h> 26#include <asm/hardware/gic.h>
27 27
28#include <mach/iomap.h>
29
30#include "board.h" 28#include "board.h"
29#include "iomap.h"
31 30
32#define ICTLR_CPU_IEP_VFIQ 0x08 31#define ICTLR_CPU_IEP_VFIQ 0x08
33#define ICTLR_CPU_IEP_FIR 0x14 32#define ICTLR_CPU_IEP_FIR 0x14
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index a8dba6489c9b..f18fc3ab4e58 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -37,11 +37,11 @@
37#include <asm/sizes.h> 37#include <asm/sizes.h>
38#include <asm/mach/pci.h> 38#include <asm/mach/pci.h>
39 39
40#include <mach/iomap.h>
41#include <mach/clk.h> 40#include <mach/clk.h>
42#include <mach/powergate.h> 41#include <mach/powergate.h>
43 42
44#include "board.h" 43#include "board.h"
44#include "iomap.h"
45 45
46/* register definitions */ 46/* register definitions */
47#define AFI_OFFSET 0x3800 47#define AFI_OFFSET 0x3800
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 81cb26591acf..1b926df99c4b 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -24,8 +24,6 @@
24#include <asm/mach-types.h> 24#include <asm/mach-types.h>
25#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
26 26
27#include <mach/clk.h>
28#include <mach/iomap.h>
29#include <mach/powergate.h> 27#include <mach/powergate.h>
30 28
31#include "fuse.h" 29#include "fuse.h"
@@ -34,6 +32,7 @@
34#include "tegra_cpu_car.h" 32#include "tegra_cpu_car.h"
35 33
36#include "common.h" 34#include "common.h"
35#include "iomap.h"
37 36
38extern void tegra_secondary_startup(void); 37extern void tegra_secondary_startup(void);
39 38
diff --git a/arch/arm/mach-tegra/pmc.c b/arch/arm/mach-tegra/pmc.c
index 7af6a54404be..d4fdb5fcec20 100644
--- a/arch/arm/mach-tegra/pmc.c
+++ b/arch/arm/mach-tegra/pmc.c
@@ -19,7 +19,7 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/of.h> 20#include <linux/of.h>
21 21
22#include <mach/iomap.h> 22#include "iomap.h"
23 23
24#define PMC_CTRL 0x0 24#define PMC_CTRL 0x0
25#define PMC_CTRL_INTR_LOW (1 << 17) 25#define PMC_CTRL_INTR_LOW (1 << 17)
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index de0662de28a0..2cc1185d902e 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -28,10 +28,10 @@
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29 29
30#include <mach/clk.h> 30#include <mach/clk.h>
31#include <mach/iomap.h>
32#include <mach/powergate.h> 31#include <mach/powergate.h>
33 32
34#include "fuse.h" 33#include "fuse.h"
34#include "iomap.h"
35 35
36#define PWRGATE_TOGGLE 0x30 36#define PWRGATE_TOGGLE 0x30
37#define PWRGATE_TOGGLE_START (1 << 8) 37#define PWRGATE_TOGGLE_START (1 << 8)
diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c
index 5beb7ebe2948..e05da7d10c3b 100644
--- a/arch/arm/mach-tegra/reset.c
+++ b/arch/arm/mach-tegra/reset.c
@@ -22,9 +22,8 @@
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/hardware/cache-l2x0.h> 23#include <asm/hardware/cache-l2x0.h>
24 24
25#include <mach/iomap.h> 25#include "iomap.h"
26#include <mach/irammap.h> 26#include "irammap.h"
27
28#include "reset.h" 27#include "reset.h"
29#include "fuse.h" 28#include "fuse.h"
30 29
diff --git a/arch/arm/mach-tegra/sleep-t20.S b/arch/arm/mach-tegra/sleep-t20.S
index a36ae413e2b8..72ce709799da 100644
--- a/arch/arm/mach-tegra/sleep-t20.S
+++ b/arch/arm/mach-tegra/sleep-t20.S
@@ -22,8 +22,6 @@
22 22
23#include <asm/assembler.h> 23#include <asm/assembler.h>
24 24
25#include <mach/iomap.h>
26
27#include "sleep.h" 25#include "sleep.h"
28#include "flowctrl.h" 26#include "flowctrl.h"
29 27
diff --git a/arch/arm/mach-tegra/sleep-t30.S b/arch/arm/mach-tegra/sleep-t30.S
index 777d9cee8b90..be7614b7c5cb 100644
--- a/arch/arm/mach-tegra/sleep-t30.S
+++ b/arch/arm/mach-tegra/sleep-t30.S
@@ -18,8 +18,6 @@
18 18
19#include <asm/assembler.h> 19#include <asm/assembler.h>
20 20
21#include <mach/iomap.h>
22
23#include "sleep.h" 21#include "sleep.h"
24#include "flowctrl.h" 22#include "flowctrl.h"
25 23
diff --git a/arch/arm/mach-tegra/sleep.S b/arch/arm/mach-tegra/sleep.S
index ea81554c4833..08e9481c049e 100644
--- a/arch/arm/mach-tegra/sleep.S
+++ b/arch/arm/mach-tegra/sleep.S
@@ -26,7 +26,7 @@
26 26
27#include <asm/assembler.h> 27#include <asm/assembler.h>
28 28
29#include <mach/iomap.h> 29#include "iomap.h"
30 30
31#include "flowctrl.h" 31#include "flowctrl.h"
32#include "sleep.h" 32#include "sleep.h"
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index e25a7cd703d9..4889b281c5f9 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -17,7 +17,7 @@
17#ifndef __MACH_TEGRA_SLEEP_H 17#ifndef __MACH_TEGRA_SLEEP_H
18#define __MACH_TEGRA_SLEEP_H 18#define __MACH_TEGRA_SLEEP_H
19 19
20#include <mach/iomap.h> 20#include "iomap.h"
21 21
22#define TEGRA_ARM_PERIF_VIRT (TEGRA_ARM_PERIF_BASE - IO_CPU_PHYS \ 22#define TEGRA_ARM_PERIF_VIRT (TEGRA_ARM_PERIF_BASE - IO_CPU_PHYS \
23 + IO_CPU_VIRT) 23 + IO_CPU_VIRT)
diff --git a/arch/arm/mach-tegra/tegra20_clocks.c b/arch/arm/mach-tegra/tegra20_clocks.c
index deb873fb12b6..4eb6bc81a87b 100644
--- a/arch/arm/mach-tegra/tegra20_clocks.c
+++ b/arch/arm/mach-tegra/tegra20_clocks.c
@@ -27,10 +27,9 @@
27#include <linux/clkdev.h> 27#include <linux/clkdev.h>
28#include <linux/clk.h> 28#include <linux/clk.h>
29 29
30#include <mach/iomap.h>
31
32#include "clock.h" 30#include "clock.h"
33#include "fuse.h" 31#include "fuse.h"
32#include "iomap.h"
34#include "tegra2_emc.h" 33#include "tegra2_emc.h"
35#include "tegra_cpu_car.h" 34#include "tegra_cpu_car.h"
36 35
diff --git a/arch/arm/mach-tegra/tegra20_clocks_data.c b/arch/arm/mach-tegra/tegra20_clocks_data.c
index 8d398a33adf7..a23a0734e352 100644
--- a/arch/arm/mach-tegra/tegra20_clocks_data.c
+++ b/arch/arm/mach-tegra/tegra20_clocks_data.c
@@ -27,8 +27,6 @@
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/clk.h> 28#include <linux/clk.h>
29 29
30#include <mach/iomap.h>
31
32#include "clock.h" 30#include "clock.h"
33#include "fuse.h" 31#include "fuse.h"
34#include "tegra2_emc.h" 32#include "tegra2_emc.h"
@@ -248,11 +246,16 @@ static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
248 { 19200000, 216000000, 135, 12, 1, 3}, 246 { 19200000, 216000000, 135, 12, 1, 3},
249 { 26000000, 216000000, 216, 26, 1, 4}, 247 { 26000000, 216000000, 216, 26, 1, 4},
250 248
249 { 12000000, 297000000, 99, 4, 1, 4 },
250 { 12000000, 339000000, 113, 4, 1, 4 },
251
251 { 12000000, 594000000, 594, 12, 1, 8}, 252 { 12000000, 594000000, 594, 12, 1, 8},
252 { 13000000, 594000000, 594, 13, 1, 8}, 253 { 13000000, 594000000, 594, 13, 1, 8},
253 { 19200000, 594000000, 495, 16, 1, 8}, 254 { 19200000, 594000000, 495, 16, 1, 8},
254 { 26000000, 594000000, 594, 26, 1, 8}, 255 { 26000000, 594000000, 594, 26, 1, 8},
255 256
257 { 12000000, 616000000, 616, 12, 1, 8},
258
256 { 12000000, 1000000000, 1000, 12, 1, 12}, 259 { 12000000, 1000000000, 1000, 12, 1, 12},
257 { 13000000, 1000000000, 1000, 13, 1, 12}, 260 { 13000000, 1000000000, 1000, 13, 1, 12},
258 { 19200000, 1000000000, 625, 12, 1, 8}, 261 { 19200000, 1000000000, 625, 12, 1, 8},
@@ -1038,9 +1041,6 @@ static struct clk_duplicate tegra_clk_duplicates[] = {
1038 CLK_DUPLICATE("usbd", "utmip-pad", NULL), 1041 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
1039 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL), 1042 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
1040 CLK_DUPLICATE("usbd", "tegra-otg", NULL), 1043 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
1041 CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
1042 CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
1043 CLK_DUPLICATE("host1x", "tegra_grhost", "host1x"),
1044 CLK_DUPLICATE("2d", "tegra_grhost", "gr2d"), 1044 CLK_DUPLICATE("2d", "tegra_grhost", "gr2d"),
1045 CLK_DUPLICATE("3d", "tegra_grhost", "gr3d"), 1045 CLK_DUPLICATE("3d", "tegra_grhost", "gr3d"),
1046 CLK_DUPLICATE("epp", "tegra_grhost", "epp"), 1046 CLK_DUPLICATE("epp", "tegra_grhost", "epp"),
@@ -1053,6 +1053,9 @@ static struct clk_duplicate tegra_clk_duplicates[] = {
1053 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.1", "fast-clk"), 1053 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.1", "fast-clk"),
1054 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.2", "fast-clk"), 1054 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.2", "fast-clk"),
1055 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.3", "fast-clk"), 1055 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.3", "fast-clk"),
1056 CLK_DUPLICATE("pll_p", "tegradc.0", "parent"),
1057 CLK_DUPLICATE("pll_p", "tegradc.1", "parent"),
1058 CLK_DUPLICATE("pll_d_out0", "hdmi", "parent"),
1056}; 1059};
1057 1060
1058#define CLK(dev, con, ck) \ 1061#define CLK(dev, con, ck) \
diff --git a/arch/arm/mach-tegra/tegra20_speedo.c b/arch/arm/mach-tegra/tegra20_speedo.c
new file mode 100644
index 000000000000..fa6eb570623f
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra20_speedo.c
@@ -0,0 +1,109 @@
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/kernel.h>
18#include <linux/bug.h>
19
20#include "fuse.h"
21
22#define CPU_SPEEDO_LSBIT 20
23#define CPU_SPEEDO_MSBIT 29
24#define CPU_SPEEDO_REDUND_LSBIT 30
25#define CPU_SPEEDO_REDUND_MSBIT 39
26#define CPU_SPEEDO_REDUND_OFFS (CPU_SPEEDO_REDUND_MSBIT - CPU_SPEEDO_MSBIT)
27
28#define CORE_SPEEDO_LSBIT 40
29#define CORE_SPEEDO_MSBIT 47
30#define CORE_SPEEDO_REDUND_LSBIT 48
31#define CORE_SPEEDO_REDUND_MSBIT 55
32#define CORE_SPEEDO_REDUND_OFFS (CORE_SPEEDO_REDUND_MSBIT - CORE_SPEEDO_MSBIT)
33
34#define SPEEDO_MULT 4
35
36#define PROCESS_CORNERS_NUM 4
37
38#define SPEEDO_ID_SELECT_0(rev) ((rev) <= 2)
39#define SPEEDO_ID_SELECT_1(sku) \
40 (((sku) != 20) && ((sku) != 23) && ((sku) != 24) && \
41 ((sku) != 27) && ((sku) != 28))
42
43enum {
44 SPEEDO_ID_0,
45 SPEEDO_ID_1,
46 SPEEDO_ID_2,
47 SPEEDO_ID_COUNT,
48};
49
50static const u32 cpu_process_speedos[][PROCESS_CORNERS_NUM] = {
51 {315, 366, 420, UINT_MAX},
52 {303, 368, 419, UINT_MAX},
53 {316, 331, 383, UINT_MAX},
54};
55
56static const u32 core_process_speedos[][PROCESS_CORNERS_NUM] = {
57 {165, 195, 224, UINT_MAX},
58 {165, 195, 224, UINT_MAX},
59 {165, 195, 224, UINT_MAX},
60};
61
62void tegra20_init_speedo_data(void)
63{
64 u32 reg;
65 u32 val;
66 int i;
67
68 BUILD_BUG_ON(ARRAY_SIZE(cpu_process_speedos) != SPEEDO_ID_COUNT);
69 BUILD_BUG_ON(ARRAY_SIZE(core_process_speedos) != SPEEDO_ID_COUNT);
70
71 if (SPEEDO_ID_SELECT_0(tegra_revision))
72 tegra_soc_speedo_id = SPEEDO_ID_0;
73 else if (SPEEDO_ID_SELECT_1(tegra_sku_id))
74 tegra_soc_speedo_id = SPEEDO_ID_1;
75 else
76 tegra_soc_speedo_id = SPEEDO_ID_2;
77
78 val = 0;
79 for (i = CPU_SPEEDO_MSBIT; i >= CPU_SPEEDO_LSBIT; i--) {
80 reg = tegra_spare_fuse(i) |
81 tegra_spare_fuse(i + CPU_SPEEDO_REDUND_OFFS);
82 val = (val << 1) | (reg & 0x1);
83 }
84 val = val * SPEEDO_MULT;
85 pr_debug("%s CPU speedo value %u\n", __func__, val);
86
87 for (i = 0; i < (PROCESS_CORNERS_NUM - 1); i++) {
88 if (val <= cpu_process_speedos[tegra_soc_speedo_id][i])
89 break;
90 }
91 tegra_cpu_process_id = i;
92
93 val = 0;
94 for (i = CORE_SPEEDO_MSBIT; i >= CORE_SPEEDO_LSBIT; i--) {
95 reg = tegra_spare_fuse(i) |
96 tegra_spare_fuse(i + CORE_SPEEDO_REDUND_OFFS);
97 val = (val << 1) | (reg & 0x1);
98 }
99 val = val * SPEEDO_MULT;
100 pr_debug("%s Core speedo value %u\n", __func__, val);
101
102 for (i = 0; i < (PROCESS_CORNERS_NUM - 1); i++) {
103 if (val <= core_process_speedos[tegra_soc_speedo_id][i])
104 break;
105 }
106 tegra_core_process_id = i;
107
108 pr_info("Tegra20 Soc Speedo ID %d", tegra_soc_speedo_id);
109}
diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c
index 5070d833bdd1..837c7b9ea63b 100644
--- a/arch/arm/mach-tegra/tegra2_emc.c
+++ b/arch/arm/mach-tegra/tegra2_emc.c
@@ -25,8 +25,6 @@
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/platform_data/tegra_emc.h> 26#include <linux/platform_data/tegra_emc.h>
27 27
28#include <mach/iomap.h>
29
30#include "tegra2_emc.h" 28#include "tegra2_emc.h"
31#include "fuse.h" 29#include "fuse.h"
32 30
diff --git a/arch/arm/mach-tegra/tegra30_clocks.c b/arch/arm/mach-tegra/tegra30_clocks.c
index e9de5dfd94ec..f5b453f4bf4d 100644
--- a/arch/arm/mach-tegra/tegra30_clocks.c
+++ b/arch/arm/mach-tegra/tegra30_clocks.c
@@ -31,10 +31,9 @@
31 31
32#include <asm/clkdev.h> 32#include <asm/clkdev.h>
33 33
34#include <mach/iomap.h>
35
36#include "clock.h" 34#include "clock.h"
37#include "fuse.h" 35#include "fuse.h"
36#include "iomap.h"
38#include "tegra_cpu_car.h" 37#include "tegra_cpu_car.h"
39 38
40#define USE_PLL_LOCK_BITS 0 39#define USE_PLL_LOCK_BITS 0
@@ -792,6 +791,112 @@ struct clk_ops tegra30_twd_ops = {
792 .recalc_rate = tegra30_twd_clk_recalc_rate, 791 .recalc_rate = tegra30_twd_clk_recalc_rate,
793}; 792};
794 793
794/* bus clock functions */
795static int tegra30_bus_clk_is_enabled(struct clk_hw *hw)
796{
797 struct clk_tegra *c = to_clk_tegra(hw);
798 u32 val = clk_readl(c->reg);
799
800 c->state = ((val >> c->reg_shift) & BUS_CLK_DISABLE) ? OFF : ON;
801 return c->state;
802}
803
804static int tegra30_bus_clk_enable(struct clk_hw *hw)
805{
806 struct clk_tegra *c = to_clk_tegra(hw);
807 u32 val;
808
809 val = clk_readl(c->reg);
810 val &= ~(BUS_CLK_DISABLE << c->reg_shift);
811 clk_writel(val, c->reg);
812
813 return 0;
814}
815
816static void tegra30_bus_clk_disable(struct clk_hw *hw)
817{
818 struct clk_tegra *c = to_clk_tegra(hw);
819 u32 val;
820
821 val = clk_readl(c->reg);
822 val |= BUS_CLK_DISABLE << c->reg_shift;
823 clk_writel(val, c->reg);
824}
825
826static unsigned long tegra30_bus_clk_recalc_rate(struct clk_hw *hw,
827 unsigned long prate)
828{
829 struct clk_tegra *c = to_clk_tegra(hw);
830 u32 val = clk_readl(c->reg);
831 u64 rate = prate;
832
833 c->div = ((val >> c->reg_shift) & BUS_CLK_DIV_MASK) + 1;
834 c->mul = 1;
835
836 if (c->mul != 0 && c->div != 0) {
837 rate *= c->mul;
838 rate += c->div - 1; /* round up */
839 do_div(rate, c->div);
840 }
841 return rate;
842}
843
844static int tegra30_bus_clk_set_rate(struct clk_hw *hw, unsigned long rate,
845 unsigned long parent_rate)
846{
847 struct clk_tegra *c = to_clk_tegra(hw);
848 int ret = -EINVAL;
849 u32 val;
850 int i;
851
852 val = clk_readl(c->reg);
853 for (i = 1; i <= 4; i++) {
854 if (rate == parent_rate / i) {
855 val &= ~(BUS_CLK_DIV_MASK << c->reg_shift);
856 val |= (i - 1) << c->reg_shift;
857 clk_writel(val, c->reg);
858 c->div = i;
859 c->mul = 1;
860 ret = 0;
861 break;
862 }
863 }
864
865 return ret;
866}
867
868static long tegra30_bus_clk_round_rate(struct clk_hw *hw, unsigned long rate,
869 unsigned long *prate)
870{
871 unsigned long parent_rate = *prate;
872 s64 divider;
873
874 if (rate >= parent_rate)
875 return parent_rate;
876
877 divider = parent_rate;
878 divider += rate - 1;
879 do_div(divider, rate);
880
881 if (divider < 0)
882 return divider;
883
884 if (divider > 4)
885 divider = 4;
886 do_div(parent_rate, divider);
887
888 return parent_rate;
889}
890
891struct clk_ops tegra30_bus_ops = {
892 .is_enabled = tegra30_bus_clk_is_enabled,
893 .enable = tegra30_bus_clk_enable,
894 .disable = tegra30_bus_clk_disable,
895 .set_rate = tegra30_bus_clk_set_rate,
896 .round_rate = tegra30_bus_clk_round_rate,
897 .recalc_rate = tegra30_bus_clk_recalc_rate,
898};
899
795/* Blink output functions */ 900/* Blink output functions */
796static int tegra30_blink_clk_is_enabled(struct clk_hw *hw) 901static int tegra30_blink_clk_is_enabled(struct clk_hw *hw)
797{ 902{
diff --git a/arch/arm/mach-tegra/tegra30_clocks.h b/arch/arm/mach-tegra/tegra30_clocks.h
index f2f88fef6b8b..7a34adb2f72d 100644
--- a/arch/arm/mach-tegra/tegra30_clocks.h
+++ b/arch/arm/mach-tegra/tegra30_clocks.h
@@ -34,6 +34,7 @@ extern struct clk_ops tegra_clk_out_ops;
34extern struct clk_ops tegra30_super_ops; 34extern struct clk_ops tegra30_super_ops;
35extern struct clk_ops tegra30_blink_clk_ops; 35extern struct clk_ops tegra30_blink_clk_ops;
36extern struct clk_ops tegra30_twd_ops; 36extern struct clk_ops tegra30_twd_ops;
37extern struct clk_ops tegra30_bus_ops;
37extern struct clk_ops tegra30_periph_clk_ops; 38extern struct clk_ops tegra30_periph_clk_ops;
38extern struct clk_ops tegra30_dsib_clk_ops; 39extern struct clk_ops tegra30_dsib_clk_ops;
39extern struct clk_ops tegra_nand_clk_ops; 40extern struct clk_ops tegra_nand_clk_ops;
diff --git a/arch/arm/mach-tegra/tegra30_clocks_data.c b/arch/arm/mach-tegra/tegra30_clocks_data.c
index 3d2e5532a9ea..6942c7add3bb 100644
--- a/arch/arm/mach-tegra/tegra30_clocks_data.c
+++ b/arch/arm/mach-tegra/tegra30_clocks_data.c
@@ -711,6 +711,50 @@ static struct clk tegra_clk_sclk = {
711 .num_parents = ARRAY_SIZE(mux_sclk), 711 .num_parents = ARRAY_SIZE(mux_sclk),
712}; 712};
713 713
714static const char *tegra_hclk_parent_names[] = {
715 "tegra_sclk",
716};
717
718static struct clk *tegra_hclk_parents[] = {
719 &tegra_clk_sclk,
720};
721
722static struct clk tegra_hclk;
723static struct clk_tegra tegra_hclk_hw = {
724 .hw = {
725 .clk = &tegra_hclk,
726 },
727 .flags = DIV_BUS,
728 .reg = 0x30,
729 .reg_shift = 4,
730 .max_rate = 378000000,
731 .min_rate = 12000000,
732};
733DEFINE_CLK_TEGRA(hclk, 0, &tegra30_bus_ops, 0, tegra_hclk_parent_names,
734 tegra_hclk_parents, &tegra_clk_sclk);
735
736static const char *tegra_pclk_parent_names[] = {
737 "tegra_hclk",
738};
739
740static struct clk *tegra_pclk_parents[] = {
741 &tegra_hclk,
742};
743
744static struct clk tegra_pclk;
745static struct clk_tegra tegra_pclk_hw = {
746 .hw = {
747 .clk = &tegra_pclk,
748 },
749 .flags = DIV_BUS,
750 .reg = 0x30,
751 .reg_shift = 0,
752 .max_rate = 167000000,
753 .min_rate = 12000000,
754};
755DEFINE_CLK_TEGRA(pclk, 0, &tegra30_bus_ops, 0, tegra_pclk_parent_names,
756 tegra_pclk_parents, &tegra_hclk);
757
714static const char *mux_blink[] = { 758static const char *mux_blink[] = {
715 "clk_32k", 759 "clk_32k",
716}; 760};
@@ -1254,8 +1298,6 @@ struct clk_duplicate tegra_clk_duplicates[] = {
1254 CLK_DUPLICATE("usbd", "utmip-pad", NULL), 1298 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
1255 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL), 1299 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
1256 CLK_DUPLICATE("usbd", "tegra-otg", NULL), 1300 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
1257 CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
1258 CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
1259 CLK_DUPLICATE("dsib", "tegradc.0", "dsib"), 1301 CLK_DUPLICATE("dsib", "tegradc.0", "dsib"),
1260 CLK_DUPLICATE("dsia", "tegradc.1", "dsia"), 1302 CLK_DUPLICATE("dsia", "tegradc.1", "dsia"),
1261 CLK_DUPLICATE("bsev", "tegra-avp", "bsev"), 1303 CLK_DUPLICATE("bsev", "tegra-avp", "bsev"),
@@ -1293,6 +1335,9 @@ struct clk_duplicate tegra_clk_duplicates[] = {
1293 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.2", "fast-clk"), 1335 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.2", "fast-clk"),
1294 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.3", "fast-clk"), 1336 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.3", "fast-clk"),
1295 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.4", "fast-clk"), 1337 CLK_DUPLICATE("pll_p_out3", "tegra-i2c.4", "fast-clk"),
1338 CLK_DUPLICATE("pll_p", "tegradc.0", "parent"),
1339 CLK_DUPLICATE("pll_p", "tegradc.1", "parent"),
1340 CLK_DUPLICATE("pll_d2_out0", "hdmi", "parent"),
1296}; 1341};
1297 1342
1298struct clk *tegra_ptr_clks[] = { 1343struct clk *tegra_ptr_clks[] = {
@@ -1325,6 +1370,8 @@ struct clk *tegra_ptr_clks[] = {
1325 &tegra_cml1, 1370 &tegra_cml1,
1326 &tegra_pciex, 1371 &tegra_pciex,
1327 &tegra_clk_sclk, 1372 &tegra_clk_sclk,
1373 &tegra_hclk,
1374 &tegra_pclk,
1328 &tegra_clk_blink, 1375 &tegra_clk_blink,
1329 &tegra30_clk_twd, 1376 &tegra30_clk_twd,
1330}; 1377};
diff --git a/arch/arm/mach-tegra/tegra30_speedo.c b/arch/arm/mach-tegra/tegra30_speedo.c
new file mode 100644
index 000000000000..125cb16424a6
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra30_speedo.c
@@ -0,0 +1,292 @@
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/kernel.h>
18#include <linux/bug.h>
19
20#include "fuse.h"
21
22#define CORE_PROCESS_CORNERS_NUM 1
23#define CPU_PROCESS_CORNERS_NUM 6
24
25#define FUSE_SPEEDO_CALIB_0 0x114
26#define FUSE_PACKAGE_INFO 0X1FC
27#define FUSE_TEST_PROG_VER 0X128
28
29#define G_SPEEDO_BIT_MINUS1 58
30#define G_SPEEDO_BIT_MINUS1_R 59
31#define G_SPEEDO_BIT_MINUS2 60
32#define G_SPEEDO_BIT_MINUS2_R 61
33#define LP_SPEEDO_BIT_MINUS1 62
34#define LP_SPEEDO_BIT_MINUS1_R 63
35#define LP_SPEEDO_BIT_MINUS2 64
36#define LP_SPEEDO_BIT_MINUS2_R 65
37
38enum {
39 THRESHOLD_INDEX_0,
40 THRESHOLD_INDEX_1,
41 THRESHOLD_INDEX_2,
42 THRESHOLD_INDEX_3,
43 THRESHOLD_INDEX_4,
44 THRESHOLD_INDEX_5,
45 THRESHOLD_INDEX_6,
46 THRESHOLD_INDEX_7,
47 THRESHOLD_INDEX_8,
48 THRESHOLD_INDEX_9,
49 THRESHOLD_INDEX_10,
50 THRESHOLD_INDEX_11,
51 THRESHOLD_INDEX_COUNT,
52};
53
54static const u32 core_process_speedos[][CORE_PROCESS_CORNERS_NUM] = {
55 {180},
56 {170},
57 {195},
58 {180},
59 {168},
60 {192},
61 {180},
62 {170},
63 {195},
64 {180},
65 {180},
66 {180},
67};
68
69static const u32 cpu_process_speedos[][CPU_PROCESS_CORNERS_NUM] = {
70 {306, 338, 360, 376, UINT_MAX},
71 {295, 336, 358, 375, UINT_MAX},
72 {325, 325, 358, 375, UINT_MAX},
73 {325, 325, 358, 375, UINT_MAX},
74 {292, 324, 348, 364, UINT_MAX},
75 {324, 324, 348, 364, UINT_MAX},
76 {324, 324, 348, 364, UINT_MAX},
77 {295, 336, 358, 375, UINT_MAX},
78 {358, 358, 358, 358, 397, UINT_MAX},
79 {364, 364, 364, 364, 397, UINT_MAX},
80 {295, 336, 358, 375, 391, UINT_MAX},
81 {295, 336, 358, 375, 391, UINT_MAX},
82};
83
84static int threshold_index;
85static int package_id;
86
87static void fuse_speedo_calib(u32 *speedo_g, u32 *speedo_lp)
88{
89 u32 reg;
90 int ate_ver;
91 int bit_minus1;
92 int bit_minus2;
93
94 reg = tegra_fuse_readl(FUSE_SPEEDO_CALIB_0);
95
96 *speedo_lp = (reg & 0xFFFF) * 4;
97 *speedo_g = ((reg >> 16) & 0xFFFF) * 4;
98
99 ate_ver = tegra_fuse_readl(FUSE_TEST_PROG_VER);
100 pr_info("%s: ATE prog ver %d.%d\n", __func__, ate_ver/10, ate_ver%10);
101
102 if (ate_ver >= 26) {
103 bit_minus1 = tegra_spare_fuse(LP_SPEEDO_BIT_MINUS1);
104 bit_minus1 |= tegra_spare_fuse(LP_SPEEDO_BIT_MINUS1_R);
105 bit_minus2 = tegra_spare_fuse(LP_SPEEDO_BIT_MINUS2);
106 bit_minus2 |= tegra_spare_fuse(LP_SPEEDO_BIT_MINUS2_R);
107 *speedo_lp |= (bit_minus1 << 1) | bit_minus2;
108
109 bit_minus1 = tegra_spare_fuse(G_SPEEDO_BIT_MINUS1);
110 bit_minus1 |= tegra_spare_fuse(G_SPEEDO_BIT_MINUS1_R);
111 bit_minus2 = tegra_spare_fuse(G_SPEEDO_BIT_MINUS2);
112 bit_minus2 |= tegra_spare_fuse(G_SPEEDO_BIT_MINUS2_R);
113 *speedo_g |= (bit_minus1 << 1) | bit_minus2;
114 } else {
115 *speedo_lp |= 0x3;
116 *speedo_g |= 0x3;
117 }
118}
119
120static void rev_sku_to_speedo_ids(int rev, int sku)
121{
122 switch (rev) {
123 case TEGRA_REVISION_A01:
124 tegra_cpu_speedo_id = 0;
125 tegra_soc_speedo_id = 0;
126 threshold_index = THRESHOLD_INDEX_0;
127 break;
128 case TEGRA_REVISION_A02:
129 case TEGRA_REVISION_A03:
130 switch (sku) {
131 case 0x87:
132 case 0x82:
133 tegra_cpu_speedo_id = 1;
134 tegra_soc_speedo_id = 1;
135 threshold_index = THRESHOLD_INDEX_1;
136 break;
137 case 0x81:
138 switch (package_id) {
139 case 1:
140 tegra_cpu_speedo_id = 2;
141 tegra_soc_speedo_id = 2;
142 threshold_index = THRESHOLD_INDEX_2;
143 break;
144 case 2:
145 tegra_cpu_speedo_id = 4;
146 tegra_soc_speedo_id = 1;
147 threshold_index = THRESHOLD_INDEX_7;
148 break;
149 default:
150 pr_err("Tegra30: Unknown pkg %d\n", package_id);
151 BUG();
152 break;
153 }
154 break;
155 case 0x80:
156 switch (package_id) {
157 case 1:
158 tegra_cpu_speedo_id = 5;
159 tegra_soc_speedo_id = 2;
160 threshold_index = THRESHOLD_INDEX_8;
161 break;
162 case 2:
163 tegra_cpu_speedo_id = 6;
164 tegra_soc_speedo_id = 2;
165 threshold_index = THRESHOLD_INDEX_9;
166 break;
167 default:
168 pr_err("Tegra30: Unknown pkg %d\n", package_id);
169 BUG();
170 break;
171 }
172 break;
173 case 0x83:
174 switch (package_id) {
175 case 1:
176 tegra_cpu_speedo_id = 7;
177 tegra_soc_speedo_id = 1;
178 threshold_index = THRESHOLD_INDEX_10;
179 break;
180 case 2:
181 tegra_cpu_speedo_id = 3;
182 tegra_soc_speedo_id = 2;
183 threshold_index = THRESHOLD_INDEX_3;
184 break;
185 default:
186 pr_err("Tegra30: Unknown pkg %d\n", package_id);
187 BUG();
188 break;
189 }
190 break;
191 case 0x8F:
192 tegra_cpu_speedo_id = 8;
193 tegra_soc_speedo_id = 1;
194 threshold_index = THRESHOLD_INDEX_11;
195 break;
196 case 0x08:
197 tegra_cpu_speedo_id = 1;
198 tegra_soc_speedo_id = 1;
199 threshold_index = THRESHOLD_INDEX_4;
200 break;
201 case 0x02:
202 tegra_cpu_speedo_id = 2;
203 tegra_soc_speedo_id = 2;
204 threshold_index = THRESHOLD_INDEX_5;
205 break;
206 case 0x04:
207 tegra_cpu_speedo_id = 3;
208 tegra_soc_speedo_id = 2;
209 threshold_index = THRESHOLD_INDEX_6;
210 break;
211 case 0:
212 switch (package_id) {
213 case 1:
214 tegra_cpu_speedo_id = 2;
215 tegra_soc_speedo_id = 2;
216 threshold_index = THRESHOLD_INDEX_2;
217 break;
218 case 2:
219 tegra_cpu_speedo_id = 3;
220 tegra_soc_speedo_id = 2;
221 threshold_index = THRESHOLD_INDEX_3;
222 break;
223 default:
224 pr_err("Tegra30: Unknown pkg %d\n", package_id);
225 BUG();
226 break;
227 }
228 break;
229 default:
230 pr_warn("Tegra30: Unknown SKU %d\n", sku);
231 tegra_cpu_speedo_id = 0;
232 tegra_soc_speedo_id = 0;
233 threshold_index = THRESHOLD_INDEX_0;
234 break;
235 }
236 break;
237 default:
238 pr_warn("Tegra30: Unknown chip rev %d\n", rev);
239 tegra_cpu_speedo_id = 0;
240 tegra_soc_speedo_id = 0;
241 threshold_index = THRESHOLD_INDEX_0;
242 break;
243 }
244}
245
246void tegra30_init_speedo_data(void)
247{
248 u32 cpu_speedo_val;
249 u32 core_speedo_val;
250 int i;
251
252 BUILD_BUG_ON(ARRAY_SIZE(cpu_process_speedos) !=
253 THRESHOLD_INDEX_COUNT);
254 BUILD_BUG_ON(ARRAY_SIZE(core_process_speedos) !=
255 THRESHOLD_INDEX_COUNT);
256
257 package_id = tegra_fuse_readl(FUSE_PACKAGE_INFO) & 0x0F;
258
259 rev_sku_to_speedo_ids(tegra_revision, tegra_sku_id);
260 fuse_speedo_calib(&cpu_speedo_val, &core_speedo_val);
261 pr_debug("%s CPU speedo value %u\n", __func__, cpu_speedo_val);
262 pr_debug("%s Core speedo value %u\n", __func__, core_speedo_val);
263
264 for (i = 0; i < CPU_PROCESS_CORNERS_NUM; i++) {
265 if (cpu_speedo_val < cpu_process_speedos[threshold_index][i])
266 break;
267 }
268 tegra_cpu_process_id = i - 1;
269
270 if (tegra_cpu_process_id == -1) {
271 pr_warn("Tegra30: CPU speedo value %3d out of range",
272 cpu_speedo_val);
273 tegra_cpu_process_id = 0;
274 tegra_cpu_speedo_id = 1;
275 }
276
277 for (i = 0; i < CORE_PROCESS_CORNERS_NUM; i++) {
278 if (core_speedo_val < core_process_speedos[threshold_index][i])
279 break;
280 }
281 tegra_core_process_id = i - 1;
282
283 if (tegra_core_process_id == -1) {
284 pr_warn("Tegra30: CORE speedo value %3d out of range",
285 core_speedo_val);
286 tegra_core_process_id = 0;
287 tegra_soc_speedo_id = 1;
288 }
289
290 pr_info("Tegra30: CPU Speedo ID %d, Soc Speedo ID %d",
291 tegra_cpu_speedo_id, tegra_soc_speedo_id);
292}
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index d3b8c8e7368f..6ff503536512 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -31,11 +31,11 @@
31#include <asm/smp_twd.h> 31#include <asm/smp_twd.h>
32#include <asm/sched_clock.h> 32#include <asm/sched_clock.h>
33 33
34#include <mach/iomap.h>
35#include <mach/irqs.h> 34#include <mach/irqs.h>
36 35
37#include "board.h" 36#include "board.h"
38#include "clock.h" 37#include "clock.h"
38#include "iomap.h"
39 39
40#define RTC_SECONDS 0x08 40#define RTC_SECONDS 0x08
41#define RTC_SHADOW_SECONDS 0x0c 41#define RTC_SHADOW_SECONDS 0x0c
diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c
index 8c979770d872..564f57d5d8a7 100644
--- a/arch/arm/mach-ux500/board-mop500-stuib.c
+++ b/arch/arm/mach-ux500/board-mop500-stuib.c
@@ -162,18 +162,6 @@ static struct bu21013_platform_device tsc_plat_device = {
162 .y_flip = true, 162 .y_flip = true,
163}; 163};
164 164
165static struct bu21013_platform_device tsc_plat2_device = {
166 .cs_en = bu21013_gpio_board_init,
167 .cs_dis = bu21013_gpio_board_exit,
168 .irq_read_val = bu21013_read_pin_val,
169 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
170 .touch_x_max = TOUCH_XMAX,
171 .touch_y_max = TOUCH_YMAX,
172 .ext_clk = false,
173 .x_flip = false,
174 .y_flip = true,
175};
176
177static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = { 165static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = {
178 { 166 {
179 I2C_BOARD_INFO("bu21013_tp", 0x5C), 167 I2C_BOARD_INFO("bu21013_tp", 0x5C),
@@ -181,21 +169,17 @@ static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = {
181 }, 169 },
182 { 170 {
183 I2C_BOARD_INFO("bu21013_tp", 0x5D), 171 I2C_BOARD_INFO("bu21013_tp", 0x5D),
184 .platform_data = &tsc_plat2_device, 172 .platform_data = &tsc_plat_device,
185 }, 173 },
186 174
187}; 175};
188 176
189void __init mop500_stuib_init(void) 177void __init mop500_stuib_init(void)
190{ 178{
191 if (machine_is_hrefv60()) { 179 if (machine_is_hrefv60())
192 tsc_plat_device.cs_pin = HREFV60_TOUCH_RST_GPIO; 180 tsc_plat_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
193 tsc_plat2_device.cs_pin = HREFV60_TOUCH_RST_GPIO; 181 else
194 } else {
195 tsc_plat_device.cs_pin = GPIO_BU21013_CS; 182 tsc_plat_device.cs_pin = GPIO_BU21013_CS;
196 tsc_plat2_device.cs_pin = GPIO_BU21013_CS;
197
198 }
199 183
200 mop500_uib_i2c_add(0, mop500_i2c0_devices_stuib, 184 mop500_uib_i2c_add(0, mop500_i2c0_devices_stuib,
201 ARRAY_SIZE(mop500_i2c0_devices_stuib)); 185 ARRAY_SIZE(mop500_i2c0_devices_stuib));
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 416d436111f2..daa4237ac0dc 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -33,8 +33,6 @@
33#include <linux/smsc911x.h> 33#include <linux/smsc911x.h>
34#include <linux/gpio_keys.h> 34#include <linux/gpio_keys.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/of.h>
37#include <linux/of_platform.h>
38#include <linux/leds.h> 36#include <linux/leds.h>
39#include <linux/pinctrl/consumer.h> 37#include <linux/pinctrl/consumer.h>
40 38
@@ -464,7 +462,7 @@ static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
464}; 462};
465#endif 463#endif
466 464
467static struct pl022_ssp_controller ssp0_plat = { 465struct pl022_ssp_controller ssp0_plat = {
468 .bus_id = 0, 466 .bus_id = 0,
469#ifdef CONFIG_STE_DMA40 467#ifdef CONFIG_STE_DMA40
470 .enable_dma = 1, 468 .enable_dma = 1,
@@ -541,7 +539,7 @@ static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
541}; 539};
542#endif 540#endif
543 541
544static struct amba_pl011_data uart0_plat = { 542struct amba_pl011_data uart0_plat = {
545#ifdef CONFIG_STE_DMA40 543#ifdef CONFIG_STE_DMA40
546 .dma_filter = stedma40_filter, 544 .dma_filter = stedma40_filter,
547 .dma_rx_param = &uart0_dma_cfg_rx, 545 .dma_rx_param = &uart0_dma_cfg_rx,
@@ -549,7 +547,7 @@ static struct amba_pl011_data uart0_plat = {
549#endif 547#endif
550}; 548};
551 549
552static struct amba_pl011_data uart1_plat = { 550struct amba_pl011_data uart1_plat = {
553#ifdef CONFIG_STE_DMA40 551#ifdef CONFIG_STE_DMA40
554 .dma_filter = stedma40_filter, 552 .dma_filter = stedma40_filter,
555 .dma_rx_param = &uart1_dma_cfg_rx, 553 .dma_rx_param = &uart1_dma_cfg_rx,
@@ -557,7 +555,7 @@ static struct amba_pl011_data uart1_plat = {
557#endif 555#endif
558}; 556};
559 557
560static struct amba_pl011_data uart2_plat = { 558struct amba_pl011_data uart2_plat = {
561#ifdef CONFIG_STE_DMA40 559#ifdef CONFIG_STE_DMA40
562 .dma_filter = stedma40_filter, 560 .dma_filter = stedma40_filter,
563 .dma_rx_param = &uart2_dma_cfg_rx, 561 .dma_rx_param = &uart2_dma_cfg_rx,
@@ -618,8 +616,6 @@ static void __init mop500_init_machine(void)
618 616
619 /* This board has full regulator constraints */ 617 /* This board has full regulator constraints */
620 regulator_has_full_constraints(); 618 regulator_has_full_constraints();
621
622 mop500_uib_init();
623} 619}
624 620
625static void __init snowball_init_machine(void) 621static void __init snowball_init_machine(void)
@@ -684,8 +680,6 @@ static void __init hrefv60_init_machine(void)
684 680
685 /* This board has full regulator constraints */ 681 /* This board has full regulator constraints */
686 regulator_has_full_constraints(); 682 regulator_has_full_constraints();
687
688 mop500_uib_init();
689} 683}
690 684
691MACHINE_START(U8500, "ST-Ericsson MOP500 platform") 685MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
@@ -721,135 +715,5 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
721 .timer = &ux500_timer, 715 .timer = &ux500_timer,
722 .handle_irq = gic_handle_irq, 716 .handle_irq = gic_handle_irq,
723 .init_machine = snowball_init_machine, 717 .init_machine = snowball_init_machine,
724 .init_late = ux500_init_late, 718 .init_late = NULL,
725MACHINE_END
726
727#ifdef CONFIG_MACH_UX500_DT
728
729struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
730 /* Requires call-back bindings. */
731 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
732 /* Requires DMA and call-back bindings. */
733 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
734 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
735 OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
736 /* Requires DMA bindings. */
737 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat),
738 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data),
739 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data),
740 OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data),
741 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data),
742 /* Requires clock name bindings. */
743 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
744 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
745 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
746 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
747 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
748 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
749 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
750 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
751 OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),
752 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80004000, "nmk-i2c.0", NULL),
753 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80122000, "nmk-i2c.1", NULL),
754 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL),
755 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),
756 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
757 /* Requires device name bindings. */
758 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL),
759 /* Requires clock name and DMA bindings. */
760 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
761 "ux500-msp-i2s.0", &msp0_platform_data),
762 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000,
763 "ux500-msp-i2s.1", &msp1_platform_data),
764 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80117000,
765 "ux500-msp-i2s.2", &msp2_platform_data),
766 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000,
767 "ux500-msp-i2s.3", &msp3_platform_data),
768 {},
769};
770
771static const struct of_device_id u8500_local_bus_nodes[] = {
772 /* only create devices below soc node */
773 { .compatible = "stericsson,db8500", },
774 { .compatible = "stericsson,db8500-prcmu", },
775 { .compatible = "simple-bus"},
776 { },
777};
778
779static void __init u8500_init_machine(void)
780{
781 struct device *parent = NULL;
782 int i2c0_devs;
783 int i;
784
785 /* Pinmaps must be in place before devices register */
786 if (of_machine_is_compatible("st-ericsson,mop500"))
787 mop500_pinmaps_init();
788 else if (of_machine_is_compatible("calaosystems,snowball-a9500"))
789 snowball_pinmaps_init();
790 else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
791 hrefv60_pinmaps_init();
792
793 parent = u8500_of_init_devices();
794
795 for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
796 mop500_platform_devs[i]->dev.parent = parent;
797
798 /* automatically probe child nodes of db8500 device */
799 of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
800
801 if (of_machine_is_compatible("st-ericsson,mop500")) {
802 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
803
804 platform_add_devices(mop500_platform_devs,
805 ARRAY_SIZE(mop500_platform_devs));
806
807 mop500_sdi_init(parent);
808 mop500_audio_init(parent);
809 i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
810 i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
811 i2c_register_board_info(2, mop500_i2c2_devices,
812 ARRAY_SIZE(mop500_i2c2_devices));
813
814 mop500_uib_init();
815
816 } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
817 mop500_of_audio_init(parent);
818 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
819 /*
820 * The HREFv60 board removed a GPIO expander and routed
821 * all these GPIO pins to the internal GPIO controller
822 * instead.
823 */
824 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
825 platform_add_devices(mop500_platform_devs,
826 ARRAY_SIZE(mop500_platform_devs));
827
828 mop500_uib_init();
829 }
830
831 /* This board has full regulator constraints */
832 regulator_has_full_constraints();
833}
834
835static const char * u8500_dt_board_compat[] = {
836 "calaosystems,snowball-a9500",
837 "st-ericsson,hrefv60+",
838 "st-ericsson,u8500",
839 "st-ericsson,mop500",
840 NULL,
841};
842
843
844DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
845 .smp = smp_ops(ux500_smp_ops),
846 .map_io = u8500_map_io,
847 .init_irq = ux500_init_irq,
848 /* we re-use nomadik timer here */
849 .timer = &ux500_timer,
850 .handle_irq = gic_handle_irq,
851 .init_machine = u8500_init_machine,
852 .init_late = ux500_init_late,
853 .dt_compat = u8500_dt_board_compat,
854MACHINE_END 719MACHINE_END
855#endif
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index aca39a68712a..d77208232cbc 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -89,6 +89,10 @@ extern struct msp_i2s_platform_data msp1_platform_data;
89extern struct msp_i2s_platform_data msp2_platform_data; 89extern struct msp_i2s_platform_data msp2_platform_data;
90extern struct msp_i2s_platform_data msp3_platform_data; 90extern struct msp_i2s_platform_data msp3_platform_data;
91extern struct arm_pmu_platdata db8500_pmu_platdata; 91extern struct arm_pmu_platdata db8500_pmu_platdata;
92extern struct amba_pl011_data uart0_plat;
93extern struct amba_pl011_data uart1_plat;
94extern struct amba_pl011_data uart2_plat;
95extern struct pl022_ssp_controller ssp0_plat;
92 96
93extern void mop500_sdi_init(struct device *parent); 97extern void mop500_sdi_init(struct device *parent);
94extern void snowball_sdi_init(struct device *parent); 98extern void snowball_sdi_init(struct device *parent);
@@ -106,8 +110,4 @@ void mop500_of_audio_init(struct device *parent);
106int __init mop500_uib_init(void); 110int __init mop500_uib_init(void);
107void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, 111void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
108 unsigned n); 112 unsigned n);
109
110/* TODO: Once all pieces are DT:ed, remove completely. */
111struct device * __init u8500_of_init_devices(void);
112
113#endif 113#endif
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index bcdfe6b1d453..d2076ce22e97 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -17,9 +17,15 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/mfd/abx500/ab8500.h> 19#include <linux/mfd/abx500/ab8500.h>
20#include <linux/mfd/dbx500-prcmu.h>
21#include <linux/of.h>
22#include <linux/of_platform.h>
23#include <linux/regulator/machine.h>
20 24
21#include <asm/pmu.h> 25#include <asm/pmu.h>
22#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <asm/mach/arch.h>
28#include <asm/hardware/gic.h>
23#include <plat/gpio-nomadik.h> 29#include <plat/gpio-nomadik.h>
24#include <mach/hardware.h> 30#include <mach/hardware.h>
25#include <mach/setup.h> 31#include <mach/setup.h>
@@ -29,6 +35,7 @@
29 35
30#include "devices-db8500.h" 36#include "devices-db8500.h"
31#include "ste-dma40-db8500.h" 37#include "ste-dma40-db8500.h"
38#include "board-mop500.h"
32 39
33/* minimum static i/o mapping required to boot U8500 platforms */ 40/* minimum static i/o mapping required to boot U8500 platforms */
34static struct map_desc u8500_uart_io_desc[] __initdata = { 41static struct map_desc u8500_uart_io_desc[] __initdata = {
@@ -227,12 +234,12 @@ struct device * __init u8500_init_devices(struct ab8500_platform_data *ab8500)
227 return parent; 234 return parent;
228} 235}
229 236
237#ifdef CONFIG_MACH_UX500_DT
238
230/* TODO: Once all pieces are DT:ed, remove completely. */ 239/* TODO: Once all pieces are DT:ed, remove completely. */
231struct device * __init u8500_of_init_devices(void) 240static struct device * __init u8500_of_init_devices(void)
232{ 241{
233 struct device *parent; 242 struct device *parent = db8500_soc_device_init();
234
235 parent = db8500_soc_device_init();
236 243
237 db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); 244 db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg);
238 245
@@ -251,3 +258,95 @@ struct device * __init u8500_of_init_devices(void)
251 258
252 return parent; 259 return parent;
253} 260}
261
262static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
263 /* Requires call-back bindings. */
264 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
265 /* Requires DMA bindings. */
266 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
267 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
268 OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
269 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat),
270 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data),
271 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data),
272 OF_DEV_AUXDATA("arm,pl18x", 0x80005000, "sdi2", &mop500_sdi2_data),
273 OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4", &mop500_sdi4_data),
274 /* Requires clock name bindings. */
275 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
276 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
277 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
278 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
279 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
280 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
281 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
282 OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
283 OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),
284 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80004000, "nmk-i2c.0", NULL),
285 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80122000, "nmk-i2c.1", NULL),
286 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL),
287 OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),
288 OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
289 /* Requires device name bindings. */
290 OF_DEV_AUXDATA("stericsson,nmk_pinctrl", 0, "pinctrl-db8500", NULL),
291 /* Requires clock name and DMA bindings. */
292 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
293 "ux500-msp-i2s.0", &msp0_platform_data),
294 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80124000,
295 "ux500-msp-i2s.1", &msp1_platform_data),
296 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80117000,
297 "ux500-msp-i2s.2", &msp2_platform_data),
298 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000,
299 "ux500-msp-i2s.3", &msp3_platform_data),
300 {},
301};
302
303static const struct of_device_id u8500_local_bus_nodes[] = {
304 /* only create devices below soc node */
305 { .compatible = "stericsson,db8500", },
306 { .compatible = "stericsson,db8500-prcmu", },
307 { .compatible = "simple-bus"},
308 { },
309};
310
311static void __init u8500_init_machine(void)
312{
313 struct device *parent = NULL;
314
315 /* Pinmaps must be in place before devices register */
316 if (of_machine_is_compatible("st-ericsson,mop500"))
317 mop500_pinmaps_init();
318 else if (of_machine_is_compatible("calaosystems,snowball-a9500"))
319 snowball_pinmaps_init();
320 else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
321 hrefv60_pinmaps_init();
322 else if (of_machine_is_compatible("st-ericsson,ccu9540")) {}
323 /* TODO: Add pinmaps for ccu9540 board. */
324
325 /* TODO: Export SoC, USB, cpu-freq and DMA40 */
326 parent = u8500_of_init_devices();
327
328 /* automatically probe child nodes of db8500 device */
329 of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
330}
331
332static const char * stericsson_dt_platform_compat[] = {
333 "st-ericsson,u8500",
334 "st-ericsson,u8540",
335 "st-ericsson,u9500",
336 "st-ericsson,u9540",
337 NULL,
338};
339
340DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)")
341 .smp = smp_ops(ux500_smp_ops),
342 .map_io = u8500_map_io,
343 .init_irq = ux500_init_irq,
344 /* we re-use nomadik timer here */
345 .timer = &ux500_timer,
346 .handle_irq = gic_handle_irq,
347 .init_machine = u8500_init_machine,
348 .init_late = NULL,
349 .dt_compat = stericsson_dt_platform_compat,
350MACHINE_END
351
352#endif
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index 1f3fbc2bb776..721e7b4275f3 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -26,6 +26,8 @@
26#include <mach/setup.h> 26#include <mach/setup.h>
27#include <mach/devices.h> 27#include <mach/devices.h>
28 28
29#include "board-mop500.h"
30
29void __iomem *_PRCMU_BASE; 31void __iomem *_PRCMU_BASE;
30 32
31/* 33/*
@@ -82,6 +84,7 @@ void __init ux500_init_irq(void)
82 84
83void __init ux500_init_late(void) 85void __init ux500_init_late(void)
84{ 86{
87 mop500_uib_init();
85} 88}
86 89
87static const char * __init ux500_get_machine(void) 90static const char * __init ux500_get_machine(void)
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index ab5cfddc0d7b..79bf5fb4dad3 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -19,19 +19,21 @@
19#include <linux/cpumask.h> 19#include <linux/cpumask.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/clk/zynq.h>
23#include <linux/of_address.h>
22#include <linux/of_irq.h> 24#include <linux/of_irq.h>
23#include <linux/of_platform.h> 25#include <linux/of_platform.h>
24#include <linux/of.h> 26#include <linux/of.h>
25 27
26#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30#include <asm/mach/time.h>
28#include <asm/mach-types.h> 31#include <asm/mach-types.h>
29#include <asm/page.h> 32#include <asm/page.h>
30#include <asm/hardware/gic.h> 33#include <asm/hardware/gic.h>
31#include <asm/hardware/cache-l2x0.h> 34#include <asm/hardware/cache-l2x0.h>
32 35
33#include <mach/zynq_soc.h> 36#include <mach/zynq_soc.h>
34#include <mach/clkdev.h>
35#include "common.h" 37#include "common.h"
36 38
37static struct of_device_id zynq_of_bus_ids[] __initdata = { 39static struct of_device_id zynq_of_bus_ids[] __initdata = {
@@ -45,22 +47,25 @@ static struct of_device_id zynq_of_bus_ids[] __initdata = {
45 */ 47 */
46static void __init xilinx_init_machine(void) 48static void __init xilinx_init_machine(void)
47{ 49{
48#ifdef CONFIG_CACHE_L2X0
49 /* 50 /*
50 * 64KB way size, 8-way associativity, parity disabled 51 * 64KB way size, 8-way associativity, parity disabled
51 */ 52 */
52 l2x0_init(PL310_L2CC_BASE, 0x02060000, 0xF0F0FFFF); 53 l2x0_of_init(0x02060000, 0xF0F0FFFF);
53#endif
54 54
55 of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); 55 of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL);
56} 56}
57 57
58static struct of_device_id irq_match[] __initdata = {
59 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
60 { }
61};
62
58/** 63/**
59 * xilinx_irq_init() - Interrupt controller initialization for the GIC. 64 * xilinx_irq_init() - Interrupt controller initialization for the GIC.
60 */ 65 */
61static void __init xilinx_irq_init(void) 66static void __init xilinx_irq_init(void)
62{ 67{
63 gic_init(0, 29, SCU_GIC_DIST_BASE, SCU_GIC_CPU_BASE); 68 of_irq_init(irq_match);
64} 69}
65 70
66/* The minimum devices needed to be mapped before the VM system is up and 71/* The minimum devices needed to be mapped before the VM system is up and
@@ -71,31 +76,47 @@ static struct map_desc io_desc[] __initdata = {
71 { 76 {
72 .virtual = TTC0_VIRT, 77 .virtual = TTC0_VIRT,
73 .pfn = __phys_to_pfn(TTC0_PHYS), 78 .pfn = __phys_to_pfn(TTC0_PHYS),
74 .length = SZ_4K, 79 .length = TTC0_SIZE,
75 .type = MT_DEVICE, 80 .type = MT_DEVICE,
76 }, { 81 }, {
77 .virtual = SCU_PERIPH_VIRT, 82 .virtual = SCU_PERIPH_VIRT,
78 .pfn = __phys_to_pfn(SCU_PERIPH_PHYS), 83 .pfn = __phys_to_pfn(SCU_PERIPH_PHYS),
79 .length = SZ_8K, 84 .length = SCU_PERIPH_SIZE,
80 .type = MT_DEVICE,
81 }, {
82 .virtual = PL310_L2CC_VIRT,
83 .pfn = __phys_to_pfn(PL310_L2CC_PHYS),
84 .length = SZ_4K,
85 .type = MT_DEVICE, 85 .type = MT_DEVICE,
86 }, 86 },
87 87
88#ifdef CONFIG_DEBUG_LL 88#ifdef CONFIG_DEBUG_LL
89 { 89 {
90 .virtual = UART0_VIRT, 90 .virtual = LL_UART_VADDR,
91 .pfn = __phys_to_pfn(UART0_PHYS), 91 .pfn = __phys_to_pfn(LL_UART_PADDR),
92 .length = SZ_4K, 92 .length = UART_SIZE,
93 .type = MT_DEVICE, 93 .type = MT_DEVICE,
94 }, 94 },
95#endif 95#endif
96 96
97}; 97};
98 98
99static void __init xilinx_zynq_timer_init(void)
100{
101 struct device_node *np;
102 void __iomem *slcr;
103
104 np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-slcr");
105 slcr = of_iomap(np, 0);
106 WARN_ON(!slcr);
107
108 xilinx_zynq_clocks_init(slcr);
109
110 xttcpss_timer_init();
111}
112
113/*
114 * Instantiate and initialize the system timer structure
115 */
116static struct sys_timer xttcpss_sys_timer = {
117 .init = xilinx_zynq_timer_init,
118};
119
99/** 120/**
100 * xilinx_map_io() - Create memory mappings needed for early I/O. 121 * xilinx_map_io() - Create memory mappings needed for early I/O.
101 */ 122 */
@@ -105,7 +126,8 @@ static void __init xilinx_map_io(void)
105} 126}
106 127
107static const char *xilinx_dt_match[] = { 128static const char *xilinx_dt_match[] = {
108 "xlnx,zynq-ep107", 129 "xlnx,zynq-zc702",
130 "xlnx,zynq-7000",
109 NULL 131 NULL
110}; 132};
111 133
diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
index a009644a1555..954b91c13c91 100644
--- a/arch/arm/mach-zynq/common.h
+++ b/arch/arm/mach-zynq/common.h
@@ -17,8 +17,6 @@
17#ifndef __MACH_ZYNQ_COMMON_H__ 17#ifndef __MACH_ZYNQ_COMMON_H__
18#define __MACH_ZYNQ_COMMON_H__ 18#define __MACH_ZYNQ_COMMON_H__
19 19
20#include <asm/mach/time.h> 20void __init xttcpss_timer_init(void);
21
22extern struct sys_timer xttcpss_sys_timer;
23 21
24#endif 22#endif
diff --git a/arch/arm/mach-zynq/include/mach/clkdev.h b/arch/arm/mach-zynq/include/mach/clkdev.h
deleted file mode 100644
index c6e73d81a459..000000000000
--- a/arch/arm/mach-zynq/include/mach/clkdev.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * arch/arm/mach-zynq/include/mach/clkdev.h
3 *
4 * Copyright (C) 2011 Xilinx, 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_CLKDEV_H__
18#define __MACH_CLKDEV_H__
19
20#include <plat/clock.h>
21
22struct clk {
23 unsigned long rate;
24 const struct clk_ops *ops;
25 const struct icst_params *params;
26 void __iomem *vcoreg;
27};
28
29#define __clk_get(clk) ({ 1; })
30#define __clk_put(clk) do { } while (0)
31
32#endif
diff --git a/arch/arm/mach-zynq/include/mach/zynq_soc.h b/arch/arm/mach-zynq/include/mach/zynq_soc.h
index d0d3f8fb06dd..5ebbd8e6eeee 100644
--- a/arch/arm/mach-zynq/include/mach/zynq_soc.h
+++ b/arch/arm/mach-zynq/include/mach/zynq_soc.h
@@ -15,34 +15,39 @@
15#ifndef __MACH_XILINX_SOC_H__ 15#ifndef __MACH_XILINX_SOC_H__
16#define __MACH_XILINX_SOC_H__ 16#define __MACH_XILINX_SOC_H__
17 17
18#include <asm/pgtable.h>
19
18#define PERIPHERAL_CLOCK_RATE 2500000 20#define PERIPHERAL_CLOCK_RATE 2500000
19 21
20/* For now, all mappings are flat (physical = virtual) 22/* Static peripheral mappings are mapped at the top of the vmalloc region. The
23 * early uart mapping causes intermediate problems/failure at certain
24 * addresses, including the very top of the vmalloc region. Map it at an
25 * address that is known to work.
21 */ 26 */
22#define UART0_PHYS 0xE0000000 27#define UART0_PHYS 0xE0000000
23#define UART0_VIRT UART0_PHYS 28#define UART1_PHYS 0xE0001000
24 29#define UART_SIZE SZ_4K
25#define TTC0_PHYS 0xF8001000 30#define UART_VIRT 0xF0001000
26#define TTC0_VIRT TTC0_PHYS 31
27 32#define TTC0_PHYS 0xF8001000
28#define PL310_L2CC_PHYS 0xF8F02000 33#define TTC0_SIZE SZ_4K
29#define PL310_L2CC_VIRT PL310_L2CC_PHYS 34#define TTC0_VIRT (VMALLOC_END - TTC0_SIZE)
35
36#define SCU_PERIPH_PHYS 0xF8F00000
37#define SCU_PERIPH_SIZE SZ_8K
38#define SCU_PERIPH_VIRT (TTC0_VIRT - SCU_PERIPH_SIZE)
39
40#if IS_ENABLED(CONFIG_DEBUG_ZYNQ_UART1)
41# define LL_UART_PADDR UART1_PHYS
42#else
43# define LL_UART_PADDR UART0_PHYS
44#endif
30 45
31#define SCU_PERIPH_PHYS 0xF8F00000 46#define LL_UART_VADDR UART_VIRT
32#define SCU_PERIPH_VIRT SCU_PERIPH_PHYS
33 47
34/* The following are intended for the devices that are mapped early */ 48/* The following are intended for the devices that are mapped early */
35 49
36#define TTC0_BASE IOMEM(TTC0_VIRT) 50#define TTC0_BASE IOMEM(TTC0_VIRT)
37#define SCU_PERIPH_BASE IOMEM(SCU_PERIPH_VIRT) 51#define SCU_PERIPH_BASE IOMEM(SCU_PERIPH_VIRT)
38#define SCU_GIC_CPU_BASE (SCU_PERIPH_BASE + 0x100)
39#define SCU_GIC_DIST_BASE (SCU_PERIPH_BASE + 0x1000)
40#define PL310_L2CC_BASE IOMEM(PL310_L2CC_VIRT)
41
42/*
43 * Mandatory for CONFIG_LL_DEBUG, UART is mapped virtual = physical
44 */
45#define LL_UART_PADDR UART0_PHYS
46#define LL_UART_VADDR UART0_VIRT
47 52
48#endif 53#endif
diff --git a/arch/arm/mach-zynq/timer.c b/arch/arm/mach-zynq/timer.c
index c2c96cc7d6e7..9662306aa12f 100644
--- a/arch/arm/mach-zynq/timer.c
+++ b/arch/arm/mach-zynq/timer.c
@@ -23,32 +23,15 @@
23#include <linux/clocksource.h> 23#include <linux/clocksource.h>
24#include <linux/clockchips.h> 24#include <linux/clockchips.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/of.h>
27#include <linux/of_address.h>
28#include <linux/of_irq.h>
29#include <linux/slab.h>
30#include <linux/clk-provider.h>
26 31
27#include <asm/mach/time.h>
28#include <mach/zynq_soc.h> 32#include <mach/zynq_soc.h>
29#include "common.h" 33#include "common.h"
30 34
31#define IRQ_TIMERCOUNTER0 42
32
33/*
34 * This driver configures the 2 16-bit count-up timers as follows:
35 *
36 * T1: Timer 1, clocksource for generic timekeeping
37 * T2: Timer 2, clockevent source for hrtimers
38 * T3: Timer 3, <unused>
39 *
40 * The input frequency to the timer module for emulation is 2.5MHz which is
41 * common to all the timer channels (T1, T2, and T3). With a pre-scaler of 32,
42 * the timers are clocked at 78.125KHz (12.8 us resolution).
43 *
44 * The input frequency to the timer module in silicon will be 200MHz. With the
45 * pre-scaler of 32, the timers are clocked at 6.25MHz (160ns resolution).
46 */
47#define XTTCPSS_CLOCKSOURCE 0 /* Timer 1 as a generic timekeeping */
48#define XTTCPSS_CLOCKEVENT 1 /* Timer 2 as a clock event */
49
50#define XTTCPSS_TIMER_BASE TTC0_BASE
51#define XTTCPCC_EVENT_TIMER_IRQ (IRQ_TIMERCOUNTER0 + 1)
52/* 35/*
53 * Timer Register Offset Definitions of Timer 1, Increment base address by 4 36 * Timer Register Offset Definitions of Timer 1, Increment base address by 4
54 * and use same offsets for Timer 2 37 * and use same offsets for Timer 2
@@ -65,9 +48,14 @@
65 48
66#define XTTCPSS_CNT_CNTRL_DISABLE_MASK 0x1 49#define XTTCPSS_CNT_CNTRL_DISABLE_MASK 0x1
67 50
68/* Setup the timers to use pre-scaling */ 51/* Setup the timers to use pre-scaling, using a fixed value for now that will
69 52 * work across most input frequency, but it may need to be more dynamic
70#define TIMER_RATE (PERIPHERAL_CLOCK_RATE / 32) 53 */
54#define PRESCALE_EXPONENT 11 /* 2 ^ PRESCALE_EXPONENT = PRESCALE */
55#define PRESCALE 2048 /* The exponent must match this */
56#define CLK_CNTRL_PRESCALE ((PRESCALE_EXPONENT - 1) << 1)
57#define CLK_CNTRL_PRESCALE_EN 1
58#define CNT_CNTRL_RESET (1<<4)
71 59
72/** 60/**
73 * struct xttcpss_timer - This definition defines local timer structure 61 * struct xttcpss_timer - This definition defines local timer structure
@@ -75,11 +63,25 @@
75 * @base_addr: Base address of timer 63 * @base_addr: Base address of timer
76 **/ 64 **/
77struct xttcpss_timer { 65struct xttcpss_timer {
78 void __iomem *base_addr; 66 void __iomem *base_addr;
79}; 67};
80 68
81static struct xttcpss_timer timers[2]; 69struct xttcpss_timer_clocksource {
82static struct clock_event_device xttcpss_clockevent; 70 struct xttcpss_timer xttc;
71 struct clocksource cs;
72};
73
74#define to_xttcpss_timer_clksrc(x) \
75 container_of(x, struct xttcpss_timer_clocksource, cs)
76
77struct xttcpss_timer_clockevent {
78 struct xttcpss_timer xttc;
79 struct clock_event_device ce;
80 struct clk *clk;
81};
82
83#define to_xttcpss_timer_clkevent(x) \
84 container_of(x, struct xttcpss_timer_clockevent, ce)
83 85
84/** 86/**
85 * xttcpss_set_interval - Set the timer interval value 87 * xttcpss_set_interval - Set the timer interval value
@@ -101,7 +103,7 @@ static void xttcpss_set_interval(struct xttcpss_timer *timer,
101 103
102 /* Reset the counter (0x10) so that it starts from 0, one-shot 104 /* Reset the counter (0x10) so that it starts from 0, one-shot
103 mode makes this needed for timing to be right. */ 105 mode makes this needed for timing to be right. */
104 ctrl_reg |= 0x10; 106 ctrl_reg |= CNT_CNTRL_RESET;
105 ctrl_reg &= ~XTTCPSS_CNT_CNTRL_DISABLE_MASK; 107 ctrl_reg &= ~XTTCPSS_CNT_CNTRL_DISABLE_MASK;
106 __raw_writel(ctrl_reg, timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET); 108 __raw_writel(ctrl_reg, timer->base_addr + XTTCPSS_CNT_CNTRL_OFFSET);
107} 109}
@@ -116,90 +118,31 @@ static void xttcpss_set_interval(struct xttcpss_timer *timer,
116 **/ 118 **/
117static irqreturn_t xttcpss_clock_event_interrupt(int irq, void *dev_id) 119static irqreturn_t xttcpss_clock_event_interrupt(int irq, void *dev_id)
118{ 120{
119 struct clock_event_device *evt = &xttcpss_clockevent; 121 struct xttcpss_timer_clockevent *xttce = dev_id;
120 struct xttcpss_timer *timer = dev_id; 122 struct xttcpss_timer *timer = &xttce->xttc;
121 123
122 /* Acknowledge the interrupt and call event handler */ 124 /* Acknowledge the interrupt and call event handler */
123 __raw_writel(__raw_readl(timer->base_addr + XTTCPSS_ISR_OFFSET), 125 __raw_writel(__raw_readl(timer->base_addr + XTTCPSS_ISR_OFFSET),
124 timer->base_addr + XTTCPSS_ISR_OFFSET); 126 timer->base_addr + XTTCPSS_ISR_OFFSET);
125 127
126 evt->event_handler(evt); 128 xttce->ce.event_handler(&xttce->ce);
127 129
128 return IRQ_HANDLED; 130 return IRQ_HANDLED;
129} 131}
130 132
131static struct irqaction event_timer_irq = {
132 .name = "xttcpss clockevent",
133 .flags = IRQF_DISABLED | IRQF_TIMER,
134 .handler = xttcpss_clock_event_interrupt,
135};
136
137/** 133/**
138 * xttcpss_timer_hardware_init - Initialize the timer hardware 134 * __xttc_clocksource_read - Reads the timer counter register
139 *
140 * Initialize the hardware to start the clock source, get the clock
141 * event timer ready to use, and hook up the interrupt.
142 **/
143static void __init xttcpss_timer_hardware_init(void)
144{
145 /* Setup the clock source counter to be an incrementing counter
146 * with no interrupt and it rolls over at 0xFFFF. Pre-scale
147 it by 32 also. Let it start running now.
148 */
149 timers[XTTCPSS_CLOCKSOURCE].base_addr = XTTCPSS_TIMER_BASE;
150
151 __raw_writel(0x0, timers[XTTCPSS_CLOCKSOURCE].base_addr +
152 XTTCPSS_IER_OFFSET);
153 __raw_writel(0x9, timers[XTTCPSS_CLOCKSOURCE].base_addr +
154 XTTCPSS_CLK_CNTRL_OFFSET);
155 __raw_writel(0x10, timers[XTTCPSS_CLOCKSOURCE].base_addr +
156 XTTCPSS_CNT_CNTRL_OFFSET);
157
158 /* Setup the clock event timer to be an interval timer which
159 * is prescaled by 32 using the interval interrupt. Leave it
160 * disabled for now.
161 */
162
163 timers[XTTCPSS_CLOCKEVENT].base_addr = XTTCPSS_TIMER_BASE + 4;
164
165 __raw_writel(0x23, timers[XTTCPSS_CLOCKEVENT].base_addr +
166 XTTCPSS_CNT_CNTRL_OFFSET);
167 __raw_writel(0x9, timers[XTTCPSS_CLOCKEVENT].base_addr +
168 XTTCPSS_CLK_CNTRL_OFFSET);
169 __raw_writel(0x1, timers[XTTCPSS_CLOCKEVENT].base_addr +
170 XTTCPSS_IER_OFFSET);
171
172 /* Setup IRQ the clock event timer */
173 event_timer_irq.dev_id = &timers[XTTCPSS_CLOCKEVENT];
174 setup_irq(XTTCPCC_EVENT_TIMER_IRQ, &event_timer_irq);
175}
176
177/**
178 * __raw_readl_cycles - Reads the timer counter register
179 * 135 *
180 * returns: Current timer counter register value 136 * returns: Current timer counter register value
181 **/ 137 **/
182static cycle_t __raw_readl_cycles(struct clocksource *cs) 138static cycle_t __xttc_clocksource_read(struct clocksource *cs)
183{ 139{
184 struct xttcpss_timer *timer = &timers[XTTCPSS_CLOCKSOURCE]; 140 struct xttcpss_timer *timer = &to_xttcpss_timer_clksrc(cs)->xttc;
185 141
186 return (cycle_t)__raw_readl(timer->base_addr + 142 return (cycle_t)__raw_readl(timer->base_addr +
187 XTTCPSS_COUNT_VAL_OFFSET); 143 XTTCPSS_COUNT_VAL_OFFSET);
188} 144}
189 145
190
191/*
192 * Instantiate and initialize the clock source structure
193 */
194static struct clocksource clocksource_xttcpss = {
195 .name = "xttcpss_timer1",
196 .rating = 200, /* Reasonable clock source */
197 .read = __raw_readl_cycles,
198 .mask = CLOCKSOURCE_MASK(16),
199 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
200};
201
202
203/** 146/**
204 * xttcpss_set_next_event - Sets the time interval for next event 147 * xttcpss_set_next_event - Sets the time interval for next event
205 * 148 *
@@ -211,7 +154,8 @@ static struct clocksource clocksource_xttcpss = {
211static int xttcpss_set_next_event(unsigned long cycles, 154static int xttcpss_set_next_event(unsigned long cycles,
212 struct clock_event_device *evt) 155 struct clock_event_device *evt)
213{ 156{
214 struct xttcpss_timer *timer = &timers[XTTCPSS_CLOCKEVENT]; 157 struct xttcpss_timer_clockevent *xttce = to_xttcpss_timer_clkevent(evt);
158 struct xttcpss_timer *timer = &xttce->xttc;
215 159
216 xttcpss_set_interval(timer, cycles); 160 xttcpss_set_interval(timer, cycles);
217 return 0; 161 return 0;
@@ -226,12 +170,15 @@ static int xttcpss_set_next_event(unsigned long cycles,
226static void xttcpss_set_mode(enum clock_event_mode mode, 170static void xttcpss_set_mode(enum clock_event_mode mode,
227 struct clock_event_device *evt) 171 struct clock_event_device *evt)
228{ 172{
229 struct xttcpss_timer *timer = &timers[XTTCPSS_CLOCKEVENT]; 173 struct xttcpss_timer_clockevent *xttce = to_xttcpss_timer_clkevent(evt);
174 struct xttcpss_timer *timer = &xttce->xttc;
230 u32 ctrl_reg; 175 u32 ctrl_reg;
231 176
232 switch (mode) { 177 switch (mode) {
233 case CLOCK_EVT_MODE_PERIODIC: 178 case CLOCK_EVT_MODE_PERIODIC:
234 xttcpss_set_interval(timer, TIMER_RATE / HZ); 179 xttcpss_set_interval(timer,
180 DIV_ROUND_CLOSEST(clk_get_rate(xttce->clk),
181 PRESCALE * HZ));
235 break; 182 break;
236 case CLOCK_EVT_MODE_ONESHOT: 183 case CLOCK_EVT_MODE_ONESHOT:
237 case CLOCK_EVT_MODE_UNUSED: 184 case CLOCK_EVT_MODE_UNUSED:
@@ -252,15 +199,106 @@ static void xttcpss_set_mode(enum clock_event_mode mode,
252 } 199 }
253} 200}
254 201
255/* 202static void __init zynq_ttc_setup_clocksource(struct device_node *np,
256 * Instantiate and initialize the clock event structure 203 void __iomem *base)
257 */ 204{
258static struct clock_event_device xttcpss_clockevent = { 205 struct xttcpss_timer_clocksource *ttccs;
259 .name = "xttcpss_timer2", 206 struct clk *clk;
260 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 207 int err;
261 .set_next_event = xttcpss_set_next_event, 208 u32 reg;
262 .set_mode = xttcpss_set_mode, 209
263 .rating = 200, 210 ttccs = kzalloc(sizeof(*ttccs), GFP_KERNEL);
211 if (WARN_ON(!ttccs))
212 return;
213
214 err = of_property_read_u32(np, "reg", &reg);
215 if (WARN_ON(err))
216 return;
217
218 clk = of_clk_get_by_name(np, "cpu_1x");
219 if (WARN_ON(IS_ERR(clk)))
220 return;
221
222 err = clk_prepare_enable(clk);
223 if (WARN_ON(err))
224 return;
225
226 ttccs->xttc.base_addr = base + reg * 4;
227
228 ttccs->cs.name = np->name;
229 ttccs->cs.rating = 200;
230 ttccs->cs.read = __xttc_clocksource_read;
231 ttccs->cs.mask = CLOCKSOURCE_MASK(16);
232 ttccs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS;
233
234 __raw_writel(0x0, ttccs->xttc.base_addr + XTTCPSS_IER_OFFSET);
235 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN,
236 ttccs->xttc.base_addr + XTTCPSS_CLK_CNTRL_OFFSET);
237 __raw_writel(CNT_CNTRL_RESET,
238 ttccs->xttc.base_addr + XTTCPSS_CNT_CNTRL_OFFSET);
239
240 err = clocksource_register_hz(&ttccs->cs, clk_get_rate(clk) / PRESCALE);
241 if (WARN_ON(err))
242 return;
243}
244
245static void __init zynq_ttc_setup_clockevent(struct device_node *np,
246 void __iomem *base)
247{
248 struct xttcpss_timer_clockevent *ttcce;
249 int err, irq;
250 u32 reg;
251
252 ttcce = kzalloc(sizeof(*ttcce), GFP_KERNEL);
253 if (WARN_ON(!ttcce))
254 return;
255
256 err = of_property_read_u32(np, "reg", &reg);
257 if (WARN_ON(err))
258 return;
259
260 ttcce->xttc.base_addr = base + reg * 4;
261
262 ttcce->clk = of_clk_get_by_name(np, "cpu_1x");
263 if (WARN_ON(IS_ERR(ttcce->clk)))
264 return;
265
266 err = clk_prepare_enable(ttcce->clk);
267 if (WARN_ON(err))
268 return;
269
270 irq = irq_of_parse_and_map(np, 0);
271 if (WARN_ON(!irq))
272 return;
273
274 ttcce->ce.name = np->name;
275 ttcce->ce.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
276 ttcce->ce.set_next_event = xttcpss_set_next_event;
277 ttcce->ce.set_mode = xttcpss_set_mode;
278 ttcce->ce.rating = 200;
279 ttcce->ce.irq = irq;
280
281 __raw_writel(0x23, ttcce->xttc.base_addr + XTTCPSS_CNT_CNTRL_OFFSET);
282 __raw_writel(CLK_CNTRL_PRESCALE | CLK_CNTRL_PRESCALE_EN,
283 ttcce->xttc.base_addr + XTTCPSS_CLK_CNTRL_OFFSET);
284 __raw_writel(0x1, ttcce->xttc.base_addr + XTTCPSS_IER_OFFSET);
285
286 err = request_irq(irq, xttcpss_clock_event_interrupt, IRQF_TIMER,
287 np->name, ttcce);
288 if (WARN_ON(err))
289 return;
290
291 clockevents_config_and_register(&ttcce->ce,
292 clk_get_rate(ttcce->clk) / PRESCALE,
293 1, 0xfffe);
294}
295
296static const __initconst struct of_device_id zynq_ttc_match[] = {
297 { .compatible = "xlnx,ttc-counter-clocksource",
298 .data = zynq_ttc_setup_clocksource, },
299 { .compatible = "xlnx,ttc-counter-clockevent",
300 .data = zynq_ttc_setup_clockevent, },
301 {}
264}; 302};
265 303
266/** 304/**
@@ -269,30 +307,27 @@ static struct clock_event_device xttcpss_clockevent = {
269 * Initializes the timer hardware and register the clock source and clock event 307 * Initializes the timer hardware and register the clock source and clock event
270 * timers with Linux kernal timer framework 308 * timers with Linux kernal timer framework
271 **/ 309 **/
272static void __init xttcpss_timer_init(void) 310void __init xttcpss_timer_init(void)
273{ 311{
274 xttcpss_timer_hardware_init(); 312 struct device_node *np;
275 clocksource_register_hz(&clocksource_xttcpss, TIMER_RATE); 313
276 314 for_each_compatible_node(np, NULL, "xlnx,ttc") {
277 /* Calculate the parameters to allow the clockevent to operate using 315 struct device_node *np_chld;
278 integer math 316 void __iomem *base;
279 */ 317
280 clockevents_calc_mult_shift(&xttcpss_clockevent, TIMER_RATE, 4); 318 base = of_iomap(np, 0);
281 319 if (WARN_ON(!base))
282 xttcpss_clockevent.max_delta_ns = 320 return;
283 clockevent_delta2ns(0xfffe, &xttcpss_clockevent); 321
284 xttcpss_clockevent.min_delta_ns = 322 for_each_available_child_of_node(np, np_chld) {
285 clockevent_delta2ns(1, &xttcpss_clockevent); 323 int (*cb)(struct device_node *np, void __iomem *base);
286 324 const struct of_device_id *match;
287 /* Indicate that clock event is on 1st CPU as SMP boot needs it */ 325
288 326 match = of_match_node(zynq_ttc_match, np_chld);
289 xttcpss_clockevent.cpumask = cpumask_of(0); 327 if (match) {
290 clockevents_register_device(&xttcpss_clockevent); 328 cb = match->data;
329 cb(np_chld, base);
330 }
331 }
332 }
291} 333}
292
293/*
294 * Instantiate and initialize the system timer structure
295 */
296struct sys_timer xttcpss_sys_timer = {
297 .init = xttcpss_timer_init,
298};
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
deleted file mode 100644
index 88e1e2e7a20d..000000000000
--- a/arch/arm/plat-mxc/Kconfig
+++ /dev/null
@@ -1,89 +0,0 @@
1if ARCH_MXC
2
3source "arch/arm/plat-mxc/devices/Kconfig"
4
5menu "Freescale MXC Implementations"
6
7choice
8 prompt "Freescale CPU family:"
9 default ARCH_IMX_V6_V7
10
11config ARCH_IMX_V4_V5
12 bool "i.MX1, i.MX21, i.MX25, i.MX27"
13 select ARM_PATCH_PHYS_VIRT
14 select AUTO_ZRELADDR if !ZBOOT_ROM
15 help
16 This enables support for systems based on the Freescale i.MX ARMv4
17 and ARMv5 SoCs
18
19config ARCH_IMX_V6_V7
20 bool "i.MX3, i.MX5, i.MX6"
21 select ARM_PATCH_PHYS_VIRT
22 select AUTO_ZRELADDR if !ZBOOT_ROM
23 select MIGHT_HAVE_CACHE_L2X0
24 help
25 This enables support for systems based on the Freescale i.MX3, i.MX5
26 and i.MX6 family.
27
28endchoice
29
30source "arch/arm/mach-imx/Kconfig"
31
32endmenu
33
34config MXC_IRQ_PRIOR
35 bool "Use IRQ priority"
36 help
37 Select this if you want to use prioritized IRQ handling.
38 This feature prevents higher priority ISR to be interrupted
39 by lower priority IRQ even IRQF_DISABLED flag is not set.
40 This may be useful in embedded applications, where are strong
41 requirements for timing.
42 Say N here, unless you have a specialized requirement.
43
44config MXC_TZIC
45 bool
46
47config MXC_AVIC
48 bool
49
50config MXC_DEBUG_BOARD
51 bool "Enable MXC debug board(for 3-stack)"
52 help
53 The debug board is an integral part of the MXC 3-stack(PDK)
54 platforms, it can be attached or removed from the peripheral
55 board. On debug board, several debug devices(ethernet, UART,
56 buttons, LEDs and JTAG) are implemented. Between the MCU and
57 these devices, a CPLD is added as a bridge which performs
58 data/address de-multiplexing and decode, signal level shift,
59 interrupt control and various board functions.
60
61config HAVE_EPIT
62 bool
63
64config MXC_USE_EPIT
65 bool "Use EPIT instead of GPT"
66 depends on HAVE_EPIT
67 help
68 Use EPIT as the system timer on systems that have it. Normally you
69 don't have a reason to do so as the EPIT has the same features and
70 uses the same clocks as the GPT. Anyway, on some systems the GPT
71 may be in use for other purposes.
72
73config MXC_ULPI
74 bool
75
76config ARCH_HAS_RNGA
77 bool
78
79config IMX_HAVE_IOMUX_V1
80 bool
81
82config ARCH_MXC_IOMUX_V3
83 bool
84
85config IRAM_ALLOC
86 bool
87 select GENERIC_ALLOCATOR
88
89endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
deleted file mode 100644
index 149237e24850..000000000000
--- a/arch/arm/plat-mxc/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common support
6obj-y := time.o devices.o cpu.o system.o irq-common.o
7
8obj-$(CONFIG_MXC_TZIC) += tzic.o
9obj-$(CONFIG_MXC_AVIC) += avic.o
10
11obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
12obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
13obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o
14obj-$(CONFIG_MXC_ULPI) += ulpi.o
15obj-$(CONFIG_MXC_USE_EPIT) += epit.o
16obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
17obj-$(CONFIG_CPU_FREQ_IMX) += cpufreq.o
18obj-$(CONFIG_CPU_IDLE) += cpuidle.o
19ifdef CONFIG_SND_IMX_SOC
20obj-y += ssi-fiq.o
21obj-y += ssi-fiq-ksym.o
22endif
23
24obj-y += devices/
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S
deleted file mode 100644
index 761e45f9456f..000000000000
--- a/arch/arm/plat-mxc/include/mach/debug-macro.S
+++ /dev/null
@@ -1,51 +0,0 @@
1/* arch/arm/mach-imx/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#include <mach/hardware.h>
14
15#ifdef CONFIG_DEBUG_IMX1_UART
16#define UART_PADDR MX1_UART1_BASE_ADDR
17#elif defined (CONFIG_DEBUG_IMX25_UART)
18#define UART_PADDR MX25_UART1_BASE_ADDR
19#elif defined (CONFIG_DEBUG_IMX21_IMX27_UART)
20#define UART_PADDR MX2x_UART1_BASE_ADDR
21#elif defined (CONFIG_DEBUG_IMX31_IMX35_UART)
22#define UART_PADDR MX3x_UART1_BASE_ADDR
23#elif defined (CONFIG_DEBUG_IMX51_UART)
24#define UART_PADDR MX51_UART1_BASE_ADDR
25#elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
26#define UART_PADDR MX53_UART1_BASE_ADDR
27#elif defined (CONFIG_DEBUG_IMX6Q_UART2)
28#define UART_PADDR MX6Q_UART2_BASE_ADDR
29#elif defined (CONFIG_DEBUG_IMX6Q_UART4)
30#define UART_PADDR MX6Q_UART4_BASE_ADDR
31#endif
32
33#define UART_VADDR IMX_IO_ADDRESS(UART_PADDR)
34
35 .macro addruart, rp, rv, tmp
36 ldr \rp, =UART_PADDR @ physical
37 ldr \rv, =UART_VADDR @ virtual
38 .endm
39
40 .macro senduart,rd,rx
41 str \rd, [\rx, #0x40] @ TXDATA
42 .endm
43
44 .macro waituart,rd,rx
45 .endm
46
47 .macro busyuart,rd,rx
481002: ldr \rd, [\rx, #0x98] @ SR2
49 tst \rd, #1 << 3 @ TXDC
50 beq 1002b @ wait until transmit done
51 .endm
diff --git a/arch/arm/plat-mxc/include/mach/ipu.h b/arch/arm/plat-mxc/include/mach/ipu.h
deleted file mode 100644
index 539e559d18b2..000000000000
--- a/arch/arm/plat-mxc/include/mach/ipu.h
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2 * Copyright (C) 2008
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
4 *
5 * Copyright (C) 2005-2007 Freescale Semiconductor, 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 version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef _IPU_H_
13#define _IPU_H_
14
15#include <linux/types.h>
16#include <linux/dmaengine.h>
17
18/* IPU DMA Controller channel definitions. */
19enum ipu_channel {
20 IDMAC_IC_0 = 0, /* IC (encoding task) to memory */
21 IDMAC_IC_1 = 1, /* IC (viewfinder task) to memory */
22 IDMAC_ADC_0 = 1,
23 IDMAC_IC_2 = 2,
24 IDMAC_ADC_1 = 2,
25 IDMAC_IC_3 = 3,
26 IDMAC_IC_4 = 4,
27 IDMAC_IC_5 = 5,
28 IDMAC_IC_6 = 6,
29 IDMAC_IC_7 = 7, /* IC (sensor data) to memory */
30 IDMAC_IC_8 = 8,
31 IDMAC_IC_9 = 9,
32 IDMAC_IC_10 = 10,
33 IDMAC_IC_11 = 11,
34 IDMAC_IC_12 = 12,
35 IDMAC_IC_13 = 13,
36 IDMAC_SDC_0 = 14, /* Background synchronous display data */
37 IDMAC_SDC_1 = 15, /* Foreground data (overlay) */
38 IDMAC_SDC_2 = 16,
39 IDMAC_SDC_3 = 17,
40 IDMAC_ADC_2 = 18,
41 IDMAC_ADC_3 = 19,
42 IDMAC_ADC_4 = 20,
43 IDMAC_ADC_5 = 21,
44 IDMAC_ADC_6 = 22,
45 IDMAC_ADC_7 = 23,
46 IDMAC_PF_0 = 24,
47 IDMAC_PF_1 = 25,
48 IDMAC_PF_2 = 26,
49 IDMAC_PF_3 = 27,
50 IDMAC_PF_4 = 28,
51 IDMAC_PF_5 = 29,
52 IDMAC_PF_6 = 30,
53 IDMAC_PF_7 = 31,
54};
55
56/* Order significant! */
57enum ipu_channel_status {
58 IPU_CHANNEL_FREE,
59 IPU_CHANNEL_INITIALIZED,
60 IPU_CHANNEL_READY,
61 IPU_CHANNEL_ENABLED,
62};
63
64#define IPU_CHANNELS_NUM 32
65
66enum pixel_fmt {
67 /* 1 byte */
68 IPU_PIX_FMT_GENERIC,
69 IPU_PIX_FMT_RGB332,
70 IPU_PIX_FMT_YUV420P,
71 IPU_PIX_FMT_YUV422P,
72 IPU_PIX_FMT_YUV420P2,
73 IPU_PIX_FMT_YVU422P,
74 /* 2 bytes */
75 IPU_PIX_FMT_RGB565,
76 IPU_PIX_FMT_RGB666,
77 IPU_PIX_FMT_BGR666,
78 IPU_PIX_FMT_YUYV,
79 IPU_PIX_FMT_UYVY,
80 /* 3 bytes */
81 IPU_PIX_FMT_RGB24,
82 IPU_PIX_FMT_BGR24,
83 /* 4 bytes */
84 IPU_PIX_FMT_GENERIC_32,
85 IPU_PIX_FMT_RGB32,
86 IPU_PIX_FMT_BGR32,
87 IPU_PIX_FMT_ABGR32,
88 IPU_PIX_FMT_BGRA32,
89 IPU_PIX_FMT_RGBA32,
90};
91
92enum ipu_color_space {
93 IPU_COLORSPACE_RGB,
94 IPU_COLORSPACE_YCBCR,
95 IPU_COLORSPACE_YUV
96};
97
98/*
99 * Enumeration of IPU rotation modes
100 */
101enum ipu_rotate_mode {
102 /* Note the enum values correspond to BAM value */
103 IPU_ROTATE_NONE = 0,
104 IPU_ROTATE_VERT_FLIP = 1,
105 IPU_ROTATE_HORIZ_FLIP = 2,
106 IPU_ROTATE_180 = 3,
107 IPU_ROTATE_90_RIGHT = 4,
108 IPU_ROTATE_90_RIGHT_VFLIP = 5,
109 IPU_ROTATE_90_RIGHT_HFLIP = 6,
110 IPU_ROTATE_90_LEFT = 7,
111};
112
113/*
114 * Enumeration of DI ports for ADC.
115 */
116enum display_port {
117 DISP0,
118 DISP1,
119 DISP2,
120 DISP3
121};
122
123struct idmac_video_param {
124 unsigned short in_width;
125 unsigned short in_height;
126 uint32_t in_pixel_fmt;
127 unsigned short out_width;
128 unsigned short out_height;
129 uint32_t out_pixel_fmt;
130 unsigned short out_stride;
131 bool graphics_combine_en;
132 bool global_alpha_en;
133 bool key_color_en;
134 enum display_port disp;
135 unsigned short out_left;
136 unsigned short out_top;
137};
138
139/*
140 * Union of initialization parameters for a logical channel. So far only video
141 * parameters are used.
142 */
143union ipu_channel_param {
144 struct idmac_video_param video;
145};
146
147struct idmac_tx_desc {
148 struct dma_async_tx_descriptor txd;
149 struct scatterlist *sg; /* scatterlist for this */
150 unsigned int sg_len; /* tx-descriptor. */
151 struct list_head list;
152};
153
154struct idmac_channel {
155 struct dma_chan dma_chan;
156 dma_cookie_t completed; /* last completed cookie */
157 union ipu_channel_param params;
158 enum ipu_channel link; /* input channel, linked to the output */
159 enum ipu_channel_status status;
160 void *client; /* Only one client per channel */
161 unsigned int n_tx_desc;
162 struct idmac_tx_desc *desc; /* allocated tx-descriptors */
163 struct scatterlist *sg[2]; /* scatterlist elements in buffer-0 and -1 */
164 struct list_head free_list; /* free tx-descriptors */
165 struct list_head queue; /* queued tx-descriptors */
166 spinlock_t lock; /* protects sg[0,1], queue */
167 struct mutex chan_mutex; /* protects status, cookie, free_list */
168 bool sec_chan_en;
169 int active_buffer;
170 unsigned int eof_irq;
171 char eof_name[16]; /* EOF IRQ name for request_irq() */
172};
173
174#define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
175#define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
176
177#endif
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
deleted file mode 100644
index d73f5e8ea9cb..000000000000
--- a/arch/arm/plat-mxc/include/mach/irqs.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_IRQS_H__
12#define __ASM_ARCH_MXC_IRQS_H__
13
14extern int imx_irq_set_priority(unsigned char irq, unsigned char prio);
15
16/* all normal IRQs can be FIQs */
17#define FIQ_START 0
18/* switch between IRQ and FIQ */
19extern int mxc_set_irq_fiq(unsigned int irq, unsigned int type);
20
21#endif /* __ASM_ARCH_MXC_IRQS_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/timex.h b/arch/arm/plat-mxc/include/mach/timex.h
deleted file mode 100644
index 10343d1f87e1..000000000000
--- a/arch/arm/plat-mxc/include/mach/timex.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright (C) 1999 ARM Limited
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
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#ifndef __ASM_ARCH_MXC_TIMEX_H__
17#define __ASM_ARCH_MXC_TIMEX_H__
18
19/* Bogus value */
20#define CLOCK_TICK_RATE 12345678
21
22#endif /* __ASM_ARCH_MXC_TIMEX_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
deleted file mode 100644
index 477971b00930..000000000000
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * arch/arm/plat-mxc/include/mach/uncompress.h
3 *
4 * Copyright (C) 1999 ARM Limited
5 * Copyright (C) Shane Nay (shane@minirl.com)
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17#ifndef __ASM_ARCH_MXC_UNCOMPRESS_H__
18#define __ASM_ARCH_MXC_UNCOMPRESS_H__
19
20#define __MXC_BOOT_UNCOMPRESS
21
22#include <asm/mach-types.h>
23
24unsigned long uart_base;
25
26#define UART(x) (*(volatile unsigned long *)(uart_base + (x)))
27
28#define USR2 0x98
29#define USR2_TXFE (1<<14)
30#define TXR 0x40
31#define UCR1 0x80
32#define UCR1_UARTEN 1
33
34/*
35 * The following code assumes the serial port has already been
36 * initialized by the bootloader. We search for the first enabled
37 * port in the most probable order. If you didn't setup a port in
38 * your bootloader then nothing will appear (which might be desired).
39 *
40 * This does not append a newline
41 */
42
43static void putc(int ch)
44{
45 if (!uart_base)
46 return;
47 if (!(UART(UCR1) & UCR1_UARTEN))
48 return;
49
50 while (!(UART(USR2) & USR2_TXFE))
51 barrier();
52
53 UART(TXR) = ch;
54}
55
56static inline void flush(void)
57{
58}
59
60#define MX1_UART1_BASE_ADDR 0x00206000
61#define MX25_UART1_BASE_ADDR 0x43f90000
62#define MX2X_UART1_BASE_ADDR 0x1000a000
63#define MX3X_UART1_BASE_ADDR 0x43F90000
64#define MX3X_UART2_BASE_ADDR 0x43F94000
65#define MX3X_UART5_BASE_ADDR 0x43FB4000
66#define MX51_UART1_BASE_ADDR 0x73fbc000
67#define MX50_UART1_BASE_ADDR 0x53fbc000
68#define MX53_UART1_BASE_ADDR 0x53fbc000
69
70static __inline__ void __arch_decomp_setup(unsigned long arch_id)
71{
72 switch (arch_id) {
73 case MACH_TYPE_MX1ADS:
74 case MACH_TYPE_SCB9328:
75 uart_base = MX1_UART1_BASE_ADDR;
76 break;
77 case MACH_TYPE_MX25_3DS:
78 uart_base = MX25_UART1_BASE_ADDR;
79 break;
80 case MACH_TYPE_IMX27LITE:
81 case MACH_TYPE_MX27_3DS:
82 case MACH_TYPE_MX27ADS:
83 case MACH_TYPE_PCM038:
84 case MACH_TYPE_MX21ADS:
85 case MACH_TYPE_PCA100:
86 case MACH_TYPE_MXT_TD60:
87 case MACH_TYPE_IMX27IPCAM:
88 uart_base = MX2X_UART1_BASE_ADDR;
89 break;
90 case MACH_TYPE_MX31LITE:
91 case MACH_TYPE_ARMADILLO5X0:
92 case MACH_TYPE_MX31MOBOARD:
93 case MACH_TYPE_QONG:
94 case MACH_TYPE_MX31_3DS:
95 case MACH_TYPE_PCM037:
96 case MACH_TYPE_MX31ADS:
97 case MACH_TYPE_MX35_3DS:
98 case MACH_TYPE_PCM043:
99 case MACH_TYPE_LILLY1131:
100 case MACH_TYPE_VPR200:
101 case MACH_TYPE_EUKREA_CPUIMX35SD:
102 uart_base = MX3X_UART1_BASE_ADDR;
103 break;
104 case MACH_TYPE_MAGX_ZN5:
105 uart_base = MX3X_UART2_BASE_ADDR;
106 break;
107 case MACH_TYPE_BUG:
108 uart_base = MX3X_UART5_BASE_ADDR;
109 break;
110 case MACH_TYPE_MX51_BABBAGE:
111 case MACH_TYPE_EUKREA_CPUIMX51SD:
112 case MACH_TYPE_MX51_3DS:
113 uart_base = MX51_UART1_BASE_ADDR;
114 break;
115 case MACH_TYPE_MX50_RDP:
116 uart_base = MX50_UART1_BASE_ADDR;
117 break;
118 case MACH_TYPE_MX53_EVK:
119 case MACH_TYPE_MX53_LOCO:
120 case MACH_TYPE_MX53_SMD:
121 case MACH_TYPE_MX53_ARD:
122 uart_base = MX53_UART1_BASE_ADDR;
123 break;
124 default:
125 break;
126 }
127}
128
129#define arch_decomp_setup() __arch_decomp_setup(arch_id)
130#define arch_decomp_wdog()
131
132#endif /* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index dacaee009a4e..8d885848600a 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -3,13 +3,12 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := common.o sram.o clock.o dma.o fb.o counter_32k.o 6obj-y := sram.o dma.o fb.o counter_32k.o
7obj-m := 7obj-m :=
8obj-n := 8obj-n :=
9obj- := 9obj- :=
10 10
11# omap_device support (OMAP2+ only at the moment) 11# omap_device support (OMAP2+ only at the moment)
12obj-$(CONFIG_ARCH_OMAP2PLUS) += omap_device.o
13 12
14obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o 13obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
15obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o 14obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
@@ -20,4 +19,3 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y)
20# OMAP mailbox framework 19# OMAP mailbox framework
21obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o 20obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
22 21
23obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-noop.o
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
deleted file mode 100644
index 9d7ac20ef8f9..000000000000
--- a/arch/arm/plat-omap/clock.c
+++ /dev/null
@@ -1,544 +0,0 @@
1/*
2 * linux/arch/arm/plat-omap/clock.c
3 *
4 * Copyright (C) 2004 - 2008 Nokia corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 *
7 * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/list.h>
16#include <linux/errno.h>
17#include <linux/export.h>
18#include <linux/err.h>
19#include <linux/string.h>
20#include <linux/clk.h>
21#include <linux/mutex.h>
22#include <linux/cpufreq.h>
23#include <linux/io.h>
24
25#include <plat/clock.h>
26
27static LIST_HEAD(clocks);
28static DEFINE_MUTEX(clocks_mutex);
29static DEFINE_SPINLOCK(clockfw_lock);
30
31static struct clk_functions *arch_clock;
32
33/*
34 * Standard clock functions defined in include/linux/clk.h
35 */
36
37int clk_enable(struct clk *clk)
38{
39 unsigned long flags;
40 int ret;
41
42 if (clk == NULL || IS_ERR(clk))
43 return -EINVAL;
44
45 if (!arch_clock || !arch_clock->clk_enable)
46 return -EINVAL;
47
48 spin_lock_irqsave(&clockfw_lock, flags);
49 ret = arch_clock->clk_enable(clk);
50 spin_unlock_irqrestore(&clockfw_lock, flags);
51
52 return ret;
53}
54EXPORT_SYMBOL(clk_enable);
55
56void clk_disable(struct clk *clk)
57{
58 unsigned long flags;
59
60 if (clk == NULL || IS_ERR(clk))
61 return;
62
63 if (!arch_clock || !arch_clock->clk_disable)
64 return;
65
66 spin_lock_irqsave(&clockfw_lock, flags);
67 if (clk->usecount == 0) {
68 pr_err("Trying disable clock %s with 0 usecount\n",
69 clk->name);
70 WARN_ON(1);
71 goto out;
72 }
73
74 arch_clock->clk_disable(clk);
75
76out:
77 spin_unlock_irqrestore(&clockfw_lock, flags);
78}
79EXPORT_SYMBOL(clk_disable);
80
81unsigned long clk_get_rate(struct clk *clk)
82{
83 unsigned long flags;
84 unsigned long ret;
85
86 if (clk == NULL || IS_ERR(clk))
87 return 0;
88
89 spin_lock_irqsave(&clockfw_lock, flags);
90 ret = clk->rate;
91 spin_unlock_irqrestore(&clockfw_lock, flags);
92
93 return ret;
94}
95EXPORT_SYMBOL(clk_get_rate);
96
97/*
98 * Optional clock functions defined in include/linux/clk.h
99 */
100
101long clk_round_rate(struct clk *clk, unsigned long rate)
102{
103 unsigned long flags;
104 long ret;
105
106 if (clk == NULL || IS_ERR(clk))
107 return 0;
108
109 if (!arch_clock || !arch_clock->clk_round_rate)
110 return 0;
111
112 spin_lock_irqsave(&clockfw_lock, flags);
113 ret = arch_clock->clk_round_rate(clk, rate);
114 spin_unlock_irqrestore(&clockfw_lock, flags);
115
116 return ret;
117}
118EXPORT_SYMBOL(clk_round_rate);
119
120int clk_set_rate(struct clk *clk, unsigned long rate)
121{
122 unsigned long flags;
123 int ret = -EINVAL;
124
125 if (clk == NULL || IS_ERR(clk))
126 return ret;
127
128 if (!arch_clock || !arch_clock->clk_set_rate)
129 return ret;
130
131 spin_lock_irqsave(&clockfw_lock, flags);
132 ret = arch_clock->clk_set_rate(clk, rate);
133 if (ret == 0)
134 propagate_rate(clk);
135 spin_unlock_irqrestore(&clockfw_lock, flags);
136
137 return ret;
138}
139EXPORT_SYMBOL(clk_set_rate);
140
141int clk_set_parent(struct clk *clk, struct clk *parent)
142{
143 unsigned long flags;
144 int ret = -EINVAL;
145
146 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
147 return ret;
148
149 if (!arch_clock || !arch_clock->clk_set_parent)
150 return ret;
151
152 spin_lock_irqsave(&clockfw_lock, flags);
153 if (clk->usecount == 0) {
154 ret = arch_clock->clk_set_parent(clk, parent);
155 if (ret == 0)
156 propagate_rate(clk);
157 } else
158 ret = -EBUSY;
159 spin_unlock_irqrestore(&clockfw_lock, flags);
160
161 return ret;
162}
163EXPORT_SYMBOL(clk_set_parent);
164
165struct clk *clk_get_parent(struct clk *clk)
166{
167 return clk->parent;
168}
169EXPORT_SYMBOL(clk_get_parent);
170
171/*
172 * OMAP specific clock functions shared between omap1 and omap2
173 */
174
175int __initdata mpurate;
176
177/*
178 * By default we use the rate set by the bootloader.
179 * You can override this with mpurate= cmdline option.
180 */
181static int __init omap_clk_setup(char *str)
182{
183 get_option(&str, &mpurate);
184
185 if (!mpurate)
186 return 1;
187
188 if (mpurate < 1000)
189 mpurate *= 1000000;
190
191 return 1;
192}
193__setup("mpurate=", omap_clk_setup);
194
195/* Used for clocks that always have same value as the parent clock */
196unsigned long followparent_recalc(struct clk *clk)
197{
198 return clk->parent->rate;
199}
200
201/*
202 * Used for clocks that have the same value as the parent clock,
203 * divided by some factor
204 */
205unsigned long omap_fixed_divisor_recalc(struct clk *clk)
206{
207 WARN_ON(!clk->fixed_div);
208
209 return clk->parent->rate / clk->fixed_div;
210}
211
212void clk_reparent(struct clk *child, struct clk *parent)
213{
214 list_del_init(&child->sibling);
215 if (parent)
216 list_add(&child->sibling, &parent->children);
217 child->parent = parent;
218
219 /* now do the debugfs renaming to reattach the child
220 to the proper parent */
221}
222
223/* Propagate rate to children */
224void propagate_rate(struct clk *tclk)
225{
226 struct clk *clkp;
227
228 list_for_each_entry(clkp, &tclk->children, sibling) {
229 if (clkp->recalc)
230 clkp->rate = clkp->recalc(clkp);
231 propagate_rate(clkp);
232 }
233}
234
235static LIST_HEAD(root_clks);
236
237/**
238 * recalculate_root_clocks - recalculate and propagate all root clocks
239 *
240 * Recalculates all root clocks (clocks with no parent), which if the
241 * clock's .recalc is set correctly, should also propagate their rates.
242 * Called at init.
243 */
244void recalculate_root_clocks(void)
245{
246 struct clk *clkp;
247
248 list_for_each_entry(clkp, &root_clks, sibling) {
249 if (clkp->recalc)
250 clkp->rate = clkp->recalc(clkp);
251 propagate_rate(clkp);
252 }
253}
254
255/**
256 * clk_preinit - initialize any fields in the struct clk before clk init
257 * @clk: struct clk * to initialize
258 *
259 * Initialize any struct clk fields needed before normal clk initialization
260 * can run. No return value.
261 */
262void clk_preinit(struct clk *clk)
263{
264 INIT_LIST_HEAD(&clk->children);
265}
266
267int clk_register(struct clk *clk)
268{
269 if (clk == NULL || IS_ERR(clk))
270 return -EINVAL;
271
272 /*
273 * trap out already registered clocks
274 */
275 if (clk->node.next || clk->node.prev)
276 return 0;
277
278 mutex_lock(&clocks_mutex);
279 if (clk->parent)
280 list_add(&clk->sibling, &clk->parent->children);
281 else
282 list_add(&clk->sibling, &root_clks);
283
284 list_add(&clk->node, &clocks);
285 if (clk->init)
286 clk->init(clk);
287 mutex_unlock(&clocks_mutex);
288
289 return 0;
290}
291EXPORT_SYMBOL(clk_register);
292
293void clk_unregister(struct clk *clk)
294{
295 if (clk == NULL || IS_ERR(clk))
296 return;
297
298 mutex_lock(&clocks_mutex);
299 list_del(&clk->sibling);
300 list_del(&clk->node);
301 mutex_unlock(&clocks_mutex);
302}
303EXPORT_SYMBOL(clk_unregister);
304
305void clk_enable_init_clocks(void)
306{
307 struct clk *clkp;
308
309 list_for_each_entry(clkp, &clocks, node) {
310 if (clkp->flags & ENABLE_ON_INIT)
311 clk_enable(clkp);
312 }
313}
314
315int omap_clk_enable_autoidle_all(void)
316{
317 struct clk *c;
318 unsigned long flags;
319
320 spin_lock_irqsave(&clockfw_lock, flags);
321
322 list_for_each_entry(c, &clocks, node)
323 if (c->ops->allow_idle)
324 c->ops->allow_idle(c);
325
326 spin_unlock_irqrestore(&clockfw_lock, flags);
327
328 return 0;
329}
330
331int omap_clk_disable_autoidle_all(void)
332{
333 struct clk *c;
334 unsigned long flags;
335
336 spin_lock_irqsave(&clockfw_lock, flags);
337
338 list_for_each_entry(c, &clocks, node)
339 if (c->ops->deny_idle)
340 c->ops->deny_idle(c);
341
342 spin_unlock_irqrestore(&clockfw_lock, flags);
343
344 return 0;
345}
346
347/*
348 * Low level helpers
349 */
350static int clkll_enable_null(struct clk *clk)
351{
352 return 0;
353}
354
355static void clkll_disable_null(struct clk *clk)
356{
357}
358
359const struct clkops clkops_null = {
360 .enable = clkll_enable_null,
361 .disable = clkll_disable_null,
362};
363
364/*
365 * Dummy clock
366 *
367 * Used for clock aliases that are needed on some OMAPs, but not others
368 */
369struct clk dummy_ck = {
370 .name = "dummy",
371 .ops = &clkops_null,
372};
373
374/*
375 *
376 */
377
378#ifdef CONFIG_OMAP_RESET_CLOCKS
379/*
380 * Disable any unused clocks left on by the bootloader
381 */
382static int __init clk_disable_unused(void)
383{
384 struct clk *ck;
385 unsigned long flags;
386
387 if (!arch_clock || !arch_clock->clk_disable_unused)
388 return 0;
389
390 pr_info("clock: disabling unused clocks to save power\n");
391
392 spin_lock_irqsave(&clockfw_lock, flags);
393 list_for_each_entry(ck, &clocks, node) {
394 if (ck->ops == &clkops_null)
395 continue;
396
397 if (ck->usecount > 0 || !ck->enable_reg)
398 continue;
399
400 arch_clock->clk_disable_unused(ck);
401 }
402 spin_unlock_irqrestore(&clockfw_lock, flags);
403
404 return 0;
405}
406late_initcall(clk_disable_unused);
407late_initcall(omap_clk_enable_autoidle_all);
408#endif
409
410int __init clk_init(struct clk_functions * custom_clocks)
411{
412 if (!custom_clocks) {
413 pr_err("No custom clock functions registered\n");
414 BUG();
415 }
416
417 arch_clock = custom_clocks;
418
419 return 0;
420}
421
422#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
423/*
424 * debugfs support to trace clock tree hierarchy and attributes
425 */
426
427#include <linux/debugfs.h>
428#include <linux/seq_file.h>
429
430static struct dentry *clk_debugfs_root;
431
432static int clk_dbg_show_summary(struct seq_file *s, void *unused)
433{
434 struct clk *c;
435 struct clk *pa;
436
437 mutex_lock(&clocks_mutex);
438 seq_printf(s, "%-30s %-30s %-10s %s\n",
439 "clock-name", "parent-name", "rate", "use-count");
440
441 list_for_each_entry(c, &clocks, node) {
442 pa = c->parent;
443 seq_printf(s, "%-30s %-30s %-10lu %d\n",
444 c->name, pa ? pa->name : "none", c->rate, c->usecount);
445 }
446 mutex_unlock(&clocks_mutex);
447
448 return 0;
449}
450
451static int clk_dbg_open(struct inode *inode, struct file *file)
452{
453 return single_open(file, clk_dbg_show_summary, inode->i_private);
454}
455
456static const struct file_operations debug_clock_fops = {
457 .open = clk_dbg_open,
458 .read = seq_read,
459 .llseek = seq_lseek,
460 .release = single_release,
461};
462
463static int clk_debugfs_register_one(struct clk *c)
464{
465 int err;
466 struct dentry *d;
467 struct clk *pa = c->parent;
468
469 d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root);
470 if (!d)
471 return -ENOMEM;
472 c->dent = d;
473
474 d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usecount);
475 if (!d) {
476 err = -ENOMEM;
477 goto err_out;
478 }
479 d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
480 if (!d) {
481 err = -ENOMEM;
482 goto err_out;
483 }
484 d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
485 if (!d) {
486 err = -ENOMEM;
487 goto err_out;
488 }
489 return 0;
490
491err_out:
492 debugfs_remove_recursive(c->dent);
493 return err;
494}
495
496static int clk_debugfs_register(struct clk *c)
497{
498 int err;
499 struct clk *pa = c->parent;
500
501 if (pa && !pa->dent) {
502 err = clk_debugfs_register(pa);
503 if (err)
504 return err;
505 }
506
507 if (!c->dent) {
508 err = clk_debugfs_register_one(c);
509 if (err)
510 return err;
511 }
512 return 0;
513}
514
515static int __init clk_debugfs_init(void)
516{
517 struct clk *c;
518 struct dentry *d;
519 int err;
520
521 d = debugfs_create_dir("clock", NULL);
522 if (!d)
523 return -ENOMEM;
524 clk_debugfs_root = d;
525
526 list_for_each_entry(c, &clocks, node) {
527 err = clk_debugfs_register(c);
528 if (err)
529 goto err_out;
530 }
531
532 d = debugfs_create_file("summary", S_IRUGO,
533 d, NULL, &debug_clock_fops);
534 if (!d)
535 return -ENOMEM;
536
537 return 0;
538err_out:
539 debugfs_remove_recursive(clk_debugfs_root);
540 return err;
541}
542late_initcall(clk_debugfs_init);
543
544#endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
deleted file mode 100644
index 111315a69354..000000000000
--- a/arch/arm/plat-omap/common.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * linux/arch/arm/plat-omap/common.c
3 *
4 * Code common to all OMAP machines.
5 * The file is created by Tony Lindgren <tony@atomide.com>
6 *
7 * Copyright (C) 2009 Texas Instruments
8 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/io.h>
17#include <linux/dma-mapping.h>
18
19#include <plat/common.h>
20#include <plat/vram.h>
21#include <linux/platform_data/dsp-omap.h>
22#include <plat/dma.h>
23
24#include <plat/omap-secure.h>
25
26void __init omap_reserve(void)
27{
28 omap_vram_reserve_sdram_memblock();
29 omap_dsp_reserve_sdram_memblock();
30 omap_secure_ram_reserve_memblock();
31 omap_barrier_reserve_memblock();
32}
33
34void __init omap_init_consistent_dma_size(void)
35{
36#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
37 init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
38#endif
39}
40
41/*
42 * Stub function for OMAP2 so that common files
43 * continue to build when custom builds are used
44 */
45int __weak omap_secure_ram_reserve_memblock(void)
46{
47 return 0;
48}
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index 87ba8dd0d791..f3771cdb9838 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -22,9 +22,6 @@
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23#include <asm/sched_clock.h> 23#include <asm/sched_clock.h>
24 24
25#include <plat/common.h>
26#include <plat/clock.h>
27
28/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */ 25/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */
29#define OMAP2_32KSYNCNT_REV_OFF 0x0 26#define OMAP2_32KSYNCNT_REV_OFF 0x0
30#define OMAP2_32KSYNCNT_REV_SCHEME (0x3 << 30) 27#define OMAP2_32KSYNCNT_REV_SCHEME (0x3 << 30)
diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c
index 5a4678edd65a..a609e2161817 100644
--- a/arch/arm/plat-omap/debug-devices.c
+++ b/arch/arm/plat-omap/debug-devices.c
@@ -15,8 +15,7 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/smc91x.h> 16#include <linux/smc91x.h>
17 17
18#include <mach/hardware.h> 18#include <plat/debug-devices.h>
19#include "../mach-omap2/debug-devices.h"
20 19
21/* Many OMAP development platforms reuse the same "debug board"; these 20/* Many OMAP development platforms reuse the same "debug board"; these
22 * platforms include H2, H3, H4, and Perseus2. 21 * platforms include H2, H3, H4, and Perseus2.
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c
index ea29bbe8e5cf..c43ea21f33b4 100644
--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -17,16 +17,33 @@
17#include <linux/platform_data/gpio-omap.h> 17#include <linux/platform_data/gpio-omap.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19 19
20#include <mach/hardware.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22 21
23#include <plat/fpga.h>
24
25/* Many OMAP development platforms reuse the same "debug board"; these 22/* Many OMAP development platforms reuse the same "debug board"; these
26 * platforms include H2, H3, H4, and Perseus2. There are 16 LEDs on the 23 * platforms include H2, H3, H4, and Perseus2. There are 16 LEDs on the
27 * debug board (all green), accessed through FPGA registers. 24 * debug board (all green), accessed through FPGA registers.
28 */ 25 */
29 26
27/* NOTE: most boards don't have a static mapping for the FPGA ... */
28struct h2p2_dbg_fpga {
29 /* offset 0x00 */
30 u16 smc91x[8];
31 /* offset 0x10 */
32 u16 fpga_rev;
33 u16 board_rev;
34 u16 gpio_outputs;
35 u16 leds;
36 /* offset 0x18 */
37 u16 misc_inputs;
38 u16 lan_status;
39 u16 lan_reset;
40 u16 reserved0;
41 /* offset 0x20 */
42 u16 ps2_data;
43 u16 ps2_ctrl;
44 /* plus also 4 rs232 ports ... */
45};
46
30static struct h2p2_dbg_fpga __iomem *fpga; 47static struct h2p2_dbg_fpga __iomem *fpga;
31 48
32static u16 fpga_led_state; 49static u16 fpga_led_state;
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index c76ed8bff838..c288b76f8e6c 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -36,9 +36,7 @@
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/delay.h> 37#include <linux/delay.h>
38 38
39#include <plat/cpu.h> 39#include <plat-omap/dma-omap.h>
40#include <plat/dma.h>
41#include <plat/tc.h>
42 40
43/* 41/*
44 * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA 42 * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA
@@ -175,12 +173,13 @@ static inline void set_gdma_dev(int req, int dev)
175#define omap_writel(val, reg) do {} while (0) 173#define omap_writel(val, reg) do {} while (0)
176#endif 174#endif
177 175
176#ifdef CONFIG_ARCH_OMAP1
178void omap_set_dma_priority(int lch, int dst_port, int priority) 177void omap_set_dma_priority(int lch, int dst_port, int priority)
179{ 178{
180 unsigned long reg; 179 unsigned long reg;
181 u32 l; 180 u32 l;
182 181
183 if (cpu_class_is_omap1()) { 182 if (dma_omap1()) {
184 switch (dst_port) { 183 switch (dst_port) {
185 case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */ 184 case OMAP_DMA_PORT_OCP_T1: /* FFFECC00 */
186 reg = OMAP_TC_OCPT1_PRIOR; 185 reg = OMAP_TC_OCPT1_PRIOR;
@@ -203,18 +202,22 @@ void omap_set_dma_priority(int lch, int dst_port, int priority)
203 l |= (priority & 0xf) << 8; 202 l |= (priority & 0xf) << 8;
204 omap_writel(l, reg); 203 omap_writel(l, reg);
205 } 204 }
205}
206#endif
206 207
207 if (cpu_class_is_omap2()) { 208#ifdef CONFIG_ARCH_OMAP2PLUS
208 u32 ccr; 209void omap_set_dma_priority(int lch, int dst_port, int priority)
210{
211 u32 ccr;
209 212
210 ccr = p->dma_read(CCR, lch); 213 ccr = p->dma_read(CCR, lch);
211 if (priority) 214 if (priority)
212 ccr |= (1 << 6); 215 ccr |= (1 << 6);
213 else 216 else
214 ccr &= ~(1 << 6); 217 ccr &= ~(1 << 6);
215 p->dma_write(ccr, CCR, lch); 218 p->dma_write(ccr, CCR, lch);
216 }
217} 219}
220#endif
218EXPORT_SYMBOL(omap_set_dma_priority); 221EXPORT_SYMBOL(omap_set_dma_priority);
219 222
220void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, 223void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
@@ -228,7 +231,7 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
228 l |= data_type; 231 l |= data_type;
229 p->dma_write(l, CSDP, lch); 232 p->dma_write(l, CSDP, lch);
230 233
231 if (cpu_class_is_omap1()) { 234 if (dma_omap1()) {
232 u16 ccr; 235 u16 ccr;
233 236
234 ccr = p->dma_read(CCR, lch); 237 ccr = p->dma_read(CCR, lch);
@@ -244,7 +247,7 @@ void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
244 p->dma_write(ccr, CCR2, lch); 247 p->dma_write(ccr, CCR2, lch);
245 } 248 }
246 249
247 if (cpu_class_is_omap2() && dma_trigger) { 250 if (dma_omap2plus() && dma_trigger) {
248 u32 val; 251 u32 val;
249 252
250 val = p->dma_read(CCR, lch); 253 val = p->dma_read(CCR, lch);
@@ -284,7 +287,7 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
284{ 287{
285 BUG_ON(omap_dma_in_1510_mode()); 288 BUG_ON(omap_dma_in_1510_mode());
286 289
287 if (cpu_class_is_omap1()) { 290 if (dma_omap1()) {
288 u16 w; 291 u16 w;
289 292
290 w = p->dma_read(CCR2, lch); 293 w = p->dma_read(CCR2, lch);
@@ -314,7 +317,7 @@ void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, u32 color)
314 p->dma_write(w, LCH_CTRL, lch); 317 p->dma_write(w, LCH_CTRL, lch);
315 } 318 }
316 319
317 if (cpu_class_is_omap2()) { 320 if (dma_omap2plus()) {
318 u32 val; 321 u32 val;
319 322
320 val = p->dma_read(CCR, lch); 323 val = p->dma_read(CCR, lch);
@@ -342,7 +345,7 @@ EXPORT_SYMBOL(omap_set_dma_color_mode);
342 345
343void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode) 346void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode)
344{ 347{
345 if (cpu_class_is_omap2()) { 348 if (dma_omap2plus()) {
346 u32 csdp; 349 u32 csdp;
347 350
348 csdp = p->dma_read(CSDP, lch); 351 csdp = p->dma_read(CSDP, lch);
@@ -355,7 +358,7 @@ EXPORT_SYMBOL(omap_set_dma_write_mode);
355 358
356void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode) 359void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode)
357{ 360{
358 if (cpu_class_is_omap1() && !cpu_is_omap15xx()) { 361 if (dma_omap1() && !dma_omap15xx()) {
359 u32 l; 362 u32 l;
360 363
361 l = p->dma_read(LCH_CTRL, lch); 364 l = p->dma_read(LCH_CTRL, lch);
@@ -373,7 +376,7 @@ void omap_set_dma_src_params(int lch, int src_port, int src_amode,
373{ 376{
374 u32 l; 377 u32 l;
375 378
376 if (cpu_class_is_omap1()) { 379 if (dma_omap1()) {
377 u16 w; 380 u16 w;
378 381
379 w = p->dma_read(CSDP, lch); 382 w = p->dma_read(CSDP, lch);
@@ -415,7 +418,7 @@ EXPORT_SYMBOL(omap_set_dma_params);
415 418
416void omap_set_dma_src_index(int lch, int eidx, int fidx) 419void omap_set_dma_src_index(int lch, int eidx, int fidx)
417{ 420{
418 if (cpu_class_is_omap2()) 421 if (dma_omap2plus())
419 return; 422 return;
420 423
421 p->dma_write(eidx, CSEI, lch); 424 p->dma_write(eidx, CSEI, lch);
@@ -447,13 +450,13 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
447 case OMAP_DMA_DATA_BURST_DIS: 450 case OMAP_DMA_DATA_BURST_DIS:
448 break; 451 break;
449 case OMAP_DMA_DATA_BURST_4: 452 case OMAP_DMA_DATA_BURST_4:
450 if (cpu_class_is_omap2()) 453 if (dma_omap2plus())
451 burst = 0x1; 454 burst = 0x1;
452 else 455 else
453 burst = 0x2; 456 burst = 0x2;
454 break; 457 break;
455 case OMAP_DMA_DATA_BURST_8: 458 case OMAP_DMA_DATA_BURST_8:
456 if (cpu_class_is_omap2()) { 459 if (dma_omap2plus()) {
457 burst = 0x2; 460 burst = 0x2;
458 break; 461 break;
459 } 462 }
@@ -463,7 +466,7 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
463 * fall through 466 * fall through
464 */ 467 */
465 case OMAP_DMA_DATA_BURST_16: 468 case OMAP_DMA_DATA_BURST_16:
466 if (cpu_class_is_omap2()) { 469 if (dma_omap2plus()) {
467 burst = 0x3; 470 burst = 0x3;
468 break; 471 break;
469 } 472 }
@@ -487,7 +490,7 @@ void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
487{ 490{
488 u32 l; 491 u32 l;
489 492
490 if (cpu_class_is_omap1()) { 493 if (dma_omap1()) {
491 l = p->dma_read(CSDP, lch); 494 l = p->dma_read(CSDP, lch);
492 l &= ~(0x1f << 9); 495 l &= ~(0x1f << 9);
493 l |= dest_port << 9; 496 l |= dest_port << 9;
@@ -508,7 +511,7 @@ EXPORT_SYMBOL(omap_set_dma_dest_params);
508 511
509void omap_set_dma_dest_index(int lch, int eidx, int fidx) 512void omap_set_dma_dest_index(int lch, int eidx, int fidx)
510{ 513{
511 if (cpu_class_is_omap2()) 514 if (dma_omap2plus())
512 return; 515 return;
513 516
514 p->dma_write(eidx, CDEI, lch); 517 p->dma_write(eidx, CDEI, lch);
@@ -540,19 +543,19 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
540 case OMAP_DMA_DATA_BURST_DIS: 543 case OMAP_DMA_DATA_BURST_DIS:
541 break; 544 break;
542 case OMAP_DMA_DATA_BURST_4: 545 case OMAP_DMA_DATA_BURST_4:
543 if (cpu_class_is_omap2()) 546 if (dma_omap2plus())
544 burst = 0x1; 547 burst = 0x1;
545 else 548 else
546 burst = 0x2; 549 burst = 0x2;
547 break; 550 break;
548 case OMAP_DMA_DATA_BURST_8: 551 case OMAP_DMA_DATA_BURST_8:
549 if (cpu_class_is_omap2()) 552 if (dma_omap2plus())
550 burst = 0x2; 553 burst = 0x2;
551 else 554 else
552 burst = 0x3; 555 burst = 0x3;
553 break; 556 break;
554 case OMAP_DMA_DATA_BURST_16: 557 case OMAP_DMA_DATA_BURST_16:
555 if (cpu_class_is_omap2()) { 558 if (dma_omap2plus()) {
556 burst = 0x3; 559 burst = 0x3;
557 break; 560 break;
558 } 561 }
@@ -573,7 +576,7 @@ EXPORT_SYMBOL(omap_set_dma_dest_burst_mode);
573static inline void omap_enable_channel_irq(int lch) 576static inline void omap_enable_channel_irq(int lch)
574{ 577{
575 /* Clear CSR */ 578 /* Clear CSR */
576 if (cpu_class_is_omap1()) 579 if (dma_omap1())
577 p->dma_read(CSR, lch); 580 p->dma_read(CSR, lch);
578 else 581 else
579 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); 582 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch);
@@ -587,7 +590,7 @@ static inline void omap_disable_channel_irq(int lch)
587 /* disable channel interrupts */ 590 /* disable channel interrupts */
588 p->dma_write(0, CICR, lch); 591 p->dma_write(0, CICR, lch);
589 /* Clear CSR */ 592 /* Clear CSR */
590 if (cpu_class_is_omap1()) 593 if (dma_omap1())
591 p->dma_read(CSR, lch); 594 p->dma_read(CSR, lch);
592 else 595 else
593 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); 596 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch);
@@ -611,7 +614,7 @@ static inline void enable_lnk(int lch)
611 614
612 l = p->dma_read(CLNK_CTRL, lch); 615 l = p->dma_read(CLNK_CTRL, lch);
613 616
614 if (cpu_class_is_omap1()) 617 if (dma_omap1())
615 l &= ~(1 << 14); 618 l &= ~(1 << 14);
616 619
617 /* Set the ENABLE_LNK bits */ 620 /* Set the ENABLE_LNK bits */
@@ -619,7 +622,7 @@ static inline void enable_lnk(int lch)
619 l = dma_chan[lch].next_lch | (1 << 15); 622 l = dma_chan[lch].next_lch | (1 << 15);
620 623
621#ifndef CONFIG_ARCH_OMAP1 624#ifndef CONFIG_ARCH_OMAP1
622 if (cpu_class_is_omap2()) 625 if (dma_omap2plus())
623 if (dma_chan[lch].next_linked_ch != -1) 626 if (dma_chan[lch].next_linked_ch != -1)
624 l = dma_chan[lch].next_linked_ch | (1 << 15); 627 l = dma_chan[lch].next_linked_ch | (1 << 15);
625#endif 628#endif
@@ -636,12 +639,12 @@ static inline void disable_lnk(int lch)
636 /* Disable interrupts */ 639 /* Disable interrupts */
637 omap_disable_channel_irq(lch); 640 omap_disable_channel_irq(lch);
638 641
639 if (cpu_class_is_omap1()) { 642 if (dma_omap1()) {
640 /* Set the STOP_LNK bit */ 643 /* Set the STOP_LNK bit */
641 l |= 1 << 14; 644 l |= 1 << 14;
642 } 645 }
643 646
644 if (cpu_class_is_omap2()) { 647 if (dma_omap2plus()) {
645 /* Clear the ENABLE_LNK bit */ 648 /* Clear the ENABLE_LNK bit */
646 l &= ~(1 << 15); 649 l &= ~(1 << 15);
647 } 650 }
@@ -655,7 +658,7 @@ static inline void omap2_enable_irq_lch(int lch)
655 u32 val; 658 u32 val;
656 unsigned long flags; 659 unsigned long flags;
657 660
658 if (!cpu_class_is_omap2()) 661 if (dma_omap1())
659 return; 662 return;
660 663
661 spin_lock_irqsave(&dma_chan_lock, flags); 664 spin_lock_irqsave(&dma_chan_lock, flags);
@@ -673,7 +676,7 @@ static inline void omap2_disable_irq_lch(int lch)
673 u32 val; 676 u32 val;
674 unsigned long flags; 677 unsigned long flags;
675 678
676 if (!cpu_class_is_omap2()) 679 if (dma_omap1())
677 return; 680 return;
678 681
679 spin_lock_irqsave(&dma_chan_lock, flags); 682 spin_lock_irqsave(&dma_chan_lock, flags);
@@ -712,7 +715,7 @@ int omap_request_dma(int dev_id, const char *dev_name,
712 if (p->clear_lch_regs) 715 if (p->clear_lch_regs)
713 p->clear_lch_regs(free_ch); 716 p->clear_lch_regs(free_ch);
714 717
715 if (cpu_class_is_omap2()) 718 if (dma_omap2plus())
716 omap_clear_dma(free_ch); 719 omap_clear_dma(free_ch);
717 720
718 spin_unlock_irqrestore(&dma_chan_lock, flags); 721 spin_unlock_irqrestore(&dma_chan_lock, flags);
@@ -723,7 +726,7 @@ int omap_request_dma(int dev_id, const char *dev_name,
723 chan->flags = 0; 726 chan->flags = 0;
724 727
725#ifndef CONFIG_ARCH_OMAP1 728#ifndef CONFIG_ARCH_OMAP1
726 if (cpu_class_is_omap2()) { 729 if (dma_omap2plus()) {
727 chan->chain_id = -1; 730 chan->chain_id = -1;
728 chan->next_linked_ch = -1; 731 chan->next_linked_ch = -1;
729 } 732 }
@@ -731,13 +734,13 @@ int omap_request_dma(int dev_id, const char *dev_name,
731 734
732 chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ; 735 chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ;
733 736
734 if (cpu_class_is_omap1()) 737 if (dma_omap1())
735 chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ; 738 chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ;
736 else if (cpu_class_is_omap2()) 739 else if (dma_omap2plus())
737 chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ | 740 chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ |
738 OMAP2_DMA_TRANS_ERR_IRQ; 741 OMAP2_DMA_TRANS_ERR_IRQ;
739 742
740 if (cpu_is_omap16xx()) { 743 if (dma_omap16xx()) {
741 /* If the sync device is set, configure it dynamically. */ 744 /* If the sync device is set, configure it dynamically. */
742 if (dev_id != 0) { 745 if (dev_id != 0) {
743 set_gdma_dev(free_ch + 1, dev_id); 746 set_gdma_dev(free_ch + 1, dev_id);
@@ -748,11 +751,11 @@ int omap_request_dma(int dev_id, const char *dev_name,
748 * id. 751 * id.
749 */ 752 */
750 p->dma_write(dev_id | (1 << 10), CCR, free_ch); 753 p->dma_write(dev_id | (1 << 10), CCR, free_ch);
751 } else if (cpu_is_omap7xx() || cpu_is_omap15xx()) { 754 } else if (dma_omap1()) {
752 p->dma_write(dev_id, CCR, free_ch); 755 p->dma_write(dev_id, CCR, free_ch);
753 } 756 }
754 757
755 if (cpu_class_is_omap2()) { 758 if (dma_omap2plus()) {
756 omap_enable_channel_irq(free_ch); 759 omap_enable_channel_irq(free_ch);
757 omap2_enable_irq_lch(free_ch); 760 omap2_enable_irq_lch(free_ch);
758 } 761 }
@@ -774,7 +777,7 @@ void omap_free_dma(int lch)
774 } 777 }
775 778
776 /* Disable interrupt for logical channel */ 779 /* Disable interrupt for logical channel */
777 if (cpu_class_is_omap2()) 780 if (dma_omap2plus())
778 omap2_disable_irq_lch(lch); 781 omap2_disable_irq_lch(lch);
779 782
780 /* Disable all DMA interrupts for the channel. */ 783 /* Disable all DMA interrupts for the channel. */
@@ -784,7 +787,7 @@ void omap_free_dma(int lch)
784 p->dma_write(0, CCR, lch); 787 p->dma_write(0, CCR, lch);
785 788
786 /* Clear registers */ 789 /* Clear registers */
787 if (cpu_class_is_omap2()) 790 if (dma_omap2plus())
788 omap_clear_dma(lch); 791 omap_clear_dma(lch);
789 792
790 spin_lock_irqsave(&dma_chan_lock, flags); 793 spin_lock_irqsave(&dma_chan_lock, flags);
@@ -810,7 +813,7 @@ omap_dma_set_global_params(int arb_rate, int max_fifo_depth, int tparams)
810{ 813{
811 u32 reg; 814 u32 reg;
812 815
813 if (!cpu_class_is_omap2()) { 816 if (dma_omap1()) {
814 printk(KERN_ERR "FIXME: no %s on 15xx/16xx\n", __func__); 817 printk(KERN_ERR "FIXME: no %s on 15xx/16xx\n", __func__);
815 return; 818 return;
816 } 819 }
@@ -849,7 +852,7 @@ omap_dma_set_prio_lch(int lch, unsigned char read_prio,
849 } 852 }
850 l = p->dma_read(CCR, lch); 853 l = p->dma_read(CCR, lch);
851 l &= ~((1 << 6) | (1 << 26)); 854 l &= ~((1 << 6) | (1 << 26));
852 if (cpu_class_is_omap2() && !cpu_is_omap242x()) 855 if (d->dev_caps & IS_RW_PRIORITY)
853 l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26); 856 l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26);
854 else 857 else
855 l |= ((read_prio & 0x1) << 6); 858 l |= ((read_prio & 0x1) << 6);
@@ -882,7 +885,7 @@ void omap_start_dma(int lch)
882 * The CPC/CDAC register needs to be initialized to zero 885 * The CPC/CDAC register needs to be initialized to zero
883 * before starting dma transfer. 886 * before starting dma transfer.
884 */ 887 */
885 if (cpu_is_omap15xx()) 888 if (dma_omap15xx())
886 p->dma_write(0, CPC, lch); 889 p->dma_write(0, CPC, lch);
887 else 890 else
888 p->dma_write(0, CDAC, lch); 891 p->dma_write(0, CDAC, lch);
@@ -1045,7 +1048,7 @@ dma_addr_t omap_get_dma_src_pos(int lch)
1045{ 1048{
1046 dma_addr_t offset = 0; 1049 dma_addr_t offset = 0;
1047 1050
1048 if (cpu_is_omap15xx()) 1051 if (dma_omap15xx())
1049 offset = p->dma_read(CPC, lch); 1052 offset = p->dma_read(CPC, lch);
1050 else 1053 else
1051 offset = p->dma_read(CSAC, lch); 1054 offset = p->dma_read(CSAC, lch);
@@ -1053,7 +1056,7 @@ dma_addr_t omap_get_dma_src_pos(int lch)
1053 if (IS_DMA_ERRATA(DMA_ERRATA_3_3) && offset == 0) 1056 if (IS_DMA_ERRATA(DMA_ERRATA_3_3) && offset == 0)
1054 offset = p->dma_read(CSAC, lch); 1057 offset = p->dma_read(CSAC, lch);
1055 1058
1056 if (!cpu_is_omap15xx()) { 1059 if (!dma_omap15xx()) {
1057 /* 1060 /*
1058 * CDAC == 0 indicates that the DMA transfer on the channel has 1061 * CDAC == 0 indicates that the DMA transfer on the channel has
1059 * not been started (no data has been transferred so far). 1062 * not been started (no data has been transferred so far).
@@ -1065,7 +1068,7 @@ dma_addr_t omap_get_dma_src_pos(int lch)
1065 offset = p->dma_read(CSSA, lch); 1068 offset = p->dma_read(CSSA, lch);
1066 } 1069 }
1067 1070
1068 if (cpu_class_is_omap1()) 1071 if (dma_omap1())
1069 offset |= (p->dma_read(CSSA, lch) & 0xFFFF0000); 1072 offset |= (p->dma_read(CSSA, lch) & 0xFFFF0000);
1070 1073
1071 return offset; 1074 return offset;
@@ -1084,7 +1087,7 @@ dma_addr_t omap_get_dma_dst_pos(int lch)
1084{ 1087{
1085 dma_addr_t offset = 0; 1088 dma_addr_t offset = 0;
1086 1089
1087 if (cpu_is_omap15xx()) 1090 if (dma_omap15xx())
1088 offset = p->dma_read(CPC, lch); 1091 offset = p->dma_read(CPC, lch);
1089 else 1092 else
1090 offset = p->dma_read(CDAC, lch); 1093 offset = p->dma_read(CDAC, lch);
@@ -1093,7 +1096,7 @@ dma_addr_t omap_get_dma_dst_pos(int lch)
1093 * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is 1096 * omap 3.2/3.3 erratum: sometimes 0 is returned if CSAC/CDAC is
1094 * read before the DMA controller finished disabling the channel. 1097 * read before the DMA controller finished disabling the channel.
1095 */ 1098 */
1096 if (!cpu_is_omap15xx() && offset == 0) { 1099 if (!dma_omap15xx() && offset == 0) {
1097 offset = p->dma_read(CDAC, lch); 1100 offset = p->dma_read(CDAC, lch);
1098 /* 1101 /*
1099 * CDAC == 0 indicates that the DMA transfer on the channel has 1102 * CDAC == 0 indicates that the DMA transfer on the channel has
@@ -1104,7 +1107,7 @@ dma_addr_t omap_get_dma_dst_pos(int lch)
1104 offset = p->dma_read(CDSA, lch); 1107 offset = p->dma_read(CDSA, lch);
1105 } 1108 }
1106 1109
1107 if (cpu_class_is_omap1()) 1110 if (dma_omap1())
1108 offset |= (p->dma_read(CDSA, lch) & 0xFFFF0000); 1111 offset |= (p->dma_read(CDSA, lch) & 0xFFFF0000);
1109 1112
1110 return offset; 1113 return offset;
@@ -1121,7 +1124,7 @@ int omap_dma_running(void)
1121{ 1124{
1122 int lch; 1125 int lch;
1123 1126
1124 if (cpu_class_is_omap1()) 1127 if (dma_omap1())
1125 if (omap_lcd_dma_running()) 1128 if (omap_lcd_dma_running())
1126 return 1; 1129 return 1;
1127 1130
@@ -2024,7 +2027,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2024 dma_chan = d->chan; 2027 dma_chan = d->chan;
2025 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; 2028 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
2026 2029
2027 if (cpu_class_is_omap2()) { 2030 if (dma_omap2plus()) {
2028 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * 2031 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) *
2029 dma_lch_count, GFP_KERNEL); 2032 dma_lch_count, GFP_KERNEL);
2030 if (!dma_linked_lch) { 2033 if (!dma_linked_lch) {
@@ -2036,7 +2039,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2036 spin_lock_init(&dma_chan_lock); 2039 spin_lock_init(&dma_chan_lock);
2037 for (ch = 0; ch < dma_chan_count; ch++) { 2040 for (ch = 0; ch < dma_chan_count; ch++) {
2038 omap_clear_dma(ch); 2041 omap_clear_dma(ch);
2039 if (cpu_class_is_omap2()) 2042 if (dma_omap2plus())
2040 omap2_disable_irq_lch(ch); 2043 omap2_disable_irq_lch(ch);
2041 2044
2042 dma_chan[ch].dev_id = -1; 2045 dma_chan[ch].dev_id = -1;
@@ -2045,7 +2048,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2045 if (ch >= 6 && enable_1510_mode) 2048 if (ch >= 6 && enable_1510_mode)
2046 continue; 2049 continue;
2047 2050
2048 if (cpu_class_is_omap1()) { 2051 if (dma_omap1()) {
2049 /* 2052 /*
2050 * request_irq() doesn't like dev_id (ie. ch) being 2053 * request_irq() doesn't like dev_id (ie. ch) being
2051 * zero, so we have to kludge around this. 2054 * zero, so we have to kludge around this.
@@ -2070,11 +2073,11 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2070 } 2073 }
2071 } 2074 }
2072 2075
2073 if (cpu_class_is_omap2() && !cpu_is_omap242x()) 2076 if (d->dev_caps & IS_RW_PRIORITY)
2074 omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE, 2077 omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE,
2075 DMA_DEFAULT_FIFO_DEPTH, 0); 2078 DMA_DEFAULT_FIFO_DEPTH, 0);
2076 2079
2077 if (cpu_class_is_omap2()) { 2080 if (dma_omap2plus()) {
2078 strcpy(irq_name, "0"); 2081 strcpy(irq_name, "0");
2079 dma_irq = platform_get_irq_byname(pdev, irq_name); 2082 dma_irq = platform_get_irq_byname(pdev, irq_name);
2080 if (dma_irq < 0) { 2083 if (dma_irq < 0) {
@@ -2089,9 +2092,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2089 } 2092 }
2090 } 2093 }
2091 2094
2092 /* reserve dma channels 0 and 1 in high security devices */ 2095 /* reserve dma channels 0 and 1 in high security devices on 34xx */
2093 if (cpu_is_omap34xx() && 2096 if (d->dev_caps & HS_CHANNELS_RESERVED) {
2094 (omap_type() != OMAP2_DEVICE_TYPE_GP)) {
2095 pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n"); 2097 pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n");
2096 dma_chan[0].dev_id = 0; 2098 dma_chan[0].dev_id = 0;
2097 dma_chan[1].dev_id = 1; 2099 dma_chan[1].dev_id = 1;
@@ -2118,7 +2120,7 @@ static int __devexit omap_system_dma_remove(struct platform_device *pdev)
2118{ 2120{
2119 int dma_irq; 2121 int dma_irq;
2120 2122
2121 if (cpu_class_is_omap2()) { 2123 if (dma_omap2plus()) {
2122 char irq_name[4]; 2124 char irq_name[4];
2123 strcpy(irq_name, "0"); 2125 strcpy(irq_name, "0");
2124 dma_irq = platform_get_irq_byname(pdev, irq_name); 2126 dma_irq = platform_get_irq_byname(pdev, irq_name);
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 938b50a33439..9dca23e4d6b0 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -40,11 +40,10 @@
40#include <linux/device.h> 40#include <linux/device.h>
41#include <linux/err.h> 41#include <linux/err.h>
42#include <linux/pm_runtime.h> 42#include <linux/pm_runtime.h>
43#include <linux/of.h>
44#include <linux/of_device.h>
43 45
44#include <plat/dmtimer.h> 46#include <plat/dmtimer.h>
45#include <plat/omap-pm.h>
46
47#include <mach/hardware.h>
48 47
49static u32 omap_reserved_systimers; 48static u32 omap_reserved_systimers;
50static LIST_HEAD(omap_timer_list); 49static LIST_HEAD(omap_timer_list);
@@ -212,6 +211,13 @@ struct omap_dm_timer *omap_dm_timer_request_specific(int id)
212 unsigned long flags; 211 unsigned long flags;
213 int ret = 0; 212 int ret = 0;
214 213
214 /* Requesting timer by ID is not supported when device tree is used */
215 if (of_have_populated_dt()) {
216 pr_warn("%s: Please use omap_dm_timer_request_by_cap()\n",
217 __func__);
218 return NULL;
219 }
220
215 spin_lock_irqsave(&dm_timer_lock, flags); 221 spin_lock_irqsave(&dm_timer_lock, flags);
216 list_for_each_entry(t, &omap_timer_list, node) { 222 list_for_each_entry(t, &omap_timer_list, node) {
217 if (t->pdev->id == id && !t->reserved) { 223 if (t->pdev->id == id && !t->reserved) {
@@ -237,6 +243,58 @@ struct omap_dm_timer *omap_dm_timer_request_specific(int id)
237} 243}
238EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific); 244EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific);
239 245
246/**
247 * omap_dm_timer_request_by_cap - Request a timer by capability
248 * @cap: Bit mask of capabilities to match
249 *
250 * Find a timer based upon capabilities bit mask. Callers of this function
251 * should use the definitions found in the plat/dmtimer.h file under the
252 * comment "timer capabilities used in hwmod database". Returns pointer to
253 * timer handle on success and a NULL pointer on failure.
254 */
255struct omap_dm_timer *omap_dm_timer_request_by_cap(u32 cap)
256{
257 struct omap_dm_timer *timer = NULL, *t;
258 unsigned long flags;
259
260 if (!cap)
261 return NULL;
262
263 spin_lock_irqsave(&dm_timer_lock, flags);
264 list_for_each_entry(t, &omap_timer_list, node) {
265 if ((!t->reserved) && ((t->capability & cap) == cap)) {
266 /*
267 * If timer is not NULL, we have already found one timer
268 * but it was not an exact match because it had more
269 * capabilites that what was required. Therefore,
270 * unreserve the last timer found and see if this one
271 * is a better match.
272 */
273 if (timer)
274 timer->reserved = 0;
275
276 timer = t;
277 timer->reserved = 1;
278
279 /* Exit loop early if we find an exact match */
280 if (t->capability == cap)
281 break;
282 }
283 }
284 spin_unlock_irqrestore(&dm_timer_lock, flags);
285
286 if (timer && omap_dm_timer_prepare(timer)) {
287 timer->reserved = 0;
288 timer = NULL;
289 }
290
291 if (!timer)
292 pr_debug("%s: timer request failed!\n", __func__);
293
294 return timer;
295}
296EXPORT_SYMBOL_GPL(omap_dm_timer_request_by_cap);
297
240int omap_dm_timer_free(struct omap_dm_timer *timer) 298int omap_dm_timer_free(struct omap_dm_timer *timer)
241{ 299{
242 if (unlikely(!timer)) 300 if (unlikely(!timer))
@@ -271,7 +329,7 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
271EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq); 329EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
272 330
273#if defined(CONFIG_ARCH_OMAP1) 331#if defined(CONFIG_ARCH_OMAP1)
274 332#include <mach/hardware.h>
275/** 333/**
276 * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR 334 * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR
277 * @inputmask: current value of idlect mask 335 * @inputmask: current value of idlect mask
@@ -348,7 +406,8 @@ int omap_dm_timer_start(struct omap_dm_timer *timer)
348 omap_dm_timer_enable(timer); 406 omap_dm_timer_enable(timer);
349 407
350 if (!(timer->capability & OMAP_TIMER_ALWON)) { 408 if (!(timer->capability & OMAP_TIMER_ALWON)) {
351 if (omap_pm_get_dev_context_loss_count(&timer->pdev->dev) != 409 if (timer->get_context_loss_count &&
410 timer->get_context_loss_count(&timer->pdev->dev) !=
352 timer->ctx_loss_count) 411 timer->ctx_loss_count)
353 omap_timer_restore_context(timer); 412 omap_timer_restore_context(timer);
354 } 413 }
@@ -377,9 +436,11 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer)
377 436
378 __omap_dm_timer_stop(timer, timer->posted, rate); 437 __omap_dm_timer_stop(timer, timer->posted, rate);
379 438
380 if (!(timer->capability & OMAP_TIMER_ALWON)) 439 if (!(timer->capability & OMAP_TIMER_ALWON)) {
381 timer->ctx_loss_count = 440 if (timer->get_context_loss_count)
382 omap_pm_get_dev_context_loss_count(&timer->pdev->dev); 441 timer->ctx_loss_count =
442 timer->get_context_loss_count(&timer->pdev->dev);
443 }
383 444
384 /* 445 /*
385 * Since the register values are computed and written within 446 * Since the register values are computed and written within
@@ -414,7 +475,7 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
414 * use the clock framework to set the parent clock. To be removed 475 * use the clock framework to set the parent clock. To be removed
415 * once OMAP1 migrated to using clock framework for dmtimers 476 * once OMAP1 migrated to using clock framework for dmtimers
416 */ 477 */
417 if (pdata->set_timer_src) 478 if (pdata && pdata->set_timer_src)
418 return pdata->set_timer_src(timer->pdev, source); 479 return pdata->set_timer_src(timer->pdev, source);
419 480
420 fclk = clk_get(&timer->pdev->dev, "fck"); 481 fclk = clk_get(&timer->pdev->dev, "fck");
@@ -495,7 +556,8 @@ int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
495 omap_dm_timer_enable(timer); 556 omap_dm_timer_enable(timer);
496 557
497 if (!(timer->capability & OMAP_TIMER_ALWON)) { 558 if (!(timer->capability & OMAP_TIMER_ALWON)) {
498 if (omap_pm_get_dev_context_loss_count(&timer->pdev->dev) != 559 if (timer->get_context_loss_count &&
560 timer->get_context_loss_count(&timer->pdev->dev) !=
499 timer->ctx_loss_count) 561 timer->ctx_loss_count)
500 omap_timer_restore_context(timer); 562 omap_timer_restore_context(timer);
501 } 563 }
@@ -695,7 +757,7 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
695 struct device *dev = &pdev->dev; 757 struct device *dev = &pdev->dev;
696 struct dmtimer_platform_data *pdata = pdev->dev.platform_data; 758 struct dmtimer_platform_data *pdata = pdev->dev.platform_data;
697 759
698 if (!pdata) { 760 if (!pdata && !dev->of_node) {
699 dev_err(dev, "%s: no platform data.\n", __func__); 761 dev_err(dev, "%s: no platform data.\n", __func__);
700 return -ENODEV; 762 return -ENODEV;
701 } 763 }
@@ -724,11 +786,24 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
724 return -ENOMEM; 786 return -ENOMEM;
725 } 787 }
726 788
727 timer->id = pdev->id; 789 if (dev->of_node) {
790 if (of_find_property(dev->of_node, "ti,timer-alwon", NULL))
791 timer->capability |= OMAP_TIMER_ALWON;
792 if (of_find_property(dev->of_node, "ti,timer-dsp", NULL))
793 timer->capability |= OMAP_TIMER_HAS_DSP_IRQ;
794 if (of_find_property(dev->of_node, "ti,timer-pwm", NULL))
795 timer->capability |= OMAP_TIMER_HAS_PWM;
796 if (of_find_property(dev->of_node, "ti,timer-secure", NULL))
797 timer->capability |= OMAP_TIMER_SECURE;
798 } else {
799 timer->id = pdev->id;
800 timer->capability = pdata->timer_capability;
801 timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
802 timer->get_context_loss_count = pdata->get_context_loss_count;
803 }
804
728 timer->irq = irq->start; 805 timer->irq = irq->start;
729 timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
730 timer->pdev = pdev; 806 timer->pdev = pdev;
731 timer->capability = pdata->timer_capability;
732 807
733 /* Skip pm_runtime_enable for OMAP1 */ 808 /* Skip pm_runtime_enable for OMAP1 */
734 if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) { 809 if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {
@@ -768,7 +843,8 @@ static int __devexit omap_dm_timer_remove(struct platform_device *pdev)
768 843
769 spin_lock_irqsave(&dm_timer_lock, flags); 844 spin_lock_irqsave(&dm_timer_lock, flags);
770 list_for_each_entry(timer, &omap_timer_list, node) 845 list_for_each_entry(timer, &omap_timer_list, node)
771 if (timer->pdev->id == pdev->id) { 846 if (!strcmp(dev_name(&timer->pdev->dev),
847 dev_name(&pdev->dev))) {
772 list_del(&timer->node); 848 list_del(&timer->node);
773 ret = 0; 849 ret = 0;
774 break; 850 break;
@@ -778,11 +854,18 @@ static int __devexit omap_dm_timer_remove(struct platform_device *pdev)
778 return ret; 854 return ret;
779} 855}
780 856
857static const struct of_device_id omap_timer_match[] = {
858 { .compatible = "ti,omap2-timer", },
859 {},
860};
861MODULE_DEVICE_TABLE(of, omap_timer_match);
862
781static struct platform_driver omap_dm_timer_driver = { 863static struct platform_driver omap_dm_timer_driver = {
782 .probe = omap_dm_timer_probe, 864 .probe = omap_dm_timer_probe,
783 .remove = __devexit_p(omap_dm_timer_remove), 865 .remove = __devexit_p(omap_dm_timer_remove),
784 .driver = { 866 .driver = {
785 .name = "omap_timer", 867 .name = "omap_timer",
868 .of_match_table = of_match_ptr(omap_timer_match),
786 }, 869 },
787}; 870};
788 871
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index bcbb9d5dc293..3a77b30f53d4 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -30,9 +30,69 @@
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/omapfb.h> 31#include <linux/omapfb.h>
32 32
33#include <mach/hardware.h>
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
35 34
35#include <plat/cpu.h>
36
37#ifdef CONFIG_OMAP2_VRFB
38
39/*
40 * The first memory resource is the register region for VRFB,
41 * the rest are VRFB virtual memory areas for each VRFB context.
42 */
43
44static const struct resource omap2_vrfb_resources[] = {
45 DEFINE_RES_MEM_NAMED(0x68008000u, 0x40, "vrfb-regs"),
46 DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
47 DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
48 DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
49 DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
50};
51
52static const struct resource omap3_vrfb_resources[] = {
53 DEFINE_RES_MEM_NAMED(0x6C000180u, 0xc0, "vrfb-regs"),
54 DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"),
55 DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"),
56 DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"),
57 DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"),
58 DEFINE_RES_MEM_NAMED(0xe0000000u, 0x4000000, "vrfb-area-4"),
59 DEFINE_RES_MEM_NAMED(0xe4000000u, 0x4000000, "vrfb-area-5"),
60 DEFINE_RES_MEM_NAMED(0xe8000000u, 0x4000000, "vrfb-area-6"),
61 DEFINE_RES_MEM_NAMED(0xec000000u, 0x4000000, "vrfb-area-7"),
62 DEFINE_RES_MEM_NAMED(0xf0000000u, 0x4000000, "vrfb-area-8"),
63 DEFINE_RES_MEM_NAMED(0xf4000000u, 0x4000000, "vrfb-area-9"),
64 DEFINE_RES_MEM_NAMED(0xf8000000u, 0x4000000, "vrfb-area-10"),
65 DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"),
66};
67
68static int __init omap_init_vrfb(void)
69{
70 struct platform_device *pdev;
71 const struct resource *res;
72 unsigned int num_res;
73
74 if (cpu_is_omap24xx()) {
75 res = omap2_vrfb_resources;
76 num_res = ARRAY_SIZE(omap2_vrfb_resources);
77 } else if (cpu_is_omap34xx()) {
78 res = omap3_vrfb_resources;
79 num_res = ARRAY_SIZE(omap3_vrfb_resources);
80 } else {
81 return 0;
82 }
83
84 pdev = platform_device_register_resndata(NULL, "omapvrfb", -1,
85 res, num_res, NULL, 0);
86
87 if (IS_ERR(pdev))
88 return PTR_ERR(pdev);
89 else
90 return 0;
91}
92
93arch_initcall(omap_init_vrfb);
94#endif
95
36#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 96#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
37 97
38static bool omapfb_lcd_configured; 98static bool omapfb_lcd_configured;
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index a5683a84c6ee..f9df624d108c 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -26,160 +26,18 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <linux/i2c-omap.h>
29#include <linux/slab.h> 30#include <linux/slab.h>
30#include <linux/err.h> 31#include <linux/err.h>
31#include <linux/clk.h> 32#include <linux/clk.h>
32 33
33#include <mach/irqs.h>
34#include <plat/i2c.h> 34#include <plat/i2c.h>
35#include <plat/omap_device.h>
36 35
37#define OMAP_I2C_SIZE 0x3f
38#define OMAP1_I2C_BASE 0xfffb3800
39#define OMAP1_INT_I2C (32 + 4)
40
41static const char name[] = "omap_i2c";
42
43#define I2C_RESOURCE_BUILDER(base, irq) \
44 { \
45 .start = (base), \
46 .end = (base) + OMAP_I2C_SIZE, \
47 .flags = IORESOURCE_MEM, \
48 }, \
49 { \
50 .start = (irq), \
51 .flags = IORESOURCE_IRQ, \
52 },
53
54static struct resource i2c_resources[][2] = {
55 { I2C_RESOURCE_BUILDER(0, 0) },
56};
57
58#define I2C_DEV_BUILDER(bus_id, res, data) \
59 { \
60 .id = (bus_id), \
61 .name = name, \
62 .num_resources = ARRAY_SIZE(res), \
63 .resource = (res), \
64 .dev = { \
65 .platform_data = (data), \
66 }, \
67 }
68
69#define MAX_OMAP_I2C_HWMOD_NAME_LEN 16
70#define OMAP_I2C_MAX_CONTROLLERS 4 36#define OMAP_I2C_MAX_CONTROLLERS 4
71static struct omap_i2c_bus_platform_data i2c_pdata[OMAP_I2C_MAX_CONTROLLERS]; 37static struct omap_i2c_bus_platform_data i2c_pdata[OMAP_I2C_MAX_CONTROLLERS];
72static struct platform_device omap_i2c_devices[] = {
73 I2C_DEV_BUILDER(1, i2c_resources[0], &i2c_pdata[0]),
74};
75 38
76#define OMAP_I2C_CMDLINE_SETUP (BIT(31)) 39#define OMAP_I2C_CMDLINE_SETUP (BIT(31))
77 40
78static int __init omap_i2c_nr_ports(void)
79{
80 int ports = 0;
81
82 if (cpu_class_is_omap1())
83 ports = 1;
84 else if (cpu_is_omap24xx())
85 ports = 2;
86 else if (cpu_is_omap34xx())
87 ports = 3;
88 else if (cpu_is_omap44xx())
89 ports = 4;
90
91 return ports;
92}
93
94static inline int omap1_i2c_add_bus(int bus_id)
95{
96 struct platform_device *pdev;
97 struct omap_i2c_bus_platform_data *pdata;
98 struct resource *res;
99
100 omap1_i2c_mux_pins(bus_id);
101
102 pdev = &omap_i2c_devices[bus_id - 1];
103 res = pdev->resource;
104 res[0].start = OMAP1_I2C_BASE;
105 res[0].end = res[0].start + OMAP_I2C_SIZE;
106 res[1].start = OMAP1_INT_I2C;
107 pdata = &i2c_pdata[bus_id - 1];
108
109 /* all OMAP1 have IP version 1 register set */
110 pdata->rev = OMAP_I2C_IP_VERSION_1;
111
112 /* all OMAP1 I2C are implemented like this */
113 pdata->flags = OMAP_I2C_FLAG_NO_FIFO |
114 OMAP_I2C_FLAG_SIMPLE_CLOCK |
115 OMAP_I2C_FLAG_16BIT_DATA_REG |
116 OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK;
117
118 /* how the cpu bus is wired up differs for 7xx only */
119
120 if (cpu_is_omap7xx())
121 pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_1;
122 else
123 pdata->flags |= OMAP_I2C_FLAG_BUS_SHIFT_2;
124
125 return platform_device_register(pdev);
126}
127
128
129#ifdef CONFIG_ARCH_OMAP2PLUS
130static inline int omap2_i2c_add_bus(int bus_id)
131{
132 int l;
133 struct omap_hwmod *oh;
134 struct platform_device *pdev;
135 char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN];
136 struct omap_i2c_bus_platform_data *pdata;
137 struct omap_i2c_dev_attr *dev_attr;
138
139 omap2_i2c_mux_pins(bus_id);
140
141 l = snprintf(oh_name, MAX_OMAP_I2C_HWMOD_NAME_LEN, "i2c%d", bus_id);
142 WARN(l >= MAX_OMAP_I2C_HWMOD_NAME_LEN,
143 "String buffer overflow in I2C%d device setup\n", bus_id);
144 oh = omap_hwmod_lookup(oh_name);
145 if (!oh) {
146 pr_err("Could not look up %s\n", oh_name);
147 return -EEXIST;
148 }
149
150 pdata = &i2c_pdata[bus_id - 1];
151 /*
152 * pass the hwmod class's CPU-specific knowledge of I2C IP revision in
153 * use, and functionality implementation flags, up to the OMAP I2C
154 * driver via platform data
155 */
156 pdata->rev = oh->class->rev;
157
158 dev_attr = (struct omap_i2c_dev_attr *)oh->dev_attr;
159 pdata->flags = dev_attr->flags;
160
161 pdev = omap_device_build(name, bus_id, oh, pdata,
162 sizeof(struct omap_i2c_bus_platform_data),
163 NULL, 0, 0);
164 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
165
166 return PTR_RET(pdev);
167}
168#else
169static inline int omap2_i2c_add_bus(int bus_id)
170{
171 return 0;
172}
173#endif
174
175static int __init omap_i2c_add_bus(int bus_id)
176{
177 if (cpu_class_is_omap1())
178 return omap1_i2c_add_bus(bus_id);
179 else
180 return omap2_i2c_add_bus(bus_id);
181}
182
183/** 41/**
184 * omap_i2c_bus_setup - Process command line options for the I2C bus speed 42 * omap_i2c_bus_setup - Process command line options for the I2C bus speed
185 * @str: String of options 43 * @str: String of options
@@ -193,12 +51,11 @@ static int __init omap_i2c_add_bus(int bus_id)
193 */ 51 */
194static int __init omap_i2c_bus_setup(char *str) 52static int __init omap_i2c_bus_setup(char *str)
195{ 53{
196 int ports;
197 int ints[3]; 54 int ints[3];
198 55
199 ports = omap_i2c_nr_ports();
200 get_options(str, 3, ints); 56 get_options(str, 3, ints);
201 if (ints[0] < 2 || ints[1] < 1 || ints[1] > ports) 57 if (ints[0] < 2 || ints[1] < 1 ||
58 ints[1] > OMAP_I2C_MAX_CONTROLLERS)
202 return 0; 59 return 0;
203 i2c_pdata[ints[1] - 1].clkrate = ints[2]; 60 i2c_pdata[ints[1] - 1].clkrate = ints[2];
204 i2c_pdata[ints[1] - 1].clkrate |= OMAP_I2C_CMDLINE_SETUP; 61 i2c_pdata[ints[1] - 1].clkrate |= OMAP_I2C_CMDLINE_SETUP;
@@ -218,7 +75,7 @@ static int __init omap_register_i2c_bus_cmdline(void)
218 for (i = 0; i < ARRAY_SIZE(i2c_pdata); i++) 75 for (i = 0; i < ARRAY_SIZE(i2c_pdata); i++)
219 if (i2c_pdata[i].clkrate & OMAP_I2C_CMDLINE_SETUP) { 76 if (i2c_pdata[i].clkrate & OMAP_I2C_CMDLINE_SETUP) {
220 i2c_pdata[i].clkrate &= ~OMAP_I2C_CMDLINE_SETUP; 77 i2c_pdata[i].clkrate &= ~OMAP_I2C_CMDLINE_SETUP;
221 err = omap_i2c_add_bus(i + 1); 78 err = omap_i2c_add_bus(&i2c_pdata[i], i + 1);
222 if (err) 79 if (err)
223 goto out; 80 goto out;
224 } 81 }
@@ -243,7 +100,7 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
243{ 100{
244 int err; 101 int err;
245 102
246 BUG_ON(bus_id < 1 || bus_id > omap_i2c_nr_ports()); 103 BUG_ON(bus_id < 1 || bus_id > OMAP_I2C_MAX_CONTROLLERS);
247 104
248 if (info) { 105 if (info) {
249 err = i2c_register_board_info(bus_id, info, len); 106 err = i2c_register_board_info(bus_id, info, len);
@@ -256,5 +113,5 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
256 113
257 i2c_pdata[bus_id - 1].clkrate &= ~OMAP_I2C_CMDLINE_SETUP; 114 i2c_pdata[bus_id - 1].clkrate &= ~OMAP_I2C_CMDLINE_SETUP;
258 115
259 return omap_i2c_add_bus(bus_id); 116 return omap_i2c_add_bus(&i2c_pdata[bus_id - 1], bus_id);
260} 117}
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat-omap/dma-omap.h
index 0a87b052f8f7..6f506ba9e453 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat-omap/dma-omap.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/dma.h 2 * OMAP DMA handling defines and function
3 * 3 *
4 * Copyright (C) 2003 Nokia Corporation 4 * Copyright (C) 2003 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com> 5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
@@ -23,187 +23,8 @@
23 23
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25 25
26/*
27 * TODO: These dma channel defines should go away once all
28 * the omap drivers hwmod adapted.
29 */
30
31/* Move omap4 specific defines to dma-44xx.h */
32#include "dma-44xx.h"
33
34#define INT_DMA_LCD 25 26#define INT_DMA_LCD 25
35 27
36/* DMA channels for omap1 */
37#define OMAP_DMA_NO_DEVICE 0
38#define OMAP_DMA_MCSI1_TX 1
39#define OMAP_DMA_MCSI1_RX 2
40#define OMAP_DMA_I2C_RX 3
41#define OMAP_DMA_I2C_TX 4
42#define OMAP_DMA_EXT_NDMA_REQ 5
43#define OMAP_DMA_EXT_NDMA_REQ2 6
44#define OMAP_DMA_UWIRE_TX 7
45#define OMAP_DMA_MCBSP1_TX 8
46#define OMAP_DMA_MCBSP1_RX 9
47#define OMAP_DMA_MCBSP3_TX 10
48#define OMAP_DMA_MCBSP3_RX 11
49#define OMAP_DMA_UART1_TX 12
50#define OMAP_DMA_UART1_RX 13
51#define OMAP_DMA_UART2_TX 14
52#define OMAP_DMA_UART2_RX 15
53#define OMAP_DMA_MCBSP2_TX 16
54#define OMAP_DMA_MCBSP2_RX 17
55#define OMAP_DMA_UART3_TX 18
56#define OMAP_DMA_UART3_RX 19
57#define OMAP_DMA_CAMERA_IF_RX 20
58#define OMAP_DMA_MMC_TX 21
59#define OMAP_DMA_MMC_RX 22
60#define OMAP_DMA_NAND 23
61#define OMAP_DMA_IRQ_LCD_LINE 24
62#define OMAP_DMA_MEMORY_STICK 25
63#define OMAP_DMA_USB_W2FC_RX0 26
64#define OMAP_DMA_USB_W2FC_RX1 27
65#define OMAP_DMA_USB_W2FC_RX2 28
66#define OMAP_DMA_USB_W2FC_TX0 29
67#define OMAP_DMA_USB_W2FC_TX1 30
68#define OMAP_DMA_USB_W2FC_TX2 31
69
70/* These are only for 1610 */
71#define OMAP_DMA_CRYPTO_DES_IN 32
72#define OMAP_DMA_SPI_TX 33
73#define OMAP_DMA_SPI_RX 34
74#define OMAP_DMA_CRYPTO_HASH 35
75#define OMAP_DMA_CCP_ATTN 36
76#define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37
77#define OMAP_DMA_CMT_APE_TX_CHAN_0 38
78#define OMAP_DMA_CMT_APE_RV_CHAN_0 39
79#define OMAP_DMA_CMT_APE_TX_CHAN_1 40
80#define OMAP_DMA_CMT_APE_RV_CHAN_1 41
81#define OMAP_DMA_CMT_APE_TX_CHAN_2 42
82#define OMAP_DMA_CMT_APE_RV_CHAN_2 43
83#define OMAP_DMA_CMT_APE_TX_CHAN_3 44
84#define OMAP_DMA_CMT_APE_RV_CHAN_3 45
85#define OMAP_DMA_CMT_APE_TX_CHAN_4 46
86#define OMAP_DMA_CMT_APE_RV_CHAN_4 47
87#define OMAP_DMA_CMT_APE_TX_CHAN_5 48
88#define OMAP_DMA_CMT_APE_RV_CHAN_5 49
89#define OMAP_DMA_CMT_APE_TX_CHAN_6 50
90#define OMAP_DMA_CMT_APE_RV_CHAN_6 51
91#define OMAP_DMA_CMT_APE_TX_CHAN_7 52
92#define OMAP_DMA_CMT_APE_RV_CHAN_7 53
93#define OMAP_DMA_MMC2_TX 54
94#define OMAP_DMA_MMC2_RX 55
95#define OMAP_DMA_CRYPTO_DES_OUT 56
96
97/* DMA channels for 24xx */
98#define OMAP24XX_DMA_NO_DEVICE 0
99#define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */
100#define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */
101#define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */
102#define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */
103#define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */
104#define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */
105#define OMAP242X_DMA_VLYNQ_TX 7 /* S_DMA_6 */
106#define OMAP24XX_DMA_EXT_DMAREQ2 7 /* S_DMA_6 */
107#define OMAP24XX_DMA_CWT 8 /* S_DMA_7 */
108#define OMAP24XX_DMA_AES_TX 9 /* S_DMA_8 */
109#define OMAP24XX_DMA_AES_RX 10 /* S_DMA_9 */
110#define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */
111#define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */
112#define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */
113#define OMAP34XX_DMA_SHA2MD5_RX 13 /* S_DMA_12 */
114#define OMAP242X_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */
115#define OMAP242X_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */
116#define OMAP242X_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */
117#define OMAP242X_DMA_EAC_AC_RD 17 /* S_DMA_16 */
118#define OMAP242X_DMA_EAC_AC_WR 18 /* S_DMA_17 */
119#define OMAP242X_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */
120#define OMAP242X_DMA_EAC_MD_UL_WR 20 /* S_DMA_19 */
121#define OMAP242X_DMA_EAC_MD_DL_RD 21 /* S_DMA_20 */
122#define OMAP242X_DMA_EAC_MD_DL_WR 22 /* S_DMA_21 */
123#define OMAP242X_DMA_EAC_BT_UL_RD 23 /* S_DMA_22 */
124#define OMAP242X_DMA_EAC_BT_UL_WR 24 /* S_DMA_23 */
125#define OMAP242X_DMA_EAC_BT_DL_RD 25 /* S_DMA_24 */
126#define OMAP242X_DMA_EAC_BT_DL_WR 26 /* S_DMA_25 */
127#define OMAP243X_DMA_EXT_DMAREQ3 14 /* S_DMA_13 */
128#define OMAP24XX_DMA_SPI3_TX0 15 /* S_DMA_14 */
129#define OMAP24XX_DMA_SPI3_RX0 16 /* S_DMA_15 */
130#define OMAP24XX_DMA_MCBSP3_TX 17 /* S_DMA_16 */
131#define OMAP24XX_DMA_MCBSP3_RX 18 /* S_DMA_17 */
132#define OMAP24XX_DMA_MCBSP4_TX 19 /* S_DMA_18 */
133#define OMAP24XX_DMA_MCBSP4_RX 20 /* S_DMA_19 */
134#define OMAP24XX_DMA_MCBSP5_TX 21 /* S_DMA_20 */
135#define OMAP24XX_DMA_MCBSP5_RX 22 /* S_DMA_21 */
136#define OMAP24XX_DMA_SPI3_TX1 23 /* S_DMA_22 */
137#define OMAP24XX_DMA_SPI3_RX1 24 /* S_DMA_23 */
138#define OMAP243X_DMA_EXT_DMAREQ4 25 /* S_DMA_24 */
139#define OMAP243X_DMA_EXT_DMAREQ5 26 /* S_DMA_25 */
140#define OMAP34XX_DMA_I2C3_TX 25 /* S_DMA_24 */
141#define OMAP34XX_DMA_I2C3_RX 26 /* S_DMA_25 */
142#define OMAP24XX_DMA_I2C1_TX 27 /* S_DMA_26 */
143#define OMAP24XX_DMA_I2C1_RX 28 /* S_DMA_27 */
144#define OMAP24XX_DMA_I2C2_TX 29 /* S_DMA_28 */
145#define OMAP24XX_DMA_I2C2_RX 30 /* S_DMA_29 */
146#define OMAP24XX_DMA_MCBSP1_TX 31 /* S_DMA_30 */
147#define OMAP24XX_DMA_MCBSP1_RX 32 /* S_DMA_31 */
148#define OMAP24XX_DMA_MCBSP2_TX 33 /* S_DMA_32 */
149#define OMAP24XX_DMA_MCBSP2_RX 34 /* S_DMA_33 */
150#define OMAP24XX_DMA_SPI1_TX0 35 /* S_DMA_34 */
151#define OMAP24XX_DMA_SPI1_RX0 36 /* S_DMA_35 */
152#define OMAP24XX_DMA_SPI1_TX1 37 /* S_DMA_36 */
153#define OMAP24XX_DMA_SPI1_RX1 38 /* S_DMA_37 */
154#define OMAP24XX_DMA_SPI1_TX2 39 /* S_DMA_38 */
155#define OMAP24XX_DMA_SPI1_RX2 40 /* S_DMA_39 */
156#define OMAP24XX_DMA_SPI1_TX3 41 /* S_DMA_40 */
157#define OMAP24XX_DMA_SPI1_RX3 42 /* S_DMA_41 */
158#define OMAP24XX_DMA_SPI2_TX0 43 /* S_DMA_42 */
159#define OMAP24XX_DMA_SPI2_RX0 44 /* S_DMA_43 */
160#define OMAP24XX_DMA_SPI2_TX1 45 /* S_DMA_44 */
161#define OMAP24XX_DMA_SPI2_RX1 46 /* S_DMA_45 */
162#define OMAP24XX_DMA_MMC2_TX 47 /* S_DMA_46 */
163#define OMAP24XX_DMA_MMC2_RX 48 /* S_DMA_47 */
164#define OMAP24XX_DMA_UART1_TX 49 /* S_DMA_48 */
165#define OMAP24XX_DMA_UART1_RX 50 /* S_DMA_49 */
166#define OMAP24XX_DMA_UART2_TX 51 /* S_DMA_50 */
167#define OMAP24XX_DMA_UART2_RX 52 /* S_DMA_51 */
168#define OMAP24XX_DMA_UART3_TX 53 /* S_DMA_52 */
169#define OMAP24XX_DMA_UART3_RX 54 /* S_DMA_53 */
170#define OMAP24XX_DMA_USB_W2FC_TX0 55 /* S_DMA_54 */
171#define OMAP24XX_DMA_USB_W2FC_RX0 56 /* S_DMA_55 */
172#define OMAP24XX_DMA_USB_W2FC_TX1 57 /* S_DMA_56 */
173#define OMAP24XX_DMA_USB_W2FC_RX1 58 /* S_DMA_57 */
174#define OMAP24XX_DMA_USB_W2FC_TX2 59 /* S_DMA_58 */
175#define OMAP24XX_DMA_USB_W2FC_RX2 60 /* S_DMA_59 */
176#define OMAP24XX_DMA_MMC1_TX 61 /* S_DMA_60 */
177#define OMAP24XX_DMA_MMC1_RX 62 /* S_DMA_61 */
178#define OMAP24XX_DMA_MS 63 /* S_DMA_62 */
179#define OMAP242X_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */
180#define OMAP243X_DMA_EXT_DMAREQ6 64 /* S_DMA_63 */
181#define OMAP34XX_DMA_EXT_DMAREQ3 64 /* S_DMA_63 */
182#define OMAP34XX_DMA_AES2_TX 65 /* S_DMA_64 */
183#define OMAP34XX_DMA_AES2_RX 66 /* S_DMA_65 */
184#define OMAP34XX_DMA_DES2_TX 67 /* S_DMA_66 */
185#define OMAP34XX_DMA_DES2_RX 68 /* S_DMA_67 */
186#define OMAP34XX_DMA_SHA1MD5_RX 69 /* S_DMA_68 */
187#define OMAP34XX_DMA_SPI4_TX0 70 /* S_DMA_69 */
188#define OMAP34XX_DMA_SPI4_RX0 71 /* S_DMA_70 */
189#define OMAP34XX_DSS_DMA0 72 /* S_DMA_71 */
190#define OMAP34XX_DSS_DMA1 73 /* S_DMA_72 */
191#define OMAP34XX_DSS_DMA2 74 /* S_DMA_73 */
192#define OMAP34XX_DSS_DMA3 75 /* S_DMA_74 */
193#define OMAP34XX_DMA_MMC3_TX 77 /* S_DMA_76 */
194#define OMAP34XX_DMA_MMC3_RX 78 /* S_DMA_77 */
195#define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */
196#define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */
197
198#define OMAP36XX_DMA_UART4_TX 81 /* S_DMA_80 */
199#define OMAP36XX_DMA_UART4_RX 82 /* S_DMA_81 */
200
201/* Only for AM35xx */
202#define AM35XX_DMA_UART4_TX 54
203#define AM35XX_DMA_UART4_RX 55
204
205/*----------------------------------------------------------------------------*/
206
207#define OMAP1_DMA_TOUT_IRQ (1 << 0) 28#define OMAP1_DMA_TOUT_IRQ (1 << 0)
208#define OMAP_DMA_DROP_IRQ (1 << 1) 29#define OMAP_DMA_DROP_IRQ (1 << 1)
209#define OMAP_DMA_HALF_IRQ (1 << 2) 30#define OMAP_DMA_HALF_IRQ (1 << 2)
@@ -309,10 +130,12 @@
309#define SRC_PORT BIT(0x7) 130#define SRC_PORT BIT(0x7)
310#define DST_PORT BIT(0x8) 131#define DST_PORT BIT(0x8)
311#define SRC_INDEX BIT(0x9) 132#define SRC_INDEX BIT(0x9)
312#define DST_INDEX BIT(0xA) 133#define DST_INDEX BIT(0xa)
313#define IS_BURST_ONLY4 BIT(0xB) 134#define IS_BURST_ONLY4 BIT(0xb)
314#define CLEAR_CSR_ON_READ BIT(0xC) 135#define CLEAR_CSR_ON_READ BIT(0xc)
315#define IS_WORD_16 BIT(0xD) 136#define IS_WORD_16 BIT(0xd)
137#define ENABLE_16XX_MODE BIT(0xe)
138#define HS_CHANNELS_RESERVED BIT(0xf)
316 139
317/* Defines for DMA Capabilities */ 140/* Defines for DMA Capabilities */
318#define DMA_HAS_TRANSPARENT_CAPS (0x1 << 18) 141#define DMA_HAS_TRANSPARENT_CAPS (0x1 << 18)
@@ -449,7 +272,15 @@ struct omap_system_dma_plat_info {
449 u32 (*dma_read)(int reg, int lch); 272 u32 (*dma_read)(int reg, int lch);
450}; 273};
451 274
452extern void __init omap_init_consistent_dma_size(void); 275#ifdef CONFIG_ARCH_OMAP2PLUS
276#define dma_omap2plus() 1
277#else
278#define dma_omap2plus() 0
279#endif
280#define dma_omap1() (!dma_omap2plus())
281#define dma_omap15xx() ((dma_omap1() && (d->dev_caps & ENABLE_1510_MODE)))
282#define dma_omap16xx() ((dma_omap1() && (d->dev_caps & ENABLE_16XX_MODE)))
283
453extern void omap_set_dma_priority(int lch, int dst_port, int priority); 284extern void omap_set_dma_priority(int lch, int dst_port, int priority);
454extern int omap_request_dma(int dev_id, const char *dev_name, 285extern int omap_request_dma(int dev_id, const char *dev_name,
455 void (*callback)(int lch, u16 ch_status, void *data), 286 void (*callback)(int lch, u16 ch_status, void *data),
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
deleted file mode 100644
index 025d85a3ee86..000000000000
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * clkdev <-> OMAP integration
3 *
4 * Russell King <linux@arm.linux.org.uk>
5 *
6 */
7
8#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
9#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
10
11#include <linux/clkdev.h>
12
13struct omap_clk {
14 u16 cpu;
15 struct clk_lookup lk;
16};
17
18#define CLK(dev, con, ck, cp) \
19 { \
20 .cpu = cp, \
21 .lk = { \
22 .dev_id = dev, \
23 .con_id = con, \
24 .clk = ck, \
25 }, \
26 }
27
28/* Platform flags for the clkdev-OMAP integration code */
29#define CK_310 (1 << 0)
30#define CK_7XX (1 << 1) /* 7xx, 850 */
31#define CK_1510 (1 << 2)
32#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */
33#define CK_242X (1 << 4)
34#define CK_243X (1 << 5) /* 243x, 253x */
35#define CK_3430ES1 (1 << 6) /* 34xxES1 only */
36#define CK_3430ES2PLUS (1 << 7) /* 34xxES2, ES3, non-Sitara 35xx only */
37#define CK_AM35XX (1 << 9) /* Sitara AM35xx */
38#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */
39#define CK_443X (1 << 11)
40#define CK_TI816X (1 << 12)
41#define CK_446X (1 << 13)
42#define CK_AM33XX (1 << 14) /* AM33xx specific clocks */
43#define CK_1710 (1 << 15) /* 1710 extra for rate selection */
44
45
46#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS)
47#define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX)
48
49
50#endif
51
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
deleted file mode 100644
index e2e2d045e428..000000000000
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ /dev/null
@@ -1,309 +0,0 @@
1/*
2 * OMAP clock: data structure definitions, function prototypes, shared macros
3 *
4 * Copyright (C) 2004-2005, 2008-2010 Nokia Corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ARCH_ARM_OMAP_CLOCK_H
14#define __ARCH_ARM_OMAP_CLOCK_H
15
16#include <linux/list.h>
17
18struct module;
19struct clk;
20struct clockdomain;
21
22/* Temporary, needed during the common clock framework conversion */
23#define __clk_get_name(clk) (clk->name)
24#define __clk_get_parent(clk) (clk->parent)
25#define __clk_get_rate(clk) (clk->rate)
26
27/**
28 * struct clkops - some clock function pointers
29 * @enable: fn ptr that enables the current clock in hardware
30 * @disable: fn ptr that enables the current clock in hardware
31 * @find_idlest: function returning the IDLEST register for the clock's IP blk
32 * @find_companion: function returning the "companion" clk reg for the clock
33 * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
34 * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
35 *
36 * A "companion" clk is an accompanying clock to the one being queried
37 * that must be enabled for the IP module connected to the clock to
38 * become accessible by the hardware. Neither @find_idlest nor
39 * @find_companion should be needed; that information is IP
40 * block-specific; the hwmod code has been created to handle this, but
41 * until hwmod data is ready and drivers have been converted to use PM
42 * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
43 * @find_companion must, unfortunately, remain.
44 */
45struct clkops {
46 int (*enable)(struct clk *);
47 void (*disable)(struct clk *);
48 void (*find_idlest)(struct clk *, void __iomem **,
49 u8 *, u8 *);
50 void (*find_companion)(struct clk *, void __iomem **,
51 u8 *);
52 void (*allow_idle)(struct clk *);
53 void (*deny_idle)(struct clk *);
54};
55
56#ifdef CONFIG_ARCH_OMAP2PLUS
57
58/* struct clksel_rate.flags possibilities */
59#define RATE_IN_242X (1 << 0)
60#define RATE_IN_243X (1 << 1)
61#define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */
62#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
63#define RATE_IN_36XX (1 << 4)
64#define RATE_IN_4430 (1 << 5)
65#define RATE_IN_TI816X (1 << 6)
66#define RATE_IN_4460 (1 << 7)
67#define RATE_IN_AM33XX (1 << 8)
68#define RATE_IN_TI814X (1 << 9)
69
70#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
71#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
72#define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX)
73#define RATE_IN_44XX (RATE_IN_4430 | RATE_IN_4460)
74
75/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
76#define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
77
78
79/**
80 * struct clksel_rate - register bitfield values corresponding to clk divisors
81 * @val: register bitfield value (shifted to bit 0)
82 * @div: clock divisor corresponding to @val
83 * @flags: (see "struct clksel_rate.flags possibilities" above)
84 *
85 * @val should match the value of a read from struct clk.clksel_reg
86 * AND'ed with struct clk.clksel_mask, shifted right to bit 0.
87 *
88 * @div is the divisor that should be applied to the parent clock's rate
89 * to produce the current clock's rate.
90 */
91struct clksel_rate {
92 u32 val;
93 u8 div;
94 u16 flags;
95};
96
97/**
98 * struct clksel - available parent clocks, and a pointer to their divisors
99 * @parent: struct clk * to a possible parent clock
100 * @rates: available divisors for this parent clock
101 *
102 * A struct clksel is always associated with one or more struct clks
103 * and one or more struct clksel_rates.
104 */
105struct clksel {
106 struct clk *parent;
107 const struct clksel_rate *rates;
108};
109
110/**
111 * struct dpll_data - DPLL registers and integration data
112 * @mult_div1_reg: register containing the DPLL M and N bitfields
113 * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
114 * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
115 * @clk_bypass: struct clk pointer to the clock's bypass clock input
116 * @clk_ref: struct clk pointer to the clock's reference clock input
117 * @control_reg: register containing the DPLL mode bitfield
118 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
119 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
120 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
121 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
122 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
123 * @min_divider: minimum valid non-bypass divider value (actual)
124 * @max_divider: maximum valid non-bypass divider value (actual)
125 * @modes: possible values of @enable_mask
126 * @autoidle_reg: register containing the DPLL autoidle mode bitfield
127 * @idlest_reg: register containing the DPLL idle status bitfield
128 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
129 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
130 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
131 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
132 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
133 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
134 * @flags: DPLL type/features (see below)
135 *
136 * Possible values for @flags:
137 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
138 *
139 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
140 *
141 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
142 * correct to only have one @clk_bypass pointer.
143 *
144 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
145 * @last_rounded_n) should be separated from the runtime-fixed fields
146 * and placed into a different structure, so that the runtime-fixed data
147 * can be placed into read-only space.
148 */
149struct dpll_data {
150 void __iomem *mult_div1_reg;
151 u32 mult_mask;
152 u32 div1_mask;
153 struct clk *clk_bypass;
154 struct clk *clk_ref;
155 void __iomem *control_reg;
156 u32 enable_mask;
157 unsigned long last_rounded_rate;
158 u16 last_rounded_m;
159 u16 max_multiplier;
160 u8 last_rounded_n;
161 u8 min_divider;
162 u16 max_divider;
163 u8 modes;
164 void __iomem *autoidle_reg;
165 void __iomem *idlest_reg;
166 u32 autoidle_mask;
167 u32 freqsel_mask;
168 u32 idlest_mask;
169 u32 dco_mask;
170 u32 sddiv_mask;
171 u8 auto_recal_bit;
172 u8 recal_en_bit;
173 u8 recal_st_bit;
174 u8 flags;
175};
176
177#endif
178
179/*
180 * struct clk.flags possibilities
181 *
182 * XXX document the rest of the clock flags here
183 *
184 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
185 * bits share the same register. This flag allows the
186 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
187 * should be used. This is a temporary solution - a better approach
188 * would be to associate clock type-specific data with the clock,
189 * similar to the struct dpll_data approach.
190 */
191#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
192#define CLOCK_IDLE_CONTROL (1 << 1)
193#define CLOCK_NO_IDLE_PARENT (1 << 2)
194#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
195#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
196#define CLOCK_CLKOUTX2 (1 << 5)
197
198/**
199 * struct clk - OMAP struct clk
200 * @node: list_head connecting this clock into the full clock list
201 * @ops: struct clkops * for this clock
202 * @name: the name of the clock in the hardware (used in hwmod data and debug)
203 * @parent: pointer to this clock's parent struct clk
204 * @children: list_head connecting to the child clks' @sibling list_heads
205 * @sibling: list_head connecting this clk to its parent clk's @children
206 * @rate: current clock rate
207 * @enable_reg: register to write to enable the clock (see @enable_bit)
208 * @recalc: fn ptr that returns the clock's current rate
209 * @set_rate: fn ptr that can change the clock's current rate
210 * @round_rate: fn ptr that can round the clock's current rate
211 * @init: fn ptr to do clock-specific initialization
212 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
213 * @usecount: number of users that have requested this clock to be enabled
214 * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
215 * @flags: see "struct clk.flags possibilities" above
216 * @clksel_reg: for clksel clks, register va containing src/divisor select
217 * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
218 * @clksel: for clksel clks, pointer to struct clksel for this clock
219 * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
220 * @clkdm_name: clockdomain name that this clock is contained in
221 * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
222 * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
223 * @src_offset: bitshift for source selection bitfield (OMAP1 only)
224 *
225 * XXX @rate_offset, @src_offset should probably be removed and OMAP1
226 * clock code converted to use clksel.
227 *
228 * XXX @usecount is poorly named. It should be "enable_count" or
229 * something similar. "users" in the description refers to kernel
230 * code (core code or drivers) that have called clk_enable() and not
231 * yet called clk_disable(); the usecount of parent clocks is also
232 * incremented by the clock code when clk_enable() is called on child
233 * clocks and decremented by the clock code when clk_disable() is
234 * called on child clocks.
235 *
236 * XXX @clkdm, @usecount, @children, @sibling should be marked for
237 * internal use only.
238 *
239 * @children and @sibling are used to optimize parent-to-child clock
240 * tree traversals. (child-to-parent traversals use @parent.)
241 *
242 * XXX The notion of the clock's current rate probably needs to be
243 * separated from the clock's target rate.
244 */
245struct clk {
246 struct list_head node;
247 const struct clkops *ops;
248 const char *name;
249 struct clk *parent;
250 struct list_head children;
251 struct list_head sibling; /* node for children */
252 unsigned long rate;
253 void __iomem *enable_reg;
254 unsigned long (*recalc)(struct clk *);
255 int (*set_rate)(struct clk *, unsigned long);
256 long (*round_rate)(struct clk *, unsigned long);
257 void (*init)(struct clk *);
258 u8 enable_bit;
259 s8 usecount;
260 u8 fixed_div;
261 u8 flags;
262#ifdef CONFIG_ARCH_OMAP2PLUS
263 void __iomem *clksel_reg;
264 u32 clksel_mask;
265 const struct clksel *clksel;
266 struct dpll_data *dpll_data;
267 const char *clkdm_name;
268 struct clockdomain *clkdm;
269#else
270 u8 rate_offset;
271 u8 src_offset;
272#endif
273#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
274 struct dentry *dent; /* For visible tree hierarchy */
275#endif
276};
277
278struct clk_functions {
279 int (*clk_enable)(struct clk *clk);
280 void (*clk_disable)(struct clk *clk);
281 long (*clk_round_rate)(struct clk *clk, unsigned long rate);
282 int (*clk_set_rate)(struct clk *clk, unsigned long rate);
283 int (*clk_set_parent)(struct clk *clk, struct clk *parent);
284 void (*clk_allow_idle)(struct clk *clk);
285 void (*clk_deny_idle)(struct clk *clk);
286 void (*clk_disable_unused)(struct clk *clk);
287};
288
289extern int mpurate;
290
291extern int clk_init(struct clk_functions *custom_clocks);
292extern void clk_preinit(struct clk *clk);
293extern int clk_register(struct clk *clk);
294extern void clk_reparent(struct clk *child, struct clk *parent);
295extern void clk_unregister(struct clk *clk);
296extern void propagate_rate(struct clk *clk);
297extern void recalculate_root_clocks(void);
298extern unsigned long followparent_recalc(struct clk *clk);
299extern void clk_enable_init_clocks(void);
300unsigned long omap_fixed_divisor_recalc(struct clk *clk);
301extern struct clk *omap_clk_get_by_name(const char *name);
302extern int omap_clk_enable_autoidle_all(void);
303extern int omap_clk_disable_autoidle_all(void);
304
305extern const struct clkops clkops_null;
306
307extern struct clk dummy_ck;
308
309#endif
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
deleted file mode 100644
index d1cb6f527b7e..000000000000
--- a/arch/arm/plat-omap/include/plat/common.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/common.h
3 *
4 * Header for code common to all OMAP machines.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
28#define __ARCH_ARM_MACH_OMAP_COMMON_H
29
30#include <plat/i2c.h>
31#include <plat/omap_hwmod.h>
32
33extern int __init omap_init_clocksource_32k(void __iomem *vbase);
34
35extern void __init omap_check_revision(void);
36
37extern void omap_reserve(void);
38extern int omap_dss_reset(struct omap_hwmod *);
39
40void omap_sram_init(void);
41
42#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
diff --git a/arch/arm/plat-omap/include/plat/counter-32k.h b/arch/arm/plat-omap/include/plat/counter-32k.h
new file mode 100644
index 000000000000..da000d482ff2
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/counter-32k.h
@@ -0,0 +1 @@
int omap_init_clocksource_32k(void __iomem *vbase);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 67da857783ce..b4516aba67ed 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/cpu.h
3 *
4 * OMAP cpu type detection 2 * OMAP cpu type detection
5 * 3 *
6 * Copyright (C) 2004, 2008 Nokia Corporation 4 * Copyright (C) 2004, 2008 Nokia Corporation
@@ -30,470 +28,12 @@
30#ifndef __ASM_ARCH_OMAP_CPU_H 28#ifndef __ASM_ARCH_OMAP_CPU_H
31#define __ASM_ARCH_OMAP_CPU_H 29#define __ASM_ARCH_OMAP_CPU_H
32 30
33#ifndef __ASSEMBLY__ 31#ifdef CONFIG_ARCH_OMAP1
34 32#include <mach/soc.h>
35#include <linux/bitops.h>
36#include <plat/multi.h>
37
38/*
39 * Omap device type i.e. EMU/HS/TST/GP/BAD
40 */
41#define OMAP2_DEVICE_TYPE_TEST 0
42#define OMAP2_DEVICE_TYPE_EMU 1
43#define OMAP2_DEVICE_TYPE_SEC 2
44#define OMAP2_DEVICE_TYPE_GP 3
45#define OMAP2_DEVICE_TYPE_BAD 4
46
47int omap_type(void);
48
49/*
50 * omap_rev bits:
51 * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
52 * CPU revision (See _REV_ defined in cpu.h) [15:08]
53 * CPU class bits (15xx, 16xx, 24xx, 34xx...) [07:00]
54 */
55unsigned int omap_rev(void);
56
57/*
58 * Get the CPU revision for OMAP devices
59 */
60#define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
61
62/*
63 * Macros to group OMAP into cpu classes.
64 * These can be used in most places.
65 * cpu_is_omap7xx(): True for OMAP730, OMAP850
66 * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310
67 * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710
68 * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
69 * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423
70 * cpu_is_omap243x(): True for OMAP2430
71 * cpu_is_omap343x(): True for OMAP3430
72 * cpu_is_omap443x(): True for OMAP4430
73 * cpu_is_omap446x(): True for OMAP4460
74 * cpu_is_omap447x(): True for OMAP4470
75 * soc_is_omap543x(): True for OMAP5430, OMAP5432
76 */
77#define GET_OMAP_CLASS (omap_rev() & 0xff)
78
79#define IS_OMAP_CLASS(class, id) \
80static inline int is_omap ##class (void) \
81{ \
82 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
83}
84
85#define GET_AM_CLASS ((omap_rev() >> 24) & 0xff)
86
87#define IS_AM_CLASS(class, id) \
88static inline int is_am ##class (void) \
89{ \
90 return (GET_AM_CLASS == (id)) ? 1 : 0; \
91}
92
93#define GET_TI_CLASS ((omap_rev() >> 24) & 0xff)
94
95#define IS_TI_CLASS(class, id) \
96static inline int is_ti ##class (void) \
97{ \
98 return (GET_TI_CLASS == (id)) ? 1 : 0; \
99}
100
101#define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
102
103#define IS_OMAP_SUBCLASS(subclass, id) \
104static inline int is_omap ##subclass (void) \
105{ \
106 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
107}
108
109#define IS_TI_SUBCLASS(subclass, id) \
110static inline int is_ti ##subclass (void) \
111{ \
112 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
113}
114
115#define IS_AM_SUBCLASS(subclass, id) \
116static inline int is_am ##subclass (void) \
117{ \
118 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
119}
120
121IS_OMAP_CLASS(7xx, 0x07)
122IS_OMAP_CLASS(15xx, 0x15)
123IS_OMAP_CLASS(16xx, 0x16)
124IS_OMAP_CLASS(24xx, 0x24)
125IS_OMAP_CLASS(34xx, 0x34)
126IS_OMAP_CLASS(44xx, 0x44)
127IS_AM_CLASS(35xx, 0x35)
128IS_OMAP_CLASS(54xx, 0x54)
129IS_AM_CLASS(33xx, 0x33)
130
131IS_TI_CLASS(81xx, 0x81)
132
133IS_OMAP_SUBCLASS(242x, 0x242)
134IS_OMAP_SUBCLASS(243x, 0x243)
135IS_OMAP_SUBCLASS(343x, 0x343)
136IS_OMAP_SUBCLASS(363x, 0x363)
137IS_OMAP_SUBCLASS(443x, 0x443)
138IS_OMAP_SUBCLASS(446x, 0x446)
139IS_OMAP_SUBCLASS(447x, 0x447)
140IS_OMAP_SUBCLASS(543x, 0x543)
141
142IS_TI_SUBCLASS(816x, 0x816)
143IS_TI_SUBCLASS(814x, 0x814)
144IS_AM_SUBCLASS(335x, 0x335)
145
146#define cpu_is_omap7xx() 0
147#define cpu_is_omap15xx() 0
148#define cpu_is_omap16xx() 0
149#define cpu_is_omap24xx() 0
150#define cpu_is_omap242x() 0
151#define cpu_is_omap243x() 0
152#define cpu_is_omap34xx() 0
153#define cpu_is_omap343x() 0
154#define cpu_is_ti81xx() 0
155#define cpu_is_ti816x() 0
156#define cpu_is_ti814x() 0
157#define soc_is_am35xx() 0
158#define soc_is_am33xx() 0
159#define soc_is_am335x() 0
160#define cpu_is_omap44xx() 0
161#define cpu_is_omap443x() 0
162#define cpu_is_omap446x() 0
163#define cpu_is_omap447x() 0
164#define soc_is_omap54xx() 0
165#define soc_is_omap543x() 0
166
167#if defined(MULTI_OMAP1)
168# if defined(CONFIG_ARCH_OMAP730)
169# undef cpu_is_omap7xx
170# define cpu_is_omap7xx() is_omap7xx()
171# endif
172# if defined(CONFIG_ARCH_OMAP850)
173# undef cpu_is_omap7xx
174# define cpu_is_omap7xx() is_omap7xx()
175# endif
176# if defined(CONFIG_ARCH_OMAP15XX)
177# undef cpu_is_omap15xx
178# define cpu_is_omap15xx() is_omap15xx()
179# endif
180# if defined(CONFIG_ARCH_OMAP16XX)
181# undef cpu_is_omap16xx
182# define cpu_is_omap16xx() is_omap16xx()
183# endif
184#else
185# if defined(CONFIG_ARCH_OMAP730)
186# undef cpu_is_omap7xx
187# define cpu_is_omap7xx() 1
188# endif
189# if defined(CONFIG_ARCH_OMAP850)
190# undef cpu_is_omap7xx
191# define cpu_is_omap7xx() 1
192# endif
193# if defined(CONFIG_ARCH_OMAP15XX)
194# undef cpu_is_omap15xx
195# define cpu_is_omap15xx() 1
196# endif
197# if defined(CONFIG_ARCH_OMAP16XX)
198# undef cpu_is_omap16xx
199# define cpu_is_omap16xx() 1
200# endif
201#endif
202
203#if defined(MULTI_OMAP2)
204# if defined(CONFIG_ARCH_OMAP2)
205# undef cpu_is_omap24xx
206# define cpu_is_omap24xx() is_omap24xx()
207# endif
208# if defined (CONFIG_SOC_OMAP2420)
209# undef cpu_is_omap242x
210# define cpu_is_omap242x() is_omap242x()
211# endif
212# if defined (CONFIG_SOC_OMAP2430)
213# undef cpu_is_omap243x
214# define cpu_is_omap243x() is_omap243x()
215# endif
216# if defined(CONFIG_ARCH_OMAP3)
217# undef cpu_is_omap34xx
218# undef cpu_is_omap343x
219# define cpu_is_omap34xx() is_omap34xx()
220# define cpu_is_omap343x() is_omap343x()
221# endif
222#else
223# if defined(CONFIG_ARCH_OMAP2)
224# undef cpu_is_omap24xx
225# define cpu_is_omap24xx() 1
226# endif
227# if defined(CONFIG_SOC_OMAP2420)
228# undef cpu_is_omap242x
229# define cpu_is_omap242x() 1
230# endif
231# if defined(CONFIG_SOC_OMAP2430)
232# undef cpu_is_omap243x
233# define cpu_is_omap243x() 1
234# endif
235# if defined(CONFIG_ARCH_OMAP3)
236# undef cpu_is_omap34xx
237# define cpu_is_omap34xx() 1
238# endif
239# if defined(CONFIG_SOC_OMAP3430)
240# undef cpu_is_omap343x
241# define cpu_is_omap343x() 1
242# endif
243#endif
244
245/*
246 * Macros to detect individual cpu types.
247 * These are only rarely needed.
248 * cpu_is_omap310(): True for OMAP310
249 * cpu_is_omap1510(): True for OMAP1510
250 * cpu_is_omap1610(): True for OMAP1610
251 * cpu_is_omap1611(): True for OMAP1611
252 * cpu_is_omap5912(): True for OMAP5912
253 * cpu_is_omap1621(): True for OMAP1621
254 * cpu_is_omap1710(): True for OMAP1710
255 * cpu_is_omap2420(): True for OMAP2420
256 * cpu_is_omap2422(): True for OMAP2422
257 * cpu_is_omap2423(): True for OMAP2423
258 * cpu_is_omap2430(): True for OMAP2430
259 * cpu_is_omap3430(): True for OMAP3430
260 */
261#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
262
263#define IS_OMAP_TYPE(type, id) \
264static inline int is_omap ##type (void) \
265{ \
266 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
267}
268
269IS_OMAP_TYPE(310, 0x0310)
270IS_OMAP_TYPE(1510, 0x1510)
271IS_OMAP_TYPE(1610, 0x1610)
272IS_OMAP_TYPE(1611, 0x1611)
273IS_OMAP_TYPE(5912, 0x1611)
274IS_OMAP_TYPE(1621, 0x1621)
275IS_OMAP_TYPE(1710, 0x1710)
276IS_OMAP_TYPE(2420, 0x2420)
277IS_OMAP_TYPE(2422, 0x2422)
278IS_OMAP_TYPE(2423, 0x2423)
279IS_OMAP_TYPE(2430, 0x2430)
280IS_OMAP_TYPE(3430, 0x3430)
281
282#define cpu_is_omap310() 0
283#define cpu_is_omap1510() 0
284#define cpu_is_omap1610() 0
285#define cpu_is_omap5912() 0
286#define cpu_is_omap1611() 0
287#define cpu_is_omap1621() 0
288#define cpu_is_omap1710() 0
289#define cpu_is_omap2420() 0
290#define cpu_is_omap2422() 0
291#define cpu_is_omap2423() 0
292#define cpu_is_omap2430() 0
293#define cpu_is_omap3430() 0
294#define cpu_is_omap3630() 0
295#define soc_is_omap5430() 0
296
297/*
298 * Whether we have MULTI_OMAP1 or not, we still need to distinguish
299 * between 310 vs. 1510 and 1611B/5912 vs. 1710.
300 */
301
302#if defined(CONFIG_ARCH_OMAP15XX)
303# undef cpu_is_omap310
304# undef cpu_is_omap1510
305# define cpu_is_omap310() is_omap310()
306# define cpu_is_omap1510() is_omap1510()
307#endif
308
309#if defined(CONFIG_ARCH_OMAP16XX)
310# undef cpu_is_omap1610
311# undef cpu_is_omap1611
312# undef cpu_is_omap5912
313# undef cpu_is_omap1621
314# undef cpu_is_omap1710
315# define cpu_is_omap1610() is_omap1610()
316# define cpu_is_omap1611() is_omap1611()
317# define cpu_is_omap5912() is_omap5912()
318# define cpu_is_omap1621() is_omap1621()
319# define cpu_is_omap1710() is_omap1710()
320#endif
321
322#if defined(CONFIG_ARCH_OMAP2)
323# undef cpu_is_omap2420
324# undef cpu_is_omap2422
325# undef cpu_is_omap2423
326# undef cpu_is_omap2430
327# define cpu_is_omap2420() is_omap2420()
328# define cpu_is_omap2422() is_omap2422()
329# define cpu_is_omap2423() is_omap2423()
330# define cpu_is_omap2430() is_omap2430()
331#endif
332
333#if defined(CONFIG_ARCH_OMAP3)
334# undef cpu_is_omap3430
335# undef cpu_is_ti81xx
336# undef cpu_is_ti816x
337# undef cpu_is_ti814x
338# undef soc_is_am35xx
339# define cpu_is_omap3430() is_omap3430()
340# undef cpu_is_omap3630
341# define cpu_is_omap3630() is_omap363x()
342# define cpu_is_ti81xx() is_ti81xx()
343# define cpu_is_ti816x() is_ti816x()
344# define cpu_is_ti814x() is_ti814x()
345# define soc_is_am35xx() is_am35xx()
346#endif 33#endif
347 34
348# if defined(CONFIG_SOC_AM33XX) 35#ifdef CONFIG_ARCH_OMAP2PLUS
349# undef soc_is_am33xx 36#include "../../mach-omap2/soc.h"
350# undef soc_is_am335x
351# define soc_is_am33xx() is_am33xx()
352# define soc_is_am335x() is_am335x()
353#endif 37#endif
354 38
355# if defined(CONFIG_ARCH_OMAP4)
356# undef cpu_is_omap44xx
357# undef cpu_is_omap443x
358# undef cpu_is_omap446x
359# undef cpu_is_omap447x
360# define cpu_is_omap44xx() is_omap44xx()
361# define cpu_is_omap443x() is_omap443x()
362# define cpu_is_omap446x() is_omap446x()
363# define cpu_is_omap447x() is_omap447x()
364# endif
365
366# if defined(CONFIG_SOC_OMAP5)
367# undef soc_is_omap54xx
368# undef soc_is_omap543x
369# define soc_is_omap54xx() is_omap54xx()
370# define soc_is_omap543x() is_omap543x()
371#endif
372
373/* Macros to detect if we have OMAP1 or OMAP2 */
374#define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \
375 cpu_is_omap16xx())
376#define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \
377 cpu_is_omap44xx() || soc_is_omap54xx() || \
378 soc_is_am33xx())
379
380/* Various silicon revisions for omap2 */
381#define OMAP242X_CLASS 0x24200024
382#define OMAP2420_REV_ES1_0 OMAP242X_CLASS
383#define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (0x1 << 8))
384
385#define OMAP243X_CLASS 0x24300024
386#define OMAP2430_REV_ES1_0 OMAP243X_CLASS
387
388#define OMAP343X_CLASS 0x34300034
389#define OMAP3430_REV_ES1_0 OMAP343X_CLASS
390#define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (0x1 << 8))
391#define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (0x2 << 8))
392#define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (0x3 << 8))
393#define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (0x4 << 8))
394#define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (0x5 << 8))
395
396#define OMAP363X_CLASS 0x36300034
397#define OMAP3630_REV_ES1_0 OMAP363X_CLASS
398#define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8))
399#define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8))
400
401#define TI816X_CLASS 0x81600034
402#define TI8168_REV_ES1_0 TI816X_CLASS
403#define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8))
404
405#define TI814X_CLASS 0x81400034
406#define TI8148_REV_ES1_0 TI814X_CLASS
407#define TI8148_REV_ES2_0 (TI814X_CLASS | (0x1 << 8))
408#define TI8148_REV_ES2_1 (TI814X_CLASS | (0x2 << 8))
409
410#define AM35XX_CLASS 0x35170034
411#define AM35XX_REV_ES1_0 AM35XX_CLASS
412#define AM35XX_REV_ES1_1 (AM35XX_CLASS | (0x1 << 8))
413
414#define AM335X_CLASS 0x33500033
415#define AM335X_REV_ES1_0 AM335X_CLASS
416
417#define OMAP443X_CLASS 0x44300044
418#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
419#define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8))
420#define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8))
421#define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8))
422#define OMAP4430_REV_ES2_3 (OMAP443X_CLASS | (0x23 << 8))
423
424#define OMAP446X_CLASS 0x44600044
425#define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8))
426#define OMAP4460_REV_ES1_1 (OMAP446X_CLASS | (0x11 << 8))
427
428#define OMAP447X_CLASS 0x44700044
429#define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8))
430
431#define OMAP54XX_CLASS 0x54000054
432#define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8))
433#define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8))
434
435void omap2xxx_check_revision(void);
436void omap3xxx_check_revision(void);
437void omap4xxx_check_revision(void);
438void omap5xxx_check_revision(void);
439void omap3xxx_check_features(void);
440void ti81xx_check_features(void);
441void omap4xxx_check_features(void);
442
443/*
444 * Runtime detection of OMAP3 features
445 *
446 * OMAP3_HAS_IO_CHAIN_CTRL: Some later members of the OMAP3 chip
447 * family have OS-level control over the I/O chain clock. This is
448 * to avoid a window during which wakeups could potentially be lost
449 * during powerdomain transitions. If this bit is set, it
450 * indicates that the chip does support OS-level control of this
451 * feature.
452 */
453extern u32 omap_features;
454
455#define OMAP3_HAS_L2CACHE BIT(0)
456#define OMAP3_HAS_IVA BIT(1)
457#define OMAP3_HAS_SGX BIT(2)
458#define OMAP3_HAS_NEON BIT(3)
459#define OMAP3_HAS_ISP BIT(4)
460#define OMAP3_HAS_192MHZ_CLK BIT(5)
461#define OMAP3_HAS_IO_WAKEUP BIT(6)
462#define OMAP3_HAS_SDRC BIT(7)
463#define OMAP3_HAS_IO_CHAIN_CTRL BIT(8)
464#define OMAP4_HAS_MPU_1GHZ BIT(9)
465#define OMAP4_HAS_MPU_1_2GHZ BIT(10)
466#define OMAP4_HAS_MPU_1_5GHZ BIT(11)
467
468
469#define OMAP3_HAS_FEATURE(feat,flag) \
470static inline unsigned int omap3_has_ ##feat(void) \
471{ \
472 return omap_features & OMAP3_HAS_ ##flag; \
473} \
474
475OMAP3_HAS_FEATURE(l2cache, L2CACHE)
476OMAP3_HAS_FEATURE(sgx, SGX)
477OMAP3_HAS_FEATURE(iva, IVA)
478OMAP3_HAS_FEATURE(neon, NEON)
479OMAP3_HAS_FEATURE(isp, ISP)
480OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
481OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
482OMAP3_HAS_FEATURE(sdrc, SDRC)
483OMAP3_HAS_FEATURE(io_chain_ctrl, IO_CHAIN_CTRL)
484
485/*
486 * Runtime detection of OMAP4 features
487 */
488#define OMAP4_HAS_FEATURE(feat, flag) \
489static inline unsigned int omap4_has_ ##feat(void) \
490{ \
491 return omap_features & OMAP4_HAS_ ##flag; \
492} \
493
494OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
495OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ)
496OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
497
498#endif /* __ASSEMBLY__ */
499#endif 39#endif
diff --git a/arch/arm/mach-omap2/debug-devices.h b/arch/arm/plat-omap/include/plat/debug-devices.h
index a4edbd2f7484..8fc4287222dd 100644
--- a/arch/arm/mach-omap2/debug-devices.h
+++ b/arch/arm/plat-omap/include/plat/debug-devices.h
@@ -1,9 +1,2 @@
1#ifndef _OMAP_DEBUG_DEVICES_H
2#define _OMAP_DEBUG_DEVICES_H
3
4#include <linux/types.h>
5
6/* for TI reference platforms sharing the same debug card */ 1/* for TI reference platforms sharing the same debug card */
7extern int debug_card_init(u32 addr, unsigned gpio); 2extern int debug_card_init(u32 addr, unsigned gpio);
8
9#endif
diff --git a/arch/arm/plat-omap/include/plat/dma-44xx.h b/arch/arm/plat-omap/include/plat/dma-44xx.h
deleted file mode 100644
index 1f767cb2f38a..000000000000
--- a/arch/arm/plat-omap/include/plat/dma-44xx.h
+++ /dev/null
@@ -1,147 +0,0 @@
1/*
2 * OMAP4 SDMA channel definitions
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation
6 *
7 * Santosh Shilimkar (santosh.shilimkar@ti.com)
8 * Benoit Cousson (b-cousson@ti.com)
9 * Paul Walmsley (paul@pwsan.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22#ifndef __ARCH_ARM_MACH_OMAP2_OMAP44XX_DMA_H
23#define __ARCH_ARM_MACH_OMAP2_OMAP44XX_DMA_H
24
25#define OMAP44XX_DMA_SYS_REQ0 2
26#define OMAP44XX_DMA_SYS_REQ1 3
27#define OMAP44XX_DMA_GPMC 4
28#define OMAP44XX_DMA_DSS_DISPC_REQ 6
29#define OMAP44XX_DMA_SYS_REQ2 7
30#define OMAP44XX_DMA_MCASP1_AXEVT 8
31#define OMAP44XX_DMA_ISS_REQ1 9
32#define OMAP44XX_DMA_ISS_REQ2 10
33#define OMAP44XX_DMA_MCASP1_AREVT 11
34#define OMAP44XX_DMA_ISS_REQ3 12
35#define OMAP44XX_DMA_ISS_REQ4 13
36#define OMAP44XX_DMA_DSS_RFBI_REQ 14
37#define OMAP44XX_DMA_SPI3_TX0 15
38#define OMAP44XX_DMA_SPI3_RX0 16
39#define OMAP44XX_DMA_MCBSP2_TX 17
40#define OMAP44XX_DMA_MCBSP2_RX 18
41#define OMAP44XX_DMA_MCBSP3_TX 19
42#define OMAP44XX_DMA_MCBSP3_RX 20
43#define OMAP44XX_DMA_C2C_SSCM_GPO0 21
44#define OMAP44XX_DMA_C2C_SSCM_GPO1 22
45#define OMAP44XX_DMA_SPI3_TX1 23
46#define OMAP44XX_DMA_SPI3_RX1 24
47#define OMAP44XX_DMA_I2C3_TX 25
48#define OMAP44XX_DMA_I2C3_RX 26
49#define OMAP44XX_DMA_I2C1_TX 27
50#define OMAP44XX_DMA_I2C1_RX 28
51#define OMAP44XX_DMA_I2C2_TX 29
52#define OMAP44XX_DMA_I2C2_RX 30
53#define OMAP44XX_DMA_MCBSP4_TX 31
54#define OMAP44XX_DMA_MCBSP4_RX 32
55#define OMAP44XX_DMA_MCBSP1_TX 33
56#define OMAP44XX_DMA_MCBSP1_RX 34
57#define OMAP44XX_DMA_SPI1_TX0 35
58#define OMAP44XX_DMA_SPI1_RX0 36
59#define OMAP44XX_DMA_SPI1_TX1 37
60#define OMAP44XX_DMA_SPI1_RX1 38
61#define OMAP44XX_DMA_SPI1_TX2 39
62#define OMAP44XX_DMA_SPI1_RX2 40
63#define OMAP44XX_DMA_SPI1_TX3 41
64#define OMAP44XX_DMA_SPI1_RX3 42
65#define OMAP44XX_DMA_SPI2_TX0 43
66#define OMAP44XX_DMA_SPI2_RX0 44
67#define OMAP44XX_DMA_SPI2_TX1 45
68#define OMAP44XX_DMA_SPI2_RX1 46
69#define OMAP44XX_DMA_MMC2_TX 47
70#define OMAP44XX_DMA_MMC2_RX 48
71#define OMAP44XX_DMA_UART1_TX 49
72#define OMAP44XX_DMA_UART1_RX 50
73#define OMAP44XX_DMA_UART2_TX 51
74#define OMAP44XX_DMA_UART2_RX 52
75#define OMAP44XX_DMA_UART3_TX 53
76#define OMAP44XX_DMA_UART3_RX 54
77#define OMAP44XX_DMA_UART4_TX 55
78#define OMAP44XX_DMA_UART4_RX 56
79#define OMAP44XX_DMA_MMC4_TX 57
80#define OMAP44XX_DMA_MMC4_RX 58
81#define OMAP44XX_DMA_MMC5_TX 59
82#define OMAP44XX_DMA_MMC5_RX 60
83#define OMAP44XX_DMA_MMC1_TX 61
84#define OMAP44XX_DMA_MMC1_RX 62
85#define OMAP44XX_DMA_SYS_REQ3 64
86#define OMAP44XX_DMA_MCPDM_UP 65
87#define OMAP44XX_DMA_MCPDM_DL 66
88#define OMAP44XX_DMA_DMIC_REQ 67
89#define OMAP44XX_DMA_C2C_SSCM_GPO2 68
90#define OMAP44XX_DMA_C2C_SSCM_GPO3 69
91#define OMAP44XX_DMA_SPI4_TX0 70
92#define OMAP44XX_DMA_SPI4_RX0 71
93#define OMAP44XX_DMA_DSS_DSI1_REQ0 72
94#define OMAP44XX_DMA_DSS_DSI1_REQ1 73
95#define OMAP44XX_DMA_DSS_DSI1_REQ2 74
96#define OMAP44XX_DMA_DSS_DSI1_REQ3 75
97#define OMAP44XX_DMA_DSS_HDMI_REQ 76
98#define OMAP44XX_DMA_MMC3_TX 77
99#define OMAP44XX_DMA_MMC3_RX 78
100#define OMAP44XX_DMA_USIM_TX 79
101#define OMAP44XX_DMA_USIM_RX 80
102#define OMAP44XX_DMA_DSS_DSI2_REQ0 81
103#define OMAP44XX_DMA_DSS_DSI2_REQ1 82
104#define OMAP44XX_DMA_DSS_DSI2_REQ2 83
105#define OMAP44XX_DMA_DSS_DSI2_REQ3 84
106#define OMAP44XX_DMA_SLIMBUS1_TX0 85
107#define OMAP44XX_DMA_SLIMBUS1_TX1 86
108#define OMAP44XX_DMA_SLIMBUS1_TX2 87
109#define OMAP44XX_DMA_SLIMBUS1_TX3 88
110#define OMAP44XX_DMA_SLIMBUS1_RX0 89
111#define OMAP44XX_DMA_SLIMBUS1_RX1 90
112#define OMAP44XX_DMA_SLIMBUS1_RX2 91
113#define OMAP44XX_DMA_SLIMBUS1_RX3 92
114#define OMAP44XX_DMA_SLIMBUS2_TX0 93
115#define OMAP44XX_DMA_SLIMBUS2_TX1 94
116#define OMAP44XX_DMA_SLIMBUS2_TX2 95
117#define OMAP44XX_DMA_SLIMBUS2_TX3 96
118#define OMAP44XX_DMA_SLIMBUS2_RX0 97
119#define OMAP44XX_DMA_SLIMBUS2_RX1 98
120#define OMAP44XX_DMA_SLIMBUS2_RX2 99
121#define OMAP44XX_DMA_SLIMBUS2_RX3 100
122#define OMAP44XX_DMA_ABE_REQ_0 101
123#define OMAP44XX_DMA_ABE_REQ_1 102
124#define OMAP44XX_DMA_ABE_REQ_2 103
125#define OMAP44XX_DMA_ABE_REQ_3 104
126#define OMAP44XX_DMA_ABE_REQ_4 105
127#define OMAP44XX_DMA_ABE_REQ_5 106
128#define OMAP44XX_DMA_ABE_REQ_6 107
129#define OMAP44XX_DMA_ABE_REQ_7 108
130#define OMAP44XX_DMA_AES1_P_CTX_IN_REQ 109
131#define OMAP44XX_DMA_AES1_P_DATA_IN_REQ 110
132#define OMAP44XX_DMA_AES1_P_DATA_OUT_REQ 111
133#define OMAP44XX_DMA_AES2_P_CTX_IN_REQ 112
134#define OMAP44XX_DMA_AES2_P_DATA_IN_REQ 113
135#define OMAP44XX_DMA_AES2_P_DATA_OUT_REQ 114
136#define OMAP44XX_DMA_DES_P_CTX_IN_REQ 115
137#define OMAP44XX_DMA_DES_P_DATA_IN_REQ 116
138#define OMAP44XX_DMA_DES_P_DATA_OUT_REQ 117
139#define OMAP44XX_DMA_SHA2_CTXIN_P 118
140#define OMAP44XX_DMA_SHA2_DIN_P 119
141#define OMAP44XX_DMA_SHA2_CTXOUT_P 120
142#define OMAP44XX_DMA_AES1_P_CONTEXT_OUT_REQ 121
143#define OMAP44XX_DMA_AES2_P_CONTEXT_OUT_REQ 122
144#define OMAP44XX_DMA_I2C4_TX 124
145#define OMAP44XX_DMA_I2C4_RX 125
146
147#endif
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 85868e98c11c..f8943c8f9dbf 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -94,11 +94,13 @@ struct dmtimer_platform_data {
94 /* set_timer_src - Only used for OMAP1 devices */ 94 /* set_timer_src - Only used for OMAP1 devices */
95 int (*set_timer_src)(struct platform_device *pdev, int source); 95 int (*set_timer_src)(struct platform_device *pdev, int source);
96 u32 timer_capability; 96 u32 timer_capability;
97 int (*get_context_loss_count)(struct device *);
97}; 98};
98 99
99int omap_dm_timer_reserve_systimer(int id); 100int omap_dm_timer_reserve_systimer(int id);
100struct omap_dm_timer *omap_dm_timer_request(void); 101struct omap_dm_timer *omap_dm_timer_request(void);
101struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); 102struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
103struct omap_dm_timer *omap_dm_timer_request_by_cap(u32 cap);
102int omap_dm_timer_free(struct omap_dm_timer *timer); 104int omap_dm_timer_free(struct omap_dm_timer *timer);
103void omap_dm_timer_enable(struct omap_dm_timer *timer); 105void omap_dm_timer_enable(struct omap_dm_timer *timer);
104void omap_dm_timer_disable(struct omap_dm_timer *timer); 106void omap_dm_timer_disable(struct omap_dm_timer *timer);
@@ -263,6 +265,7 @@ struct omap_dm_timer {
263 unsigned reserved:1; 265 unsigned reserved:1;
264 unsigned posted:1; 266 unsigned posted:1;
265 struct timer_regs context; 267 struct timer_regs context;
268 int (*get_context_loss_count)(struct device *);
266 int ctx_loss_count; 269 int ctx_loss_count;
267 int revision; 270 int revision;
268 u32 capability; 271 u32 capability;
diff --git a/arch/arm/plat-omap/include/plat/fpga.h b/arch/arm/plat-omap/include/plat/fpga.h
deleted file mode 100644
index bd3c6324ae1f..000000000000
--- a/arch/arm/plat-omap/include/plat/fpga.h
+++ /dev/null
@@ -1,193 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/fpga.h
3 *
4 * Interrupt handler for OMAP-1510 FPGA
5 *
6 * Copyright (C) 2001 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
8 *
9 * Copyright (C) 2002 MontaVista Software, Inc.
10 *
11 * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
12 * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#ifndef __ASM_ARCH_OMAP_FPGA_H
20#define __ASM_ARCH_OMAP_FPGA_H
21
22extern void omap1510_fpga_init_irq(void);
23
24#define fpga_read(reg) __raw_readb(reg)
25#define fpga_write(val, reg) __raw_writeb(val, reg)
26
27/*
28 * ---------------------------------------------------------------------------
29 * H2/P2 Debug board FPGA
30 * ---------------------------------------------------------------------------
31 */
32/* maps in the FPGA registers and the ETHR registers */
33#define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */
34#define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */
35#define H2P2_DBG_FPGA_START 0x04000000 /* PA */
36
37#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300)
38#define H2P2_DBG_FPGA_FPGA_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */
39#define H2P2_DBG_FPGA_BOARD_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */
40#define H2P2_DBG_FPGA_GPIO IOMEM(H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */
41#define H2P2_DBG_FPGA_LEDS IOMEM(H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */
42#define H2P2_DBG_FPGA_MISC_INPUTS IOMEM(H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */
43#define H2P2_DBG_FPGA_LAN_STATUS IOMEM(H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */
44#define H2P2_DBG_FPGA_LAN_RESET IOMEM(H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */
45
46/* NOTE: most boards don't have a static mapping for the FPGA ... */
47struct h2p2_dbg_fpga {
48 /* offset 0x00 */
49 u16 smc91x[8];
50 /* offset 0x10 */
51 u16 fpga_rev;
52 u16 board_rev;
53 u16 gpio_outputs;
54 u16 leds;
55 /* offset 0x18 */
56 u16 misc_inputs;
57 u16 lan_status;
58 u16 lan_reset;
59 u16 reserved0;
60 /* offset 0x20 */
61 u16 ps2_data;
62 u16 ps2_ctrl;
63 /* plus also 4 rs232 ports ... */
64};
65
66/* LEDs definition on debug board (16 LEDs, all physically green) */
67#define H2P2_DBG_FPGA_LED_GREEN (1 << 15)
68#define H2P2_DBG_FPGA_LED_AMBER (1 << 14)
69#define H2P2_DBG_FPGA_LED_RED (1 << 13)
70#define H2P2_DBG_FPGA_LED_BLUE (1 << 12)
71/* cpu0 load-meter LEDs */
72#define H2P2_DBG_FPGA_LOAD_METER (1 << 0) // A bit of fun on our board ...
73#define H2P2_DBG_FPGA_LOAD_METER_SIZE 11
74#define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
75
76#define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0)
77#define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1)
78
79/*
80 * ---------------------------------------------------------------------------
81 * OMAP-1510 FPGA
82 * ---------------------------------------------------------------------------
83 */
84#define OMAP1510_FPGA_BASE 0xE8000000 /* VA */
85#define OMAP1510_FPGA_SIZE SZ_4K
86#define OMAP1510_FPGA_START 0x08000000 /* PA */
87
88/* Revision */
89#define OMAP1510_FPGA_REV_LOW IOMEM(OMAP1510_FPGA_BASE + 0x0)
90#define OMAP1510_FPGA_REV_HIGH IOMEM(OMAP1510_FPGA_BASE + 0x1)
91
92#define OMAP1510_FPGA_LCD_PANEL_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x2)
93#define OMAP1510_FPGA_LED_DIGIT IOMEM(OMAP1510_FPGA_BASE + 0x3)
94#define INNOVATOR_FPGA_HID_SPI IOMEM(OMAP1510_FPGA_BASE + 0x4)
95#define OMAP1510_FPGA_POWER IOMEM(OMAP1510_FPGA_BASE + 0x5)
96
97/* Interrupt status */
98#define OMAP1510_FPGA_ISR_LO IOMEM(OMAP1510_FPGA_BASE + 0x6)
99#define OMAP1510_FPGA_ISR_HI IOMEM(OMAP1510_FPGA_BASE + 0x7)
100
101/* Interrupt mask */
102#define OMAP1510_FPGA_IMR_LO IOMEM(OMAP1510_FPGA_BASE + 0x8)
103#define OMAP1510_FPGA_IMR_HI IOMEM(OMAP1510_FPGA_BASE + 0x9)
104
105/* Reset registers */
106#define OMAP1510_FPGA_HOST_RESET IOMEM(OMAP1510_FPGA_BASE + 0xa)
107#define OMAP1510_FPGA_RST IOMEM(OMAP1510_FPGA_BASE + 0xb)
108
109#define OMAP1510_FPGA_AUDIO IOMEM(OMAP1510_FPGA_BASE + 0xc)
110#define OMAP1510_FPGA_DIP IOMEM(OMAP1510_FPGA_BASE + 0xe)
111#define OMAP1510_FPGA_FPGA_IO IOMEM(OMAP1510_FPGA_BASE + 0xf)
112#define OMAP1510_FPGA_UART1 IOMEM(OMAP1510_FPGA_BASE + 0x14)
113#define OMAP1510_FPGA_UART2 IOMEM(OMAP1510_FPGA_BASE + 0x15)
114#define OMAP1510_FPGA_OMAP1510_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x16)
115#define OMAP1510_FPGA_BOARD_REV IOMEM(OMAP1510_FPGA_BASE + 0x18)
116#define OMAP1510P1_PPT_DATA IOMEM(OMAP1510_FPGA_BASE + 0x100)
117#define OMAP1510P1_PPT_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x101)
118#define OMAP1510P1_PPT_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x102)
119
120#define OMAP1510_FPGA_TOUCHSCREEN IOMEM(OMAP1510_FPGA_BASE + 0x204)
121
122#define INNOVATOR_FPGA_INFO IOMEM(OMAP1510_FPGA_BASE + 0x205)
123#define INNOVATOR_FPGA_LCD_BRIGHT_LO IOMEM(OMAP1510_FPGA_BASE + 0x206)
124#define INNOVATOR_FPGA_LCD_BRIGHT_HI IOMEM(OMAP1510_FPGA_BASE + 0x207)
125#define INNOVATOR_FPGA_LED_GRN_LO IOMEM(OMAP1510_FPGA_BASE + 0x208)
126#define INNOVATOR_FPGA_LED_GRN_HI IOMEM(OMAP1510_FPGA_BASE + 0x209)
127#define INNOVATOR_FPGA_LED_RED_LO IOMEM(OMAP1510_FPGA_BASE + 0x20a)
128#define INNOVATOR_FPGA_LED_RED_HI IOMEM(OMAP1510_FPGA_BASE + 0x20b)
129#define INNOVATOR_FPGA_CAM_USB_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20c)
130#define INNOVATOR_FPGA_EXP_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20d)
131#define INNOVATOR_FPGA_ISR2 IOMEM(OMAP1510_FPGA_BASE + 0x20e)
132#define INNOVATOR_FPGA_IMR2 IOMEM(OMAP1510_FPGA_BASE + 0x210)
133
134#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300)
135
136/*
137 * Power up Giga UART driver, turn on HID clock.
138 * Turn off BT power, since we're not using it and it
139 * draws power.
140 */
141#define OMAP1510_FPGA_RESET_VALUE 0x42
142
143#define OMAP1510_FPGA_PCR_IF_PD0 (1 << 7)
144#define OMAP1510_FPGA_PCR_COM2_EN (1 << 6)
145#define OMAP1510_FPGA_PCR_COM1_EN (1 << 5)
146#define OMAP1510_FPGA_PCR_EXP_PD0 (1 << 4)
147#define OMAP1510_FPGA_PCR_EXP_PD1 (1 << 3)
148#define OMAP1510_FPGA_PCR_48MHZ_CLK (1 << 2)
149#define OMAP1510_FPGA_PCR_4MHZ_CLK (1 << 1)
150#define OMAP1510_FPGA_PCR_RSRVD_BIT0 (1 << 0)
151
152/*
153 * Innovator/OMAP1510 FPGA HID register bit definitions
154 */
155#define OMAP1510_FPGA_HID_SCLK (1<<0) /* output */
156#define OMAP1510_FPGA_HID_MOSI (1<<1) /* output */
157#define OMAP1510_FPGA_HID_nSS (1<<2) /* output 0/1 chip idle/select */
158#define OMAP1510_FPGA_HID_nHSUS (1<<3) /* output 0/1 host active/suspended */
159#define OMAP1510_FPGA_HID_MISO (1<<4) /* input */
160#define OMAP1510_FPGA_HID_ATN (1<<5) /* input 0/1 chip idle/ATN */
161#define OMAP1510_FPGA_HID_rsrvd (1<<6)
162#define OMAP1510_FPGA_HID_RESETn (1<<7) /* output - 0/1 USAR reset/run */
163
164/* The FPGA IRQ is cascaded through GPIO_13 */
165#define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13)
166
167/* IRQ Numbers for interrupts muxed through the FPGA */
168#define OMAP1510_INT_FPGA_ATN (OMAP_FPGA_IRQ_BASE + 0)
169#define OMAP1510_INT_FPGA_ACK (OMAP_FPGA_IRQ_BASE + 1)
170#define OMAP1510_INT_FPGA2 (OMAP_FPGA_IRQ_BASE + 2)
171#define OMAP1510_INT_FPGA3 (OMAP_FPGA_IRQ_BASE + 3)
172#define OMAP1510_INT_FPGA4 (OMAP_FPGA_IRQ_BASE + 4)
173#define OMAP1510_INT_FPGA5 (OMAP_FPGA_IRQ_BASE + 5)
174#define OMAP1510_INT_FPGA6 (OMAP_FPGA_IRQ_BASE + 6)
175#define OMAP1510_INT_FPGA7 (OMAP_FPGA_IRQ_BASE + 7)
176#define OMAP1510_INT_FPGA8 (OMAP_FPGA_IRQ_BASE + 8)
177#define OMAP1510_INT_FPGA9 (OMAP_FPGA_IRQ_BASE + 9)
178#define OMAP1510_INT_FPGA10 (OMAP_FPGA_IRQ_BASE + 10)
179#define OMAP1510_INT_FPGA11 (OMAP_FPGA_IRQ_BASE + 11)
180#define OMAP1510_INT_FPGA12 (OMAP_FPGA_IRQ_BASE + 12)
181#define OMAP1510_INT_ETHER (OMAP_FPGA_IRQ_BASE + 13)
182#define OMAP1510_INT_FPGAUART1 (OMAP_FPGA_IRQ_BASE + 14)
183#define OMAP1510_INT_FPGAUART2 (OMAP_FPGA_IRQ_BASE + 15)
184#define OMAP1510_INT_FPGA_TS (OMAP_FPGA_IRQ_BASE + 16)
185#define OMAP1510_INT_FPGA17 (OMAP_FPGA_IRQ_BASE + 17)
186#define OMAP1510_INT_FPGA_CAM (OMAP_FPGA_IRQ_BASE + 18)
187#define OMAP1510_INT_FPGA_RTC_A (OMAP_FPGA_IRQ_BASE + 19)
188#define OMAP1510_INT_FPGA_RTC_B (OMAP_FPGA_IRQ_BASE + 20)
189#define OMAP1510_INT_FPGA_CD (OMAP_FPGA_IRQ_BASE + 21)
190#define OMAP1510_INT_FPGA22 (OMAP_FPGA_IRQ_BASE + 22)
191#define OMAP1510_INT_FPGA23 (OMAP_FPGA_IRQ_BASE + 23)
192
193#endif
diff --git a/arch/arm/plat-omap/include/plat/i2c.h b/arch/arm/plat-omap/include/plat/i2c.h
index 7c22b9e10dc3..7a9028cb5a75 100644
--- a/arch/arm/plat-omap/include/plat/i2c.h
+++ b/arch/arm/plat-omap/include/plat/i2c.h
@@ -18,11 +18,15 @@
18 * 02110-1301 USA 18 * 02110-1301 USA
19 * 19 *
20 */ 20 */
21#ifndef __ASM__ARCH_OMAP_I2C_H
22#define __ASM__ARCH_OMAP_I2C_H
23 21
24#include <linux/i2c.h> 22#ifndef __PLAT_OMAP_I2C_H
25#include <linux/i2c-omap.h> 23#define __PLAT_OMAP_I2C_H
24
25struct i2c_board_info;
26struct omap_i2c_bus_platform_data;
27
28int omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
29 int bus_id);
26 30
27#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) 31#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
28extern int omap_register_i2c_bus(int bus_id, u32 clkrate, 32extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
@@ -37,23 +41,7 @@ static inline int omap_register_i2c_bus(int bus_id, u32 clkrate,
37} 41}
38#endif 42#endif
39 43
40/**
41 * i2c_dev_attr - OMAP I2C controller device attributes for omap_hwmod
42 * @fifo_depth: total controller FIFO size (in bytes)
43 * @flags: differences in hardware support capability
44 *
45 * @fifo_depth represents what exists on the hardware, not what is
46 * actually configured at runtime by the device driver.
47 */
48struct omap_i2c_dev_attr {
49 u8 fifo_depth;
50 u32 flags;
51};
52
53void __init omap1_i2c_mux_pins(int bus_id);
54void __init omap2_i2c_mux_pins(int bus_id);
55
56struct omap_hwmod; 44struct omap_hwmod;
57int omap_i2c_reset(struct omap_hwmod *oh); 45int omap_i2c_reset(struct omap_hwmod *oh);
58 46
59#endif /* __ASM__ARCH_OMAP_I2C_H */ 47#endif /* __PLAT_OMAP_I2C_H */
diff --git a/arch/arm/plat-omap/include/plat/led.h b/arch/arm/plat-omap/include/plat/led.h
deleted file mode 100644
index 25e451e7e2fd..000000000000
--- a/arch/arm/plat-omap/include/plat/led.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/led.h
3 *
4 * Copyright (C) 2006 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef ASMARM_ARCH_LED_H
12#define ASMARM_ARCH_LED_H
13
14struct omap_led_config {
15 struct led_classdev cdev;
16 s16 gpio;
17};
18
19struct omap_led_platform_data {
20 s16 nr_leds;
21 struct omap_led_config *leds;
22};
23
24#endif
diff --git a/arch/arm/plat-omap/include/plat/menelaus.h b/arch/arm/plat-omap/include/plat/menelaus.h
deleted file mode 100644
index 4a970ec62dd1..000000000000
--- a/arch/arm/plat-omap/include/plat/menelaus.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/menelaus.h
3 *
4 * Functions to access Menelaus power management chip
5 */
6
7#ifndef __ASM_ARCH_MENELAUS_H
8#define __ASM_ARCH_MENELAUS_H
9
10struct device;
11
12struct menelaus_platform_data {
13 int (* late_init)(struct device *dev);
14};
15
16extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask),
17 void *data);
18extern void menelaus_unregister_mmc_callback(void);
19extern int menelaus_set_mmc_opendrain(int slot, int enable);
20extern int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_on);
21
22extern int menelaus_set_vmem(unsigned int mV);
23extern int menelaus_set_vio(unsigned int mV);
24extern int menelaus_set_vmmc(unsigned int mV);
25extern int menelaus_set_vaux(unsigned int mV);
26extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
27extern int menelaus_set_slot_sel(int enable);
28extern int menelaus_get_slot_pin_states(void);
29extern int menelaus_set_vcore_sw(unsigned int mV);
30extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
31
32#define EN_VPLL_SLEEP (1 << 7)
33#define EN_VMMC_SLEEP (1 << 6)
34#define EN_VAUX_SLEEP (1 << 5)
35#define EN_VIO_SLEEP (1 << 4)
36#define EN_VMEM_SLEEP (1 << 3)
37#define EN_DC3_SLEEP (1 << 2)
38#define EN_DC2_SLEEP (1 << 1)
39#define EN_VC_SLEEP (1 << 0)
40
41extern int menelaus_set_regulator_sleep(int enable, u32 val);
42
43#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_MENELAUS)
44#define omap_has_menelaus() 1
45#else
46#define omap_has_menelaus() 0
47#endif
48
49#endif
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
deleted file mode 100644
index 8b4e4f2da2f5..000000000000
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ /dev/null
@@ -1,188 +0,0 @@
1/*
2 * MMC definitions for OMAP2
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __OMAP2_MMC_H
12#define __OMAP2_MMC_H
13
14#include <linux/types.h>
15#include <linux/device.h>
16#include <linux/mmc/host.h>
17
18#include <plat/omap_hwmod.h>
19
20#define OMAP15XX_NR_MMC 1
21#define OMAP16XX_NR_MMC 2
22#define OMAP1_MMC_SIZE 0x080
23#define OMAP1_MMC1_BASE 0xfffb7800
24#define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */
25
26#define OMAP24XX_NR_MMC 2
27#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE
28#define OMAP2_MMC1_BASE 0x4809c000
29
30#define OMAP4_MMC_REG_OFFSET 0x100
31
32#define OMAP_MMC_MAX_SLOTS 2
33
34/*
35 * struct omap_mmc_dev_attr.flags possibilities
36 *
37 * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
38 * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
39 * should be set if this is the case. See for example Section 22.5.3
40 * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
41 * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
42 *
43 * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
44 * don't work correctly on some MMC controller instances on some
45 * OMAP3 SoCs; this flag should be set if this is the case. See
46 * for example Advisory 2.1.1.128 "MMC: Multiple Block Read
47 * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
48 * Revision F (October 2010) (SPRZ278F).
49 */
50#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0)
51#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
52
53struct omap_mmc_dev_attr {
54 u8 flags;
55};
56
57struct omap_mmc_platform_data {
58 /* back-link to device */
59 struct device *dev;
60
61 /* number of slots per controller */
62 unsigned nr_slots:2;
63
64 /* set if your board has components or wiring that limits the
65 * maximum frequency on the MMC bus */
66 unsigned int max_freq;
67
68 /* switch the bus to a new slot */
69 int (*switch_slot)(struct device *dev, int slot);
70 /* initialize board-specific MMC functionality, can be NULL if
71 * not supported */
72 int (*init)(struct device *dev);
73 void (*cleanup)(struct device *dev);
74 void (*shutdown)(struct device *dev);
75
76 /* To handle board related suspend/resume functionality for MMC */
77 int (*suspend)(struct device *dev, int slot);
78 int (*resume)(struct device *dev, int slot);
79
80 /* Return context loss count due to PM states changing */
81 int (*get_context_loss_count)(struct device *dev);
82
83 /* Integrating attributes from the omap_hwmod layer */
84 u8 controller_flags;
85
86 /* Register offset deviation */
87 u16 reg_offset;
88
89 struct omap_mmc_slot_data {
90
91 /*
92 * 4/8 wires and any additional host capabilities
93 * need to OR'd all capabilities (ref. linux/mmc/host.h)
94 */
95 u8 wires; /* Used for the MMC driver on omap1 and 2420 */
96 u32 caps; /* Used for the MMC driver on 2430 and later */
97 u32 pm_caps; /* PM capabilities of the mmc */
98
99 /*
100 * nomux means "standard" muxing is wrong on this board, and
101 * that board-specific code handled it before common init logic.
102 */
103 unsigned nomux:1;
104
105 /* switch pin can be for card detect (default) or card cover */
106 unsigned cover:1;
107
108 /* use the internal clock */
109 unsigned internal_clock:1;
110
111 /* nonremovable e.g. eMMC */
112 unsigned nonremovable:1;
113
114 /* Try to sleep or power off when possible */
115 unsigned power_saving:1;
116
117 /* If using power_saving and the MMC power is not to go off */
118 unsigned no_off:1;
119
120 /* eMMC does not handle power off when not in sleep state */
121 unsigned no_regulator_off_init:1;
122
123 /* Regulator off remapped to sleep */
124 unsigned vcc_aux_disable_is_sleep:1;
125
126 /* we can put the features above into this variable */
127#define HSMMC_HAS_PBIAS (1 << 0)
128#define HSMMC_HAS_UPDATED_RESET (1 << 1)
129 unsigned features;
130
131 int switch_pin; /* gpio (card detect) */
132 int gpio_wp; /* gpio (write protect) */
133
134 int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
135 int (*set_power)(struct device *dev, int slot,
136 int power_on, int vdd);
137 int (*get_ro)(struct device *dev, int slot);
138 void (*remux)(struct device *dev, int slot, int power_on);
139 /* Call back before enabling / disabling regulators */
140 void (*before_set_reg)(struct device *dev, int slot,
141 int power_on, int vdd);
142 /* Call back after enabling / disabling regulators */
143 void (*after_set_reg)(struct device *dev, int slot,
144 int power_on, int vdd);
145 /* if we have special card, init it using this callback */
146 void (*init_card)(struct mmc_card *card);
147
148 /* return MMC cover switch state, can be NULL if not supported.
149 *
150 * possible return values:
151 * 0 - closed
152 * 1 - open
153 */
154 int (*get_cover_state)(struct device *dev, int slot);
155
156 const char *name;
157 u32 ocr_mask;
158
159 /* Card detection IRQs */
160 int card_detect_irq;
161 int (*card_detect)(struct device *dev, int slot);
162
163 unsigned int ban_openended:1;
164
165 } slots[OMAP_MMC_MAX_SLOTS];
166};
167
168/* called from board-specific card detection service routine */
169extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
170 int is_closed);
171
172#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
173void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
174 int nr_controllers);
175void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
176#else
177static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
178 int nr_controllers)
179{
180}
181static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
182{
183}
184#endif
185
186extern int omap_msdi_reset(struct omap_hwmod *oh);
187
188#endif
diff --git a/arch/arm/plat-omap/include/plat/multi.h b/arch/arm/plat-omap/include/plat/multi.h
deleted file mode 100644
index 324d31b14852..000000000000
--- a/arch/arm/plat-omap/include/plat/multi.h
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 * Support for compiling in multiple OMAP processors
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22#ifndef __PLAT_OMAP_MULTI_H
23#define __PLAT_OMAP_MULTI_H
24
25/*
26 * Test if multicore OMAP support is needed
27 */
28#undef MULTI_OMAP1
29#undef MULTI_OMAP2
30#undef OMAP_NAME
31
32#ifdef CONFIG_ARCH_OMAP730
33# ifdef OMAP_NAME
34# undef MULTI_OMAP1
35# define MULTI_OMAP1
36# else
37# define OMAP_NAME omap730
38# endif
39#endif
40#ifdef CONFIG_ARCH_OMAP850
41# ifdef OMAP_NAME
42# undef MULTI_OMAP1
43# define MULTI_OMAP1
44# else
45# define OMAP_NAME omap850
46# endif
47#endif
48#ifdef CONFIG_ARCH_OMAP15XX
49# ifdef OMAP_NAME
50# undef MULTI_OMAP1
51# define MULTI_OMAP1
52# else
53# define OMAP_NAME omap1510
54# endif
55#endif
56#ifdef CONFIG_ARCH_OMAP16XX
57# ifdef OMAP_NAME
58# undef MULTI_OMAP1
59# define MULTI_OMAP1
60# else
61# define OMAP_NAME omap16xx
62# endif
63#endif
64#ifdef CONFIG_ARCH_OMAP2PLUS
65# if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
66# error "OMAP1 and OMAP2PLUS can't be selected at the same time"
67# endif
68#endif
69#ifdef CONFIG_SOC_OMAP2420
70# ifdef OMAP_NAME
71# undef MULTI_OMAP2
72# define MULTI_OMAP2
73# else
74# define OMAP_NAME omap2420
75# endif
76#endif
77#ifdef CONFIG_SOC_OMAP2430
78# ifdef OMAP_NAME
79# undef MULTI_OMAP2
80# define MULTI_OMAP2
81# else
82# define OMAP_NAME omap2430
83# endif
84#endif
85#ifdef CONFIG_ARCH_OMAP3
86# ifdef OMAP_NAME
87# undef MULTI_OMAP2
88# define MULTI_OMAP2
89# else
90# define OMAP_NAME omap3
91# endif
92#endif
93#ifdef CONFIG_ARCH_OMAP4
94# ifdef OMAP_NAME
95# undef MULTI_OMAP2
96# define MULTI_OMAP2
97# else
98# define OMAP_NAME omap4
99# endif
100#endif
101
102#ifdef CONFIG_SOC_OMAP5
103# ifdef OMAP_NAME
104# undef MULTI_OMAP2
105# define MULTI_OMAP2
106# else
107# define OMAP_NAME omap5
108# endif
109#endif
110
111#ifdef CONFIG_SOC_AM33XX
112# ifdef OMAP_NAME
113# undef MULTI_OMAP2
114# define MULTI_OMAP2
115# else
116# define OMAP_NAME am33xx
117# endif
118#endif
119
120#endif /* __PLAT_OMAP_MULTI_H */
diff --git a/arch/arm/plat-omap/include/plat/omap-secure.h b/arch/arm/plat-omap/include/plat/omap-secure.h
deleted file mode 100644
index 0e4acd2d2deb..000000000000
--- a/arch/arm/plat-omap/include/plat/omap-secure.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef __OMAP_SECURE_H__
2#define __OMAP_SECURE_H__
3
4#include <linux/types.h>
5
6extern int omap_secure_ram_reserve_memblock(void);
7
8#ifdef CONFIG_OMAP4_ERRATA_I688
9extern int omap_barrier_reserve_memblock(void);
10#else
11static inline void omap_barrier_reserve_memblock(void)
12{ }
13#endif
14#endif /* __OMAP_SECURE_H__ */
diff --git a/arch/arm/plat-omap/include/plat/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h
deleted file mode 100644
index 267f43bb2a4e..000000000000
--- a/arch/arm/plat-omap/include/plat/prcm.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/prcm.h
3 *
4 * Access definations for use in OMAP24XX clock and power management
5 *
6 * Copyright (C) 2005 Texas Instruments, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License 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 * XXX This file is deprecated. The PRCM is an OMAP2+-only subsystem,
23 * so this file doesn't belong in plat-omap/include/plat. Please
24 * do not add anything new to this file.
25 */
26
27#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H
28#define __ASM_ARM_ARCH_OMAP_PRCM_H
29
30u32 omap_prcm_get_reset_sources(void);
31int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
32 const char *name);
33
34#endif
35
36
37
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
deleted file mode 100644
index 36d6a7666216..000000000000
--- a/arch/arm/plat-omap/include/plat/sdrc.h
+++ /dev/null
@@ -1,164 +0,0 @@
1#ifndef ____ASM_ARCH_SDRC_H
2#define ____ASM_ARCH_SDRC_H
3
4/*
5 * OMAP2/3 SDRC/SMS register definitions
6 *
7 * Copyright (C) 2007-2008 Texas Instruments, Inc.
8 * Copyright (C) 2007-2008 Nokia Corporation
9 *
10 * Tony Lindgren
11 * Paul Walmsley
12 * Richard Woodruff
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19
20/* SDRC register offsets - read/write with sdrc_{read,write}_reg() */
21
22#define SDRC_SYSCONFIG 0x010
23#define SDRC_CS_CFG 0x040
24#define SDRC_SHARING 0x044
25#define SDRC_ERR_TYPE 0x04C
26#define SDRC_DLLA_CTRL 0x060
27#define SDRC_DLLA_STATUS 0x064
28#define SDRC_DLLB_CTRL 0x068
29#define SDRC_DLLB_STATUS 0x06C
30#define SDRC_POWER 0x070
31#define SDRC_MCFG_0 0x080
32#define SDRC_MR_0 0x084
33#define SDRC_EMR2_0 0x08c
34#define SDRC_ACTIM_CTRL_A_0 0x09c
35#define SDRC_ACTIM_CTRL_B_0 0x0a0
36#define SDRC_RFR_CTRL_0 0x0a4
37#define SDRC_MANUAL_0 0x0a8
38#define SDRC_MCFG_1 0x0B0
39#define SDRC_MR_1 0x0B4
40#define SDRC_EMR2_1 0x0BC
41#define SDRC_ACTIM_CTRL_A_1 0x0C4
42#define SDRC_ACTIM_CTRL_B_1 0x0C8
43#define SDRC_RFR_CTRL_1 0x0D4
44#define SDRC_MANUAL_1 0x0D8
45
46#define SDRC_POWER_AUTOCOUNT_SHIFT 8
47#define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
48#define SDRC_POWER_CLKCTRL_SHIFT 4
49#define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
50#define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
51
52/*
53 * These values represent the number of memory clock cycles between
54 * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192
55 * rows per device, and include a subtraction of a 50 cycle window in the
56 * event that the autorefresh command is delayed due to other SDRC activity.
57 * The '| 1' sets the ARE field to send one autorefresh when the autorefresh
58 * counter reaches 0.
59 *
60 * These represent optimal values for common parts, it won't work for all.
61 * As long as you scale down, most parameters are still work, they just
62 * become sub-optimal. The RFR value goes in the opposite direction. If you
63 * don't adjust it down as your clock period increases the refresh interval
64 * will not be met. Setting all parameters for complete worst case may work,
65 * but may cut memory performance by 2x. Due to errata the DLLs need to be
66 * unlocked and their value needs run time calibration. A dynamic call is
67 * need for that as no single right value exists acorss production samples.
68 *
69 * Only the FULL speed values are given. Current code is such that rate
70 * changes must be made at DPLLoutx2. The actual value adjustment for low
71 * frequency operation will be handled by omap_set_performance()
72 *
73 * By having the boot loader boot up in the fastest L4 speed available likely
74 * will result in something which you can switch between.
75 */
76#define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1)
77#define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1)
78#define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1)
79#define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1) /* Need to calc */
80#define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1) /* Need to calc */
81
82
83/*
84 * SMS register access
85 */
86
87#define OMAP242X_SMS_REGADDR(reg) \
88 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
89#define OMAP243X_SMS_REGADDR(reg) \
90 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
91#define OMAP343X_SMS_REGADDR(reg) \
92 (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
93
94/* SMS register offsets - read/write with sms_{read,write}_reg() */
95
96#define SMS_SYSCONFIG 0x010
97#define SMS_ROT_CONTROL(context) (0x180 + 0x10 * context)
98#define SMS_ROT_SIZE(context) (0x184 + 0x10 * context)
99#define SMS_ROT_PHYSICAL_BA(context) (0x188 + 0x10 * context)
100/* REVISIT: fill in other SMS registers here */
101
102
103#ifndef __ASSEMBLER__
104
105/**
106 * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate
107 * @rate: SDRC clock rate (in Hz)
108 * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate
109 * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate
110 * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate
111 * @mr: Value to program to SDRC_MR for this rate
112 *
113 * This structure holds a pre-computed set of register values for the
114 * SDRC for a given SDRC clock rate and SDRAM chip. These are
115 * intended to be pre-computed and specified in an array in the board-*.c
116 * files. The structure is keyed off the 'rate' field.
117 */
118struct omap_sdrc_params {
119 unsigned long rate;
120 u32 actim_ctrla;
121 u32 actim_ctrlb;
122 u32 rfr_ctrl;
123 u32 mr;
124};
125
126#ifdef CONFIG_SOC_HAS_OMAP2_SDRC
127void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
128 struct omap_sdrc_params *sdrc_cs1);
129#else
130static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
131 struct omap_sdrc_params *sdrc_cs1) {};
132#endif
133
134int omap2_sdrc_get_params(unsigned long r,
135 struct omap_sdrc_params **sdrc_cs0,
136 struct omap_sdrc_params **sdrc_cs1);
137void omap2_sms_save_context(void);
138void omap2_sms_restore_context(void);
139
140void omap2_sms_write_rot_control(u32 val, unsigned ctx);
141void omap2_sms_write_rot_size(u32 val, unsigned ctx);
142void omap2_sms_write_rot_physical_ba(u32 val, unsigned ctx);
143
144#ifdef CONFIG_ARCH_OMAP2
145
146struct memory_timings {
147 u32 m_type; /* ddr = 1, sdr = 0 */
148 u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */
149 u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */
150 u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */
151 u32 base_cs; /* base chip select to use for calculations */
152};
153
154extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode);
155struct omap_sdrc_params *rx51_get_sdram_timings(void);
156
157u32 omap2xxx_sdrc_dll_is_unlocked(void);
158u32 omap2xxx_sdrc_reprogram(u32 level, u32 force);
159
160#endif /* CONFIG_ARCH_OMAP2 */
161
162#endif /* __ASSEMBLER__ */
163
164#endif
diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h
index 227ae2657554..ba4525059a99 100644
--- a/arch/arm/plat-omap/include/plat/sram.h
+++ b/arch/arm/plat-omap/include/plat/sram.h
@@ -1,18 +1,8 @@
1/* 1int omap_sram_init(void);
2 * arch/arm/plat-omap/include/mach/sram.h
3 *
4 * Interface for functions that need to be run in internal SRAM
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 2
11#ifndef __ARCH_ARM_OMAP_SRAM_H 3void omap_map_sram(unsigned long start, unsigned long size,
12#define __ARCH_ARM_OMAP_SRAM_H 4 unsigned long skip, int cached);
13 5void omap_sram_reset(void);
14#ifndef __ASSEMBLY__
15#include <asm/fncpy.h>
16 6
17extern void *omap_sram_push_address(unsigned long size); 7extern void *omap_sram_push_address(unsigned long size);
18 8
@@ -24,82 +14,3 @@ extern void *omap_sram_push_address(unsigned long size);
24 _res = fncpy(_sram_address, &(funcp), size); \ 14 _res = fncpy(_sram_address, &(funcp), size); \
25 _res; \ 15 _res; \
26}) 16})
27
28extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
29
30extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
31 u32 base_cs, u32 force_unlock);
32extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
33 u32 mem_type);
34extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
35
36extern u32 omap3_configure_core_dpll(
37 u32 m2, u32 unlock_dll, u32 f, u32 inc,
38 u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
39 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
40 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
41 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
42extern void omap3_sram_restore_context(void);
43
44/* Do not use these */
45extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
46extern unsigned long omap1_sram_reprogram_clock_sz;
47
48extern void omap24xx_sram_reprogram_clock(u32 ckctl, u32 dpllctl);
49extern unsigned long omap24xx_sram_reprogram_clock_sz;
50
51extern void omap242x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
52 u32 base_cs, u32 force_unlock);
53extern unsigned long omap242x_sram_ddr_init_sz;
54
55extern u32 omap242x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
56 int bypass);
57extern unsigned long omap242x_sram_set_prcm_sz;
58
59extern void omap242x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
60 u32 mem_type);
61extern unsigned long omap242x_sram_reprogram_sdrc_sz;
62
63
64extern void omap243x_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
65 u32 base_cs, u32 force_unlock);
66extern unsigned long omap243x_sram_ddr_init_sz;
67
68extern u32 omap243x_sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val,
69 int bypass);
70extern unsigned long omap243x_sram_set_prcm_sz;
71
72extern void omap243x_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
73 u32 mem_type);
74extern unsigned long omap243x_sram_reprogram_sdrc_sz;
75
76extern u32 omap3_sram_configure_core_dpll(
77 u32 m2, u32 unlock_dll, u32 f, u32 inc,
78 u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
79 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
80 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
81 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
82extern unsigned long omap3_sram_configure_core_dpll_sz;
83
84#ifdef CONFIG_PM
85extern void omap_push_sram_idle(void);
86#else
87static inline void omap_push_sram_idle(void) {}
88#endif /* CONFIG_PM */
89
90#endif /* __ASSEMBLY__ */
91
92/*
93 * OMAP2+: define the SRAM PA addresses.
94 * Used by the SRAM management code and the idle sleep code.
95 */
96#define OMAP2_SRAM_PA 0x40200000
97#define OMAP3_SRAM_PA 0x40200000
98#ifdef CONFIG_OMAP4_ERRATA_I688
99#define OMAP4_SRAM_PA 0x40304000
100#define OMAP4_SRAM_VA 0xfe404000
101#else
102#define OMAP4_SRAM_PA 0x40300000
103#endif
104#define AM33XX_SRAM_PA 0x40300000
105#endif
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
deleted file mode 100644
index 7f7b112acccb..000000000000
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ /dev/null
@@ -1,204 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
10 *
11 * Rewritten by:
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
14 *
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
18 */
19
20#include <linux/types.h>
21#include <linux/serial_reg.h>
22
23#include <asm/memory.h>
24#include <asm/mach-types.h>
25
26#include <plat/serial.h>
27
28#define MDR1_MODE_MASK 0x07
29
30volatile u8 *uart_base;
31int uart_shift;
32
33/*
34 * Store the DEBUG_LL uart number into memory.
35 * See also debug-macro.S, and serial.c for related code.
36 */
37static void set_omap_uart_info(unsigned char port)
38{
39 /*
40 * Get address of some.bss variable and round it down
41 * a la CONFIG_AUTO_ZRELADDR.
42 */
43 u32 ram_start = (u32)&uart_shift & 0xf8000000;
44 u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
45 *uart_info = port;
46}
47
48static void putc(int c)
49{
50 if (!uart_base)
51 return;
52
53 /* Check for UART 16x mode */
54 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
55 return;
56
57 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
58 barrier();
59 uart_base[UART_TX << uart_shift] = c;
60}
61
62static inline void flush(void)
63{
64}
65
66/*
67 * Macros to configure UART1 and debug UART
68 */
69#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
70 if (machine_is_##mach()) { \
71 uart_base = (volatile u8 *)(dbg_uart); \
72 uart_shift = (dbg_shft); \
73 port = (dbg_id); \
74 set_omap_uart_info(port); \
75 break; \
76 }
77
78#define DEBUG_LL_OMAP7XX(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
80 OMAP1UART##p)
81
82#define DEBUG_LL_OMAP1(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
84 OMAP1UART##p)
85
86#define DEBUG_LL_OMAP2(p, mach) \
87 _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
88 OMAP2UART##p)
89
90#define DEBUG_LL_OMAP3(p, mach) \
91 _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
92 OMAP3UART##p)
93
94#define DEBUG_LL_OMAP4(p, mach) \
95 _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
96 OMAP4UART##p)
97
98#define DEBUG_LL_OMAP5(p, mach) \
99 _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT, \
100 OMAP5UART##p)
101/* Zoom2/3 shift is different for UART1 and external port */
102#define DEBUG_LL_ZOOM(mach) \
103 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
104
105#define DEBUG_LL_TI81XX(p, mach) \
106 _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
107 TI81XXUART##p)
108
109#define DEBUG_LL_AM33XX(p, mach) \
110 _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
111 AM33XXUART##p)
112
113static inline void arch_decomp_setup(void)
114{
115 int port = 0;
116
117 /*
118 * Initialize the port based on the machine ID from the bootloader.
119 * Note that we're using macros here instead of switch statement
120 * as machine_is functions are optimized out for the boards that
121 * are not selected.
122 */
123 do {
124 /* omap7xx/8xx based boards using UART1 with shift 0 */
125 DEBUG_LL_OMAP7XX(1, herald);
126 DEBUG_LL_OMAP7XX(1, omap_perseus2);
127
128 /* omap15xx/16xx based boards using UART1 */
129 DEBUG_LL_OMAP1(1, ams_delta);
130 DEBUG_LL_OMAP1(1, nokia770);
131 DEBUG_LL_OMAP1(1, omap_h2);
132 DEBUG_LL_OMAP1(1, omap_h3);
133 DEBUG_LL_OMAP1(1, omap_innovator);
134 DEBUG_LL_OMAP1(1, omap_osk);
135 DEBUG_LL_OMAP1(1, omap_palmte);
136 DEBUG_LL_OMAP1(1, omap_palmz71);
137
138 /* omap15xx/16xx based boards using UART2 */
139 DEBUG_LL_OMAP1(2, omap_palmtt);
140
141 /* omap15xx/16xx based boards using UART3 */
142 DEBUG_LL_OMAP1(3, sx1);
143
144 /* omap2 based boards using UART1 */
145 DEBUG_LL_OMAP2(1, omap_2430sdp);
146 DEBUG_LL_OMAP2(1, omap_apollon);
147 DEBUG_LL_OMAP2(1, omap_h4);
148
149 /* omap2 based boards using UART3 */
150 DEBUG_LL_OMAP2(3, nokia_n800);
151 DEBUG_LL_OMAP2(3, nokia_n810);
152 DEBUG_LL_OMAP2(3, nokia_n810_wimax);
153
154 /* omap3 based boards using UART1 */
155 DEBUG_LL_OMAP2(1, omap3evm);
156 DEBUG_LL_OMAP3(1, omap_3430sdp);
157 DEBUG_LL_OMAP3(1, omap_3630sdp);
158 DEBUG_LL_OMAP3(1, omap3530_lv_som);
159 DEBUG_LL_OMAP3(1, omap3_torpedo);
160
161 /* omap3 based boards using UART3 */
162 DEBUG_LL_OMAP3(3, cm_t35);
163 DEBUG_LL_OMAP3(3, cm_t3517);
164 DEBUG_LL_OMAP3(3, cm_t3730);
165 DEBUG_LL_OMAP3(3, craneboard);
166 DEBUG_LL_OMAP3(3, devkit8000);
167 DEBUG_LL_OMAP3(3, igep0020);
168 DEBUG_LL_OMAP3(3, igep0030);
169 DEBUG_LL_OMAP3(3, nokia_rm680);
170 DEBUG_LL_OMAP3(3, nokia_rm696);
171 DEBUG_LL_OMAP3(3, nokia_rx51);
172 DEBUG_LL_OMAP3(3, omap3517evm);
173 DEBUG_LL_OMAP3(3, omap3_beagle);
174 DEBUG_LL_OMAP3(3, omap3_pandora);
175 DEBUG_LL_OMAP3(3, omap_ldp);
176 DEBUG_LL_OMAP3(3, overo);
177 DEBUG_LL_OMAP3(3, touchbook);
178
179 /* omap4 based boards using UART3 */
180 DEBUG_LL_OMAP4(3, omap_4430sdp);
181 DEBUG_LL_OMAP4(3, omap4_panda);
182
183 /* omap5 based boards using UART3 */
184 DEBUG_LL_OMAP5(3, omap5_sevm);
185
186 /* zoom2/3 external uart */
187 DEBUG_LL_ZOOM(omap_zoom2);
188 DEBUG_LL_ZOOM(omap_zoom3);
189
190 /* TI8168 base boards using UART3 */
191 DEBUG_LL_TI81XX(3, ti8168evm);
192
193 /* TI8148 base boards using UART1 */
194 DEBUG_LL_TI81XX(1, ti8148evm);
195
196 /* AM33XX base boards using UART1 */
197 DEBUG_LL_AM33XX(1, am335xevm);
198 } while (0);
199}
200
201/*
202 * nothing to do
203 */
204#define arch_decomp_wdog()
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
deleted file mode 100644
index 87ee140fefaa..000000000000
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ /dev/null
@@ -1,179 +0,0 @@
1// include/asm-arm/mach-omap/usb.h
2
3#ifndef __ASM_ARCH_OMAP_USB_H
4#define __ASM_ARCH_OMAP_USB_H
5
6#include <linux/io.h>
7#include <linux/platform_device.h>
8#include <linux/usb/musb.h>
9
10#define OMAP3_HS_USB_PORTS 3
11
12enum usbhs_omap_port_mode {
13 OMAP_USBHS_PORT_MODE_UNUSED,
14 OMAP_EHCI_PORT_MODE_PHY,
15 OMAP_EHCI_PORT_MODE_TLL,
16 OMAP_EHCI_PORT_MODE_HSIC,
17 OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0,
18 OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM,
19 OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0,
20 OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
21 OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0,
22 OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM,
23 OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0,
24 OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM,
25 OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0,
26 OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
27};
28
29struct usbhs_omap_board_data {
30 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
31
32 /* have to be valid if phy_reset is true and portx is in phy mode */
33 int reset_gpio_port[OMAP3_HS_USB_PORTS];
34
35 /* Set this to true for ES2.x silicon */
36 unsigned es2_compatibility:1;
37
38 unsigned phy_reset:1;
39
40 /*
41 * Regulators for USB PHYs.
42 * Each PHY can have a separate regulator.
43 */
44 struct regulator *regulator[OMAP3_HS_USB_PORTS];
45};
46
47#ifdef CONFIG_ARCH_OMAP2PLUS
48
49struct ehci_hcd_omap_platform_data {
50 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
51 int reset_gpio_port[OMAP3_HS_USB_PORTS];
52 struct regulator *regulator[OMAP3_HS_USB_PORTS];
53 unsigned phy_reset:1;
54};
55
56struct ohci_hcd_omap_platform_data {
57 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
58 unsigned es2_compatibility:1;
59};
60
61struct usbhs_omap_platform_data {
62 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
63
64 struct ehci_hcd_omap_platform_data *ehci_data;
65 struct ohci_hcd_omap_platform_data *ohci_data;
66};
67
68struct usbtll_omap_platform_data {
69 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
70};
71/*-------------------------------------------------------------------------*/
72
73struct omap_musb_board_data {
74 u8 interface_type;
75 u8 mode;
76 u16 power;
77 unsigned extvbus:1;
78 void (*set_phy_power)(u8 on);
79 void (*clear_irq)(void);
80 void (*set_mode)(u8 mode);
81 void (*reset)(void);
82};
83
84enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
85
86extern void usb_musb_init(struct omap_musb_board_data *board_data);
87
88extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
89extern int omap_tll_enable(void);
90extern int omap_tll_disable(void);
91
92extern int omap4430_phy_power(struct device *dev, int ID, int on);
93extern int omap4430_phy_set_clk(struct device *dev, int on);
94extern int omap4430_phy_init(struct device *dev);
95extern int omap4430_phy_exit(struct device *dev);
96extern int omap4430_phy_suspend(struct device *dev, int suspend);
97
98#endif
99
100extern void am35x_musb_reset(void);
101extern void am35x_musb_phy_power(u8 on);
102extern void am35x_musb_clear_irq(void);
103extern void am35x_set_mode(u8 musb_mode);
104extern void ti81xx_musb_phy_power(u8 on);
105
106/* AM35x */
107/* USB 2.0 PHY Control */
108#define CONF2_PHY_GPIOMODE (1 << 23)
109#define CONF2_OTGMODE (3 << 14)
110#define CONF2_NO_OVERRIDE (0 << 14)
111#define CONF2_FORCE_HOST (1 << 14)
112#define CONF2_FORCE_DEVICE (2 << 14)
113#define CONF2_FORCE_HOST_VBUS_LOW (3 << 14)
114#define CONF2_SESENDEN (1 << 13)
115#define CONF2_VBDTCTEN (1 << 12)
116#define CONF2_REFFREQ_24MHZ (2 << 8)
117#define CONF2_REFFREQ_26MHZ (7 << 8)
118#define CONF2_REFFREQ_13MHZ (6 << 8)
119#define CONF2_REFFREQ (0xf << 8)
120#define CONF2_PHYCLKGD (1 << 7)
121#define CONF2_VBUSSENSE (1 << 6)
122#define CONF2_PHY_PLLON (1 << 5)
123#define CONF2_RESET (1 << 4)
124#define CONF2_PHYPWRDN (1 << 3)
125#define CONF2_OTGPWRDN (1 << 2)
126#define CONF2_DATPOL (1 << 1)
127
128/* TI81XX specific definitions */
129#define USBCTRL0 0x620
130#define USBSTAT0 0x624
131
132/* TI816X PHY controls bits */
133#define TI816X_USBPHY0_NORMAL_MODE (1 << 0)
134#define TI816X_USBPHY_REFCLK_OSC (1 << 8)
135
136/* TI814X PHY controls bits */
137#define USBPHY_CM_PWRDN (1 << 0)
138#define USBPHY_OTG_PWRDN (1 << 1)
139#define USBPHY_CHGDET_DIS (1 << 2)
140#define USBPHY_CHGDET_RSTRT (1 << 3)
141#define USBPHY_SRCONDM (1 << 4)
142#define USBPHY_SINKONDP (1 << 5)
143#define USBPHY_CHGISINK_EN (1 << 6)
144#define USBPHY_CHGVSRC_EN (1 << 7)
145#define USBPHY_DMPULLUP (1 << 8)
146#define USBPHY_DPPULLUP (1 << 9)
147#define USBPHY_CDET_EXTCTL (1 << 10)
148#define USBPHY_GPIO_MODE (1 << 12)
149#define USBPHY_DPOPBUFCTL (1 << 13)
150#define USBPHY_DMOPBUFCTL (1 << 14)
151#define USBPHY_DPINPUT (1 << 15)
152#define USBPHY_DMINPUT (1 << 16)
153#define USBPHY_DPGPIO_PD (1 << 17)
154#define USBPHY_DMGPIO_PD (1 << 18)
155#define USBPHY_OTGVDET_EN (1 << 19)
156#define USBPHY_OTGSESSEND_EN (1 << 20)
157#define USBPHY_DATA_POLARITY (1 << 23)
158
159#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_USB)
160u32 omap1_usb0_init(unsigned nwires, unsigned is_device);
161u32 omap1_usb1_init(unsigned nwires);
162u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup);
163#else
164static inline u32 omap1_usb0_init(unsigned nwires, unsigned is_device)
165{
166 return 0;
167}
168static inline u32 omap1_usb1_init(unsigned nwires)
169{
170 return 0;
171
172}
173static inline u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup)
174{
175 return 0;
176}
177#endif
178
179#endif /* __ASM_ARCH_OMAP_USB_H */
diff --git a/arch/arm/plat-omap/include/plat/vrfb.h b/arch/arm/plat-omap/include/plat/vrfb.h
deleted file mode 100644
index 3792bdea2f6d..000000000000
--- a/arch/arm/plat-omap/include/plat/vrfb.h
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * VRFB Rotation Engine
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * 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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __OMAP_VRFB_H__
22#define __OMAP_VRFB_H__
23
24#define OMAP_VRFB_LINE_LEN 2048
25
26struct vrfb {
27 u8 context;
28 void __iomem *vaddr[4];
29 unsigned long paddr[4];
30 u16 xres;
31 u16 yres;
32 u16 xoffset;
33 u16 yoffset;
34 u8 bytespp;
35 bool yuv_mode;
36};
37
38#ifdef CONFIG_OMAP2_VRFB
39extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
40extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
41extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
42 u8 bytespp);
43extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
44extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
45extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
46 u16 width, u16 height,
47 unsigned bytespp, bool yuv_mode);
48extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
49extern void omap_vrfb_restore_context(void);
50
51#else
52static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
53static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
54static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
55 u8 bytespp) {}
56static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
57 { return 0; }
58static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
59 { return 0; }
60static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
61 u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
62static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
63 { return 0; }
64static inline void omap_vrfb_restore_context(void) {}
65#endif
66#endif /* __VRFB_H */
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 28acb383e7df..743fc2836f7a 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -20,198 +20,20 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <asm/fncpy.h>
23#include <asm/tlb.h> 24#include <asm/tlb.h>
24#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
25 26
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
27 28
28#include <plat/sram.h>
29#include <plat/cpu.h>
30
31#include "sram.h"
32
33/* XXX These "sideways" includes will disappear when sram.c becomes a driver */
34#include "../mach-omap2/iomap.h"
35#include "../mach-omap2/prm2xxx_3xxx.h"
36#include "../mach-omap2/sdrc.h"
37
38#define OMAP1_SRAM_PA 0x20000000
39#define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800)
40#define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000)
41#ifdef CONFIG_OMAP4_ERRATA_I688
42#define OMAP4_SRAM_PUB_PA OMAP4_SRAM_PA
43#else
44#define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000)
45#endif
46#define OMAP5_SRAM_PA 0x40300000
47
48#if defined(CONFIG_ARCH_OMAP2PLUS)
49#define SRAM_BOOTLOADER_SZ 0x00
50#else
51#define SRAM_BOOTLOADER_SZ 0x80
52#endif
53
54#define OMAP24XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68005048)
55#define OMAP24XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68005050)
56#define OMAP24XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68005058)
57
58#define OMAP34XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68012848)
59#define OMAP34XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68012850)
60#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)
61#define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880)
62#define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048)
63
64#define GP_DEVICE 0x300
65
66#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) 29#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1)))
67 30
68static unsigned long omap_sram_start;
69static void __iomem *omap_sram_base; 31static void __iomem *omap_sram_base;
70static unsigned long omap_sram_skip; 32static unsigned long omap_sram_skip;
71static unsigned long omap_sram_size; 33static unsigned long omap_sram_size;
72static void __iomem *omap_sram_ceil; 34static void __iomem *omap_sram_ceil;
73 35
74/* 36/*
75 * Depending on the target RAMFS firewall setup, the public usable amount of
76 * SRAM varies. The default accessible size for all device types is 2k. A GP
77 * device allows ARM11 but not other initiators for full size. This
78 * functionality seems ok until some nice security API happens.
79 */
80static int is_sram_locked(void)
81{
82 if (OMAP2_DEVICE_TYPE_GP == omap_type()) {
83 /* RAMFW: R/W access to all initiators for all qualifier sets */
84 if (cpu_is_omap242x()) {
85 __raw_writel(0xFF, OMAP24XX_VA_REQINFOPERM0); /* all q-vects */
86 __raw_writel(0xCFDE, OMAP24XX_VA_READPERM0); /* all i-read */
87 __raw_writel(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */
88 }
89 if (cpu_is_omap34xx()) {
90 __raw_writel(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */
91 __raw_writel(0xFFFF, OMAP34XX_VA_READPERM0); /* all i-read */
92 __raw_writel(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */
93 __raw_writel(0x0, OMAP34XX_VA_ADDR_MATCH2);
94 __raw_writel(0xFFFFFFFF, OMAP34XX_VA_SMS_RG_ATT0);
95 }
96 return 0;
97 } else
98 return 1; /* assume locked with no PPA or security driver */
99}
100
101/*
102 * The amount of SRAM depends on the core type.
103 * Note that we cannot try to test for SRAM here because writes
104 * to secure SRAM will hang the system. Also the SRAM is not
105 * yet mapped at this point.
106 */
107static void __init omap_detect_sram(void)
108{
109 omap_sram_skip = SRAM_BOOTLOADER_SZ;
110 if (cpu_class_is_omap2()) {
111 if (is_sram_locked()) {
112 if (cpu_is_omap34xx()) {
113 omap_sram_start = OMAP3_SRAM_PUB_PA;
114 if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) ||
115 (omap_type() == OMAP2_DEVICE_TYPE_SEC)) {
116 omap_sram_size = 0x7000; /* 28K */
117 omap_sram_skip += SZ_16K;
118 } else {
119 omap_sram_size = 0x8000; /* 32K */
120 }
121 } else if (cpu_is_omap44xx()) {
122 omap_sram_start = OMAP4_SRAM_PUB_PA;
123 omap_sram_size = 0xa000; /* 40K */
124 } else if (soc_is_omap54xx()) {
125 omap_sram_start = OMAP5_SRAM_PA;
126 omap_sram_size = SZ_128K; /* 128KB */
127 } else {
128 omap_sram_start = OMAP2_SRAM_PUB_PA;
129 omap_sram_size = 0x800; /* 2K */
130 }
131 } else {
132 if (soc_is_am33xx()) {
133 omap_sram_start = AM33XX_SRAM_PA;
134 omap_sram_size = 0x10000; /* 64K */
135 } else if (cpu_is_omap34xx()) {
136 omap_sram_start = OMAP3_SRAM_PA;
137 omap_sram_size = 0x10000; /* 64K */
138 } else if (cpu_is_omap44xx()) {
139 omap_sram_start = OMAP4_SRAM_PA;
140 omap_sram_size = 0xe000; /* 56K */
141 } else if (soc_is_omap54xx()) {
142 omap_sram_start = OMAP5_SRAM_PA;
143 omap_sram_size = SZ_128K; /* 128KB */
144 } else {
145 omap_sram_start = OMAP2_SRAM_PA;
146 if (cpu_is_omap242x())
147 omap_sram_size = 0xa0000; /* 640K */
148 else if (cpu_is_omap243x())
149 omap_sram_size = 0x10000; /* 64K */
150 }
151 }
152 } else {
153 omap_sram_start = OMAP1_SRAM_PA;
154
155 if (cpu_is_omap7xx())
156 omap_sram_size = 0x32000; /* 200K */
157 else if (cpu_is_omap15xx())
158 omap_sram_size = 0x30000; /* 192K */
159 else if (cpu_is_omap1610() || cpu_is_omap1611() ||
160 cpu_is_omap1621() || cpu_is_omap1710())
161 omap_sram_size = 0x4000; /* 16K */
162 else {
163 pr_err("Could not detect SRAM size\n");
164 omap_sram_size = 0x4000;
165 }
166 }
167}
168
169/*
170 * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early.
171 */
172static void __init omap_map_sram(void)
173{
174 int cached = 1;
175
176 if (omap_sram_size == 0)
177 return;
178
179#ifdef CONFIG_OMAP4_ERRATA_I688
180 if (cpu_is_omap44xx()) {
181 omap_sram_start += PAGE_SIZE;
182 omap_sram_size -= SZ_16K;
183 }
184#endif
185 if (cpu_is_omap34xx()) {
186 /*
187 * SRAM must be marked as non-cached on OMAP3 since the
188 * CORE DPLL M2 divider change code (in SRAM) runs with the
189 * SDRAM controller disabled, and if it is marked cached,
190 * the ARM may attempt to write cache lines back to SDRAM
191 * which will cause the system to hang.
192 */
193 cached = 0;
194 }
195
196 omap_sram_start = ROUND_DOWN(omap_sram_start, PAGE_SIZE);
197 omap_sram_base = __arm_ioremap_exec(omap_sram_start, omap_sram_size,
198 cached);
199 if (!omap_sram_base) {
200 pr_err("SRAM: Could not map\n");
201 return;
202 }
203
204 omap_sram_ceil = omap_sram_base + omap_sram_size;
205
206 /*
207 * Looks like we need to preserve some bootloader code at the
208 * beginning of SRAM for jumping to flash for reboot to work...
209 */
210 memset_io(omap_sram_base + omap_sram_skip, 0,
211 omap_sram_size - omap_sram_skip);
212}
213
214/*
215 * Memory allocator for SRAM: calculates the new ceiling address 37 * Memory allocator for SRAM: calculates the new ceiling address
216 * for pushing a function using the fncpy API. 38 * for pushing a function using the fncpy API.
217 * 39 *
@@ -236,171 +58,39 @@ void *omap_sram_push_address(unsigned long size)
236 return (void *)omap_sram_ceil; 58 return (void *)omap_sram_ceil;
237} 59}
238 60
239#ifdef CONFIG_ARCH_OMAP1 61/*
240 62 * The SRAM context is lost during off-idle and stack
241static void (*_omap_sram_reprogram_clock)(u32 dpllctl, u32 ckctl); 63 * needs to be reset.
242 64 */
243void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl) 65void omap_sram_reset(void)
244{
245 BUG_ON(!_omap_sram_reprogram_clock);
246 /* On 730, bit 13 must always be 1 */
247 if (cpu_is_omap7xx())
248 ckctl |= 0x2000;
249 _omap_sram_reprogram_clock(dpllctl, ckctl);
250}
251
252static int __init omap1_sram_init(void)
253{
254 _omap_sram_reprogram_clock =
255 omap_sram_push(omap1_sram_reprogram_clock,
256 omap1_sram_reprogram_clock_sz);
257
258 return 0;
259}
260
261#else
262#define omap1_sram_init() do {} while (0)
263#endif
264
265#if defined(CONFIG_ARCH_OMAP2)
266
267static void (*_omap2_sram_ddr_init)(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
268 u32 base_cs, u32 force_unlock);
269
270void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
271 u32 base_cs, u32 force_unlock)
272{
273 BUG_ON(!_omap2_sram_ddr_init);
274 _omap2_sram_ddr_init(slow_dll_ctrl, fast_dll_ctrl,
275 base_cs, force_unlock);
276}
277
278static void (*_omap2_sram_reprogram_sdrc)(u32 perf_level, u32 dll_val,
279 u32 mem_type);
280
281void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type)
282{
283 BUG_ON(!_omap2_sram_reprogram_sdrc);
284 _omap2_sram_reprogram_sdrc(perf_level, dll_val, mem_type);
285}
286
287static u32 (*_omap2_set_prcm)(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass);
288
289u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass)
290{
291 BUG_ON(!_omap2_set_prcm);
292 return _omap2_set_prcm(dpll_ctrl_val, sdrc_rfr_val, bypass);
293}
294#endif
295
296#ifdef CONFIG_SOC_OMAP2420
297static int __init omap242x_sram_init(void)
298{
299 _omap2_sram_ddr_init = omap_sram_push(omap242x_sram_ddr_init,
300 omap242x_sram_ddr_init_sz);
301
302 _omap2_sram_reprogram_sdrc = omap_sram_push(omap242x_sram_reprogram_sdrc,
303 omap242x_sram_reprogram_sdrc_sz);
304
305 _omap2_set_prcm = omap_sram_push(omap242x_sram_set_prcm,
306 omap242x_sram_set_prcm_sz);
307
308 return 0;
309}
310#else
311static inline int omap242x_sram_init(void)
312{
313 return 0;
314}
315#endif
316
317#ifdef CONFIG_SOC_OMAP2430
318static int __init omap243x_sram_init(void)
319{
320 _omap2_sram_ddr_init = omap_sram_push(omap243x_sram_ddr_init,
321 omap243x_sram_ddr_init_sz);
322
323 _omap2_sram_reprogram_sdrc = omap_sram_push(omap243x_sram_reprogram_sdrc,
324 omap243x_sram_reprogram_sdrc_sz);
325
326 _omap2_set_prcm = omap_sram_push(omap243x_sram_set_prcm,
327 omap243x_sram_set_prcm_sz);
328
329 return 0;
330}
331#else
332static inline int omap243x_sram_init(void)
333{
334 return 0;
335}
336#endif
337
338#ifdef CONFIG_ARCH_OMAP3
339
340static u32 (*_omap3_sram_configure_core_dpll)(
341 u32 m2, u32 unlock_dll, u32 f, u32 inc,
342 u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
343 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
344 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
345 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1);
346
347u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc,
348 u32 sdrc_rfr_ctrl_0, u32 sdrc_actim_ctrl_a_0,
349 u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0,
350 u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1,
351 u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1)
352{
353 BUG_ON(!_omap3_sram_configure_core_dpll);
354 return _omap3_sram_configure_core_dpll(
355 m2, unlock_dll, f, inc,
356 sdrc_rfr_ctrl_0, sdrc_actim_ctrl_a_0,
357 sdrc_actim_ctrl_b_0, sdrc_mr_0,
358 sdrc_rfr_ctrl_1, sdrc_actim_ctrl_a_1,
359 sdrc_actim_ctrl_b_1, sdrc_mr_1);
360}
361
362void omap3_sram_restore_context(void)
363{ 66{
364 omap_sram_ceil = omap_sram_base + omap_sram_size; 67 omap_sram_ceil = omap_sram_base + omap_sram_size;
365
366 _omap3_sram_configure_core_dpll =
367 omap_sram_push(omap3_sram_configure_core_dpll,
368 omap3_sram_configure_core_dpll_sz);
369 omap_push_sram_idle();
370} 68}
371 69
372static inline int omap34xx_sram_init(void) 70/*
373{ 71 * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early.
374 omap3_sram_restore_context(); 72 */
375 return 0; 73void __init omap_map_sram(unsigned long start, unsigned long size,
376} 74 unsigned long skip, int cached)
377#else
378static inline int omap34xx_sram_init(void)
379{
380 return 0;
381}
382#endif /* CONFIG_ARCH_OMAP3 */
383
384static inline int am33xx_sram_init(void)
385{ 75{
386 return 0; 76 if (size == 0)
387} 77 return;
388 78
389int __init omap_sram_init(void) 79 start = ROUND_DOWN(start, PAGE_SIZE);
390{ 80 omap_sram_size = size;
391 omap_detect_sram(); 81 omap_sram_skip = skip;
392 omap_map_sram(); 82 omap_sram_base = __arm_ioremap_exec(start, size, cached);
83 if (!omap_sram_base) {
84 pr_err("SRAM: Could not map\n");
85 return;
86 }
393 87
394 if (!(cpu_class_is_omap2())) 88 omap_sram_reset();
395 omap1_sram_init();
396 else if (cpu_is_omap242x())
397 omap242x_sram_init();
398 else if (cpu_is_omap2430())
399 omap243x_sram_init();
400 else if (soc_is_am33xx())
401 am33xx_sram_init();
402 else if (cpu_is_omap34xx())
403 omap34xx_sram_init();
404 89
405 return 0; 90 /*
91 * Looks like we need to preserve some bootloader code at the
92 * beginning of SRAM for jumping to flash for reboot to work...
93 */
94 memset_io(omap_sram_base + omap_sram_skip, 0,
95 omap_sram_size - omap_sram_skip);
406} 96}
diff --git a/arch/arm/plat-omap/sram.h b/arch/arm/plat-omap/sram.h
deleted file mode 100644
index 29b43ef97f20..000000000000
--- a/arch/arm/plat-omap/sram.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __PLAT_OMAP_SRAM_H__
2#define __PLAT_OMAP_SRAM_H__
3
4extern int __init omap_sram_init(void);
5
6#endif /* __PLAT_OMAP_SRAM_H__ */
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 03f654d55eff..52dfa8f914c7 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -933,6 +933,7 @@ struct platform_device s5p_device_mfc_r = {
933 .coherent_dma_mask = DMA_BIT_MASK(32), 933 .coherent_dma_mask = DMA_BIT_MASK(32),
934 }, 934 },
935}; 935};
936
936#endif /* CONFIG_S5P_DEV_MFC */ 937#endif /* CONFIG_S5P_DEV_MFC */
937 938
938/* MIPI CSIS */ 939/* MIPI CSIS */
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 5da4b4f38f40..133e3e4170fb 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -133,8 +133,6 @@ extern struct platform_device exynos4_device_pcm1;
133extern struct platform_device exynos4_device_pcm2; 133extern struct platform_device exynos4_device_pcm2;
134extern struct platform_device exynos4_device_spdif; 134extern struct platform_device exynos4_device_spdif;
135 135
136extern struct platform_device exynos_device_drm;
137
138extern struct platform_device samsung_asoc_dma; 136extern struct platform_device samsung_asoc_dma;
139extern struct platform_device samsung_asoc_idma; 137extern struct platform_device samsung_asoc_idma;
140extern struct platform_device samsung_device_keypad; 138extern struct platform_device samsung_device_keypad;
diff --git a/arch/arm/plat-samsung/include/plat/mfc.h b/arch/arm/plat-samsung/include/plat/mfc.h
index ac13227272f0..e6d7c42d68b6 100644
--- a/arch/arm/plat-samsung/include/plat/mfc.h
+++ b/arch/arm/plat-samsung/include/plat/mfc.h
@@ -10,6 +10,14 @@
10#ifndef __PLAT_SAMSUNG_MFC_H 10#ifndef __PLAT_SAMSUNG_MFC_H
11#define __PLAT_SAMSUNG_MFC_H __FILE__ 11#define __PLAT_SAMSUNG_MFC_H __FILE__
12 12
13struct s5p_mfc_dt_meminfo {
14 unsigned long loff;
15 unsigned long lsize;
16 unsigned long roff;
17 unsigned long rsize;
18 char *compatible;
19};
20
13/** 21/**
14 * s5p_mfc_reserve_mem - function to early reserve memory for MFC driver 22 * s5p_mfc_reserve_mem - function to early reserve memory for MFC driver
15 * @rbase: base address for MFC 'right' memory interface 23 * @rbase: base address for MFC 'right' memory interface
@@ -24,4 +32,7 @@
24void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize, 32void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
25 phys_addr_t lbase, unsigned int lsize); 33 phys_addr_t lbase, unsigned int lsize);
26 34
35int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname,
36 int depth, void *data);
37
27#endif /* __PLAT_SAMSUNG_MFC_H */ 38#endif /* __PLAT_SAMSUNG_MFC_H */
diff --git a/arch/arm/plat-samsung/s5p-dev-mfc.c b/arch/arm/plat-samsung/s5p-dev-mfc.c
index ad6089465e2a..5ec104b5408b 100644
--- a/arch/arm/plat-samsung/s5p-dev-mfc.c
+++ b/arch/arm/plat-samsung/s5p-dev-mfc.c
@@ -14,6 +14,8 @@
14#include <linux/dma-mapping.h> 14#include <linux/dma-mapping.h>
15#include <linux/memblock.h> 15#include <linux/memblock.h>
16#include <linux/ioport.h> 16#include <linux/ioport.h>
17#include <linux/of_fdt.h>
18#include <linux/of.h>
17 19
18#include <mach/map.h> 20#include <mach/map.h>
19#include <plat/devs.h> 21#include <plat/devs.h>
@@ -69,3 +71,35 @@ static int __init s5p_mfc_memory_init(void)
69 return 0; 71 return 0;
70} 72}
71device_initcall(s5p_mfc_memory_init); 73device_initcall(s5p_mfc_memory_init);
74
75#ifdef CONFIG_OF
76int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname,
77 int depth, void *data)
78{
79 __be32 *prop;
80 unsigned long len;
81 struct s5p_mfc_dt_meminfo *mfc_mem = data;
82
83 if (!data)
84 return 0;
85
86 if (!of_flat_dt_is_compatible(node, mfc_mem->compatible))
87 return 0;
88
89 prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len);
90 if (!prop || (len != 2 * sizeof(unsigned long)))
91 return 0;
92
93 mfc_mem->loff = be32_to_cpu(prop[0]);
94 mfc_mem->lsize = be32_to_cpu(prop[1]);
95
96 prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len);
97 if (!prop || (len != 2 * sizeof(unsigned long)))
98 return 0;
99
100 mfc_mem->roff = be32_to_cpu(prop[0]);
101 mfc_mem->rsize = be32_to_cpu(prop[1]);
102
103 return 1;
104}
105#endif