aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/arm/sunxi/clocks.txt56
-rw-r--r--Documentation/clk.txt4
-rw-r--r--Documentation/devicetree/bindings/arm/omap/l3-noc.txt1
-rw-r--r--Documentation/devicetree/bindings/arm/omap/timer.txt17
-rw-r--r--Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt67
-rw-r--r--Documentation/devicetree/bindings/clock/axi-clkgen.txt22
-rw-r--r--Documentation/devicetree/bindings/clock/nvidia,tegra114-car.txt303
-rw-r--r--Documentation/devicetree/bindings/clock/nvidia,tegra20-car.txt4
-rw-r--r--Documentation/devicetree/bindings/clock/sunxi.txt44
-rw-r--r--Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt49
-rw-r--r--Documentation/devicetree/bindings/fb/mxsfb.txt36
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-omap.txt8
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-mxs.txt12
-rw-r--r--Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt60
-rw-r--r--Documentation/devicetree/bindings/mmc/davinci_mmc.txt33
-rw-r--r--Documentation/devicetree/bindings/mmc/mxs-mmc.txt12
-rw-r--r--Documentation/devicetree/bindings/mtd/gpmi-nand.txt17
-rw-r--r--Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt4
-rw-r--r--Documentation/devicetree/bindings/sound/nvidia,tegra-audio-alc5632.txt8
-rw-r--r--Documentation/devicetree/bindings/sound/nvidia,tegra-audio-trimslice.txt7
-rw-r--r--Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8753.txt8
-rw-r--r--Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt8
-rw-r--r--Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm9712.txt8
-rw-r--r--Documentation/devicetree/bindings/spi/mxs-spi.txt12
-rw-r--r--Documentation/devicetree/bindings/spi/spi-davinci.txt51
-rw-r--r--Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt16
-rw-r--r--Documentation/devicetree/bindings/usb/omap-usb.txt1
-rw-r--r--arch/arm/Kconfig8
-rw-r--r--arch/arm/boot/dts/Makefile4
-rw-r--r--arch/arm/boot/dts/am335x-bone.dts10
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts18
-rw-r--r--arch/arm/boot/dts/am335x-evmsk.dts18
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi40
-rw-r--r--arch/arm/boot/dts/am3517-evm.dts2
-rw-r--r--arch/arm/boot/dts/am3517_mt_ventoux.dts2
-rw-r--r--arch/arm/boot/dts/armada-370-db.dts123
-rw-r--r--arch/arm/boot/dts/armada-370-mirabox.dts142
-rw-r--r--arch/arm/boot/dts/armada-370-rd.dts85
-rw-r--r--arch/arm/boot/dts/armada-370-xp.dtsi296
-rw-r--r--arch/arm/boot/dts/armada-370.dtsi282
-rw-r--r--arch/arm/boot/dts/armada-xp-db.dts187
-rw-r--r--arch/arm/boot/dts/armada-xp-gp.dts184
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78230.dtsi194
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78260.dtsi238
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78460.dtsi332
-rw-r--r--arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts232
-rw-r--r--arch/arm/boot/dts/armada-xp.dtsi196
-rw-r--r--arch/arm/boot/dts/da850-evm.dts110
-rw-r--r--arch/arm/boot/dts/da850.dtsi109
-rw-r--r--arch/arm/boot/dts/dove.dtsi5
-rw-r--r--arch/arm/boot/dts/exynos4412.dtsi8
-rw-r--r--arch/arm/boot/dts/imx23-evk.dts36
-rw-r--r--arch/arm/boot/dts/imx23-olinuxino.dts1
-rw-r--r--arch/arm/boot/dts/imx23.dtsi47
-rw-r--r--arch/arm/boot/dts/imx28-apf28dev.dts25
-rw-r--r--arch/arm/boot/dts/imx28-apx4devkit.dts25
-rw-r--r--arch/arm/boot/dts/imx28-cfa10049.dts50
-rw-r--r--arch/arm/boot/dts/imx28-evk.dts36
-rw-r--r--arch/arm/boot/dts/imx28-m28evk.dts27
-rw-r--r--arch/arm/boot/dts/imx28.dtsi67
-rw-r--r--arch/arm/boot/dts/imx6qdl.dtsi8
-rw-r--r--arch/arm/boot/dts/kirkwood-6282.dtsi6
-rw-r--r--arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts4
-rw-r--r--arch/arm/boot/dts/omap2.dtsi39
-rw-r--r--arch/arm/boot/dts/omap2420-h4.dts46
-rw-r--r--arch/arm/boot/dts/omap2420.dtsi67
-rw-r--r--arch/arm/boot/dts/omap2430.dtsi87
-rw-r--r--arch/arm/boot/dts/omap3-beagle-xm.dts26
-rw-r--r--arch/arm/boot/dts/omap3-beagle.dts79
-rw-r--r--arch/arm/boot/dts/omap3-devkit8000.dts169
-rw-r--r--arch/arm/boot/dts/omap3-evm.dts14
-rw-r--r--arch/arm/boot/dts/omap3-igep.dtsi122
-rw-r--r--arch/arm/boot/dts/omap3-igep0020.dts56
-rw-r--r--arch/arm/boot/dts/omap3-igep0030.dts44
-rw-r--r--arch/arm/boot/dts/omap3-overo.dtsi31
-rw-r--r--arch/arm/boot/dts/omap3.dtsi173
-rw-r--r--arch/arm/boot/dts/omap3430-sdp.dts190
-rw-r--r--arch/arm/boot/dts/omap34xx.dtsi28
-rw-r--r--arch/arm/boot/dts/omap36xx.dtsi13
-rw-r--r--arch/arm/boot/dts/omap4-panda-a4.dts5
-rw-r--r--arch/arm/boot/dts/omap4-panda-common.dtsi251
-rw-r--r--arch/arm/boot/dts/omap4-panda-es.dts5
-rw-r--r--arch/arm/boot/dts/omap4-panda.dts201
-rw-r--r--arch/arm/boot/dts/omap4-sdp.dts74
-rw-r--r--arch/arm/boot/dts/omap4-var-som.dts2
-rw-r--r--arch/arm/boot/dts/omap4.dtsi165
-rw-r--r--arch/arm/boot/dts/omap443x.dtsi27
-rw-r--r--arch/arm/boot/dts/omap4460.dtsi32
-rw-r--r--arch/arm/boot/dts/omap5-evm.dts110
-rw-r--r--arch/arm/boot/dts/omap5.dtsi245
-rw-r--r--arch/arm/boot/dts/orion5x.dtsi33
-rw-r--r--arch/arm/boot/dts/skeleton64.dtsi13
-rw-r--r--arch/arm/boot/dts/tegra114-dalmore.dts905
-rw-r--r--arch/arm/boot/dts/tegra114-pluto.dts14
-rw-r--r--arch/arm/boot/dts/tegra114.dtsi252
-rw-r--r--arch/arm/boot/dts/tegra20-colibri-512.dtsi27
-rw-r--r--arch/arm/boot/dts/tegra20-harmony.dts37
-rw-r--r--arch/arm/boot/dts/tegra20-medcom-wide.dts7
-rw-r--r--arch/arm/boot/dts/tegra20-paz00.dts25
-rw-r--r--arch/arm/boot/dts/tegra20-plutux.dts3
-rw-r--r--arch/arm/boot/dts/tegra20-seaboard.dts26
-rw-r--r--arch/arm/boot/dts/tegra20-tamonten.dtsi21
-rw-r--r--arch/arm/boot/dts/tegra20-tec.dts3
-rw-r--r--arch/arm/boot/dts/tegra20-trimslice.dts38
-rw-r--r--arch/arm/boot/dts/tegra20-ventana.dts37
-rw-r--r--arch/arm/boot/dts/tegra20-whistler.dts27
-rw-r--r--arch/arm/boot/dts/tegra20.dtsi57
-rw-r--r--arch/arm/boot/dts/tegra30-beaver.dts23
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu-a02.dts1
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu-a04.dts1
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu.dtsi26
-rw-r--r--arch/arm/boot/dts/tegra30.dtsi7
-rw-r--r--arch/arm/boot/dts/tps6507x.dtsi47
-rw-r--r--arch/arm/boot/dts/twl4030.dtsi18
-rw-r--r--arch/arm/boot/dts/twl6030.dtsi12
-rw-r--r--arch/arm/configs/dove_defconfig2
-rw-r--r--arch/arm/configs/kirkwood_defconfig2
-rw-r--r--arch/arm/configs/mvebu_defconfig9
-rw-r--r--arch/arm/include/asm/smp_twd.h8
-rw-r--r--arch/arm/include/debug/mvebu.S2
-rw-r--r--arch/arm/kernel/smp_twd.c17
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c2
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c1
-rw-r--r--arch/arm/mach-davinci/board-omapl138-hawk.c1
-rw-r--r--arch/arm/mach-davinci/board-tnetv107x-evm.c1
-rw-r--r--arch/arm/mach-davinci/clock.c21
-rw-r--r--arch/arm/mach-davinci/clock.h2
-rw-r--r--arch/arm/mach-davinci/da830.c2
-rw-r--r--arch/arm/mach-davinci/da850.c50
-rw-r--r--arch/arm/mach-davinci/da8xx-dt.c7
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c4
-rw-r--r--arch/arm/mach-davinci/devices-tnetv107x.c4
-rw-r--r--arch/arm/mach-davinci/devices.c6
-rw-r--r--arch/arm/mach-davinci/dm355.c4
-rw-r--r--arch/arm/mach-davinci/dm365.c4
-rw-r--r--arch/arm/mach-davinci/dm644x.c2
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-davinci/tnetv107x.c4
-rw-r--r--arch/arm/mach-dove/Makefile2
-rw-r--r--arch/arm/mach-dove/addr-map.c125
-rw-r--r--arch/arm/mach-dove/board-dt.c2
-rw-r--r--arch/arm/mach-dove/common.c39
-rw-r--r--arch/arm/mach-dove/common.h2
-rw-r--r--arch/arm/mach-dove/include/mach/dove.h5
-rw-r--r--arch/arm/mach-highbank/highbank.c5
-rw-r--r--arch/arm/mach-imx/clk-busy.c2
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c5
-rw-r--r--arch/arm/mach-kirkwood/Makefile2
-rw-r--r--arch/arm/mach-kirkwood/addr-map.c91
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c2
-rw-r--r--arch/arm/mach-kirkwood/board-guruplug.c6
-rw-r--r--arch/arm/mach-kirkwood/common.c38
-rw-r--r--arch/arm/mach-kirkwood/common.h2
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h7
-rw-r--r--arch/arm/mach-kirkwood/pcie.c1
-rw-r--r--arch/arm/mach-mv78xx0/Makefile2
-rw-r--r--arch/arm/mach-mv78xx0/addr-map.c93
-rw-r--r--arch/arm/mach-mv78xx0/common.c10
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/mv78xx0.h9
-rw-r--r--arch/arm/mach-mv78xx0/pcie.c21
-rw-r--r--arch/arm/mach-mvebu/Kconfig2
-rw-r--r--arch/arm/mach-mvebu/Makefile2
-rw-r--r--arch/arm/mach-mvebu/addr-map.c137
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.c18
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.h8
-rw-r--r--arch/arm/mach-mvebu/platsmp.c2
-rw-r--r--arch/arm/mach-mxs/Makefile4
-rw-r--r--arch/arm/mach-mxs/include/mach/common.h29
-rw-r--r--arch/arm/mach-mxs/include/mach/debug-macro.S9
-rw-r--r--arch/arm/mach-mxs/include/mach/digctl.h22
-rw-r--r--arch/arm/mach-mxs/include/mach/hardware.h23
-rw-r--r--arch/arm/mach-mxs/include/mach/mx23.h169
-rw-r--r--arch/arm/mach-mxs/include/mach/mx28.h225
-rw-r--r--arch/arm/mach-mxs/include/mach/mxs.h117
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c343
-rw-r--r--arch/arm/mach-mxs/mm.c52
-rw-r--r--arch/arm/mach-mxs/ocotp.c93
-rw-r--r--arch/arm/mach-mxs/system.c139
-rw-r--r--arch/arm/mach-omap1/Kconfig6
-rw-r--r--arch/arm/mach-omap2/Kconfig2
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c2
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c21
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c21
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c24
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c17
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c20
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c20
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c8
-rw-r--r--arch/arm/mach-omap2/board-generic.c1
-rw-r--r--arch/arm/mach-omap2/board-h4.c2
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c32
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c32
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c25
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c21
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c17
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c17
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c55
-rw-r--r--arch/arm/mach-omap2/board-overo.c16
-rw-r--r--arch/arm/mach-omap2/board-zoom.c16
-rw-r--r--arch/arm/mach-omap2/cclock33xx_data.c8
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c30
-rw-r--r--arch/arm/mach-omap2/dsp.c4
-rw-r--r--arch/arm/mach-omap2/id.c12
-rw-r--r--arch/arm/mach-omap2/io.c9
-rw-r--r--arch/arm/mach-omap2/omap4-common.c10
-rw-r--r--arch/arm/mach-omap2/omap4-sar-layout.h14
-rw-r--r--arch/arm/mach-omap2/omap54xx.h1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c52
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c15
-rw-r--r--arch/arm/mach-omap2/pmu.c14
-rw-r--r--arch/arm/mach-omap2/powerdomain.c18
-rw-r--r--arch/arm/mach-omap2/prm44xx.c6
-rw-r--r--arch/arm/mach-omap2/soc.h2
-rw-r--r--arch/arm/mach-omap2/timer.c14
-rw-r--r--arch/arm/mach-omap2/usb-host.c160
-rw-r--r--arch/arm/mach-omap2/usb.h9
-rw-r--r--arch/arm/mach-orion5x/Makefile2
-rw-r--r--arch/arm/mach-orion5x/addr-map.c155
-rw-r--r--arch/arm/mach-orion5x/board-dt.c2
-rw-r--r--arch/arm/mach-orion5x/common.c49
-rw-r--r--arch/arm/mach-orion5x/common.h13
-rw-r--r--arch/arm/mach-orion5x/d2net-setup.c4
-rw-r--r--arch/arm/mach-orion5x/db88f5281-setup.c13
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c3
-rw-r--r--arch/arm/mach-orion5x/edmini_v2-setup.c4
-rw-r--r--arch/arm/mach-orion5x/include/mach/orion5x.h6
-rw-r--r--arch/arm/mach-orion5x/kurobox_pro-setup.c8
-rw-r--r--arch/arm/mach-orion5x/ls-chl-setup.c4
-rw-r--r--arch/arm/mach-orion5x/ls_hgl-setup.c4
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c4
-rw-r--r--arch/arm/mach-orion5x/mss2-setup.c3
-rw-r--r--arch/arm/mach-orion5x/mv2120-setup.c3
-rw-r--r--arch/arm/mach-orion5x/net2big-setup.c4
-rw-r--r--arch/arm/mach-orion5x/pci.c14
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c4
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-ge-setup.c4
-rw-r--r--arch/arm/mach-orion5x/rd88f5182-setup.c7
-rw-r--r--arch/arm/mach-orion5x/terastation_pro2-setup.c4
-rw-r--r--arch/arm/mach-orion5x/ts209-setup.c4
-rw-r--r--arch/arm/mach-orion5x/ts409-setup.c4
-rw-r--r--arch/arm/mach-orion5x/wnr854t-setup.c4
-rw-r--r--arch/arm/mach-orion5x/wrt350n-v2-setup.c4
-rw-r--r--arch/arm/mach-spear13xx/spear13xx.c4
-rw-r--r--arch/arm/mach-tegra/Makefile5
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra114.c46
-rw-r--r--arch/arm/mach-tegra/board-dt-tegra30.c60
-rw-r--r--arch/arm/mach-tegra/board-harmony-pcie.c7
-rw-r--r--arch/arm/mach-tegra/board.h4
-rw-r--r--arch/arm/mach-tegra/common.c31
-rw-r--r--arch/arm/mach-tegra/cpuidle-tegra20.c6
-rw-r--r--arch/arm/mach-tegra/cpuidle-tegra30.c10
-rw-r--r--arch/arm/mach-tegra/fuse.c4
-rw-r--r--arch/arm/mach-tegra/fuse.h7
-rw-r--r--arch/arm/mach-tegra/headsmp.S3
-rw-r--r--arch/arm/mach-tegra/hotplug.c23
-rw-r--r--arch/arm/mach-tegra/irq.c96
-rw-r--r--arch/arm/mach-tegra/irq.h6
-rw-r--r--arch/arm/mach-tegra/platsmp.c119
-rw-r--r--arch/arm/mach-tegra/pm.c151
-rw-r--r--arch/arm/mach-tegra/pm.h17
-rw-r--r--arch/arm/mach-tegra/pmc.c310
-rw-r--r--arch/arm/mach-tegra/pmc.h18
-rw-r--r--arch/arm/mach-tegra/reset-handler.S48
-rw-r--r--arch/arm/mach-tegra/sleep.h10
-rw-r--r--arch/arm/mach-tegra/tegra.c (renamed from arch/arm/mach-tegra/board-dt-tegra20.c)48
-rw-r--r--arch/arm/mach-tegra/tegra114_speedo.c104
-rw-r--r--arch/arm/mach-ux500/timer.c3
-rw-r--r--arch/arm/mach-vexpress/v2m.c6
-rw-r--r--arch/arm/plat-omap/dmtimer.c241
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h1
-rw-r--r--arch/arm/plat-orion/Makefile2
-rw-r--r--arch/arm/plat-orion/addr-map.c178
-rw-r--r--arch/arm/plat-orion/gpio.c59
-rw-r--r--arch/arm/plat-orion/pcie.c10
-rw-r--r--drivers/bus/Kconfig7
-rw-r--r--drivers/bus/Makefile1
-rw-r--r--drivers/bus/mvebu-mbus.c870
-rw-r--r--drivers/clk/Kconfig8
-rw-r--r--drivers/clk/Makefile3
-rw-r--r--drivers/clk/clk-axi-clkgen.c331
-rw-r--r--drivers/clk/clk-composite.c201
-rw-r--r--drivers/clk/clk-mux.c50
-rw-r--r--drivers/clk/clk-prima2.c2
-rw-r--r--drivers/clk/clk-zynq.c1
-rw-r--r--drivers/clk/clk.c193
-rw-r--r--drivers/clk/mxs/clk-imx23.c42
-rw-r--r--drivers/clk/mxs/clk-imx28.c42
-rw-r--r--drivers/clk/mxs/clk.c1
-rw-r--r--drivers/clk/spear/spear1340_clock.c18
-rw-r--r--drivers/clk/sunxi/Makefile5
-rw-r--r--drivers/clk/sunxi/clk-factors.c180
-rw-r--r--drivers/clk/sunxi/clk-factors.h27
-rw-r--r--drivers/clk/sunxi/clk-sunxi.c362
-rw-r--r--drivers/clk/tegra/Makefile1
-rw-r--r--drivers/clk/tegra/clk-periph-gate.c11
-rw-r--r--drivers/clk/tegra/clk-periph.c14
-rw-r--r--drivers/clk/tegra/clk-pll.c1144
-rw-r--r--drivers/clk/tegra/clk-tegra114.c2085
-rw-r--r--drivers/clk/tegra/clk-tegra20.c220
-rw-r--r--drivers/clk/tegra/clk-tegra30.c276
-rw-r--r--drivers/clk/tegra/clk.c14
-rw-r--r--drivers/clk/tegra/clk.h121
-rw-r--r--drivers/clk/ux500/clk-prcmu.c136
-rw-r--r--drivers/clocksource/Makefile1
-rw-r--r--drivers/clocksource/bcm2835_timer.c12
-rw-r--r--drivers/clocksource/clksrc-of.c4
-rw-r--r--drivers/clocksource/mxs_timer.c (renamed from arch/arm/mach-mxs/timer.c)36
-rw-r--r--drivers/clocksource/sunxi_timer.c4
-rw-r--r--drivers/clocksource/tegra20_timer.c75
-rw-r--r--drivers/clocksource/vt8500_timer.c14
-rw-r--r--drivers/dma/mxs-dma.c109
-rw-r--r--drivers/gpio/gpio-tegra.c21
-rw-r--r--drivers/i2c/busses/i2c-mxs.c40
-rw-r--r--drivers/irqchip/Makefile1
-rw-r--r--drivers/irqchip/irq-mxs.c (renamed from arch/arm/mach-mxs/icoll.c)24
-rw-r--r--drivers/mmc/host/davinci_mmc.c88
-rw-r--r--drivers/mmc/host/mxs-mmc.c48
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c51
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.h3
-rw-r--r--drivers/net/ethernet/freescale/fec.c18
-rw-r--r--drivers/net/ethernet/freescale/fec.h1
-rw-r--r--drivers/rtc/rtc-stmp3xxx.c6
-rw-r--r--drivers/spi/spi-davinci.c4
-rw-r--r--drivers/spi/spi-mxs.c60
-rw-r--r--drivers/staging/iio/adc/mxs-lradc.c3
-rw-r--r--drivers/tty/serial/mxs-auart.c52
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--drivers/video/mxsfb.c260
-rw-r--r--include/linux/clk-private.h2
-rw-r--r--include/linux/clk-provider.h51
-rw-r--r--include/linux/clk/mxs.h16
-rw-r--r--include/linux/clk/sunxi.h22
-rw-r--r--include/linux/clk/tegra.h1
-rw-r--r--include/linux/clocksource.h1
-rw-r--r--include/linux/irqchip/mxs.h14
-rw-r--r--include/linux/mbus.h27
-rw-r--r--include/linux/mxsfb.h52
-rw-r--r--include/linux/platform_data/mmc-davinci.h3
-rw-r--r--include/linux/spi/mxs-spi.h4
-rw-r--r--include/linux/usb/nop-usb-xceiv.h5
-rw-r--r--sound/soc/mxs/mxs-saif.c5
347 files changed, 15132 insertions, 5113 deletions
diff --git a/Documentation/arm/sunxi/clocks.txt b/Documentation/arm/sunxi/clocks.txt
new file mode 100644
index 000000000000..e09a88aa3136
--- /dev/null
+++ b/Documentation/arm/sunxi/clocks.txt
@@ -0,0 +1,56 @@
1Frequently asked questions about the sunxi clock system
2=======================================================
3
4This document contains useful bits of information that people tend to ask
5about the sunxi clock system, as well as accompanying ASCII art when adequate.
6
7Q: Why is the main 24MHz oscillator gatable? Wouldn't that break the
8 system?
9
10A: The 24MHz oscillator allows gating to save power. Indeed, if gated
11 carelessly the system would stop functioning, but with the right
12 steps, one can gate it and keep the system running. Consider this
13 simplified suspend example:
14
15 While the system is operational, you would see something like
16
17 24MHz 32kHz
18 |
19 PLL1
20 \
21 \_ CPU Mux
22 |
23 [CPU]
24
25 When you are about to suspend, you switch the CPU Mux to the 32kHz
26 oscillator:
27
28 24Mhz 32kHz
29 | |
30 PLL1 |
31 /
32 CPU Mux _/
33 |
34 [CPU]
35
36 Finally you can gate the main oscillator
37
38 32kHz
39 |
40 |
41 /
42 CPU Mux _/
43 |
44 [CPU]
45
46Q: Were can I learn more about the sunxi clocks?
47
48A: The linux-sunxi wiki contains a page documenting the clock registers,
49 you can find it at
50
51 http://linux-sunxi.org/A10/CCM
52
53 The authoritative source for information at this time is the ccmu driver
54 released by Allwinner, you can find it at
55
56 https://github.com/linux-sunxi/linux-sunxi/tree/sunxi-3.0/arch/arm/mach-sun4i/clock/ccmu
diff --git a/Documentation/clk.txt b/Documentation/clk.txt
index 1943fae014fd..4274a546eb57 100644
--- a/Documentation/clk.txt
+++ b/Documentation/clk.txt
@@ -174,9 +174,9 @@ int clk_foo_enable(struct clk_hw *hw)
174}; 174};
175 175
176Below is a matrix detailing which clk_ops are mandatory based upon the 176Below is a matrix detailing which clk_ops are mandatory based upon the
177hardware capbilities of that clock. A cell marked as "y" means 177hardware capabilities of that clock. A cell marked as "y" means
178mandatory, a cell marked as "n" implies that either including that 178mandatory, a cell marked as "n" implies that either including that
179callback is invalid or otherwise uneccesary. Empty cells are either 179callback is invalid or otherwise unnecessary. Empty cells are either
180optional or must be evaluated on a case-by-case basis. 180optional or must be evaluated on a case-by-case basis.
181 181
182 clock hardware characteristics 182 clock hardware characteristics
diff --git a/Documentation/devicetree/bindings/arm/omap/l3-noc.txt b/Documentation/devicetree/bindings/arm/omap/l3-noc.txt
index 6888a5efc860..c0105de55cbd 100644
--- a/Documentation/devicetree/bindings/arm/omap/l3-noc.txt
+++ b/Documentation/devicetree/bindings/arm/omap/l3-noc.txt
@@ -6,6 +6,7 @@ provided by Arteris.
6Required properties: 6Required properties:
7- compatible : Should be "ti,omap3-l3-smx" for OMAP3 family 7- compatible : Should be "ti,omap3-l3-smx" for OMAP3 family
8 Should be "ti,omap4-l3-noc" for OMAP4 family 8 Should be "ti,omap4-l3-noc" for OMAP4 family
9- reg: Contains L3 register address range for each noc domain.
9- ti,hwmods: "l3_main_1", ... One hwmod for each noc domain. 10- ti,hwmods: "l3_main_1", ... One hwmod for each noc domain.
10 11
11Examples: 12Examples:
diff --git a/Documentation/devicetree/bindings/arm/omap/timer.txt b/Documentation/devicetree/bindings/arm/omap/timer.txt
index 8732d4d41f8b..d02e27c764ec 100644
--- a/Documentation/devicetree/bindings/arm/omap/timer.txt
+++ b/Documentation/devicetree/bindings/arm/omap/timer.txt
@@ -1,7 +1,20 @@
1OMAP Timer bindings 1OMAP Timer bindings
2 2
3Required properties: 3Required properties:
4- compatible: Must be "ti,omap2-timer" for OMAP2+ controllers. 4- compatible: Should be set to one of the below. Please note that
5 OMAP44xx devices have timer instances that are 100%
6 register compatible with OMAP3xxx devices as well as
7 newer timers that are not 100% register compatible.
8 So for OMAP44xx devices timer instances may use
9 different compatible strings.
10
11 ti,omap2420-timer (applicable to OMAP24xx devices)
12 ti,omap3430-timer (applicable to OMAP3xxx/44xx devices)
13 ti,omap4430-timer (applicable to OMAP44xx devices)
14 ti,omap5430-timer (applicable to OMAP543x devices)
15 ti,am335x-timer (applicable to AM335x devices)
16 ti,am335x-timer-1ms (applicable to AM335x devices)
17
5- reg: Contains timer register address range (base address and 18- reg: Contains timer register address range (base address and
6 length). 19 length).
7- interrupts: Contains the interrupt information for the timer. The 20- interrupts: Contains the interrupt information for the timer. The
@@ -22,7 +35,7 @@ Optional properties:
22Example: 35Example:
23 36
24timer12: timer@48304000 { 37timer12: timer@48304000 {
25 compatible = "ti,omap2-timer"; 38 compatible = "ti,omap3430-timer";
26 reg = <0x48304000 0x400>; 39 reg = <0x48304000 0x400>;
27 interrupts = <95>; 40 interrupts = <95>;
28 ti,hwmods = "timer12" 41 ti,hwmods = "timer12"
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt
index b5846e21cc2e..1608a54e90e1 100644
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt
+++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt
@@ -1,19 +1,84 @@
1NVIDIA Tegra Power Management Controller (PMC) 1NVIDIA Tegra Power Management Controller (PMC)
2 2
3Properties: 3The PMC block interacts with an external Power Management Unit. The PMC
4mostly controls the entry and exit of the system from different sleep
5modes. It provides power-gating controllers for SoC and CPU power-islands.
6
7Required properties:
4- name : Should be pmc 8- name : Should be pmc
5- compatible : Should contain "nvidia,tegra<chip>-pmc". 9- compatible : Should contain "nvidia,tegra<chip>-pmc".
6- reg : Offset and length of the register set for the device 10- reg : Offset and length of the register set for the device
11- clocks : Must contain an entry for each entry in clock-names.
12- clock-names : Must include the following entries:
13 "pclk" (The Tegra clock of that name),
14 "clk32k_in" (The 32KHz clock input to Tegra).
15
16Optional properties:
7- nvidia,invert-interrupt : If present, inverts the PMU interrupt signal. 17- nvidia,invert-interrupt : If present, inverts the PMU interrupt signal.
8 The PMU is an external Power Management Unit, whose interrupt output 18 The PMU is an external Power Management Unit, whose interrupt output
9 signal is fed into the PMC. This signal is optionally inverted, and then 19 signal is fed into the PMC. This signal is optionally inverted, and then
10 fed into the ARM GIC. The PMC is not involved in the detection or 20 fed into the ARM GIC. The PMC is not involved in the detection or
11 handling of this interrupt signal, merely its inversion. 21 handling of this interrupt signal, merely its inversion.
22- nvidia,suspend-mode : The suspend mode that the platform should use.
23 Valid values are 0, 1 and 2:
24 0 (LP0): CPU + Core voltage off and DRAM in self-refresh
25 1 (LP1): CPU voltage off and DRAM in self-refresh
26 2 (LP2): CPU voltage off
27- nvidia,core-power-req-active-high : Boolean, core power request active-high
28- nvidia,sys-clock-req-active-high : Boolean, system clock request active-high
29- nvidia,combined-power-req : Boolean, combined power request for CPU & Core
30- nvidia,cpu-pwr-good-en : Boolean, CPU power good signal (from PMIC to PMC)
31 is enabled.
32
33Required properties when nvidia,suspend-mode is specified:
34- nvidia,cpu-pwr-good-time : CPU power good time in uS.
35- nvidia,cpu-pwr-off-time : CPU power off time in uS.
36- nvidia,core-pwr-good-time : <Oscillator-stable-time Power-stable-time>
37 Core power good time in uS.
38- nvidia,core-pwr-off-time : Core power off time in uS.
39
40Required properties when nvidia,suspend-mode=<0>:
41- nvidia,lp0-vec : <start length> Starting address and length of LP0 vector
42 The LP0 vector contains the warm boot code that is executed by AVP when
43 resuming from the LP0 state. The AVP (Audio-Video Processor) is an ARM7
44 processor and always being the first boot processor when chip is power on
45 or resume from deep sleep mode. When the system is resumed from the deep
46 sleep mode, the warm boot code will restore some PLLs, clocks and then
47 bring up CPU0 for resuming the system.
12 48
13Example: 49Example:
14 50
51/ SoC dts including file
15pmc@7000f400 { 52pmc@7000f400 {
16 compatible = "nvidia,tegra20-pmc"; 53 compatible = "nvidia,tegra20-pmc";
17 reg = <0x7000e400 0x400>; 54 reg = <0x7000e400 0x400>;
55 clocks = <&tegra_car 110>, <&clk32k_in>;
56 clock-names = "pclk", "clk32k_in";
18 nvidia,invert-interrupt; 57 nvidia,invert-interrupt;
58 nvidia,suspend-mode = <1>;
59 nvidia,cpu-pwr-good-time = <2000>;
60 nvidia,cpu-pwr-off-time = <100>;
61 nvidia,core-pwr-good-time = <3845 3845>;
62 nvidia,core-pwr-off-time = <458>;
63 nvidia,core-power-req-active-high;
64 nvidia,sys-clock-req-active-high;
65 nvidia,lp0-vec = <0xbdffd000 0x2000>;
66};
67
68/ Tegra board dts file
69{
70 ...
71 clocks {
72 compatible = "simple-bus";
73 #address-cells = <1>;
74 #size-cells = <0>;
75
76 clk32k_in: clock {
77 compatible = "fixed-clock";
78 reg=<0>;
79 #clock-cells = <0>;
80 clock-frequency = <32768>;
81 };
82 };
83 ...
19}; 84};
diff --git a/Documentation/devicetree/bindings/clock/axi-clkgen.txt b/Documentation/devicetree/bindings/clock/axi-clkgen.txt
new file mode 100644
index 000000000000..028b493e97ff
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/axi-clkgen.txt
@@ -0,0 +1,22 @@
1Binding for the axi-clkgen clock generator
2
3This binding uses the common clock binding[1].
4
5[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
6
7Required properties:
8- compatible : shall be "adi,axi-clkgen".
9- #clock-cells : from common clock binding; Should always be set to 0.
10- reg : Address and length of the axi-clkgen register set.
11- clocks : Phandle and clock specifier for the parent clock.
12
13Optional properties:
14- clock-output-names : From common clock binding.
15
16Example:
17 clock@0xff000000 {
18 compatible = "adi,axi-clkgen";
19 #clock-cells = <0>;
20 reg = <0xff000000 0x1000>;
21 clocks = <&osc 1>;
22 };
diff --git a/Documentation/devicetree/bindings/clock/nvidia,tegra114-car.txt b/Documentation/devicetree/bindings/clock/nvidia,tegra114-car.txt
new file mode 100644
index 000000000000..d6cb083b90a2
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/nvidia,tegra114-car.txt
@@ -0,0 +1,303 @@
1NVIDIA Tegra114 Clock And Reset Controller
2
3This binding uses the common clock binding:
4Documentation/devicetree/bindings/clock/clock-bindings.txt
5
6The CAR (Clock And Reset) Controller on Tegra is the HW module responsible
7for muxing and gating Tegra's clocks, and setting their rates.
8
9Required properties :
10- compatible : Should be "nvidia,tegra114-car"
11- reg : Should contain CAR registers location and length
12- clocks : Should contain phandle and clock specifiers for two clocks:
13 the 32 KHz "32k_in", and the board-specific oscillator "osc".
14- #clock-cells : Should be 1.
15 In clock consumers, this cell represents the clock ID exposed by the CAR.
16
17 The first 160 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB
18 registers. These IDs often match those in the CAR's RST_DEVICES registers,
19 but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In
20 this case, those clocks are assigned IDs above 160 in order to highlight
21 this issue. Implementations that interpret these clock IDs as bit values
22 within the CLK_OUT_ENB or RST_DEVICES registers should be careful to
23 explicitly handle these special cases.
24
25 The balance of the clocks controlled by the CAR are assigned IDs of 160 and
26 above.
27
28 0 unassigned
29 1 unassigned
30 2 unassigned
31 3 unassigned
32 4 rtc
33 5 timer
34 6 uarta
35 7 unassigned (register bit affects uartb and vfir)
36 8 unassigned
37 9 sdmmc2
38 10 unassigned (register bit affects spdif_in and spdif_out)
39 11 i2s1
40 12 i2c1
41 13 ndflash
42 14 sdmmc1
43 15 sdmmc4
44 16 unassigned
45 17 pwm
46 18 i2s2
47 19 epp
48 20 unassigned (register bit affects vi and vi_sensor)
49 21 2d
50 22 usbd
51 23 isp
52 24 3d
53 25 unassigned
54 26 disp2
55 27 disp1
56 28 host1x
57 29 vcp
58 30 i2s0
59 31 unassigned
60
61 32 unassigned
62 33 unassigned
63 34 apbdma
64 35 unassigned
65 36 kbc
66 37 unassigned
67 38 unassigned
68 39 unassigned (register bit affects fuse and fuse_burn)
69 40 kfuse
70 41 sbc1
71 42 nor
72 43 unassigned
73 44 sbc2
74 45 unassigned
75 46 sbc3
76 47 i2c5
77 48 dsia
78 49 unassigned
79 50 mipi
80 51 hdmi
81 52 csi
82 53 unassigned
83 54 i2c2
84 55 uartc
85 56 mipi-cal
86 57 emc
87 58 usb2
88 59 usb3
89 60 msenc
90 61 vde
91 62 bsea
92 63 bsev
93
94 64 unassigned
95 65 uartd
96 66 unassigned
97 67 i2c3
98 68 sbc4
99 69 sdmmc3
100 70 unassigned
101 71 owr
102 72 afi
103 73 csite
104 74 unassigned
105 75 unassigned
106 76 la
107 77 trace
108 78 soc_therm
109 79 dtv
110 80 ndspeed
111 81 i2cslow
112 82 dsib
113 83 tsec
114 84 unassigned
115 85 unassigned
116 86 unassigned
117 87 unassigned
118 88 unassigned
119 89 xusb_host
120 90 unassigned
121 91 msenc
122 92 csus
123 93 unassigned
124 94 unassigned
125 95 unassigned (bit affects xusb_dev and xusb_dev_src)
126
127 96 unassigned
128 97 unassigned
129 98 unassigned
130 99 mselect
131 100 tsensor
132 101 i2s3
133 102 i2s4
134 103 i2c4
135 104 sbc5
136 105 sbc6
137 106 d_audio
138 107 apbif
139 108 dam0
140 109 dam1
141 110 dam2
142 111 hda2codec_2x
143 112 unassigned
144 113 audio0_2x
145 114 audio1_2x
146 115 audio2_2x
147 116 audio3_2x
148 117 audio4_2x
149 118 spdif_2x
150 119 actmon
151 120 extern1
152 121 extern2
153 122 extern3
154 123 unassigned
155 124 unassigned
156 125 hda
157 126 unassigned
158 127 se
159
160 128 hda2hdmi
161 129 unassigned
162 130 unassigned
163 131 unassigned
164 132 unassigned
165 133 unassigned
166 134 unassigned
167 135 unassigned
168 136 unassigned
169 137 unassigned
170 138 unassigned
171 139 unassigned
172 140 unassigned
173 141 unassigned
174 142 unassigned
175 143 unassigned (bit affects xusb_falcon_src, xusb_fs_src,
176 xusb_host_src and xusb_ss_src)
177 144 cilab
178 145 cilcd
179 146 cile
180 147 dsialp
181 148 dsiblp
182 149 unassigned
183 150 dds
184 151 unassigned
185 152 dp2
186 153 amx
187 154 adx
188 155 unassigned (bit affects dfll_ref and dfll_soc)
189 156 xusb_ss
190
191 192 uartb
192 193 vfir
193 194 spdif_in
194 195 spdif_out
195 196 vi
196 197 vi_sensor
197 198 fuse
198 199 fuse_burn
199 200 clk_32k
200 201 clk_m
201 202 clk_m_div2
202 203 clk_m_div4
203 204 pll_ref
204 205 pll_c
205 206 pll_c_out1
206 207 pll_c2
207 208 pll_c3
208 209 pll_m
209 210 pll_m_out1
210 211 pll_p
211 212 pll_p_out1
212 213 pll_p_out2
213 214 pll_p_out3
214 215 pll_p_out4
215 216 pll_a
216 217 pll_a_out0
217 218 pll_d
218 219 pll_d_out0
219 220 pll_d2
220 221 pll_d2_out0
221 222 pll_u
222 223 pll_u_480M
223 224 pll_u_60M
224 225 pll_u_48M
225 226 pll_u_12M
226 227 pll_x
227 228 pll_x_out0
228 229 pll_re_vco
229 230 pll_re_out
230 231 pll_e_out0
231 232 spdif_in_sync
232 233 i2s0_sync
233 234 i2s1_sync
234 235 i2s2_sync
235 236 i2s3_sync
236 237 i2s4_sync
237 238 vimclk_sync
238 239 audio0
239 240 audio1
240 241 audio2
241 242 audio3
242 243 audio4
243 244 spdif
244 245 clk_out_1
245 246 clk_out_2
246 247 clk_out_3
247 248 blink
248 252 xusb_host_src
249 253 xusb_falcon_src
250 254 xusb_fs_src
251 255 xusb_ss_src
252 256 xusb_dev_src
253 257 xusb_dev
254 258 xusb_hs_src
255 259 sclk
256 260 hclk
257 261 pclk
258 262 cclk_g
259 263 cclk_lp
260 264 dfll_ref
261 265 dfll_soc
262
263Example SoC include file:
264
265/ {
266 tegra_car: clock {
267 compatible = "nvidia,tegra114-car";
268 reg = <0x60006000 0x1000>;
269 #clock-cells = <1>;
270 };
271
272 usb@c5004000 {
273 clocks = <&tegra_car 58>; /* usb2 */
274 };
275};
276
277Example board file:
278
279/ {
280 clocks {
281 compatible = "simple-bus";
282 #address-cells = <1>;
283 #size-cells = <0>;
284
285 osc: clock@0 {
286 compatible = "fixed-clock";
287 reg = <0>;
288 #clock-cells = <0>;
289 clock-frequency = <12000000>;
290 };
291
292 clk_32k: clock@1 {
293 compatible = "fixed-clock";
294 reg = <1>;
295 #clock-cells = <0>;
296 clock-frequency = <32768>;
297 };
298 };
299
300 &tegra_car {
301 clocks = <&clk_32k> <&osc>;
302 };
303};
diff --git a/Documentation/devicetree/bindings/clock/nvidia,tegra20-car.txt b/Documentation/devicetree/bindings/clock/nvidia,tegra20-car.txt
index 0921fac73528..e885680f6b45 100644
--- a/Documentation/devicetree/bindings/clock/nvidia,tegra20-car.txt
+++ b/Documentation/devicetree/bindings/clock/nvidia,tegra20-car.txt
@@ -120,8 +120,8 @@ Required properties :
120 90 clk_d 120 90 clk_d
121 91 unassigned 121 91 unassigned
122 92 sus 122 92 sus
123 93 cdev1 123 93 cdev2
124 94 cdev2 124 94 cdev1
125 95 unassigned 125 95 unassigned
126 126
127 96 uart2 127 96 uart2
diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt
new file mode 100644
index 000000000000..20b8479c2760
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/sunxi.txt
@@ -0,0 +1,44 @@
1Device Tree Clock bindings for arch-sunxi
2
3This binding uses the common clock binding[1].
4
5[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
6
7Required properties:
8- compatible : shall be one of the following:
9 "allwinner,sun4i-osc-clk" - for a gatable oscillator
10 "allwinner,sun4i-pll1-clk" - for the main PLL clock
11 "allwinner,sun4i-cpu-clk" - for the CPU multiplexer clock
12 "allwinner,sun4i-axi-clk" - for the AXI clock
13 "allwinner,sun4i-ahb-clk" - for the AHB clock
14 "allwinner,sun4i-apb0-clk" - for the APB0 clock
15 "allwinner,sun4i-apb1-clk" - for the APB1 clock
16 "allwinner,sun4i-apb1-mux-clk" - for the APB1 clock muxing
17
18Required properties for all clocks:
19- reg : shall be the control register address for the clock.
20- clocks : shall be the input parent clock(s) phandle for the clock
21- #clock-cells : from common clock binding; shall be set to 0.
22
23For example:
24
25osc24M: osc24M@01c20050 {
26 #clock-cells = <0>;
27 compatible = "allwinner,sun4i-osc-clk";
28 reg = <0x01c20050 0x4>;
29 clocks = <&osc24M_fixed>;
30};
31
32pll1: pll1@01c20000 {
33 #clock-cells = <0>;
34 compatible = "allwinner,sun4i-pll1-clk";
35 reg = <0x01c20000 0x4>;
36 clocks = <&osc24M>;
37};
38
39cpu: cpu@01c20054 {
40 #clock-cells = <0>;
41 compatible = "allwinner,sun4i-cpu-clk";
42 reg = <0x01c20054 0x4>;
43 clocks = <&osc32k>, <&osc24M>, <&pll1>;
44};
diff --git a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
index ded0398d3bdc..a4873e5e3e36 100644
--- a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
+++ b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
@@ -3,17 +3,58 @@
3Required properties: 3Required properties:
4- compatible : Should be "fsl,<chip>-dma-apbh" or "fsl,<chip>-dma-apbx" 4- compatible : Should be "fsl,<chip>-dma-apbh" or "fsl,<chip>-dma-apbx"
5- reg : Should contain registers location and length 5- reg : Should contain registers location and length
6- interrupts : Should contain the interrupt numbers of DMA channels.
7 If a channel is empty/reserved, 0 should be filled in place.
8- #dma-cells : Must be <1>. The number cell specifies the channel ID.
9- dma-channels : Number of channels supported by the DMA controller
10
11Optional properties:
12- interrupt-names : Name of DMA channel interrupts
6 13
7Supported chips: 14Supported chips:
8imx23, imx28. 15imx23, imx28.
9 16
10Examples: 17Examples:
11dma-apbh@80004000 { 18
19dma_apbh: dma-apbh@80004000 {
12 compatible = "fsl,imx28-dma-apbh"; 20 compatible = "fsl,imx28-dma-apbh";
13 reg = <0x80004000 2000>; 21 reg = <0x80004000 0x2000>;
22 interrupts = <82 83 84 85
23 88 88 88 88
24 88 88 88 88
25 87 86 0 0>;
26 interrupt-names = "ssp0", "ssp1", "ssp2", "ssp3",
27 "gpmi0", "gmpi1", "gpmi2", "gmpi3",
28 "gpmi4", "gmpi5", "gpmi6", "gmpi7",
29 "hsadc", "lcdif", "empty", "empty";
30 #dma-cells = <1>;
31 dma-channels = <16>;
14}; 32};
15 33
16dma-apbx@80024000 { 34dma_apbx: dma-apbx@80024000 {
17 compatible = "fsl,imx28-dma-apbx"; 35 compatible = "fsl,imx28-dma-apbx";
18 reg = <0x80024000 2000>; 36 reg = <0x80024000 0x2000>;
37 interrupts = <78 79 66 0
38 80 81 68 69
39 70 71 72 73
40 74 75 76 77>;
41 interrupt-names = "auart4-rx", "aurat4-tx", "spdif-tx", "empty",
42 "saif0", "saif1", "i2c0", "i2c1",
43 "auart0-rx", "auart0-tx", "auart1-rx", "auart1-tx",
44 "auart2-rx", "auart2-tx", "auart3-rx", "auart3-tx";
45 #dma-cells = <1>;
46 dma-channels = <16>;
47};
48
49DMA clients connected to the MXS DMA controller must use the format
50described in the dma.txt file.
51
52Examples:
53
54auart0: serial@8006a000 {
55 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
56 reg = <0x8006a000 0x2000>;
57 interrupts = <112>;
58 dmas = <&dma_apbx 8>, <&dma_apbx 9>;
59 dma-names = "rx", "tx";
19}; 60};
diff --git a/Documentation/devicetree/bindings/fb/mxsfb.txt b/Documentation/devicetree/bindings/fb/mxsfb.txt
index b41e5e52a676..96ec5179c8a0 100644
--- a/Documentation/devicetree/bindings/fb/mxsfb.txt
+++ b/Documentation/devicetree/bindings/fb/mxsfb.txt
@@ -5,9 +5,16 @@ Required properties:
5 imx23 and imx28. 5 imx23 and imx28.
6- reg: Address and length of the register set for lcdif 6- reg: Address and length of the register set for lcdif
7- interrupts: Should contain lcdif interrupts 7- interrupts: Should contain lcdif interrupts
8- display : phandle to display node (see below for details)
8 9
9Optional properties: 10* display node
10- panel-enable-gpios : Should specify the gpio for panel enable 11
12Required properties:
13- bits-per-pixel : <16> for RGB565, <32> for RGB888/666.
14- bus-width : number of data lines. Could be <8>, <16>, <18> or <24>.
15
16Required sub-node:
17- display-timings : Refer to binding doc display-timing.txt for details.
11 18
12Examples: 19Examples:
13 20
@@ -15,5 +22,28 @@ lcdif@80030000 {
15 compatible = "fsl,imx28-lcdif"; 22 compatible = "fsl,imx28-lcdif";
16 reg = <0x80030000 2000>; 23 reg = <0x80030000 2000>;
17 interrupts = <38 86>; 24 interrupts = <38 86>;
18 panel-enable-gpios = <&gpio3 30 0>; 25
26 display: display {
27 bits-per-pixel = <32>;
28 bus-width = <24>;
29
30 display-timings {
31 native-mode = <&timing0>;
32 timing0: timing0 {
33 clock-frequency = <33500000>;
34 hactive = <800>;
35 vactive = <480>;
36 hfront-porch = <164>;
37 hback-porch = <89>;
38 hsync-len = <10>;
39 vback-porch = <23>;
40 vfront-porch = <10>;
41 vsync-len = <10>;
42 hsync-active = <0>;
43 vsync-active = <0>;
44 de-active = <1>;
45 pixelclk-active = <0>;
46 };
47 };
48 };
19}; 49};
diff --git a/Documentation/devicetree/bindings/gpio/gpio-omap.txt b/Documentation/devicetree/bindings/gpio/gpio-omap.txt
index bff51a2fee1e..a56e3a53a360 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-omap.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-omap.txt
@@ -5,12 +5,12 @@ Required properties:
5 - "ti,omap2-gpio" for OMAP2 controllers 5 - "ti,omap2-gpio" for OMAP2 controllers
6 - "ti,omap3-gpio" for OMAP3 controllers 6 - "ti,omap3-gpio" for OMAP3 controllers
7 - "ti,omap4-gpio" for OMAP4 controllers 7 - "ti,omap4-gpio" for OMAP4 controllers
8- gpio-controller : Marks the device node as a GPIO controller.
8- #gpio-cells : Should be two. 9- #gpio-cells : Should be two.
9 - first cell is the pin number 10 - first cell is the pin number
10 - second cell is used to specify optional parameters (unused) 11 - second cell is used to specify optional parameters (unused)
11- gpio-controller : Marks the device node as a GPIO controller. 12- interrupt-controller: Mark the device node as an interrupt controller.
12- #interrupt-cells : Should be 2. 13- #interrupt-cells : Should be 2.
13- interrupt-controller: Mark the device node as an interrupt controller
14 The first cell is the GPIO number. 14 The first cell is the GPIO number.
15 The second cell is used to specify flags: 15 The second cell is used to specify flags:
16 bits[3:0] trigger type and level flags: 16 bits[3:0] trigger type and level flags:
@@ -29,8 +29,8 @@ Example:
29gpio4: gpio4 { 29gpio4: gpio4 {
30 compatible = "ti,omap4-gpio"; 30 compatible = "ti,omap4-gpio";
31 ti,hwmods = "gpio4"; 31 ti,hwmods = "gpio4";
32 #gpio-cells = <2>;
33 gpio-controller; 32 gpio-controller;
34 #interrupt-cells = <2>; 33 #gpio-cells = <2>;
35 interrupt-controller; 34 interrupt-controller;
35 #interrupt-cells = <2>;
36}; 36};
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mxs.txt b/Documentation/devicetree/bindings/i2c/i2c-mxs.txt
index 7a3fe9e5f4cb..4e1c8ac01eba 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mxs.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-mxs.txt
@@ -3,10 +3,13 @@
3Required properties: 3Required properties:
4- compatible: Should be "fsl,<chip>-i2c" 4- compatible: Should be "fsl,<chip>-i2c"
5- reg: Should contain registers location and length 5- reg: Should contain registers location and length
6- interrupts: Should contain ERROR and DMA interrupts 6- interrupts: Should contain ERROR interrupt number
7- clock-frequency: Desired I2C bus clock frequency in Hz. 7- clock-frequency: Desired I2C bus clock frequency in Hz.
8 Only 100000Hz and 400000Hz modes are supported. 8 Only 100000Hz and 400000Hz modes are supported.
9- fsl,i2c-dma-channel: APBX DMA channel for the I2C 9- dmas: DMA specifier, consisting of a phandle to DMA controller node
10 and I2C DMA channel ID.
11 Refer to dma.txt and fsl-mxs-dma.txt for details.
12- dma-names: Must be "rx-tx".
10 13
11Examples: 14Examples:
12 15
@@ -15,7 +18,8 @@ i2c0: i2c@80058000 {
15 #size-cells = <0>; 18 #size-cells = <0>;
16 compatible = "fsl,imx28-i2c"; 19 compatible = "fsl,imx28-i2c";
17 reg = <0x80058000 2000>; 20 reg = <0x80058000 2000>;
18 interrupts = <111 68>; 21 interrupts = <111>;
19 clock-frequency = <100000>; 22 clock-frequency = <100000>;
20 fsl,i2c-dma-channel = <6>; 23 dmas = <&dma_apbx 6>;
24 dma-names = "rx-tx";
21}; 25};
diff --git a/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt
new file mode 100644
index 000000000000..ef77cc7a0e46
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/nvidia,tegra20-i2c.txt
@@ -0,0 +1,60 @@
1NVIDIA Tegra20/Tegra30/Tegra114 I2C controller driver.
2
3Required properties:
4- compatible : should be:
5 "nvidia,tegra114-i2c"
6 "nvidia,tegra30-i2c"
7 "nvidia,tegra20-i2c"
8 "nvidia,tegra20-i2c-dvc"
9 Details of compatible are as follows:
10 nvidia,tegra20-i2c-dvc: Tegra20 has specific I2C controller called as DVC I2C
11 controller. This only support master mode of I2C communication. Register
12 interface/offset and interrupts handling are different than generic I2C
13 controller. Driver of DVC I2C controller is only compatible with
14 "nvidia,tegra20-i2c-dvc".
15 nvidia,tegra20-i2c: Tegra20 has 4 generic I2C controller. This can support
16 master and slave mode of I2C communication. The i2c-tegra driver only
17 support master mode of I2C communication. Driver of I2C controller is
18 only compatible with "nvidia,tegra20-i2c".
19 nvidia,tegra30-i2c: Tegra30 has 5 generic I2C controller. This controller is
20 very much similar to Tegra20 I2C controller with additional feature:
21 Continue Transfer Support. This feature helps to implement M_NO_START
22 as per I2C core API transfer flags. Driver of I2C controller is
23 compatible with "nvidia,tegra30-i2c" to enable the continue transfer
24 support. This is also compatible with "nvidia,tegra20-i2c" without
25 continue transfer support.
26 nvidia,tegra114-i2c: Tegra114 has 5 generic I2C controller. This controller is
27 very much similar to Tegra30 I2C controller with some hardware
28 modification:
29 - Tegra30/Tegra20 I2C controller has 2 clock source called div-clk and
30 fast-clk. Tegra114 has only one clock source called as div-clk and
31 hence clock mechanism is changed in I2C controller.
32 - Tegra30/Tegra20 I2C controller has enabled per packet transfer by
33 default and there is no way to disable it. Tegra114 has this
34 interrupt disable by default and SW need to enable explicitly.
35 Due to above changes, Tegra114 I2C driver makes incompatible with
36 previous hardware driver. Hence, tegra114 I2C controller is compatible
37 with "nvidia,tegra114-i2c".
38- reg: Should contain I2C controller registers physical address and length.
39- interrupts: Should contain I2C controller interrupts.
40- address-cells: Address cells for I2C device address.
41- size-cells: Size of the I2C device address.
42- clocks: Clock ID as per
43 Documentation/devicetree/bindings/clock/tegra<chip-id>.txt
44 for I2C controller.
45- clock-names: Name of the clock:
46 Tegra20/Tegra30 I2C controller: "div-clk and "fast-clk".
47 Tegra114 I2C controller: "div-clk".
48
49Example:
50
51 i2c@7000c000 {
52 compatible = "nvidia,tegra20-i2c";
53 reg = <0x7000c000 0x100>;
54 interrupts = <0 38 0x04>;
55 #address-cells = <1>;
56 #size-cells = <0>;
57 clocks = <&tegra_car 12>, <&tegra_car 124>;
58 clock-names = "div-clk", "fast-clk";
59 status = "disabled";
60 };
diff --git a/Documentation/devicetree/bindings/mmc/davinci_mmc.txt b/Documentation/devicetree/bindings/mmc/davinci_mmc.txt
new file mode 100644
index 000000000000..e5a0140b2381
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/davinci_mmc.txt
@@ -0,0 +1,33 @@
1* TI Highspeed MMC host controller for DaVinci
2
3The Highspeed MMC Host Controller on TI DaVinci family
4provides an interface for MMC, SD and SDIO types of memory cards.
5
6This file documents the properties used by the davinci_mmc driver.
7
8Required properties:
9- compatible:
10 Should be "ti,da830-mmc": for da830, da850, dm365
11 Should be "ti,dm355-mmc": for dm355, dm644x
12
13Optional properties:
14- bus-width: Number of data lines, can be <1>, <4>, or <8>, default <1>
15- max-frequency: Maximum operating clock frequency, default 25MHz.
16- dmas: List of DMA specifiers with the controller specific format
17 as described in the generic DMA client binding. A tx and rx
18 specifier is required.
19- dma-names: RX and TX DMA request names. These strings correspond
20 1:1 with the DMA specifiers listed in dmas.
21
22Example:
23mmc0: mmc@1c40000 {
24 compatible = "ti,da830-mmc",
25 reg = <0x40000 0x1000>;
26 interrupts = <16>;
27 status = "okay";
28 bus-width = <4>;
29 max-frequency = <50000000>;
30 dmas = <&edma 16
31 &edma 17>;
32 dma-names = "rx", "tx";
33};
diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
index 54949f6faede..515addc20070 100644
--- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
@@ -9,15 +9,19 @@ and the properties used by the mxsmmc driver.
9Required properties: 9Required properties:
10- compatible: Should be "fsl,<chip>-mmc". The supported chips include 10- compatible: Should be "fsl,<chip>-mmc". The supported chips include
11 imx23 and imx28. 11 imx23 and imx28.
12- interrupts: Should contain ERROR and DMA interrupts 12- interrupts: Should contain ERROR interrupt number
13- fsl,ssp-dma-channel: APBH DMA channel for the SSP 13- dmas: DMA specifier, consisting of a phandle to DMA controller node
14 and SSP DMA channel ID.
15 Refer to dma.txt and fsl-mxs-dma.txt for details.
16- dma-names: Must be "rx-tx".
14 17
15Examples: 18Examples:
16 19
17ssp0: ssp@80010000 { 20ssp0: ssp@80010000 {
18 compatible = "fsl,imx28-mmc"; 21 compatible = "fsl,imx28-mmc";
19 reg = <0x80010000 2000>; 22 reg = <0x80010000 2000>;
20 interrupts = <96 82>; 23 interrupts = <96>;
21 fsl,ssp-dma-channel = <0>; 24 dmas = <&dma_apbh 0>;
25 dma-names = "rx-tx";
22 bus-width = <8>; 26 bus-width = <8>;
23}; 27};
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 3fb3f9015365..551b2a179d01 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -7,10 +7,12 @@ Required properties:
7 - compatible : should be "fsl,<chip>-gpmi-nand" 7 - compatible : should be "fsl,<chip>-gpmi-nand"
8 - reg : should contain registers location and length for gpmi and bch. 8 - reg : should contain registers location and length for gpmi and bch.
9 - reg-names: Should contain the reg names "gpmi-nand" and "bch" 9 - reg-names: Should contain the reg names "gpmi-nand" and "bch"
10 - interrupts : The first is the DMA interrupt number for GPMI. 10 - interrupts : BCH interrupt number.
11 The second is the BCH interrupt number. 11 - interrupt-names : Should be "bch".
12 - interrupt-names : The interrupt names "gpmi-dma", "bch"; 12 - dmas: DMA specifier, consisting of a phandle to DMA controller node
13 - fsl,gpmi-dma-channel : Should contain the dma channel it uses. 13 and GPMI DMA channel ID.
14 Refer to dma.txt and fsl-mxs-dma.txt for details.
15 - dma-names: Must be "rx-tx".
14 16
15Optional properties: 17Optional properties:
16 - nand-on-flash-bbt: boolean to enable on flash bbt option if not 18 - nand-on-flash-bbt: boolean to enable on flash bbt option if not
@@ -27,9 +29,10 @@ gpmi-nand@8000c000 {
27 #size-cells = <1>; 29 #size-cells = <1>;
28 reg = <0x8000c000 2000>, <0x8000a000 2000>; 30 reg = <0x8000c000 2000>, <0x8000a000 2000>;
29 reg-names = "gpmi-nand", "bch"; 31 reg-names = "gpmi-nand", "bch";
30 interrupts = <88>, <41>; 32 interrupts = <41>;
31 interrupt-names = "gpmi-dma", "bch"; 33 interrupt-names = "bch";
32 fsl,gpmi-dma-channel = <4>; 34 dmas = <&dma_apbh 4>;
35 dma-names = "rx-tx";
33 36
34 partition@0 { 37 partition@0 {
35 ... 38 ...
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
index f7e8e8f4d9a3..3077370c89af 100644
--- a/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/fsl,mxs-pinctrl.txt
@@ -70,6 +70,10 @@ Optional subnode-properties:
70 0: Disable the internal pull-up 70 0: Disable the internal pull-up
71 1: Enable the internal pull-up 71 1: Enable the internal pull-up
72 72
73Note that when enabling the pull-up, the internal pad keeper gets disabled.
74Also, some pins doesn't have a pull up, in that case, setting the fsl,pull-up
75will only disable the internal pad keeper.
76
73Examples: 77Examples:
74 78
75pinctrl@80018000 { 79pinctrl@80018000 {
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-alc5632.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-alc5632.txt
index b77a97c9101e..05ffecb57103 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-alc5632.txt
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-alc5632.txt
@@ -2,6 +2,11 @@ NVIDIA Tegra audio complex
2 2
3Required properties: 3Required properties:
4- compatible : "nvidia,tegra-audio-alc5632" 4- compatible : "nvidia,tegra-audio-alc5632"
5- clocks : Must contain an entry for each entry in clock-names.
6- clock-names : Must include the following entries:
7 "pll_a" (The Tegra clock of that name),
8 "pll_a_out0" (The Tegra clock of that name),
9 "mclk" (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
5- nvidia,model : The user-visible name of this sound complex. 10- nvidia,model : The user-visible name of this sound complex.
6- nvidia,audio-routing : A list of the connections between audio components. 11- nvidia,audio-routing : A list of the connections between audio components.
7 Each entry is a pair of strings, the first being the connection's sink, 12 Each entry is a pair of strings, the first being the connection's sink,
@@ -56,4 +61,7 @@ sound {
56 61
57 nvidia,i2s-controller = <&tegra_i2s1>; 62 nvidia,i2s-controller = <&tegra_i2s1>;
58 nvidia,audio-codec = <&alc5632>; 63 nvidia,audio-codec = <&alc5632>;
64
65 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 93>;
66 clock-names = "pll_a", "pll_a_out0", "mclk";
59}; 67};
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-trimslice.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-trimslice.txt
index 04b14cfb1f16..ef1fe7358279 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-trimslice.txt
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-trimslice.txt
@@ -2,6 +2,11 @@ NVIDIA Tegra audio complex for TrimSlice
2 2
3Required properties: 3Required properties:
4- compatible : "nvidia,tegra-audio-trimslice" 4- compatible : "nvidia,tegra-audio-trimslice"
5- clocks : Must contain an entry for each entry in clock-names.
6- clock-names : Must include the following entries:
7 "pll_a" (The Tegra clock of that name),
8 "pll_a_out0" (The Tegra clock of that name),
9 "mclk" (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
5- nvidia,i2s-controller : The phandle of the Tegra I2S1 controller 10- nvidia,i2s-controller : The phandle of the Tegra I2S1 controller
6- nvidia,audio-codec : The phandle of the WM8903 audio codec 11- nvidia,audio-codec : The phandle of the WM8903 audio codec
7 12
@@ -11,4 +16,6 @@ sound {
11 compatible = "nvidia,tegra-audio-trimslice"; 16 compatible = "nvidia,tegra-audio-trimslice";
12 nvidia,i2s-controller = <&tegra_i2s1>; 17 nvidia,i2s-controller = <&tegra_i2s1>;
13 nvidia,audio-codec = <&codec>; 18 nvidia,audio-codec = <&codec>;
19 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 93>;
20 clock-names = "pll_a", "pll_a_out0", "mclk";
14}; 21};
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8753.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8753.txt
index c4dd39ce6165..d14510613a7f 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8753.txt
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8753.txt
@@ -2,6 +2,11 @@ NVIDIA Tegra audio complex
2 2
3Required properties: 3Required properties:
4- compatible : "nvidia,tegra-audio-wm8753" 4- compatible : "nvidia,tegra-audio-wm8753"
5- clocks : Must contain an entry for each entry in clock-names.
6- clock-names : Must include the following entries:
7 "pll_a" (The Tegra clock of that name),
8 "pll_a_out0" (The Tegra clock of that name),
9 "mclk" (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
5- nvidia,model : The user-visible name of this sound complex. 10- nvidia,model : The user-visible name of this sound complex.
6- nvidia,audio-routing : A list of the connections between audio components. 11- nvidia,audio-routing : A list of the connections between audio components.
7 Each entry is a pair of strings, the first being the connection's sink, 12 Each entry is a pair of strings, the first being the connection's sink,
@@ -50,5 +55,8 @@ sound {
50 55
51 nvidia,i2s-controller = <&i2s1>; 56 nvidia,i2s-controller = <&i2s1>;
52 nvidia,audio-codec = <&wm8753>; 57 nvidia,audio-codec = <&wm8753>;
58
59 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 93>;
60 clock-names = "pll_a", "pll_a_out0", "mclk";
53}; 61};
54 62
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt
index d5b0da8bf1d8..3bf722deb722 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm8903.txt
@@ -2,6 +2,11 @@ NVIDIA Tegra audio complex
2 2
3Required properties: 3Required properties:
4- compatible : "nvidia,tegra-audio-wm8903" 4- compatible : "nvidia,tegra-audio-wm8903"
5- clocks : Must contain an entry for each entry in clock-names.
6- clock-names : Must include the following entries:
7 "pll_a" (The Tegra clock of that name),
8 "pll_a_out0" (The Tegra clock of that name),
9 "mclk" (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
5- nvidia,model : The user-visible name of this sound complex. 10- nvidia,model : The user-visible name of this sound complex.
6- nvidia,audio-routing : A list of the connections between audio components. 11- nvidia,audio-routing : A list of the connections between audio components.
7 Each entry is a pair of strings, the first being the connection's sink, 12 Each entry is a pair of strings, the first being the connection's sink,
@@ -67,5 +72,8 @@ sound {
67 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ 72 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
68 nvidia,int-mic-en-gpios = <&gpio 184 0>; /*gpio PX0 */ 73 nvidia,int-mic-en-gpios = <&gpio 184 0>; /*gpio PX0 */
69 nvidia,ext-mic-en-gpios = <&gpio 185 0>; /* gpio PX1 */ 74 nvidia,ext-mic-en-gpios = <&gpio 185 0>; /* gpio PX1 */
75
76 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 93>;
77 clock-names = "pll_a", "pll_a_out0", "mclk";
70}; 78};
71 79
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm9712.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm9712.txt
index be35d34e8b26..ad589b163639 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm9712.txt
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-wm9712.txt
@@ -2,6 +2,11 @@ NVIDIA Tegra audio complex
2 2
3Required properties: 3Required properties:
4- compatible : "nvidia,tegra-audio-wm9712" 4- compatible : "nvidia,tegra-audio-wm9712"
5- clocks : Must contain an entry for each entry in clock-names.
6- clock-names : Must include the following entries:
7 "pll_a" (The Tegra clock of that name),
8 "pll_a_out0" (The Tegra clock of that name),
9 "mclk" (The Tegra cdev1/extern1 clock, which feeds the CODEC's mclk)
5- nvidia,model : The user-visible name of this sound complex. 10- nvidia,model : The user-visible name of this sound complex.
6- nvidia,audio-routing : A list of the connections between audio components. 11- nvidia,audio-routing : A list of the connections between audio components.
7 Each entry is a pair of strings, the first being the connection's sink, 12 Each entry is a pair of strings, the first being the connection's sink,
@@ -48,4 +53,7 @@ sound {
48 "Mic", "MIC1"; 53 "Mic", "MIC1";
49 54
50 nvidia,ac97-controller = <&ac97>; 55 nvidia,ac97-controller = <&ac97>;
56
57 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 93>;
58 clock-names = "pll_a", "pll_a_out0", "mclk";
51}; 59};
diff --git a/Documentation/devicetree/bindings/spi/mxs-spi.txt b/Documentation/devicetree/bindings/spi/mxs-spi.txt
index e2e13957c2a4..3499b73293c2 100644
--- a/Documentation/devicetree/bindings/spi/mxs-spi.txt
+++ b/Documentation/devicetree/bindings/spi/mxs-spi.txt
@@ -3,8 +3,11 @@
3Required properties: 3Required properties:
4- compatible: Should be "fsl,<soc>-spi", where soc is "imx23" or "imx28" 4- compatible: Should be "fsl,<soc>-spi", where soc is "imx23" or "imx28"
5- reg: Offset and length of the register set for the device 5- reg: Offset and length of the register set for the device
6- interrupts: Should contain SSP interrupts (error irq first, dma irq second) 6- interrupts: Should contain SSP ERROR interrupt
7- fsl,ssp-dma-channel: APBX DMA channel for the SSP 7- dmas: DMA specifier, consisting of a phandle to DMA controller node
8 and SSP DMA channel ID.
9 Refer to dma.txt and fsl-mxs-dma.txt for details.
10- dma-names: Must be "rx-tx".
8 11
9Optional properties: 12Optional properties:
10- clock-frequency : Input clock frequency to the SPI block in Hz. 13- clock-frequency : Input clock frequency to the SPI block in Hz.
@@ -17,6 +20,7 @@ ssp0: ssp@80010000 {
17 #size-cells = <0>; 20 #size-cells = <0>;
18 compatible = "fsl,imx28-spi"; 21 compatible = "fsl,imx28-spi";
19 reg = <0x80010000 0x2000>; 22 reg = <0x80010000 0x2000>;
20 interrupts = <96 82>; 23 interrupts = <96>;
21 fsl,ssp-dma-channel = <0>; 24 dmas = <&dma_apbh 0>;
25 dma-names = "rx-tx";
22}; 26};
diff --git a/Documentation/devicetree/bindings/spi/spi-davinci.txt b/Documentation/devicetree/bindings/spi/spi-davinci.txt
new file mode 100644
index 000000000000..6d0ac8d0ad9b
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-davinci.txt
@@ -0,0 +1,51 @@
1Davinci SPI controller device bindings
2
3Required properties:
4- #address-cells: number of cells required to define a chip select
5 address on the SPI bus. Should be set to 1.
6- #size-cells: should be zero.
7- compatible:
8 - "ti,dm6441-spi" for SPI used similar to that on DM644x SoC family
9 - "ti,da830-spi" for SPI used similar to that on DA8xx SoC family
10- reg: Offset and length of SPI controller register space
11- num-cs: Number of chip selects
12- ti,davinci-spi-intr-line: interrupt line used to connect the SPI
13 IP to the interrupt controller within the SoC. Possible values
14 are 0 and 1. Manual says one of the two possible interrupt
15 lines can be tied to the interrupt controller. Set this
16 based on a specifc SoC configuration.
17- interrupts: interrupt number mapped to CPU.
18- clocks: spi clk phandle
19
20Example of a NOR flash slave device (n25q032) connected to DaVinci
21SPI controller device over the SPI bus.
22
23spi0:spi@20BF0000 {
24 #address-cells = <1>;
25 #size-cells = <0>;
26 compatible = "ti,dm6446-spi";
27 reg = <0x20BF0000 0x1000>;
28 num-cs = <4>;
29 ti,davinci-spi-intr-line = <0>;
30 interrupts = <338>;
31 clocks = <&clkspi>;
32
33 flash: n25q032@0 {
34 #address-cells = <1>;
35 #size-cells = <1>;
36 compatible = "st,m25p32";
37 spi-max-frequency = <25000000>;
38 reg = <0>;
39
40 partition@0 {
41 label = "u-boot-spl";
42 reg = <0x0 0x80000>;
43 read-only;
44 };
45
46 partition@1 {
47 label = "test";
48 reg = <0x80000 0x380000>;
49 };
50 };
51};
diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
index 273a8d5b3300..2c00ec64628e 100644
--- a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
@@ -5,20 +5,18 @@ Required properties:
5 imx23 and imx28. 5 imx23 and imx28.
6- reg : Address and length of the register set for the device 6- reg : Address and length of the register set for the device
7- interrupts : Should contain the auart interrupt numbers 7- interrupts : Should contain the auart interrupt numbers
8 8- dmas: DMA specifier, consisting of a phandle to DMA controller node
9Optional properties: 9 and AUART DMA channel ID.
10- fsl,auart-dma-channel : The DMA channels, the first is for RX, the other 10 Refer to dma.txt and fsl-mxs-dma.txt for details.
11 is for TX. If you add this property, it also means that you 11- dma-names: "rx" for RX channel, "tx" for TX channel.
12 will enable the DMA support for the auart.
13 Note: due to the hardware bug in imx23(see errata : 2836),
14 only the imx28 can enable the DMA support for the auart.
15 12
16Example: 13Example:
17auart0: serial@8006a000 { 14auart0: serial@8006a000 {
18 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 15 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
19 reg = <0x8006a000 0x2000>; 16 reg = <0x8006a000 0x2000>;
20 interrupts = <112 70 71>; 17 interrupts = <112>;
21 fsl,auart-dma-channel = <8 9>; 18 dmas = <&dma_apbx 8>, <&dma_apbx 9>;
19 dma-names = "rx", "tx";
22}; 20};
23 21
24Note: Each auart port should have an alias correctly numbered in "aliases" 22Note: Each auart port should have an alias correctly numbered in "aliases"
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt
index 1ef0ce71f8fa..abce25684abc 100644
--- a/Documentation/devicetree/bindings/usb/omap-usb.txt
+++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
@@ -18,6 +18,7 @@ OMAP MUSB GLUE
18 represents PERIPHERAL. 18 represents PERIPHERAL.
19 - power : Should be "50". This signifies the controller can supply upto 19 - power : Should be "50". This signifies the controller can supply upto
20 100mA when operating in host mode. 20 100mA when operating in host mode.
21 - usb-phy : the phandle for the PHY device
21 22
22Optional properties: 23Optional properties:
23 - ctrl-module : phandle of the control module this glue uses to write to 24 - ctrl-module : phandle of the control module this glue uses to write to
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index be23497f5b29..60ee4f124af2 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -473,12 +473,14 @@ config ARCH_MXS
473 select ARCH_REQUIRE_GPIOLIB 473 select ARCH_REQUIRE_GPIOLIB
474 select CLKDEV_LOOKUP 474 select CLKDEV_LOOKUP
475 select CLKSRC_MMIO 475 select CLKSRC_MMIO
476 select CLKSRC_OF
476 select COMMON_CLK 477 select COMMON_CLK
477 select GENERIC_CLOCKEVENTS 478 select GENERIC_CLOCKEVENTS
478 select HAVE_CLK_PREPARE 479 select HAVE_CLK_PREPARE
479 select MULTI_IRQ_HANDLER 480 select MULTI_IRQ_HANDLER
480 select PINCTRL 481 select PINCTRL
481 select SPARSE_IRQ 482 select SPARSE_IRQ
483 select STMP_DEVICE
482 select USE_OF 484 select USE_OF
483 help 485 help
484 Support for Freescale MXS-based family of processors 486 Support for Freescale MXS-based family of processors
@@ -562,6 +564,7 @@ config ARCH_DOVE
562 select PINCTRL_DOVE 564 select PINCTRL_DOVE
563 select PLAT_ORION_LEGACY 565 select PLAT_ORION_LEGACY
564 select USB_ARCH_HAS_EHCI 566 select USB_ARCH_HAS_EHCI
567 select MVEBU_MBUS
565 help 568 help
566 Support for the Marvell Dove SoC 88AP510 569 Support for the Marvell Dove SoC 88AP510
567 570
@@ -575,6 +578,7 @@ config ARCH_KIRKWOOD
575 select PINCTRL 578 select PINCTRL
576 select PINCTRL_KIRKWOOD 579 select PINCTRL_KIRKWOOD
577 select PLAT_ORION_LEGACY 580 select PLAT_ORION_LEGACY
581 select MVEBU_MBUS
578 help 582 help
579 Support for the following Marvell Kirkwood series SoCs: 583 Support for the following Marvell Kirkwood series SoCs:
580 88F6180, 88F6192 and 88F6281. 584 88F6180, 88F6192 and 88F6281.
@@ -586,6 +590,7 @@ config ARCH_MV78XX0
586 select GENERIC_CLOCKEVENTS 590 select GENERIC_CLOCKEVENTS
587 select PCI 591 select PCI
588 select PLAT_ORION_LEGACY 592 select PLAT_ORION_LEGACY
593 select MVEBU_MBUS
589 help 594 help
590 Support for the following Marvell MV78xx0 series SoCs: 595 Support for the following Marvell MV78xx0 series SoCs:
591 MV781x0, MV782x0. 596 MV781x0, MV782x0.
@@ -598,6 +603,7 @@ config ARCH_ORION5X
598 select GENERIC_CLOCKEVENTS 603 select GENERIC_CLOCKEVENTS
599 select PCI 604 select PCI
600 select PLAT_ORION_LEGACY 605 select PLAT_ORION_LEGACY
606 select MVEBU_MBUS
601 help 607 help
602 Support for the following Marvell Orion 5x series SoCs: 608 Support for the following Marvell Orion 5x series SoCs:
603 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182), 609 Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
@@ -673,6 +679,7 @@ config ARCH_TEGRA
673 select HAVE_CLK 679 select HAVE_CLK
674 select HAVE_SMP 680 select HAVE_SMP
675 select MIGHT_HAVE_CACHE_L2X0 681 select MIGHT_HAVE_CACHE_L2X0
682 select SOC_BUS
676 select SPARSE_IRQ 683 select SPARSE_IRQ
677 select USE_OF 684 select USE_OF
678 help 685 help
@@ -1609,6 +1616,7 @@ config HAVE_ARM_ARCH_TIMER
1609config HAVE_ARM_TWD 1616config HAVE_ARM_TWD
1610 bool 1617 bool
1611 depends on SMP 1618 depends on SMP
1619 select CLKSRC_OF if OF
1612 help 1620 help
1613 This options enables support for the ARM timer and watchdog unit 1621 This options enables support for the ARM timer and watchdog unit
1614 1622
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 11fef62e237b..6cecf1437ea0 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -119,10 +119,14 @@ dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
119 imx28-tx28.dtb 119 imx28-tx28.dtb
120dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb 120dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb
121dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ 121dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
122 omap3430-sdp.dtb \
122 omap3-beagle.dtb \ 123 omap3-beagle.dtb \
124 omap3-devkit8000.dtb \
123 omap3-beagle-xm.dtb \ 125 omap3-beagle-xm.dtb \
124 omap3-evm.dtb \ 126 omap3-evm.dtb \
125 omap3-tobi.dtb \ 127 omap3-tobi.dtb \
128 omap3-igep0020.dtb \
129 omap3-igep0030.dtb \
126 omap4-panda.dtb \ 130 omap4-panda.dtb \
127 omap4-panda-a4.dtb \ 131 omap4-panda-a4.dtb \
128 omap4-panda-es.dtb \ 132 omap4-panda-es.dtb \
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 11b240c5d323..5302f79c05b7 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -43,7 +43,7 @@
43 status = "okay"; 43 status = "okay";
44 }; 44 };
45 45
46 i2c1: i2c@44e0b000 { 46 i2c0: i2c@44e0b000 {
47 status = "okay"; 47 status = "okay";
48 clock-frequency = <400000>; 48 clock-frequency = <400000>;
49 49
@@ -59,27 +59,27 @@
59 59
60 led@2 { 60 led@2 {
61 label = "beaglebone:green:heartbeat"; 61 label = "beaglebone:green:heartbeat";
62 gpios = <&gpio2 21 0>; 62 gpios = <&gpio1 21 0>;
63 linux,default-trigger = "heartbeat"; 63 linux,default-trigger = "heartbeat";
64 default-state = "off"; 64 default-state = "off";
65 }; 65 };
66 66
67 led@3 { 67 led@3 {
68 label = "beaglebone:green:mmc0"; 68 label = "beaglebone:green:mmc0";
69 gpios = <&gpio2 22 0>; 69 gpios = <&gpio1 22 0>;
70 linux,default-trigger = "mmc0"; 70 linux,default-trigger = "mmc0";
71 default-state = "off"; 71 default-state = "off";
72 }; 72 };
73 73
74 led@4 { 74 led@4 {
75 label = "beaglebone:green:usr2"; 75 label = "beaglebone:green:usr2";
76 gpios = <&gpio2 23 0>; 76 gpios = <&gpio1 23 0>;
77 default-state = "off"; 77 default-state = "off";
78 }; 78 };
79 79
80 led@5 { 80 led@5 {
81 label = "beaglebone:green:usr3"; 81 label = "beaglebone:green:usr3";
82 gpios = <&gpio2 24 0>; 82 gpios = <&gpio1 24 0>;
83 default-state = "off"; 83 default-state = "off";
84 }; 84 };
85 }; 85 };
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index d6496440fcea..0423298a26fe 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -51,7 +51,7 @@
51 status = "okay"; 51 status = "okay";
52 }; 52 };
53 53
54 i2c1: i2c@44e0b000 { 54 i2c0: i2c@44e0b000 {
55 status = "okay"; 55 status = "okay";
56 clock-frequency = <400000>; 56 clock-frequency = <400000>;
57 57
@@ -60,7 +60,7 @@
60 }; 60 };
61 }; 61 };
62 62
63 i2c2: i2c@4802a000 { 63 i2c1: i2c@4802a000 {
64 status = "okay"; 64 status = "okay";
65 clock-frequency = <100000>; 65 clock-frequency = <100000>;
66 66
@@ -123,12 +123,12 @@
123 debounce-delay-ms = <5>; 123 debounce-delay-ms = <5>;
124 col-scan-delay-us = <2>; 124 col-scan-delay-us = <2>;
125 125
126 row-gpios = <&gpio2 25 0 /* Bank1, pin25 */ 126 row-gpios = <&gpio1 25 0 /* Bank1, pin25 */
127 &gpio2 26 0 /* Bank1, pin26 */ 127 &gpio1 26 0 /* Bank1, pin26 */
128 &gpio2 27 0>; /* Bank1, pin27 */ 128 &gpio1 27 0>; /* Bank1, pin27 */
129 129
130 col-gpios = <&gpio2 21 0 /* Bank1, pin21 */ 130 col-gpios = <&gpio1 21 0 /* Bank1, pin21 */
131 &gpio2 22 0>; /* Bank1, pin22 */ 131 &gpio1 22 0>; /* Bank1, pin22 */
132 132
133 linux,keymap = <0x0000008b /* MENU */ 133 linux,keymap = <0x0000008b /* MENU */
134 0x0100009e /* BACK */ 134 0x0100009e /* BACK */
@@ -147,14 +147,14 @@
147 switch@9 { 147 switch@9 {
148 label = "volume-up"; 148 label = "volume-up";
149 linux,code = <115>; 149 linux,code = <115>;
150 gpios = <&gpio1 2 1>; 150 gpios = <&gpio0 2 1>;
151 gpio-key,wakeup; 151 gpio-key,wakeup;
152 }; 152 };
153 153
154 switch@10 { 154 switch@10 {
155 label = "volume-down"; 155 label = "volume-down";
156 linux,code = <114>; 156 linux,code = <114>;
157 gpios = <&gpio1 3 1>; 157 gpios = <&gpio0 3 1>;
158 gpio-key,wakeup; 158 gpio-key,wakeup;
159 }; 159 };
160 }; 160 };
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index f5a6162a4ff2..f67c360844f4 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -58,7 +58,7 @@
58 status = "okay"; 58 status = "okay";
59 }; 59 };
60 60
61 i2c1: i2c@44e0b000 { 61 i2c0: i2c@44e0b000 {
62 status = "okay"; 62 status = "okay";
63 clock-frequency = <400000>; 63 clock-frequency = <400000>;
64 64
@@ -115,26 +115,26 @@
115 115
116 led@1 { 116 led@1 {
117 label = "evmsk:green:usr0"; 117 label = "evmsk:green:usr0";
118 gpios = <&gpio2 4 0>; 118 gpios = <&gpio1 4 0>;
119 default-state = "off"; 119 default-state = "off";
120 }; 120 };
121 121
122 led@2 { 122 led@2 {
123 label = "evmsk:green:usr1"; 123 label = "evmsk:green:usr1";
124 gpios = <&gpio2 5 0>; 124 gpios = <&gpio1 5 0>;
125 default-state = "off"; 125 default-state = "off";
126 }; 126 };
127 127
128 led@3 { 128 led@3 {
129 label = "evmsk:green:mmc0"; 129 label = "evmsk:green:mmc0";
130 gpios = <&gpio2 6 0>; 130 gpios = <&gpio1 6 0>;
131 linux,default-trigger = "mmc0"; 131 linux,default-trigger = "mmc0";
132 default-state = "off"; 132 default-state = "off";
133 }; 133 };
134 134
135 led@4 { 135 led@4 {
136 label = "evmsk:green:heartbeat"; 136 label = "evmsk:green:heartbeat";
137 gpios = <&gpio2 7 0>; 137 gpios = <&gpio1 7 0>;
138 linux,default-trigger = "heartbeat"; 138 linux,default-trigger = "heartbeat";
139 default-state = "off"; 139 default-state = "off";
140 }; 140 };
@@ -148,26 +148,26 @@
148 switch@1 { 148 switch@1 {
149 label = "button0"; 149 label = "button0";
150 linux,code = <0x100>; 150 linux,code = <0x100>;
151 gpios = <&gpio3 3 0>; 151 gpios = <&gpio2 3 0>;
152 }; 152 };
153 153
154 switch@2 { 154 switch@2 {
155 label = "button1"; 155 label = "button1";
156 linux,code = <0x101>; 156 linux,code = <0x101>;
157 gpios = <&gpio3 2 0>; 157 gpios = <&gpio2 2 0>;
158 }; 158 };
159 159
160 switch@3 { 160 switch@3 {
161 label = "button2"; 161 label = "button2";
162 linux,code = <0x102>; 162 linux,code = <0x102>;
163 gpios = <&gpio1 30 0>; 163 gpios = <&gpio0 30 0>;
164 gpio-key,wakeup; 164 gpio-key,wakeup;
165 }; 165 };
166 166
167 switch@4 { 167 switch@4 {
168 label = "button3"; 168 label = "button3";
169 linux,code = <0x103>; 169 linux,code = <0x103>;
170 gpios = <&gpio3 5 0>; 170 gpios = <&gpio2 5 0>;
171 }; 171 };
172 }; 172 };
173}; 173};
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 0957645b73af..df6283076e79 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -21,6 +21,8 @@
21 serial3 = &uart4; 21 serial3 = &uart4;
22 serial4 = &uart5; 22 serial4 = &uart5;
23 serial5 = &uart6; 23 serial5 = &uart6;
24 d_can0 = &dcan0;
25 d_can1 = &dcan1;
24 }; 26 };
25 27
26 cpus { 28 cpus {
@@ -87,7 +89,7 @@
87 reg = <0x48200000 0x1000>; 89 reg = <0x48200000 0x1000>;
88 }; 90 };
89 91
90 gpio1: gpio@44e07000 { 92 gpio0: gpio@44e07000 {
91 compatible = "ti,omap4-gpio"; 93 compatible = "ti,omap4-gpio";
92 ti,hwmods = "gpio1"; 94 ti,hwmods = "gpio1";
93 gpio-controller; 95 gpio-controller;
@@ -98,7 +100,7 @@
98 interrupts = <96>; 100 interrupts = <96>;
99 }; 101 };
100 102
101 gpio2: gpio@4804c000 { 103 gpio1: gpio@4804c000 {
102 compatible = "ti,omap4-gpio"; 104 compatible = "ti,omap4-gpio";
103 ti,hwmods = "gpio2"; 105 ti,hwmods = "gpio2";
104 gpio-controller; 106 gpio-controller;
@@ -109,7 +111,7 @@
109 interrupts = <98>; 111 interrupts = <98>;
110 }; 112 };
111 113
112 gpio3: gpio@481ac000 { 114 gpio2: gpio@481ac000 {
113 compatible = "ti,omap4-gpio"; 115 compatible = "ti,omap4-gpio";
114 ti,hwmods = "gpio3"; 116 ti,hwmods = "gpio3";
115 gpio-controller; 117 gpio-controller;
@@ -120,7 +122,7 @@
120 interrupts = <32>; 122 interrupts = <32>;
121 }; 123 };
122 124
123 gpio4: gpio@481ae000 { 125 gpio3: gpio@481ae000 {
124 compatible = "ti,omap4-gpio"; 126 compatible = "ti,omap4-gpio";
125 ti,hwmods = "gpio4"; 127 ti,hwmods = "gpio4";
126 gpio-controller; 128 gpio-controller;
@@ -185,7 +187,7 @@
185 status = "disabled"; 187 status = "disabled";
186 }; 188 };
187 189
188 i2c1: i2c@44e0b000 { 190 i2c0: i2c@44e0b000 {
189 compatible = "ti,omap4-i2c"; 191 compatible = "ti,omap4-i2c";
190 #address-cells = <1>; 192 #address-cells = <1>;
191 #size-cells = <0>; 193 #size-cells = <0>;
@@ -195,7 +197,7 @@
195 status = "disabled"; 197 status = "disabled";
196 }; 198 };
197 199
198 i2c2: i2c@4802a000 { 200 i2c1: i2c@4802a000 {
199 compatible = "ti,omap4-i2c"; 201 compatible = "ti,omap4-i2c";
200 #address-cells = <1>; 202 #address-cells = <1>;
201 #size-cells = <0>; 203 #size-cells = <0>;
@@ -205,7 +207,7 @@
205 status = "disabled"; 207 status = "disabled";
206 }; 208 };
207 209
208 i2c3: i2c@4819c000 { 210 i2c2: i2c@4819c000 {
209 compatible = "ti,omap4-i2c"; 211 compatible = "ti,omap4-i2c";
210 #address-cells = <1>; 212 #address-cells = <1>;
211 #size-cells = <0>; 213 #size-cells = <0>;
@@ -225,7 +227,8 @@
225 dcan0: d_can@481cc000 { 227 dcan0: d_can@481cc000 {
226 compatible = "bosch,d_can"; 228 compatible = "bosch,d_can";
227 ti,hwmods = "d_can0"; 229 ti,hwmods = "d_can0";
228 reg = <0x481cc000 0x2000>; 230 reg = <0x481cc000 0x2000
231 0x44e10644 0x4>;
229 interrupts = <52>; 232 interrupts = <52>;
230 status = "disabled"; 233 status = "disabled";
231 }; 234 };
@@ -233,13 +236,14 @@
233 dcan1: d_can@481d0000 { 236 dcan1: d_can@481d0000 {
234 compatible = "bosch,d_can"; 237 compatible = "bosch,d_can";
235 ti,hwmods = "d_can1"; 238 ti,hwmods = "d_can1";
236 reg = <0x481d0000 0x2000>; 239 reg = <0x481d0000 0x2000
240 0x44e10644 0x4>;
237 interrupts = <55>; 241 interrupts = <55>;
238 status = "disabled"; 242 status = "disabled";
239 }; 243 };
240 244
241 timer1: timer@44e31000 { 245 timer1: timer@44e31000 {
242 compatible = "ti,omap2-timer"; 246 compatible = "ti,am335x-timer-1ms";
243 reg = <0x44e31000 0x400>; 247 reg = <0x44e31000 0x400>;
244 interrupts = <67>; 248 interrupts = <67>;
245 ti,hwmods = "timer1"; 249 ti,hwmods = "timer1";
@@ -247,21 +251,21 @@
247 }; 251 };
248 252
249 timer2: timer@48040000 { 253 timer2: timer@48040000 {
250 compatible = "ti,omap2-timer"; 254 compatible = "ti,am335x-timer";
251 reg = <0x48040000 0x400>; 255 reg = <0x48040000 0x400>;
252 interrupts = <68>; 256 interrupts = <68>;
253 ti,hwmods = "timer2"; 257 ti,hwmods = "timer2";
254 }; 258 };
255 259
256 timer3: timer@48042000 { 260 timer3: timer@48042000 {
257 compatible = "ti,omap2-timer"; 261 compatible = "ti,am335x-timer";
258 reg = <0x48042000 0x400>; 262 reg = <0x48042000 0x400>;
259 interrupts = <69>; 263 interrupts = <69>;
260 ti,hwmods = "timer3"; 264 ti,hwmods = "timer3";
261 }; 265 };
262 266
263 timer4: timer@48044000 { 267 timer4: timer@48044000 {
264 compatible = "ti,omap2-timer"; 268 compatible = "ti,am335x-timer";
265 reg = <0x48044000 0x400>; 269 reg = <0x48044000 0x400>;
266 interrupts = <92>; 270 interrupts = <92>;
267 ti,hwmods = "timer4"; 271 ti,hwmods = "timer4";
@@ -269,7 +273,7 @@
269 }; 273 };
270 274
271 timer5: timer@48046000 { 275 timer5: timer@48046000 {
272 compatible = "ti,omap2-timer"; 276 compatible = "ti,am335x-timer";
273 reg = <0x48046000 0x400>; 277 reg = <0x48046000 0x400>;
274 interrupts = <93>; 278 interrupts = <93>;
275 ti,hwmods = "timer5"; 279 ti,hwmods = "timer5";
@@ -277,7 +281,7 @@
277 }; 281 };
278 282
279 timer6: timer@48048000 { 283 timer6: timer@48048000 {
280 compatible = "ti,omap2-timer"; 284 compatible = "ti,am335x-timer";
281 reg = <0x48048000 0x400>; 285 reg = <0x48048000 0x400>;
282 interrupts = <94>; 286 interrupts = <94>;
283 ti,hwmods = "timer6"; 287 ti,hwmods = "timer6";
@@ -285,7 +289,7 @@
285 }; 289 };
286 290
287 timer7: timer@4804a000 { 291 timer7: timer@4804a000 {
288 compatible = "ti,omap2-timer"; 292 compatible = "ti,am335x-timer";
289 reg = <0x4804a000 0x400>; 293 reg = <0x4804a000 0x400>;
290 interrupts = <95>; 294 interrupts = <95>;
291 ti,hwmods = "timer7"; 295 ti,hwmods = "timer7";
@@ -305,7 +309,7 @@
305 #address-cells = <1>; 309 #address-cells = <1>;
306 #size-cells = <0>; 310 #size-cells = <0>;
307 reg = <0x48030000 0x400>; 311 reg = <0x48030000 0x400>;
308 interrupt = <65>; 312 interrupts = <65>;
309 ti,spi-num-cs = <2>; 313 ti,spi-num-cs = <2>;
310 ti,hwmods = "spi0"; 314 ti,hwmods = "spi0";
311 status = "disabled"; 315 status = "disabled";
@@ -316,7 +320,7 @@
316 #address-cells = <1>; 320 #address-cells = <1>;
317 #size-cells = <0>; 321 #size-cells = <0>;
318 reg = <0x481a0000 0x400>; 322 reg = <0x481a0000 0x400>;
319 interrupt = <125>; 323 interrupts = <125>;
320 ti,spi-num-cs = <2>; 324 ti,spi-num-cs = <2>;
321 ti,hwmods = "spi1"; 325 ti,hwmods = "spi1";
322 status = "disabled"; 326 status = "disabled";
diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts
index 474f760ecadf..e9b5bdae4908 100644
--- a/arch/arm/boot/dts/am3517-evm.dts
+++ b/arch/arm/boot/dts/am3517-evm.dts
@@ -7,7 +7,7 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap3.dtsi" 10/include/ "omap34xx.dtsi"
11 11
12/ { 12/ {
13 model = "TI AM3517 EVM (AM3517/05)"; 13 model = "TI AM3517 EVM (AM3517/05)";
diff --git a/arch/arm/boot/dts/am3517_mt_ventoux.dts b/arch/arm/boot/dts/am3517_mt_ventoux.dts
index 5eb26d7d9b4e..556868388a23 100644
--- a/arch/arm/boot/dts/am3517_mt_ventoux.dts
+++ b/arch/arm/boot/dts/am3517_mt_ventoux.dts
@@ -7,7 +7,7 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap3.dtsi" 10/include/ "omap34xx.dtsi"
11 11
12/ { 12/ {
13 model = "TeeJet Mt.Ventoux"; 13 model = "TeeJet Mt.Ventoux";
diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts
index e34b280ce6ec..2353b1f13704 100644
--- a/arch/arm/boot/dts/armada-370-db.dts
+++ b/arch/arm/boot/dts/armada-370-db.dts
@@ -30,68 +30,87 @@
30 }; 30 };
31 31
32 soc { 32 soc {
33 serial@d0012000 { 33 internal-regs {
34 clock-frequency = <200000000>; 34 serial@12000 {
35 status = "okay"; 35 clock-frequency = <200000000>;
36 }; 36 status = "okay";
37 sata@d00a0000 { 37 };
38 nr-ports = <2>; 38 sata@a0000 {
39 status = "okay"; 39 nr-ports = <2>;
40 }; 40 status = "okay";
41 };
41 42
42 mdio { 43 mdio {
43 phy0: ethernet-phy@0 { 44 phy0: ethernet-phy@0 {
44 reg = <0>; 45 reg = <0>;
46 };
47
48 phy1: ethernet-phy@1 {
49 reg = <1>;
50 };
45 }; 51 };
46 52
47 phy1: ethernet-phy@1 { 53 ethernet@70000 {
48 reg = <1>; 54 status = "okay";
55 phy = <&phy0>;
56 phy-mode = "rgmii-id";
57 };
58 ethernet@74000 {
59 status = "okay";
60 phy = <&phy1>;
61 phy-mode = "rgmii-id";
49 }; 62 };
50 };
51 63
52 ethernet@d0070000 { 64 mvsdio@d4000 {
53 status = "okay"; 65 pinctrl-0 = <&sdio_pins1>;
54 phy = <&phy0>; 66 pinctrl-names = "default";
55 phy-mode = "rgmii-id"; 67 /*
56 }; 68 * This device is disabled by default, because
57 ethernet@d0074000 { 69 * using the SD card connector requires
58 status = "okay"; 70 * changing the default CON40 connector
59 phy = <&phy1>; 71 * "DB-88F6710_MPP_2xRGMII_DEVICE_Jumper" to a
60 phy-mode = "rgmii-id"; 72 * different connector
61 }; 73 * "DB-88F6710_MPP_RGMII_SD_Jumper".
74 */
75 status = "disabled";
76 /* No CD or WP GPIOs */
77 };
62 78
63 mvsdio@d00d4000 { 79 usb@50000 {
64 pinctrl-0 = <&sdio_pins1>; 80 status = "okay";
65 pinctrl-names = "default"; 81 };
66 /*
67 * This device is disabled by default, because
68 * using the SD card connector requires
69 * changing the default CON40 connector
70 * "DB-88F6710_MPP_2xRGMII_DEVICE_Jumper" to a
71 * different connector
72 * "DB-88F6710_MPP_RGMII_SD_Jumper".
73 */
74 status = "disabled";
75 /* No CD or WP GPIOs */
76 };
77 82
78 usb@d0050000 { 83 usb@51000 {
79 status = "okay"; 84 status = "okay";
80 }; 85 };
81 86
82 usb@d0051000 { 87 spi0: spi@10600 {
83 status = "okay"; 88 status = "okay";
84 };
85 89
86 spi0: spi@d0010600 { 90 spi-flash@0 {
87 status = "okay"; 91 #address-cells = <1>;
92 #size-cells = <1>;
93 compatible = "mx25l25635e";
94 reg = <0>; /* Chip select 0 */
95 spi-max-frequency = <50000000>;
96 };
97 };
88 98
89 spi-flash@0 { 99 pcie-controller {
90 #address-cells = <1>; 100 status = "okay";
91 #size-cells = <1>; 101 /*
92 compatible = "mx25l25635e"; 102 * The two PCIe units are accessible through
93 reg = <0>; /* Chip select 0 */ 103 * both standard PCIe slots and mini-PCIe
94 spi-max-frequency = <50000000>; 104 * slots on the board.
105 */
106 pcie@1,0 {
107 /* Port 0, Lane 0 */
108 status = "okay";
109 };
110 pcie@2,0 {
111 /* Port 1, Lane 0 */
112 status = "okay";
113 };
95 }; 114 };
96 }; 115 };
97 }; 116 };
diff --git a/arch/arm/boot/dts/armada-370-mirabox.dts b/arch/arm/boot/dts/armada-370-mirabox.dts
index 3234875824dc..14e36e19d515 100644
--- a/arch/arm/boot/dts/armada-370-mirabox.dts
+++ b/arch/arm/boot/dts/armada-370-mirabox.dts
@@ -25,50 +25,116 @@
25 }; 25 };
26 26
27 soc { 27 soc {
28 serial@d0012000 { 28 internal-regs {
29 clock-frequency = <200000000>; 29 serial@12000 {
30 status = "okay"; 30 clock-frequency = <200000000>;
31 }; 31 status = "okay";
32 timer@d0020300 {
33 clock-frequency = <600000000>;
34 status = "okay";
35 };
36 mdio {
37 phy0: ethernet-phy@0 {
38 reg = <0>;
39 }; 32 };
33 timer@20300 {
34 clock-frequency = <600000000>;
35 status = "okay";
36 };
37
38 pinctrl {
39 pwr_led_pin: pwr-led-pin {
40 marvell,pins = "mpp63";
41 marvell,function = "gpo";
42 };
40 43
41 phy1: ethernet-phy@1 { 44 stat_led_pins: stat-led-pins {
42 reg = <1>; 45 marvell,pins = "mpp64", "mpp65";
46 marvell,function = "gpio";
47 };
43 }; 48 };
44 };
45 ethernet@d0070000 {
46 status = "okay";
47 phy = <&phy0>;
48 phy-mode = "rgmii-id";
49 };
50 ethernet@d0074000 {
51 status = "okay";
52 phy = <&phy1>;
53 phy-mode = "rgmii-id";
54 };
55 49
56 mvsdio@d00d4000 { 50 gpio_leds {
57 pinctrl-0 = <&sdio_pins3>; 51 compatible = "gpio-leds";
58 pinctrl-names = "default"; 52 pinctrl-names = "default";
59 status = "okay"; 53 pinctrl-0 = <&pwr_led_pin &stat_led_pins>;
60 /*
61 * No CD or WP GPIOs: SDIO interface used for
62 * Wifi/Bluetooth chip
63 */
64 };
65 54
66 usb@d0050000 { 55 green_pwr_led {
67 status = "okay"; 56 label = "mirabox:green:pwr";
68 }; 57 gpios = <&gpio1 31 1>;
58 linux,default-trigger = "heartbeat";
59 };
60
61 blue_stat_led {
62 label = "mirabox:blue:stat";
63 gpios = <&gpio2 0 1>;
64 linux,default-trigger = "cpu0";
65 };
66
67 green_stat_led {
68 label = "mirabox:green:stat";
69 gpios = <&gpio2 1 1>;
70 default-state = "off";
71 };
72 };
73
74 mdio {
75 phy0: ethernet-phy@0 {
76 reg = <0>;
77 };
78
79 phy1: ethernet-phy@1 {
80 reg = <1>;
81 };
82 };
83 ethernet@70000 {
84 status = "okay";
85 phy = <&phy0>;
86 phy-mode = "rgmii-id";
87 };
88 ethernet@74000 {
89 status = "okay";
90 phy = <&phy1>;
91 phy-mode = "rgmii-id";
92 };
93
94 mvsdio@d4000 {
95 pinctrl-0 = <&sdio_pins3>;
96 pinctrl-names = "default";
97 status = "okay";
98 /*
99 * No CD or WP GPIOs: SDIO interface used for
100 * Wifi/Bluetooth chip
101 */
102 };
103
104 usb@50000 {
105 status = "okay";
106 };
69 107
70 usb@d0051000 { 108 usb@51000 {
71 status = "okay"; 109 status = "okay";
110 };
111
112 i2c@11000 {
113 status = "okay";
114 clock-frequency = <100000>;
115 pca9505: pca9505@25 {
116 compatible = "nxp,pca9505";
117 gpio-controller;
118 #gpio-cells = <2>;
119 reg = <0x25>;
120 };
121 };
122
123 pcie-controller {
124 status = "okay";
125
126 /* Internal mini-PCIe connector */
127 pcie@1,0 {
128 /* Port 0, Lane 0 */
129 status = "okay";
130 };
131
132 /* Connected on the PCB to a USB 3.0 XHCI controller */
133 pcie@2,0 {
134 /* Port 1, Lane 0 */
135 status = "okay";
136 };
137 };
72 }; 138 };
73 }; 139 };
74}; 140};
diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts
index 070bba4f2585..130f8390a7e4 100644
--- a/arch/arm/boot/dts/armada-370-rd.dts
+++ b/arch/arm/boot/dts/armada-370-rd.dts
@@ -28,49 +28,62 @@
28 }; 28 };
29 29
30 soc { 30 soc {
31 serial@d0012000 { 31 internal-regs {
32 clock-frequency = <200000000>; 32 serial@12000 {
33 status = "okay"; 33 clock-frequency = <200000000>;
34 }; 34 status = "okay";
35 sata@d00a0000 { 35 };
36 nr-ports = <2>; 36 sata@a0000 {
37 status = "okay"; 37 nr-ports = <2>;
38 }; 38 status = "okay";
39 };
39 40
40 mdio { 41 mdio {
41 phy0: ethernet-phy@0 { 42 phy0: ethernet-phy@0 {
42 reg = <0>; 43 reg = <0>;
44 };
45
46 phy1: ethernet-phy@1 {
47 reg = <1>;
48 };
43 }; 49 };
44 50
45 phy1: ethernet-phy@1 { 51 ethernet@70000 {
46 reg = <1>; 52 status = "okay";
53 phy = <&phy0>;
54 phy-mode = "sgmii";
55 };
56 ethernet@74000 {
57 status = "okay";
58 phy = <&phy1>;
59 phy-mode = "rgmii-id";
47 }; 60 };
48 };
49 61
50 ethernet@d0070000 { 62 mvsdio@d4000 {
51 status = "okay"; 63 pinctrl-0 = <&sdio_pins1>;
52 phy = <&phy0>; 64 pinctrl-names = "default";
53 phy-mode = "sgmii"; 65 status = "okay";
54 }; 66 /* No CD or WP GPIOs */
55 ethernet@d0074000 { 67 };
56 status = "okay";
57 phy = <&phy1>;
58 phy-mode = "rgmii-id";
59 };
60 68
61 mvsdio@d00d4000 { 69 usb@50000 {
62 pinctrl-0 = <&sdio_pins1>; 70 status = "okay";
63 pinctrl-names = "default"; 71 };
64 status = "okay";
65 /* No CD or WP GPIOs */
66 };
67 72
68 usb@d0050000 { 73 usb@51000 {
69 status = "okay"; 74 status = "okay";
70 }; 75 };
71 76
72 usb@d0051000 { 77 gpio-keys {
73 status = "okay"; 78 compatible = "gpio-keys";
79 #address-cells = <1>;
80 #size-cells = <0>;
81 button@1 {
82 label = "Software Button";
83 linux,code = <116>;
84 gpios = <&gpio0 6 1>;
85 };
86 };
74 }; 87 };
75 }; 88 };
76}; 89 };
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 5b708208b607..272bbc65fab0 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -16,7 +16,7 @@
16 * 370 and Armada XP SoC. 16 * 370 and Armada XP SoC.
17 */ 17 */
18 18
19/include/ "skeleton.dtsi" 19/include/ "skeleton64.dtsi"
20 20
21/ { 21/ {
22 model = "Marvell Armada 370 and XP SoC"; 22 model = "Marvell Armada 370 and XP SoC";
@@ -28,159 +28,203 @@
28 }; 28 };
29 }; 29 };
30 30
31 mpic: interrupt-controller@d0020000 {
32 compatible = "marvell,mpic";
33 #interrupt-cells = <1>;
34 #size-cells = <1>;
35 interrupt-controller;
36 };
37
38 coherency-fabric@d0020200 {
39 compatible = "marvell,coherency-fabric";
40 reg = <0xd0020200 0xb0>,
41 <0xd0021810 0x1c>;
42 };
43
44 soc { 31 soc {
45 #address-cells = <1>; 32 #address-cells = <1>;
46 #size-cells = <1>; 33 #size-cells = <1>;
47 compatible = "simple-bus"; 34 compatible = "simple-bus";
48 interrupt-parent = <&mpic>; 35 interrupt-parent = <&mpic>;
49 ranges; 36 ranges = <0 0 0xd0000000 0x100000>;
50 37
51 serial@d0012000 { 38 internal-regs {
39 compatible = "simple-bus";
40 #address-cells = <1>;
41 #size-cells = <1>;
42 ranges;
43
44 mpic: interrupt-controller@20000 {
45 compatible = "marvell,mpic";
46 #interrupt-cells = <1>;
47 #size-cells = <1>;
48 interrupt-controller;
49 };
50
51 coherency-fabric@20200 {
52 compatible = "marvell,coherency-fabric";
53 reg = <0x20200 0xb0>, <0x21810 0x1c>;
54 };
55
56 serial@12000 {
52 compatible = "snps,dw-apb-uart"; 57 compatible = "snps,dw-apb-uart";
53 reg = <0xd0012000 0x100>; 58 reg = <0x12000 0x100>;
54 reg-shift = <2>; 59 reg-shift = <2>;
55 interrupts = <41>; 60 interrupts = <41>;
56 reg-io-width = <1>; 61 reg-io-width = <1>;
57 status = "disabled"; 62 status = "disabled";
58 }; 63 };
59 serial@d0012100 { 64 serial@12100 {
60 compatible = "snps,dw-apb-uart"; 65 compatible = "snps,dw-apb-uart";
61 reg = <0xd0012100 0x100>; 66 reg = <0x12100 0x100>;
62 reg-shift = <2>; 67 reg-shift = <2>;
63 interrupts = <42>; 68 interrupts = <42>;
64 reg-io-width = <1>; 69 reg-io-width = <1>;
65 status = "disabled"; 70 status = "disabled";
66 }; 71 };
67 72
68 timer@d0020300 { 73 timer@20300 {
69 compatible = "marvell,armada-370-xp-timer"; 74 compatible = "marvell,armada-370-xp-timer";
70 reg = <0xd0020300 0x30>, 75 reg = <0x20300 0x30>, <0x21040 0x30>;
71 <0xd0021040 0x30>; 76 interrupts = <37>, <38>, <39>, <40>, <5>, <6>;
72 interrupts = <37>, <38>, <39>, <40>, <5>, <6>; 77 clocks = <&coreclk 2>;
73 clocks = <&coreclk 2>; 78 };
74 }; 79
75 80 sata@a0000 {
76 addr-decoding@d0020000 { 81 compatible = "marvell,orion-sata";
77 compatible = "marvell,armada-addr-decoding-controller"; 82 reg = <0xa0000 0x2400>;
78 reg = <0xd0020000 0x258>; 83 interrupts = <55>;
79 }; 84 clocks = <&gateclk 15>, <&gateclk 30>;
80 85 clock-names = "0", "1";
81 sata@d00a0000 { 86 status = "disabled";
82 compatible = "marvell,orion-sata"; 87 };
83 reg = <0xd00a0000 0x2400>;
84 interrupts = <55>;
85 clocks = <&gateclk 15>, <&gateclk 30>;
86 clock-names = "0", "1";
87 status = "disabled";
88 };
89 88
90 mdio { 89 mdio {
91 #address-cells = <1>; 90 #address-cells = <1>;
92 #size-cells = <0>; 91 #size-cells = <0>;
93 compatible = "marvell,orion-mdio"; 92 compatible = "marvell,orion-mdio";
94 reg = <0xd0072004 0x4>; 93 reg = <0x72004 0x4>;
95 }; 94 };
96 95
97 ethernet@d0070000 { 96 ethernet@70000 {
98 compatible = "marvell,armada-370-neta"; 97 compatible = "marvell,armada-370-neta";
99 reg = <0xd0070000 0x2500>; 98 reg = <0x70000 0x2500>;
100 interrupts = <8>; 99 interrupts = <8>;
101 clocks = <&gateclk 4>; 100 clocks = <&gateclk 4>;
102 status = "disabled"; 101 status = "disabled";
103 }; 102 };
104 103
105 ethernet@d0074000 { 104 ethernet@74000 {
106 compatible = "marvell,armada-370-neta"; 105 compatible = "marvell,armada-370-neta";
107 reg = <0xd0074000 0x2500>; 106 reg = <0x74000 0x2500>;
108 interrupts = <10>; 107 interrupts = <10>;
109 clocks = <&gateclk 3>; 108 clocks = <&gateclk 3>;
110 status = "disabled"; 109 status = "disabled";
111 }; 110 };
112 111
113 i2c0: i2c@d0011000 { 112 i2c0: i2c@11000 {
114 compatible = "marvell,mv64xxx-i2c"; 113 compatible = "marvell,mv64xxx-i2c";
115 reg = <0xd0011000 0x20>; 114 reg = <0x11000 0x20>;
116 #address-cells = <1>; 115 #address-cells = <1>;
117 #size-cells = <0>; 116 #size-cells = <0>;
118 interrupts = <31>; 117 interrupts = <31>;
119 timeout-ms = <1000>; 118 timeout-ms = <1000>;
120 clocks = <&coreclk 0>; 119 clocks = <&coreclk 0>;
121 status = "disabled"; 120 status = "disabled";
122 }; 121 };
123 122
124 i2c1: i2c@d0011100 { 123 i2c1: i2c@11100 {
125 compatible = "marvell,mv64xxx-i2c"; 124 compatible = "marvell,mv64xxx-i2c";
126 reg = <0xd0011100 0x20>; 125 reg = <0x11100 0x20>;
127 #address-cells = <1>; 126 #address-cells = <1>;
128 #size-cells = <0>; 127 #size-cells = <0>;
129 interrupts = <32>; 128 interrupts = <32>;
130 timeout-ms = <1000>; 129 timeout-ms = <1000>;
131 clocks = <&coreclk 0>; 130 clocks = <&coreclk 0>;
132 status = "disabled"; 131 status = "disabled";
133 }; 132 };
134 133
135 rtc@10300 { 134 rtc@10300 {
136 compatible = "marvell,orion-rtc"; 135 compatible = "marvell,orion-rtc";
137 reg = <0xd0010300 0x20>; 136 reg = <0x10300 0x20>;
138 interrupts = <50>; 137 interrupts = <50>;
139 }; 138 };
140 139
141 mvsdio@d00d4000 { 140 mvsdio@d4000 {
142 compatible = "marvell,orion-sdio"; 141 compatible = "marvell,orion-sdio";
143 reg = <0xd00d4000 0x200>; 142 reg = <0xd4000 0x200>;
144 interrupts = <54>; 143 interrupts = <54>;
145 clocks = <&gateclk 17>; 144 clocks = <&gateclk 17>;
146 status = "disabled"; 145 status = "disabled";
147 }; 146 };
148
149 usb@d0050000 {
150 compatible = "marvell,orion-ehci";
151 reg = <0xd0050000 0x500>;
152 interrupts = <45>;
153 status = "disabled";
154 };
155
156 usb@d0051000 {
157 compatible = "marvell,orion-ehci";
158 reg = <0xd0051000 0x500>;
159 interrupts = <46>;
160 status = "disabled";
161 };
162 147
163 spi0: spi@d0010600 { 148 usb@50000 {
164 compatible = "marvell,orion-spi"; 149 compatible = "marvell,orion-ehci";
165 reg = <0xd0010600 0x28>; 150 reg = <0x50000 0x500>;
166 #address-cells = <1>; 151 interrupts = <45>;
167 #size-cells = <0>; 152 status = "disabled";
168 cell-index = <0>; 153 };
169 interrupts = <30>;
170 clocks = <&coreclk 0>;
171 status = "disabled";
172 };
173 154
174 spi1: spi@d0010680 { 155 usb@51000 {
175 compatible = "marvell,orion-spi"; 156 compatible = "marvell,orion-ehci";
176 reg = <0xd0010680 0x28>; 157 reg = <0x51000 0x500>;
177 #address-cells = <1>; 158 interrupts = <46>;
178 #size-cells = <0>; 159 status = "disabled";
179 cell-index = <1>; 160 };
180 interrupts = <92>; 161
181 clocks = <&coreclk 0>; 162 spi0: spi@10600 {
182 status = "disabled"; 163 compatible = "marvell,orion-spi";
164 reg = <0x10600 0x28>;
165 #address-cells = <1>;
166 #size-cells = <0>;
167 cell-index = <0>;
168 interrupts = <30>;
169 clocks = <&coreclk 0>;
170 status = "disabled";
171 };
172
173 spi1: spi@10680 {
174 compatible = "marvell,orion-spi";
175 reg = <0x10680 0x28>;
176 #address-cells = <1>;
177 #size-cells = <0>;
178 cell-index = <1>;
179 interrupts = <92>;
180 clocks = <&coreclk 0>;
181 status = "disabled";
182 };
183
184 devbus-bootcs@10400 {
185 compatible = "marvell,mvebu-devbus";
186 reg = <0x10400 0x8>;
187 #address-cells = <1>;
188 #size-cells = <1>;
189 clocks = <&coreclk 0>;
190 status = "disabled";
191 };
192
193 devbus-cs0@10408 {
194 compatible = "marvell,mvebu-devbus";
195 reg = <0x10408 0x8>;
196 #address-cells = <1>;
197 #size-cells = <1>;
198 clocks = <&coreclk 0>;
199 status = "disabled";
200 };
201
202 devbus-cs1@10410 {
203 compatible = "marvell,mvebu-devbus";
204 reg = <0x10410 0x8>;
205 #address-cells = <1>;
206 #size-cells = <1>;
207 clocks = <&coreclk 0>;
208 status = "disabled";
209 };
210
211 devbus-cs2@10418 {
212 compatible = "marvell,mvebu-devbus";
213 reg = <0x10418 0x8>;
214 #address-cells = <1>;
215 #size-cells = <1>;
216 clocks = <&coreclk 0>;
217 status = "disabled";
218 };
219
220 devbus-cs3@10420 {
221 compatible = "marvell,mvebu-devbus";
222 reg = <0x10420 0x8>;
223 #address-cells = <1>;
224 #size-cells = <1>;
225 clocks = <&coreclk 0>;
226 status = "disabled";
227 };
183 }; 228 };
184 }; 229 };
185}; 230 };
186
diff --git a/arch/arm/boot/dts/armada-370.dtsi b/arch/arm/boot/dts/armada-370.dtsi
index a195debb67d3..b2c1b5af9749 100644
--- a/arch/arm/boot/dts/armada-370.dtsi
+++ b/arch/arm/boot/dts/armada-370.dtsi
@@ -16,16 +16,11 @@
16 */ 16 */
17 17
18/include/ "armada-370-xp.dtsi" 18/include/ "armada-370-xp.dtsi"
19/include/ "skeleton.dtsi"
19 20
20/ { 21/ {
21 model = "Marvell Armada 370 family SoC"; 22 model = "Marvell Armada 370 family SoC";
22 compatible = "marvell,armada370", "marvell,armada-370-xp"; 23 compatible = "marvell,armada370", "marvell,armada-370-xp";
23 L2: l2-cache {
24 compatible = "marvell,aurora-outer-cache";
25 reg = <0xd0008000 0x1000>;
26 cache-id-part = <0x100>;
27 wt-override;
28 };
29 24
30 aliases { 25 aliases {
31 gpio0 = &gpio0; 26 gpio0 = &gpio0;
@@ -33,131 +28,198 @@
33 gpio2 = &gpio2; 28 gpio2 = &gpio2;
34 }; 29 };
35 30
36 mpic: interrupt-controller@d0020000 {
37 reg = <0xd0020a00 0x1d0>,
38 <0xd0021870 0x58>;
39 };
40
41 soc { 31 soc {
42 system-controller@d0018200 { 32 ranges = <0 0xd0000000 0x100000>;
33 internal-regs {
34 system-controller@18200 {
43 compatible = "marvell,armada-370-xp-system-controller"; 35 compatible = "marvell,armada-370-xp-system-controller";
44 reg = <0xd0018200 0x100>; 36 reg = <0x18200 0x100>;
45 };
46
47 pinctrl {
48 compatible = "marvell,mv88f6710-pinctrl";
49 reg = <0xd0018000 0x38>;
50
51 sdio_pins1: sdio-pins1 {
52 marvell,pins = "mpp9", "mpp11", "mpp12",
53 "mpp13", "mpp14", "mpp15";
54 marvell,function = "sd0";
55 }; 37 };
56 38
57 sdio_pins2: sdio-pins2 { 39 L2: l2-cache {
58 marvell,pins = "mpp47", "mpp48", "mpp49", 40 compatible = "marvell,aurora-outer-cache";
59 "mpp50", "mpp51", "mpp52"; 41 reg = <0xd0008000 0x1000>;
60 marvell,function = "sd0"; 42 cache-id-part = <0x100>;
43 wt-override;
61 }; 44 };
62 45
63 sdio_pins3: sdio-pins3 { 46 mpic: interrupt-controller@20000 {
64 marvell,pins = "mpp48", "mpp49", "mpp50", 47 reg = <0x20a00 0x1d0>, <0x21870 0x58>;
65 "mpp51", "mpp52", "mpp53";
66 marvell,function = "sd0";
67 }; 48 };
68 };
69
70 gpio0: gpio@d0018100 {
71 compatible = "marvell,orion-gpio";
72 reg = <0xd0018100 0x40>;
73 ngpios = <32>;
74 gpio-controller;
75 #gpio-cells = <2>;
76 interrupt-controller;
77 #interrupts-cells = <2>;
78 interrupts = <82>, <83>, <84>, <85>;
79 };
80 49
81 gpio1: gpio@d0018140 { 50 pinctrl {
82 compatible = "marvell,orion-gpio"; 51 compatible = "marvell,mv88f6710-pinctrl";
83 reg = <0xd0018140 0x40>; 52 reg = <0x18000 0x38>;
84 ngpios = <32>; 53
85 gpio-controller; 54 sdio_pins1: sdio-pins1 {
86 #gpio-cells = <2>; 55 marvell,pins = "mpp9", "mpp11", "mpp12",
87 interrupt-controller; 56 "mpp13", "mpp14", "mpp15";
88 #interrupts-cells = <2>; 57 marvell,function = "sd0";
89 interrupts = <87>, <88>, <89>, <90>; 58 };
90 }; 59
60 sdio_pins2: sdio-pins2 {
61 marvell,pins = "mpp47", "mpp48", "mpp49",
62 "mpp50", "mpp51", "mpp52";
63 marvell,function = "sd0";
64 };
65
66 sdio_pins3: sdio-pins3 {
67 marvell,pins = "mpp48", "mpp49", "mpp50",
68 "mpp51", "mpp52", "mpp53";
69 marvell,function = "sd0";
70 };
71 };
91 72
92 gpio2: gpio@d0018180 { 73 gpio0: gpio@18100 {
93 compatible = "marvell,orion-gpio"; 74 compatible = "marvell,orion-gpio";
94 reg = <0xd0018180 0x40>; 75 reg = <0x18100 0x40>;
95 ngpios = <2>; 76 ngpios = <32>;
96 gpio-controller; 77 gpio-controller;
97 #gpio-cells = <2>; 78 #gpio-cells = <2>;
98 interrupt-controller; 79 interrupt-controller;
99 #interrupts-cells = <2>; 80 #interrupts-cells = <2>;
100 interrupts = <91>; 81 interrupts = <82>, <83>, <84>, <85>;
101 }; 82 };
102 83
103 coreclk: mvebu-sar@d0018230 { 84 gpio1: gpio@18140 {
104 compatible = "marvell,armada-370-core-clock"; 85 compatible = "marvell,orion-gpio";
105 reg = <0xd0018230 0x08>; 86 reg = <0x18140 0x40>;
106 #clock-cells = <1>; 87 ngpios = <32>;
107 }; 88 gpio-controller;
89 #gpio-cells = <2>;
90 interrupt-controller;
91 #interrupts-cells = <2>;
92 interrupts = <87>, <88>, <89>, <90>;
93 };
108 94
109 gateclk: clock-gating-control@d0018220 { 95 gpio2: gpio@18180 {
110 compatible = "marvell,armada-370-gating-clock"; 96 compatible = "marvell,orion-gpio";
111 reg = <0xd0018220 0x4>; 97 reg = <0x18180 0x40>;
112 clocks = <&coreclk 0>; 98 ngpios = <2>;
113 #clock-cells = <1>; 99 gpio-controller;
114 }; 100 #gpio-cells = <2>;
101 interrupt-controller;
102 #interrupts-cells = <2>;
103 interrupts = <91>;
104 };
115 105
116 xor@d0060800 { 106 coreclk: mvebu-sar@18230 {
117 compatible = "marvell,orion-xor"; 107 compatible = "marvell,armada-370-core-clock";
118 reg = <0xd0060800 0x100 108 reg = <0x18230 0x08>;
119 0xd0060A00 0x100>; 109 #clock-cells = <1>;
120 status = "okay"; 110 };
121 111
122 xor00 { 112 gateclk: clock-gating-control@18220 {
123 interrupts = <51>; 113 compatible = "marvell,armada-370-gating-clock";
124 dmacap,memcpy; 114 reg = <0x18220 0x4>;
125 dmacap,xor; 115 clocks = <&coreclk 0>;
116 #clock-cells = <1>;
126 }; 117 };
127 xor01 { 118
128 interrupts = <52>; 119 xor@60800 {
129 dmacap,memcpy; 120 compatible = "marvell,orion-xor";
130 dmacap,xor; 121 reg = <0x60800 0x100
131 dmacap,memset; 122 0x60A00 0x100>;
123 status = "okay";
124
125 xor00 {
126 interrupts = <51>;
127 dmacap,memcpy;
128 dmacap,xor;
129 };
130 xor01 {
131 interrupts = <52>;
132 dmacap,memcpy;
133 dmacap,xor;
134 dmacap,memset;
135 };
132 }; 136 };
133 };
134 137
135 xor@d0060900 { 138 xor@60900 {
136 compatible = "marvell,orion-xor"; 139 compatible = "marvell,orion-xor";
137 reg = <0xd0060900 0x100 140 reg = <0x60900 0x100
138 0xd0060b00 0x100>; 141 0x60b00 0x100>;
139 status = "okay"; 142 status = "okay";
143
144 xor10 {
145 interrupts = <94>;
146 dmacap,memcpy;
147 dmacap,xor;
148 };
149 xor11 {
150 interrupts = <95>;
151 dmacap,memcpy;
152 dmacap,xor;
153 dmacap,memset;
154 };
155 };
140 156
141 xor10 { 157 usb@50000 {
142 interrupts = <94>; 158 clocks = <&coreclk 0>;
143 dmacap,memcpy;
144 dmacap,xor;
145 }; 159 };
146 xor11 { 160
147 interrupts = <95>; 161 usb@51000 {
148 dmacap,memcpy; 162 clocks = <&coreclk 0>;
149 dmacap,xor;
150 dmacap,memset;
151 }; 163 };
152 };
153 164
154 usb@d0050000 { 165 thermal@18300 {
155 clocks = <&coreclk 0>; 166 compatible = "marvell,armada370-thermal";
156 }; 167 reg = <0x18300 0x4
168 0x18304 0x4>;
169 status = "okay";
170 };
157 171
158 usb@d0051000 { 172 pcie-controller {
159 clocks = <&coreclk 0>; 173 compatible = "marvell,armada-370-pcie";
174 status = "disabled";
175 device_type = "pci";
176
177 #address-cells = <3>;
178 #size-cells = <2>;
179
180 bus-range = <0x00 0xff>;
181
182 reg = <0x40000 0x2000>, <0x80000 0x2000>;
183
184 reg-names = "pcie0.0", "pcie1.0";
185
186 ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000 /* Port 0.0 registers */
187 0x82000000 0 0x80000 0x80000 0 0x00002000 /* Port 1.0 registers */
188 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
189 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
190
191 pcie@1,0 {
192 device_type = "pci";
193 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
194 reg = <0x0800 0 0 0 0>;
195 #address-cells = <3>;
196 #size-cells = <2>;
197 #interrupt-cells = <1>;
198 ranges;
199 interrupt-map-mask = <0 0 0 0>;
200 interrupt-map = <0 0 0 0 &mpic 58>;
201 marvell,pcie-port = <0>;
202 marvell,pcie-lane = <0>;
203 clocks = <&gateclk 5>;
204 status = "disabled";
205 };
206
207 pcie@2,0 {
208 device_type = "pci";
209 assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
210 reg = <0x1000 0 0 0 0>;
211 #address-cells = <3>;
212 #size-cells = <2>;
213 #interrupt-cells = <1>;
214 ranges;
215 interrupt-map-mask = <0 0 0 0>;
216 interrupt-map = <0 0 0 0 &mpic 62>;
217 marvell,pcie-port = <1>;
218 marvell,pcie-lane = <0>;
219 clocks = <&gateclk 9>;
220 status = "disabled";
221 };
222 };
160 }; 223 };
161
162 }; 224 };
163}; 225};
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index e83505e4c236..d6cc8bf8272e 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -26,99 +26,134 @@
26 26
27 memory { 27 memory {
28 device_type = "memory"; 28 device_type = "memory";
29 reg = <0x00000000 0x80000000>; /* 2 GB */ 29 reg = <0 0x00000000 0 0x80000000>; /* 2 GB */
30 }; 30 };
31 31
32 soc { 32 soc {
33 serial@d0012000 { 33 internal-regs {
34 clock-frequency = <250000000>; 34 serial@12000 {
35 status = "okay"; 35 clock-frequency = <250000000>;
36 }; 36 status = "okay";
37 serial@d0012100 { 37 };
38 clock-frequency = <250000000>; 38 serial@12100 {
39 status = "okay"; 39 clock-frequency = <250000000>;
40 }; 40 status = "okay";
41 serial@d0012200 { 41 };
42 clock-frequency = <250000000>; 42 serial@12200 {
43 status = "okay"; 43 clock-frequency = <250000000>;
44 }; 44 status = "okay";
45 serial@d0012300 { 45 };
46 clock-frequency = <250000000>; 46 serial@12300 {
47 status = "okay"; 47 clock-frequency = <250000000>;
48 }; 48 status = "okay";
49
50 sata@d00a0000 {
51 nr-ports = <2>;
52 status = "okay";
53 };
54
55 mdio {
56 phy0: ethernet-phy@0 {
57 reg = <0>;
58 }; 49 };
59 50
60 phy1: ethernet-phy@1 { 51 sata@a0000 {
61 reg = <1>; 52 nr-ports = <2>;
53 status = "okay";
62 }; 54 };
63 55
64 phy2: ethernet-phy@2 { 56 mdio {
65 reg = <25>; 57 phy0: ethernet-phy@0 {
58 reg = <0>;
59 };
60
61 phy1: ethernet-phy@1 {
62 reg = <1>;
63 };
64
65 phy2: ethernet-phy@2 {
66 reg = <25>;
67 };
68
69 phy3: ethernet-phy@3 {
70 reg = <27>;
71 };
66 }; 72 };
67 73
68 phy3: ethernet-phy@3 { 74 ethernet@70000 {
69 reg = <27>; 75 status = "okay";
76 phy = <&phy0>;
77 phy-mode = "rgmii-id";
78 };
79 ethernet@74000 {
80 status = "okay";
81 phy = <&phy1>;
82 phy-mode = "rgmii-id";
83 };
84 ethernet@30000 {
85 status = "okay";
86 phy = <&phy2>;
87 phy-mode = "sgmii";
88 };
89 ethernet@34000 {
90 status = "okay";
91 phy = <&phy3>;
92 phy-mode = "sgmii";
70 }; 93 };
71 };
72 94
73 ethernet@d0070000 { 95 mvsdio@d4000 {
74 status = "okay"; 96 pinctrl-0 = <&sdio_pins>;
75 phy = <&phy0>; 97 pinctrl-names = "default";
76 phy-mode = "rgmii-id"; 98 status = "okay";
77 }; 99 /* No CD or WP GPIOs */
78 ethernet@d0074000 { 100 };
79 status = "okay";
80 phy = <&phy1>;
81 phy-mode = "rgmii-id";
82 };
83 ethernet@d0030000 {
84 status = "okay";
85 phy = <&phy2>;
86 phy-mode = "sgmii";
87 };
88 ethernet@d0034000 {
89 status = "okay";
90 phy = <&phy3>;
91 phy-mode = "sgmii";
92 };
93 101
94 mvsdio@d00d4000 { 102 usb@50000 {
95 pinctrl-0 = <&sdio_pins>; 103 status = "okay";
96 pinctrl-names = "default"; 104 };
97 status = "okay";
98 /* No CD or WP GPIOs */
99 };
100 105
101 usb@d0050000 { 106 usb@51000 {
102 status = "okay"; 107 status = "okay";
103 }; 108 };
104 109
105 usb@d0051000 { 110 usb@52000 {
106 status = "okay"; 111 status = "okay";
107 }; 112 };
108 113
109 usb@d0052000 { 114 spi0: spi@10600 {
110 status = "okay"; 115 status = "okay";
111 };
112 116
113 spi0: spi@d0010600 { 117 spi-flash@0 {
114 status = "okay"; 118 #address-cells = <1>;
119 #size-cells = <1>;
120 compatible = "m25p64";
121 reg = <0>; /* Chip select 0 */
122 spi-max-frequency = <20000000>;
123 };
124 };
115 125
116 spi-flash@0 { 126 pcie-controller {
117 #address-cells = <1>; 127 status = "okay";
118 #size-cells = <1>; 128
119 compatible = "m25p64"; 129 /*
120 reg = <0>; /* Chip select 0 */ 130 * All 6 slots are physically present as
121 spi-max-frequency = <20000000>; 131 * standard PCIe slots on the board.
132 */
133 pcie@1,0 {
134 /* Port 0, Lane 0 */
135 status = "okay";
136 };
137 pcie@2,0 {
138 /* Port 0, Lane 1 */
139 status = "okay";
140 };
141 pcie@3,0 {
142 /* Port 0, Lane 2 */
143 status = "okay";
144 };
145 pcie@4,0 {
146 /* Port 0, Lane 3 */
147 status = "okay";
148 };
149 pcie@9,0 {
150 /* Port 2, Lane 0 */
151 status = "okay";
152 };
153 pcie@10,0 {
154 /* Port 3, Lane 0 */
155 status = "okay";
156 };
122 }; 157 };
123 }; 158 };
124 }; 159 };
diff --git a/arch/arm/boot/dts/armada-xp-gp.dts b/arch/arm/boot/dts/armada-xp-gp.dts
index 1c8afe2ffebc..26ad06fc147e 100644
--- a/arch/arm/boot/dts/armada-xp-gp.dts
+++ b/arch/arm/boot/dts/armada-xp-gp.dts
@@ -26,87 +26,141 @@
26 26
27 memory { 27 memory {
28 device_type = "memory"; 28 device_type = "memory";
29
30 /* 29 /*
31 * 4 GB of plug-in RAM modules by default but only 3GB 30 * 8 GB of plug-in RAM modules by default.The amount
32 * are visible, the amount of memory available can be 31 * of memory available can be changed by the
33 * changed by the bootloader according the size of the 32 * bootloader according the size of the module
34 * module actually plugged 33 * actually plugged. Only 7GB are usable because
34 * addresses from 0xC0000000 to 0xffffffff are used by
35 * the internal registers of the SoC.
35 */ 36 */
36 reg = <0x00000000 0xC0000000>; 37 reg = <0x00000000 0x00000000 0x00000000 0xC0000000>,
38 <0x00000001 0x00000000 0x00000001 0x00000000>;
37 }; 39 };
38 40
39 soc { 41 soc {
40 serial@d0012000 { 42 internal-regs {
41 clock-frequency = <250000000>; 43 serial@12000 {
42 status = "okay"; 44 clock-frequency = <250000000>;
43 }; 45 status = "okay";
44 serial@d0012100 { 46 };
45 clock-frequency = <250000000>; 47 serial@12100 {
46 status = "okay"; 48 clock-frequency = <250000000>;
47 }; 49 status = "okay";
48 serial@d0012200 { 50 };
49 clock-frequency = <250000000>; 51 serial@12200 {
50 status = "okay"; 52 clock-frequency = <250000000>;
51 }; 53 status = "okay";
52 serial@d0012300 { 54 };
53 clock-frequency = <250000000>; 55 serial@12300 {
54 status = "okay"; 56 clock-frequency = <250000000>;
55 }; 57 status = "okay";
56 58 };
57 sata@d00a0000 {
58 nr-ports = <2>;
59 status = "okay";
60 };
61 59
62 mdio { 60 sata@a0000 {
63 phy0: ethernet-phy@0 { 61 nr-ports = <2>;
64 reg = <16>; 62 status = "okay";
65 }; 63 };
66 64
67 phy1: ethernet-phy@1 { 65 mdio {
68 reg = <17>; 66 phy0: ethernet-phy@0 {
67 reg = <16>;
68 };
69
70 phy1: ethernet-phy@1 {
71 reg = <17>;
72 };
73
74 phy2: ethernet-phy@2 {
75 reg = <18>;
76 };
77
78 phy3: ethernet-phy@3 {
79 reg = <19>;
80 };
69 }; 81 };
70 82
71 phy2: ethernet-phy@2 { 83 ethernet@70000 {
72 reg = <18>; 84 status = "okay";
85 phy = <&phy0>;
86 phy-mode = "rgmii-id";
73 }; 87 };
88 ethernet@74000 {
89 status = "okay";
90 phy = <&phy1>;
91 phy-mode = "rgmii-id";
92 };
93 ethernet@30000 {
94 status = "okay";
95 phy = <&phy2>;
96 phy-mode = "rgmii-id";
97 };
98 ethernet@34000 {
99 status = "okay";
100 phy = <&phy3>;
101 phy-mode = "rgmii-id";
102 };
103
104 spi0: spi@10600 {
105 status = "okay";
74 106
75 phy3: ethernet-phy@3 { 107 spi-flash@0 {
76 reg = <19>; 108 #address-cells = <1>;
109 #size-cells = <1>;
110 compatible = "n25q128a13";
111 reg = <0>; /* Chip select 0 */
112 spi-max-frequency = <108000000>;
113 };
77 }; 114 };
78 };
79 115
80 ethernet@d0070000 { 116 devbus-bootcs@10400 {
81 status = "okay"; 117 status = "okay";
82 phy = <&phy0>; 118 ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf000000, size 0x1000000 */
83 phy-mode = "rgmii-id"; 119
84 }; 120 /* Device Bus parameters are required */
85 ethernet@d0074000 { 121
86 status = "okay"; 122 /* Read parameters */
87 phy = <&phy1>; 123 devbus,bus-width = <8>;
88 phy-mode = "rgmii-id"; 124 devbus,turn-off-ps = <60000>;
89 }; 125 devbus,badr-skew-ps = <0>;
90 ethernet@d0030000 { 126 devbus,acc-first-ps = <124000>;
91 status = "okay"; 127 devbus,acc-next-ps = <248000>;
92 phy = <&phy2>; 128 devbus,rd-setup-ps = <0>;
93 phy-mode = "rgmii-id"; 129 devbus,rd-hold-ps = <0>;
94 }; 130
95 ethernet@d0034000 { 131 /* Write parameters */
96 status = "okay"; 132 devbus,sync-enable = <0>;
97 phy = <&phy3>; 133 devbus,wr-high-ps = <60000>;
98 phy-mode = "rgmii-id"; 134 devbus,wr-low-ps = <60000>;
99 }; 135 devbus,ale-wr-ps = <60000>;
136
137 /* NOR 16 MiB */
138 nor@0 {
139 compatible = "cfi-flash";
140 reg = <0 0x1000000>;
141 bank-width = <2>;
142 };
143 };
100 144
101 spi0: spi@d0010600 { 145 pcie-controller {
102 status = "okay"; 146 status = "okay";
103 147
104 spi-flash@0 { 148 /*
105 #address-cells = <1>; 149 * The 3 slots are physically present as
106 #size-cells = <1>; 150 * standard PCIe slots on the board.
107 compatible = "n25q128a13"; 151 */
108 reg = <0>; /* Chip select 0 */ 152 pcie@1,0 {
109 spi-max-frequency = <108000000>; 153 /* Port 0, Lane 0 */
154 status = "okay";
155 };
156 pcie@9,0 {
157 /* Port 2, Lane 0 */
158 status = "okay";
159 };
160 pcie@10,0 {
161 /* Port 3, Lane 0 */
162 status = "okay";
163 };
110 }; 164 };
111 }; 165 };
112 }; 166 };
diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
index f56c40599f5b..f8eaa383e07f 100644
--- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
@@ -25,56 +25,162 @@
25 }; 25 };
26 26
27 cpus { 27 cpus {
28 #address-cells = <1>; 28 #address-cells = <1>;
29 #size-cells = <0>; 29 #size-cells = <0>;
30 30
31 cpu@0 { 31 cpu@0 {
32 device_type = "cpu"; 32 device_type = "cpu";
33 compatible = "marvell,sheeva-v7"; 33 compatible = "marvell,sheeva-v7";
34 reg = <0>; 34 reg = <0>;
35 clocks = <&cpuclk 0>; 35 clocks = <&cpuclk 0>;
36 }; 36 };
37 37
38 cpu@1 { 38 cpu@1 {
39 device_type = "cpu"; 39 device_type = "cpu";
40 compatible = "marvell,sheeva-v7"; 40 compatible = "marvell,sheeva-v7";
41 reg = <1>; 41 reg = <1>;
42 clocks = <&cpuclk 1>; 42 clocks = <&cpuclk 1>;
43 }; 43 };
44 }; 44 };
45 45
46 soc { 46 soc {
47 pinctrl { 47 internal-regs {
48 compatible = "marvell,mv78230-pinctrl"; 48 pinctrl {
49 reg = <0xd0018000 0x38>; 49 compatible = "marvell,mv78230-pinctrl";
50 50 reg = <0x18000 0x38>;
51 sdio_pins: sdio-pins { 51
52 marvell,pins = "mpp30", "mpp31", "mpp32", 52 sdio_pins: sdio-pins {
53 "mpp33", "mpp34", "mpp35"; 53 marvell,pins = "mpp30", "mpp31", "mpp32",
54 marvell,function = "sd0"; 54 "mpp33", "mpp34", "mpp35";
55 marvell,function = "sd0";
56 };
55 }; 57 };
56 };
57 58
58 gpio0: gpio@d0018100 { 59 gpio0: gpio@18100 {
59 compatible = "marvell,orion-gpio"; 60 compatible = "marvell,orion-gpio";
60 reg = <0xd0018100 0x40>; 61 reg = <0x18100 0x40>;
61 ngpios = <32>; 62 ngpios = <32>;
62 gpio-controller; 63 gpio-controller;
63 #gpio-cells = <2>; 64 #gpio-cells = <2>;
64 interrupt-controller; 65 interrupt-controller;
65 #interrupts-cells = <2>; 66 #interrupts-cells = <2>;
66 interrupts = <82>, <83>, <84>, <85>; 67 interrupts = <82>, <83>, <84>, <85>;
67 }; 68 };
69
70 gpio1: gpio@18140 {
71 compatible = "marvell,orion-gpio";
72 reg = <0x18140 0x40>;
73 ngpios = <17>;
74 gpio-controller;
75 #gpio-cells = <2>;
76 interrupt-controller;
77 #interrupts-cells = <2>;
78 interrupts = <87>, <88>, <89>;
79 };
68 80
69 gpio1: gpio@d0018140 { 81 /*
70 compatible = "marvell,orion-gpio"; 82 * MV78230 has 2 PCIe units Gen2.0: One unit can be
71 reg = <0xd0018140 0x40>; 83 * configured as x4 or quad x1 lanes. One unit is
72 ngpios = <17>; 84 * x4/x1.
73 gpio-controller; 85 */
74 #gpio-cells = <2>; 86 pcie-controller {
75 interrupt-controller; 87 compatible = "marvell,armada-xp-pcie";
76 #interrupts-cells = <2>; 88 status = "disabled";
77 interrupts = <87>, <88>, <89>; 89 device_type = "pci";
90
91#address-cells = <3>;
92#size-cells = <2>;
93
94 bus-range = <0x00 0xff>;
95
96 ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000 /* Port 0.0 registers */
97 0x82000000 0 0x42000 0x42000 0 0x00002000 /* Port 2.0 registers */
98 0x82000000 0 0x44000 0x44000 0 0x00002000 /* Port 0.1 registers */
99 0x82000000 0 0x48000 0x48000 0 0x00002000 /* Port 0.2 registers */
100 0x82000000 0 0x4c000 0x4c000 0 0x00002000 /* Port 0.3 registers */
101 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
102 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
103
104 pcie@1,0 {
105 device_type = "pci";
106 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
107 reg = <0x0800 0 0 0 0>;
108 #address-cells = <3>;
109 #size-cells = <2>;
110 #interrupt-cells = <1>;
111 ranges;
112 interrupt-map-mask = <0 0 0 0>;
113 interrupt-map = <0 0 0 0 &mpic 58>;
114 marvell,pcie-port = <0>;
115 marvell,pcie-lane = <0>;
116 clocks = <&gateclk 5>;
117 status = "disabled";
118 };
119
120 pcie@2,0 {
121 device_type = "pci";
122 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
123 reg = <0x1000 0 0 0 0>;
124 #address-cells = <3>;
125 #size-cells = <2>;
126 #interrupt-cells = <1>;
127 ranges;
128 interrupt-map-mask = <0 0 0 0>;
129 interrupt-map = <0 0 0 0 &mpic 59>;
130 marvell,pcie-port = <0>;
131 marvell,pcie-lane = <1>;
132 clocks = <&gateclk 6>;
133 status = "disabled";
134 };
135
136 pcie@3,0 {
137 device_type = "pci";
138 assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
139 reg = <0x1800 0 0 0 0>;
140 #address-cells = <3>;
141 #size-cells = <2>;
142 #interrupt-cells = <1>;
143 ranges;
144 interrupt-map-mask = <0 0 0 0>;
145 interrupt-map = <0 0 0 0 &mpic 60>;
146 marvell,pcie-port = <0>;
147 marvell,pcie-lane = <2>;
148 clocks = <&gateclk 7>;
149 status = "disabled";
150 };
151
152 pcie@4,0 {
153 device_type = "pci";
154 assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
155 reg = <0x2000 0 0 0 0>;
156 #address-cells = <3>;
157 #size-cells = <2>;
158 #interrupt-cells = <1>;
159 ranges;
160 interrupt-map-mask = <0 0 0 0>;
161 interrupt-map = <0 0 0 0 &mpic 61>;
162 marvell,pcie-port = <0>;
163 marvell,pcie-lane = <3>;
164 clocks = <&gateclk 8>;
165 status = "disabled";
166 };
167
168 pcie@9,0 {
169 device_type = "pci";
170 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
171 reg = <0x4800 0 0 0 0>;
172 #address-cells = <3>;
173 #size-cells = <2>;
174 #interrupt-cells = <1>;
175 ranges;
176 interrupt-map-mask = <0 0 0 0>;
177 interrupt-map = <0 0 0 0 &mpic 99>;
178 marvell,pcie-port = <2>;
179 marvell,pcie-lane = <0>;
180 clocks = <&gateclk 26>;
181 status = "disabled";
182 };
183 };
78 }; 184 };
79 }; 185 };
80}; 186};
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
index f8f2b787d2b0..f4029f015aff 100644
--- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
@@ -26,75 +26,199 @@
26 }; 26 };
27 27
28 cpus { 28 cpus {
29 #address-cells = <1>; 29 #address-cells = <1>;
30 #size-cells = <0>; 30 #size-cells = <0>;
31 31
32 cpu@0 { 32 cpu@0 {
33 device_type = "cpu"; 33 device_type = "cpu";
34 compatible = "marvell,sheeva-v7"; 34 compatible = "marvell,sheeva-v7";
35 reg = <0>; 35 reg = <0>;
36 clocks = <&cpuclk 0>; 36 clocks = <&cpuclk 0>;
37 }; 37 };
38 38
39 cpu@1 { 39 cpu@1 {
40 device_type = "cpu"; 40 device_type = "cpu";
41 compatible = "marvell,sheeva-v7"; 41 compatible = "marvell,sheeva-v7";
42 reg = <1>; 42 reg = <1>;
43 clocks = <&cpuclk 1>; 43 clocks = <&cpuclk 1>;
44 }; 44 };
45 }; 45 };
46 46
47 soc { 47 soc {
48 pinctrl { 48 internal-regs {
49 compatible = "marvell,mv78260-pinctrl"; 49 pinctrl {
50 reg = <0xd0018000 0x38>; 50 compatible = "marvell,mv78260-pinctrl";
51 51 reg = <0x18000 0x38>;
52 sdio_pins: sdio-pins { 52
53 marvell,pins = "mpp30", "mpp31", "mpp32", 53 sdio_pins: sdio-pins {
54 "mpp33", "mpp34", "mpp35"; 54 marvell,pins = "mpp30", "mpp31", "mpp32",
55 marvell,function = "sd0"; 55 "mpp33", "mpp34", "mpp35";
56 marvell,function = "sd0";
57 };
56 }; 58 };
57 };
58 59
59 gpio0: gpio@d0018100 { 60 gpio0: gpio@18100 {
60 compatible = "marvell,orion-gpio"; 61 compatible = "marvell,orion-gpio";
61 reg = <0xd0018100 0x40>; 62 reg = <0x18100 0x40>;
62 ngpios = <32>; 63 ngpios = <32>;
63 gpio-controller; 64 gpio-controller;
64 #gpio-cells = <2>; 65 #gpio-cells = <2>;
65 interrupt-controller; 66 interrupt-controller;
66 #interrupts-cells = <2>; 67 #interrupts-cells = <2>;
67 interrupts = <82>, <83>, <84>, <85>; 68 interrupts = <82>, <83>, <84>, <85>;
68 }; 69 };
69 70
70 gpio1: gpio@d0018140 { 71 gpio1: gpio@18140 {
71 compatible = "marvell,orion-gpio"; 72 compatible = "marvell,orion-gpio";
72 reg = <0xd0018140 0x40>; 73 reg = <0x18140 0x40>;
73 ngpios = <32>; 74 ngpios = <32>;
74 gpio-controller; 75 gpio-controller;
75 #gpio-cells = <2>; 76 #gpio-cells = <2>;
76 interrupt-controller; 77 interrupt-controller;
77 #interrupts-cells = <2>; 78 #interrupts-cells = <2>;
78 interrupts = <87>, <88>, <89>, <90>; 79 interrupts = <87>, <88>, <89>, <90>;
79 }; 80 };
80 81
81 gpio2: gpio@d0018180 { 82 gpio2: gpio@18180 {
82 compatible = "marvell,orion-gpio"; 83 compatible = "marvell,orion-gpio";
83 reg = <0xd0018180 0x40>; 84 reg = <0x18180 0x40>;
84 ngpios = <3>; 85 ngpios = <3>;
85 gpio-controller; 86 gpio-controller;
86 #gpio-cells = <2>; 87 #gpio-cells = <2>;
87 interrupt-controller; 88 interrupt-controller;
88 #interrupts-cells = <2>; 89 #interrupts-cells = <2>;
89 interrupts = <91>; 90 interrupts = <91>;
90 }; 91 };
91 92
92 ethernet@d0034000 { 93 ethernet@34000 {
93 compatible = "marvell,armada-370-neta"; 94 compatible = "marvell,armada-370-neta";
94 reg = <0xd0034000 0x2500>; 95 reg = <0x34000 0x2500>;
95 interrupts = <14>; 96 interrupts = <14>;
96 clocks = <&gateclk 1>; 97 clocks = <&gateclk 1>;
97 status = "disabled"; 98 status = "disabled";
99 };
100
101 /*
102 * MV78260 has 3 PCIe units Gen2.0: Two units can be
103 * configured as x4 or quad x1 lanes. One unit is
104 * x4/x1.
105 */
106 pcie-controller {
107 compatible = "marvell,armada-xp-pcie";
108 status = "disabled";
109 device_type = "pci";
110
111 #address-cells = <3>;
112 #size-cells = <2>;
113
114 bus-range = <0x00 0xff>;
115
116 ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000 /* Port 0.0 registers */
117 0x82000000 0 0x42000 0x42000 0 0x00002000 /* Port 2.0 registers */
118 0x82000000 0 0x44000 0x44000 0 0x00002000 /* Port 0.1 registers */
119 0x82000000 0 0x48000 0x48000 0 0x00002000 /* Port 0.2 registers */
120 0x82000000 0 0x4c000 0x4c000 0 0x00002000 /* Port 0.3 registers */
121 0x82000000 0 0x80000 0x80000 0 0x00002000 /* Port 1.0 registers */
122 0x82000000 0 0x82000 0x82000 0 0x00002000 /* Port 3.0 registers */
123 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
124 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
125
126 pcie@1,0 {
127 device_type = "pci";
128 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
129 reg = <0x0800 0 0 0 0>;
130 #address-cells = <3>;
131 #size-cells = <2>;
132 #interrupt-cells = <1>;
133 ranges;
134 interrupt-map-mask = <0 0 0 0>;
135 interrupt-map = <0 0 0 0 &mpic 58>;
136 marvell,pcie-port = <0>;
137 marvell,pcie-lane = <0>;
138 clocks = <&gateclk 5>;
139 status = "disabled";
140 };
141
142 pcie@2,0 {
143 device_type = "pci";
144 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
145 reg = <0x1000 0 0 0 0>;
146 #address-cells = <3>;
147 #size-cells = <2>;
148 #interrupt-cells = <1>;
149 ranges;
150 interrupt-map-mask = <0 0 0 0>;
151 interrupt-map = <0 0 0 0 &mpic 59>;
152 marvell,pcie-port = <0>;
153 marvell,pcie-lane = <1>;
154 clocks = <&gateclk 6>;
155 status = "disabled";
156 };
157
158 pcie@3,0 {
159 device_type = "pci";
160 assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
161 reg = <0x1800 0 0 0 0>;
162 #address-cells = <3>;
163 #size-cells = <2>;
164 #interrupt-cells = <1>;
165 ranges;
166 interrupt-map-mask = <0 0 0 0>;
167 interrupt-map = <0 0 0 0 &mpic 60>;
168 marvell,pcie-port = <0>;
169 marvell,pcie-lane = <2>;
170 clocks = <&gateclk 7>;
171 status = "disabled";
172 };
173
174 pcie@4,0 {
175 device_type = "pci";
176 assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
177 reg = <0x2000 0 0 0 0>;
178 #address-cells = <3>;
179 #size-cells = <2>;
180 #interrupt-cells = <1>;
181 ranges;
182 interrupt-map-mask = <0 0 0 0>;
183 interrupt-map = <0 0 0 0 &mpic 61>;
184 marvell,pcie-port = <0>;
185 marvell,pcie-lane = <3>;
186 clocks = <&gateclk 8>;
187 status = "disabled";
188 };
189
190 pcie@9,0 {
191 device_type = "pci";
192 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
193 reg = <0x4800 0 0 0 0>;
194 #address-cells = <3>;
195 #size-cells = <2>;
196 #interrupt-cells = <1>;
197 ranges;
198 interrupt-map-mask = <0 0 0 0>;
199 interrupt-map = <0 0 0 0 &mpic 99>;
200 marvell,pcie-port = <2>;
201 marvell,pcie-lane = <0>;
202 clocks = <&gateclk 26>;
203 status = "disabled";
204 };
205
206 pcie@10,0 {
207 device_type = "pci";
208 assigned-addresses = <0x82000800 0 0x82000 0 0x2000>;
209 reg = <0x5000 0 0 0 0>;
210 #address-cells = <3>;
211 #size-cells = <2>;
212 #interrupt-cells = <1>;
213 ranges;
214 interrupt-map-mask = <0 0 0 0>;
215 interrupt-map = <0 0 0 0 &mpic 103>;
216 marvell,pcie-port = <3>;
217 marvell,pcie-lane = <0>;
218 clocks = <&gateclk 27>;
219 status = "disabled";
220 };
221 };
98 }; 222 };
99 }; 223 };
100}; 224};
diff --git a/arch/arm/boot/dts/armada-xp-mv78460.dtsi b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
index 936c25dc32b0..6ab56bd35de9 100644
--- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
@@ -27,89 +27,279 @@
27 27
28 28
29 cpus { 29 cpus {
30 #address-cells = <1>; 30 #address-cells = <1>;
31 #size-cells = <0>; 31 #size-cells = <0>;
32
33 cpu@0 {
34 device_type = "cpu";
35 compatible = "marvell,sheeva-v7";
36 reg = <0>;
37 clocks = <&cpuclk 0>;
38 };
39
40 cpu@1 {
41 device_type = "cpu";
42 compatible = "marvell,sheeva-v7";
43 reg = <1>;
44 clocks = <&cpuclk 1>;
45 };
46
47 cpu@2 {
48 device_type = "cpu";
49 compatible = "marvell,sheeva-v7";
50 reg = <2>;
51 clocks = <&cpuclk 2>;
52 };
53
54 cpu@3 {
55 device_type = "cpu";
56 compatible = "marvell,sheeva-v7";
57 reg = <3>;
58 clocks = <&cpuclk 3>;
59 };
60 };
61 32
62 soc { 33 cpu@0 {
63 pinctrl { 34 device_type = "cpu";
64 compatible = "marvell,mv78460-pinctrl"; 35 compatible = "marvell,sheeva-v7";
65 reg = <0xd0018000 0x38>; 36 reg = <0>;
66 37 clocks = <&cpuclk 0>;
67 sdio_pins: sdio-pins {
68 marvell,pins = "mpp30", "mpp31", "mpp32",
69 "mpp33", "mpp34", "mpp35";
70 marvell,function = "sd0";
71 };
72 }; 38 };
73 39
74 gpio0: gpio@d0018100 { 40 cpu@1 {
75 compatible = "marvell,orion-gpio"; 41 device_type = "cpu";
76 reg = <0xd0018100 0x40>; 42 compatible = "marvell,sheeva-v7";
77 ngpios = <32>; 43 reg = <1>;
78 gpio-controller; 44 clocks = <&cpuclk 1>;
79 #gpio-cells = <2>;
80 interrupt-controller;
81 #interrupts-cells = <2>;
82 interrupts = <82>, <83>, <84>, <85>;
83 }; 45 };
84 46
85 gpio1: gpio@d0018140 { 47 cpu@2 {
86 compatible = "marvell,orion-gpio"; 48 device_type = "cpu";
87 reg = <0xd0018140 0x40>; 49 compatible = "marvell,sheeva-v7";
88 ngpios = <32>; 50 reg = <2>;
89 gpio-controller; 51 clocks = <&cpuclk 2>;
90 #gpio-cells = <2>;
91 interrupt-controller;
92 #interrupts-cells = <2>;
93 interrupts = <87>, <88>, <89>, <90>;
94 }; 52 };
95 53
96 gpio2: gpio@d0018180 { 54 cpu@3 {
97 compatible = "marvell,orion-gpio"; 55 device_type = "cpu";
98 reg = <0xd0018180 0x40>; 56 compatible = "marvell,sheeva-v7";
99 ngpios = <3>; 57 reg = <3>;
100 gpio-controller; 58 clocks = <&cpuclk 3>;
101 #gpio-cells = <2>;
102 interrupt-controller;
103 #interrupts-cells = <2>;
104 interrupts = <91>;
105 }; 59 };
60 };
61
62 soc {
63 internal-regs {
64 pinctrl {
65 compatible = "marvell,mv78460-pinctrl";
66 reg = <0x18000 0x38>;
67
68 sdio_pins: sdio-pins {
69 marvell,pins = "mpp30", "mpp31", "mpp32",
70 "mpp33", "mpp34", "mpp35";
71 marvell,function = "sd0";
72 };
73 };
106 74
107 ethernet@d0034000 { 75 gpio0: gpio@18100 {
76 compatible = "marvell,orion-gpio";
77 reg = <0x18100 0x40>;
78 ngpios = <32>;
79 gpio-controller;
80 #gpio-cells = <2>;
81 interrupt-controller;
82 #interrupts-cells = <2>;
83 interrupts = <82>, <83>, <84>, <85>;
84 };
85
86 gpio1: gpio@18140 {
87 compatible = "marvell,orion-gpio";
88 reg = <0x18140 0x40>;
89 ngpios = <32>;
90 gpio-controller;
91 #gpio-cells = <2>;
92 interrupt-controller;
93 #interrupts-cells = <2>;
94 interrupts = <87>, <88>, <89>, <90>;
95 };
96
97 gpio2: gpio@18180 {
98 compatible = "marvell,orion-gpio";
99 reg = <0x18180 0x40>;
100 ngpios = <3>;
101 gpio-controller;
102 #gpio-cells = <2>;
103 interrupt-controller;
104 #interrupts-cells = <2>;
105 interrupts = <91>;
106 };
107
108 ethernet@34000 {
108 compatible = "marvell,armada-370-neta"; 109 compatible = "marvell,armada-370-neta";
109 reg = <0xd0034000 0x2500>; 110 reg = <0x34000 0x2500>;
110 interrupts = <14>; 111 interrupts = <14>;
111 clocks = <&gateclk 1>; 112 clocks = <&gateclk 1>;
112 status = "disabled"; 113 status = "disabled";
114 };
115
116 /*
117 * MV78460 has 4 PCIe units Gen2.0: Two units can be
118 * configured as x4 or quad x1 lanes. Two units are
119 * x4/x1.
120 */
121 pcie-controller {
122 compatible = "marvell,armada-xp-pcie";
123 status = "disabled";
124 device_type = "pci";
125
126 #address-cells = <3>;
127 #size-cells = <2>;
128
129 bus-range = <0x00 0xff>;
130
131 ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000 /* Port 0.0 registers */
132 0x82000000 0 0x42000 0x42000 0 0x00002000 /* Port 2.0 registers */
133 0x82000000 0 0x44000 0x44000 0 0x00002000 /* Port 0.1 registers */
134 0x82000000 0 0x48000 0x48000 0 0x00002000 /* Port 0.2 registers */
135 0x82000000 0 0x4c000 0x4c000 0 0x00002000 /* Port 0.3 registers */
136 0x82000000 0 0x80000 0x80000 0 0x00002000 /* Port 1.0 registers */
137 0x82000000 0 0x82000 0x82000 0 0x00002000 /* Port 3.0 registers */
138 0x82000000 0 0x84000 0x84000 0 0x00002000 /* Port 1.1 registers */
139 0x82000000 0 0x88000 0x88000 0 0x00002000 /* Port 1.2 registers */
140 0x82000000 0 0x8c000 0x8c000 0 0x00002000 /* Port 1.3 registers */
141 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
142 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
143
144 pcie@1,0 {
145 device_type = "pci";
146 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
147 reg = <0x0800 0 0 0 0>;
148 #address-cells = <3>;
149 #size-cells = <2>;
150 #interrupt-cells = <1>;
151 ranges;
152 interrupt-map-mask = <0 0 0 0>;
153 interrupt-map = <0 0 0 0 &mpic 58>;
154 marvell,pcie-port = <0>;
155 marvell,pcie-lane = <0>;
156 clocks = <&gateclk 5>;
157 status = "disabled";
158 };
159
160 pcie@2,0 {
161 device_type = "pci";
162 assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
163 reg = <0x1000 0 0 0 0>;
164 #address-cells = <3>;
165 #size-cells = <2>;
166 #interrupt-cells = <1>;
167 ranges;
168 interrupt-map-mask = <0 0 0 0>;
169 interrupt-map = <0 0 0 0 &mpic 59>;
170 marvell,pcie-port = <0>;
171 marvell,pcie-lane = <1>;
172 clocks = <&gateclk 6>;
173 status = "disabled";
174 };
175
176 pcie@3,0 {
177 device_type = "pci";
178 assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
179 reg = <0x1800 0 0 0 0>;
180 #address-cells = <3>;
181 #size-cells = <2>;
182 #interrupt-cells = <1>;
183 ranges;
184 interrupt-map-mask = <0 0 0 0>;
185 interrupt-map = <0 0 0 0 &mpic 60>;
186 marvell,pcie-port = <0>;
187 marvell,pcie-lane = <2>;
188 clocks = <&gateclk 7>;
189 status = "disabled";
190 };
191
192 pcie@4,0 {
193 device_type = "pci";
194 assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
195 reg = <0x2000 0 0 0 0>;
196 #address-cells = <3>;
197 #size-cells = <2>;
198 #interrupt-cells = <1>;
199 ranges;
200 interrupt-map-mask = <0 0 0 0>;
201 interrupt-map = <0 0 0 0 &mpic 61>;
202 marvell,pcie-port = <0>;
203 marvell,pcie-lane = <3>;
204 clocks = <&gateclk 8>;
205 status = "disabled";
206 };
207
208 pcie@5,0 {
209 device_type = "pci";
210 assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
211 reg = <0x2800 0 0 0 0>;
212 #address-cells = <3>;
213 #size-cells = <2>;
214 #interrupt-cells = <1>;
215 ranges;
216 interrupt-map-mask = <0 0 0 0>;
217 interrupt-map = <0 0 0 0 &mpic 62>;
218 marvell,pcie-port = <1>;
219 marvell,pcie-lane = <0>;
220 clocks = <&gateclk 9>;
221 status = "disabled";
222 };
223
224 pcie@6,0 {
225 device_type = "pci";
226 assigned-addresses = <0x82003000 0 0x84000 0 0x2000>;
227 reg = <0x3000 0 0 0 0>;
228 #address-cells = <3>;
229 #size-cells = <2>;
230 #interrupt-cells = <1>;
231 ranges;
232 interrupt-map-mask = <0 0 0 0>;
233 interrupt-map = <0 0 0 0 &mpic 63>;
234 marvell,pcie-port = <1>;
235 marvell,pcie-lane = <1>;
236 clocks = <&gateclk 10>;
237 status = "disabled";
238 };
239
240 pcie@7,0 {
241 device_type = "pci";
242 assigned-addresses = <0x82003800 0 0x88000 0 0x2000>;
243 reg = <0x3800 0 0 0 0>;
244 #address-cells = <3>;
245 #size-cells = <2>;
246 #interrupt-cells = <1>;
247 ranges;
248 interrupt-map-mask = <0 0 0 0>;
249 interrupt-map = <0 0 0 0 &mpic 64>;
250 marvell,pcie-port = <1>;
251 marvell,pcie-lane = <2>;
252 clocks = <&gateclk 11>;
253 status = "disabled";
254 };
255
256 pcie@8,0 {
257 device_type = "pci";
258 assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>;
259 reg = <0x4000 0 0 0 0>;
260 #address-cells = <3>;
261 #size-cells = <2>;
262 #interrupt-cells = <1>;
263 ranges;
264 interrupt-map-mask = <0 0 0 0>;
265 interrupt-map = <0 0 0 0 &mpic 65>;
266 marvell,pcie-port = <1>;
267 marvell,pcie-lane = <3>;
268 clocks = <&gateclk 12>;
269 status = "disabled";
270 };
271 pcie@9,0 {
272 device_type = "pci";
273 assigned-addresses = <0x82004800 0 0x42000 0 0x2000>;
274 reg = <0x4800 0 0 0 0>;
275 #address-cells = <3>;
276 #size-cells = <2>;
277 #interrupt-cells = <1>;
278 ranges;
279 interrupt-map-mask = <0 0 0 0>;
280 interrupt-map = <0 0 0 0 &mpic 99>;
281 marvell,pcie-port = <2>;
282 marvell,pcie-lane = <0>;
283 clocks = <&gateclk 26>;
284 status = "disabled";
285 };
286
287 pcie@10,0 {
288 device_type = "pci";
289 assigned-addresses = <0x82005000 0 0x82000 0 0x2000>;
290 reg = <0x5000 0 0 0 0>;
291 #address-cells = <3>;
292 #size-cells = <2>;
293 #interrupt-cells = <1>;
294 ranges;
295 interrupt-map-mask = <0 0 0 0>;
296 interrupt-map = <0 0 0 0 &mpic 103>;
297 marvell,pcie-port = <3>;
298 marvell,pcie-lane = <0>;
299 clocks = <&gateclk 27>;
300 status = "disabled";
301 };
302 };
113 }; 303 };
114 }; 304 };
115 }; 305};
diff --git a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
index 3818a82176a2..f14d36c46159 100644
--- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
+++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
@@ -23,121 +23,161 @@
23 23
24 memory { 24 memory {
25 device_type = "memory"; 25 device_type = "memory";
26 reg = <0x00000000 0xC0000000>; /* 3 GB */ 26 reg = <0 0x00000000 0 0xC0000000>; /* 3 GB */
27 }; 27 };
28 28
29 soc { 29 soc {
30 serial@d0012000 { 30 internal-regs {
31 clock-frequency = <250000000>; 31 serial@12000 {
32 status = "okay"; 32 clock-frequency = <250000000>;
33 }; 33 status = "okay";
34 serial@d0012100 {
35 clock-frequency = <250000000>;
36 status = "okay";
37 };
38 pinctrl {
39 led_pins: led-pins-0 {
40 marvell,pins = "mpp49", "mpp51", "mpp53";
41 marvell,function = "gpio";
42 }; 34 };
43 }; 35 serial@12100 {
44 leds { 36 clock-frequency = <250000000>;
45 compatible = "gpio-leds"; 37 status = "okay";
46 pinctrl-names = "default";
47 pinctrl-0 = <&led_pins>;
48
49 red_led {
50 label = "red_led";
51 gpios = <&gpio1 17 1>;
52 default-state = "off";
53 }; 38 };
54 39 pinctrl {
55 yellow_led { 40 led_pins: led-pins-0 {
56 label = "yellow_led"; 41 marvell,pins = "mpp49", "mpp51", "mpp53";
57 gpios = <&gpio1 19 1>; 42 marvell,function = "gpio";
58 default-state = "off"; 43 };
59 }; 44 };
60 45 leds {
61 green_led { 46 compatible = "gpio-leds";
62 label = "green_led"; 47 pinctrl-names = "default";
63 gpios = <&gpio1 21 1>; 48 pinctrl-0 = <&led_pins>;
64 default-state = "off"; 49
65 linux,default-trigger = "heartbeat"; 50 red_led {
51 label = "red_led";
52 gpios = <&gpio1 17 1>;
53 default-state = "off";
54 };
55
56 yellow_led {
57 label = "yellow_led";
58 gpios = <&gpio1 19 1>;
59 default-state = "off";
60 };
61
62 green_led {
63 label = "green_led";
64 gpios = <&gpio1 21 1>;
65 default-state = "off";
66 linux,default-trigger = "heartbeat";
67 };
66 }; 68 };
67 };
68 69
69 gpio_keys { 70 gpio_keys {
70 compatible = "gpio-keys"; 71 compatible = "gpio-keys";
71 #address-cells = <1>; 72 #address-cells = <1>;
72 #size-cells = <0>; 73 #size-cells = <0>;
73 74
74 button@1 { 75 button@1 {
75 label = "Init Button"; 76 label = "Init Button";
76 linux,code = <116>; 77 linux,code = <116>;
77 gpios = <&gpio1 28 0>; 78 gpios = <&gpio1 28 0>;
79 };
78 }; 80 };
79 };
80 81
81 mdio { 82 mdio {
82 phy0: ethernet-phy@0 { 83 phy0: ethernet-phy@0 {
83 reg = <0>; 84 reg = <0>;
84 }; 85 };
85 86
86 phy1: ethernet-phy@1 { 87 phy1: ethernet-phy@1 {
87 reg = <1>; 88 reg = <1>;
88 }; 89 };
89 90
90 phy2: ethernet-phy@2 { 91 phy2: ethernet-phy@2 {
91 reg = <2>; 92 reg = <2>;
93 };
94
95 phy3: ethernet-phy@3 {
96 reg = <3>;
97 };
92 }; 98 };
93 99
94 phy3: ethernet-phy@3 { 100 ethernet@70000 {
95 reg = <3>; 101 status = "okay";
102 phy = <&phy0>;
103 phy-mode = "sgmii";
104 };
105 ethernet@74000 {
106 status = "okay";
107 phy = <&phy1>;
108 phy-mode = "sgmii";
109 };
110 ethernet@30000 {
111 status = "okay";
112 phy = <&phy2>;
113 phy-mode = "sgmii";
114 };
115 ethernet@34000 {
116 status = "okay";
117 phy = <&phy3>;
118 phy-mode = "sgmii";
119 };
120 i2c@11000 {
121 status = "okay";
122 clock-frequency = <400000>;
123 };
124 i2c@11100 {
125 status = "okay";
126 clock-frequency = <400000>;
127
128 s35390a: s35390a@30 {
129 compatible = "s35390a";
130 reg = <0x30>;
131 };
132 };
133 sata@a0000 {
134 nr-ports = <2>;
135 status = "okay";
136 };
137 usb@50000 {
138 status = "okay";
139 };
140 usb@51000 {
141 status = "okay";
96 }; 142 };
97 };
98 143
99 ethernet@d0070000 { 144 devbus-bootcs@10400 {
100 status = "okay"; 145 status = "okay";
101 phy = <&phy0>; 146 ranges = <0 0xf0000000 0x8000000>; /* @addr 0xf000000, size 0x8000000 */
102 phy-mode = "sgmii"; 147
103 }; 148 /* Device Bus parameters are required */
104 ethernet@d0074000 { 149
105 status = "okay"; 150 /* Read parameters */
106 phy = <&phy1>; 151 devbus,bus-width = <8>;
107 phy-mode = "sgmii"; 152 devbus,turn-off-ps = <60000>;
108 }; 153 devbus,badr-skew-ps = <0>;
109 ethernet@d0030000 { 154 devbus,acc-first-ps = <124000>;
110 status = "okay"; 155 devbus,acc-next-ps = <248000>;
111 phy = <&phy2>; 156 devbus,rd-setup-ps = <0>;
112 phy-mode = "sgmii"; 157 devbus,rd-hold-ps = <0>;
113 }; 158
114 ethernet@d0034000 { 159 /* Write parameters */
115 status = "okay"; 160 devbus,sync-enable = <0>;
116 phy = <&phy3>; 161 devbus,wr-high-ps = <60000>;
117 phy-mode = "sgmii"; 162 devbus,wr-low-ps = <60000>;
118 }; 163 devbus,ale-wr-ps = <60000>;
119 i2c@d0011000 { 164
120 status = "okay"; 165 /* NOR 128 MiB */
121 clock-frequency = <400000>; 166 nor@0 {
122 }; 167 compatible = "cfi-flash";
123 i2c@d0011100 { 168 reg = <0 0x8000000>;
124 status = "okay"; 169 bank-width = <2>;
125 clock-frequency = <400000>; 170 };
171 };
126 172
127 s35390a: s35390a@30 { 173 pcie-controller {
128 compatible = "s35390a"; 174 status = "okay";
129 reg = <0x30>; 175 /* Internal mini-PCIe connector */
176 pcie@1,0 {
177 /* Port 0, Lane 0 */
178 status = "okay";
179 };
130 }; 180 };
131 }; 181 };
132 sata@d00a0000 {
133 nr-ports = <2>;
134 status = "okay";
135 };
136 usb@d0050000 {
137 status = "okay";
138 };
139 usb@d0051000 {
140 status = "okay";
141 };
142 }; 182 };
143}; 183};
diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi
index ca00d8326c87..bacab11c10dc 100644
--- a/arch/arm/boot/dts/armada-xp.dtsi
+++ b/arch/arm/boot/dts/armada-xp.dtsi
@@ -22,134 +22,140 @@
22 model = "Marvell Armada XP family SoC"; 22 model = "Marvell Armada XP family SoC";
23 compatible = "marvell,armadaxp", "marvell,armada-370-xp"; 23 compatible = "marvell,armadaxp", "marvell,armada-370-xp";
24 24
25 L2: l2-cache { 25 soc {
26 compatible = "marvell,aurora-system-cache"; 26 internal-regs {
27 reg = <0xd0008000 0x1000>; 27 L2: l2-cache {
28 cache-id-part = <0x100>; 28 compatible = "marvell,aurora-system-cache";
29 wt-override; 29 reg = <0x08000 0x1000>;
30 }; 30 cache-id-part = <0x100>;
31 wt-override;
32 };
31 33
32 mpic: interrupt-controller@d0020000 { 34 mpic: interrupt-controller@20000 {
33 reg = <0xd0020a00 0x2d0>, 35 reg = <0x20a00 0x2d0>, <0x21070 0x58>;
34 <0xd0021070 0x58>; 36 };
35 };
36 37
37 armada-370-xp-pmsu@d0022000 { 38 armada-370-xp-pmsu@22000 {
38 compatible = "marvell,armada-370-xp-pmsu"; 39 compatible = "marvell,armada-370-xp-pmsu";
39 reg = <0xd0022100 0x430>, 40 reg = <0x22100 0x430>, <0x20800 0x20>;
40 <0xd0020800 0x20>; 41 };
41 };
42 42
43 soc { 43 serial@12200 {
44 serial@d0012200 {
45 compatible = "snps,dw-apb-uart"; 44 compatible = "snps,dw-apb-uart";
46 reg = <0xd0012200 0x100>; 45 reg = <0x12200 0x100>;
47 reg-shift = <2>; 46 reg-shift = <2>;
48 interrupts = <43>; 47 interrupts = <43>;
49 reg-io-width = <1>; 48 reg-io-width = <1>;
50 status = "disabled"; 49 status = "disabled";
51 }; 50 };
52 serial@d0012300 { 51 serial@12300 {
53 compatible = "snps,dw-apb-uart"; 52 compatible = "snps,dw-apb-uart";
54 reg = <0xd0012300 0x100>; 53 reg = <0x12300 0x100>;
55 reg-shift = <2>; 54 reg-shift = <2>;
56 interrupts = <44>; 55 interrupts = <44>;
57 reg-io-width = <1>; 56 reg-io-width = <1>;
58 status = "disabled"; 57 status = "disabled";
59 }; 58 };
60 59
61 timer@d0020300 { 60 timer@20300 {
62 marvell,timer-25Mhz; 61 marvell,timer-25Mhz;
63 }; 62 };
64 63
65 coreclk: mvebu-sar@d0018230 { 64 coreclk: mvebu-sar@18230 {
66 compatible = "marvell,armada-xp-core-clock"; 65 compatible = "marvell,armada-xp-core-clock";
67 reg = <0xd0018230 0x08>; 66 reg = <0x18230 0x08>;
68 #clock-cells = <1>; 67 #clock-cells = <1>;
69 }; 68 };
70 69
71 cpuclk: clock-complex@d0018700 { 70 cpuclk: clock-complex@18700 {
72 #clock-cells = <1>; 71 #clock-cells = <1>;
73 compatible = "marvell,armada-xp-cpu-clock"; 72 compatible = "marvell,armada-xp-cpu-clock";
74 reg = <0xd0018700 0xA0>; 73 reg = <0x18700 0xA0>;
75 clocks = <&coreclk 1>; 74 clocks = <&coreclk 1>;
76 }; 75 };
77 76
78 gateclk: clock-gating-control@d0018220 { 77 gateclk: clock-gating-control@18220 {
79 compatible = "marvell,armada-xp-gating-clock"; 78 compatible = "marvell,armada-xp-gating-clock";
80 reg = <0xd0018220 0x4>; 79 reg = <0x18220 0x4>;
81 clocks = <&coreclk 0>; 80 clocks = <&coreclk 0>;
82 #clock-cells = <1>; 81 #clock-cells = <1>;
83 }; 82 };
84 83
85 system-controller@d0018200 { 84 system-controller@18200 {
86 compatible = "marvell,armada-370-xp-system-controller"; 85 compatible = "marvell,armada-370-xp-system-controller";
87 reg = <0xd0018200 0x500>; 86 reg = <0x18200 0x500>;
88 }; 87 };
89 88
90 ethernet@d0030000 { 89 ethernet@30000 {
91 compatible = "marvell,armada-370-neta"; 90 compatible = "marvell,armada-370-neta";
92 reg = <0xd0030000 0x2500>; 91 reg = <0x30000 0x2500>;
93 interrupts = <12>; 92 interrupts = <12>;
94 clocks = <&gateclk 2>; 93 clocks = <&gateclk 2>;
95 status = "disabled"; 94 status = "disabled";
96 };
97
98 xor@d0060900 {
99 compatible = "marvell,orion-xor";
100 reg = <0xd0060900 0x100
101 0xd0060b00 0x100>;
102 clocks = <&gateclk 22>;
103 status = "okay";
104
105 xor10 {
106 interrupts = <51>;
107 dmacap,memcpy;
108 dmacap,xor;
109 };
110 xor11 {
111 interrupts = <52>;
112 dmacap,memcpy;
113 dmacap,xor;
114 dmacap,memset;
115 }; 95 };
116 };
117 96
118 xor@d00f0900 { 97 xor@60900 {
119 compatible = "marvell,orion-xor"; 98 compatible = "marvell,orion-xor";
120 reg = <0xd00F0900 0x100 99 reg = <0x60900 0x100
121 0xd00F0B00 0x100>; 100 0x60b00 0x100>;
122 clocks = <&gateclk 28>; 101 clocks = <&gateclk 22>;
123 status = "okay"; 102 status = "okay";
103
104 xor10 {
105 interrupts = <51>;
106 dmacap,memcpy;
107 dmacap,xor;
108 };
109 xor11 {
110 interrupts = <52>;
111 dmacap,memcpy;
112 dmacap,xor;
113 dmacap,memset;
114 };
115 };
124 116
125 xor00 { 117 xor@f0900 {
126 interrupts = <94>; 118 compatible = "marvell,orion-xor";
127 dmacap,memcpy; 119 reg = <0xF0900 0x100
128 dmacap,xor; 120 0xF0B00 0x100>;
121 clocks = <&gateclk 28>;
122 status = "okay";
123
124 xor00 {
125 interrupts = <94>;
126 dmacap,memcpy;
127 dmacap,xor;
128 };
129 xor01 {
130 interrupts = <95>;
131 dmacap,memcpy;
132 dmacap,xor;
133 dmacap,memset;
134 };
129 }; 135 };
130 xor01 { 136
131 interrupts = <95>; 137 usb@50000 {
132 dmacap,memcpy; 138 clocks = <&gateclk 18>;
133 dmacap,xor;
134 dmacap,memset;
135 }; 139 };
136 };
137 140
138 usb@d0050000 { 141 usb@51000 {
139 clocks = <&gateclk 18>; 142 clocks = <&gateclk 19>;
140 }; 143 };
141 144
142 usb@d0051000 { 145 usb@52000 {
143 clocks = <&gateclk 19>; 146 compatible = "marvell,orion-ehci";
144 }; 147 reg = <0x52000 0x500>;
148 interrupts = <47>;
149 clocks = <&gateclk 20>;
150 status = "disabled";
151 };
145 152
146 usb@d0052000 { 153 thermal@182b0 {
147 compatible = "marvell,orion-ehci"; 154 compatible = "marvell,armadaxp-thermal";
148 reg = <0xd0052000 0x500>; 155 reg = <0x182b0 0x4
149 interrupts = <47>; 156 0x184d0 0x4>;
150 clocks = <&gateclk 20>; 157 status = "okay";
151 status = "disabled"; 158 };
152 }; 159 };
153
154 }; 160 };
155}; 161};
diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index f712fb607a42..c914357c0d89 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -35,14 +35,124 @@
35 clock-frequency = <100000>; 35 clock-frequency = <100000>;
36 pinctrl-names = "default"; 36 pinctrl-names = "default";
37 pinctrl-0 = <&i2c0_pins>; 37 pinctrl-0 = <&i2c0_pins>;
38
39 tps: tps@48 {
40 reg = <0x48>;
41 };
38 }; 42 };
39 wdt: wdt@1c21000 { 43 wdt: wdt@1c21000 {
40 status = "okay"; 44 status = "okay";
41 }; 45 };
46 mmc0: mmc@1c40000 {
47 max-frequency = <50000000>;
48 bus-width = <4>;
49 status = "okay";
50 pinctrl-names = "default";
51 pinctrl-0 = <&mmc0_pins>;
52 };
53 spi1: spi@1f0e000 {
54 status = "okay";
55 pinctrl-names = "default";
56 pinctrl-0 = <&spi1_pins &spi1_cs0_pin>;
57 flash: m25p80@0 {
58 #address-cells = <1>;
59 #size-cells = <1>;
60 compatible = "m25p64";
61 spi-max-frequency = <30000000>;
62 reg = <0>;
63 partition@0 {
64 label = "U-Boot-SPL";
65 reg = <0x00000000 0x00010000>;
66 read-only;
67 };
68 partition@1 {
69 label = "U-Boot";
70 reg = <0x00010000 0x00080000>;
71 read-only;
72 };
73 partition@2 {
74 label = "U-Boot-Env";
75 reg = <0x00090000 0x00010000>;
76 read-only;
77 };
78 partition@3 {
79 label = "Kernel";
80 reg = <0x000a0000 0x00280000>;
81 };
82 partition@4 {
83 label = "Filesystem";
84 reg = <0x00320000 0x00400000>;
85 };
86 partition@5 {
87 label = "MAC-Address";
88 reg = <0x007f0000 0x00010000>;
89 read-only;
90 };
91 };
92 };
42 }; 93 };
43 nand_cs3@62000000 { 94 nand_cs3@62000000 {
44 status = "okay"; 95 status = "okay";
45 pinctrl-names = "default"; 96 pinctrl-names = "default";
46 pinctrl-0 = <&nand_cs3_pins>; 97 pinctrl-0 = <&nand_cs3_pins>;
47 }; 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
108/include/ "tps6507x.dtsi"
109
110&tps {
111 vdcdc1_2-supply = <&vbat>;
112 vdcdc3-supply = <&vbat>;
113 vldo1_2-supply = <&vbat>;
114
115 regulators {
116 vdcdc1_reg: regulator@0 {
117 regulator-name = "VDCDC1_3.3V";
118 regulator-min-microvolt = <3150000>;
119 regulator-max-microvolt = <3450000>;
120 regulator-always-on;
121 regulator-boot-on;
122 };
123
124 vdcdc2_reg: regulator@1 {
125 regulator-name = "VDCDC2_3.3V";
126 regulator-min-microvolt = <1710000>;
127 regulator-max-microvolt = <3450000>;
128 regulator-always-on;
129 regulator-boot-on;
130 ti,defdcdc_default = <1>;
131 };
132
133 vdcdc3_reg: regulator@2 {
134 regulator-name = "VDCDC3_1.2V";
135 regulator-min-microvolt = <950000>;
136 regulator-max-microvolt = <1350000>;
137 regulator-always-on;
138 regulator-boot-on;
139 ti,defdcdc_default = <1>;
140 };
141
142 ldo1_reg: regulator@3 {
143 regulator-name = "LDO1_1.8V";
144 regulator-min-microvolt = <1710000>;
145 regulator-max-microvolt = <1890000>;
146 regulator-always-on;
147 regulator-boot-on;
148 };
149
150 ldo2_reg: regulator@4 {
151 regulator-name = "LDO2_1.2V";
152 regulator-min-microvolt = <1140000>;
153 regulator-max-microvolt = <1320000>;
154 regulator-always-on;
155 regulator-boot-on;
156 };
157 };
48}; 158};
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 3ec1bda64356..2c88313d2c7a 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -62,6 +62,69 @@
62 0x10 0x00002200 0x0000ff00 62 0x10 0x00002200 0x0000ff00
63 >; 63 >;
64 }; 64 };
65 mmc0_pins: pinmux_mmc_pins {
66 pinctrl-single,bits = <
67 /* MMCSD0_DAT[3] MMCSD0_DAT[2]
68 * MMCSD0_DAT[1] MMCSD0_DAT[0]
69 * MMCSD0_CMD MMCSD0_CLK
70 */
71 0x28 0x00222222 0x00ffffff
72 >;
73 };
74 ehrpwm0a_pins: pinmux_ehrpwm0a_pins {
75 pinctrl-single,bits = <
76 /* EPWM0A */
77 0xc 0x00000002 0x0000000f
78 >;
79 };
80 ehrpwm0b_pins: pinmux_ehrpwm0b_pins {
81 pinctrl-single,bits = <
82 /* EPWM0B */
83 0xc 0x00000020 0x000000f0
84 >;
85 };
86 ehrpwm1a_pins: pinmux_ehrpwm1a_pins {
87 pinctrl-single,bits = <
88 /* EPWM1A */
89 0x14 0x00000002 0x0000000f
90 >;
91 };
92 ehrpwm1b_pins: pinmux_ehrpwm1b_pins {
93 pinctrl-single,bits = <
94 /* EPWM1B */
95 0x14 0x00000020 0x000000f0
96 >;
97 };
98 ecap0_pins: pinmux_ecap0_pins {
99 pinctrl-single,bits = <
100 /* ECAP0_APWM0 */
101 0x8 0x20000000 0xf0000000
102 >;
103 };
104 ecap1_pins: pinmux_ecap1_pins {
105 pinctrl-single,bits = <
106 /* ECAP1_APWM1 */
107 0x4 0x40000000 0xf0000000
108 >;
109 };
110 ecap2_pins: pinmux_ecap2_pins {
111 pinctrl-single,bits = <
112 /* ECAP2_APWM2 */
113 0x4 0x00000004 0x0000000f
114 >;
115 };
116 spi1_pins: pinmux_spi_pins {
117 pinctrl-single,bits = <
118 /* SIMO, SOMI, CLK */
119 0x14 0x00110100 0x00ff0f00
120 >;
121 };
122 spi1_cs0_pin: pinmux_spi1_cs0 {
123 pinctrl-single,bits = <
124 /* CS0 */
125 0x14 0x00000010 0x000000f0
126 >;
127 };
65 }; 128 };
66 serial0: serial@1c42000 { 129 serial0: serial@1c42000 {
67 compatible = "ns16550a"; 130 compatible = "ns16550a";
@@ -107,6 +170,52 @@
107 reg = <0x21000 0x1000>; 170 reg = <0x21000 0x1000>;
108 status = "disabled"; 171 status = "disabled";
109 }; 172 };
173 mmc0: mmc@1c40000 {
174 compatible = "ti,da830-mmc";
175 reg = <0x40000 0x1000>;
176 interrupts = <16>;
177 status = "disabled";
178 };
179 ehrpwm0: ehrpwm@01f00000 {
180 compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
181 #pwm-cells = <3>;
182 reg = <0x300000 0x2000>;
183 status = "disabled";
184 };
185 ehrpwm1: ehrpwm@01f02000 {
186 compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
187 #pwm-cells = <3>;
188 reg = <0x302000 0x2000>;
189 status = "disabled";
190 };
191 ecap0: ecap@01f06000 {
192 compatible = "ti,da850-ecap", "ti,am33xx-ecap";
193 #pwm-cells = <3>;
194 reg = <0x306000 0x80>;
195 status = "disabled";
196 };
197 ecap1: ecap@01f07000 {
198 compatible = "ti,da850-ecap", "ti,am33xx-ecap";
199 #pwm-cells = <3>;
200 reg = <0x307000 0x80>;
201 status = "disabled";
202 };
203 ecap2: ecap@01f08000 {
204 compatible = "ti,da850-ecap", "ti,am33xx-ecap";
205 #pwm-cells = <3>;
206 reg = <0x308000 0x80>;
207 status = "disabled";
208 };
209 spi1: spi@1f0e000 {
210 #address-cells = <1>;
211 #size-cells = <0>;
212 compatible = "ti,da830-spi";
213 reg = <0x30e000 0x1000>;
214 num-cs = <4>;
215 ti,davinci-spi-intr-line = <1>;
216 interrupts = <56>;
217 status = "disabled";
218 };
110 }; 219 };
111 nand_cs3@62000000 { 220 nand_cs3@62000000 {
112 compatible = "ti,davinci-nand"; 221 compatible = "ti,davinci-nand";
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
index f7509cafc377..6cab46849cdb 100644
--- a/arch/arm/boot/dts/dove.dtsi
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -50,6 +50,11 @@
50 #clock-cells = <1>; 50 #clock-cells = <1>;
51 }; 51 };
52 52
53 thermal: thermal@d001c {
54 compatible = "marvell,dove-thermal";
55 reg = <0xd001c 0x0c>, <0xd005c 0x08>;
56 };
57
53 uart0: serial@12000 { 58 uart0: serial@12000 {
54 compatible = "ns16550a"; 59 compatible = "ns16550a";
55 reg = <0x12000 0x100>; 60 reg = <0x12000 0x100>;
diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi
index d75c047e80a9..7f428272fee6 100644
--- a/arch/arm/boot/dts/exynos4412.dtsi
+++ b/arch/arm/boot/dts/exynos4412.dtsi
@@ -51,4 +51,12 @@
51 <0x7 0 &gic 1 12 0>; 51 <0x7 0 &gic 1 12 0>;
52 }; 52 };
53 }; 53 };
54
55 mshc@12550000 {
56 compatible = "samsung,exynos4412-dw-mshc";
57 reg = <0x12550000 0x1000>;
58 interrupts = <0 77 0>;
59 #address-cells = <1>;
60 #size-cells = <0>;
61 };
54}; 62};
diff --git a/arch/arm/boot/dts/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts
index 035c13f9d3c0..da0588a04131 100644
--- a/arch/arm/boot/dts/imx23-evk.dts
+++ b/arch/arm/boot/dts/imx23-evk.dts
@@ -59,8 +59,33 @@
59 lcdif@80030000 { 59 lcdif@80030000 {
60 pinctrl-names = "default"; 60 pinctrl-names = "default";
61 pinctrl-0 = <&lcdif_24bit_pins_a>; 61 pinctrl-0 = <&lcdif_24bit_pins_a>;
62 panel-enable-gpios = <&gpio1 18 0>; 62 lcd-supply = <&reg_lcd_3v3>;
63 display = <&display>;
63 status = "okay"; 64 status = "okay";
65
66 display: display {
67 bits-per-pixel = <32>;
68 bus-width = <24>;
69
70 display-timings {
71 native-mode = <&timing0>;
72 timing0: timing0 {
73 clock-frequency = <9200000>;
74 hactive = <480>;
75 vactive = <272>;
76 hback-porch = <15>;
77 hfront-porch = <8>;
78 vback-porch = <12>;
79 vfront-porch = <4>;
80 hsync-len = <1>;
81 vsync-len = <1>;
82 hsync-active = <0>;
83 vsync-active = <0>;
84 de-active = <1>;
85 pixelclk-active = <0>;
86 };
87 };
88 };
64 }; 89 };
65 }; 90 };
66 91
@@ -95,6 +120,15 @@
95 regulator-max-microvolt = <3300000>; 120 regulator-max-microvolt = <3300000>;
96 gpio = <&gpio1 29 0>; 121 gpio = <&gpio1 29 0>;
97 }; 122 };
123
124 reg_lcd_3v3: lcd-3v3 {
125 compatible = "regulator-fixed";
126 regulator-name = "lcd-3v3";
127 regulator-min-microvolt = <3300000>;
128 regulator-max-microvolt = <3300000>;
129 gpio = <&gpio1 18 0>;
130 enable-active-high;
131 };
98 }; 132 };
99 133
100 backlight { 134 backlight {
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index e7484e4ea659..d107c4af321f 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -29,6 +29,7 @@
29 pinctrl-names = "default"; 29 pinctrl-names = "default";
30 pinctrl-0 = <&mmc0_4bit_pins_a &mmc0_pins_fixup>; 30 pinctrl-0 = <&mmc0_4bit_pins_a &mmc0_pins_fixup>;
31 bus-width = <4>; 31 bus-width = <4>;
32 broken-cd;
32 status = "okay"; 33 status = "okay";
33 }; 34 };
34 35
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index 56afcf41aae0..73fd7d0887b5 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -49,9 +49,15 @@
49 reg = <0x80000000 0x2000>; 49 reg = <0x80000000 0x2000>;
50 }; 50 };
51 51
52 dma-apbh@80004000 { 52 dma_apbh: dma-apbh@80004000 {
53 compatible = "fsl,imx23-dma-apbh"; 53 compatible = "fsl,imx23-dma-apbh";
54 reg = <0x80004000 0x2000>; 54 reg = <0x80004000 0x2000>;
55 interrupts = <0 14 20 0
56 13 13 13 13>;
57 interrupt-names = "empty", "ssp0", "ssp1", "empty",
58 "gpmi0", "gpmi1", "gpmi2", "gpmi3";
59 #dma-cells = <1>;
60 dma-channels = <8>;
55 clocks = <&clks 15>; 61 clocks = <&clks 15>;
56 }; 62 };
57 63
@@ -70,6 +76,8 @@
70 interrupt-names = "gpmi-dma", "bch"; 76 interrupt-names = "gpmi-dma", "bch";
71 clocks = <&clks 34>; 77 clocks = <&clks 34>;
72 clock-names = "gpmi_io"; 78 clock-names = "gpmi_io";
79 dmas = <&dma_apbh 4>;
80 dma-names = "rx-tx";
73 fsl,gpmi-dma-channel = <4>; 81 fsl,gpmi-dma-channel = <4>;
74 status = "disabled"; 82 status = "disabled";
75 }; 83 };
@@ -78,6 +86,8 @@
78 reg = <0x80010000 0x2000>; 86 reg = <0x80010000 0x2000>;
79 interrupts = <15 14>; 87 interrupts = <15 14>;
80 clocks = <&clks 33>; 88 clocks = <&clks 33>;
89 dmas = <&dma_apbh 1>;
90 dma-names = "rx-tx";
81 fsl,ssp-dma-channel = <1>; 91 fsl,ssp-dma-channel = <1>;
82 status = "disabled"; 92 status = "disabled";
83 }; 93 };
@@ -295,6 +305,7 @@
295 }; 305 };
296 306
297 digctl@8001c000 { 307 digctl@8001c000 {
308 compatible = "fsl,imx23-digctl";
298 reg = <0x8001c000 2000>; 309 reg = <0x8001c000 2000>;
299 status = "disabled"; 310 status = "disabled";
300 }; 311 };
@@ -304,9 +315,19 @@
304 status = "disabled"; 315 status = "disabled";
305 }; 316 };
306 317
307 dma-apbx@80024000 { 318 dma_apbx: dma-apbx@80024000 {
308 compatible = "fsl,imx23-dma-apbx"; 319 compatible = "fsl,imx23-dma-apbx";
309 reg = <0x80024000 0x2000>; 320 reg = <0x80024000 0x2000>;
321 interrupts = <7 5 9 26
322 19 0 25 23
323 60 58 9 0
324 0 0 0 0>;
325 interrupt-names = "audio-adc", "audio-dac", "spdif-tx", "i2c",
326 "saif0", "empty", "auart0-rx", "auart0-tx",
327 "auart1-rx", "auart1-tx", "saif1", "empty",
328 "empty", "empty", "empty", "empty";
329 #dma-cells = <1>;
330 dma-channels = <16>;
310 clocks = <&clks 16>; 331 clocks = <&clks 16>;
311 }; 332 };
312 333
@@ -321,6 +342,7 @@
321 }; 342 };
322 343
323 ocotp@8002c000 { 344 ocotp@8002c000 {
345 compatible = "fsl,ocotp";
324 reg = <0x8002c000 0x2000>; 346 reg = <0x8002c000 0x2000>;
325 status = "disabled"; 347 status = "disabled";
326 }; 348 };
@@ -342,6 +364,8 @@
342 reg = <0x80034000 0x2000>; 364 reg = <0x80034000 0x2000>;
343 interrupts = <2 20>; 365 interrupts = <2 20>;
344 clocks = <&clks 33>; 366 clocks = <&clks 33>;
367 dmas = <&dma_apbh 2>;
368 dma-names = "rx-tx";
345 fsl,ssp-dma-channel = <2>; 369 fsl,ssp-dma-channel = <2>;
346 status = "disabled"; 370 status = "disabled";
347 }; 371 };
@@ -360,13 +384,15 @@
360 ranges; 384 ranges;
361 385
362 clks: clkctrl@80040000 { 386 clks: clkctrl@80040000 {
363 compatible = "fsl,imx23-clkctrl"; 387 compatible = "fsl,imx23-clkctrl", "fsl,clkctrl";
364 reg = <0x80040000 0x2000>; 388 reg = <0x80040000 0x2000>;
365 #clock-cells = <1>; 389 #clock-cells = <1>;
366 }; 390 };
367 391
368 saif0: saif@80042000 { 392 saif0: saif@80042000 {
369 reg = <0x80042000 0x2000>; 393 reg = <0x80042000 0x2000>;
394 dmas = <&dma_apbx 4>;
395 dma-names = "rx-tx";
370 status = "disabled"; 396 status = "disabled";
371 }; 397 };
372 398
@@ -377,16 +403,22 @@
377 403
378 saif1: saif@80046000 { 404 saif1: saif@80046000 {
379 reg = <0x80046000 0x2000>; 405 reg = <0x80046000 0x2000>;
406 dmas = <&dma_apbx 10>;
407 dma-names = "rx-tx";
380 status = "disabled"; 408 status = "disabled";
381 }; 409 };
382 410
383 audio-out@80048000 { 411 audio-out@80048000 {
384 reg = <0x80048000 0x2000>; 412 reg = <0x80048000 0x2000>;
413 dmas = <&dma_apbx 1>;
414 dma-names = "tx";
385 status = "disabled"; 415 status = "disabled";
386 }; 416 };
387 417
388 audio-in@8004c000 { 418 audio-in@8004c000 {
389 reg = <0x8004c000 0x2000>; 419 reg = <0x8004c000 0x2000>;
420 dmas = <&dma_apbx 0>;
421 dma-names = "rx";
390 status = "disabled"; 422 status = "disabled";
391 }; 423 };
392 424
@@ -399,11 +431,15 @@
399 431
400 spdif@80054000 { 432 spdif@80054000 {
401 reg = <0x80054000 2000>; 433 reg = <0x80054000 2000>;
434 dmas = <&dma_apbx 2>;
435 dma-names = "tx";
402 status = "disabled"; 436 status = "disabled";
403 }; 437 };
404 438
405 i2c@80058000 { 439 i2c@80058000 {
406 reg = <0x80058000 0x2000>; 440 reg = <0x80058000 0x2000>;
441 dmas = <&dma_apbx 3>;
442 dma-names = "rx-tx";
407 status = "disabled"; 443 status = "disabled";
408 }; 444 };
409 445
@@ -426,6 +462,7 @@
426 compatible = "fsl,imx23-timrot", "fsl,timrot"; 462 compatible = "fsl,imx23-timrot", "fsl,timrot";
427 reg = <0x80068000 0x2000>; 463 reg = <0x80068000 0x2000>;
428 interrupts = <28 29 30 31>; 464 interrupts = <28 29 30 31>;
465 clocks = <&clks 28>;
429 }; 466 };
430 467
431 auart0: serial@8006c000 { 468 auart0: serial@8006c000 {
@@ -433,6 +470,8 @@
433 reg = <0x8006c000 0x2000>; 470 reg = <0x8006c000 0x2000>;
434 interrupts = <24 25 23>; 471 interrupts = <24 25 23>;
435 clocks = <&clks 32>; 472 clocks = <&clks 32>;
473 dmas = <&dma_apbx 6>, <&dma_apbx 7>;
474 dma-names = "rx", "tx";
436 status = "disabled"; 475 status = "disabled";
437 }; 476 };
438 477
@@ -441,6 +480,8 @@
441 reg = <0x8006e000 0x2000>; 480 reg = <0x8006e000 0x2000>;
442 interrupts = <59 60 58>; 481 interrupts = <59 60 58>;
443 clocks = <&clks 32>; 482 clocks = <&clks 32>;
483 dmas = <&dma_apbx 8>, <&dma_apbx 9>;
484 dma-names = "rx", "tx";
444 status = "disabled"; 485 status = "disabled";
445 }; 486 };
446 487
diff --git a/arch/arm/boot/dts/imx28-apf28dev.dts b/arch/arm/boot/dts/imx28-apf28dev.dts
index 6d8865bfb4b7..3d905d16cbec 100644
--- a/arch/arm/boot/dts/imx28-apf28dev.dts
+++ b/arch/arm/boot/dts/imx28-apf28dev.dts
@@ -72,7 +72,32 @@
72 pinctrl-names = "default"; 72 pinctrl-names = "default";
73 pinctrl-0 = <&lcdif_16bit_pins_a 73 pinctrl-0 = <&lcdif_16bit_pins_a
74 &lcdif_pins_apf28dev>; 74 &lcdif_pins_apf28dev>;
75 display = <&display>;
75 status = "okay"; 76 status = "okay";
77
78 display: display {
79 bits-per-pixel = <16>;
80 bus-width = <16>;
81
82 display-timings {
83 native-mode = <&timing0>;
84 timing0: timing0 {
85 clock-frequency = <33000033>;
86 hactive = <800>;
87 vactive = <480>;
88 hback-porch = <96>;
89 hfront-porch = <96>;
90 vback-porch = <20>;
91 vfront-porch = <21>;
92 hsync-len = <64>;
93 vsync-len = <4>;
94 hsync-active = <1>;
95 vsync-active = <1>;
96 de-active = <1>;
97 pixelclk-active = <0>;
98 };
99 };
100 };
76 }; 101 };
77 }; 102 };
78 103
diff --git a/arch/arm/boot/dts/imx28-apx4devkit.dts b/arch/arm/boot/dts/imx28-apx4devkit.dts
index 5171667a7763..43bf3c796cba 100644
--- a/arch/arm/boot/dts/imx28-apx4devkit.dts
+++ b/arch/arm/boot/dts/imx28-apx4devkit.dts
@@ -94,7 +94,32 @@
94 pinctrl-names = "default"; 94 pinctrl-names = "default";
95 pinctrl-0 = <&lcdif_24bit_pins_a 95 pinctrl-0 = <&lcdif_24bit_pins_a
96 &lcdif_pins_apx4>; 96 &lcdif_pins_apx4>;
97 display = <&display>;
97 status = "okay"; 98 status = "okay";
99
100 display: display {
101 bits-per-pixel = <32>;
102 bus-width = <24>;
103
104 display-timings {
105 native-mode = <&timing0>;
106 timing0: timing0 {
107 clock-frequency = <30000000>;
108 hactive = <800>;
109 vactive = <480>;
110 hback-porch = <88>;
111 hfront-porch = <40>;
112 vback-porch = <32>;
113 vfront-porch = <13>;
114 hsync-len = <48>;
115 vsync-len = <3>;
116 hsync-active = <1>;
117 vsync-active = <1>;
118 de-active = <1>;
119 pixelclk-active = <0>;
120 };
121 };
122 };
98 }; 123 };
99 }; 124 };
100 125
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index a0d3e9f1738e..063e62059890 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -30,7 +30,6 @@
30 reg = <0>; 30 reg = <0>;
31 fsl,pinmux-ids = < 31 fsl,pinmux-ids = <
32 0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */ 32 0x0073 /* MX28_PAD_GPMI_D7__GPIO_0_7 */
33 0x1153 /* MX28_PAD_LCD_D22__GPIO_1_21 */
34 0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */ 33 0x1163 /* MX28_PAD_LCD_D22__GPIO_1_22 */
35 0x1173 /* MX28_PAD_LCD_D22__GPIO_1_23 */ 34 0x1173 /* MX28_PAD_LCD_D22__GPIO_1_23 */
36 0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */ 35 0x2153 /* MX28_PAD_SSP2_D5__GPIO_2_21 */
@@ -120,13 +119,48 @@
120 fsl,voltage = <1>; 119 fsl,voltage = <1>;
121 fsl,pull-up = <0>; 120 fsl,pull-up = <0>;
122 }; 121 };
122
123 w1_gpio_pins: w1-gpio@0 {
124 reg = <0>;
125 fsl,pinmux-ids = <
126 0x1153 /* MX28_PAD_LCD_D21__GPIO_1_21 */
127 >;
128 fsl,drive-strength = <1>;
129 fsl,voltage = <1>;
130 fsl,pull-up = <0>; /* 0 will enable the keeper */
131 };
123 }; 132 };
124 133
125 lcdif@80030000 { 134 lcdif@80030000 {
126 pinctrl-names = "default"; 135 pinctrl-names = "default";
127 pinctrl-0 = <&lcdif_18bit_pins_cfa10049 136 pinctrl-0 = <&lcdif_18bit_pins_cfa10049
128 &lcdif_pins_cfa10049>; 137 &lcdif_pins_cfa10049>;
138 display = <&display>;
129 status = "okay"; 139 status = "okay";
140
141 display: display {
142 bits-per-pixel = <32>;
143 bus-width = <18>;
144
145 display-timings {
146 native-mode = <&timing0>;
147 timing0: timing0 {
148 clock-frequency = <9216000>;
149 hactive = <320>;
150 vactive = <480>;
151 hback-porch = <2>;
152 hfront-porch = <2>;
153 vback-porch = <2>;
154 vfront-porch = <2>;
155 hsync-len = <15>;
156 vsync-len = <15>;
157 hsync-active = <0>;
158 vsync-active = <0>;
159 de-active = <1>;
160 pixelclk-active = <1>;
161 };
162 };
163 };
130 }; 164 };
131 }; 165 };
132 166
@@ -183,6 +217,11 @@
183 usbphy1: usbphy@8007e000 { 217 usbphy1: usbphy@8007e000 {
184 status = "okay"; 218 status = "okay";
185 }; 219 };
220
221 lradc@80050000 {
222 status = "okay";
223 fsl,lradc-touchscreen-wires = <4>;
224 };
186 }; 225 };
187 }; 226 };
188 227
@@ -304,5 +343,14 @@
304 pwms = <&pwm 3 5000000>; 343 pwms = <&pwm 3 5000000>;
305 brightness-levels = <0 4 8 16 32 64 128 255>; 344 brightness-levels = <0 4 8 16 32 64 128 255>;
306 default-brightness-level = <6>; 345 default-brightness-level = <6>;
346
347 };
348
349 onewire@0 {
350 compatible = "w1-gpio";
351 pinctrl-names = "default";
352 pinctrl-0 = <&w1_gpio_pins>;
353 status = "okay";
354 gpios = <&gpio1 21 0>;
307 }; 355 };
308}; 356};
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index 2da316e04409..3637bf3b1d59 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -123,8 +123,33 @@
123 pinctrl-names = "default"; 123 pinctrl-names = "default";
124 pinctrl-0 = <&lcdif_24bit_pins_a 124 pinctrl-0 = <&lcdif_24bit_pins_a
125 &lcdif_pins_evk>; 125 &lcdif_pins_evk>;
126 panel-enable-gpios = <&gpio3 30 0>; 126 lcd-supply = <&reg_lcd_3v3>;
127 display = <&display>;
127 status = "okay"; 128 status = "okay";
129
130 display: display {
131 bits-per-pixel = <32>;
132 bus-width = <24>;
133
134 display-timings {
135 native-mode = <&timing0>;
136 timing0: timing0 {
137 clock-frequency = <33500000>;
138 hactive = <800>;
139 vactive = <480>;
140 hback-porch = <89>;
141 hfront-porch = <164>;
142 vback-porch = <23>;
143 vfront-porch = <10>;
144 hsync-len = <10>;
145 vsync-len = <10>;
146 hsync-active = <0>;
147 vsync-active = <0>;
148 de-active = <1>;
149 pixelclk-active = <0>;
150 };
151 };
152 };
128 }; 153 };
129 154
130 can0: can@80032000 { 155 can0: can@80032000 {
@@ -285,6 +310,15 @@
285 gpio = <&gpio3 8 0>; 310 gpio = <&gpio3 8 0>;
286 enable-active-high; 311 enable-active-high;
287 }; 312 };
313
314 reg_lcd_3v3: lcd-3v3 {
315 compatible = "regulator-fixed";
316 regulator-name = "lcd-3v3";
317 regulator-min-microvolt = <3300000>;
318 regulator-max-microvolt = <3300000>;
319 gpio = <&gpio3 30 0>;
320 enable-active-high;
321 };
288 }; 322 };
289 323
290 sound { 324 sound {
diff --git a/arch/arm/boot/dts/imx28-m28evk.dts b/arch/arm/boot/dts/imx28-m28evk.dts
index fd36e1cca104..5aa44e05c9f5 100644
--- a/arch/arm/boot/dts/imx28-m28evk.dts
+++ b/arch/arm/boot/dts/imx28-m28evk.dts
@@ -119,7 +119,32 @@
119 pinctrl-names = "default"; 119 pinctrl-names = "default";
120 pinctrl-0 = <&lcdif_24bit_pins_a 120 pinctrl-0 = <&lcdif_24bit_pins_a
121 &lcdif_pins_m28>; 121 &lcdif_pins_m28>;
122 display = <&display>;
122 status = "okay"; 123 status = "okay";
124
125 display: display {
126 bits-per-pixel = <16>;
127 bus-width = <18>;
128
129 display-timings {
130 native-mode = <&timing0>;
131 timing0: timing0 {
132 clock-frequency = <33260000>;
133 hactive = <800>;
134 vactive = <480>;
135 hback-porch = <0>;
136 hfront-porch = <256>;
137 vback-porch = <0>;
138 vfront-porch = <45>;
139 hsync-len = <1>;
140 vsync-len = <1>;
141 hsync-active = <0>;
142 vsync-active = <0>;
143 de-active = <1>;
144 pixelclk-active = <1>;
145 };
146 };
147 };
123 }; 148 };
124 149
125 can0: can@80032000 { 150 can0: can@80032000 {
@@ -220,6 +245,8 @@
220 phy-mode = "rmii"; 245 phy-mode = "rmii";
221 pinctrl-names = "default"; 246 pinctrl-names = "default";
222 pinctrl-0 = <&mac0_pins_a>; 247 pinctrl-0 = <&mac0_pins_a>;
248 clocks = <&clks 57>, <&clks 57>;
249 clock-names = "ipg", "ahb";
223 status = "okay"; 250 status = "okay";
224 }; 251 };
225 252
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index 7ba49662b9bc..600f7cb51f3e 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -61,12 +61,24 @@
61 hsadc@80002000 { 61 hsadc@80002000 {
62 reg = <0x80002000 0x2000>; 62 reg = <0x80002000 0x2000>;
63 interrupts = <13 87>; 63 interrupts = <13 87>;
64 dmas = <&dma_apbh 12>;
65 dma-names = "rx";
64 status = "disabled"; 66 status = "disabled";
65 }; 67 };
66 68
67 dma-apbh@80004000 { 69 dma_apbh: dma-apbh@80004000 {
68 compatible = "fsl,imx28-dma-apbh"; 70 compatible = "fsl,imx28-dma-apbh";
69 reg = <0x80004000 0x2000>; 71 reg = <0x80004000 0x2000>;
72 interrupts = <82 83 84 85
73 88 88 88 88
74 88 88 88 88
75 87 86 0 0>;
76 interrupt-names = "ssp0", "ssp1", "ssp2", "ssp3",
77 "gpmi0", "gmpi1", "gpmi2", "gmpi3",
78 "gpmi4", "gmpi5", "gpmi6", "gmpi7",
79 "hsadc", "lcdif", "empty", "empty";
80 #dma-cells = <1>;
81 dma-channels = <16>;
70 clocks = <&clks 25>; 82 clocks = <&clks 25>;
71 }; 83 };
72 84
@@ -86,6 +98,8 @@
86 interrupt-names = "gpmi-dma", "bch"; 98 interrupt-names = "gpmi-dma", "bch";
87 clocks = <&clks 50>; 99 clocks = <&clks 50>;
88 clock-names = "gpmi_io"; 100 clock-names = "gpmi_io";
101 dmas = <&dma_apbh 4>;
102 dma-names = "rx-tx";
89 fsl,gpmi-dma-channel = <4>; 103 fsl,gpmi-dma-channel = <4>;
90 status = "disabled"; 104 status = "disabled";
91 }; 105 };
@@ -96,6 +110,8 @@
96 reg = <0x80010000 0x2000>; 110 reg = <0x80010000 0x2000>;
97 interrupts = <96 82>; 111 interrupts = <96 82>;
98 clocks = <&clks 46>; 112 clocks = <&clks 46>;
113 dmas = <&dma_apbh 0>;
114 dma-names = "rx-tx";
99 fsl,ssp-dma-channel = <0>; 115 fsl,ssp-dma-channel = <0>;
100 status = "disabled"; 116 status = "disabled";
101 }; 117 };
@@ -106,6 +122,8 @@
106 reg = <0x80012000 0x2000>; 122 reg = <0x80012000 0x2000>;
107 interrupts = <97 83>; 123 interrupts = <97 83>;
108 clocks = <&clks 47>; 124 clocks = <&clks 47>;
125 dmas = <&dma_apbh 1>;
126 dma-names = "rx-tx";
109 fsl,ssp-dma-channel = <1>; 127 fsl,ssp-dma-channel = <1>;
110 status = "disabled"; 128 status = "disabled";
111 }; 129 };
@@ -116,6 +134,8 @@
116 reg = <0x80014000 0x2000>; 134 reg = <0x80014000 0x2000>;
117 interrupts = <98 84>; 135 interrupts = <98 84>;
118 clocks = <&clks 48>; 136 clocks = <&clks 48>;
137 dmas = <&dma_apbh 2>;
138 dma-names = "rx-tx";
119 fsl,ssp-dma-channel = <2>; 139 fsl,ssp-dma-channel = <2>;
120 status = "disabled"; 140 status = "disabled";
121 }; 141 };
@@ -126,6 +146,8 @@
126 reg = <0x80016000 0x2000>; 146 reg = <0x80016000 0x2000>;
127 interrupts = <99 85>; 147 interrupts = <99 85>;
128 clocks = <&clks 49>; 148 clocks = <&clks 49>;
149 dmas = <&dma_apbh 3>;
150 dma-names = "rx-tx";
129 fsl,ssp-dma-channel = <3>; 151 fsl,ssp-dma-channel = <3>;
130 status = "disabled"; 152 status = "disabled";
131 }; 153 };
@@ -647,6 +669,7 @@
647 }; 669 };
648 670
649 digctl@8001c000 { 671 digctl@8001c000 {
672 compatible = "fsl,imx28-digctl";
650 reg = <0x8001c000 0x2000>; 673 reg = <0x8001c000 0x2000>;
651 interrupts = <89>; 674 interrupts = <89>;
652 status = "disabled"; 675 status = "disabled";
@@ -657,9 +680,19 @@
657 status = "disabled"; 680 status = "disabled";
658 }; 681 };
659 682
660 dma-apbx@80024000 { 683 dma_apbx: dma-apbx@80024000 {
661 compatible = "fsl,imx28-dma-apbx"; 684 compatible = "fsl,imx28-dma-apbx";
662 reg = <0x80024000 0x2000>; 685 reg = <0x80024000 0x2000>;
686 interrupts = <78 79 66 0
687 80 81 68 69
688 70 71 72 73
689 74 75 76 77>;
690 interrupt-names = "auart4-rx", "aurat4-tx", "spdif-tx", "empty",
691 "saif0", "saif1", "i2c0", "i2c1",
692 "auart0-rx", "auart0-tx", "auart1-rx", "auart1-tx",
693 "auart2-rx", "auart2-tx", "auart3-rx", "auart3-tx";
694 #dma-cells = <1>;
695 dma-channels = <16>;
663 clocks = <&clks 26>; 696 clocks = <&clks 26>;
664 }; 697 };
665 698
@@ -676,6 +709,7 @@
676 }; 709 };
677 710
678 ocotp@8002c000 { 711 ocotp@8002c000 {
712 compatible = "fsl,ocotp";
679 reg = <0x8002c000 0x2000>; 713 reg = <0x8002c000 0x2000>;
680 status = "disabled"; 714 status = "disabled";
681 }; 715 };
@@ -690,6 +724,8 @@
690 reg = <0x80030000 0x2000>; 724 reg = <0x80030000 0x2000>;
691 interrupts = <38 86>; 725 interrupts = <38 86>;
692 clocks = <&clks 55>; 726 clocks = <&clks 55>;
727 dmas = <&dma_apbh 13>;
728 dma-names = "rx";
693 status = "disabled"; 729 status = "disabled";
694 }; 730 };
695 731
@@ -755,7 +791,7 @@
755 ranges; 791 ranges;
756 792
757 clks: clkctrl@80040000 { 793 clks: clkctrl@80040000 {
758 compatible = "fsl,imx28-clkctrl"; 794 compatible = "fsl,imx28-clkctrl", "fsl,clkctrl";
759 reg = <0x80040000 0x2000>; 795 reg = <0x80040000 0x2000>;
760 #clock-cells = <1>; 796 #clock-cells = <1>;
761 }; 797 };
@@ -765,6 +801,8 @@
765 reg = <0x80042000 0x2000>; 801 reg = <0x80042000 0x2000>;
766 interrupts = <59 80>; 802 interrupts = <59 80>;
767 clocks = <&clks 53>; 803 clocks = <&clks 53>;
804 dmas = <&dma_apbx 4>;
805 dma-names = "rx-tx";
768 fsl,saif-dma-channel = <4>; 806 fsl,saif-dma-channel = <4>;
769 status = "disabled"; 807 status = "disabled";
770 }; 808 };
@@ -779,6 +817,8 @@
779 reg = <0x80046000 0x2000>; 817 reg = <0x80046000 0x2000>;
780 interrupts = <58 81>; 818 interrupts = <58 81>;
781 clocks = <&clks 54>; 819 clocks = <&clks 54>;
820 dmas = <&dma_apbx 5>;
821 dma-names = "rx-tx";
782 fsl,saif-dma-channel = <5>; 822 fsl,saif-dma-channel = <5>;
783 status = "disabled"; 823 status = "disabled";
784 }; 824 };
@@ -794,6 +834,8 @@
794 spdif@80054000 { 834 spdif@80054000 {
795 reg = <0x80054000 0x2000>; 835 reg = <0x80054000 0x2000>;
796 interrupts = <45 66>; 836 interrupts = <45 66>;
837 dmas = <&dma_apbx 2>;
838 dma-names = "tx";
797 status = "disabled"; 839 status = "disabled";
798 }; 840 };
799 841
@@ -810,6 +852,8 @@
810 reg = <0x80058000 0x2000>; 852 reg = <0x80058000 0x2000>;
811 interrupts = <111 68>; 853 interrupts = <111 68>;
812 clock-frequency = <100000>; 854 clock-frequency = <100000>;
855 dmas = <&dma_apbx 6>;
856 dma-names = "rx-tx";
813 fsl,i2c-dma-channel = <6>; 857 fsl,i2c-dma-channel = <6>;
814 status = "disabled"; 858 status = "disabled";
815 }; 859 };
@@ -821,6 +865,8 @@
821 reg = <0x8005a000 0x2000>; 865 reg = <0x8005a000 0x2000>;
822 interrupts = <110 69>; 866 interrupts = <110 69>;
823 clock-frequency = <100000>; 867 clock-frequency = <100000>;
868 dmas = <&dma_apbx 7>;
869 dma-names = "rx-tx";
824 fsl,i2c-dma-channel = <7>; 870 fsl,i2c-dma-channel = <7>;
825 status = "disabled"; 871 status = "disabled";
826 }; 872 };
@@ -838,12 +884,15 @@
838 compatible = "fsl,imx28-timrot", "fsl,timrot"; 884 compatible = "fsl,imx28-timrot", "fsl,timrot";
839 reg = <0x80068000 0x2000>; 885 reg = <0x80068000 0x2000>;
840 interrupts = <48 49 50 51>; 886 interrupts = <48 49 50 51>;
887 clocks = <&clks 26>;
841 }; 888 };
842 889
843 auart0: serial@8006a000 { 890 auart0: serial@8006a000 {
844 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 891 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
845 reg = <0x8006a000 0x2000>; 892 reg = <0x8006a000 0x2000>;
846 interrupts = <112 70 71>; 893 interrupts = <112 70 71>;
894 dmas = <&dma_apbx 8>, <&dma_apbx 9>;
895 dma-names = "rx", "tx";
847 fsl,auart-dma-channel = <8 9>; 896 fsl,auart-dma-channel = <8 9>;
848 clocks = <&clks 45>; 897 clocks = <&clks 45>;
849 status = "disabled"; 898 status = "disabled";
@@ -853,6 +902,8 @@
853 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 902 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
854 reg = <0x8006c000 0x2000>; 903 reg = <0x8006c000 0x2000>;
855 interrupts = <113 72 73>; 904 interrupts = <113 72 73>;
905 dmas = <&dma_apbx 10>, <&dma_apbx 11>;
906 dma-names = "rx", "tx";
856 clocks = <&clks 45>; 907 clocks = <&clks 45>;
857 status = "disabled"; 908 status = "disabled";
858 }; 909 };
@@ -861,6 +912,8 @@
861 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 912 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
862 reg = <0x8006e000 0x2000>; 913 reg = <0x8006e000 0x2000>;
863 interrupts = <114 74 75>; 914 interrupts = <114 74 75>;
915 dmas = <&dma_apbx 12>, <&dma_apbx 13>;
916 dma-names = "rx", "tx";
864 clocks = <&clks 45>; 917 clocks = <&clks 45>;
865 status = "disabled"; 918 status = "disabled";
866 }; 919 };
@@ -869,6 +922,8 @@
869 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 922 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
870 reg = <0x80070000 0x2000>; 923 reg = <0x80070000 0x2000>;
871 interrupts = <115 76 77>; 924 interrupts = <115 76 77>;
925 dmas = <&dma_apbx 14>, <&dma_apbx 15>;
926 dma-names = "rx", "tx";
872 clocks = <&clks 45>; 927 clocks = <&clks 45>;
873 status = "disabled"; 928 status = "disabled";
874 }; 929 };
@@ -877,6 +932,8 @@
877 compatible = "fsl,imx28-auart", "fsl,imx23-auart"; 932 compatible = "fsl,imx28-auart", "fsl,imx23-auart";
878 reg = <0x80072000 0x2000>; 933 reg = <0x80072000 0x2000>;
879 interrupts = <116 78 79>; 934 interrupts = <116 78 79>;
935 dmas = <&dma_apbx 0>, <&dma_apbx 1>;
936 dma-names = "rx", "tx";
880 clocks = <&clks 45>; 937 clocks = <&clks 45>;
881 status = "disabled"; 938 status = "disabled";
882 }; 939 };
@@ -940,8 +997,8 @@
940 compatible = "fsl,imx28-fec"; 997 compatible = "fsl,imx28-fec";
941 reg = <0x800f0000 0x4000>; 998 reg = <0x800f0000 0x4000>;
942 interrupts = <101>; 999 interrupts = <101>;
943 clocks = <&clks 57>, <&clks 57>; 1000 clocks = <&clks 57>, <&clks 57>, <&clks 64>;
944 clock-names = "ipg", "ahb"; 1001 clock-names = "ipg", "ahb", "enet_out";
945 status = "disabled"; 1002 status = "disabled";
946 }; 1003 };
947 1004
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index 281a223591ff..491b0a0c24b0 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -65,9 +65,13 @@
65 interrupt-parent = <&intc>; 65 interrupt-parent = <&intc>;
66 ranges; 66 ranges;
67 67
68 dma-apbh@00110000 { 68 dma_apbh: dma-apbh@00110000 {
69 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh"; 69 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";
70 reg = <0x00110000 0x2000>; 70 reg = <0x00110000 0x2000>;
71 interrupts = <0 13 0x04>, <0 13 0x04>, <0 13 0x04>, <0 13 0x04>;
72 interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3";
73 #dma-cells = <1>;
74 dma-channels = <4>;
71 clocks = <&clks 106>; 75 clocks = <&clks 106>;
72 }; 76 };
73 77
@@ -83,6 +87,8 @@
83 <&clks 150>, <&clks 149>; 87 <&clks 150>, <&clks 149>;
84 clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch", 88 clock-names = "gpmi_io", "gpmi_apb", "gpmi_bch",
85 "gpmi_bch_apb", "per1_bch"; 89 "gpmi_bch_apb", "per1_bch";
90 dmas = <&dma_apbh 0>;
91 dma-names = "rx-tx";
86 fsl,gpmi-dma-channel = <0>; 92 fsl,gpmi-dma-channel = <0>;
87 status = "disabled"; 93 status = "disabled";
88 }; 94 };
diff --git a/arch/arm/boot/dts/kirkwood-6282.dtsi b/arch/arm/boot/dts/kirkwood-6282.dtsi
index 192cf76fbf93..23991e45bc55 100644
--- a/arch/arm/boot/dts/kirkwood-6282.dtsi
+++ b/arch/arm/boot/dts/kirkwood-6282.dtsi
@@ -49,6 +49,12 @@
49 }; 49 };
50 }; 50 };
51 51
52 thermal@10078 {
53 compatible = "marvell,kirkwood-thermal";
54 reg = <0x10078 0x4>;
55 status = "okay";
56 };
57
52 i2c@11100 { 58 i2c@11100 {
53 compatible = "marvell,mv64xxx-i2c"; 59 compatible = "marvell,mv64xxx-i2c";
54 reg = <0x11100 0x20>; 60 reg = <0x11100 0x20>;
diff --git a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
index 9555a86297c2..44fd97dfc1f3 100644
--- a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
+++ b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
@@ -69,6 +69,10 @@
69 status = "okay"; 69 status = "okay";
70 nr-ports = <1>; 70 nr-ports = <1>;
71 }; 71 };
72
73 mvsdio@90000 {
74 status = "okay";
75 };
72 }; 76 };
73 77
74 gpio-leds { 78 gpio-leds {
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index 761c4b69b25b..37aa7487d4d8 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -26,6 +26,11 @@
26 }; 26 };
27 }; 27 };
28 28
29 pmu {
30 compatible = "arm,arm1136-pmu";
31 interrupts = <3>;
32 };
33
29 soc { 34 soc {
30 compatible = "ti,omap-infra"; 35 compatible = "ti,omap-infra";
31 mpu { 36 mpu {
@@ -49,6 +54,18 @@
49 reg = <0x480FE000 0x1000>; 54 reg = <0x480FE000 0x1000>;
50 }; 55 };
51 56
57 sdma: dma-controller@48056000 {
58 compatible = "ti,omap2430-sdma", "ti,omap2420-sdma";
59 reg = <0x48056000 0x1000>;
60 interrupts = <12>,
61 <13>,
62 <14>,
63 <15>;
64 #dma-cells = <1>;
65 #dma-channels = <32>;
66 #dma-requests = <64>;
67 };
68
52 uart1: serial@4806a000 { 69 uart1: serial@4806a000 {
53 compatible = "ti,omap2-uart"; 70 compatible = "ti,omap2-uart";
54 ti,hwmods = "uart1"; 71 ti,hwmods = "uart1";
@@ -68,28 +85,28 @@
68 }; 85 };
69 86
70 timer2: timer@4802a000 { 87 timer2: timer@4802a000 {
71 compatible = "ti,omap2-timer"; 88 compatible = "ti,omap2420-timer";
72 reg = <0x4802a000 0x400>; 89 reg = <0x4802a000 0x400>;
73 interrupts = <38>; 90 interrupts = <38>;
74 ti,hwmods = "timer2"; 91 ti,hwmods = "timer2";
75 }; 92 };
76 93
77 timer3: timer@48078000 { 94 timer3: timer@48078000 {
78 compatible = "ti,omap2-timer"; 95 compatible = "ti,omap2420-timer";
79 reg = <0x48078000 0x400>; 96 reg = <0x48078000 0x400>;
80 interrupts = <39>; 97 interrupts = <39>;
81 ti,hwmods = "timer3"; 98 ti,hwmods = "timer3";
82 }; 99 };
83 100
84 timer4: timer@4807a000 { 101 timer4: timer@4807a000 {
85 compatible = "ti,omap2-timer"; 102 compatible = "ti,omap2420-timer";
86 reg = <0x4807a000 0x400>; 103 reg = <0x4807a000 0x400>;
87 interrupts = <40>; 104 interrupts = <40>;
88 ti,hwmods = "timer4"; 105 ti,hwmods = "timer4";
89 }; 106 };
90 107
91 timer5: timer@4807c000 { 108 timer5: timer@4807c000 {
92 compatible = "ti,omap2-timer"; 109 compatible = "ti,omap2420-timer";
93 reg = <0x4807c000 0x400>; 110 reg = <0x4807c000 0x400>;
94 interrupts = <41>; 111 interrupts = <41>;
95 ti,hwmods = "timer5"; 112 ti,hwmods = "timer5";
@@ -97,7 +114,7 @@
97 }; 114 };
98 115
99 timer6: timer@4807e000 { 116 timer6: timer@4807e000 {
100 compatible = "ti,omap2-timer"; 117 compatible = "ti,omap2420-timer";
101 reg = <0x4807e000 0x400>; 118 reg = <0x4807e000 0x400>;
102 interrupts = <42>; 119 interrupts = <42>;
103 ti,hwmods = "timer6"; 120 ti,hwmods = "timer6";
@@ -105,7 +122,7 @@
105 }; 122 };
106 123
107 timer7: timer@48080000 { 124 timer7: timer@48080000 {
108 compatible = "ti,omap2-timer"; 125 compatible = "ti,omap2420-timer";
109 reg = <0x48080000 0x400>; 126 reg = <0x48080000 0x400>;
110 interrupts = <43>; 127 interrupts = <43>;
111 ti,hwmods = "timer7"; 128 ti,hwmods = "timer7";
@@ -113,7 +130,7 @@
113 }; 130 };
114 131
115 timer8: timer@48082000 { 132 timer8: timer@48082000 {
116 compatible = "ti,omap2-timer"; 133 compatible = "ti,omap2420-timer";
117 reg = <0x48082000 0x400>; 134 reg = <0x48082000 0x400>;
118 interrupts = <44>; 135 interrupts = <44>;
119 ti,hwmods = "timer8"; 136 ti,hwmods = "timer8";
@@ -121,7 +138,7 @@
121 }; 138 };
122 139
123 timer9: timer@48084000 { 140 timer9: timer@48084000 {
124 compatible = "ti,omap2-timer"; 141 compatible = "ti,omap2420-timer";
125 reg = <0x48084000 0x400>; 142 reg = <0x48084000 0x400>;
126 interrupts = <45>; 143 interrupts = <45>;
127 ti,hwmods = "timer9"; 144 ti,hwmods = "timer9";
@@ -129,7 +146,7 @@
129 }; 146 };
130 147
131 timer10: timer@48086000 { 148 timer10: timer@48086000 {
132 compatible = "ti,omap2-timer"; 149 compatible = "ti,omap2420-timer";
133 reg = <0x48086000 0x400>; 150 reg = <0x48086000 0x400>;
134 interrupts = <46>; 151 interrupts = <46>;
135 ti,hwmods = "timer10"; 152 ti,hwmods = "timer10";
@@ -137,7 +154,7 @@
137 }; 154 };
138 155
139 timer11: timer@48088000 { 156 timer11: timer@48088000 {
140 compatible = "ti,omap2-timer"; 157 compatible = "ti,omap2420-timer";
141 reg = <0x48088000 0x400>; 158 reg = <0x48088000 0x400>;
142 interrupts = <47>; 159 interrupts = <47>;
143 ti,hwmods = "timer11"; 160 ti,hwmods = "timer11";
@@ -145,7 +162,7 @@
145 }; 162 };
146 163
147 timer12: timer@4808a000 { 164 timer12: timer@4808a000 {
148 compatible = "ti,omap2-timer"; 165 compatible = "ti,omap2420-timer";
149 reg = <0x4808a000 0x400>; 166 reg = <0x4808a000 0x400>;
150 interrupts = <48>; 167 interrupts = <48>;
151 ti,hwmods = "timer12"; 168 ti,hwmods = "timer12";
diff --git a/arch/arm/boot/dts/omap2420-h4.dts b/arch/arm/boot/dts/omap2420-h4.dts
index 9b0d07746cba..68282ee13e26 100644
--- a/arch/arm/boot/dts/omap2420-h4.dts
+++ b/arch/arm/boot/dts/omap2420-h4.dts
@@ -18,3 +18,49 @@
18 reg = <0x80000000 0x4000000>; /* 64 MB */ 18 reg = <0x80000000 0x4000000>; /* 64 MB */
19 }; 19 };
20}; 20};
21
22&gpmc {
23 ranges = <0 0 0x08000000 0x04000000>;
24
25 nor@0,0 {
26 compatible = "cfi-flash";
27 linux,mtd-name= "intel,ge28f256l18b85";
28 #address-cells = <1>;
29 #size-cells = <1>;
30 reg = <0 0 0x04000000>;
31 bank-width = <2>;
32
33 gpmc,mux-add-data = <2>;
34 gpmc,cs-on-ns = <10>;
35 gpmc,cs-rd-off-ns = <160>;
36 gpmc,cs-wr-off-ns = <160>;
37 gpmc,adv-on-ns = <20>;
38 gpmc,adv-rd-off-ns = <50>;
39 gpmc,adv-wr-off-ns = <50>;
40 gpmc,oe-on-ns = <60>;
41 gpmc,oe-off-ns = <120>;
42 gpmc,we-on-ns = <60>;
43 gpmc,we-off-ns = <120>;
44 gpmc,rd-cycle-ns = <170>;
45 gpmc,wr-cycle-ns = <170>;
46 gpmc,access-ns = <150>;
47 gpmc,page-burst-access-ns = <10>;
48
49 partition@0 {
50 label = "bootloader";
51 reg = <0 0x20000>;
52 };
53 partition@0x20000 {
54 label = "params";
55 reg = <0x20000 0x20000>;
56 };
57 partition@0x40000 {
58 label = "kernel";
59 reg = <0x40000 0x200000>;
60 };
61 partition@0x240000 {
62 label = "file-system";
63 reg = <0x240000 0x3dc0000>;
64 };
65 };
66};
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
index af6560908905..da5b285b73be 100644
--- a/arch/arm/boot/dts/omap2420.dtsi
+++ b/arch/arm/boot/dts/omap2420.dtsi
@@ -29,6 +29,65 @@
29 pinctrl-single,function-mask = <0x3f>; 29 pinctrl-single,function-mask = <0x3f>;
30 }; 30 };
31 31
32 gpio1: gpio@48018000 {
33 compatible = "ti,omap2-gpio";
34 reg = <0x48018000 0x200>;
35 interrupts = <29>;
36 ti,hwmods = "gpio1";
37 ti,gpio-always-on;
38 #gpio-cells = <2>;
39 gpio-controller;
40 #interrupt-cells = <2>;
41 interrupt-controller;
42 };
43
44 gpio2: gpio@4801a000 {
45 compatible = "ti,omap2-gpio";
46 reg = <0x4801a000 0x200>;
47 interrupts = <30>;
48 ti,hwmods = "gpio2";
49 ti,gpio-always-on;
50 #gpio-cells = <2>;
51 gpio-controller;
52 #interrupt-cells = <2>;
53 interrupt-controller;
54 };
55
56 gpio3: gpio@4801c000 {
57 compatible = "ti,omap2-gpio";
58 reg = <0x4801c000 0x200>;
59 interrupts = <31>;
60 ti,hwmods = "gpio3";
61 ti,gpio-always-on;
62 #gpio-cells = <2>;
63 gpio-controller;
64 #interrupt-cells = <2>;
65 interrupt-controller;
66 };
67
68 gpio4: gpio@4801e000 {
69 compatible = "ti,omap2-gpio";
70 reg = <0x4801e000 0x200>;
71 interrupts = <32>;
72 ti,hwmods = "gpio4";
73 ti,gpio-always-on;
74 #gpio-cells = <2>;
75 gpio-controller;
76 #interrupt-cells = <2>;
77 interrupt-controller;
78 };
79
80 gpmc: gpmc@6800a000 {
81 compatible = "ti,omap2420-gpmc";
82 reg = <0x6800a000 0x1000>;
83 #address-cells = <2>;
84 #size-cells = <1>;
85 interrupts = <20>;
86 gpmc,num-cs = <8>;
87 gpmc,num-waitpins = <4>;
88 ti,hwmods = "gpmc";
89 };
90
32 mcbsp1: mcbsp@48074000 { 91 mcbsp1: mcbsp@48074000 {
33 compatible = "ti,omap2420-mcbsp"; 92 compatible = "ti,omap2420-mcbsp";
34 reg = <0x48074000 0xff>; 93 reg = <0x48074000 0xff>;
@@ -37,6 +96,9 @@
37 <60>; /* RX interrupt */ 96 <60>; /* RX interrupt */
38 interrupt-names = "tx", "rx"; 97 interrupt-names = "tx", "rx";
39 ti,hwmods = "mcbsp1"; 98 ti,hwmods = "mcbsp1";
99 dmas = <&sdma 31>,
100 <&sdma 32>;
101 dma-names = "tx", "rx";
40 }; 102 };
41 103
42 mcbsp2: mcbsp@48076000 { 104 mcbsp2: mcbsp@48076000 {
@@ -47,10 +109,13 @@
47 <63>; /* RX interrupt */ 109 <63>; /* RX interrupt */
48 interrupt-names = "tx", "rx"; 110 interrupt-names = "tx", "rx";
49 ti,hwmods = "mcbsp2"; 111 ti,hwmods = "mcbsp2";
112 dmas = <&sdma 33>,
113 <&sdma 34>;
114 dma-names = "tx", "rx";
50 }; 115 };
51 116
52 timer1: timer@48028000 { 117 timer1: timer@48028000 {
53 compatible = "ti,omap2-timer"; 118 compatible = "ti,omap2420-timer";
54 reg = <0x48028000 0x400>; 119 reg = <0x48028000 0x400>;
55 interrupts = <37>; 120 interrupts = <37>;
56 ti,hwmods = "timer1"; 121 ti,hwmods = "timer1";
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
index c3924457c9b6..054bc4439568 100644
--- a/arch/arm/boot/dts/omap2430.dtsi
+++ b/arch/arm/boot/dts/omap2430.dtsi
@@ -29,6 +29,76 @@
29 pinctrl-single,function-mask = <0x3f>; 29 pinctrl-single,function-mask = <0x3f>;
30 }; 30 };
31 31
32 gpio1: gpio@4900c000 {
33 compatible = "ti,omap2-gpio";
34 reg = <0x4900c000 0x200>;
35 interrupts = <29>;
36 ti,hwmods = "gpio1";
37 ti,gpio-always-on;
38 #gpio-cells = <2>;
39 gpio-controller;
40 #interrupt-cells = <2>;
41 interrupt-controller;
42 };
43
44 gpio2: gpio@4900e000 {
45 compatible = "ti,omap2-gpio";
46 reg = <0x4900e000 0x200>;
47 interrupts = <30>;
48 ti,hwmods = "gpio2";
49 ti,gpio-always-on;
50 #gpio-cells = <2>;
51 gpio-controller;
52 #interrupt-cells = <2>;
53 interrupt-controller;
54 };
55
56 gpio3: gpio@49010000 {
57 compatible = "ti,omap2-gpio";
58 reg = <0x49010000 0x200>;
59 interrupts = <31>;
60 ti,hwmods = "gpio3";
61 ti,gpio-always-on;
62 #gpio-cells = <2>;
63 gpio-controller;
64 #interrupt-cells = <2>;
65 interrupt-controller;
66 };
67
68 gpio4: gpio@49012000 {
69 compatible = "ti,omap2-gpio";
70 reg = <0x49012000 0x200>;
71 interrupts = <32>;
72 ti,hwmods = "gpio4";
73 ti,gpio-always-on;
74 #gpio-cells = <2>;
75 gpio-controller;
76 #interrupt-cells = <2>;
77 interrupt-controller;
78 };
79
80 gpio5: gpio@480b6000 {
81 compatible = "ti,omap2-gpio";
82 reg = <0x480b6000 0x200>;
83 interrupts = <33>;
84 ti,hwmods = "gpio5";
85 #gpio-cells = <2>;
86 gpio-controller;
87 #interrupt-cells = <2>;
88 interrupt-controller;
89 };
90
91 gpmc: gpmc@6e000000 {
92 compatible = "ti,omap2430-gpmc";
93 reg = <0x6e000000 0x1000>;
94 #address-cells = <2>;
95 #size-cells = <1>;
96 interrupts = <20>;
97 gpmc,num-cs = <8>;
98 gpmc,num-waitpins = <4>;
99 ti,hwmods = "gpmc";
100 };
101
32 mcbsp1: mcbsp@48074000 { 102 mcbsp1: mcbsp@48074000 {
33 compatible = "ti,omap2430-mcbsp"; 103 compatible = "ti,omap2430-mcbsp";
34 reg = <0x48074000 0xff>; 104 reg = <0x48074000 0xff>;
@@ -40,6 +110,9 @@
40 interrupt-names = "common", "tx", "rx", "rx_overflow"; 110 interrupt-names = "common", "tx", "rx", "rx_overflow";
41 ti,buffer-size = <128>; 111 ti,buffer-size = <128>;
42 ti,hwmods = "mcbsp1"; 112 ti,hwmods = "mcbsp1";
113 dmas = <&sdma 31>,
114 <&sdma 32>;
115 dma-names = "tx", "rx";
43 }; 116 };
44 117
45 mcbsp2: mcbsp@48076000 { 118 mcbsp2: mcbsp@48076000 {
@@ -52,6 +125,9 @@
52 interrupt-names = "common", "tx", "rx"; 125 interrupt-names = "common", "tx", "rx";
53 ti,buffer-size = <128>; 126 ti,buffer-size = <128>;
54 ti,hwmods = "mcbsp2"; 127 ti,hwmods = "mcbsp2";
128 dmas = <&sdma 33>,
129 <&sdma 34>;
130 dma-names = "tx", "rx";
55 }; 131 };
56 132
57 mcbsp3: mcbsp@4808c000 { 133 mcbsp3: mcbsp@4808c000 {
@@ -64,6 +140,9 @@
64 interrupt-names = "common", "tx", "rx"; 140 interrupt-names = "common", "tx", "rx";
65 ti,buffer-size = <128>; 141 ti,buffer-size = <128>;
66 ti,hwmods = "mcbsp3"; 142 ti,hwmods = "mcbsp3";
143 dmas = <&sdma 17>,
144 <&sdma 18>;
145 dma-names = "tx", "rx";
67 }; 146 };
68 147
69 mcbsp4: mcbsp@4808e000 { 148 mcbsp4: mcbsp@4808e000 {
@@ -76,6 +155,9 @@
76 interrupt-names = "common", "tx", "rx"; 155 interrupt-names = "common", "tx", "rx";
77 ti,buffer-size = <128>; 156 ti,buffer-size = <128>;
78 ti,hwmods = "mcbsp4"; 157 ti,hwmods = "mcbsp4";
158 dmas = <&sdma 19>,
159 <&sdma 20>;
160 dma-names = "tx", "rx";
79 }; 161 };
80 162
81 mcbsp5: mcbsp@48096000 { 163 mcbsp5: mcbsp@48096000 {
@@ -88,10 +170,13 @@
88 interrupt-names = "common", "tx", "rx"; 170 interrupt-names = "common", "tx", "rx";
89 ti,buffer-size = <128>; 171 ti,buffer-size = <128>;
90 ti,hwmods = "mcbsp5"; 172 ti,hwmods = "mcbsp5";
173 dmas = <&sdma 21>,
174 <&sdma 22>;
175 dma-names = "tx", "rx";
91 }; 176 };
92 177
93 timer1: timer@49018000 { 178 timer1: timer@49018000 {
94 compatible = "ti,omap2-timer"; 179 compatible = "ti,omap2420-timer";
95 reg = <0x49018000 0x400>; 180 reg = <0x49018000 0x400>;
96 interrupts = <37>; 181 interrupts = <37>;
97 ti,hwmods = "timer1"; 182 ti,hwmods = "timer1";
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index 3705a81c1fc2..5a31964ae339 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -13,6 +13,12 @@
13 model = "TI OMAP3 BeagleBoard xM"; 13 model = "TI OMAP3 BeagleBoard xM";
14 compatible = "ti,omap3-beagle-xm, ti,omap3-beagle", "ti,omap3"; 14 compatible = "ti,omap3-beagle-xm, ti,omap3-beagle", "ti,omap3";
15 15
16 cpus {
17 cpu@0 {
18 cpu0-supply = <&vcc>;
19 };
20 };
21
16 memory { 22 memory {
17 device_type = "memory"; 23 device_type = "memory";
18 reg = <0x80000000 0x20000000>; /* 512 MB */ 24 reg = <0x80000000 0x20000000>; /* 512 MB */
@@ -20,10 +26,6 @@
20 26
21 leds { 27 leds {
22 compatible = "gpio-leds"; 28 compatible = "gpio-leds";
23 pmu_stat {
24 label = "beagleboard::pmu_stat";
25 gpios = <&twl_gpio 19 0>; /* LEDB */
26 };
27 29
28 heartbeat { 30 heartbeat {
29 label = "beagleboard::usr0"; 31 label = "beagleboard::usr0";
@@ -38,6 +40,16 @@
38 }; 40 };
39 }; 41 };
40 42
43 pwmleds {
44 compatible = "pwm-leds";
45
46 pmu_stat {
47 label = "beagleboard::pmu_stat";
48 pwms = <&twl_pwmled 1 7812500>;
49 max-brightness = <127>;
50 };
51 };
52
41 sound { 53 sound {
42 compatible = "ti,omap-twl4030"; 54 compatible = "ti,omap-twl4030";
43 ti,model = "omap3beagle"; 55 ti,model = "omap3beagle";
@@ -107,3 +119,9 @@
107 */ 119 */
108 ti,pulldowns = <0x03a1c4>; 120 ti,pulldowns = <0x03a1c4>;
109}; 121};
122
123&usb_otg_hs {
124 interface-type = <0>;
125 mode = <3>;
126 power = <50>;
127};
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
index f624dc85d441..6eec69997607 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -7,12 +7,18 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap3.dtsi" 10/include/ "omap34xx.dtsi"
11 11
12/ { 12/ {
13 model = "TI OMAP3 BeagleBoard"; 13 model = "TI OMAP3 BeagleBoard";
14 compatible = "ti,omap3-beagle", "ti,omap3"; 14 compatible = "ti,omap3-beagle", "ti,omap3";
15 15
16 cpus {
17 cpu@0 {
18 cpu0-supply = <&vcc>;
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 */
@@ -38,6 +44,57 @@
38 }; 44 };
39 }; 45 };
40 46
47 /* HS USB Port 2 RESET */
48 hsusb2_reset: hsusb2_reset_reg {
49 compatible = "regulator-fixed";
50 regulator-name = "hsusb2_reset";
51 regulator-min-microvolt = <3300000>;
52 regulator-max-microvolt = <3300000>;
53 gpio = <&gpio5 19 0>; /* gpio_147 */
54 startup-delay-us = <70000>;
55 enable-active-high;
56 };
57
58 /* HS USB Port 2 Power */
59 hsusb2_power: hsusb2_power_reg {
60 compatible = "regulator-fixed";
61 regulator-name = "hsusb2_vbus";
62 regulator-min-microvolt = <3300000>;
63 regulator-max-microvolt = <3300000>;
64 gpio = <&twl_gpio 18 0>; /* GPIO LEDA */
65 startup-delay-us = <70000>;
66 };
67
68 /* HS USB Host PHY on PORT 2 */
69 hsusb2_phy: hsusb2_phy {
70 compatible = "usb-nop-xceiv";
71 reset-supply = <&hsusb2_reset>;
72 vcc-supply = <&hsusb2_power>;
73 };
74};
75
76&omap3_pmx_core {
77 pinctrl-names = "default";
78 pinctrl-0 = <
79 &hsusbb2_pins
80 >;
81
82 hsusbb2_pins: pinmux_hsusbb2_pins {
83 pinctrl-single,pins = <
84 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */
85 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */
86 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */
87 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */
88 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */
89 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */
90 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */
91 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */
92 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */
93 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */
94 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */
95 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */
96 >;
97 };
41}; 98};
42 99
43&i2c1 { 100&i2c1 {
@@ -65,3 +122,23 @@
65&mmc3 { 122&mmc3 {
66 status = "disabled"; 123 status = "disabled";
67}; 124};
125
126&usbhshost {
127 port2-mode = "ehci-phy";
128};
129
130&usbhsehci {
131 phys = <0 &hsusb2_phy>;
132};
133
134&twl_gpio {
135 ti,use-leds;
136 /* pullups: BIT(1) */
137 ti,pullups = <0x000002>;
138 /*
139 * pulldowns:
140 * BIT(2), BIT(6), BIT(7), BIT(8), BIT(13)
141 * BIT(15), BIT(16), BIT(17)
142 */
143 ti,pulldowns = <0x03a1c4>;
144};
diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
new file mode 100644
index 000000000000..8a5cdcc6debd
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-devkit8000.dts
@@ -0,0 +1,169 @@
1/*
2 * Author: Anil Kumar <anilk4.v@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8/dts-v1/;
9
10/include/ "omap34xx.dtsi"
11/ {
12 model = "TimLL OMAP3 Devkit8000";
13 compatible = "timll,omap3-devkit8000", "ti,omap3";
14
15 memory {
16 device_type = "memory";
17 reg = <0x80000000 0x10000000>; /* 256 MB */
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 heartbeat {
24 label = "devkit8000::led1";
25 gpios = <&gpio6 26 0>; /* 186 -> LED1 */
26 default-state = "on";
27 linux,default-trigger = "heartbeat";
28 };
29
30 mmc {
31 label = "devkit8000::led2";
32 gpios = <&gpio6 3 0>; /* 163 -> LED2 */
33 default-state = "on";
34 linux,default-trigger = "none";
35 };
36
37 usr {
38 label = "devkit8000::led3";
39 gpios = <&gpio6 4 0>; /* 164 -> LED3 */
40 default-state = "on";
41 linux,default-trigger = "usr";
42 };
43
44 };
45
46 sound {
47 compatible = "ti,omap-twl4030";
48 ti,model = "devkit8000";
49
50 ti,mcbsp = <&mcbsp2>;
51 ti,codec = <&twl_audio>;
52 ti,audio-routing =
53 "Ext Spk", "PREDRIVEL",
54 "Ext Spk", "PREDRIVER",
55 "MAINMIC", "Main Mic",
56 "Main Mic", "Mic Bias 1";
57 };
58};
59
60&i2c1 {
61 clock-frequency = <2600000>;
62
63 twl: twl@48 {
64 reg = <0x48>;
65 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
66
67 twl_audio: audio {
68 compatible = "ti,twl4030-audio";
69 codec {
70 };
71 };
72 };
73};
74
75&i2c2 {
76 status = "disabled";
77};
78
79&i2c3 {
80 status = "disabled";
81};
82
83/include/ "twl4030.dtsi"
84
85&mmc1 {
86 vmmc-supply = <&vmmc1>;
87 vmmc_aux-supply = <&vsim>;
88 bus-width = <8>;
89};
90
91&mmc2 {
92 status = "disabled";
93};
94
95&mmc3 {
96 status = "disabled";
97};
98
99&wdt2 {
100 status = "disabled";
101};
102
103&mcbsp1 {
104 status = "disabled";
105};
106
107&mcbsp3 {
108 status = "disabled";
109};
110
111&mcbsp4 {
112 status = "disabled";
113};
114
115&mcbsp5 {
116 status = "disabled";
117};
118
119&gpmc {
120 ranges = <0 0 0x30000000 0x04>; /* CS0: NAND */
121
122 nand@0,0 {
123 reg = <0 0 0>; /* CS0, offset 0 */
124 nand-bus-width = <16>;
125
126 gpmc,sync-clk = <0>;
127 gpmc,cs-on = <0>;
128 gpmc,cs-rd-off = <44>;
129 gpmc,cs-wr-off = <44>;
130 gpmc,adv-on = <6>;
131 gpmc,adv-rd-off = <34>;
132 gpmc,adv-wr-off = <44>;
133 gpmc,we-off = <40>;
134 gpmc,oe-off = <54>;
135 gpmc,access = <64>;
136 gpmc,rd-cycle = <82>;
137 gpmc,wr-cycle = <82>;
138 gpmc,wr-access = <40>;
139 gpmc,wr-data-mux-bus = <0>;
140
141 #address-cells = <1>;
142 #size-cells = <1>;
143
144 x-loader@0 {
145 label = "X-Loader";
146 reg = <0 0x80000>;
147 };
148
149 bootloaders@80000 {
150 label = "U-Boot";
151 reg = <0x80000 0x1e0000>;
152 };
153
154 bootloaders_env@260000 {
155 label = "U-Boot Env";
156 reg = <0x260000 0x20000>;
157 };
158
159 kernel@280000 {
160 label = "Kernel";
161 reg = <0x280000 0x400000>;
162 };
163
164 filesystem@680000 {
165 label = "File System";
166 reg = <0x680000 0xf980000>;
167 };
168 };
169};
diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts
index e8ba1c247a39..05f51e10ddd6 100644
--- a/arch/arm/boot/dts/omap3-evm.dts
+++ b/arch/arm/boot/dts/omap3-evm.dts
@@ -7,12 +7,18 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap3.dtsi" 10/include/ "omap34xx.dtsi"
11 11
12/ { 12/ {
13 model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)"; 13 model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)";
14 compatible = "ti,omap3-evm", "ti,omap3"; 14 compatible = "ti,omap3-evm", "ti,omap3";
15 15
16 cpus {
17 cpu@0 {
18 cpu0-supply = <&vcc>;
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 */
@@ -59,3 +65,9 @@
59&twl_gpio { 65&twl_gpio {
60 ti,use-leds; 66 ti,use-leds;
61}; 67};
68
69&usb_otg_hs {
70 interface-type = <0>;
71 mode = <3>;
72 power = <50>;
73};
diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi
new file mode 100644
index 000000000000..f8fe3b748c3e
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-igep.dtsi
@@ -0,0 +1,122 @@
1/*
2 * Device Tree Source for IGEP Technology devices
3 *
4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11/dts-v1/;
12
13/include/ "omap34xx.dtsi"
14
15/ {
16 memory {
17 device_type = "memory";
18 reg = <0x80000000 0x20000000>; /* 512 MB */
19 };
20
21 sound {
22 compatible = "ti,omap-twl4030";
23 ti,model = "igep2";
24 ti,mcbsp = <&mcbsp2>;
25 ti,codec = <&twl_audio>;
26 };
27};
28
29&omap3_pmx_core {
30 uart1_pins: pinmux_uart1_pins {
31 pinctrl-single,pins = <
32 0x152 0x100 /* uart1_rx.uart1_rx INPUT | MODE0 */
33 0x14c 0 /* uart1_tx.uart1_tx OUTPUT | MODE0 */
34 >;
35 };
36
37 uart2_pins: pinmux_uart2_pins {
38 pinctrl-single,pins = <
39 0x14a 0x100 /* uart2_rx.uart2_rx INPUT | MODE0 */
40 0x148 0 /* uart2_tx.uart2_tx OUTPUT | MODE0 */
41 >;
42 };
43
44 uart3_pins: pinmux_uart3_pins {
45 pinctrl-single,pins = <
46 0x16e 0x100 /* uart3_rx.uart3_rx INPUT | MODE0 */
47 0x170 0 /* uart3_tx.uart3_tx OUTPUT | MODE0 */
48 >;
49 };
50
51 mmc1_pins: pinmux_mmc1_pins {
52 pinctrl-single,pins = <
53 0x114 0x0118 /* sdmmc1_clk.sdmmc1_clk INPUT PULLUP | MODE 0 */
54 0x116 0x0118 /* sdmmc1_cmd.sdmmc1_cmd INPUT PULLUP | MODE 0 */
55 0x118 0x0118 /* sdmmc1_dat0.sdmmc1_dat0 INPUT PULLUP | MODE 0 */
56 0x11a 0x0118 /* sdmmc1_dat1.sdmmc1_dat1 INPUT PULLUP | MODE 0 */
57 0x11c 0x0118 /* sdmmc1_dat2.sdmmc1_dat2 INPUT PULLUP | MODE 0 */
58 0x11e 0x0118 /* sdmmc1_dat3.sdmmc1_dat3 INPUT PULLUP | MODE 0 */
59 0x120 0x0100 /* sdmmc1_dat4.sdmmc1_dat4 INPUT | MODE 0 */
60 0x122 0x0100 /* sdmmc1_dat5.sdmmc1_dat5 INPUT | MODE 0 */
61 0x124 0x0100 /* sdmmc1_dat6.sdmmc1_dat6 INPUT | MODE 0 */
62 0x126 0x0100 /* sdmmc1_dat7.sdmmc1_dat7 INPUT | MODE 0 */
63 >;
64 };
65};
66
67&i2c1 {
68 clock-frequency = <2600000>;
69
70 twl: twl@48 {
71 reg = <0x48>;
72 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
73 interrupt-parent = <&intc>;
74
75 twl_audio: audio {
76 compatible = "ti,twl4030-audio";
77 codec {
78 };
79 };
80 };
81};
82
83/include/ "twl4030.dtsi"
84
85&i2c2 {
86 clock-frequency = <400000>;
87};
88
89&mmc1 {
90 pinctrl-names = "default";
91 pinctrl-0 = <&mmc1_pins>;
92 vmmc-supply = <&vmmc1>;
93 vmmc_aux-supply = <&vsim>;
94 bus-width = <8>;
95};
96
97&mmc2 {
98 status = "disabled";
99};
100
101&mmc3 {
102 status = "disabled";
103};
104
105&uart1 {
106 pinctrl-names = "default";
107 pinctrl-0 = <&uart1_pins>;
108};
109
110&uart2 {
111 pinctrl-names = "default";
112 pinctrl-0 = <&uart2_pins>;
113};
114
115&uart3 {
116 pinctrl-names = "default";
117 pinctrl-0 = <&uart3_pins>;
118};
119
120&twl_gpio {
121 ti,use-leds;
122};
diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts
new file mode 100644
index 000000000000..e2b98490cc9a
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-igep0020.dts
@@ -0,0 +1,56 @@
1/*
2 * Device Tree Source for IGEPv2 board
3 *
4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12/include/ "omap3-igep.dtsi"
13
14/ {
15 model = "IGEPv2";
16 compatible = "isee,omap3-igep0020", "ti,omap3";
17
18 leds {
19 compatible = "gpio-leds";
20 boot {
21 label = "omap3:green:boot";
22 gpios = <&gpio1 26 0>;
23 default-state = "on";
24 };
25
26 user0 {
27 label = "omap3:red:user0";
28 gpios = <&gpio1 27 0>;
29 default-state = "off";
30 };
31
32 user1 {
33 label = "omap3:red:user1";
34 gpios = <&gpio1 28 0>;
35 default-state = "off";
36 };
37
38 user2 {
39 label = "omap3:green:user1";
40 gpios = <&twl_gpio 19 1>;
41 };
42 };
43};
44
45&i2c3 {
46 clock-frequency = <100000>;
47
48 /*
49 * Display monitor features are burnt in the EEPROM
50 * as EDID data.
51 */
52 eeprom@50 {
53 compatible = "ti,eeprom";
54 reg = <0x50>;
55 };
56};
diff --git a/arch/arm/boot/dts/omap3-igep0030.dts b/arch/arm/boot/dts/omap3-igep0030.dts
new file mode 100644
index 000000000000..9dc48d262ffb
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-igep0030.dts
@@ -0,0 +1,44 @@
1/*
2 * Device Tree Source for IGEP COM Module
3 *
4 * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
5 * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12/include/ "omap3-igep.dtsi"
13
14/ {
15 model = "IGEP COM Module";
16 compatible = "isee,omap3-igep0030", "ti,omap3";
17
18 leds {
19 compatible = "gpio-leds";
20 boot {
21 label = "omap3:green:boot";
22 gpios = <&twl_gpio 13 1>;
23 default-state = "on";
24 };
25
26 user0 {
27 label = "omap3:red:user0";
28 gpios = <&twl_gpio 18 1>; /* LEDA */
29 default-state = "off";
30 };
31
32 user1 {
33 label = "omap3:green:user1";
34 gpios = <&twl_gpio 19 1>; /* LEDB */
35 default-state = "off";
36 };
37
38 user2 {
39 label = "omap3:red:user1";
40 gpios = <&gpio1 16 1>;
41 default-state = "off";
42 };
43 };
44};
diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
index 89808ce01673..d4a7280d18b7 100644
--- a/arch/arm/boot/dts/omap3-overo.dtsi
+++ b/arch/arm/boot/dts/omap3-overo.dtsi
@@ -11,17 +11,26 @@
11 */ 11 */
12/dts-v1/; 12/dts-v1/;
13 13
14/include/ "omap3.dtsi" 14/include/ "omap34xx.dtsi"
15 15
16/ { 16/ {
17 leds { 17 pwmleds {
18 compatible = "gpio-leds"; 18 compatible = "pwm-leds";
19
19 overo { 20 overo {
20 label = "overo:blue:COM"; 21 label = "overo:blue:COM";
21 gpios = <&twl_gpio 19 0>; 22 pwms = <&twl_pwmled 1 7812500>;
22 linux,default-trigger = "mmc0"; 23 max-brightness = <127>;
23 }; 24 };
24 }; 25 };
26
27 sound {
28 compatible = "ti,omap-twl4030";
29 ti,model = "overo";
30
31 ti,mcbsp = <&mcbsp2>;
32 ti,codec = <&twl_audio>;
33 };
25}; 34};
26 35
27&i2c1 { 36&i2c1 {
@@ -31,6 +40,12 @@
31 reg = <0x48>; 40 reg = <0x48>;
32 interrupts = <7>; /* SYS_NIRQ cascaded to intc */ 41 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
33 interrupt-parent = <&intc>; 42 interrupt-parent = <&intc>;
43
44 twl_audio: audio {
45 compatible = "ti,twl4030-audio";
46 codec {
47 };
48 };
34 }; 49 };
35}; 50};
36 51
@@ -55,3 +70,9 @@
55&twl_gpio { 70&twl_gpio {
56 ti,use-leds; 71 ti,use-leds;
57}; 72};
73
74&usb_otg_hs {
75 interface-type = <0>;
76 mode = <3>;
77 power = <50>;
78};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 1acc26148ffc..4ad03d9dbf0c 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -26,8 +26,14 @@
26 }; 26 };
27 }; 27 };
28 28
29 pmu {
30 compatible = "arm,cortex-a8-pmu";
31 interrupts = <3>;
32 ti,hwmods = "debugss";
33 };
34
29 /* 35 /*
30 * The soc node represents the soc top level view. It is uses for IPs 36 * The soc node represents the soc top level view. It is used for IPs
31 * that are not memory mapped in the MPU view or for the MPU itself. 37 * that are not memory mapped in the MPU view or for the MPU itself.
32 */ 38 */
33 soc { 39 soc {
@@ -75,76 +81,101 @@
75 reg = <0x48200000 0x1000>; 81 reg = <0x48200000 0x1000>;
76 }; 82 };
77 83
84 sdma: dma-controller@48056000 {
85 compatible = "ti,omap3630-sdma", "ti,omap3430-sdma";
86 reg = <0x48056000 0x1000>;
87 interrupts = <12>,
88 <13>,
89 <14>,
90 <15>;
91 #dma-cells = <1>;
92 #dma-channels = <32>;
93 #dma-requests = <96>;
94 };
95
78 omap3_pmx_core: pinmux@48002030 { 96 omap3_pmx_core: pinmux@48002030 {
79 compatible = "ti,omap3-padconf", "pinctrl-single"; 97 compatible = "ti,omap3-padconf", "pinctrl-single";
80 reg = <0x48002030 0x05cc>; 98 reg = <0x48002030 0x05cc>;
81 #address-cells = <1>; 99 #address-cells = <1>;
82 #size-cells = <0>; 100 #size-cells = <0>;
83 pinctrl-single,register-width = <16>; 101 pinctrl-single,register-width = <16>;
84 pinctrl-single,function-mask = <0x7fff>; 102 pinctrl-single,function-mask = <0x7f1f>;
85 }; 103 };
86 104
87 omap3_pmx_wkup: pinmux@0x48002a58 { 105 omap3_pmx_wkup: pinmux@0x48002a00 {
88 compatible = "ti,omap3-padconf", "pinctrl-single"; 106 compatible = "ti,omap3-padconf", "pinctrl-single";
89 reg = <0x48002a58 0x5c>; 107 reg = <0x48002a00 0x5c>;
90 #address-cells = <1>; 108 #address-cells = <1>;
91 #size-cells = <0>; 109 #size-cells = <0>;
92 pinctrl-single,register-width = <16>; 110 pinctrl-single,register-width = <16>;
93 pinctrl-single,function-mask = <0x7fff>; 111 pinctrl-single,function-mask = <0x7f1f>;
94 }; 112 };
95 113
96 gpio1: gpio@48310000 { 114 gpio1: gpio@48310000 {
97 compatible = "ti,omap3-gpio"; 115 compatible = "ti,omap3-gpio";
116 reg = <0x48310000 0x200>;
117 interrupts = <29>;
98 ti,hwmods = "gpio1"; 118 ti,hwmods = "gpio1";
119 ti,gpio-always-on;
99 gpio-controller; 120 gpio-controller;
100 #gpio-cells = <2>; 121 #gpio-cells = <2>;
101 interrupt-controller; 122 interrupt-controller;
102 #interrupt-cells = <1>; 123 #interrupt-cells = <2>;
103 }; 124 };
104 125
105 gpio2: gpio@49050000 { 126 gpio2: gpio@49050000 {
106 compatible = "ti,omap3-gpio"; 127 compatible = "ti,omap3-gpio";
128 reg = <0x49050000 0x200>;
129 interrupts = <30>;
107 ti,hwmods = "gpio2"; 130 ti,hwmods = "gpio2";
108 gpio-controller; 131 gpio-controller;
109 #gpio-cells = <2>; 132 #gpio-cells = <2>;
110 interrupt-controller; 133 interrupt-controller;
111 #interrupt-cells = <1>; 134 #interrupt-cells = <2>;
112 }; 135 };
113 136
114 gpio3: gpio@49052000 { 137 gpio3: gpio@49052000 {
115 compatible = "ti,omap3-gpio"; 138 compatible = "ti,omap3-gpio";
139 reg = <0x49052000 0x200>;
140 interrupts = <31>;
116 ti,hwmods = "gpio3"; 141 ti,hwmods = "gpio3";
117 gpio-controller; 142 gpio-controller;
118 #gpio-cells = <2>; 143 #gpio-cells = <2>;
119 interrupt-controller; 144 interrupt-controller;
120 #interrupt-cells = <1>; 145 #interrupt-cells = <2>;
121 }; 146 };
122 147
123 gpio4: gpio@49054000 { 148 gpio4: gpio@49054000 {
124 compatible = "ti,omap3-gpio"; 149 compatible = "ti,omap3-gpio";
150 reg = <0x49054000 0x200>;
151 interrupts = <32>;
125 ti,hwmods = "gpio4"; 152 ti,hwmods = "gpio4";
126 gpio-controller; 153 gpio-controller;
127 #gpio-cells = <2>; 154 #gpio-cells = <2>;
128 interrupt-controller; 155 interrupt-controller;
129 #interrupt-cells = <1>; 156 #interrupt-cells = <2>;
130 }; 157 };
131 158
132 gpio5: gpio@49056000 { 159 gpio5: gpio@49056000 {
133 compatible = "ti,omap3-gpio"; 160 compatible = "ti,omap3-gpio";
161 reg = <0x49056000 0x200>;
162 interrupts = <33>;
134 ti,hwmods = "gpio5"; 163 ti,hwmods = "gpio5";
135 gpio-controller; 164 gpio-controller;
136 #gpio-cells = <2>; 165 #gpio-cells = <2>;
137 interrupt-controller; 166 interrupt-controller;
138 #interrupt-cells = <1>; 167 #interrupt-cells = <2>;
139 }; 168 };
140 169
141 gpio6: gpio@49058000 { 170 gpio6: gpio@49058000 {
142 compatible = "ti,omap3-gpio"; 171 compatible = "ti,omap3-gpio";
172 reg = <0x49058000 0x200>;
173 interrupts = <34>;
143 ti,hwmods = "gpio6"; 174 ti,hwmods = "gpio6";
144 gpio-controller; 175 gpio-controller;
145 #gpio-cells = <2>; 176 #gpio-cells = <2>;
146 interrupt-controller; 177 interrupt-controller;
147 #interrupt-cells = <1>; 178 #interrupt-cells = <2>;
148 }; 179 };
149 180
150 uart1: serial@4806a000 { 181 uart1: serial@4806a000 {
@@ -192,6 +223,16 @@
192 #size-cells = <0>; 223 #size-cells = <0>;
193 ti,hwmods = "mcspi1"; 224 ti,hwmods = "mcspi1";
194 ti,spi-num-cs = <4>; 225 ti,spi-num-cs = <4>;
226 dmas = <&sdma 35>,
227 <&sdma 36>,
228 <&sdma 37>,
229 <&sdma 38>,
230 <&sdma 39>,
231 <&sdma 40>,
232 <&sdma 41>,
233 <&sdma 42>;
234 dma-names = "tx0", "rx0", "tx1", "rx1",
235 "tx2", "rx2", "tx3", "rx3";
195 }; 236 };
196 237
197 mcspi2: spi@4809a000 { 238 mcspi2: spi@4809a000 {
@@ -200,6 +241,11 @@
200 #size-cells = <0>; 241 #size-cells = <0>;
201 ti,hwmods = "mcspi2"; 242 ti,hwmods = "mcspi2";
202 ti,spi-num-cs = <2>; 243 ti,spi-num-cs = <2>;
244 dmas = <&sdma 43>,
245 <&sdma 44>,
246 <&sdma 45>,
247 <&sdma 46>;
248 dma-names = "tx0", "rx0", "tx1", "rx1";
203 }; 249 };
204 250
205 mcspi3: spi@480b8000 { 251 mcspi3: spi@480b8000 {
@@ -208,6 +254,11 @@
208 #size-cells = <0>; 254 #size-cells = <0>;
209 ti,hwmods = "mcspi3"; 255 ti,hwmods = "mcspi3";
210 ti,spi-num-cs = <2>; 256 ti,spi-num-cs = <2>;
257 dmas = <&sdma 15>,
258 <&sdma 16>,
259 <&sdma 23>,
260 <&sdma 24>;
261 dma-names = "tx0", "rx0", "tx1", "rx1";
211 }; 262 };
212 263
213 mcspi4: spi@480ba000 { 264 mcspi4: spi@480ba000 {
@@ -216,22 +267,30 @@
216 #size-cells = <0>; 267 #size-cells = <0>;
217 ti,hwmods = "mcspi4"; 268 ti,hwmods = "mcspi4";
218 ti,spi-num-cs = <1>; 269 ti,spi-num-cs = <1>;
270 dmas = <&sdma 70>, <&sdma 71>;
271 dma-names = "tx0", "rx0";
219 }; 272 };
220 273
221 mmc1: mmc@4809c000 { 274 mmc1: mmc@4809c000 {
222 compatible = "ti,omap3-hsmmc"; 275 compatible = "ti,omap3-hsmmc";
223 ti,hwmods = "mmc1"; 276 ti,hwmods = "mmc1";
224 ti,dual-volt; 277 ti,dual-volt;
278 dmas = <&sdma 61>, <&sdma 62>;
279 dma-names = "tx", "rx";
225 }; 280 };
226 281
227 mmc2: mmc@480b4000 { 282 mmc2: mmc@480b4000 {
228 compatible = "ti,omap3-hsmmc"; 283 compatible = "ti,omap3-hsmmc";
229 ti,hwmods = "mmc2"; 284 ti,hwmods = "mmc2";
285 dmas = <&sdma 47>, <&sdma 48>;
286 dma-names = "tx", "rx";
230 }; 287 };
231 288
232 mmc3: mmc@480ad000 { 289 mmc3: mmc@480ad000 {
233 compatible = "ti,omap3-hsmmc"; 290 compatible = "ti,omap3-hsmmc";
234 ti,hwmods = "mmc3"; 291 ti,hwmods = "mmc3";
292 dmas = <&sdma 77>, <&sdma 78>;
293 dma-names = "tx", "rx";
235 }; 294 };
236 295
237 wdt2: wdt@48314000 { 296 wdt2: wdt@48314000 {
@@ -249,6 +308,9 @@
249 interrupt-names = "common", "tx", "rx"; 308 interrupt-names = "common", "tx", "rx";
250 ti,buffer-size = <128>; 309 ti,buffer-size = <128>;
251 ti,hwmods = "mcbsp1"; 310 ti,hwmods = "mcbsp1";
311 dmas = <&sdma 31>,
312 <&sdma 32>;
313 dma-names = "tx", "rx";
252 }; 314 };
253 315
254 mcbsp2: mcbsp@49022000 { 316 mcbsp2: mcbsp@49022000 {
@@ -263,6 +325,9 @@
263 interrupt-names = "common", "tx", "rx", "sidetone"; 325 interrupt-names = "common", "tx", "rx", "sidetone";
264 ti,buffer-size = <1280>; 326 ti,buffer-size = <1280>;
265 ti,hwmods = "mcbsp2", "mcbsp2_sidetone"; 327 ti,hwmods = "mcbsp2", "mcbsp2_sidetone";
328 dmas = <&sdma 33>,
329 <&sdma 34>;
330 dma-names = "tx", "rx";
266 }; 331 };
267 332
268 mcbsp3: mcbsp@49024000 { 333 mcbsp3: mcbsp@49024000 {
@@ -277,6 +342,9 @@
277 interrupt-names = "common", "tx", "rx", "sidetone"; 342 interrupt-names = "common", "tx", "rx", "sidetone";
278 ti,buffer-size = <128>; 343 ti,buffer-size = <128>;
279 ti,hwmods = "mcbsp3", "mcbsp3_sidetone"; 344 ti,hwmods = "mcbsp3", "mcbsp3_sidetone";
345 dmas = <&sdma 17>,
346 <&sdma 18>;
347 dma-names = "tx", "rx";
280 }; 348 };
281 349
282 mcbsp4: mcbsp@49026000 { 350 mcbsp4: mcbsp@49026000 {
@@ -289,6 +357,9 @@
289 interrupt-names = "common", "tx", "rx"; 357 interrupt-names = "common", "tx", "rx";
290 ti,buffer-size = <128>; 358 ti,buffer-size = <128>;
291 ti,hwmods = "mcbsp4"; 359 ti,hwmods = "mcbsp4";
360 dmas = <&sdma 19>,
361 <&sdma 20>;
362 dma-names = "tx", "rx";
292 }; 363 };
293 364
294 mcbsp5: mcbsp@48096000 { 365 mcbsp5: mcbsp@48096000 {
@@ -301,10 +372,13 @@
301 interrupt-names = "common", "tx", "rx"; 372 interrupt-names = "common", "tx", "rx";
302 ti,buffer-size = <128>; 373 ti,buffer-size = <128>;
303 ti,hwmods = "mcbsp5"; 374 ti,hwmods = "mcbsp5";
375 dmas = <&sdma 21>,
376 <&sdma 22>;
377 dma-names = "tx", "rx";
304 }; 378 };
305 379
306 timer1: timer@48318000 { 380 timer1: timer@48318000 {
307 compatible = "ti,omap2-timer"; 381 compatible = "ti,omap3430-timer";
308 reg = <0x48318000 0x400>; 382 reg = <0x48318000 0x400>;
309 interrupts = <37>; 383 interrupts = <37>;
310 ti,hwmods = "timer1"; 384 ti,hwmods = "timer1";
@@ -312,28 +386,28 @@
312 }; 386 };
313 387
314 timer2: timer@49032000 { 388 timer2: timer@49032000 {
315 compatible = "ti,omap2-timer"; 389 compatible = "ti,omap3430-timer";
316 reg = <0x49032000 0x400>; 390 reg = <0x49032000 0x400>;
317 interrupts = <38>; 391 interrupts = <38>;
318 ti,hwmods = "timer2"; 392 ti,hwmods = "timer2";
319 }; 393 };
320 394
321 timer3: timer@49034000 { 395 timer3: timer@49034000 {
322 compatible = "ti,omap2-timer"; 396 compatible = "ti,omap3430-timer";
323 reg = <0x49034000 0x400>; 397 reg = <0x49034000 0x400>;
324 interrupts = <39>; 398 interrupts = <39>;
325 ti,hwmods = "timer3"; 399 ti,hwmods = "timer3";
326 }; 400 };
327 401
328 timer4: timer@49036000 { 402 timer4: timer@49036000 {
329 compatible = "ti,omap2-timer"; 403 compatible = "ti,omap3430-timer";
330 reg = <0x49036000 0x400>; 404 reg = <0x49036000 0x400>;
331 interrupts = <40>; 405 interrupts = <40>;
332 ti,hwmods = "timer4"; 406 ti,hwmods = "timer4";
333 }; 407 };
334 408
335 timer5: timer@49038000 { 409 timer5: timer@49038000 {
336 compatible = "ti,omap2-timer"; 410 compatible = "ti,omap3430-timer";
337 reg = <0x49038000 0x400>; 411 reg = <0x49038000 0x400>;
338 interrupts = <41>; 412 interrupts = <41>;
339 ti,hwmods = "timer5"; 413 ti,hwmods = "timer5";
@@ -341,7 +415,7 @@
341 }; 415 };
342 416
343 timer6: timer@4903a000 { 417 timer6: timer@4903a000 {
344 compatible = "ti,omap2-timer"; 418 compatible = "ti,omap3430-timer";
345 reg = <0x4903a000 0x400>; 419 reg = <0x4903a000 0x400>;
346 interrupts = <42>; 420 interrupts = <42>;
347 ti,hwmods = "timer6"; 421 ti,hwmods = "timer6";
@@ -349,7 +423,7 @@
349 }; 423 };
350 424
351 timer7: timer@4903c000 { 425 timer7: timer@4903c000 {
352 compatible = "ti,omap2-timer"; 426 compatible = "ti,omap3430-timer";
353 reg = <0x4903c000 0x400>; 427 reg = <0x4903c000 0x400>;
354 interrupts = <43>; 428 interrupts = <43>;
355 ti,hwmods = "timer7"; 429 ti,hwmods = "timer7";
@@ -357,7 +431,7 @@
357 }; 431 };
358 432
359 timer8: timer@4903e000 { 433 timer8: timer@4903e000 {
360 compatible = "ti,omap2-timer"; 434 compatible = "ti,omap3430-timer";
361 reg = <0x4903e000 0x400>; 435 reg = <0x4903e000 0x400>;
362 interrupts = <44>; 436 interrupts = <44>;
363 ti,hwmods = "timer8"; 437 ti,hwmods = "timer8";
@@ -366,7 +440,7 @@
366 }; 440 };
367 441
368 timer9: timer@49040000 { 442 timer9: timer@49040000 {
369 compatible = "ti,omap2-timer"; 443 compatible = "ti,omap3430-timer";
370 reg = <0x49040000 0x400>; 444 reg = <0x49040000 0x400>;
371 interrupts = <45>; 445 interrupts = <45>;
372 ti,hwmods = "timer9"; 446 ti,hwmods = "timer9";
@@ -374,7 +448,7 @@
374 }; 448 };
375 449
376 timer10: timer@48086000 { 450 timer10: timer@48086000 {
377 compatible = "ti,omap2-timer"; 451 compatible = "ti,omap3430-timer";
378 reg = <0x48086000 0x400>; 452 reg = <0x48086000 0x400>;
379 interrupts = <46>; 453 interrupts = <46>;
380 ti,hwmods = "timer10"; 454 ti,hwmods = "timer10";
@@ -382,7 +456,7 @@
382 }; 456 };
383 457
384 timer11: timer@48088000 { 458 timer11: timer@48088000 {
385 compatible = "ti,omap2-timer"; 459 compatible = "ti,omap3430-timer";
386 reg = <0x48088000 0x400>; 460 reg = <0x48088000 0x400>;
387 interrupts = <47>; 461 interrupts = <47>;
388 ti,hwmods = "timer11"; 462 ti,hwmods = "timer11";
@@ -390,12 +464,65 @@
390 }; 464 };
391 465
392 timer12: timer@48304000 { 466 timer12: timer@48304000 {
393 compatible = "ti,omap2-timer"; 467 compatible = "ti,omap3430-timer";
394 reg = <0x48304000 0x400>; 468 reg = <0x48304000 0x400>;
395 interrupts = <95>; 469 interrupts = <95>;
396 ti,hwmods = "timer12"; 470 ti,hwmods = "timer12";
397 ti,timer-alwon; 471 ti,timer-alwon;
398 ti,timer-secure; 472 ti,timer-secure;
399 }; 473 };
474
475 usbhstll: usbhstll@48062000 {
476 compatible = "ti,usbhs-tll";
477 reg = <0x48062000 0x1000>;
478 interrupts = <78>;
479 ti,hwmods = "usb_tll_hs";
480 };
481
482 usbhshost: usbhshost@48064000 {
483 compatible = "ti,usbhs-host";
484 reg = <0x48064000 0x400>;
485 ti,hwmods = "usb_host_hs";
486 #address-cells = <1>;
487 #size-cells = <1>;
488 ranges;
489
490 usbhsohci: ohci@48064400 {
491 compatible = "ti,ohci-omap3", "usb-ohci";
492 reg = <0x48064400 0x400>;
493 interrupt-parent = <&intc>;
494 interrupts = <76>;
495 };
496
497 usbhsehci: ehci@48064800 {
498 compatible = "ti,ehci-omap", "usb-ehci";
499 reg = <0x48064800 0x400>;
500 interrupt-parent = <&intc>;
501 interrupts = <77>;
502 };
503 };
504
505 gpmc: gpmc@6e000000 {
506 compatible = "ti,omap3430-gpmc";
507 ti,hwmods = "gpmc";
508 reg = <0x6e000000 0x02d0>;
509 interrupts = <20>;
510 gpmc,num-cs = <8>;
511 gpmc,num-waitpins = <4>;
512 #address-cells = <2>;
513 #size-cells = <1>;
514 };
515
516 usb_otg_hs: usb_otg_hs@480ab000 {
517 compatible = "ti,omap3-musb";
518 reg = <0x480ab000 0x1000>;
519 interrupts = <0 92 0x4>, <0 93 0x4>;
520 interrupt-names = "mc", "dma";
521 ti,hwmods = "usb_otg_hs";
522 usb-phy = <&usb2_phy>;
523 multipoint = <1>;
524 num-eps = <16>;
525 ram-bits = <12>;
526 };
400 }; 527 };
401}; 528};
diff --git a/arch/arm/boot/dts/omap3430-sdp.dts b/arch/arm/boot/dts/omap3430-sdp.dts
new file mode 100644
index 000000000000..144ae43453c4
--- /dev/null
+++ b/arch/arm/boot/dts/omap3430-sdp.dts
@@ -0,0 +1,190 @@
1/*
2 * Copyright (C) 2013 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/ "omap34xx.dtsi"
11
12/ {
13 model = "TI OMAP3430 SDP";
14 compatible = "ti,omap3430-sdp", "ti,omap3";
15
16 memory {
17 device_type = "memory";
18 reg = <0x80000000 0x10000000>; /* 256 MB */
19 };
20};
21
22&i2c1 {
23 clock-frequency = <2600000>;
24
25 twl: twl@48 {
26 reg = <0x48>;
27 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
28 };
29};
30
31/include/ "twl4030.dtsi"
32
33&mmc1 {
34 vmmc-supply = <&vmmc1>;
35 vmmc_aux-supply = <&vsim>;
36 bus-width = <8>;
37};
38
39&mmc2 {
40 status = "disabled";
41};
42
43&mmc3 {
44 status = "disabled";
45};
46
47&gpmc {
48 ranges = <0 0 0x10000000 0x08000000>,
49 <1 0 0x28000000 0x08000000>,
50 <2 0 0x20000000 0x10000000>;
51
52 nor@0,0 {
53 compatible = "cfi-flash";
54 linux,mtd-name= "intel,pf48f6000m0y1be";
55 #address-cells = <1>;
56 #size-cells = <1>;
57 reg = <0 0 0x08000000>;
58 bank-width = <2>;
59
60 gpmc,mux-add-data = <2>;
61 gpmc,cs-on-ns = <0>;
62 gpmc,cs-rd-off-ns = <186>;
63 gpmc,cs-wr-off-ns = <186>;
64 gpmc,adv-on-ns = <12>;
65 gpmc,adv-rd-off-ns = <48>;
66 gpmc,adv-wr-off-ns = <48>;
67 gpmc,oe-on-ns = <54>;
68 gpmc,oe-off-ns = <168>;
69 gpmc,we-on-ns = <54>;
70 gpmc,we-off-ns = <168>;
71 gpmc,rd-cycle-ns = <186>;
72 gpmc,wr-cycle-ns = <186>;
73 gpmc,access-ns = <114>;
74 gpmc,page-burst-access-ns = <6>;
75 gpmc,bus-turnaround-ns = <12>;
76 gpmc,cycle2cycle-delay-ns = <18>;
77 gpmc,wr-data-mux-bus-ns = <90>;
78 gpmc,wr-access-ns = <186>;
79 gpmc,cycle2cycle-samecsen;
80 gpmc,cycle2cycle-diffcsen;
81
82 partition@0 {
83 label = "bootloader-nor";
84 reg = <0 0x40000>;
85 };
86 partition@0x40000 {
87 label = "params-nor";
88 reg = <0x40000 0x40000>;
89 };
90 partition@0x80000 {
91 label = "kernel-nor";
92 reg = <0x80000 0x200000>;
93 };
94 partition@0x280000 {
95 label = "filesystem-nor";
96 reg = <0x240000 0x7d80000>;
97 };
98 };
99
100 nand@1,0 {
101 linux,mtd-name= "micron,mt29f1g08abb";
102 #address-cells = <1>;
103 #size-cells = <1>;
104 reg = <1 0 0x08000000>;
105 nand-bus-width = <8>;
106
107 ti,nand-ecc-opt = "sw";
108 gpmc,device-nand;
109 gpmc,cs-on-ns = <0>;
110 gpmc,cs-rd-off-ns = <36>;
111 gpmc,cs-wr-off-ns = <36>;
112 gpmc,adv-on-ns = <6>;
113 gpmc,adv-rd-off-ns = <24>;
114 gpmc,adv-wr-off-ns = <36>;
115 gpmc,oe-on-ns = <6>;
116 gpmc,oe-off-ns = <48>;
117 gpmc,we-on-ns = <6>;
118 gpmc,we-off-ns = <30>;
119 gpmc,rd-cycle-ns = <72>;
120 gpmc,wr-cycle-ns = <72>;
121 gpmc,access-ns = <54>;
122 gpmc,wr-access-ns = <30>;
123
124 partition@0 {
125 label = "xloader-nand";
126 reg = <0 0x80000>;
127 };
128 partition@0x80000 {
129 label = "bootloader-nand";
130 reg = <0x80000 0x140000>;
131 };
132 partition@0x1c0000 {
133 label = "params-nand";
134 reg = <0x1c0000 0xc0000>;
135 };
136 partition@0x280000 {
137 label = "kernel-nand";
138 reg = <0x280000 0x500000>;
139 };
140 partition@0x780000 {
141 label = "filesystem-nand";
142 reg = <0x780000 0x7880000>;
143 };
144 };
145
146 onenand@2,0 {
147 linux,mtd-name= "samsung,kfm2g16q2m-deb8";
148 #address-cells = <1>;
149 #size-cells = <1>;
150 reg = <2 0 0x10000000>;
151
152 gpmc,device-width = <2>;
153 gpmc,mux-add-data = <2>;
154 gpmc,cs-on-ns = <0>;
155 gpmc,cs-rd-off-ns = <84>;
156 gpmc,cs-wr-off-ns = <72>;
157 gpmc,adv-on-ns = <0>;
158 gpmc,adv-rd-off-ns = <18>;
159 gpmc,adv-wr-off-ns = <18>;
160 gpmc,oe-on-ns = <30>;
161 gpmc,oe-off-ns = <84>;
162 gpmc,we-on-ns = <0>;
163 gpmc,we-off-ns = <42>;
164 gpmc,rd-cycle-ns = <108>;
165 gpmc,wr-cycle-ns = <96>;
166 gpmc,access-ns = <78>;
167 gpmc,wr-data-mux-bus-ns = <30>;
168
169 partition@0 {
170 label = "xloader-onenand";
171 reg = <0 0x80000>;
172 };
173 partition@0x80000 {
174 label = "bootloader-onenand";
175 reg = <0x80000 0x40000>;
176 };
177 partition@0xc0000 {
178 label = "params-onenand";
179 reg = <0xc0000 0x20000>;
180 };
181 partition@0xe0000 {
182 label = "kernel-onenand";
183 reg = <0xe0000 0x200000>;
184 };
185 partition@0x2e0000 {
186 label = "filesystem-onenand";
187 reg = <0x2e0000 0xfd20000>;
188 };
189 };
190};
diff --git a/arch/arm/boot/dts/omap34xx.dtsi b/arch/arm/boot/dts/omap34xx.dtsi
new file mode 100644
index 000000000000..75ed4ae2e631
--- /dev/null
+++ b/arch/arm/boot/dts/omap34xx.dtsi
@@ -0,0 +1,28 @@
1/*
2 * Device Tree Source for OMAP34xx/OMAP35xx SoC
3 *
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/include/ "omap3.dtsi"
12
13/ {
14 cpus {
15 cpu@0 {
16 /* OMAP343x/OMAP35xx variants OPP1-5 */
17 operating-points = <
18 /* kHz uV */
19 125000 975000
20 250000 1075000
21 500000 1200000
22 550000 1270000
23 600000 1350000
24 >;
25 clock-latency = <300000>; /* From legacy driver */
26 };
27 };
28};
diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
index 96bf0287cb9f..b89233e43b0f 100644
--- a/arch/arm/boot/dts/omap36xx.dtsi
+++ b/arch/arm/boot/dts/omap36xx.dtsi
@@ -15,6 +15,19 @@
15 serial3 = &uart4; 15 serial3 = &uart4;
16 }; 16 };
17 17
18 cpus {
19 /* OMAP3630/OMAP37xx 'standard device' variants OPP50 to OPP130 */
20 cpu@0 {
21 operating-points = <
22 /* kHz uV */
23 300000 975000
24 600000 1075000
25 800000 1200000
26 >;
27 clock-latency = <300000>; /* From legacy driver */
28 };
29 };
30
18 ocp { 31 ocp {
19 uart4: serial@49042000 { 32 uart4: serial@49042000 {
20 compatible = "ti,omap3-uart"; 33 compatible = "ti,omap3-uart";
diff --git a/arch/arm/boot/dts/omap4-panda-a4.dts b/arch/arm/boot/dts/omap4-panda-a4.dts
index 75466d2abfb5..e30cdf0f5ac1 100644
--- a/arch/arm/boot/dts/omap4-panda-a4.dts
+++ b/arch/arm/boot/dts/omap4-panda-a4.dts
@@ -5,7 +5,10 @@
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8/include/ "omap4-panda.dts" 8/dts-v1/;
9
10/include/ "omap443x.dtsi"
11/include/ "omap4-panda-common.dtsi"
9 12
10/* Pandaboard Rev A4+ have external pullups on SCL & SDA */ 13/* Pandaboard Rev A4+ have external pullups on SCL & SDA */
11&dss_hdmi_pins { 14&dss_hdmi_pins {
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
new file mode 100644
index 000000000000..03bd60deb52b
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -0,0 +1,251 @@
1/*
2 * Copyright (C) 2011-2013 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/ "elpida_ecb240abacn.dtsi"
9
10/ {
11 model = "TI OMAP4 PandaBoard";
12 compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
13
14 memory {
15 device_type = "memory";
16 reg = <0x80000000 0x40000000>; /* 1 GB */
17 };
18
19 leds {
20 compatible = "gpio-leds";
21 heartbeat {
22 label = "pandaboard::status1";
23 gpios = <&gpio1 7 0>;
24 linux,default-trigger = "heartbeat";
25 };
26
27 mmc {
28 label = "pandaboard::status2";
29 gpios = <&gpio1 8 0>;
30 linux,default-trigger = "mmc0";
31 };
32 };
33
34 sound: sound {
35 compatible = "ti,abe-twl6040";
36 ti,model = "PandaBoard";
37
38 ti,mclk-freq = <38400000>;
39
40 ti,mcpdm = <&mcpdm>;
41
42 ti,twl6040 = <&twl6040>;
43
44 /* Audio routing */
45 ti,audio-routing =
46 "Headset Stereophone", "HSOL",
47 "Headset Stereophone", "HSOR",
48 "Ext Spk", "HFL",
49 "Ext Spk", "HFR",
50 "Line Out", "AUXL",
51 "Line Out", "AUXR",
52 "HSMIC", "Headset Mic",
53 "Headset Mic", "Headset Mic Bias",
54 "AFML", "Line In",
55 "AFMR", "Line In";
56 };
57};
58
59&omap4_pmx_core {
60 pinctrl-names = "default";
61 pinctrl-0 = <
62 &twl6040_pins
63 &mcpdm_pins
64 &mcbsp1_pins
65 &dss_hdmi_pins
66 &tpd12s015_pins
67 >;
68
69 twl6040_pins: pinmux_twl6040_pins {
70 pinctrl-single,pins = <
71 0xe0 0x3 /* hdq_sio.gpio_127 OUTPUT | MODE3 */
72 0x160 0x100 /* sys_nirq2.sys_nirq2 INPUT | MODE0 */
73 >;
74 };
75
76 mcpdm_pins: pinmux_mcpdm_pins {
77 pinctrl-single,pins = <
78 0xc6 0x108 /* abe_pdm_ul_data.abe_pdm_ul_data INPUT PULLDOWN | MODE0 */
79 0xc8 0x108 /* abe_pdm_dl_data.abe_pdm_dl_data INPUT PULLDOWN | MODE0 */
80 0xca 0x118 /* abe_pdm_frame.abe_pdm_frame INPUT PULLUP | MODE0 */
81 0xcc 0x108 /* abe_pdm_lb_clk.abe_pdm_lb_clk INPUT PULLDOWN | MODE0 */
82 0xce 0x108 /* abe_clks.abe_clks INPUT PULLDOWN | MODE0 */
83 >;
84 };
85
86 mcbsp1_pins: pinmux_mcbsp1_pins {
87 pinctrl-single,pins = <
88 0xbe 0x100 /* abe_mcbsp1_clkx.abe_mcbsp1_clkx INPUT | MODE0 */
89 0xc0 0x108 /* abe_mcbsp1_dr.abe_mcbsp1_dr INPUT PULLDOWN | MODE0 */
90 0xc2 0x8 /* abe_mcbsp1_dx.abe_mcbsp1_dx OUTPUT PULLDOWN | MODE0 */
91 0xc4 0x100 /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */
92 >;
93 };
94
95 dss_hdmi_pins: pinmux_dss_hdmi_pins {
96 pinctrl-single,pins = <
97 0x5a 0x118 /* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */
98 0x5c 0x118 /* hdmi_scl.hdmi_scl INPUT PULLUP | MODE 0 */
99 0x5e 0x118 /* hdmi_sda.hdmi_sda INPUT PULLUP | MODE 0 */
100 >;
101 };
102
103 tpd12s015_pins: pinmux_tpd12s015_pins {
104 pinctrl-single,pins = <
105 0x22 0x3 /* gpmc_a17.gpio_41 OUTPUT | MODE3 */
106 0x48 0x3 /* gpmc_nbe1.gpio_60 OUTPUT | MODE3 */
107 0x58 0x10b /* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */
108 >;
109 };
110
111 i2c1_pins: pinmux_i2c1_pins {
112 pinctrl-single,pins = <
113 0xe2 0x118 /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
114 0xe4 0x118 /* i2c1_sda PULLUP | INPUTENABLE | MODE0 */
115 >;
116 };
117
118 i2c2_pins: pinmux_i2c2_pins {
119 pinctrl-single,pins = <
120 0xe6 0x118 /* i2c2_scl PULLUP | INPUTENABLE | MODE0 */
121 0xe8 0x118 /* i2c2_sda PULLUP | INPUTENABLE | MODE0 */
122 >;
123 };
124
125 i2c3_pins: pinmux_i2c3_pins {
126 pinctrl-single,pins = <
127 0xea 0x118 /* i2c3_scl PULLUP | INPUTENABLE | MODE0 */
128 0xec 0x118 /* i2c3_sda PULLUP | INPUTENABLE | MODE0 */
129 >;
130 };
131
132 i2c4_pins: pinmux_i2c4_pins {
133 pinctrl-single,pins = <
134 0xee 0x118 /* i2c4_scl PULLUP | INPUTENABLE | MODE0 */
135 0xf0 0x118 /* i2c4_sda PULLUP | INPUTENABLE | MODE0 */
136 >;
137 };
138};
139
140&i2c1 {
141 pinctrl-names = "default";
142 pinctrl-0 = <&i2c1_pins>;
143
144 clock-frequency = <400000>;
145
146 twl: twl@48 {
147 reg = <0x48>;
148 /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */
149 interrupts = <0 7 4>; /* IRQ_SYS_1N cascaded to gic */
150 interrupt-parent = <&gic>;
151 };
152
153 twl6040: twl@4b {
154 compatible = "ti,twl6040";
155 reg = <0x4b>;
156 /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
157 interrupts = <0 119 4>; /* IRQ_SYS_2N cascaded to gic */
158 interrupt-parent = <&gic>;
159 ti,audpwron-gpio = <&gpio4 31 0>; /* gpio line 127 */
160
161 vio-supply = <&v1v8>;
162 v2v1-supply = <&v2v1>;
163 enable-active-high;
164 };
165};
166
167/include/ "twl6030.dtsi"
168
169&i2c2 {
170 pinctrl-names = "default";
171 pinctrl-0 = <&i2c2_pins>;
172
173 clock-frequency = <400000>;
174};
175
176&i2c3 {
177 pinctrl-names = "default";
178 pinctrl-0 = <&i2c3_pins>;
179
180 clock-frequency = <100000>;
181
182 /*
183 * Display monitor features are burnt in their EEPROM as EDID data.
184 * The EEPROM is connected as I2C slave device.
185 */
186 eeprom@50 {
187 compatible = "ti,eeprom";
188 reg = <0x50>;
189 };
190};
191
192&i2c4 {
193 pinctrl-names = "default";
194 pinctrl-0 = <&i2c4_pins>;
195
196 clock-frequency = <400000>;
197};
198
199&mmc1 {
200 vmmc-supply = <&vmmc>;
201 bus-width = <8>;
202};
203
204&mmc2 {
205 status = "disabled";
206};
207
208&mmc3 {
209 status = "disabled";
210};
211
212&mmc4 {
213 status = "disabled";
214};
215
216&mmc5 {
217 ti,non-removable;
218 bus-width = <4>;
219};
220
221&emif1 {
222 cs1-used;
223 device-handle = <&elpida_ECB240ABACN>;
224};
225
226&emif2 {
227 cs1-used;
228 device-handle = <&elpida_ECB240ABACN>;
229};
230
231&mcbsp2 {
232 status = "disabled";
233};
234
235&mcbsp3 {
236 status = "disabled";
237};
238
239&dmic {
240 status = "disabled";
241};
242
243&twl_usb_comparator {
244 usb-supply = <&vusb>;
245};
246
247&usb_otg_hs {
248 interface-type = <1>;
249 mode = <3>;
250 power = <50>;
251};
diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts
index 73bc1a67e444..f1d8c217ce12 100644
--- a/arch/arm/boot/dts/omap4-panda-es.dts
+++ b/arch/arm/boot/dts/omap4-panda-es.dts
@@ -5,7 +5,10 @@
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8/include/ "omap4-panda.dts" 8/dts-v1/;
9
10/include/ "omap4460.dtsi"
11/include/ "omap4-panda-common.dtsi"
9 12
10/* Audio routing is differnet between PandaBoard4430 and PandaBoardES */ 13/* Audio routing is differnet between PandaBoard4430 and PandaBoardES */
11&sound { 14&sound {
diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
index 4122efe31cfd..f8b221f0168e 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -7,202 +7,5 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap4.dtsi" 10/include/ "omap443x.dtsi"
11/include/ "elpida_ecb240abacn.dtsi" 11/include/ "omap4-panda-common.dtsi"
12
13/ {
14 model = "TI OMAP4 PandaBoard";
15 compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
16
17 memory {
18 device_type = "memory";
19 reg = <0x80000000 0x40000000>; /* 1 GB */
20 };
21
22 leds {
23 compatible = "gpio-leds";
24 heartbeat {
25 label = "pandaboard::status1";
26 gpios = <&gpio1 7 0>;
27 linux,default-trigger = "heartbeat";
28 };
29
30 mmc {
31 label = "pandaboard::status2";
32 gpios = <&gpio1 8 0>;
33 linux,default-trigger = "mmc0";
34 };
35 };
36
37 sound: sound {
38 compatible = "ti,abe-twl6040";
39 ti,model = "PandaBoard";
40
41 ti,mclk-freq = <38400000>;
42
43 ti,mcpdm = <&mcpdm>;
44
45 ti,twl6040 = <&twl6040>;
46
47 /* Audio routing */
48 ti,audio-routing =
49 "Headset Stereophone", "HSOL",
50 "Headset Stereophone", "HSOR",
51 "Ext Spk", "HFL",
52 "Ext Spk", "HFR",
53 "Line Out", "AUXL",
54 "Line Out", "AUXR",
55 "HSMIC", "Headset Mic",
56 "Headset Mic", "Headset Mic Bias",
57 "AFML", "Line In",
58 "AFMR", "Line In";
59 };
60};
61
62&omap4_pmx_core {
63 pinctrl-names = "default";
64 pinctrl-0 = <
65 &twl6040_pins
66 &mcpdm_pins
67 &mcbsp1_pins
68 &dss_hdmi_pins
69 &tpd12s015_pins
70 >;
71
72 twl6040_pins: pinmux_twl6040_pins {
73 pinctrl-single,pins = <
74 0xe0 0x3 /* hdq_sio.gpio_127 OUTPUT | MODE3 */
75 0x160 0x100 /* sys_nirq2.sys_nirq2 INPUT | MODE0 */
76 >;
77 };
78
79 mcpdm_pins: pinmux_mcpdm_pins {
80 pinctrl-single,pins = <
81 0xc6 0x108 /* abe_pdm_ul_data.abe_pdm_ul_data INPUT PULLDOWN | MODE0 */
82 0xc8 0x108 /* abe_pdm_dl_data.abe_pdm_dl_data INPUT PULLDOWN | MODE0 */
83 0xca 0x118 /* abe_pdm_frame.abe_pdm_frame INPUT PULLUP | MODE0 */
84 0xcc 0x108 /* abe_pdm_lb_clk.abe_pdm_lb_clk INPUT PULLDOWN | MODE0 */
85 0xce 0x108 /* abe_clks.abe_clks INPUT PULLDOWN | MODE0 */
86 >;
87 };
88
89 mcbsp1_pins: pinmux_mcbsp1_pins {
90 pinctrl-single,pins = <
91 0xbe 0x100 /* abe_mcbsp1_clkx.abe_mcbsp1_clkx INPUT | MODE0 */
92 0xc0 0x108 /* abe_mcbsp1_dr.abe_mcbsp1_dr INPUT PULLDOWN | MODE0 */
93 0xc2 0x8 /* abe_mcbsp1_dx.abe_mcbsp1_dx OUTPUT PULLDOWN | MODE0 */
94 0xc4 0x100 /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */
95 >;
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 };
113};
114
115&i2c1 {
116 clock-frequency = <400000>;
117
118 twl: twl@48 {
119 reg = <0x48>;
120 /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */
121 interrupts = <0 7 4>; /* IRQ_SYS_1N cascaded to gic */
122 interrupt-parent = <&gic>;
123 };
124
125 twl6040: twl@4b {
126 compatible = "ti,twl6040";
127 reg = <0x4b>;
128 /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
129 interrupts = <0 119 4>; /* IRQ_SYS_2N cascaded to gic */
130 interrupt-parent = <&gic>;
131 ti,audpwron-gpio = <&gpio4 31 0>; /* gpio line 127 */
132
133 vio-supply = <&v1v8>;
134 v2v1-supply = <&v2v1>;
135 enable-active-high;
136 };
137};
138
139/include/ "twl6030.dtsi"
140
141&i2c2 {
142 clock-frequency = <400000>;
143};
144
145&i2c3 {
146 clock-frequency = <100000>;
147
148 /*
149 * Display monitor features are burnt in their EEPROM as EDID data.
150 * The EEPROM is connected as I2C slave device.
151 */
152 eeprom@50 {
153 compatible = "ti,eeprom";
154 reg = <0x50>;
155 };
156};
157
158&i2c4 {
159 clock-frequency = <400000>;
160};
161
162&mmc1 {
163 vmmc-supply = <&vmmc>;
164 bus-width = <8>;
165};
166
167&mmc2 {
168 status = "disabled";
169};
170
171&mmc3 {
172 status = "disabled";
173};
174
175&mmc4 {
176 status = "disabled";
177};
178
179&mmc5 {
180 ti,non-removable;
181 bus-width = <4>;
182};
183
184&emif1 {
185 cs1-used;
186 device-handle = <&elpida_ECB240ABACN>;
187};
188
189&emif2 {
190 cs1-used;
191 device-handle = <&elpida_ECB240ABACN>;
192};
193
194&mcbsp2 {
195 status = "disabled";
196};
197
198&mcbsp3 {
199 status = "disabled";
200};
201
202&dmic {
203 status = "disabled";
204};
205
206&twl_usb_comparator {
207 usb-supply = <&vusb>;
208};
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 43e5258a9372..c387bdc1b1d1 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -7,7 +7,7 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap4.dtsi" 10/include/ "omap443x.dtsi"
11/include/ "elpida_ecb240abacn.dtsi" 11/include/ "elpida_ecb240abacn.dtsi"
12 12
13/ { 13/ {
@@ -80,6 +80,32 @@
80 }; 80 };
81 }; 81 };
82 82
83 pwmleds {
84 compatible = "pwm-leds";
85 kpad {
86 label = "omap4::keypad";
87 pwms = <&twl_pwm 0 7812500>;
88 max-brightness = <127>;
89 };
90
91 charging {
92 label = "omap4:green:chrg";
93 pwms = <&twl_pwmled 0 7812500>;
94 max-brightness = <255>;
95 };
96 };
97
98 backlight {
99 compatible = "pwm-backlight";
100 pwms = <&twl_pwm 1 7812500>;
101 brightness-levels = <
102 0 10 20 30 40
103 50 60 70 80 90
104 100 110 120 127
105 >;
106 default-brightness-level = <13>;
107 };
108
83 sound { 109 sound {
84 compatible = "ti,abe-twl6040"; 110 compatible = "ti,abe-twl6040";
85 ti,model = "SDP4430"; 111 ti,model = "SDP4430";
@@ -212,9 +238,40 @@
212 0x58 0x10b /* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */ 238 0x58 0x10b /* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */
213 >; 239 >;
214 }; 240 };
241
242 i2c1_pins: pinmux_i2c1_pins {
243 pinctrl-single,pins = <
244 0xe2 0x118 /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
245 0xe4 0x118 /* i2c1_sda PULLUP | INPUTENABLE | MODE0 */
246 >;
247 };
248
249 i2c2_pins: pinmux_i2c2_pins {
250 pinctrl-single,pins = <
251 0xe6 0x118 /* i2c2_scl PULLUP | INPUTENABLE | MODE0 */
252 0xe8 0x118 /* i2c2_sda PULLUP | INPUTENABLE | MODE0 */
253 >;
254 };
255
256 i2c3_pins: pinmux_i2c3_pins {
257 pinctrl-single,pins = <
258 0xea 0x118 /* i2c3_scl PULLUP | INPUTENABLE | MODE0 */
259 0xec 0x118 /* i2c3_sda PULLUP | INPUTENABLE | MODE0 */
260 >;
261 };
262
263 i2c4_pins: pinmux_i2c4_pins {
264 pinctrl-single,pins = <
265 0xee 0x118 /* i2c4_scl PULLUP | INPUTENABLE | MODE0 */
266 0xf0 0x118 /* i2c4_sda PULLUP | INPUTENABLE | MODE0 */
267 >;
268 };
215}; 269};
216 270
217&i2c1 { 271&i2c1 {
272 pinctrl-names = "default";
273 pinctrl-0 = <&i2c1_pins>;
274
218 clock-frequency = <400000>; 275 clock-frequency = <400000>;
219 276
220 twl: twl@48 { 277 twl: twl@48 {
@@ -253,10 +310,16 @@
253/include/ "twl6030.dtsi" 310/include/ "twl6030.dtsi"
254 311
255&i2c2 { 312&i2c2 {
313 pinctrl-names = "default";
314 pinctrl-0 = <&i2c2_pins>;
315
256 clock-frequency = <400000>; 316 clock-frequency = <400000>;
257}; 317};
258 318
259&i2c3 { 319&i2c3 {
320 pinctrl-names = "default";
321 pinctrl-0 = <&i2c3_pins>;
322
260 clock-frequency = <400000>; 323 clock-frequency = <400000>;
261 324
262 /* 325 /*
@@ -279,6 +342,9 @@
279}; 342};
280 343
281&i2c4 { 344&i2c4 {
345 pinctrl-names = "default";
346 pinctrl-0 = <&i2c4_pins>;
347
282 clock-frequency = <400000>; 348 clock-frequency = <400000>;
283 349
284 /* 350 /*
@@ -428,3 +494,9 @@
428&twl_usb_comparator { 494&twl_usb_comparator {
429 usb-supply = <&vusb>; 495 usb-supply = <&vusb>;
430}; 496};
497
498&usb_otg_hs {
499 interface-type = <1>;
500 mode = <3>;
501 power = <50>;
502};
diff --git a/arch/arm/boot/dts/omap4-var-som.dts b/arch/arm/boot/dts/omap4-var-som.dts
index 6601e6af6092..222a413c2c51 100644
--- a/arch/arm/boot/dts/omap4-var-som.dts
+++ b/arch/arm/boot/dts/omap4-var-som.dts
@@ -7,7 +7,7 @@
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9 9
10/include/ "omap4.dtsi" 10/include/ "omap443x.dtsi"
11 11
12/ { 12/ {
13 model = "Variscite OMAP4 SOM"; 13 model = "Variscite OMAP4 SOM";
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 739bb79e410e..2a5642882c8a 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -94,6 +94,11 @@
94 #size-cells = <1>; 94 #size-cells = <1>;
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 reg = <0x44000000 0x1000>,
98 <0x44800000 0x2000>,
99 <0x45000000 0x1000>;
100 interrupts = <0 9 0x4>,
101 <0 10 0x4>;
97 102
98 counter32k: counter@4a304000 { 103 counter32k: counter@4a304000 {
99 compatible = "ti,omap-counter32k"; 104 compatible = "ti,omap-counter32k";
@@ -118,15 +123,28 @@
118 pinctrl-single,function-mask = <0x7fff>; 123 pinctrl-single,function-mask = <0x7fff>;
119 }; 124 };
120 125
126 sdma: dma-controller@4a056000 {
127 compatible = "ti,omap4430-sdma";
128 reg = <0x4a056000 0x1000>;
129 interrupts = <0 12 0x4>,
130 <0 13 0x4>,
131 <0 14 0x4>,
132 <0 15 0x4>;
133 #dma-cells = <1>;
134 #dma-channels = <32>;
135 #dma-requests = <127>;
136 };
137
121 gpio1: gpio@4a310000 { 138 gpio1: gpio@4a310000 {
122 compatible = "ti,omap4-gpio"; 139 compatible = "ti,omap4-gpio";
123 reg = <0x4a310000 0x200>; 140 reg = <0x4a310000 0x200>;
124 interrupts = <0 29 0x4>; 141 interrupts = <0 29 0x4>;
125 ti,hwmods = "gpio1"; 142 ti,hwmods = "gpio1";
143 ti,gpio-always-on;
126 gpio-controller; 144 gpio-controller;
127 #gpio-cells = <2>; 145 #gpio-cells = <2>;
128 interrupt-controller; 146 interrupt-controller;
129 #interrupt-cells = <1>; 147 #interrupt-cells = <2>;
130 }; 148 };
131 149
132 gpio2: gpio@48055000 { 150 gpio2: gpio@48055000 {
@@ -137,7 +155,7 @@
137 gpio-controller; 155 gpio-controller;
138 #gpio-cells = <2>; 156 #gpio-cells = <2>;
139 interrupt-controller; 157 interrupt-controller;
140 #interrupt-cells = <1>; 158 #interrupt-cells = <2>;
141 }; 159 };
142 160
143 gpio3: gpio@48057000 { 161 gpio3: gpio@48057000 {
@@ -148,7 +166,7 @@
148 gpio-controller; 166 gpio-controller;
149 #gpio-cells = <2>; 167 #gpio-cells = <2>;
150 interrupt-controller; 168 interrupt-controller;
151 #interrupt-cells = <1>; 169 #interrupt-cells = <2>;
152 }; 170 };
153 171
154 gpio4: gpio@48059000 { 172 gpio4: gpio@48059000 {
@@ -159,7 +177,7 @@
159 gpio-controller; 177 gpio-controller;
160 #gpio-cells = <2>; 178 #gpio-cells = <2>;
161 interrupt-controller; 179 interrupt-controller;
162 #interrupt-cells = <1>; 180 #interrupt-cells = <2>;
163 }; 181 };
164 182
165 gpio5: gpio@4805b000 { 183 gpio5: gpio@4805b000 {
@@ -170,7 +188,7 @@
170 gpio-controller; 188 gpio-controller;
171 #gpio-cells = <2>; 189 #gpio-cells = <2>;
172 interrupt-controller; 190 interrupt-controller;
173 #interrupt-cells = <1>; 191 #interrupt-cells = <2>;
174 }; 192 };
175 193
176 gpio6: gpio@4805d000 { 194 gpio6: gpio@4805d000 {
@@ -181,7 +199,18 @@
181 gpio-controller; 199 gpio-controller;
182 #gpio-cells = <2>; 200 #gpio-cells = <2>;
183 interrupt-controller; 201 interrupt-controller;
184 #interrupt-cells = <1>; 202 #interrupt-cells = <2>;
203 };
204
205 gpmc: gpmc@50000000 {
206 compatible = "ti,omap4430-gpmc";
207 reg = <0x50000000 0x1000>;
208 #address-cells = <2>;
209 #size-cells = <1>;
210 interrupts = <0 20 0x4>;
211 gpmc,num-cs = <8>;
212 gpmc,num-waitpins = <4>;
213 ti,hwmods = "gpmc";
185 }; 214 };
186 215
187 uart1: serial@4806a000 { 216 uart1: serial@4806a000 {
@@ -260,6 +289,16 @@
260 #size-cells = <0>; 289 #size-cells = <0>;
261 ti,hwmods = "mcspi1"; 290 ti,hwmods = "mcspi1";
262 ti,spi-num-cs = <4>; 291 ti,spi-num-cs = <4>;
292 dmas = <&sdma 35>,
293 <&sdma 36>,
294 <&sdma 37>,
295 <&sdma 38>,
296 <&sdma 39>,
297 <&sdma 40>,
298 <&sdma 41>,
299 <&sdma 42>;
300 dma-names = "tx0", "rx0", "tx1", "rx1",
301 "tx2", "rx2", "tx3", "rx3";
263 }; 302 };
264 303
265 mcspi2: spi@4809a000 { 304 mcspi2: spi@4809a000 {
@@ -270,6 +309,11 @@
270 #size-cells = <0>; 309 #size-cells = <0>;
271 ti,hwmods = "mcspi2"; 310 ti,hwmods = "mcspi2";
272 ti,spi-num-cs = <2>; 311 ti,spi-num-cs = <2>;
312 dmas = <&sdma 43>,
313 <&sdma 44>,
314 <&sdma 45>,
315 <&sdma 46>;
316 dma-names = "tx0", "rx0", "tx1", "rx1";
273 }; 317 };
274 318
275 mcspi3: spi@480b8000 { 319 mcspi3: spi@480b8000 {
@@ -280,6 +324,8 @@
280 #size-cells = <0>; 324 #size-cells = <0>;
281 ti,hwmods = "mcspi3"; 325 ti,hwmods = "mcspi3";
282 ti,spi-num-cs = <2>; 326 ti,spi-num-cs = <2>;
327 dmas = <&sdma 15>, <&sdma 16>;
328 dma-names = "tx0", "rx0";
283 }; 329 };
284 330
285 mcspi4: spi@480ba000 { 331 mcspi4: spi@480ba000 {
@@ -290,6 +336,8 @@
290 #size-cells = <0>; 336 #size-cells = <0>;
291 ti,hwmods = "mcspi4"; 337 ti,hwmods = "mcspi4";
292 ti,spi-num-cs = <1>; 338 ti,spi-num-cs = <1>;
339 dmas = <&sdma 70>, <&sdma 71>;
340 dma-names = "tx0", "rx0";
293 }; 341 };
294 342
295 mmc1: mmc@4809c000 { 343 mmc1: mmc@4809c000 {
@@ -299,6 +347,8 @@
299 ti,hwmods = "mmc1"; 347 ti,hwmods = "mmc1";
300 ti,dual-volt; 348 ti,dual-volt;
301 ti,needs-special-reset; 349 ti,needs-special-reset;
350 dmas = <&sdma 61>, <&sdma 62>;
351 dma-names = "tx", "rx";
302 }; 352 };
303 353
304 mmc2: mmc@480b4000 { 354 mmc2: mmc@480b4000 {
@@ -307,6 +357,8 @@
307 interrupts = <0 86 0x4>; 357 interrupts = <0 86 0x4>;
308 ti,hwmods = "mmc2"; 358 ti,hwmods = "mmc2";
309 ti,needs-special-reset; 359 ti,needs-special-reset;
360 dmas = <&sdma 47>, <&sdma 48>;
361 dma-names = "tx", "rx";
310 }; 362 };
311 363
312 mmc3: mmc@480ad000 { 364 mmc3: mmc@480ad000 {
@@ -315,6 +367,8 @@
315 interrupts = <0 94 0x4>; 367 interrupts = <0 94 0x4>;
316 ti,hwmods = "mmc3"; 368 ti,hwmods = "mmc3";
317 ti,needs-special-reset; 369 ti,needs-special-reset;
370 dmas = <&sdma 77>, <&sdma 78>;
371 dma-names = "tx", "rx";
318 }; 372 };
319 373
320 mmc4: mmc@480d1000 { 374 mmc4: mmc@480d1000 {
@@ -323,6 +377,8 @@
323 interrupts = <0 96 0x4>; 377 interrupts = <0 96 0x4>;
324 ti,hwmods = "mmc4"; 378 ti,hwmods = "mmc4";
325 ti,needs-special-reset; 379 ti,needs-special-reset;
380 dmas = <&sdma 57>, <&sdma 58>;
381 dma-names = "tx", "rx";
326 }; 382 };
327 383
328 mmc5: mmc@480d5000 { 384 mmc5: mmc@480d5000 {
@@ -331,6 +387,8 @@
331 interrupts = <0 59 0x4>; 387 interrupts = <0 59 0x4>;
332 ti,hwmods = "mmc5"; 388 ti,hwmods = "mmc5";
333 ti,needs-special-reset; 389 ti,needs-special-reset;
390 dmas = <&sdma 59>, <&sdma 60>;
391 dma-names = "tx", "rx";
334 }; 392 };
335 393
336 wdt2: wdt@4a314000 { 394 wdt2: wdt@4a314000 {
@@ -347,6 +405,9 @@
347 reg-names = "mpu", "dma"; 405 reg-names = "mpu", "dma";
348 interrupts = <0 112 0x4>; 406 interrupts = <0 112 0x4>;
349 ti,hwmods = "mcpdm"; 407 ti,hwmods = "mcpdm";
408 dmas = <&sdma 65>,
409 <&sdma 66>;
410 dma-names = "up_link", "dn_link";
350 }; 411 };
351 412
352 dmic: dmic@4012e000 { 413 dmic: dmic@4012e000 {
@@ -356,6 +417,8 @@
356 reg-names = "mpu", "dma"; 417 reg-names = "mpu", "dma";
357 interrupts = <0 114 0x4>; 418 interrupts = <0 114 0x4>;
358 ti,hwmods = "dmic"; 419 ti,hwmods = "dmic";
420 dmas = <&sdma 67>;
421 dma-names = "up_link";
359 }; 422 };
360 423
361 mcbsp1: mcbsp@40122000 { 424 mcbsp1: mcbsp@40122000 {
@@ -367,6 +430,9 @@
367 interrupt-names = "common"; 430 interrupt-names = "common";
368 ti,buffer-size = <128>; 431 ti,buffer-size = <128>;
369 ti,hwmods = "mcbsp1"; 432 ti,hwmods = "mcbsp1";
433 dmas = <&sdma 33>,
434 <&sdma 34>;
435 dma-names = "tx", "rx";
370 }; 436 };
371 437
372 mcbsp2: mcbsp@40124000 { 438 mcbsp2: mcbsp@40124000 {
@@ -378,6 +444,9 @@
378 interrupt-names = "common"; 444 interrupt-names = "common";
379 ti,buffer-size = <128>; 445 ti,buffer-size = <128>;
380 ti,hwmods = "mcbsp2"; 446 ti,hwmods = "mcbsp2";
447 dmas = <&sdma 17>,
448 <&sdma 18>;
449 dma-names = "tx", "rx";
381 }; 450 };
382 451
383 mcbsp3: mcbsp@40126000 { 452 mcbsp3: mcbsp@40126000 {
@@ -389,6 +458,9 @@
389 interrupt-names = "common"; 458 interrupt-names = "common";
390 ti,buffer-size = <128>; 459 ti,buffer-size = <128>;
391 ti,hwmods = "mcbsp3"; 460 ti,hwmods = "mcbsp3";
461 dmas = <&sdma 19>,
462 <&sdma 20>;
463 dma-names = "tx", "rx";
392 }; 464 };
393 465
394 mcbsp4: mcbsp@48096000 { 466 mcbsp4: mcbsp@48096000 {
@@ -399,6 +471,9 @@
399 interrupt-names = "common"; 471 interrupt-names = "common";
400 ti,buffer-size = <128>; 472 ti,buffer-size = <128>;
401 ti,hwmods = "mcbsp4"; 473 ti,hwmods = "mcbsp4";
474 dmas = <&sdma 31>,
475 <&sdma 32>;
476 dma-names = "tx", "rx";
402 }; 477 };
403 478
404 keypad: keypad@4a31c000 { 479 keypad: keypad@4a31c000 {
@@ -438,10 +513,15 @@
438 #size-cells = <1>; 513 #size-cells = <1>;
439 ranges; 514 ranges;
440 ti,hwmods = "ocp2scp_usb_phy"; 515 ti,hwmods = "ocp2scp_usb_phy";
516 usb2_phy: usb2phy@4a0ad080 {
517 compatible = "ti,omap-usb2";
518 reg = <0x4a0ad080 0x58>;
519 ctrl-module = <&omap_control_usb>;
520 };
441 }; 521 };
442 522
443 timer1: timer@4a318000 { 523 timer1: timer@4a318000 {
444 compatible = "ti,omap2-timer"; 524 compatible = "ti,omap3430-timer";
445 reg = <0x4a318000 0x80>; 525 reg = <0x4a318000 0x80>;
446 interrupts = <0 37 0x4>; 526 interrupts = <0 37 0x4>;
447 ti,hwmods = "timer1"; 527 ti,hwmods = "timer1";
@@ -449,28 +529,28 @@
449 }; 529 };
450 530
451 timer2: timer@48032000 { 531 timer2: timer@48032000 {
452 compatible = "ti,omap2-timer"; 532 compatible = "ti,omap3430-timer";
453 reg = <0x48032000 0x80>; 533 reg = <0x48032000 0x80>;
454 interrupts = <0 38 0x4>; 534 interrupts = <0 38 0x4>;
455 ti,hwmods = "timer2"; 535 ti,hwmods = "timer2";
456 }; 536 };
457 537
458 timer3: timer@48034000 { 538 timer3: timer@48034000 {
459 compatible = "ti,omap2-timer"; 539 compatible = "ti,omap4430-timer";
460 reg = <0x48034000 0x80>; 540 reg = <0x48034000 0x80>;
461 interrupts = <0 39 0x4>; 541 interrupts = <0 39 0x4>;
462 ti,hwmods = "timer3"; 542 ti,hwmods = "timer3";
463 }; 543 };
464 544
465 timer4: timer@48036000 { 545 timer4: timer@48036000 {
466 compatible = "ti,omap2-timer"; 546 compatible = "ti,omap4430-timer";
467 reg = <0x48036000 0x80>; 547 reg = <0x48036000 0x80>;
468 interrupts = <0 40 0x4>; 548 interrupts = <0 40 0x4>;
469 ti,hwmods = "timer4"; 549 ti,hwmods = "timer4";
470 }; 550 };
471 551
472 timer5: timer@40138000 { 552 timer5: timer@40138000 {
473 compatible = "ti,omap2-timer"; 553 compatible = "ti,omap4430-timer";
474 reg = <0x40138000 0x80>, 554 reg = <0x40138000 0x80>,
475 <0x49038000 0x80>; 555 <0x49038000 0x80>;
476 interrupts = <0 41 0x4>; 556 interrupts = <0 41 0x4>;
@@ -479,7 +559,7 @@
479 }; 559 };
480 560
481 timer6: timer@4013a000 { 561 timer6: timer@4013a000 {
482 compatible = "ti,omap2-timer"; 562 compatible = "ti,omap4430-timer";
483 reg = <0x4013a000 0x80>, 563 reg = <0x4013a000 0x80>,
484 <0x4903a000 0x80>; 564 <0x4903a000 0x80>;
485 interrupts = <0 42 0x4>; 565 interrupts = <0 42 0x4>;
@@ -488,7 +568,7 @@
488 }; 568 };
489 569
490 timer7: timer@4013c000 { 570 timer7: timer@4013c000 {
491 compatible = "ti,omap2-timer"; 571 compatible = "ti,omap4430-timer";
492 reg = <0x4013c000 0x80>, 572 reg = <0x4013c000 0x80>,
493 <0x4903c000 0x80>; 573 <0x4903c000 0x80>;
494 interrupts = <0 43 0x4>; 574 interrupts = <0 43 0x4>;
@@ -497,7 +577,7 @@
497 }; 577 };
498 578
499 timer8: timer@4013e000 { 579 timer8: timer@4013e000 {
500 compatible = "ti,omap2-timer"; 580 compatible = "ti,omap4430-timer";
501 reg = <0x4013e000 0x80>, 581 reg = <0x4013e000 0x80>,
502 <0x4903e000 0x80>; 582 <0x4903e000 0x80>;
503 interrupts = <0 44 0x4>; 583 interrupts = <0 44 0x4>;
@@ -507,7 +587,7 @@
507 }; 587 };
508 588
509 timer9: timer@4803e000 { 589 timer9: timer@4803e000 {
510 compatible = "ti,omap2-timer"; 590 compatible = "ti,omap4430-timer";
511 reg = <0x4803e000 0x80>; 591 reg = <0x4803e000 0x80>;
512 interrupts = <0 45 0x4>; 592 interrupts = <0 45 0x4>;
513 ti,hwmods = "timer9"; 593 ti,hwmods = "timer9";
@@ -515,7 +595,7 @@
515 }; 595 };
516 596
517 timer10: timer@48086000 { 597 timer10: timer@48086000 {
518 compatible = "ti,omap2-timer"; 598 compatible = "ti,omap3430-timer";
519 reg = <0x48086000 0x80>; 599 reg = <0x48086000 0x80>;
520 interrupts = <0 46 0x4>; 600 interrupts = <0 46 0x4>;
521 ti,hwmods = "timer10"; 601 ti,hwmods = "timer10";
@@ -523,11 +603,62 @@
523 }; 603 };
524 604
525 timer11: timer@48088000 { 605 timer11: timer@48088000 {
526 compatible = "ti,omap2-timer"; 606 compatible = "ti,omap4430-timer";
527 reg = <0x48088000 0x80>; 607 reg = <0x48088000 0x80>;
528 interrupts = <0 47 0x4>; 608 interrupts = <0 47 0x4>;
529 ti,hwmods = "timer11"; 609 ti,hwmods = "timer11";
530 ti,timer-pwm; 610 ti,timer-pwm;
531 }; 611 };
612
613 usbhstll: usbhstll@4a062000 {
614 compatible = "ti,usbhs-tll";
615 reg = <0x4a062000 0x1000>;
616 interrupts = <0 78 0x4>;
617 ti,hwmods = "usb_tll_hs";
618 };
619
620 usbhshost: usbhshost@4a064000 {
621 compatible = "ti,usbhs-host";
622 reg = <0x4a064000 0x800>;
623 ti,hwmods = "usb_host_hs";
624 #address-cells = <1>;
625 #size-cells = <1>;
626 ranges;
627
628 usbhsohci: ohci@4a064800 {
629 compatible = "ti,ohci-omap3", "usb-ohci";
630 reg = <0x4a064800 0x400>;
631 interrupt-parent = <&gic>;
632 interrupts = <0 76 0x4>;
633 };
634
635 usbhsehci: ehci@4a064c00 {
636 compatible = "ti,ehci-omap", "usb-ehci";
637 reg = <0x4a064c00 0x400>;
638 interrupt-parent = <&gic>;
639 interrupts = <0 77 0x4>;
640 };
641 };
642
643 omap_control_usb: omap-control-usb@4a002300 {
644 compatible = "ti,omap-control-usb";
645 reg = <0x4a002300 0x4>,
646 <0x4a00233c 0x4>;
647 reg-names = "control_dev_conf", "otghs_control";
648 ti,type = <1>;
649 };
650
651 usb_otg_hs: usb_otg_hs@4a0ab000 {
652 compatible = "ti,omap4-musb";
653 reg = <0x4a0ab000 0x7ff>;
654 interrupts = <0 92 0x4>, <0 93 0x4>;
655 interrupt-names = "mc", "dma";
656 ti,hwmods = "usb_otg_hs";
657 usb-phy = <&usb2_phy>;
658 multipoint = <1>;
659 num-eps = <16>;
660 ram-bits = <12>;
661 ti,has-mailbox;
662 };
532 }; 663 };
533}; 664};
diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
new file mode 100644
index 000000000000..cccf39af4925
--- /dev/null
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -0,0 +1,27 @@
1/*
2 * Device Tree Source for OMAP443x SoC
3 *
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/include/ "omap4.dtsi"
12
13/ {
14 cpus {
15 cpu@0 {
16 /* OMAP443x variants OPP50-OPPNT */
17 operating-points = <
18 /* kHz uV */
19 300000 1025000
20 600000 1200000
21 800000 1313000
22 1008000 1375000
23 >;
24 clock-latency = <300000>; /* From legacy driver */
25 };
26 };
27};
diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
new file mode 100644
index 000000000000..7c2c23cc17ef
--- /dev/null
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -0,0 +1,32 @@
1/*
2 * Device Tree Source for OMAP4460 SoC
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10/include/ "omap4.dtsi"
11
12/ {
13 cpus {
14 /* OMAP446x 'standard device' variants OPP50 to OPPTurbo */
15 cpu@0 {
16 operating-points = <
17 /* kHz uV */
18 350000 975000
19 700000 1075000
20 920000 1200000
21 >;
22 clock-latency = <300000>; /* From legacy driver */
23 };
24 };
25
26 pmu {
27 compatible = "arm,cortex-a9-pmu";
28 interrupts = <0 54 0x4>,
29 <0 55 0x4>;
30 ti,hwmods = "debugss";
31 };
32};
diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
index 8722c15bbba2..982acd19477d 100644
--- a/arch/arm/boot/dts/omap5-evm.dts
+++ b/arch/arm/boot/dts/omap5-evm.dts
@@ -16,7 +16,7 @@
16 16
17 memory { 17 memory {
18 device_type = "memory"; 18 device_type = "memory";
19 reg = <0x80000000 0x80000000>; /* 2 GB */ 19 reg = <0x80000000 0x7F000000>; /* 2032 MB */
20 }; 20 };
21 21
22 vmmcsd_fixed: fixedregulator-mmcsd { 22 vmmcsd_fixed: fixedregulator-mmcsd {
@@ -80,6 +80,68 @@
80 0x15a 0x100 /* abemcbsp2_clkx.abemcbsp2_clkx INPUT | MODE0 */ 80 0x15a 0x100 /* abemcbsp2_clkx.abemcbsp2_clkx INPUT | MODE0 */
81 >; 81 >;
82 }; 82 };
83
84 i2c1_pins: pinmux_i2c1_pins {
85 pinctrl-single,pins = <
86 0x1b2 0x118 /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
87 0x1b4 0x118 /* i2c1_sda PULLUP | INPUTENABLE | MODE0 */
88 >;
89 };
90
91 i2c2_pins: pinmux_i2c2_pins {
92 pinctrl-single,pins = <
93 0x178 0x100 /* i2c2_scl INPUTENABLE | MODE0 */
94 0x17a 0x100 /* i2c2_sda INPUTENABLE | MODE0 */
95 >;
96 };
97
98 i2c3_pins: pinmux_i2c3_pins {
99 pinctrl-single,pins = <
100 0x13a 0x100 /* i2c3_scl INPUTENABLE | MODE0 */
101 0x13c 0x100 /* i2c3_sda INPUTENABLE | MODE0 */
102 >;
103 };
104
105 i2c4_pins: pinmux_i2c4_pins {
106 pinctrl-single,pins = <
107 0xb8 0x100 /* i2c4_scl INPUTENABLE | MODE0 */
108 0xba 0x100 /* i2c4_sda INPUTENABLE | MODE0 */
109 >;
110 };
111
112 i2c5_pins: pinmux_i2c5_pins {
113 pinctrl-single,pins = <
114 0x184 0x100 /* i2c5_scl INPUTENABLE | MODE0 */
115 0x186 0x100 /* i2c5_sda INPUTENABLE | MODE0 */
116 >;
117 };
118
119 mcspi2_pins: pinmux_mcspi2_pins {
120 pinctrl-single,pins = <
121 0xbc 0x100 /* MCSPI2_CLK INPUTENABLE | MODE0 */
122 0xbe 0x100 /* MCSPI2_SIMO INPUTENABLE | MODE0 */
123 0xc0 0x118 /* MCSPI2_SOMI PULLUP | INPUTENABLE | MODE0*/
124 0xc2 0x0 /* MCSPI2_CS MODE0*/
125 >;
126 };
127
128 mcspi3_pins: pinmux_mcspi3_pins {
129 pinctrl-single,pins = <
130 0x78 0x101 /* MCSPI2_SOMI INPUTENABLE | MODE1 */
131 0x7a 0x101 /* MCSPI2_CS INPUTENABLE | MODE1 */
132 0x7c 0x101 /* MCSPI2_SIMO INPUTENABLE | MODE1 */
133 0x7e 0x101 /* MCSPI2_CLK INPUTENABLE | MODE1 */
134 >;
135 };
136
137 mcspi4_pins: pinmux_mcspi4_pins {
138 pinctrl-single,pins = <
139 0x164 0x101 /* MCSPI2_CLK INPUTENABLE | MODE1 */
140 0x168 0x101 /* MCSPI2_SIMO INPUTENABLE | MODE1 */
141 0x16a 0x101 /* MCSPI2_SOMI INPUTENABLE | MODE1 */
142 0x16c 0x101 /* MCSPI2_CS INPUTENABLE | MODE1 */
143 >;
144 };
83}; 145};
84 146
85&mmc1 { 147&mmc1 {
@@ -106,7 +168,17 @@
106 status = "disabled"; 168 status = "disabled";
107}; 169};
108 170
171&i2c1 {
172 pinctrl-names = "default";
173 pinctrl-0 = <&i2c1_pins>;
174
175 clock-frequency = <400000>;
176};
177
109&i2c2 { 178&i2c2 {
179 pinctrl-names = "default";
180 pinctrl-0 = <&i2c2_pins>;
181
110 clock-frequency = <400000>; 182 clock-frequency = <400000>;
111 183
112 /* Pressure Sensor */ 184 /* Pressure Sensor */
@@ -116,7 +188,17 @@
116 }; 188 };
117}; 189};
118 190
191&i2c3 {
192 pinctrl-names = "default";
193 pinctrl-0 = <&i2c3_pins>;
194
195 clock-frequency = <400000>;
196};
197
119&i2c4 { 198&i2c4 {
199 pinctrl-names = "default";
200 pinctrl-0 = <&i2c4_pins>;
201
120 clock-frequency = <400000>; 202 clock-frequency = <400000>;
121 203
122 /* Temperature Sensor */ 204 /* Temperature Sensor */
@@ -126,6 +208,13 @@
126 }; 208 };
127}; 209};
128 210
211&i2c5 {
212 pinctrl-names = "default";
213 pinctrl-0 = <&i2c5_pins>;
214
215 clock-frequency = <400000>;
216};
217
129&keypad { 218&keypad {
130 keypad,num-rows = <8>; 219 keypad,num-rows = <8>;
131 keypad,num-columns = <8>; 220 keypad,num-columns = <8>;
@@ -151,3 +240,22 @@
151 cs1-used; 240 cs1-used;
152 device-handle = <&samsung_K3PE0E000B>; 241 device-handle = <&samsung_K3PE0E000B>;
153}; 242};
243
244&mcspi1 {
245
246};
247
248&mcspi2 {
249 pinctrl-names = "default";
250 pinctrl-0 = <&mcspi2_pins>;
251};
252
253&mcspi3 {
254 pinctrl-names = "default";
255 pinctrl-0 = <&mcspi3_pins>;
256};
257
258&mcspi4 {
259 pinctrl-names = "default";
260 pinctrl-0 = <&mcspi4_pins>;
261};
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 790bb2a4b343..3dd7ff825828 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -18,6 +18,9 @@
18/include/ "skeleton.dtsi" 18/include/ "skeleton.dtsi"
19 19
20/ { 20/ {
21 #address-cells = <1>;
22 #size-cells = <1>;
23
21 compatible = "ti,omap5"; 24 compatible = "ti,omap5";
22 interrupt-parent = <&gic>; 25 interrupt-parent = <&gic>;
23 26
@@ -33,24 +36,32 @@
33 cpus { 36 cpus {
34 cpu@0 { 37 cpu@0 {
35 compatible = "arm,cortex-a15"; 38 compatible = "arm,cortex-a15";
36 timer {
37 compatible = "arm,armv7-timer";
38 /* 14th PPI IRQ, active low level-sensitive */
39 interrupts = <1 14 0x308>;
40 clock-frequency = <6144000>;
41 };
42 }; 39 };
43 cpu@1 { 40 cpu@1 {
44 compatible = "arm,cortex-a15"; 41 compatible = "arm,cortex-a15";
45 timer {
46 compatible = "arm,armv7-timer";
47 /* 14th PPI IRQ, active low level-sensitive */
48 interrupts = <1 14 0x308>;
49 clock-frequency = <6144000>;
50 };
51 }; 42 };
52 }; 43 };
53 44
45 timer {
46 compatible = "arm,armv7-timer";
47 /* PPI secure/nonsecure IRQ, active low level-sensitive */
48 interrupts = <1 13 0x308>,
49 <1 14 0x308>,
50 <1 11 0x308>,
51 <1 10 0x308>;
52 clock-frequency = <6144000>;
53 };
54
55 gic: interrupt-controller@48211000 {
56 compatible = "arm,cortex-a15-gic";
57 interrupt-controller;
58 #interrupt-cells = <3>;
59 reg = <0x48211000 0x1000>,
60 <0x48212000 0x1000>,
61 <0x48214000 0x2000>,
62 <0x48216000 0x2000>;
63 };
64
54 /* 65 /*
55 * The soc node represents the soc top level view. It is uses for IPs 66 * The soc node represents the soc top level view. It is uses for IPs
56 * that are not memory mapped in the MPU view or for the MPU itself. 67 * that are not memory mapped in the MPU view or for the MPU itself.
@@ -76,6 +87,11 @@
76 #size-cells = <1>; 87 #size-cells = <1>;
77 ranges; 88 ranges;
78 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3"; 89 ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
90 reg = <0x44000000 0x2000>,
91 <0x44800000 0x3000>,
92 <0x45000000 0x4000>;
93 interrupts = <0 9 0x4>,
94 <0 10 0x4>;
79 95
80 counter32k: counter@4ae04000 { 96 counter32k: counter@4ae04000 {
81 compatible = "ti,omap-counter32k"; 97 compatible = "ti,omap-counter32k";
@@ -100,12 +116,16 @@
100 pinctrl-single,function-mask = <0x7fff>; 116 pinctrl-single,function-mask = <0x7fff>;
101 }; 117 };
102 118
103 gic: interrupt-controller@48211000 { 119 sdma: dma-controller@4a056000 {
104 compatible = "arm,cortex-a15-gic"; 120 compatible = "ti,omap4430-sdma";
105 interrupt-controller; 121 reg = <0x4a056000 0x1000>;
106 #interrupt-cells = <3>; 122 interrupts = <0 12 0x4>,
107 reg = <0x48211000 0x1000>, 123 <0 13 0x4>,
108 <0x48212000 0x1000>; 124 <0 14 0x4>,
125 <0 15 0x4>;
126 #dma-cells = <1>;
127 #dma-channels = <32>;
128 #dma-requests = <127>;
109 }; 129 };
110 130
111 gpio1: gpio@4ae10000 { 131 gpio1: gpio@4ae10000 {
@@ -113,10 +133,11 @@
113 reg = <0x4ae10000 0x200>; 133 reg = <0x4ae10000 0x200>;
114 interrupts = <0 29 0x4>; 134 interrupts = <0 29 0x4>;
115 ti,hwmods = "gpio1"; 135 ti,hwmods = "gpio1";
136 ti,gpio-always-on;
116 gpio-controller; 137 gpio-controller;
117 #gpio-cells = <2>; 138 #gpio-cells = <2>;
118 interrupt-controller; 139 interrupt-controller;
119 #interrupt-cells = <1>; 140 #interrupt-cells = <2>;
120 }; 141 };
121 142
122 gpio2: gpio@48055000 { 143 gpio2: gpio@48055000 {
@@ -127,7 +148,7 @@
127 gpio-controller; 148 gpio-controller;
128 #gpio-cells = <2>; 149 #gpio-cells = <2>;
129 interrupt-controller; 150 interrupt-controller;
130 #interrupt-cells = <1>; 151 #interrupt-cells = <2>;
131 }; 152 };
132 153
133 gpio3: gpio@48057000 { 154 gpio3: gpio@48057000 {
@@ -138,7 +159,7 @@
138 gpio-controller; 159 gpio-controller;
139 #gpio-cells = <2>; 160 #gpio-cells = <2>;
140 interrupt-controller; 161 interrupt-controller;
141 #interrupt-cells = <1>; 162 #interrupt-cells = <2>;
142 }; 163 };
143 164
144 gpio4: gpio@48059000 { 165 gpio4: gpio@48059000 {
@@ -149,7 +170,7 @@
149 gpio-controller; 170 gpio-controller;
150 #gpio-cells = <2>; 171 #gpio-cells = <2>;
151 interrupt-controller; 172 interrupt-controller;
152 #interrupt-cells = <1>; 173 #interrupt-cells = <2>;
153 }; 174 };
154 175
155 gpio5: gpio@4805b000 { 176 gpio5: gpio@4805b000 {
@@ -160,7 +181,7 @@
160 gpio-controller; 181 gpio-controller;
161 #gpio-cells = <2>; 182 #gpio-cells = <2>;
162 interrupt-controller; 183 interrupt-controller;
163 #interrupt-cells = <1>; 184 #interrupt-cells = <2>;
164 }; 185 };
165 186
166 gpio6: gpio@4805d000 { 187 gpio6: gpio@4805d000 {
@@ -171,7 +192,7 @@
171 gpio-controller; 192 gpio-controller;
172 #gpio-cells = <2>; 193 #gpio-cells = <2>;
173 interrupt-controller; 194 interrupt-controller;
174 #interrupt-cells = <1>; 195 #interrupt-cells = <2>;
175 }; 196 };
176 197
177 gpio7: gpio@48051000 { 198 gpio7: gpio@48051000 {
@@ -182,7 +203,7 @@
182 gpio-controller; 203 gpio-controller;
183 #gpio-cells = <2>; 204 #gpio-cells = <2>;
184 interrupt-controller; 205 interrupt-controller;
185 #interrupt-cells = <1>; 206 #interrupt-cells = <2>;
186 }; 207 };
187 208
188 gpio8: gpio@48053000 { 209 gpio8: gpio@48053000 {
@@ -193,7 +214,18 @@
193 gpio-controller; 214 gpio-controller;
194 #gpio-cells = <2>; 215 #gpio-cells = <2>;
195 interrupt-controller; 216 interrupt-controller;
196 #interrupt-cells = <1>; 217 #interrupt-cells = <2>;
218 };
219
220 gpmc: gpmc@50000000 {
221 compatible = "ti,omap4430-gpmc";
222 reg = <0x50000000 0x1000>;
223 #address-cells = <2>;
224 #size-cells = <1>;
225 interrupts = <0 20 0x4>;
226 gpmc,num-cs = <8>;
227 gpmc,num-waitpins = <4>;
228 ti,hwmods = "gpmc";
197 }; 229 };
198 230
199 i2c1: i2c@48070000 { 231 i2c1: i2c@48070000 {
@@ -241,6 +273,65 @@
241 ti,hwmods = "i2c5"; 273 ti,hwmods = "i2c5";
242 }; 274 };
243 275
276 mcspi1: spi@48098000 {
277 compatible = "ti,omap4-mcspi";
278 reg = <0x48098000 0x200>;
279 interrupts = <0 65 0x4>;
280 #address-cells = <1>;
281 #size-cells = <0>;
282 ti,hwmods = "mcspi1";
283 ti,spi-num-cs = <4>;
284 dmas = <&sdma 35>,
285 <&sdma 36>,
286 <&sdma 37>,
287 <&sdma 38>,
288 <&sdma 39>,
289 <&sdma 40>,
290 <&sdma 41>,
291 <&sdma 42>;
292 dma-names = "tx0", "rx0", "tx1", "rx1",
293 "tx2", "rx2", "tx3", "rx3";
294 };
295
296 mcspi2: spi@4809a000 {
297 compatible = "ti,omap4-mcspi";
298 reg = <0x4809a000 0x200>;
299 interrupts = <0 66 0x4>;
300 #address-cells = <1>;
301 #size-cells = <0>;
302 ti,hwmods = "mcspi2";
303 ti,spi-num-cs = <2>;
304 dmas = <&sdma 43>,
305 <&sdma 44>,
306 <&sdma 45>,
307 <&sdma 46>;
308 dma-names = "tx0", "rx0", "tx1", "rx1";
309 };
310
311 mcspi3: spi@480b8000 {
312 compatible = "ti,omap4-mcspi";
313 reg = <0x480b8000 0x200>;
314 interrupts = <0 91 0x4>;
315 #address-cells = <1>;
316 #size-cells = <0>;
317 ti,hwmods = "mcspi3";
318 ti,spi-num-cs = <2>;
319 dmas = <&sdma 15>, <&sdma 16>;
320 dma-names = "tx0", "rx0";
321 };
322
323 mcspi4: spi@480ba000 {
324 compatible = "ti,omap4-mcspi";
325 reg = <0x480ba000 0x200>;
326 interrupts = <0 48 0x4>;
327 #address-cells = <1>;
328 #size-cells = <0>;
329 ti,hwmods = "mcspi4";
330 ti,spi-num-cs = <1>;
331 dmas = <&sdma 70>, <&sdma 71>;
332 dma-names = "tx0", "rx0";
333 };
334
244 uart1: serial@4806a000 { 335 uart1: serial@4806a000 {
245 compatible = "ti,omap4-uart"; 336 compatible = "ti,omap4-uart";
246 reg = <0x4806a000 0x100>; 337 reg = <0x4806a000 0x100>;
@@ -296,6 +387,8 @@
296 ti,hwmods = "mmc1"; 387 ti,hwmods = "mmc1";
297 ti,dual-volt; 388 ti,dual-volt;
298 ti,needs-special-reset; 389 ti,needs-special-reset;
390 dmas = <&sdma 61>, <&sdma 62>;
391 dma-names = "tx", "rx";
299 }; 392 };
300 393
301 mmc2: mmc@480b4000 { 394 mmc2: mmc@480b4000 {
@@ -304,6 +397,8 @@
304 interrupts = <0 86 0x4>; 397 interrupts = <0 86 0x4>;
305 ti,hwmods = "mmc2"; 398 ti,hwmods = "mmc2";
306 ti,needs-special-reset; 399 ti,needs-special-reset;
400 dmas = <&sdma 47>, <&sdma 48>;
401 dma-names = "tx", "rx";
307 }; 402 };
308 403
309 mmc3: mmc@480ad000 { 404 mmc3: mmc@480ad000 {
@@ -312,6 +407,8 @@
312 interrupts = <0 94 0x4>; 407 interrupts = <0 94 0x4>;
313 ti,hwmods = "mmc3"; 408 ti,hwmods = "mmc3";
314 ti,needs-special-reset; 409 ti,needs-special-reset;
410 dmas = <&sdma 77>, <&sdma 78>;
411 dma-names = "tx", "rx";
315 }; 412 };
316 413
317 mmc4: mmc@480d1000 { 414 mmc4: mmc@480d1000 {
@@ -320,6 +417,8 @@
320 interrupts = <0 96 0x4>; 417 interrupts = <0 96 0x4>;
321 ti,hwmods = "mmc4"; 418 ti,hwmods = "mmc4";
322 ti,needs-special-reset; 419 ti,needs-special-reset;
420 dmas = <&sdma 57>, <&sdma 58>;
421 dma-names = "tx", "rx";
323 }; 422 };
324 423
325 mmc5: mmc@480d5000 { 424 mmc5: mmc@480d5000 {
@@ -328,10 +427,13 @@
328 interrupts = <0 59 0x4>; 427 interrupts = <0 59 0x4>;
329 ti,hwmods = "mmc5"; 428 ti,hwmods = "mmc5";
330 ti,needs-special-reset; 429 ti,needs-special-reset;
430 dmas = <&sdma 59>, <&sdma 60>;
431 dma-names = "tx", "rx";
331 }; 432 };
332 433
333 keypad: keypad@4ae1c000 { 434 keypad: keypad@4ae1c000 {
334 compatible = "ti,omap4-keypad"; 435 compatible = "ti,omap4-keypad";
436 reg = <0x4ae1c000 0x400>;
335 ti,hwmods = "kbd"; 437 ti,hwmods = "kbd";
336 }; 438 };
337 439
@@ -342,6 +444,9 @@
342 reg-names = "mpu", "dma"; 444 reg-names = "mpu", "dma";
343 interrupts = <0 112 0x4>; 445 interrupts = <0 112 0x4>;
344 ti,hwmods = "mcpdm"; 446 ti,hwmods = "mcpdm";
447 dmas = <&sdma 65>,
448 <&sdma 66>;
449 dma-names = "up_link", "dn_link";
345 }; 450 };
346 451
347 dmic: dmic@4012e000 { 452 dmic: dmic@4012e000 {
@@ -351,6 +456,8 @@
351 reg-names = "mpu", "dma"; 456 reg-names = "mpu", "dma";
352 interrupts = <0 114 0x4>; 457 interrupts = <0 114 0x4>;
353 ti,hwmods = "dmic"; 458 ti,hwmods = "dmic";
459 dmas = <&sdma 67>;
460 dma-names = "up_link";
354 }; 461 };
355 462
356 mcbsp1: mcbsp@40122000 { 463 mcbsp1: mcbsp@40122000 {
@@ -362,6 +469,9 @@
362 interrupt-names = "common"; 469 interrupt-names = "common";
363 ti,buffer-size = <128>; 470 ti,buffer-size = <128>;
364 ti,hwmods = "mcbsp1"; 471 ti,hwmods = "mcbsp1";
472 dmas = <&sdma 33>,
473 <&sdma 34>;
474 dma-names = "tx", "rx";
365 }; 475 };
366 476
367 mcbsp2: mcbsp@40124000 { 477 mcbsp2: mcbsp@40124000 {
@@ -373,6 +483,9 @@
373 interrupt-names = "common"; 483 interrupt-names = "common";
374 ti,buffer-size = <128>; 484 ti,buffer-size = <128>;
375 ti,hwmods = "mcbsp2"; 485 ti,hwmods = "mcbsp2";
486 dmas = <&sdma 17>,
487 <&sdma 18>;
488 dma-names = "tx", "rx";
376 }; 489 };
377 490
378 mcbsp3: mcbsp@40126000 { 491 mcbsp3: mcbsp@40126000 {
@@ -384,10 +497,13 @@
384 interrupt-names = "common"; 497 interrupt-names = "common";
385 ti,buffer-size = <128>; 498 ti,buffer-size = <128>;
386 ti,hwmods = "mcbsp3"; 499 ti,hwmods = "mcbsp3";
500 dmas = <&sdma 19>,
501 <&sdma 20>;
502 dma-names = "tx", "rx";
387 }; 503 };
388 504
389 timer1: timer@4ae18000 { 505 timer1: timer@4ae18000 {
390 compatible = "ti,omap2-timer"; 506 compatible = "ti,omap5430-timer";
391 reg = <0x4ae18000 0x80>; 507 reg = <0x4ae18000 0x80>;
392 interrupts = <0 37 0x4>; 508 interrupts = <0 37 0x4>;
393 ti,hwmods = "timer1"; 509 ti,hwmods = "timer1";
@@ -395,28 +511,28 @@
395 }; 511 };
396 512
397 timer2: timer@48032000 { 513 timer2: timer@48032000 {
398 compatible = "ti,omap2-timer"; 514 compatible = "ti,omap5430-timer";
399 reg = <0x48032000 0x80>; 515 reg = <0x48032000 0x80>;
400 interrupts = <0 38 0x4>; 516 interrupts = <0 38 0x4>;
401 ti,hwmods = "timer2"; 517 ti,hwmods = "timer2";
402 }; 518 };
403 519
404 timer3: timer@48034000 { 520 timer3: timer@48034000 {
405 compatible = "ti,omap2-timer"; 521 compatible = "ti,omap5430-timer";
406 reg = <0x48034000 0x80>; 522 reg = <0x48034000 0x80>;
407 interrupts = <0 39 0x4>; 523 interrupts = <0 39 0x4>;
408 ti,hwmods = "timer3"; 524 ti,hwmods = "timer3";
409 }; 525 };
410 526
411 timer4: timer@48036000 { 527 timer4: timer@48036000 {
412 compatible = "ti,omap2-timer"; 528 compatible = "ti,omap5430-timer";
413 reg = <0x48036000 0x80>; 529 reg = <0x48036000 0x80>;
414 interrupts = <0 40 0x4>; 530 interrupts = <0 40 0x4>;
415 ti,hwmods = "timer4"; 531 ti,hwmods = "timer4";
416 }; 532 };
417 533
418 timer5: timer@40138000 { 534 timer5: timer@40138000 {
419 compatible = "ti,omap2-timer"; 535 compatible = "ti,omap5430-timer";
420 reg = <0x40138000 0x80>, 536 reg = <0x40138000 0x80>,
421 <0x49038000 0x80>; 537 <0x49038000 0x80>;
422 interrupts = <0 41 0x4>; 538 interrupts = <0 41 0x4>;
@@ -425,7 +541,7 @@
425 }; 541 };
426 542
427 timer6: timer@4013a000 { 543 timer6: timer@4013a000 {
428 compatible = "ti,omap2-timer"; 544 compatible = "ti,omap5430-timer";
429 reg = <0x4013a000 0x80>, 545 reg = <0x4013a000 0x80>,
430 <0x4903a000 0x80>; 546 <0x4903a000 0x80>;
431 interrupts = <0 42 0x4>; 547 interrupts = <0 42 0x4>;
@@ -435,7 +551,7 @@
435 }; 551 };
436 552
437 timer7: timer@4013c000 { 553 timer7: timer@4013c000 {
438 compatible = "ti,omap2-timer"; 554 compatible = "ti,omap5430-timer";
439 reg = <0x4013c000 0x80>, 555 reg = <0x4013c000 0x80>,
440 <0x4903c000 0x80>; 556 <0x4903c000 0x80>;
441 interrupts = <0 43 0x4>; 557 interrupts = <0 43 0x4>;
@@ -444,7 +560,7 @@
444 }; 560 };
445 561
446 timer8: timer@4013e000 { 562 timer8: timer@4013e000 {
447 compatible = "ti,omap2-timer"; 563 compatible = "ti,omap5430-timer";
448 reg = <0x4013e000 0x80>, 564 reg = <0x4013e000 0x80>,
449 <0x4903e000 0x80>; 565 <0x4903e000 0x80>;
450 interrupts = <0 44 0x4>; 566 interrupts = <0 44 0x4>;
@@ -454,27 +570,34 @@
454 }; 570 };
455 571
456 timer9: timer@4803e000 { 572 timer9: timer@4803e000 {
457 compatible = "ti,omap2-timer"; 573 compatible = "ti,omap5430-timer";
458 reg = <0x4803e000 0x80>; 574 reg = <0x4803e000 0x80>;
459 interrupts = <0 45 0x4>; 575 interrupts = <0 45 0x4>;
460 ti,hwmods = "timer9"; 576 ti,hwmods = "timer9";
461 }; 577 };
462 578
463 timer10: timer@48086000 { 579 timer10: timer@48086000 {
464 compatible = "ti,omap2-timer"; 580 compatible = "ti,omap5430-timer";
465 reg = <0x48086000 0x80>; 581 reg = <0x48086000 0x80>;
466 interrupts = <0 46 0x4>; 582 interrupts = <0 46 0x4>;
467 ti,hwmods = "timer10"; 583 ti,hwmods = "timer10";
468 }; 584 };
469 585
470 timer11: timer@48088000 { 586 timer11: timer@48088000 {
471 compatible = "ti,omap2-timer"; 587 compatible = "ti,omap5430-timer";
472 reg = <0x48088000 0x80>; 588 reg = <0x48088000 0x80>;
473 interrupts = <0 47 0x4>; 589 interrupts = <0 47 0x4>;
474 ti,hwmods = "timer11"; 590 ti,hwmods = "timer11";
475 ti,timer-pwm; 591 ti,timer-pwm;
476 }; 592 };
477 593
594 wdt2: wdt@4ae14000 {
595 compatible = "ti,omap5-wdt", "ti,omap3-wdt";
596 reg = <0x4ae14000 0x80>;
597 interrupts = <0 80 0x4>;
598 ti,hwmods = "wd_timer2";
599 };
600
478 emif1: emif@0x4c000000 { 601 emif1: emif@0x4c000000 {
479 compatible = "ti,emif-4d5"; 602 compatible = "ti,emif-4d5";
480 ti,hwmods = "emif1"; 603 ti,hwmods = "emif1";
@@ -496,5 +619,53 @@
496 hw-caps-ll-interface; 619 hw-caps-ll-interface;
497 hw-caps-temp-alert; 620 hw-caps-temp-alert;
498 }; 621 };
622
623 omap_control_usb: omap-control-usb@4a002300 {
624 compatible = "ti,omap-control-usb";
625 reg = <0x4a002300 0x4>,
626 <0x4a002370 0x4>;
627 reg-names = "control_dev_conf", "phy_power_usb";
628 ti,type = <2>;
629 };
630
631 omap_dwc3@4a020000 {
632 compatible = "ti,dwc3";
633 ti,hwmods = "usb_otg_ss";
634 reg = <0x4a020000 0x1000>;
635 interrupts = <0 93 4>;
636 #address-cells = <1>;
637 #size-cells = <1>;
638 utmi-mode = <2>;
639 ranges;
640 dwc3@4a030000 {
641 compatible = "synopsys,dwc3";
642 reg = <0x4a030000 0x1000>;
643 interrupts = <0 92 4>;
644 usb-phy = <&usb2_phy>, <&usb3_phy>;
645 tx-fifo-resize;
646 };
647 };
648
649 ocp2scp {
650 compatible = "ti,omap-ocp2scp";
651 #address-cells = <1>;
652 #size-cells = <1>;
653 ranges;
654 ti,hwmods = "ocp2scp1";
655 usb2_phy: usb2phy@4a084000 {
656 compatible = "ti,omap-usb2";
657 reg = <0x4a084000 0x7c>;
658 ctrl-module = <&omap_control_usb>;
659 };
660
661 usb3_phy: usb3phy@4a084400 {
662 compatible = "ti,omap-usb3";
663 reg = <0x4a084400 0x80>,
664 <0x4a084800 0x64>,
665 <0x4a084c00 0x40>;
666 reg-names = "phy_rx", "phy_tx", "pll_ctrl";
667 ctrl-module = <&omap_control_usb>;
668 };
669 };
499 }; 670 };
500}; 671};
diff --git a/arch/arm/boot/dts/orion5x.dtsi b/arch/arm/boot/dts/orion5x.dtsi
index f7bec3b1ba32..892c64e3f1e1 100644
--- a/arch/arm/boot/dts/orion5x.dtsi
+++ b/arch/arm/boot/dts/orion5x.dtsi
@@ -74,6 +74,20 @@
74 status = "okay"; 74 status = "okay";
75 }; 75 };
76 76
77 ehci@50000 {
78 compatible = "marvell,orion-ehci";
79 reg = <0x50000 0x1000>;
80 interrupts = <17>;
81 status = "disabled";
82 };
83
84 ehci@a0000 {
85 compatible = "marvell,orion-ehci";
86 reg = <0xa0000 0x1000>;
87 interrupts = <12>;
88 status = "disabled";
89 };
90
77 sata@80000 { 91 sata@80000 {
78 compatible = "marvell,orion-sata"; 92 compatible = "marvell,orion-sata";
79 reg = <0x80000 0x5000>; 93 reg = <0x80000 0x5000>;
@@ -91,6 +105,25 @@
91 status = "disabled"; 105 status = "disabled";
92 }; 106 };
93 107
108 xor@60900 {
109 compatible = "marvell,orion-xor";
110 reg = <0x60900 0x100
111 0x60b00 0x100>;
112 status = "okay";
113
114 xor00 {
115 interrupts = <30>;
116 dmacap,memcpy;
117 dmacap,xor;
118 };
119 xor01 {
120 interrupts = <31>;
121 dmacap,memcpy;
122 dmacap,xor;
123 dmacap,memset;
124 };
125 };
126
94 crypto@90000 { 127 crypto@90000 {
95 compatible = "marvell,orion-crypto"; 128 compatible = "marvell,orion-crypto";
96 reg = <0x90000 0x10000>, 129 reg = <0x90000 0x10000>,
diff --git a/arch/arm/boot/dts/skeleton64.dtsi b/arch/arm/boot/dts/skeleton64.dtsi
new file mode 100644
index 000000000000..15994158a998
--- /dev/null
+++ b/arch/arm/boot/dts/skeleton64.dtsi
@@ -0,0 +1,13 @@
1/*
2 * Skeleton device tree in the 64 bits version; the bare minimum
3 * needed to boot; just include and add a compatible value. The
4 * bootloader will typically populate the memory node.
5 */
6
7/ {
8 #address-cells = <2>;
9 #size-cells = <2>;
10 chosen { };
11 aliases { };
12 memory { device_type = "memory"; reg = <0 0>; };
13};
diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
index a30aca62658a..72c1f27af7f3 100644
--- a/arch/arm/boot/dts/tegra114-dalmore.dts
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -10,12 +10,915 @@
10 reg = <0x80000000 0x40000000>; 10 reg = <0x80000000 0x40000000>;
11 }; 11 };
12 12
13 pinmux {
14 pinctrl-names = "default";
15 pinctrl-0 = <&state_default>;
16
17 state_default: pinmux {
18 clk1_out_pw4 {
19 nvidia,pins = "clk1_out_pw4";
20 nvidia,function = "extperiph1";
21 nvidia,pull = <0>;
22 nvidia,tristate = <0>;
23 nvidia,enable-input = <0>;
24 };
25 dap1_din_pn1 {
26 nvidia,pins = "dap1_din_pn1";
27 nvidia,function = "i2s0";
28 nvidia,pull = <0>;
29 nvidia,tristate = <1>;
30 nvidia,enable-input = <1>;
31 };
32 dap1_dout_pn2 {
33 nvidia,pins = "dap1_dout_pn2",
34 "dap1_fs_pn0",
35 "dap1_sclk_pn3";
36 nvidia,function = "i2s0";
37 nvidia,pull = <0>;
38 nvidia,tristate = <0>;
39 nvidia,enable-input = <1>;
40 };
41 dap2_din_pa4 {
42 nvidia,pins = "dap2_din_pa4";
43 nvidia,function = "i2s1";
44 nvidia,pull = <0>;
45 nvidia,tristate = <1>;
46 nvidia,enable-input = <1>;
47 };
48 dap2_dout_pa5 {
49 nvidia,pins = "dap2_dout_pa5",
50 "dap2_fs_pa2",
51 "dap2_sclk_pa3";
52 nvidia,function = "i2s1";
53 nvidia,pull = <0>;
54 nvidia,tristate = <0>;
55 nvidia,enable-input = <1>;
56 };
57 dap4_din_pp5 {
58 nvidia,pins = "dap4_din_pp5",
59 "dap4_dout_pp6",
60 "dap4_fs_pp4",
61 "dap4_sclk_pp7";
62 nvidia,function = "i2s3";
63 nvidia,pull = <0>;
64 nvidia,tristate = <0>;
65 nvidia,enable-input = <1>;
66 };
67 dvfs_pwm_px0 {
68 nvidia,pins = "dvfs_pwm_px0",
69 "dvfs_clk_px2";
70 nvidia,function = "cldvfs";
71 nvidia,pull = <0>;
72 nvidia,tristate = <0>;
73 nvidia,enable-input = <0>;
74 };
75 ulpi_clk_py0 {
76 nvidia,pins = "ulpi_clk_py0",
77 "ulpi_data0_po1",
78 "ulpi_data1_po2",
79 "ulpi_data2_po3",
80 "ulpi_data3_po4",
81 "ulpi_data4_po5",
82 "ulpi_data5_po6",
83 "ulpi_data6_po7",
84 "ulpi_data7_po0";
85 nvidia,function = "ulpi";
86 nvidia,pull = <0>;
87 nvidia,tristate = <0>;
88 nvidia,enable-input = <1>;
89 };
90 ulpi_dir_py1 {
91 nvidia,pins = "ulpi_dir_py1",
92 "ulpi_nxt_py2";
93 nvidia,function = "ulpi";
94 nvidia,pull = <0>;
95 nvidia,tristate = <1>;
96 nvidia,enable-input = <1>;
97 };
98 ulpi_stp_py3 {
99 nvidia,pins = "ulpi_stp_py3";
100 nvidia,function = "ulpi";
101 nvidia,pull = <0>;
102 nvidia,tristate = <0>;
103 nvidia,enable-input = <0>;
104 };
105 cam_i2c_scl_pbb1 {
106 nvidia,pins = "cam_i2c_scl_pbb1",
107 "cam_i2c_sda_pbb2";
108 nvidia,function = "i2c3";
109 nvidia,pull = <0>;
110 nvidia,tristate = <0>;
111 nvidia,enable-input = <1>;
112 nvidia,lock = <0>;
113 nvidia,open-drain = <0>;
114 };
115 cam_mclk_pcc0 {
116 nvidia,pins = "cam_mclk_pcc0",
117 "pbb0";
118 nvidia,function = "vi_alt3";
119 nvidia,pull = <0>;
120 nvidia,tristate = <0>;
121 nvidia,enable-input = <0>;
122 nvidia,lock = <0>;
123 };
124 gen2_i2c_scl_pt5 {
125 nvidia,pins = "gen2_i2c_scl_pt5",
126 "gen2_i2c_sda_pt6";
127 nvidia,function = "i2c2";
128 nvidia,pull = <0>;
129 nvidia,tristate = <0>;
130 nvidia,enable-input = <1>;
131 nvidia,lock = <0>;
132 nvidia,open-drain = <0>;
133 };
134 gmi_a16_pj7 {
135 nvidia,pins = "gmi_a16_pj7";
136 nvidia,function = "uartd";
137 nvidia,pull = <0>;
138 nvidia,tristate = <0>;
139 nvidia,enable-input = <0>;
140 };
141 gmi_a17_pb0 {
142 nvidia,pins = "gmi_a17_pb0",
143 "gmi_a18_pb1";
144 nvidia,function = "uartd";
145 nvidia,pull = <0>;
146 nvidia,tristate = <1>;
147 nvidia,enable-input = <1>;
148 };
149 gmi_a19_pk7 {
150 nvidia,pins = "gmi_a19_pk7";
151 nvidia,function = "uartd";
152 nvidia,pull = <0>;
153 nvidia,tristate = <0>;
154 nvidia,enable-input = <0>;
155 };
156 gmi_ad5_pg5 {
157 nvidia,pins = "gmi_ad5_pg5",
158 "gmi_cs6_n_pi3",
159 "gmi_wr_n_pi0";
160 nvidia,function = "spi4";
161 nvidia,pull = <0>;
162 nvidia,tristate = <0>;
163 nvidia,enable-input = <1>;
164 };
165 gmi_ad6_pg6 {
166 nvidia,pins = "gmi_ad6_pg6",
167 "gmi_ad7_pg7";
168 nvidia,function = "spi4";
169 nvidia,pull = <2>;
170 nvidia,tristate = <0>;
171 nvidia,enable-input = <1>;
172 };
173 gmi_ad12_ph4 {
174 nvidia,pins = "gmi_ad12_ph4";
175 nvidia,function = "rsvd4";
176 nvidia,pull = <0>;
177 nvidia,tristate = <0>;
178 nvidia,enable-input = <0>;
179 };
180 gmi_ad9_ph1 {
181 nvidia,pins = "gmi_ad9_ph1";
182 nvidia,function = "pwm1";
183 nvidia,pull = <0>;
184 nvidia,tristate = <0>;
185 nvidia,enable-input = <0>;
186 };
187 gmi_cs1_n_pj2 {
188 nvidia,pins = "gmi_cs1_n_pj2",
189 "gmi_oe_n_pi1";
190 nvidia,function = "soc";
191 nvidia,pull = <0>;
192 nvidia,tristate = <1>;
193 nvidia,enable-input = <1>;
194 };
195 clk2_out_pw5 {
196 nvidia,pins = "clk2_out_pw5";
197 nvidia,function = "extperiph2";
198 nvidia,pull = <0>;
199 nvidia,tristate = <0>;
200 nvidia,enable-input = <0>;
201 };
202 sdmmc1_clk_pz0 {
203 nvidia,pins = "sdmmc1_clk_pz0";
204 nvidia,function = "sdmmc1";
205 nvidia,pull = <0>;
206 nvidia,tristate = <0>;
207 nvidia,enable-input = <1>;
208 };
209 sdmmc1_cmd_pz1 {
210 nvidia,pins = "sdmmc1_cmd_pz1",
211 "sdmmc1_dat0_py7",
212 "sdmmc1_dat1_py6",
213 "sdmmc1_dat2_py5",
214 "sdmmc1_dat3_py4";
215 nvidia,function = "sdmmc1";
216 nvidia,pull = <2>;
217 nvidia,tristate = <0>;
218 nvidia,enable-input = <1>;
219 };
220 sdmmc1_wp_n_pv3 {
221 nvidia,pins = "sdmmc1_wp_n_pv3";
222 nvidia,function = "spi4";
223 nvidia,pull = <2>;
224 nvidia,tristate = <0>;
225 nvidia,enable-input = <0>;
226 };
227 sdmmc3_clk_pa6 {
228 nvidia,pins = "sdmmc3_clk_pa6";
229 nvidia,function = "sdmmc3";
230 nvidia,pull = <0>;
231 nvidia,tristate = <0>;
232 nvidia,enable-input = <1>;
233 };
234 sdmmc3_cmd_pa7 {
235 nvidia,pins = "sdmmc3_cmd_pa7",
236 "sdmmc3_dat0_pb7",
237 "sdmmc3_dat1_pb6",
238 "sdmmc3_dat2_pb5",
239 "sdmmc3_dat3_pb4",
240 "kb_col4_pq4",
241 "sdmmc3_clk_lb_out_pee4",
242 "sdmmc3_clk_lb_in_pee5";
243 nvidia,function = "sdmmc3";
244 nvidia,pull = <2>;
245 nvidia,tristate = <0>;
246 nvidia,enable-input = <1>;
247 };
248 sdmmc4_clk_pcc4 {
249 nvidia,pins = "sdmmc4_clk_pcc4";
250 nvidia,function = "sdmmc4";
251 nvidia,pull = <0>;
252 nvidia,tristate = <0>;
253 nvidia,enable-input = <1>;
254 };
255 sdmmc4_cmd_pt7 {
256 nvidia,pins = "sdmmc4_cmd_pt7",
257 "sdmmc4_dat0_paa0",
258 "sdmmc4_dat1_paa1",
259 "sdmmc4_dat2_paa2",
260 "sdmmc4_dat3_paa3",
261 "sdmmc4_dat4_paa4",
262 "sdmmc4_dat5_paa5",
263 "sdmmc4_dat6_paa6",
264 "sdmmc4_dat7_paa7";
265 nvidia,function = "sdmmc4";
266 nvidia,pull = <2>;
267 nvidia,tristate = <0>;
268 nvidia,enable-input = <1>;
269 };
270 clk_32k_out_pa0 {
271 nvidia,pins = "clk_32k_out_pa0";
272 nvidia,function = "blink";
273 nvidia,pull = <0>;
274 nvidia,tristate = <0>;
275 nvidia,enable-input = <0>;
276 };
277 kb_col0_pq0 {
278 nvidia,pins = "kb_col0_pq0",
279 "kb_col1_pq1",
280 "kb_col2_pq2",
281 "kb_row0_pr0",
282 "kb_row1_pr1",
283 "kb_row2_pr2";
284 nvidia,function = "kbc";
285 nvidia,pull = <2>;
286 nvidia,tristate = <0>;
287 nvidia,enable-input = <1>;
288 };
289 dap3_din_pp1 {
290 nvidia,pins = "dap3_din_pp1",
291 "dap3_sclk_pp3";
292 nvidia,function = "displayb";
293 nvidia,pull = <0>;
294 nvidia,tristate = <1>;
295 nvidia,enable-input = <0>;
296 };
297 pv0 {
298 nvidia,pins = "pv0";
299 nvidia,function = "rsvd4";
300 nvidia,pull = <0>;
301 nvidia,tristate = <1>;
302 nvidia,enable-input = <0>;
303 };
304 kb_row7_pr7 {
305 nvidia,pins = "kb_row7_pr7";
306 nvidia,function = "rsvd2";
307 nvidia,pull = <2>;
308 nvidia,tristate = <0>;
309 nvidia,enable-input = <1>;
310 };
311 kb_row10_ps2 {
312 nvidia,pins = "kb_row10_ps2";
313 nvidia,function = "uarta";
314 nvidia,pull = <0>;
315 nvidia,tristate = <1>;
316 nvidia,enable-input = <1>;
317 };
318 kb_row9_ps1 {
319 nvidia,pins = "kb_row9_ps1";
320 nvidia,function = "uarta";
321 nvidia,pull = <0>;
322 nvidia,tristate = <0>;
323 nvidia,enable-input = <0>;
324 };
325 pwr_i2c_scl_pz6 {
326 nvidia,pins = "pwr_i2c_scl_pz6",
327 "pwr_i2c_sda_pz7";
328 nvidia,function = "i2cpwr";
329 nvidia,pull = <0>;
330 nvidia,tristate = <0>;
331 nvidia,enable-input = <1>;
332 nvidia,lock = <0>;
333 nvidia,open-drain = <0>;
334 };
335 sys_clk_req_pz5 {
336 nvidia,pins = "sys_clk_req_pz5";
337 nvidia,function = "sysclk";
338 nvidia,pull = <0>;
339 nvidia,tristate = <0>;
340 nvidia,enable-input = <0>;
341 };
342 core_pwr_req {
343 nvidia,pins = "core_pwr_req";
344 nvidia,function = "pwron";
345 nvidia,pull = <0>;
346 nvidia,tristate = <0>;
347 nvidia,enable-input = <0>;
348 };
349 cpu_pwr_req {
350 nvidia,pins = "cpu_pwr_req";
351 nvidia,function = "cpu";
352 nvidia,pull = <0>;
353 nvidia,tristate = <0>;
354 nvidia,enable-input = <0>;
355 };
356 pwr_int_n {
357 nvidia,pins = "pwr_int_n";
358 nvidia,function = "pmi";
359 nvidia,pull = <0>;
360 nvidia,tristate = <1>;
361 nvidia,enable-input = <1>;
362 };
363 reset_out_n {
364 nvidia,pins = "reset_out_n";
365 nvidia,function = "reset_out_n";
366 nvidia,pull = <0>;
367 nvidia,tristate = <0>;
368 nvidia,enable-input = <0>;
369 };
370 clk3_out_pee0 {
371 nvidia,pins = "clk3_out_pee0";
372 nvidia,function = "extperiph3";
373 nvidia,pull = <0>;
374 nvidia,tristate = <0>;
375 nvidia,enable-input = <0>;
376 };
377 gen1_i2c_scl_pc4 {
378 nvidia,pins = "gen1_i2c_scl_pc4",
379 "gen1_i2c_sda_pc5";
380 nvidia,function = "i2c1";
381 nvidia,pull = <0>;
382 nvidia,tristate = <0>;
383 nvidia,enable-input = <1>;
384 nvidia,lock = <0>;
385 nvidia,open-drain = <0>;
386 };
387 uart2_cts_n_pj5 {
388 nvidia,pins = "uart2_cts_n_pj5";
389 nvidia,function = "uartb";
390 nvidia,pull = <0>;
391 nvidia,tristate = <1>;
392 nvidia,enable-input = <1>;
393 };
394 uart2_rts_n_pj6 {
395 nvidia,pins = "uart2_rts_n_pj6";
396 nvidia,function = "uartb";
397 nvidia,pull = <0>;
398 nvidia,tristate = <0>;
399 nvidia,enable-input = <0>;
400 };
401 uart2_rxd_pc3 {
402 nvidia,pins = "uart2_rxd_pc3";
403 nvidia,function = "irda";
404 nvidia,pull = <0>;
405 nvidia,tristate = <1>;
406 nvidia,enable-input = <1>;
407 };
408 uart2_txd_pc2 {
409 nvidia,pins = "uart2_txd_pc2";
410 nvidia,function = "irda";
411 nvidia,pull = <0>;
412 nvidia,tristate = <0>;
413 nvidia,enable-input = <0>;
414 };
415 uart3_cts_n_pa1 {
416 nvidia,pins = "uart3_cts_n_pa1",
417 "uart3_rxd_pw7";
418 nvidia,function = "uartc";
419 nvidia,pull = <0>;
420 nvidia,tristate = <1>;
421 nvidia,enable-input = <1>;
422 };
423 uart3_rts_n_pc0 {
424 nvidia,pins = "uart3_rts_n_pc0",
425 "uart3_txd_pw6";
426 nvidia,function = "uartc";
427 nvidia,pull = <0>;
428 nvidia,tristate = <0>;
429 nvidia,enable-input = <0>;
430 };
431 owr {
432 nvidia,pins = "owr";
433 nvidia,function = "owr";
434 nvidia,pull = <0>;
435 nvidia,tristate = <0>;
436 nvidia,enable-input = <1>;
437 };
438 hdmi_cec_pee3 {
439 nvidia,pins = "hdmi_cec_pee3";
440 nvidia,function = "cec";
441 nvidia,pull = <0>;
442 nvidia,tristate = <0>;
443 nvidia,enable-input = <1>;
444 nvidia,lock = <0>;
445 nvidia,open-drain = <0>;
446 };
447 ddc_scl_pv4 {
448 nvidia,pins = "ddc_scl_pv4",
449 "ddc_sda_pv5";
450 nvidia,function = "i2c4";
451 nvidia,pull = <0>;
452 nvidia,tristate = <0>;
453 nvidia,enable-input = <1>;
454 nvidia,lock = <0>;
455 nvidia,rcv-sel = <1>;
456 };
457 spdif_in_pk6 {
458 nvidia,pins = "spdif_in_pk6";
459 nvidia,function = "usb";
460 nvidia,pull = <2>;
461 nvidia,tristate = <0>;
462 nvidia,enable-input = <1>;
463 nvidia,lock = <0>;
464 };
465 usb_vbus_en0_pn4 {
466 nvidia,pins = "usb_vbus_en0_pn4";
467 nvidia,function = "usb";
468 nvidia,pull = <2>;
469 nvidia,tristate = <0>;
470 nvidia,enable-input = <1>;
471 nvidia,lock = <0>;
472 nvidia,open-drain = <1>;
473 };
474 gpio_x6_aud_px6 {
475 nvidia,pins = "gpio_x6_aud_px6";
476 nvidia,function = "spi6";
477 nvidia,pull = <2>;
478 nvidia,tristate = <1>;
479 nvidia,enable-input = <1>;
480 };
481 gpio_x4_aud_px4 {
482 nvidia,pins = "gpio_x4_aud_px4",
483 "gpio_x7_aud_px7";
484 nvidia,function = "rsvd1";
485 nvidia,pull = <1>;
486 nvidia,tristate = <0>;
487 nvidia,enable-input = <0>;
488 };
489 gpio_x5_aud_px5 {
490 nvidia,pins = "gpio_x5_aud_px5";
491 nvidia,function = "rsvd1";
492 nvidia,pull = <2>;
493 nvidia,tristate = <0>;
494 nvidia,enable-input = <1>;
495 };
496 gpio_w2_aud_pw2 {
497 nvidia,pins = "gpio_w2_aud_pw2";
498 nvidia,function = "rsvd2";
499 nvidia,pull = <2>;
500 nvidia,tristate = <0>;
501 nvidia,enable-input = <1>;
502 };
503 gpio_w3_aud_pw3 {
504 nvidia,pins = "gpio_w3_aud_pw3";
505 nvidia,function = "spi6";
506 nvidia,pull = <2>;
507 nvidia,tristate = <0>;
508 nvidia,enable-input = <1>;
509 };
510 gpio_x1_aud_px1 {
511 nvidia,pins = "gpio_x1_aud_px1";
512 nvidia,function = "rsvd4";
513 nvidia,pull = <1>;
514 nvidia,tristate = <0>;
515 nvidia,enable-input = <1>;
516 };
517 gpio_x3_aud_px3 {
518 nvidia,pins = "gpio_x3_aud_px3";
519 nvidia,function = "rsvd4";
520 nvidia,pull = <2>;
521 nvidia,tristate = <0>;
522 nvidia,enable-input = <1>;
523 };
524 dap3_fs_pp0 {
525 nvidia,pins = "dap3_fs_pp0";
526 nvidia,function = "i2s2";
527 nvidia,pull = <1>;
528 nvidia,tristate = <0>;
529 nvidia,enable-input = <0>;
530 };
531 dap3_dout_pp2 {
532 nvidia,pins = "dap3_dout_pp2";
533 nvidia,function = "i2s2";
534 nvidia,pull = <1>;
535 nvidia,tristate = <0>;
536 nvidia,enable-input = <0>;
537 };
538 pv1 {
539 nvidia,pins = "pv1";
540 nvidia,function = "rsvd1";
541 nvidia,pull = <0>;
542 nvidia,tristate = <0>;
543 nvidia,enable-input = <1>;
544 };
545 pbb3 {
546 nvidia,pins = "pbb3",
547 "pbb5",
548 "pbb6",
549 "pbb7";
550 nvidia,function = "rsvd4";
551 nvidia,pull = <1>;
552 nvidia,tristate = <0>;
553 nvidia,enable-input = <0>;
554 };
555 pcc1 {
556 nvidia,pins = "pcc1",
557 "pcc2";
558 nvidia,function = "rsvd4";
559 nvidia,pull = <1>;
560 nvidia,tristate = <0>;
561 nvidia,enable-input = <1>;
562 };
563 gmi_ad0_pg0 {
564 nvidia,pins = "gmi_ad0_pg0",
565 "gmi_ad1_pg1";
566 nvidia,function = "gmi";
567 nvidia,pull = <0>;
568 nvidia,tristate = <0>;
569 nvidia,enable-input = <0>;
570 };
571 gmi_ad10_ph2 {
572 nvidia,pins = "gmi_ad10_ph2",
573 "gmi_ad11_ph3",
574 "gmi_ad13_ph5",
575 "gmi_ad8_ph0",
576 "gmi_clk_pk1";
577 nvidia,function = "gmi";
578 nvidia,pull = <1>;
579 nvidia,tristate = <0>;
580 nvidia,enable-input = <0>;
581 };
582 gmi_ad2_pg2 {
583 nvidia,pins = "gmi_ad2_pg2",
584 "gmi_ad3_pg3";
585 nvidia,function = "gmi";
586 nvidia,pull = <0>;
587 nvidia,tristate = <0>;
588 nvidia,enable-input = <1>;
589 };
590 gmi_adv_n_pk0 {
591 nvidia,pins = "gmi_adv_n_pk0",
592 "gmi_cs0_n_pj0",
593 "gmi_cs2_n_pk3",
594 "gmi_cs4_n_pk2",
595 "gmi_cs7_n_pi6",
596 "gmi_dqs_p_pj3",
597 "gmi_iordy_pi5",
598 "gmi_wp_n_pc7";
599 nvidia,function = "gmi";
600 nvidia,pull = <2>;
601 nvidia,tristate = <0>;
602 nvidia,enable-input = <1>;
603 };
604 gmi_cs3_n_pk4 {
605 nvidia,pins = "gmi_cs3_n_pk4";
606 nvidia,function = "gmi";
607 nvidia,pull = <2>;
608 nvidia,tristate = <0>;
609 nvidia,enable-input = <0>;
610 };
611 clk2_req_pcc5 {
612 nvidia,pins = "clk2_req_pcc5";
613 nvidia,function = "rsvd4";
614 nvidia,pull = <0>;
615 nvidia,tristate = <0>;
616 nvidia,enable-input = <0>;
617 };
618 kb_col3_pq3 {
619 nvidia,pins = "kb_col3_pq3",
620 "kb_col6_pq6",
621 "kb_col7_pq7";
622 nvidia,function = "kbc";
623 nvidia,pull = <2>;
624 nvidia,tristate = <0>;
625 nvidia,enable-input = <0>;
626 };
627 kb_col5_pq5 {
628 nvidia,pins = "kb_col5_pq5";
629 nvidia,function = "kbc";
630 nvidia,pull = <2>;
631 nvidia,tristate = <0>;
632 nvidia,enable-input = <1>;
633 };
634 kb_row3_pr3 {
635 nvidia,pins = "kb_row3_pr3",
636 "kb_row4_pr4",
637 "kb_row6_pr6",
638 "kb_row8_ps0";
639 nvidia,function = "kbc";
640 nvidia,pull = <1>;
641 nvidia,tristate = <0>;
642 nvidia,enable-input = <1>;
643 };
644 clk3_req_pee1 {
645 nvidia,pins = "clk3_req_pee1";
646 nvidia,function = "rsvd4";
647 nvidia,pull = <0>;
648 nvidia,tristate = <0>;
649 nvidia,enable-input = <0>;
650 };
651 pu4 {
652 nvidia,pins = "pu4";
653 nvidia,function = "displayb";
654 nvidia,pull = <0>;
655 nvidia,tristate = <0>;
656 nvidia,enable-input = <0>;
657 };
658 pu5 {
659 nvidia,pins = "pu5",
660 "pu6";
661 nvidia,function = "displayb";
662 nvidia,pull = <0>;
663 nvidia,tristate = <0>;
664 nvidia,enable-input = <1>;
665 };
666 hdmi_int_pn7 {
667 nvidia,pins = "hdmi_int_pn7";
668 nvidia,function = "rsvd1";
669 nvidia,pull = <1>;
670 nvidia,tristate = <0>;
671 nvidia,enable-input = <1>;
672 };
673 clk1_req_pee2 {
674 nvidia,pins = "clk1_req_pee2",
675 "usb_vbus_en1_pn5";
676 nvidia,function = "rsvd4";
677 nvidia,pull = <1>;
678 nvidia,tristate = <1>;
679 nvidia,enable-input = <0>;
680 };
681
682 drive_sdio1 {
683 nvidia,pins = "drive_sdio1";
684 nvidia,high-speed-mode = <1>;
685 nvidia,schmitt = <0>;
686 nvidia,low-power-mode = <3>;
687 nvidia,pull-down-strength = <36>;
688 nvidia,pull-up-strength = <20>;
689 nvidia,slew-rate-rising = <2>;
690 nvidia,slew-rate-falling = <2>;
691 };
692 drive_sdio3 {
693 nvidia,pins = "drive_sdio3";
694 nvidia,high-speed-mode = <1>;
695 nvidia,schmitt = <0>;
696 nvidia,low-power-mode = <3>;
697 nvidia,pull-down-strength = <22>;
698 nvidia,pull-up-strength = <36>;
699 nvidia,slew-rate-rising = <0>;
700 nvidia,slew-rate-falling = <0>;
701 };
702 drive_gma {
703 nvidia,pins = "drive_gma";
704 nvidia,high-speed-mode = <1>;
705 nvidia,schmitt = <0>;
706 nvidia,low-power-mode = <3>;
707 nvidia,pull-down-strength = <2>;
708 nvidia,pull-up-strength = <1>;
709 nvidia,slew-rate-rising = <0>;
710 nvidia,slew-rate-falling = <0>;
711 nvidia,drive-type = <1>;
712 };
713 };
714 };
715
13 serial@70006300 { 716 serial@70006300 {
14 status = "okay"; 717 status = "okay";
15 clock-frequency = <408000000>; 718 };
719
720 i2c@7000c000 {
721 status = "okay";
722 clock-frequency = <100000>;
723
724 battery: smart-battery {
725 compatible = "ti,bq20z45", "sbs,sbs-battery";
726 reg = <0xb>;
727 battery-name = "battery";
728 sbs,i2c-retry-count = <2>;
729 sbs,poll-retry-count = <100>;
730 };
731 };
732
733 i2c@7000d000 {
734 status = "okay";
735 clock-frequency = <400000>;
736
737 tps51632 {
738 compatible = "ti,tps51632";
739 reg = <0x43>;
740 regulator-name = "vdd-cpu";
741 regulator-min-microvolt = <500000>;
742 regulator-max-microvolt = <1520000>;
743 regulator-boot-on;
744 regulator-always-on;
745 };
746
747 tps65090 {
748 compatible = "ti,tps65090";
749 reg = <0x48>;
750 interrupt-parent = <&gpio>;
751 interrupts = <72 0x04>; /* gpio PJ0 */
752
753 vsys1-supply = <&vdd_ac_bat_reg>;
754 vsys2-supply = <&vdd_ac_bat_reg>;
755 vsys3-supply = <&vdd_ac_bat_reg>;
756 infet1-supply = <&vdd_ac_bat_reg>;
757 infet2-supply = <&vdd_ac_bat_reg>;
758 infet3-supply = <&tps65090_dcdc2_reg>;
759 infet4-supply = <&tps65090_dcdc2_reg>;
760 infet5-supply = <&tps65090_dcdc2_reg>;
761 infet6-supply = <&tps65090_dcdc2_reg>;
762 infet7-supply = <&tps65090_dcdc2_reg>;
763 vsys-l1-supply = <&vdd_ac_bat_reg>;
764 vsys-l2-supply = <&vdd_ac_bat_reg>;
765
766 regulators {
767 tps65090_dcdc1_reg: dcdc1 {
768 regulator-name = "vdd-sys-5v0";
769 regulator-always-on;
770 regulator-boot-on;
771 };
772
773 tps65090_dcdc2_reg: dcdc2 {
774 regulator-name = "vdd-sys-3v3";
775 regulator-always-on;
776 regulator-boot-on;
777 };
778
779 dcdc3 {
780 regulator-name = "vdd-ao";
781 regulator-always-on;
782 regulator-boot-on;
783 };
784
785 fet1 {
786 regulator-name = "vdd-lcd-bl";
787 };
788
789 fet3 {
790 regulator-name = "vdd-modem-3v3";
791 };
792
793 fet4 {
794 regulator-name = "avdd-lcd";
795 };
796
797 fet5 {
798 regulator-name = "vdd-lvds";
799 };
800
801 fet6 {
802 regulator-name = "vdd-sd-slot";
803 regulator-always-on;
804 regulator-boot-on;
805 };
806
807 fet7 {
808 regulator-name = "vdd-com-3v3";
809 };
810
811 ldo1 {
812 regulator-name = "vdd-sby-5v0";
813 regulator-always-on;
814 regulator-boot-on;
815 };
816
817 ldo2 {
818 regulator-name = "vdd-sby-3v3";
819 regulator-always-on;
820 regulator-boot-on;
821 };
822 };
823 };
16 }; 824 };
17 825
18 pmc { 826 pmc {
19 nvidia,invert-interrupt; 827 nvidia,invert-interrupt;
20 }; 828 };
829
830 sdhci@78000400 {
831 cd-gpios = <&gpio 170 1>; /* gpio PV2 */
832 bus-width = <4>;
833 status = "okay";
834 };
835
836 sdhci@78000600 {
837 bus-width = <8>;
838 status = "okay";
839 non-removable;
840 };
841
842 clocks {
843 compatible = "simple-bus";
844 #address-cells = <1>;
845 #size-cells = <0>;
846
847 clk32k_in: clock {
848 compatible = "fixed-clock";
849 reg=<0>;
850 #clock-cells = <0>;
851 clock-frequency = <32768>;
852 };
853 };
854
855 regulators {
856 compatible = "simple-bus";
857 #address-cells = <1>;
858 #size-cells = <0>;
859
860 vdd_ac_bat_reg: regulator@0 {
861 compatible = "regulator-fixed";
862 reg = <0>;
863 regulator-name = "vdd_ac_bat";
864 regulator-min-microvolt = <5000000>;
865 regulator-max-microvolt = <5000000>;
866 regulator-always-on;
867 };
868
869 dvdd_ts_reg: regulator@1 {
870 compatible = "regulator-fixed";
871 reg = <1>;
872 regulator-name = "dvdd_ts";
873 regulator-min-microvolt = <1800000>;
874 regulator-max-microvolt = <1800000>;
875 enable-active-high;
876 gpio = <&gpio 61 0>; /* GPIO PH5 */
877 };
878
879 lcd_bl_en_reg: regulator@2 {
880 compatible = "regulator-fixed";
881 reg = <2>;
882 regulator-name = "lcd_bl_en";
883 regulator-min-microvolt = <5000000>;
884 regulator-max-microvolt = <5000000>;
885 enable-active-high;
886 gpio = <&gpio 58 0>; /* GPIO PH2 */
887 };
888
889 usb1_vbus_reg: regulator@3 {
890 compatible = "regulator-fixed";
891 reg = <3>;
892 regulator-name = "usb1_vbus";
893 regulator-min-microvolt = <5000000>;
894 regulator-max-microvolt = <5000000>;
895 enable-active-high;
896 gpio = <&gpio 108 0>; /* GPIO PN4 */
897 gpio-open-drain;
898 vin-supply = <&tps65090_dcdc1_reg>;
899 };
900
901 usb3_vbus_reg: regulator@4 {
902 compatible = "regulator-fixed";
903 reg = <4>;
904 regulator-name = "usb2_vbus";
905 regulator-min-microvolt = <5000000>;
906 regulator-max-microvolt = <5000000>;
907 enable-active-high;
908 gpio = <&gpio 86 0>; /* GPIO PK6 */
909 gpio-open-drain;
910 vin-supply = <&tps65090_dcdc1_reg>;
911 };
912
913 vdd_hdmi_reg: regulator@5 {
914 compatible = "regulator-fixed";
915 reg = <5>;
916 regulator-name = "vdd_hdmi_5v0";
917 regulator-min-microvolt = <5000000>;
918 regulator-max-microvolt = <5000000>;
919 enable-active-high;
920 gpio = <&gpio 81 0>; /* GPIO PK1 */
921 vin-supply = <&tps65090_dcdc1_reg>;
922 };
923 };
21}; 924};
diff --git a/arch/arm/boot/dts/tegra114-pluto.dts b/arch/arm/boot/dts/tegra114-pluto.dts
index 9bea8f57aa47..6bbc8efae9c0 100644
--- a/arch/arm/boot/dts/tegra114-pluto.dts
+++ b/arch/arm/boot/dts/tegra114-pluto.dts
@@ -12,10 +12,22 @@
12 12
13 serial@70006300 { 13 serial@70006300 {
14 status = "okay"; 14 status = "okay";
15 clock-frequency = <408000000>;
16 }; 15 };
17 16
18 pmc { 17 pmc {
19 nvidia,invert-interrupt; 18 nvidia,invert-interrupt;
20 }; 19 };
20
21 clocks {
22 compatible = "simple-bus";
23 #address-cells = <1>;
24 #size-cells = <0>;
25
26 clk32k_in: clock {
27 compatible = "fixed-clock";
28 reg=<0>;
29 #clock-cells = <0>;
30 clock-frequency = <32768>;
31 };
32 };
21}; 33};
diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 1dfaf2874c57..629415ffd8dc 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -4,6 +4,13 @@
4 compatible = "nvidia,tegra114"; 4 compatible = "nvidia,tegra114";
5 interrupt-parent = <&gic>; 5 interrupt-parent = <&gic>;
6 6
7 aliases {
8 serial0 = &uarta;
9 serial1 = &uartb;
10 serial2 = &uartc;
11 serial3 = &uartd;
12 };
13
7 gic: interrupt-controller { 14 gic: interrupt-controller {
8 compatible = "arm,cortex-a15-gic"; 15 compatible = "arm,cortex-a15-gic";
9 #interrupt-cells = <3>; 16 #interrupt-cells = <3>;
@@ -24,14 +31,53 @@
24 0 42 0x04 31 0 42 0x04
25 0 121 0x04 32 0 121 0x04
26 0 122 0x04>; 33 0 122 0x04>;
34 clocks = <&tegra_car 5>;
27 }; 35 };
28 36
29 tegra_car: clock { 37 tegra_car: clock {
30 compatible = "nvidia,tegra114-car, nvidia,tegra30-car"; 38 compatible = "nvidia,tegra114-car";
31 reg = <0x60006000 0x1000>; 39 reg = <0x60006000 0x1000>;
32 #clock-cells = <1>; 40 #clock-cells = <1>;
33 }; 41 };
34 42
43 apbdma: dma {
44 compatible = "nvidia,tegra114-apbdma";
45 reg = <0x6000a000 0x1400>;
46 interrupts = <0 104 0x04
47 0 105 0x04
48 0 106 0x04
49 0 107 0x04
50 0 108 0x04
51 0 109 0x04
52 0 110 0x04
53 0 111 0x04
54 0 112 0x04
55 0 113 0x04
56 0 114 0x04
57 0 115 0x04
58 0 116 0x04
59 0 117 0x04
60 0 118 0x04
61 0 119 0x04
62 0 128 0x04
63 0 129 0x04
64 0 130 0x04
65 0 131 0x04
66 0 132 0x04
67 0 133 0x04
68 0 134 0x04
69 0 135 0x04
70 0 136 0x04
71 0 137 0x04
72 0 138 0x04
73 0 139 0x04
74 0 140 0x04
75 0 141 0x04
76 0 142 0x04
77 0 143 0x04>;
78 clocks = <&tegra_car 34>;
79 };
80
35 ahb: ahb { 81 ahb: ahb {
36 compatible = "nvidia,tegra114-ahb", "nvidia,tegra30-ahb"; 82 compatible = "nvidia,tegra114-ahb", "nvidia,tegra30-ahb";
37 reg = <0x6000c004 0x14c>; 83 reg = <0x6000c004 0x14c>;
@@ -60,35 +106,186 @@
60 0x70003000 0x40c>; /* Mux registers */ 106 0x70003000 0x40c>; /* Mux registers */
61 }; 107 };
62 108
63 serial@70006000 { 109 /*
110 * There are two serial driver i.e. 8250 based simple serial
111 * driver and APB DMA based serial driver for higher baudrate
112 * and performace. To enable the 8250 based driver, the compatible
113 * is "nvidia,tegra114-uart", "nvidia,tegra20-uart" and to enable
114 * the APB DMA based serial driver, the comptible is
115 * "nvidia,tegra114-hsuart", "nvidia,tegra30-hsuart".
116 */
117 uarta: serial@70006000 {
64 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; 118 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
65 reg = <0x70006000 0x40>; 119 reg = <0x70006000 0x40>;
66 reg-shift = <2>; 120 reg-shift = <2>;
67 interrupts = <0 36 0x04>; 121 interrupts = <0 36 0x04>;
122 nvidia,dma-request-selector = <&apbdma 8>;
68 status = "disabled"; 123 status = "disabled";
124 clocks = <&tegra_car 6>;
69 }; 125 };
70 126
71 serial@70006040 { 127 uartb: serial@70006040 {
72 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; 128 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
73 reg = <0x70006040 0x40>; 129 reg = <0x70006040 0x40>;
74 reg-shift = <2>; 130 reg-shift = <2>;
75 interrupts = <0 37 0x04>; 131 interrupts = <0 37 0x04>;
132 nvidia,dma-request-selector = <&apbdma 9>;
76 status = "disabled"; 133 status = "disabled";
134 clocks = <&tegra_car 192>;
77 }; 135 };
78 136
79 serial@70006200 { 137 uartc: serial@70006200 {
80 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; 138 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
81 reg = <0x70006200 0x100>; 139 reg = <0x70006200 0x100>;
82 reg-shift = <2>; 140 reg-shift = <2>;
83 interrupts = <0 46 0x04>; 141 interrupts = <0 46 0x04>;
142 nvidia,dma-request-selector = <&apbdma 10>;
84 status = "disabled"; 143 status = "disabled";
144 clocks = <&tegra_car 55>;
85 }; 145 };
86 146
87 serial@70006300 { 147 uartd: serial@70006300 {
88 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart"; 148 compatible = "nvidia,tegra114-uart", "nvidia,tegra20-uart";
89 reg = <0x70006300 0x100>; 149 reg = <0x70006300 0x100>;
90 reg-shift = <2>; 150 reg-shift = <2>;
91 interrupts = <0 90 0x04>; 151 interrupts = <0 90 0x04>;
152 nvidia,dma-request-selector = <&apbdma 19>;
153 status = "disabled";
154 clocks = <&tegra_car 65>;
155 };
156
157 pwm: pwm {
158 compatible = "nvidia,tegra114-pwm", "nvidia,tegra20-pwm";
159 reg = <0x7000a000 0x100>;
160 #pwm-cells = <2>;
161 clocks = <&tegra_car 17>;
162 status = "disabled";
163 };
164
165 i2c@7000c000 {
166 compatible = "nvidia,tegra114-i2c";
167 reg = <0x7000c000 0x100>;
168 interrupts = <0 38 0x04>;
169 #address-cells = <1>;
170 #size-cells = <0>;
171 clocks = <&tegra_car 12>;
172 clock-names = "div-clk";
173 status = "disabled";
174 };
175
176 i2c@7000c400 {
177 compatible = "nvidia,tegra114-i2c";
178 reg = <0x7000c400 0x100>;
179 interrupts = <0 84 0x04>;
180 #address-cells = <1>;
181 #size-cells = <0>;
182 clocks = <&tegra_car 54>;
183 clock-names = "div-clk";
184 status = "disabled";
185 };
186
187 i2c@7000c500 {
188 compatible = "nvidia,tegra114-i2c";
189 reg = <0x7000c500 0x100>;
190 interrupts = <0 92 0x04>;
191 #address-cells = <1>;
192 #size-cells = <0>;
193 clocks = <&tegra_car 67>;
194 clock-names = "div-clk";
195 status = "disabled";
196 };
197
198 i2c@7000c700 {
199 compatible = "nvidia,tegra114-i2c";
200 reg = <0x7000c700 0x100>;
201 interrupts = <0 120 0x04>;
202 #address-cells = <1>;
203 #size-cells = <0>;
204 clocks = <&tegra_car 103>;
205 clock-names = "div-clk";
206 status = "disabled";
207 };
208
209 i2c@7000d000 {
210 compatible = "nvidia,tegra114-i2c";
211 reg = <0x7000d000 0x100>;
212 interrupts = <0 53 0x04>;
213 #address-cells = <1>;
214 #size-cells = <0>;
215 clocks = <&tegra_car 47>;
216 clock-names = "div-clk";
217 status = "disabled";
218 };
219
220 spi@7000d400 {
221 compatible = "nvidia,tegra114-spi";
222 reg = <0x7000d400 0x200>;
223 interrupts = <0 59 0x04>;
224 nvidia,dma-request-selector = <&apbdma 15>;
225 #address-cells = <1>;
226 #size-cells = <0>;
227 clocks = <&tegra_car 41>;
228 clock-names = "spi";
229 status = "disabled";
230 };
231
232 spi@7000d600 {
233 compatible = "nvidia,tegra114-spi";
234 reg = <0x7000d600 0x200>;
235 interrupts = <0 82 0x04>;
236 nvidia,dma-request-selector = <&apbdma 16>;
237 #address-cells = <1>;
238 #size-cells = <0>;
239 clocks = <&tegra_car 44>;
240 clock-names = "spi";
241 status = "disabled";
242 };
243
244 spi@7000d800 {
245 compatible = "nvidia,tegra114-spi";
246 reg = <0x7000d800 0x200>;
247 interrupts = <0 83 0x04>;
248 nvidia,dma-request-selector = <&apbdma 17>;
249 #address-cells = <1>;
250 #size-cells = <0>;
251 clocks = <&tegra_car 46>;
252 clock-names = "spi";
253 status = "disabled";
254 };
255
256 spi@7000da00 {
257 compatible = "nvidia,tegra114-spi";
258 reg = <0x7000da00 0x200>;
259 interrupts = <0 93 0x04>;
260 nvidia,dma-request-selector = <&apbdma 18>;
261 #address-cells = <1>;
262 #size-cells = <0>;
263 clocks = <&tegra_car 68>;
264 clock-names = "spi";
265 status = "disabled";
266 };
267
268 spi@7000dc00 {
269 compatible = "nvidia,tegra114-spi";
270 reg = <0x7000dc00 0x200>;
271 interrupts = <0 94 0x04>;
272 nvidia,dma-request-selector = <&apbdma 27>;
273 #address-cells = <1>;
274 #size-cells = <0>;
275 clocks = <&tegra_car 104>;
276 clock-names = "spi";
277 status = "disabled";
278 };
279
280 spi@7000de00 {
281 compatible = "nvidia,tegra114-spi";
282 reg = <0x7000de00 0x200>;
283 interrupts = <0 79 0x04>;
284 nvidia,dma-request-selector = <&apbdma 28>;
285 #address-cells = <1>;
286 #size-cells = <0>;
287 clocks = <&tegra_car 105>;
288 clock-names = "spi";
92 status = "disabled"; 289 status = "disabled";
93 }; 290 };
94 291
@@ -96,11 +293,22 @@
96 compatible = "nvidia,tegra114-rtc", "nvidia,tegra20-rtc"; 293 compatible = "nvidia,tegra114-rtc", "nvidia,tegra20-rtc";
97 reg = <0x7000e000 0x100>; 294 reg = <0x7000e000 0x100>;
98 interrupts = <0 2 0x04>; 295 interrupts = <0 2 0x04>;
296 clocks = <&tegra_car 4>;
297 };
298
299 kbc {
300 compatible = "nvidia,tegra114-kbc";
301 reg = <0x7000e200 0x100>;
302 interrupts = <0 85 0x04>;
303 clocks = <&tegra_car 36>;
304 status = "disabled";
99 }; 305 };
100 306
101 pmc { 307 pmc {
102 compatible = "nvidia,tegra114-pmc", "nvidia,tegra30-pmc"; 308 compatible = "nvidia,tegra114-pmc";
103 reg = <0x7000e400 0x400>; 309 reg = <0x7000e400 0x400>;
310 clocks = <&tegra_car 261>, <&clk32k_in>;
311 clock-names = "pclk", "clk32k_in";
104 }; 312 };
105 313
106 iommu { 314 iommu {
@@ -114,6 +322,38 @@
114 nvidia,ahb = <&ahb>; 322 nvidia,ahb = <&ahb>;
115 }; 323 };
116 324
325 sdhci@78000000 {
326 compatible = "nvidia,tegra114-sdhci", "nvidia,tegra30-sdhci";
327 reg = <0x78000000 0x200>;
328 interrupts = <0 14 0x04>;
329 clocks = <&tegra_car 14>;
330 status = "disable";
331 };
332
333 sdhci@78000200 {
334 compatible = "nvidia,tegra114-sdhci", "nvidia,tegra30-sdhci";
335 reg = <0x78000200 0x200>;
336 interrupts = <0 15 0x04>;
337 clocks = <&tegra_car 9>;
338 status = "disable";
339 };
340
341 sdhci@78000400 {
342 compatible = "nvidia,tegra114-sdhci", "nvidia,tegra30-sdhci";
343 reg = <0x78000400 0x200>;
344 interrupts = <0 19 0x04>;
345 clocks = <&tegra_car 69>;
346 status = "disable";
347 };
348
349 sdhci@78000600 {
350 compatible = "nvidia,tegra114-sdhci", "nvidia,tegra30-sdhci";
351 reg = <0x78000600 0x200>;
352 interrupts = <0 31 0x04>;
353 clocks = <&tegra_car 15>;
354 status = "disable";
355 };
356
117 cpus { 357 cpus {
118 #address-cells = <1>; 358 #address-cells = <1>;
119 #size-cells = <0>; 359 #size-cells = <0>;
diff --git a/arch/arm/boot/dts/tegra20-colibri-512.dtsi b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
index 444162090042..a573b94b7c93 100644
--- a/arch/arm/boot/dts/tegra20-colibri-512.dtsi
+++ b/arch/arm/boot/dts/tegra20-colibri-512.dtsi
@@ -361,6 +361,15 @@
361 }; 361 };
362 }; 362 };
363 363
364 pmc {
365 nvidia,suspend-mode = <2>;
366 nvidia,cpu-pwr-good-time = <5000>;
367 nvidia,cpu-pwr-off-time = <5000>;
368 nvidia,core-pwr-good-time = <3845 3845>;
369 nvidia,core-pwr-off-time = <3875>;
370 nvidia,sys-clock-req-active-high;
371 };
372
364 memory-controller@7000f400 { 373 memory-controller@7000f400 {
365 emc-table@83250 { 374 emc-table@83250 {
366 reg = <83250>; 375 reg = <83250>;
@@ -444,7 +453,20 @@
444 }; 453 };
445 454
446 sdhci@c8000600 { 455 sdhci@c8000600 {
447 cd-gpios = <&gpio 23 0>; /* gpio PC7 */ 456 cd-gpios = <&gpio 23 1>; /* gpio PC7 */
457 };
458
459 clocks {
460 compatible = "simple-bus";
461 #address-cells = <1>;
462 #size-cells = <0>;
463
464 clk32k_in: clock {
465 compatible = "fixed-clock";
466 reg=<0>;
467 #clock-cells = <0>;
468 clock-frequency = <32768>;
469 };
448 }; 470 };
449 471
450 sound { 472 sound {
@@ -460,6 +482,9 @@
460 "Mic", "MIC1"; 482 "Mic", "MIC1";
461 483
462 nvidia,ac97-controller = <&ac97>; 484 nvidia,ac97-controller = <&ac97>;
485
486 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
487 clock-names = "pll_a", "pll_a_out0", "mclk";
463 }; 488 };
464 489
465 regulators { 490 regulators {
diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts
index 61d027f03617..e7d5de4e00b9 100644
--- a/arch/arm/boot/dts/tegra20-harmony.dts
+++ b/arch/arm/boot/dts/tegra20-harmony.dts
@@ -416,6 +416,12 @@
416 416
417 pmc { 417 pmc {
418 nvidia,invert-interrupt; 418 nvidia,invert-interrupt;
419 nvidia,suspend-mode = <2>;
420 nvidia,cpu-pwr-good-time = <5000>;
421 nvidia,cpu-pwr-off-time = <5000>;
422 nvidia,core-pwr-good-time = <3845 3845>;
423 nvidia,core-pwr-off-time = <3875>;
424 nvidia,sys-clock-req-active-high;
419 }; 425 };
420 426
421 usb@c5000000 { 427 usb@c5000000 {
@@ -437,7 +443,7 @@
437 443
438 sdhci@c8000200 { 444 sdhci@c8000200 {
439 status = "okay"; 445 status = "okay";
440 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 446 cd-gpios = <&gpio 69 1>; /* gpio PI5 */
441 wp-gpios = <&gpio 57 0>; /* gpio PH1 */ 447 wp-gpios = <&gpio 57 0>; /* gpio PH1 */
442 power-gpios = <&gpio 155 0>; /* gpio PT3 */ 448 power-gpios = <&gpio 155 0>; /* gpio PT3 */
443 bus-width = <4>; 449 bus-width = <4>;
@@ -445,12 +451,36 @@
445 451
446 sdhci@c8000600 { 452 sdhci@c8000600 {
447 status = "okay"; 453 status = "okay";
448 cd-gpios = <&gpio 58 0>; /* gpio PH2 */ 454 cd-gpios = <&gpio 58 1>; /* gpio PH2 */
449 wp-gpios = <&gpio 59 0>; /* gpio PH3 */ 455 wp-gpios = <&gpio 59 0>; /* gpio PH3 */
450 power-gpios = <&gpio 70 0>; /* gpio PI6 */ 456 power-gpios = <&gpio 70 0>; /* gpio PI6 */
451 bus-width = <8>; 457 bus-width = <8>;
452 }; 458 };
453 459
460 clocks {
461 compatible = "simple-bus";
462 #address-cells = <1>;
463 #size-cells = <0>;
464
465 clk32k_in: clock {
466 compatible = "fixed-clock";
467 reg=<0>;
468 #clock-cells = <0>;
469 clock-frequency = <32768>;
470 };
471 };
472
473 gpio-keys {
474 compatible = "gpio-keys";
475
476 power {
477 label = "Power";
478 gpios = <&gpio 170 1>; /* gpio PV2, active low */
479 linux,code = <116>; /* KEY_POWER */
480 gpio-key,wakeup;
481 };
482 };
483
454 kbc { 484 kbc {
455 status = "okay"; 485 status = "okay";
456 nvidia,debounce-delay-ms = <2>; 486 nvidia,debounce-delay-ms = <2>;
@@ -656,5 +686,8 @@
656 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ 686 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
657 nvidia,int-mic-en-gpios = <&gpio 184 0>; /*gpio PX0 */ 687 nvidia,int-mic-en-gpios = <&gpio 184 0>; /*gpio PX0 */
658 nvidia,ext-mic-en-gpios = <&gpio 185 0>; /* gpio PX1 */ 688 nvidia,ext-mic-en-gpios = <&gpio 185 0>; /* gpio PX1 */
689
690 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
691 clock-names = "pll_a", "pll_a_out0", "mclk";
659 }; 692 };
660}; 693};
diff --git a/arch/arm/boot/dts/tegra20-medcom-wide.dts b/arch/arm/boot/dts/tegra20-medcom-wide.dts
index a2d6d6541f83..ace23437da89 100644
--- a/arch/arm/boot/dts/tegra20-medcom-wide.dts
+++ b/arch/arm/boot/dts/tegra20-medcom-wide.dts
@@ -6,6 +6,10 @@
6 model = "Avionic Design Medcom-Wide board"; 6 model = "Avionic Design Medcom-Wide board";
7 compatible = "ad,medcom-wide", "ad,tamonten", "nvidia,tegra20"; 7 compatible = "ad,medcom-wide", "ad,tamonten", "nvidia,tegra20";
8 8
9 pwm {
10 status = "okay";
11 };
12
9 i2c@7000c000 { 13 i2c@7000c000 {
10 wm8903: wm8903@1a { 14 wm8903: wm8903@1a {
11 compatible = "wlf,wm8903"; 15 compatible = "wlf,wm8903";
@@ -54,5 +58,8 @@
54 58
55 nvidia,spkr-en-gpios = <&wm8903 2 0>; 59 nvidia,spkr-en-gpios = <&wm8903 2 0>;
56 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ 60 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
61
62 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
63 clock-names = "pll_a", "pll_a_out0", "mclk";
57 }; 64 };
58}; 65};
diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index 54d6fce00a59..e3e0c9977df4 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -415,6 +415,12 @@
415 415
416 pmc { 416 pmc {
417 nvidia,invert-interrupt; 417 nvidia,invert-interrupt;
418 nvidia,suspend-mode = <2>;
419 nvidia,cpu-pwr-good-time = <2000>;
420 nvidia,cpu-pwr-off-time = <0>;
421 nvidia,core-pwr-good-time = <3845 3845>;
422 nvidia,core-pwr-off-time = <0>;
423 nvidia,sys-clock-req-active-high;
418 }; 424 };
419 425
420 usb@c5000000 { 426 usb@c5000000 {
@@ -436,7 +442,7 @@
436 442
437 sdhci@c8000000 { 443 sdhci@c8000000 {
438 status = "okay"; 444 status = "okay";
439 cd-gpios = <&gpio 173 0>; /* gpio PV5 */ 445 cd-gpios = <&gpio 173 1>; /* gpio PV5 */
440 wp-gpios = <&gpio 57 0>; /* gpio PH1 */ 446 wp-gpios = <&gpio 57 0>; /* gpio PH1 */
441 power-gpios = <&gpio 169 0>; /* gpio PV1 */ 447 power-gpios = <&gpio 169 0>; /* gpio PV1 */
442 bus-width = <4>; 448 bus-width = <4>;
@@ -445,6 +451,20 @@
445 sdhci@c8000600 { 451 sdhci@c8000600 {
446 status = "okay"; 452 status = "okay";
447 bus-width = <8>; 453 bus-width = <8>;
454 non-removable;
455 };
456
457 clocks {
458 compatible = "simple-bus";
459 #address-cells = <1>;
460 #size-cells = <0>;
461
462 clk32k_in: clock {
463 compatible = "fixed-clock";
464 reg=<0>;
465 #clock-cells = <0>;
466 clock-frequency = <32768>;
467 };
448 }; 468 };
449 469
450 gpio-keys { 470 gpio-keys {
@@ -501,5 +521,8 @@
501 nvidia,audio-codec = <&alc5632>; 521 nvidia,audio-codec = <&alc5632>;
502 nvidia,i2s-controller = <&tegra_i2s1>; 522 nvidia,i2s-controller = <&tegra_i2s1>;
503 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ 523 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
524
525 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
526 clock-names = "pll_a", "pll_a_out0", "mclk";
504 }; 527 };
505}; 528};
diff --git a/arch/arm/boot/dts/tegra20-plutux.dts b/arch/arm/boot/dts/tegra20-plutux.dts
index 289480026fbf..1a17cc30bb9d 100644
--- a/arch/arm/boot/dts/tegra20-plutux.dts
+++ b/arch/arm/boot/dts/tegra20-plutux.dts
@@ -52,5 +52,8 @@
52 52
53 nvidia,spkr-en-gpios = <&wm8903 2 0>; 53 nvidia,spkr-en-gpios = <&wm8903 2 0>;
54 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ 54 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
55
56 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
57 clock-names = "pll_a", "pll_a_out0", "mclk";
55 }; 58 };
56}; 59};
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts
index 37b3a57ec0f1..cee4c34010fe 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts
@@ -517,6 +517,12 @@
517 517
518 pmc { 518 pmc {
519 nvidia,invert-interrupt; 519 nvidia,invert-interrupt;
520 nvidia,suspend-mode = <2>;
521 nvidia,cpu-pwr-good-time = <5000>;
522 nvidia,cpu-pwr-off-time = <5000>;
523 nvidia,core-pwr-good-time = <3845 3845>;
524 nvidia,core-pwr-off-time = <3875>;
525 nvidia,sys-clock-req-active-high;
520 }; 526 };
521 527
522 memory-controller@7000f400 { 528 memory-controller@7000f400 {
@@ -580,11 +586,12 @@
580 status = "okay"; 586 status = "okay";
581 power-gpios = <&gpio 86 0>; /* gpio PK6 */ 587 power-gpios = <&gpio 86 0>; /* gpio PK6 */
582 bus-width = <4>; 588 bus-width = <4>;
589 keep-power-in-suspend;
583 }; 590 };
584 591
585 sdhci@c8000400 { 592 sdhci@c8000400 {
586 status = "okay"; 593 status = "okay";
587 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 594 cd-gpios = <&gpio 69 1>; /* gpio PI5 */
588 wp-gpios = <&gpio 57 0>; /* gpio PH1 */ 595 wp-gpios = <&gpio 57 0>; /* gpio PH1 */
589 power-gpios = <&gpio 70 0>; /* gpio PI6 */ 596 power-gpios = <&gpio 70 0>; /* gpio PI6 */
590 bus-width = <4>; 597 bus-width = <4>;
@@ -593,6 +600,20 @@
593 sdhci@c8000600 { 600 sdhci@c8000600 {
594 status = "okay"; 601 status = "okay";
595 bus-width = <8>; 602 bus-width = <8>;
603 non-removable;
604 };
605
606 clocks {
607 compatible = "simple-bus";
608 #address-cells = <1>;
609 #size-cells = <0>;
610
611 clk32k_in: clock {
612 compatible = "fixed-clock";
613 reg=<0>;
614 #clock-cells = <0>;
615 clock-frequency = <32768>;
616 };
596 }; 617 };
597 618
598 gpio-keys { 619 gpio-keys {
@@ -808,5 +829,8 @@
808 829
809 nvidia,spkr-en-gpios = <&wm8903 2 0>; 830 nvidia,spkr-en-gpios = <&wm8903 2 0>;
810 nvidia,hp-det-gpios = <&gpio 185 0>; /* gpio PX1 */ 831 nvidia,hp-det-gpios = <&gpio 185 0>; /* gpio PX1 */
832
833 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
834 clock-names = "pll_a", "pll_a_out0", "mclk";
811 }; 835 };
812}; 836};
diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi b/arch/arm/boot/dts/tegra20-tamonten.dtsi
index 4766abae7a72..50b3ec16b93a 100644
--- a/arch/arm/boot/dts/tegra20-tamonten.dtsi
+++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi
@@ -458,6 +458,12 @@
458 458
459 pmc { 459 pmc {
460 nvidia,invert-interrupt; 460 nvidia,invert-interrupt;
461 nvidia,suspend-mode = <2>;
462 nvidia,cpu-pwr-good-time = <5000>;
463 nvidia,cpu-pwr-off-time = <5000>;
464 nvidia,core-pwr-good-time = <3845 3845>;
465 nvidia,core-pwr-off-time = <3875>;
466 nvidia,sys-clock-req-active-high;
461 }; 467 };
462 468
463 usb@c5008000 { 469 usb@c5008000 {
@@ -465,12 +471,25 @@
465 }; 471 };
466 472
467 sdhci@c8000600 { 473 sdhci@c8000600 {
468 cd-gpios = <&gpio 58 0>; /* gpio PH2 */ 474 cd-gpios = <&gpio 58 1>; /* gpio PH2 */
469 wp-gpios = <&gpio 59 0>; /* gpio PH3 */ 475 wp-gpios = <&gpio 59 0>; /* gpio PH3 */
470 bus-width = <4>; 476 bus-width = <4>;
471 status = "okay"; 477 status = "okay";
472 }; 478 };
473 479
480 clocks {
481 compatible = "simple-bus";
482 #address-cells = <1>;
483 #size-cells = <0>;
484
485 clk32k_in: clock {
486 compatible = "fixed-clock";
487 reg=<0>;
488 #clock-cells = <0>;
489 clock-frequency = <32768>;
490 };
491 };
492
474 regulators { 493 regulators {
475 compatible = "simple-bus"; 494 compatible = "simple-bus";
476 495
diff --git a/arch/arm/boot/dts/tegra20-tec.dts b/arch/arm/boot/dts/tegra20-tec.dts
index 402b21004bef..742f0b38d21d 100644
--- a/arch/arm/boot/dts/tegra20-tec.dts
+++ b/arch/arm/boot/dts/tegra20-tec.dts
@@ -52,5 +52,8 @@
52 52
53 nvidia,spkr-en-gpios = <&wm8903 2 0>; 53 nvidia,spkr-en-gpios = <&wm8903 2 0>;
54 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ 54 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
55
56 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
57 clock-names = "pll_a", "pll_a_out0", "mclk";
55 }; 58 };
56}; 59};
diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts b/arch/arm/boot/dts/tegra20-trimslice.dts
index 5d79e4fc49a6..9cc78a15d739 100644
--- a/arch/arm/boot/dts/tegra20-trimslice.dts
+++ b/arch/arm/boot/dts/tegra20-trimslice.dts
@@ -300,6 +300,15 @@
300 }; 300 };
301 }; 301 };
302 302
303 pmc {
304 nvidia,suspend-mode = <2>;
305 nvidia,cpu-pwr-good-time = <5000>;
306 nvidia,cpu-pwr-off-time = <5000>;
307 nvidia,core-pwr-good-time = <3845 3845>;
308 nvidia,core-pwr-off-time = <3875>;
309 nvidia,sys-clock-req-active-high;
310 };
311
303 usb@c5000000 { 312 usb@c5000000 {
304 status = "okay"; 313 status = "okay";
305 nvidia,vbus-gpio = <&gpio 170 0>; /* gpio PV2 */ 314 nvidia,vbus-gpio = <&gpio 170 0>; /* gpio PV2 */
@@ -325,11 +334,35 @@
325 334
326 sdhci@c8000600 { 335 sdhci@c8000600 {
327 status = "okay"; 336 status = "okay";
328 cd-gpios = <&gpio 121 0>; /* gpio PP1 */ 337 cd-gpios = <&gpio 121 1>; /* gpio PP1 */
329 wp-gpios = <&gpio 122 0>; /* gpio PP2 */ 338 wp-gpios = <&gpio 122 0>; /* gpio PP2 */
330 bus-width = <4>; 339 bus-width = <4>;
331 }; 340 };
332 341
342 clocks {
343 compatible = "simple-bus";
344 #address-cells = <1>;
345 #size-cells = <0>;
346
347 clk32k_in: clock {
348 compatible = "fixed-clock";
349 reg=<0>;
350 #clock-cells = <0>;
351 clock-frequency = <32768>;
352 };
353 };
354
355 gpio-keys {
356 compatible = "gpio-keys";
357
358 power {
359 label = "Power";
360 gpios = <&gpio 190 1>; /* gpio PX6, active low */
361 linux,code = <116>; /* KEY_POWER */
362 gpio-key,wakeup;
363 };
364 };
365
333 poweroff { 366 poweroff {
334 compatible = "gpio-poweroff"; 367 compatible = "gpio-poweroff";
335 gpios = <&gpio 191 1>; /* gpio PX7, active low */ 368 gpios = <&gpio 191 1>; /* gpio PX7, active low */
@@ -363,5 +396,8 @@
363 compatible = "nvidia,tegra-audio-trimslice"; 396 compatible = "nvidia,tegra-audio-trimslice";
364 nvidia,i2s-controller = <&tegra_i2s1>; 397 nvidia,i2s-controller = <&tegra_i2s1>;
365 nvidia,audio-codec = <&codec>; 398 nvidia,audio-codec = <&codec>;
399
400 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
401 clock-names = "pll_a", "pll_a_out0", "mclk";
366 }; 402 };
367}; 403};
diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts
index 425c89000c20..dd38f1f03834 100644
--- a/arch/arm/boot/dts/tegra20-ventana.dts
+++ b/arch/arm/boot/dts/tegra20-ventana.dts
@@ -493,6 +493,12 @@
493 493
494 pmc { 494 pmc {
495 nvidia,invert-interrupt; 495 nvidia,invert-interrupt;
496 nvidia,suspend-mode = <2>;
497 nvidia,cpu-pwr-good-time = <2000>;
498 nvidia,cpu-pwr-off-time = <100>;
499 nvidia,core-pwr-good-time = <3845 3845>;
500 nvidia,core-pwr-off-time = <458>;
501 nvidia,sys-clock-req-active-high;
496 }; 502 };
497 503
498 usb@c5000000 { 504 usb@c5000000 {
@@ -516,11 +522,12 @@
516 status = "okay"; 522 status = "okay";
517 power-gpios = <&gpio 86 0>; /* gpio PK6 */ 523 power-gpios = <&gpio 86 0>; /* gpio PK6 */
518 bus-width = <4>; 524 bus-width = <4>;
525 keep-power-in-suspend;
519 }; 526 };
520 527
521 sdhci@c8000400 { 528 sdhci@c8000400 {
522 status = "okay"; 529 status = "okay";
523 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 530 cd-gpios = <&gpio 69 1>; /* gpio PI5 */
524 wp-gpios = <&gpio 57 0>; /* gpio PH1 */ 531 wp-gpios = <&gpio 57 0>; /* gpio PH1 */
525 power-gpios = <&gpio 70 0>; /* gpio PI6 */ 532 power-gpios = <&gpio 70 0>; /* gpio PI6 */
526 bus-width = <4>; 533 bus-width = <4>;
@@ -529,6 +536,31 @@
529 sdhci@c8000600 { 536 sdhci@c8000600 {
530 status = "okay"; 537 status = "okay";
531 bus-width = <8>; 538 bus-width = <8>;
539 non-removable;
540 };
541
542 clocks {
543 compatible = "simple-bus";
544 #address-cells = <1>;
545 #size-cells = <0>;
546
547 clk32k_in: clock {
548 compatible = "fixed-clock";
549 reg=<0>;
550 #clock-cells = <0>;
551 clock-frequency = <32768>;
552 };
553 };
554
555 gpio-keys {
556 compatible = "gpio-keys";
557
558 power {
559 label = "Power";
560 gpios = <&gpio 170 1>; /* gpio PV2, active low */
561 linux,code = <116>; /* KEY_POWER */
562 gpio-key,wakeup;
563 };
532 }; 564 };
533 565
534 regulators { 566 regulators {
@@ -607,5 +639,8 @@
607 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ 639 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
608 nvidia,int-mic-en-gpios = <&gpio 184 0>; /* gpio PX0 */ 640 nvidia,int-mic-en-gpios = <&gpio 184 0>; /* gpio PX0 */
609 nvidia,ext-mic-en-gpios = <&gpio 185 0>; /* gpio PX1 */ 641 nvidia,ext-mic-en-gpios = <&gpio 185 0>; /* gpio PX1 */
642
643 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
644 clock-names = "pll_a", "pll_a_out0", "mclk";
610 }; 645 };
611}; 646};
diff --git a/arch/arm/boot/dts/tegra20-whistler.dts b/arch/arm/boot/dts/tegra20-whistler.dts
index ea57c0f6dcce..d2567f83aaff 100644
--- a/arch/arm/boot/dts/tegra20-whistler.dts
+++ b/arch/arm/boot/dts/tegra20-whistler.dts
@@ -496,6 +496,14 @@
496 496
497 pmc { 497 pmc {
498 nvidia,invert-interrupt; 498 nvidia,invert-interrupt;
499 nvidia,suspend-mode = <2>;
500 nvidia,cpu-pwr-good-time = <2000>;
501 nvidia,cpu-pwr-off-time = <1000>;
502 nvidia,core-pwr-good-time = <0 3845>;
503 nvidia,core-pwr-off-time = <93727>;
504 nvidia,core-power-req-active-high;
505 nvidia,sys-clock-req-active-high;
506 nvidia,combined-power-req;
499 }; 507 };
500 508
501 usb@c5000000 { 509 usb@c5000000 {
@@ -510,6 +518,7 @@
510 518
511 sdhci@c8000400 { 519 sdhci@c8000400 {
512 status = "okay"; 520 status = "okay";
521 cd-gpios = <&gpio 69 1>; /* gpio PI5 */
513 wp-gpios = <&gpio 173 0>; /* gpio PV5 */ 522 wp-gpios = <&gpio 173 0>; /* gpio PV5 */
514 bus-width = <8>; 523 bus-width = <8>;
515 }; 524 };
@@ -517,6 +526,20 @@
517 sdhci@c8000600 { 526 sdhci@c8000600 {
518 status = "okay"; 527 status = "okay";
519 bus-width = <8>; 528 bus-width = <8>;
529 non-removable;
530 };
531
532 clocks {
533 compatible = "simple-bus";
534 #address-cells = <1>;
535 #size-cells = <0>;
536
537 clk32k_in: clock {
538 compatible = "fixed-clock";
539 reg=<0>;
540 #clock-cells = <0>;
541 clock-frequency = <32768>;
542 };
520 }; 543 };
521 544
522 kbc { 545 kbc {
@@ -525,6 +548,7 @@
525 nvidia,repeat-delay-ms = <160>; 548 nvidia,repeat-delay-ms = <160>;
526 nvidia,kbc-row-pins = <0 1 2>; 549 nvidia,kbc-row-pins = <0 1 2>;
527 nvidia,kbc-col-pins = <16 17>; 550 nvidia,kbc-col-pins = <16 17>;
551 nvidia,wakeup-source;
528 linux,keymap = <0x00000074 /* KEY_POWER */ 552 linux,keymap = <0x00000074 /* KEY_POWER */
529 0x01000066 /* KEY_HOME */ 553 0x01000066 /* KEY_HOME */
530 0x0101009E /* KEY_BACK */ 554 0x0101009E /* KEY_BACK */
@@ -559,5 +583,8 @@
559 583
560 nvidia,i2s-controller = <&tegra_i2s1>; 584 nvidia,i2s-controller = <&tegra_i2s1>;
561 nvidia,audio-codec = <&codec>; 585 nvidia,audio-codec = <&codec>;
586
587 clocks = <&tegra_car 112>, <&tegra_car 113>, <&tegra_car 94>;
588 clock-names = "pll_a", "pll_a_out0", "mclk";
562 }; 589 };
563}; 590};
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 3d3f64d2111a..56a91106041b 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -145,6 +145,7 @@
145 0 1 0x04 145 0 1 0x04
146 0 41 0x04 146 0 41 0x04
147 0 42 0x04>; 147 0 42 0x04>;
148 clocks = <&tegra_car 5>;
148 }; 149 };
149 150
150 tegra_car: clock { 151 tegra_car: clock {
@@ -208,7 +209,7 @@
208 compatible = "nvidia,tegra20-das"; 209 compatible = "nvidia,tegra20-das";
209 reg = <0x70000c00 0x80>; 210 reg = <0x70000c00 0x80>;
210 }; 211 };
211 212
212 tegra_ac97: ac97 { 213 tegra_ac97: ac97 {
213 compatible = "nvidia,tegra20-ac97"; 214 compatible = "nvidia,tegra20-ac97";
214 reg = <0x70002000 0x200>; 215 reg = <0x70002000 0x200>;
@@ -298,12 +299,14 @@
298 reg = <0x7000a000 0x100>; 299 reg = <0x7000a000 0x100>;
299 #pwm-cells = <2>; 300 #pwm-cells = <2>;
300 clocks = <&tegra_car 17>; 301 clocks = <&tegra_car 17>;
302 status = "disabled";
301 }; 303 };
302 304
303 rtc { 305 rtc {
304 compatible = "nvidia,tegra20-rtc"; 306 compatible = "nvidia,tegra20-rtc";
305 reg = <0x7000e000 0x100>; 307 reg = <0x7000e000 0x100>;
306 interrupts = <0 2 0x04>; 308 interrupts = <0 2 0x04>;
309 clocks = <&tegra_car 4>;
307 }; 310 };
308 311
309 i2c@7000c000 { 312 i2c@7000c000 {
@@ -416,6 +419,8 @@
416 pmc { 419 pmc {
417 compatible = "nvidia,tegra20-pmc"; 420 compatible = "nvidia,tegra20-pmc";
418 reg = <0x7000e400 0x400>; 421 reg = <0x7000e400 0x400>;
422 clocks = <&tegra_car 110>, <&clk32k_in>;
423 clock-names = "pclk", "clk32k_in";
419 }; 424 };
420 425
421 memory-controller@7000f000 { 426 memory-controller@7000f000 {
@@ -438,31 +443,6 @@
438 #size-cells = <0>; 443 #size-cells = <0>;
439 }; 444 };
440 445
441 phy1: usb-phy@c5000400 {
442 compatible = "nvidia,tegra20-usb-phy";
443 reg = <0xc5000400 0x3c00>;
444 phy_type = "utmi";
445 nvidia,has-legacy-mode;
446 clocks = <&tegra_car 22>, <&tegra_car 127>;
447 clock-names = "phy", "pll_u";
448 };
449
450 phy2: usb-phy@c5004400 {
451 compatible = "nvidia,tegra20-usb-phy";
452 reg = <0xc5004400 0x3c00>;
453 phy_type = "ulpi";
454 clocks = <&tegra_car 94>, <&tegra_car 127>;
455 clock-names = "phy", "pll_u";
456 };
457
458 phy3: usb-phy@c5008400 {
459 compatible = "nvidia,tegra20-usb-phy";
460 reg = <0xc5008400 0x3C00>;
461 phy_type = "utmi";
462 clocks = <&tegra_car 22>, <&tegra_car 127>;
463 clock-names = "phy", "pll_u";
464 };
465
466 usb@c5000000 { 446 usb@c5000000 {
467 compatible = "nvidia,tegra20-ehci", "usb-ehci"; 447 compatible = "nvidia,tegra20-ehci", "usb-ehci";
468 reg = <0xc5000000 0x4000>; 448 reg = <0xc5000000 0x4000>;
@@ -475,6 +455,15 @@
475 status = "disabled"; 455 status = "disabled";
476 }; 456 };
477 457
458 phy1: usb-phy@c5000400 {
459 compatible = "nvidia,tegra20-usb-phy";
460 reg = <0xc5000400 0x3c00>;
461 phy_type = "utmi";
462 nvidia,has-legacy-mode;
463 clocks = <&tegra_car 22>, <&tegra_car 127>;
464 clock-names = "phy", "pll_u";
465 };
466
478 usb@c5004000 { 467 usb@c5004000 {
479 compatible = "nvidia,tegra20-ehci", "usb-ehci"; 468 compatible = "nvidia,tegra20-ehci", "usb-ehci";
480 reg = <0xc5004000 0x4000>; 469 reg = <0xc5004000 0x4000>;
@@ -485,6 +474,14 @@
485 status = "disabled"; 474 status = "disabled";
486 }; 475 };
487 476
477 phy2: usb-phy@c5004400 {
478 compatible = "nvidia,tegra20-usb-phy";
479 reg = <0xc5004400 0x3c00>;
480 phy_type = "ulpi";
481 clocks = <&tegra_car 93>, <&tegra_car 127>;
482 clock-names = "phy", "pll_u";
483 };
484
488 usb@c5008000 { 485 usb@c5008000 {
489 compatible = "nvidia,tegra20-ehci", "usb-ehci"; 486 compatible = "nvidia,tegra20-ehci", "usb-ehci";
490 reg = <0xc5008000 0x4000>; 487 reg = <0xc5008000 0x4000>;
@@ -495,6 +492,14 @@
495 status = "disabled"; 492 status = "disabled";
496 }; 493 };
497 494
495 phy3: usb-phy@c5008400 {
496 compatible = "nvidia,tegra20-usb-phy";
497 reg = <0xc5008400 0x3c00>;
498 phy_type = "utmi";
499 clocks = <&tegra_car 22>, <&tegra_car 127>;
500 clock-names = "phy", "pll_u";
501 };
502
498 sdhci@c8000000 { 503 sdhci@c8000000 {
499 compatible = "nvidia,tegra20-sdhci"; 504 compatible = "nvidia,tegra20-sdhci";
500 reg = <0xc8000000 0x200>; 505 reg = <0xc8000000 0x200>;
diff --git a/arch/arm/boot/dts/tegra30-beaver.dts b/arch/arm/boot/dts/tegra30-beaver.dts
index 8ff2ff20e4a3..b732f7c13a66 100644
--- a/arch/arm/boot/dts/tegra30-beaver.dts
+++ b/arch/arm/boot/dts/tegra30-beaver.dts
@@ -253,11 +253,18 @@
253 pmc { 253 pmc {
254 status = "okay"; 254 status = "okay";
255 nvidia,invert-interrupt; 255 nvidia,invert-interrupt;
256 nvidia,suspend-mode = <2>;
257 nvidia,cpu-pwr-good-time = <2000>;
258 nvidia,cpu-pwr-off-time = <200>;
259 nvidia,core-pwr-good-time = <3845 3845>;
260 nvidia,core-pwr-off-time = <0>;
261 nvidia,core-power-req-active-high;
262 nvidia,sys-clock-req-active-high;
256 }; 263 };
257 264
258 sdhci@78000000 { 265 sdhci@78000000 {
259 status = "okay"; 266 status = "okay";
260 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 267 cd-gpios = <&gpio 69 1>; /* gpio PI5 */
261 wp-gpios = <&gpio 155 0>; /* gpio PT3 */ 268 wp-gpios = <&gpio 155 0>; /* gpio PT3 */
262 power-gpios = <&gpio 31 0>; /* gpio PD7 */ 269 power-gpios = <&gpio 31 0>; /* gpio PD7 */
263 bus-width = <4>; 270 bus-width = <4>;
@@ -266,6 +273,20 @@
266 sdhci@78000600 { 273 sdhci@78000600 {
267 status = "okay"; 274 status = "okay";
268 bus-width = <8>; 275 bus-width = <8>;
276 non-removable;
277 };
278
279 clocks {
280 compatible = "simple-bus";
281 #address-cells = <1>;
282 #size-cells = <0>;
283
284 clk32k_in: clock {
285 compatible = "fixed-clock";
286 reg=<0>;
287 #clock-cells = <0>;
288 clock-frequency = <32768>;
289 };
269 }; 290 };
270 291
271 regulators { 292 regulators {
diff --git a/arch/arm/boot/dts/tegra30-cardhu-a02.dts b/arch/arm/boot/dts/tegra30-cardhu-a02.dts
index adc88aa50eb6..e392bd2dab9b 100644
--- a/arch/arm/boot/dts/tegra30-cardhu-a02.dts
+++ b/arch/arm/boot/dts/tegra30-cardhu-a02.dts
@@ -88,6 +88,7 @@
88 status = "okay"; 88 status = "okay";
89 power-gpios = <&gpio 28 0>; /* gpio PD4 */ 89 power-gpios = <&gpio 28 0>; /* gpio PD4 */
90 bus-width = <4>; 90 bus-width = <4>;
91 keep-power-in-suspend;
91 }; 92 };
92}; 93};
93 94
diff --git a/arch/arm/boot/dts/tegra30-cardhu-a04.dts b/arch/arm/boot/dts/tegra30-cardhu-a04.dts
index 08163e145d57..d0db6c7e774f 100644
--- a/arch/arm/boot/dts/tegra30-cardhu-a04.dts
+++ b/arch/arm/boot/dts/tegra30-cardhu-a04.dts
@@ -100,5 +100,6 @@
100 status = "okay"; 100 status = "okay";
101 power-gpios = <&gpio 27 0>; /* gpio PD3 */ 101 power-gpios = <&gpio 27 0>; /* gpio PD3 */
102 bus-width = <4>; 102 bus-width = <4>;
103 keep-power-in-suspend;
103 }; 104 };
104}; 105};
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
index 17499272a4ef..01b4c26fad96 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -307,11 +307,18 @@
307 pmc { 307 pmc {
308 status = "okay"; 308 status = "okay";
309 nvidia,invert-interrupt; 309 nvidia,invert-interrupt;
310 nvidia,suspend-mode = <2>;
311 nvidia,cpu-pwr-good-time = <2000>;
312 nvidia,cpu-pwr-off-time = <200>;
313 nvidia,core-pwr-good-time = <3845 3845>;
314 nvidia,core-pwr-off-time = <0>;
315 nvidia,core-power-req-active-high;
316 nvidia,sys-clock-req-active-high;
310 }; 317 };
311 318
312 sdhci@78000000 { 319 sdhci@78000000 {
313 status = "okay"; 320 status = "okay";
314 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 321 cd-gpios = <&gpio 69 1>; /* gpio PI5 */
315 wp-gpios = <&gpio 155 0>; /* gpio PT3 */ 322 wp-gpios = <&gpio 155 0>; /* gpio PT3 */
316 power-gpios = <&gpio 31 0>; /* gpio PD7 */ 323 power-gpios = <&gpio 31 0>; /* gpio PD7 */
317 bus-width = <4>; 324 bus-width = <4>;
@@ -320,6 +327,20 @@
320 sdhci@78000600 { 327 sdhci@78000600 {
321 status = "okay"; 328 status = "okay";
322 bus-width = <8>; 329 bus-width = <8>;
330 non-removable;
331 };
332
333 clocks {
334 compatible = "simple-bus";
335 #address-cells = <1>;
336 #size-cells = <0>;
337
338 clk32k_in: clock {
339 compatible = "fixed-clock";
340 reg=<0>;
341 #clock-cells = <0>;
342 clock-frequency = <32768>;
343 };
323 }; 344 };
324 345
325 regulators { 346 regulators {
@@ -496,5 +517,8 @@
496 517
497 nvidia,spkr-en-gpios = <&wm8903 2 0>; 518 nvidia,spkr-en-gpios = <&wm8903 2 0>;
498 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */ 519 nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
520
521 clocks = <&tegra_car 184>, <&tegra_car 185>, <&tegra_car 120>;
522 clock-names = "pll_a", "pll_a_out0", "mclk";
499 }; 523 };
500}; 524};
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index dbf46c272562..15ded605142a 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -148,6 +148,7 @@
148 0 42 0x04 148 0 42 0x04
149 0 121 0x04 149 0 121 0x04
150 0 122 0x04>; 150 0 122 0x04>;
151 clocks = <&tegra_car 5>;
151 }; 152 };
152 153
153 tegra_car: clock { 154 tegra_car: clock {
@@ -285,12 +286,14 @@
285 reg = <0x7000a000 0x100>; 286 reg = <0x7000a000 0x100>;
286 #pwm-cells = <2>; 287 #pwm-cells = <2>;
287 clocks = <&tegra_car 17>; 288 clocks = <&tegra_car 17>;
289 status = "disabled";
288 }; 290 };
289 291
290 rtc { 292 rtc {
291 compatible = "nvidia,tegra30-rtc", "nvidia,tegra20-rtc"; 293 compatible = "nvidia,tegra30-rtc", "nvidia,tegra20-rtc";
292 reg = <0x7000e000 0x100>; 294 reg = <0x7000e000 0x100>;
293 interrupts = <0 2 0x04>; 295 interrupts = <0 2 0x04>;
296 clocks = <&tegra_car 4>;
294 }; 297 };
295 298
296 i2c@7000c000 { 299 i2c@7000c000 {
@@ -423,8 +426,10 @@
423 }; 426 };
424 427
425 pmc { 428 pmc {
426 compatible = "nvidia,tegra20-pmc", "nvidia,tegra30-pmc"; 429 compatible = "nvidia,tegra30-pmc";
427 reg = <0x7000e400 0x400>; 430 reg = <0x7000e400 0x400>;
431 clocks = <&tegra_car 218>, <&clk32k_in>;
432 clock-names = "pclk", "clk32k_in";
428 }; 433 };
429 434
430 memory-controller { 435 memory-controller {
diff --git a/arch/arm/boot/dts/tps6507x.dtsi b/arch/arm/boot/dts/tps6507x.dtsi
new file mode 100644
index 000000000000..4c326e591e5a
--- /dev/null
+++ b/arch/arm/boot/dts/tps6507x.dtsi
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Integrated Power Management Chip
11 * http://www.ti.com/lit/ds/symlink/tps65070.pdf
12 */
13
14&tps {
15 compatible = "ti,tps6507x";
16
17 regulators {
18 #address-cells = <1>;
19 #size-cells = <0>;
20
21 vdcdc1_reg: regulator@0 {
22 reg = <0>;
23 regulator-compatible = "VDCDC1";
24 };
25
26 vdcdc2_reg: regulator@1 {
27 reg = <1>;
28 regulator-compatible = "VDCDC2";
29 };
30
31 vdcdc3_reg: regulator@2 {
32 reg = <2>;
33 regulator-compatible = "VDCDC3";
34 };
35
36 ldo1_reg: regulator@3 {
37 reg = <3>;
38 regulator-compatible = "LDO1";
39 };
40
41 ldo2_reg: regulator@4 {
42 reg = <4>;
43 regulator-compatible = "LDO2";
44 };
45
46 };
47};
diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
index ed0bc9546837..b3034da00a37 100644
--- a/arch/arm/boot/dts/twl4030.dtsi
+++ b/arch/arm/boot/dts/twl4030.dtsi
@@ -23,6 +23,12 @@
23 compatible = "ti,twl4030-wdt"; 23 compatible = "ti,twl4030-wdt";
24 }; 24 };
25 25
26 vcc: regulator-vdd1 {
27 compatible = "ti,twl4030-vdd1";
28 regulator-min-microvolt = <600000>;
29 regulator-max-microvolt = <1450000>;
30 };
31
26 vdac: regulator-vdac { 32 vdac: regulator-vdac {
27 compatible = "ti,twl4030-vdac"; 33 compatible = "ti,twl4030-vdac";
28 regulator-min-microvolt = <1800000>; 34 regulator-min-microvolt = <1800000>;
@@ -67,7 +73,7 @@
67 #interrupt-cells = <1>; 73 #interrupt-cells = <1>;
68 }; 74 };
69 75
70 twl4030-usb { 76 usb2_phy: twl4030-usb {
71 compatible = "ti,twl4030-usb"; 77 compatible = "ti,twl4030-usb";
72 interrupts = <10>, <4>; 78 interrupts = <10>, <4>;
73 usb1v5-supply = <&vusb1v5>; 79 usb1v5-supply = <&vusb1v5>;
@@ -75,4 +81,14 @@
75 usb3v1-supply = <&vusb3v1>; 81 usb3v1-supply = <&vusb3v1>;
76 usb_mode = <1>; 82 usb_mode = <1>;
77 }; 83 };
84
85 twl_pwm: pwm {
86 compatible = "ti,twl4030-pwm";
87 #pwm-cells = <2>;
88 };
89
90 twl_pwmled: pwmled {
91 compatible = "ti,twl4030-pwmled";
92 #pwm-cells = <2>;
93 };
78}; 94};
diff --git a/arch/arm/boot/dts/twl6030.dtsi b/arch/arm/boot/dts/twl6030.dtsi
index 9996cfc5ee80..2e3bd3172b23 100644
--- a/arch/arm/boot/dts/twl6030.dtsi
+++ b/arch/arm/boot/dts/twl6030.dtsi
@@ -91,4 +91,16 @@
91 compatible = "ti,twl6030-usb"; 91 compatible = "ti,twl6030-usb";
92 interrupts = <4>, <10>; 92 interrupts = <4>, <10>;
93 }; 93 };
94
95 twl_pwm: pwm {
96 /* provides two PWMs (id 0, 1 for PWM1 and PWM2) */
97 compatible = "ti,twl6030-pwm";
98 #pwm-cells = <2>;
99 };
100
101 twl_pwmled: pwmled {
102 /* provides one PWM (id 0 for Charging indicator LED) */
103 compatible = "ti,twl6030-pwmled";
104 #pwm-cells = <2>;
105 };
94}; 106};
diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig
index 3fe8dae8d32d..4364eff5b01e 100644
--- a/arch/arm/configs/dove_defconfig
+++ b/arch/arm/configs/dove_defconfig
@@ -75,6 +75,8 @@ CONFIG_I2C_MV64XXX=y
75CONFIG_SPI=y 75CONFIG_SPI=y
76CONFIG_SPI_ORION=y 76CONFIG_SPI_ORION=y
77# CONFIG_HWMON is not set 77# CONFIG_HWMON is not set
78CONFIG_THERMAL=y
79CONFIG_DOVE_THERMAL=y
78CONFIG_USB=y 80CONFIG_USB=y
79CONFIG_USB_EHCI_HCD=y 81CONFIG_USB_EHCI_HCD=y
80CONFIG_USB_EHCI_ROOT_HUB_TT=y 82CONFIG_USB_EHCI_ROOT_HUB_TT=y
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 13482ea58b09..8f0065bb6f39 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -119,6 +119,8 @@ CONFIG_SPI=y
119CONFIG_SPI_ORION=y 119CONFIG_SPI_ORION=y
120CONFIG_GPIO_SYSFS=y 120CONFIG_GPIO_SYSFS=y
121# CONFIG_HWMON is not set 121# CONFIG_HWMON is not set
122CONFIG_THERMAL=y
123CONFIG_KIRKWOOD_THERMAL=y
122CONFIG_WATCHDOG=y 124CONFIG_WATCHDOG=y
123CONFIG_ORION_WATCHDOG=y 125CONFIG_ORION_WATCHDOG=y
124CONFIG_HID_DRAGONRISE=y 126CONFIG_HID_DRAGONRISE=y
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig
index 2ec8119cff73..f3e8ae001ff1 100644
--- a/arch/arm/configs/mvebu_defconfig
+++ b/arch/arm/configs/mvebu_defconfig
@@ -46,9 +46,16 @@ CONFIG_I2C_MV64XXX=y
46CONFIG_MTD=y 46CONFIG_MTD=y
47CONFIG_MTD_CHAR=y 47CONFIG_MTD_CHAR=y
48CONFIG_MTD_M25P80=y 48CONFIG_MTD_M25P80=y
49CONFIG_MTD_CFI=y
50CONFIG_MTD_CFI_INTELEXT=y
51CONFIG_MTD_CFI_AMDSTD=y
52CONFIG_MTD_CFI_STAA=y
53CONFIG_MTD_PHYSMAP_OF=y
49CONFIG_SERIAL_8250_DW=y 54CONFIG_SERIAL_8250_DW=y
50CONFIG_GPIOLIB=y 55CONFIG_GPIOLIB=y
51CONFIG_GPIO_SYSFS=y 56CONFIG_GPIO_SYSFS=y
57CONFIG_THERMAL=y
58CONFIG_ARMADA_THERMAL=y
52CONFIG_USB_SUPPORT=y 59CONFIG_USB_SUPPORT=y
53CONFIG_USB=y 60CONFIG_USB=y
54CONFIG_USB_EHCI_HCD=y 61CONFIG_USB_EHCI_HCD=y
@@ -65,6 +72,8 @@ CONFIG_RTC_DRV_S35390A=y
65CONFIG_RTC_DRV_MV=y 72CONFIG_RTC_DRV_MV=y
66CONFIG_DMADEVICES=y 73CONFIG_DMADEVICES=y
67CONFIG_MV_XOR=y 74CONFIG_MV_XOR=y
75CONFIG_MEMORY=y
76CONFIG_MVEBU_DEVBUS=y
68# CONFIG_IOMMU_SUPPORT is not set 77# CONFIG_IOMMU_SUPPORT is not set
69CONFIG_EXT2_FS=y 78CONFIG_EXT2_FS=y
70CONFIG_EXT3_FS=y 79CONFIG_EXT3_FS=y
diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index 0f01f4677bd2..7b2899c2f7fc 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -34,12 +34,4 @@ struct twd_local_timer name __initdata = { \
34 34
35int twd_local_timer_register(struct twd_local_timer *); 35int twd_local_timer_register(struct twd_local_timer *);
36 36
37#ifdef CONFIG_HAVE_ARM_TWD
38void twd_local_timer_of_register(void);
39#else
40static inline void twd_local_timer_of_register(void)
41{
42}
43#endif
44
45#endif 37#endif
diff --git a/arch/arm/include/debug/mvebu.S b/arch/arm/include/debug/mvebu.S
index 865c6d02b332..df191afa3be1 100644
--- a/arch/arm/include/debug/mvebu.S
+++ b/arch/arm/include/debug/mvebu.S
@@ -12,7 +12,7 @@
12*/ 12*/
13 13
14#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000 14#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000
15#define ARMADA_370_XP_REGS_VIRT_BASE 0xfeb00000 15#define ARMADA_370_XP_REGS_VIRT_BASE 0xfec00000
16 16
17 .macro addruart, rp, rv, tmp 17 .macro addruart, rp, rv, tmp
18 ldr \rp, =ARMADA_370_XP_REGS_PHYS_BASE 18 ldr \rp, =ARMADA_370_XP_REGS_PHYS_BASE
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 3f2565037480..90525d9d290b 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -362,25 +362,13 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt)
362} 362}
363 363
364#ifdef CONFIG_OF 364#ifdef CONFIG_OF
365const static struct of_device_id twd_of_match[] __initconst = { 365static void __init twd_local_timer_of_register(struct device_node *np)
366 { .compatible = "arm,cortex-a9-twd-timer", },
367 { .compatible = "arm,cortex-a5-twd-timer", },
368 { .compatible = "arm,arm11mp-twd-timer", },
369 { },
370};
371
372void __init twd_local_timer_of_register(void)
373{ 366{
374 struct device_node *np;
375 int err; 367 int err;
376 368
377 if (!is_smp() || !setup_max_cpus) 369 if (!is_smp() || !setup_max_cpus)
378 return; 370 return;
379 371
380 np = of_find_matching_node(NULL, twd_of_match);
381 if (!np)
382 return;
383
384 twd_ppi = irq_of_parse_and_map(np, 0); 372 twd_ppi = irq_of_parse_and_map(np, 0);
385 if (!twd_ppi) { 373 if (!twd_ppi) {
386 err = -EINVAL; 374 err = -EINVAL;
@@ -398,4 +386,7 @@ void __init twd_local_timer_of_register(void)
398out: 386out:
399 WARN(err, "twd_local_timer_of_register failed (%d)\n", err); 387 WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
400} 388}
389CLOCKSOURCE_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
390CLOCKSOURCE_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
391CLOCKSOURCE_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register);
401#endif 392#endif
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 6da25eebf911..12e6f756361d 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -246,7 +246,6 @@ static struct davinci_mmc_config da830_evm_mmc_config = {
246 .wires = 8, 246 .wires = 8,
247 .max_freq = 50000000, 247 .max_freq = 50000000,
248 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 248 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
249 .version = MMC_CTLR_VERSION_2,
250}; 249};
251 250
252static inline void da830_evm_init_mmc(void) 251static inline void da830_evm_init_mmc(void)
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index c2dfe06563df..dcc8710936a5 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -802,7 +802,6 @@ static struct davinci_mmc_config da850_mmc_config = {
802 .wires = 4, 802 .wires = 4,
803 .max_freq = 50000000, 803 .max_freq = 50000000,
804 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 804 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
805 .version = MMC_CTLR_VERSION_2,
806}; 805};
807 806
808static const short da850_evm_mmcsd0_pins[] __initconst = { 807static const short da850_evm_mmcsd0_pins[] __initconst = {
@@ -1372,7 +1371,6 @@ static struct davinci_mmc_config da850_wl12xx_mmc_config = {
1372 .max_freq = 25000000, 1371 .max_freq = 25000000,
1373 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE | 1372 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
1374 MMC_CAP_POWER_OFF_CARD, 1373 MMC_CAP_POWER_OFF_CARD,
1375 .version = MMC_CTLR_VERSION_2,
1376}; 1374};
1377 1375
1378static const short da850_wl12xx_pins[] __initconst = { 1376static const short da850_wl12xx_pins[] __initconst = {
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 147b8e1a4407..bfdf8b979a64 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -280,7 +280,6 @@ static struct davinci_mmc_config dm355evm_mmc_config = {
280 .wires = 4, 280 .wires = 4,
281 .max_freq = 50000000, 281 .max_freq = 50000000,
282 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 282 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
283 .version = MMC_CTLR_VERSION_1,
284}; 283};
285 284
286/* Don't connect anything to J10 unless you're only using USB host 285/* Don't connect anything to J10 unless you're only using USB host
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index c2d4958a0cb6..4cfdd9109e19 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -253,7 +253,6 @@ static struct davinci_mmc_config dm365evm_mmc_config = {
253 .wires = 4, 253 .wires = 4,
254 .max_freq = 50000000, 254 .max_freq = 50000000,
255 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 255 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
256 .version = MMC_CTLR_VERSION_2,
257}; 256};
258 257
259static void dm365evm_emac_configure(void) 258static void dm365evm_emac_configure(void)
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 71735e7797cc..c0206d5f2bf6 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -570,7 +570,6 @@ static struct davinci_mmc_config dm6446evm_mmc_config = {
570 .get_cd = dm6444evm_mmc_get_cd, 570 .get_cd = dm6444evm_mmc_get_cd,
571 .get_ro = dm6444evm_mmc_get_ro, 571 .get_ro = dm6444evm_mmc_get_ro,
572 .wires = 4, 572 .wires = 4,
573 .version = MMC_CTLR_VERSION_1
574}; 573};
575 574
576static struct i2c_board_info __initdata i2c_info[] = { 575static struct i2c_board_info __initdata i2c_info[] = {
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 1c98107527fa..b70e83c03bed 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -164,7 +164,6 @@ static void __init davinci_ntosd2_map_io(void)
164 164
165static struct davinci_mmc_config davinci_ntosd2_mmc_config = { 165static struct davinci_mmc_config davinci_ntosd2_mmc_config = {
166 .wires = 4, 166 .wires = 4,
167 .version = MMC_CTLR_VERSION_1
168}; 167};
169 168
170 169
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index 5a2bd44da54d..328dbd8a37f5 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -136,7 +136,6 @@ static struct davinci_mmc_config da850_mmc_config = {
136 .wires = 4, 136 .wires = 4,
137 .max_freq = 50000000, 137 .max_freq = 50000000,
138 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 138 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
139 .version = MMC_CTLR_VERSION_2,
140}; 139};
141 140
142static __init void omapl138_hawk_mmc_init(void) 141static __init void omapl138_hawk_mmc_init(void)
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index 4f416023d4e2..ba798370fc96 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -85,7 +85,6 @@ static struct davinci_mmc_config mmc_config = {
85 .wires = 4, 85 .wires = 4,
86 .max_freq = 50000000, 86 .max_freq = 50000000,
87 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, 87 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
88 .version = MMC_CTLR_VERSION_1,
89}; 88};
90 89
91static const short sdio1_pins[] __initconst = { 90static const short sdio1_pins[] __initconst = {
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index d458558ee84a..dc9a470ff9c5 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -35,19 +35,26 @@ static void __clk_enable(struct clk *clk)
35{ 35{
36 if (clk->parent) 36 if (clk->parent)
37 __clk_enable(clk->parent); 37 __clk_enable(clk->parent);
38 if (clk->usecount++ == 0 && (clk->flags & CLK_PSC)) 38 if (clk->usecount++ == 0) {
39 davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, 39 if (clk->flags & CLK_PSC)
40 true, clk->flags); 40 davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
41 true, clk->flags);
42 else if (clk->clk_enable)
43 clk->clk_enable(clk);
44 }
41} 45}
42 46
43static void __clk_disable(struct clk *clk) 47static void __clk_disable(struct clk *clk)
44{ 48{
45 if (WARN_ON(clk->usecount == 0)) 49 if (WARN_ON(clk->usecount == 0))
46 return; 50 return;
47 if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) && 51 if (--clk->usecount == 0) {
48 (clk->flags & CLK_PSC)) 52 if (!(clk->flags & CLK_PLL) && (clk->flags & CLK_PSC))
49 davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, 53 davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
50 false, clk->flags); 54 false, clk->flags);
55 else if (clk->clk_disable)
56 clk->clk_disable(clk);
57 }
51 if (clk->parent) 58 if (clk->parent)
52 __clk_disable(clk->parent); 59 __clk_disable(clk->parent);
53} 60}
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 8694b395fc92..1e4e836173a1 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -104,6 +104,8 @@ struct clk {
104 int (*set_rate) (struct clk *clk, unsigned long rate); 104 int (*set_rate) (struct clk *clk, unsigned long rate);
105 int (*round_rate) (struct clk *clk, unsigned long rate); 105 int (*round_rate) (struct clk *clk, unsigned long rate);
106 int (*reset) (struct clk *clk, bool reset); 106 int (*reset) (struct clk *clk, bool reset);
107 void (*clk_enable) (struct clk *clk);
108 void (*clk_disable) (struct clk *clk);
107}; 109};
108 110
109/* Clock flags: SoC-specific flags start at BIT(16) */ 111/* Clock flags: SoC-specific flags start at BIT(16) */
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 678a54a64dae..abbaf0270be6 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -394,7 +394,7 @@ static struct clk_lookup da830_clks[] = {
394 CLK(NULL, "tpcc", &tpcc_clk), 394 CLK(NULL, "tpcc", &tpcc_clk),
395 CLK(NULL, "tptc0", &tptc0_clk), 395 CLK(NULL, "tptc0", &tptc0_clk),
396 CLK(NULL, "tptc1", &tptc1_clk), 396 CLK(NULL, "tptc1", &tptc1_clk),
397 CLK("davinci_mmc.0", NULL, &mmcsd_clk), 397 CLK("da830-mmc.0", NULL, &mmcsd_clk),
398 CLK(NULL, "uart0", &uart0_clk), 398 CLK(NULL, "uart0", &uart0_clk),
399 CLK(NULL, "uart1", &uart1_clk), 399 CLK(NULL, "uart1", &uart1_clk),
400 CLK(NULL, "uart2", &uart2_clk), 400 CLK(NULL, "uart2", &uart2_clk),
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 0c4a26ddebba..4d6933848abf 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -383,6 +383,49 @@ static struct clk dsp_clk = {
383 .flags = PSC_LRST | PSC_FORCE, 383 .flags = PSC_LRST | PSC_FORCE,
384}; 384};
385 385
386static struct clk ehrpwm_clk = {
387 .name = "ehrpwm",
388 .parent = &pll0_sysclk2,
389 .lpsc = DA8XX_LPSC1_PWM,
390 .gpsc = 1,
391 .flags = DA850_CLK_ASYNC3,
392};
393
394#define DA8XX_EHRPWM_TBCLKSYNC BIT(12)
395
396static void ehrpwm_tblck_enable(struct clk *clk)
397{
398 u32 val;
399
400 val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
401 val |= DA8XX_EHRPWM_TBCLKSYNC;
402 writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
403}
404
405static void ehrpwm_tblck_disable(struct clk *clk)
406{
407 u32 val;
408
409 val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
410 val &= ~DA8XX_EHRPWM_TBCLKSYNC;
411 writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
412}
413
414static struct clk ehrpwm_tbclk = {
415 .name = "ehrpwm_tbclk",
416 .parent = &ehrpwm_clk,
417 .clk_enable = ehrpwm_tblck_enable,
418 .clk_disable = ehrpwm_tblck_disable,
419};
420
421static struct clk ecap_clk = {
422 .name = "ecap",
423 .parent = &pll0_sysclk2,
424 .lpsc = DA8XX_LPSC1_ECAP,
425 .gpsc = 1,
426 .flags = DA850_CLK_ASYNC3,
427};
428
386static struct clk_lookup da850_clks[] = { 429static struct clk_lookup da850_clks[] = {
387 CLK(NULL, "ref", &ref_clk), 430 CLK(NULL, "ref", &ref_clk),
388 CLK(NULL, "pll0", &pll0_clk), 431 CLK(NULL, "pll0", &pll0_clk),
@@ -420,8 +463,8 @@ static struct clk_lookup da850_clks[] = {
420 CLK("davinci_emac.1", NULL, &emac_clk), 463 CLK("davinci_emac.1", NULL, &emac_clk),
421 CLK("davinci-mcasp.0", NULL, &mcasp_clk), 464 CLK("davinci-mcasp.0", NULL, &mcasp_clk),
422 CLK("da8xx_lcdc.0", "fck", &lcdc_clk), 465 CLK("da8xx_lcdc.0", "fck", &lcdc_clk),
423 CLK("davinci_mmc.0", NULL, &mmcsd0_clk), 466 CLK("da830-mmc.0", NULL, &mmcsd0_clk),
424 CLK("davinci_mmc.1", NULL, &mmcsd1_clk), 467 CLK("da830-mmc.1", NULL, &mmcsd1_clk),
425 CLK(NULL, "aemif", &aemif_clk), 468 CLK(NULL, "aemif", &aemif_clk),
426 CLK(NULL, "usb11", &usb11_clk), 469 CLK(NULL, "usb11", &usb11_clk),
427 CLK(NULL, "usb20", &usb20_clk), 470 CLK(NULL, "usb20", &usb20_clk),
@@ -430,6 +473,9 @@ static struct clk_lookup da850_clks[] = {
430 CLK("vpif", NULL, &vpif_clk), 473 CLK("vpif", NULL, &vpif_clk),
431 CLK("ahci", NULL, &sata_clk), 474 CLK("ahci", NULL, &sata_clk),
432 CLK("davinci-rproc.0", NULL, &dsp_clk), 475 CLK("davinci-rproc.0", NULL, &dsp_clk),
476 CLK("ehrpwm", "fck", &ehrpwm_clk),
477 CLK("ehrpwm", "tbclk", &ehrpwm_tbclk),
478 CLK("ecap", "fck", &ecap_clk),
433 CLK(NULL, NULL, NULL), 479 CLK(NULL, NULL, NULL),
434}; 480};
435 481
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 6b7a0a27fbd1..fb8d8607f445 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -40,6 +40,13 @@ static void __init da8xx_init_irq(void)
40struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { 40struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
41 OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL), 41 OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
42 OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL), 42 OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
43 OF_DEV_AUXDATA("ti,da830-mmc", 0x01c40000, "da830-mmc.0", NULL),
44 OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL),
45 OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL),
46 OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap", NULL),
47 OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
48 OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),
49 OF_DEV_AUXDATA("ti,da830-spi", 0x01f0e000, "spi_davinci.1", NULL),
43 {} 50 {}
44}; 51};
45 52
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index fc50243b1481..cb97e07db284 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -664,7 +664,7 @@ static struct resource da8xx_mmcsd0_resources[] = {
664}; 664};
665 665
666static struct platform_device da8xx_mmcsd0_device = { 666static struct platform_device da8xx_mmcsd0_device = {
667 .name = "davinci_mmc", 667 .name = "da830-mmc",
668 .id = 0, 668 .id = 0,
669 .num_resources = ARRAY_SIZE(da8xx_mmcsd0_resources), 669 .num_resources = ARRAY_SIZE(da8xx_mmcsd0_resources),
670 .resource = da8xx_mmcsd0_resources, 670 .resource = da8xx_mmcsd0_resources,
@@ -701,7 +701,7 @@ static struct resource da850_mmcsd1_resources[] = {
701}; 701};
702 702
703static struct platform_device da850_mmcsd1_device = { 703static struct platform_device da850_mmcsd1_device = {
704 .name = "davinci_mmc", 704 .name = "da830-mmc",
705 .id = 1, 705 .id = 1,
706 .num_resources = ARRAY_SIZE(da850_mmcsd1_resources), 706 .num_resources = ARRAY_SIZE(da850_mmcsd1_resources),
707 .resource = da850_mmcsd1_resources, 707 .resource = da850_mmcsd1_resources,
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c
index 773ab07a71a0..cfb194df18ed 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -218,7 +218,7 @@ static u64 mmc1_dma_mask = DMA_BIT_MASK(32);
218 218
219static struct platform_device mmc_devices[2] = { 219static struct platform_device mmc_devices[2] = {
220 { 220 {
221 .name = "davinci_mmc", 221 .name = "dm6441-mmc",
222 .id = 0, 222 .id = 0,
223 .dev = { 223 .dev = {
224 .dma_mask = &mmc0_dma_mask, 224 .dma_mask = &mmc0_dma_mask,
@@ -228,7 +228,7 @@ static struct platform_device mmc_devices[2] = {
228 .resource = mmc0_resources 228 .resource = mmc0_resources
229 }, 229 },
230 { 230 {
231 .name = "davinci_mmc", 231 .name = "dm6441-mmc",
232 .id = 1, 232 .id = 1,
233 .dev = { 233 .dev = {
234 .dma_mask = &mmc1_dma_mask, 234 .dma_mask = &mmc1_dma_mask,
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 4c48a36ee567..f6927df2dda8 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -150,7 +150,7 @@ static struct resource mmcsd0_resources[] = {
150}; 150};
151 151
152static struct platform_device davinci_mmcsd0_device = { 152static struct platform_device davinci_mmcsd0_device = {
153 .name = "davinci_mmc", 153 .name = "dm6441-mmc",
154 .id = 0, 154 .id = 0,
155 .dev = { 155 .dev = {
156 .dma_mask = &mmcsd0_dma_mask, 156 .dma_mask = &mmcsd0_dma_mask,
@@ -187,7 +187,7 @@ static struct resource mmcsd1_resources[] = {
187}; 187};
188 188
189static struct platform_device davinci_mmcsd1_device = { 189static struct platform_device davinci_mmcsd1_device = {
190 .name = "davinci_mmc", 190 .name = "dm6441-mmc",
191 .id = 1, 191 .id = 1,
192 .dev = { 192 .dev = {
193 .dma_mask = &mmcsd1_dma_mask, 193 .dma_mask = &mmcsd1_dma_mask,
@@ -235,6 +235,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
235 mmcsd1_resources[0].end = DM365_MMCSD1_BASE + 235 mmcsd1_resources[0].end = DM365_MMCSD1_BASE +
236 SZ_4K - 1; 236 SZ_4K - 1;
237 mmcsd1_resources[2].start = IRQ_DM365_SDIOINT1; 237 mmcsd1_resources[2].start = IRQ_DM365_SDIOINT1;
238 davinci_mmcsd1_device.name = "da830-mmc";
238 } else 239 } else
239 break; 240 break;
240 241
@@ -256,6 +257,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
256 mmcsd0_resources[0].end = DM365_MMCSD0_BASE + 257 mmcsd0_resources[0].end = DM365_MMCSD0_BASE +
257 SZ_4K - 1; 258 SZ_4K - 1;
258 mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0; 259 mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0;
260 davinci_mmcsd0_device.name = "da830-mmc";
259 } else if (cpu_is_davinci_dm644x()) { 261 } else if (cpu_is_davinci_dm644x()) {
260 /* REVISIT: should this be in board-init code? */ 262 /* REVISIT: should this be in board-init code? */
261 /* Power-on 3.3V IO cells */ 263 /* Power-on 3.3V IO cells */
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index b49c3b77d55e..87e6104f45e6 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -361,8 +361,8 @@ static struct clk_lookup dm355_clks[] = {
361 CLK("i2c_davinci.1", NULL, &i2c_clk), 361 CLK("i2c_davinci.1", NULL, &i2c_clk),
362 CLK("davinci-mcbsp.0", NULL, &asp0_clk), 362 CLK("davinci-mcbsp.0", NULL, &asp0_clk),
363 CLK("davinci-mcbsp.1", NULL, &asp1_clk), 363 CLK("davinci-mcbsp.1", NULL, &asp1_clk),
364 CLK("davinci_mmc.0", NULL, &mmcsd0_clk), 364 CLK("dm6441-mmc.0", NULL, &mmcsd0_clk),
365 CLK("davinci_mmc.1", NULL, &mmcsd1_clk), 365 CLK("dm6441-mmc.1", NULL, &mmcsd1_clk),
366 CLK("spi_davinci.0", NULL, &spi0_clk), 366 CLK("spi_davinci.0", NULL, &spi0_clk),
367 CLK("spi_davinci.1", NULL, &spi1_clk), 367 CLK("spi_davinci.1", NULL, &spi1_clk),
368 CLK("spi_davinci.2", NULL, &spi2_clk), 368 CLK("spi_davinci.2", NULL, &spi2_clk),
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 6c3980540be0..2791df9187b3 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -454,8 +454,8 @@ static struct clk_lookup dm365_clks[] = {
454 CLK(NULL, "uart0", &uart0_clk), 454 CLK(NULL, "uart0", &uart0_clk),
455 CLK(NULL, "uart1", &uart1_clk), 455 CLK(NULL, "uart1", &uart1_clk),
456 CLK("i2c_davinci.1", NULL, &i2c_clk), 456 CLK("i2c_davinci.1", NULL, &i2c_clk),
457 CLK("davinci_mmc.0", NULL, &mmcsd0_clk), 457 CLK("da830-mmc.0", NULL, &mmcsd0_clk),
458 CLK("davinci_mmc.1", NULL, &mmcsd1_clk), 458 CLK("da830-mmc.1", NULL, &mmcsd1_clk),
459 CLK("spi_davinci.0", NULL, &spi0_clk), 459 CLK("spi_davinci.0", NULL, &spi0_clk),
460 CLK("spi_davinci.1", NULL, &spi1_clk), 460 CLK("spi_davinci.1", NULL, &spi1_clk),
461 CLK("spi_davinci.2", NULL, &spi2_clk), 461 CLK("spi_davinci.2", NULL, &spi2_clk),
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index db1dd92e00af..ab6bf54c65c7 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -310,7 +310,7 @@ static struct clk_lookup dm644x_clks[] = {
310 CLK("i2c_davinci.1", NULL, &i2c_clk), 310 CLK("i2c_davinci.1", NULL, &i2c_clk),
311 CLK("palm_bk3710", NULL, &ide_clk), 311 CLK("palm_bk3710", NULL, &ide_clk),
312 CLK("davinci-mcbsp", NULL, &asp_clk), 312 CLK("davinci-mcbsp", NULL, &asp_clk),
313 CLK("davinci_mmc.0", NULL, &mmcsd_clk), 313 CLK("dm6441-mmc.0", NULL, &mmcsd_clk),
314 CLK(NULL, "spi", &spi_clk), 314 CLK(NULL, "spi", &spi_clk),
315 CLK(NULL, "gpio", &gpio_clk), 315 CLK(NULL, "gpio", &gpio_clk),
316 CLK(NULL, "usb", &usb_clk), 316 CLK(NULL, "usb", &usb_clk),
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index de439b7b9af1..be77ce269cb0 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -55,6 +55,7 @@ extern unsigned int da850_max_speed;
55#define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x)) 55#define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x))
56#define DA8XX_JTAG_ID_REG 0x18 56#define DA8XX_JTAG_ID_REG 0x18
57#define DA8XX_CFGCHIP0_REG 0x17c 57#define DA8XX_CFGCHIP0_REG 0x17c
58#define DA8XX_CFGCHIP1_REG 0x180
58#define DA8XX_CFGCHIP2_REG 0x184 59#define DA8XX_CFGCHIP2_REG 0x184
59#define DA8XX_CFGCHIP3_REG 0x188 60#define DA8XX_CFGCHIP3_REG 0x188
60 61
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S
index 34290d14754b..b18b8ebc6508 100644
--- a/arch/arm/mach-davinci/include/mach/debug-macro.S
+++ b/arch/arm/mach-davinci/include/mach/debug-macro.S
@@ -24,8 +24,6 @@
24 24
25#if defined(CONFIG_DEBUG_DAVINCI_DMx_UART0) 25#if defined(CONFIG_DEBUG_DAVINCI_DMx_UART0)
26#define UART_BASE DAVINCI_UART0_BASE 26#define UART_BASE DAVINCI_UART0_BASE
27#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART0)
28#define UART_BASE DA8XX_UART0_BASE
29#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART1) 27#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART1)
30#define UART_BASE DA8XX_UART1_BASE 28#define UART_BASE DA8XX_UART1_BASE
31#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART2) 29#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART2)
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c
index dc1a209b9b66..3b2a70d43efa 100644
--- a/arch/arm/mach-davinci/tnetv107x.c
+++ b/arch/arm/mach-davinci/tnetv107x.c
@@ -272,7 +272,7 @@ static struct clk_lookup clks[] = {
272 CLK("tnetv107x-keypad.0", NULL, &clk_keypad), 272 CLK("tnetv107x-keypad.0", NULL, &clk_keypad),
273 CLK(NULL, "clk_gpio", &clk_gpio), 273 CLK(NULL, "clk_gpio", &clk_gpio),
274 CLK(NULL, "clk_mdio", &clk_mdio), 274 CLK(NULL, "clk_mdio", &clk_mdio),
275 CLK("davinci_mmc.0", NULL, &clk_sdio0), 275 CLK("dm6441-mmc.0", NULL, &clk_sdio0),
276 CLK(NULL, "uart0", &clk_uart0), 276 CLK(NULL, "uart0", &clk_uart0),
277 CLK(NULL, "uart1", &clk_uart1), 277 CLK(NULL, "uart1", &clk_uart1),
278 CLK(NULL, "timer0", &clk_timer0), 278 CLK(NULL, "timer0", &clk_timer0),
@@ -292,7 +292,7 @@ static struct clk_lookup clks[] = {
292 CLK(NULL, "clk_system", &clk_system), 292 CLK(NULL, "clk_system", &clk_system),
293 CLK(NULL, "clk_imcop", &clk_imcop), 293 CLK(NULL, "clk_imcop", &clk_imcop),
294 CLK(NULL, "clk_spare", &clk_spare), 294 CLK(NULL, "clk_spare", &clk_spare),
295 CLK("davinci_mmc.1", NULL, &clk_sdio1), 295 CLK("dm6441-mmc.1", NULL, &clk_sdio1),
296 CLK(NULL, "clk_ddr2_vrst", &clk_ddr2_vrst), 296 CLK(NULL, "clk_ddr2_vrst", &clk_ddr2_vrst),
297 CLK(NULL, "clk_ddr2_vctl_rst", &clk_ddr2_vctl_rst), 297 CLK(NULL, "clk_ddr2_vctl_rst", &clk_ddr2_vctl_rst),
298 CLK(NULL, NULL, NULL), 298 CLK(NULL, NULL, NULL),
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
index 3f0a858fb597..4d9d2ffc4535 100644
--- a/arch/arm/mach-dove/Makefile
+++ b/arch/arm/mach-dove/Makefile
@@ -1,4 +1,4 @@
1obj-y += common.o addr-map.o irq.o 1obj-y += common.o irq.o
2obj-$(CONFIG_DOVE_LEGACY) += mpp.o 2obj-$(CONFIG_DOVE_LEGACY) += mpp.o
3obj-$(CONFIG_PCI) += pcie.o 3obj-$(CONFIG_PCI) += pcie.o
4obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o 4obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o
diff --git a/arch/arm/mach-dove/addr-map.c b/arch/arm/mach-dove/addr-map.c
deleted file mode 100644
index 2a06c0163418..000000000000
--- a/arch/arm/mach-dove/addr-map.c
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * arch/arm/mach-dove/addr-map.c
3 *
4 * Address map functions for Marvell Dove 88AP510 SoC
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mbus.h>
14#include <linux/io.h>
15#include <asm/mach/arch.h>
16#include <asm/setup.h>
17#include <mach/dove.h>
18#include <plat/addr-map.h>
19#include "common.h"
20
21/*
22 * Generic Address Decode Windows bit settings
23 */
24#define TARGET_DDR 0x0
25#define TARGET_BOOTROM 0x1
26#define TARGET_CESA 0x3
27#define TARGET_PCIE0 0x4
28#define TARGET_PCIE1 0x8
29#define TARGET_SCRATCHPAD 0xd
30
31#define ATTR_CESA 0x01
32#define ATTR_BOOTROM 0xfd
33#define ATTR_DEV_SPI0_ROM 0xfe
34#define ATTR_DEV_SPI1_ROM 0xfb
35#define ATTR_PCIE_IO 0xe0
36#define ATTR_PCIE_MEM 0xe8
37#define ATTR_SCRATCHPAD 0x0
38
39static inline void __iomem *ddr_map_sc(int i)
40{
41 return (void __iomem *)(DOVE_MC_VIRT_BASE + 0x100 + ((i) << 4));
42}
43
44/*
45 * Description of the windows needed by the platform code
46 */
47static struct __initdata orion_addr_map_cfg addr_map_cfg = {
48 .num_wins = 8,
49 .remappable_wins = 4,
50 .bridge_virt_base = BRIDGE_VIRT_BASE,
51};
52
53static const struct __initdata orion_addr_map_info addr_map_info[] = {
54 /*
55 * Windows for PCIe IO+MEM space.
56 */
57 { 0, DOVE_PCIE0_IO_PHYS_BASE, DOVE_PCIE0_IO_SIZE,
58 TARGET_PCIE0, ATTR_PCIE_IO, DOVE_PCIE0_IO_BUS_BASE
59 },
60 { 1, DOVE_PCIE1_IO_PHYS_BASE, DOVE_PCIE1_IO_SIZE,
61 TARGET_PCIE1, ATTR_PCIE_IO, DOVE_PCIE1_IO_BUS_BASE
62 },
63 { 2, DOVE_PCIE0_MEM_PHYS_BASE, DOVE_PCIE0_MEM_SIZE,
64 TARGET_PCIE0, ATTR_PCIE_MEM, -1
65 },
66 { 3, DOVE_PCIE1_MEM_PHYS_BASE, DOVE_PCIE1_MEM_SIZE,
67 TARGET_PCIE1, ATTR_PCIE_MEM, -1
68 },
69 /*
70 * Window for CESA engine.
71 */
72 { 4, DOVE_CESA_PHYS_BASE, DOVE_CESA_SIZE,
73 TARGET_CESA, ATTR_CESA, -1
74 },
75 /*
76 * Window to the BootROM for Standby and Sleep Resume
77 */
78 { 5, DOVE_BOOTROM_PHYS_BASE, DOVE_BOOTROM_SIZE,
79 TARGET_BOOTROM, ATTR_BOOTROM, -1
80 },
81 /*
82 * Window to the PMU Scratch Pad space
83 */
84 { 6, DOVE_SCRATCHPAD_PHYS_BASE, DOVE_SCRATCHPAD_SIZE,
85 TARGET_SCRATCHPAD, ATTR_SCRATCHPAD, -1
86 },
87 /* End marker */
88 { -1, 0, 0, 0, 0, 0 }
89};
90
91void __init dove_setup_cpu_mbus(void)
92{
93 int i;
94 int cs;
95
96 /*
97 * Disable, clear and configure windows.
98 */
99 orion_config_wins(&addr_map_cfg, addr_map_info);
100
101 /*
102 * Setup MBUS dram target info.
103 */
104 orion_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
105
106 for (i = 0, cs = 0; i < 2; i++) {
107 u32 map = readl(ddr_map_sc(i));
108
109 /*
110 * Chip select enabled?
111 */
112 if (map & 1) {
113 struct mbus_dram_window *w;
114
115 w = &orion_mbus_dram_info.cs[cs++];
116 w->cs_index = i;
117 w->mbus_attr = 0; /* CS address decoding done inside */
118 /* the DDR controller, no need to */
119 /* provide attributes */
120 w->base = map & 0xff800000;
121 w->size = 0x100000 << (((map & 0x000f0000) >> 16) - 4);
122 }
123 }
124 orion_mbus_dram_info.num_cs = cs;
125}
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
index fbde1dd67113..0b142803b2e1 100644
--- a/arch/arm/mach-dove/board-dt.c
+++ b/arch/arm/mach-dove/board-dt.c
@@ -64,7 +64,7 @@ static void __init dove_dt_init(void)
64#ifdef CONFIG_CACHE_TAUROS2 64#ifdef CONFIG_CACHE_TAUROS2
65 tauros2_init(0); 65 tauros2_init(0);
66#endif 66#endif
67 dove_setup_cpu_mbus(); 67 dove_setup_cpu_wins();
68 68
69 /* Setup root of clk tree */ 69 /* Setup root of clk tree */
70 dove_of_clk_init(); 70 dove_of_clk_init();
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index c6b3b2bb50e7..e2b5da031f96 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -224,6 +224,9 @@ void __init dove_i2c_init(void)
224void __init dove_init_early(void) 224void __init dove_init_early(void)
225{ 225{
226 orion_time_set_base(TIMER_VIRT_BASE); 226 orion_time_set_base(TIMER_VIRT_BASE);
227 mvebu_mbus_init("marvell,dove-mbus",
228 BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
229 DOVE_MC_WINS_BASE, DOVE_MC_WINS_SZ);
227} 230}
228 231
229static int __init dove_find_tclk(void) 232static int __init dove_find_tclk(void)
@@ -326,6 +329,40 @@ void __init dove_sdio1_init(void)
326 platform_device_register(&dove_sdio1); 329 platform_device_register(&dove_sdio1);
327} 330}
328 331
332void __init dove_setup_cpu_wins(void)
333{
334 /*
335 * The PCIe windows will no longer be statically allocated
336 * here once Dove is migrated to the pci-mvebu driver.
337 */
338 mvebu_mbus_add_window_remap_flags("pcie0.0",
339 DOVE_PCIE0_IO_PHYS_BASE,
340 DOVE_PCIE0_IO_SIZE,
341 DOVE_PCIE0_IO_BUS_BASE,
342 MVEBU_MBUS_PCI_IO);
343 mvebu_mbus_add_window_remap_flags("pcie1.0",
344 DOVE_PCIE1_IO_PHYS_BASE,
345 DOVE_PCIE1_IO_SIZE,
346 DOVE_PCIE1_IO_BUS_BASE,
347 MVEBU_MBUS_PCI_IO);
348 mvebu_mbus_add_window_remap_flags("pcie0.0",
349 DOVE_PCIE0_MEM_PHYS_BASE,
350 DOVE_PCIE0_MEM_SIZE,
351 MVEBU_MBUS_NO_REMAP,
352 MVEBU_MBUS_PCI_MEM);
353 mvebu_mbus_add_window_remap_flags("pcie1.0",
354 DOVE_PCIE1_MEM_PHYS_BASE,
355 DOVE_PCIE1_MEM_SIZE,
356 MVEBU_MBUS_NO_REMAP,
357 MVEBU_MBUS_PCI_MEM);
358 mvebu_mbus_add_window("cesa", DOVE_CESA_PHYS_BASE,
359 DOVE_CESA_SIZE);
360 mvebu_mbus_add_window("bootrom", DOVE_BOOTROM_PHYS_BASE,
361 DOVE_BOOTROM_SIZE);
362 mvebu_mbus_add_window("scratchpad", DOVE_SCRATCHPAD_PHYS_BASE,
363 DOVE_SCRATCHPAD_SIZE);
364}
365
329void __init dove_init(void) 366void __init dove_init(void)
330{ 367{
331 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n", 368 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
@@ -334,7 +371,7 @@ void __init dove_init(void)
334#ifdef CONFIG_CACHE_TAUROS2 371#ifdef CONFIG_CACHE_TAUROS2
335 tauros2_init(0); 372 tauros2_init(0);
336#endif 373#endif
337 dove_setup_cpu_mbus(); 374 dove_setup_cpu_wins();
338 375
339 /* Setup root of clk tree */ 376 /* Setup root of clk tree */
340 dove_clk_init(); 377 dove_clk_init();
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
index ee59fba4c6d1..e86347928b67 100644
--- a/arch/arm/mach-dove/common.h
+++ b/arch/arm/mach-dove/common.h
@@ -23,7 +23,7 @@ void dove_map_io(void);
23void dove_init(void); 23void dove_init(void);
24void dove_init_early(void); 24void dove_init_early(void);
25void dove_init_irq(void); 25void dove_init_irq(void);
26void dove_setup_cpu_mbus(void); 26void dove_setup_cpu_wins(void);
27void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data); 27void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data);
28void dove_sata_init(struct mv_sata_platform_data *sata_data); 28void dove_sata_init(struct mv_sata_platform_data *sata_data);
29#ifdef CONFIG_PCI 29#ifdef CONFIG_PCI
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
index 661725e3115a..0c4b35f4ee5b 100644
--- a/arch/arm/mach-dove/include/mach/dove.h
+++ b/arch/arm/mach-dove/include/mach/dove.h
@@ -77,6 +77,8 @@
77/* North-South Bridge */ 77/* North-South Bridge */
78#define BRIDGE_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x20000) 78#define BRIDGE_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0x20000)
79#define BRIDGE_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x20000) 79#define BRIDGE_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x20000)
80#define BRIDGE_WINS_BASE (BRIDGE_PHYS_BASE)
81#define BRIDGE_WINS_SZ (0x80)
80 82
81/* Cryptographic Engine */ 83/* Cryptographic Engine */
82#define DOVE_CRYPT_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x30000) 84#define DOVE_CRYPT_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0x30000)
@@ -168,6 +170,9 @@
168#define DOVE_SSP_CLOCK_ENABLE (1 << 1) 170#define DOVE_SSP_CLOCK_ENABLE (1 << 1)
169#define DOVE_SSP_BPB_CLOCK_SRC_SSP (1 << 11) 171#define DOVE_SSP_BPB_CLOCK_SRC_SSP (1 << 11)
170/* Memory Controller */ 172/* Memory Controller */
173#define DOVE_MC_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE + 0x00000)
174#define DOVE_MC_WINS_BASE (DOVE_MC_PHYS_BASE + 0x100)
175#define DOVE_MC_WINS_SZ (0x8)
171#define DOVE_MC_VIRT_BASE (DOVE_NB_REGS_VIRT_BASE + 0x00000) 176#define DOVE_MC_VIRT_BASE (DOVE_NB_REGS_VIRT_BASE + 0x00000)
172 177
173/* LCD Controller */ 178/* LCD Controller */
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index a4f9f50247d4..76c1170b3528 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -32,7 +32,6 @@
32#include <asm/cacheflush.h> 32#include <asm/cacheflush.h>
33#include <asm/cputype.h> 33#include <asm/cputype.h>
34#include <asm/smp_plat.h> 34#include <asm/smp_plat.h>
35#include <asm/smp_twd.h>
36#include <asm/hardware/arm_timer.h> 35#include <asm/hardware/arm_timer.h>
37#include <asm/hardware/timer-sp.h> 36#include <asm/hardware/timer-sp.h>
38#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
@@ -119,10 +118,10 @@ static void __init highbank_timer_init(void)
119 sp804_clocksource_and_sched_clock_init(timer_base + 0x20, "timer1"); 118 sp804_clocksource_and_sched_clock_init(timer_base + 0x20, "timer1");
120 sp804_clockevents_init(timer_base, irq, "timer0"); 119 sp804_clockevents_init(timer_base, irq, "timer0");
121 120
122 twd_local_timer_of_register();
123
124 arch_timer_of_register(); 121 arch_timer_of_register();
125 arch_timer_sched_clock_init(); 122 arch_timer_sched_clock_init();
123
124 clocksource_of_init();
126} 125}
127 126
128static void highbank_power_off(void) 127static void highbank_power_off(void)
diff --git a/arch/arm/mach-imx/clk-busy.c b/arch/arm/mach-imx/clk-busy.c
index 1ab91b5209e6..85b728cc27ab 100644
--- a/arch/arm/mach-imx/clk-busy.c
+++ b/arch/arm/mach-imx/clk-busy.c
@@ -169,7 +169,7 @@ struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
169 169
170 busy->mux.reg = reg; 170 busy->mux.reg = reg;
171 busy->mux.shift = shift; 171 busy->mux.shift = shift;
172 busy->mux.width = width; 172 busy->mux.mask = BIT(width) - 1;
173 busy->mux.lock = &imx_ccm_lock; 173 busy->mux.lock = &imx_ccm_lock;
174 busy->mux_ops = &clk_mux_ops; 174 busy->mux_ops = &clk_mux_ops;
175 175
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 9ffd103b27e4..b59ddcb57c78 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -12,6 +12,7 @@
12 12
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/clkdev.h> 14#include <linux/clkdev.h>
15#include <linux/clocksource.h>
15#include <linux/cpu.h> 16#include <linux/cpu.h>
16#include <linux/delay.h> 17#include <linux/delay.h>
17#include <linux/export.h> 18#include <linux/export.h>
@@ -28,11 +29,9 @@
28#include <linux/regmap.h> 29#include <linux/regmap.h>
29#include <linux/micrel_phy.h> 30#include <linux/micrel_phy.h>
30#include <linux/mfd/syscon.h> 31#include <linux/mfd/syscon.h>
31#include <asm/smp_twd.h>
32#include <asm/hardware/cache-l2x0.h> 32#include <asm/hardware/cache-l2x0.h>
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35#include <asm/mach/time.h>
36#include <asm/system_misc.h> 35#include <asm/system_misc.h>
37 36
38#include "common.h" 37#include "common.h"
@@ -292,7 +291,7 @@ static void __init imx6q_init_irq(void)
292static void __init imx6q_timer_init(void) 291static void __init imx6q_timer_init(void)
293{ 292{
294 mx6q_clocks_init(); 293 mx6q_clocks_init();
295 twd_local_timer_of_register(); 294 clocksource_of_init();
296 imx_print_silicon_rev("i.MX6Q", imx6q_revision()); 295 imx_print_silicon_rev("i.MX6Q", imx6q_revision());
297} 296}
298 297
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 4cc4bee4d0cf..d805f8078fa3 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -1,4 +1,4 @@
1obj-y += common.o addr-map.o irq.o pcie.o mpp.o 1obj-y += common.o irq.o pcie.o mpp.o
2 2
3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o 3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o
4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o 4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
diff --git a/arch/arm/mach-kirkwood/addr-map.c b/arch/arm/mach-kirkwood/addr-map.c
deleted file mode 100644
index 8f0d162a1e1d..000000000000
--- a/arch/arm/mach-kirkwood/addr-map.c
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/addr-map.c
3 *
4 * Address map functions for Marvell Kirkwood SoCs
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mbus.h>
14#include <linux/io.h>
15#include <mach/hardware.h>
16#include <plat/addr-map.h>
17#include "common.h"
18
19/*
20 * Generic Address Decode Windows bit settings
21 */
22#define TARGET_DEV_BUS 1
23#define TARGET_SRAM 3
24#define TARGET_PCIE 4
25#define ATTR_DEV_SPI_ROM 0x1e
26#define ATTR_DEV_BOOT 0x1d
27#define ATTR_DEV_NAND 0x2f
28#define ATTR_DEV_CS3 0x37
29#define ATTR_DEV_CS2 0x3b
30#define ATTR_DEV_CS1 0x3d
31#define ATTR_DEV_CS0 0x3e
32#define ATTR_PCIE_IO 0xe0
33#define ATTR_PCIE_MEM 0xe8
34#define ATTR_PCIE1_IO 0xd0
35#define ATTR_PCIE1_MEM 0xd8
36#define ATTR_SRAM 0x01
37
38/*
39 * Description of the windows needed by the platform code
40 */
41static struct __initdata orion_addr_map_cfg addr_map_cfg = {
42 .num_wins = 8,
43 .remappable_wins = 4,
44 .bridge_virt_base = BRIDGE_VIRT_BASE,
45};
46
47static const struct __initdata orion_addr_map_info addr_map_info[] = {
48 /*
49 * Windows for PCIe IO+MEM space.
50 */
51 { 0, KIRKWOOD_PCIE_IO_PHYS_BASE, KIRKWOOD_PCIE_IO_SIZE,
52 TARGET_PCIE, ATTR_PCIE_IO, KIRKWOOD_PCIE_IO_BUS_BASE
53 },
54 { 1, KIRKWOOD_PCIE_MEM_PHYS_BASE, KIRKWOOD_PCIE_MEM_SIZE,
55 TARGET_PCIE, ATTR_PCIE_MEM, KIRKWOOD_PCIE_MEM_BUS_BASE
56 },
57 { 2, KIRKWOOD_PCIE1_IO_PHYS_BASE, KIRKWOOD_PCIE1_IO_SIZE,
58 TARGET_PCIE, ATTR_PCIE1_IO, KIRKWOOD_PCIE1_IO_BUS_BASE
59 },
60 { 3, KIRKWOOD_PCIE1_MEM_PHYS_BASE, KIRKWOOD_PCIE1_MEM_SIZE,
61 TARGET_PCIE, ATTR_PCIE1_MEM, KIRKWOOD_PCIE1_MEM_BUS_BASE
62 },
63 /*
64 * Window for NAND controller.
65 */
66 { 4, KIRKWOOD_NAND_MEM_PHYS_BASE, KIRKWOOD_NAND_MEM_SIZE,
67 TARGET_DEV_BUS, ATTR_DEV_NAND, -1
68 },
69 /*
70 * Window for SRAM.
71 */
72 { 5, KIRKWOOD_SRAM_PHYS_BASE, KIRKWOOD_SRAM_SIZE,
73 TARGET_SRAM, ATTR_SRAM, -1
74 },
75 /* End marker */
76 { -1, 0, 0, 0, 0, 0 }
77};
78
79void __init kirkwood_setup_cpu_mbus(void)
80{
81 /*
82 * Disable, clear and configure windows.
83 */
84 orion_config_wins(&addr_map_cfg, addr_map_info);
85
86 /*
87 * Setup MBUS dram target info.
88 */
89 orion_setup_cpu_mbus_target(&addr_map_cfg,
90 (void __iomem *) DDR_WINDOW_CPU_BASE);
91}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index d367aa6b47bb..f5437c27dc2a 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -93,7 +93,7 @@ static void __init kirkwood_dt_init(void)
93 */ 93 */
94 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); 94 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
95 95
96 kirkwood_setup_cpu_mbus(); 96 kirkwood_setup_wins();
97 97
98 kirkwood_l2_init(); 98 kirkwood_l2_init();
99 99
diff --git a/arch/arm/mach-kirkwood/board-guruplug.c b/arch/arm/mach-kirkwood/board-guruplug.c
index 0a0df4554d8b..a857163954a5 100644
--- a/arch/arm/mach-kirkwood/board-guruplug.c
+++ b/arch/arm/mach-kirkwood/board-guruplug.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/mv643xx_eth.h> 14#include <linux/mv643xx_eth.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/platform_data/mmc-mvsdio.h>
17#include "common.h" 16#include "common.h"
18 17
19static struct mv643xx_eth_platform_data guruplug_ge00_data = { 18static struct mv643xx_eth_platform_data guruplug_ge00_data = {
@@ -24,10 +23,6 @@ static struct mv643xx_eth_platform_data guruplug_ge01_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(1), 23 .phy_addr = MV643XX_ETH_PHY_ADDR(1),
25}; 24};
26 25
27static struct mvsdio_platform_data guruplug_mvsdio_data = {
28 /* unfortunately the CD signal has not been connected */
29};
30
31void __init guruplug_dt_init(void) 26void __init guruplug_dt_init(void)
32{ 27{
33 /* 28 /*
@@ -35,5 +30,4 @@ void __init guruplug_dt_init(void)
35 */ 30 */
36 kirkwood_ge00_init(&guruplug_ge00_data); 31 kirkwood_ge00_init(&guruplug_ge00_data);
37 kirkwood_ge01_init(&guruplug_ge01_data); 32 kirkwood_ge01_init(&guruplug_ge01_data);
38 kirkwood_sdio_init(&guruplug_mvsdio_data);
39} 33}
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 49792a0cd2d3..c2cae69e6d2b 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -33,7 +33,6 @@
33#include <linux/platform_data/usb-ehci-orion.h> 33#include <linux/platform_data/usb-ehci-orion.h>
34#include <plat/common.h> 34#include <plat/common.h>
35#include <plat/time.h> 35#include <plat/time.h>
36#include <plat/addr-map.h>
37#include <linux/platform_data/dma-mv_xor.h> 36#include <linux/platform_data/dma-mv_xor.h>
38#include "common.h" 37#include "common.h"
39 38
@@ -535,6 +534,9 @@ void __init kirkwood_init_early(void)
535 * the allocations won't fail. 534 * the allocations won't fail.
536 */ 535 */
537 init_dma_coherent_pool_size(SZ_1M); 536 init_dma_coherent_pool_size(SZ_1M);
537 mvebu_mbus_init("marvell,kirkwood-mbus",
538 BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
539 DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ);
538} 540}
539 541
540int kirkwood_tclk; 542int kirkwood_tclk;
@@ -650,6 +652,38 @@ char * __init kirkwood_id(void)
650 } 652 }
651} 653}
652 654
655void __init kirkwood_setup_wins(void)
656{
657 /*
658 * The PCIe windows will no longer be statically allocated
659 * here once Kirkwood is migrated to the pci-mvebu driver.
660 */
661 mvebu_mbus_add_window_remap_flags("pcie0.0",
662 KIRKWOOD_PCIE_IO_PHYS_BASE,
663 KIRKWOOD_PCIE_IO_SIZE,
664 KIRKWOOD_PCIE_IO_BUS_BASE,
665 MVEBU_MBUS_PCI_IO);
666 mvebu_mbus_add_window_remap_flags("pcie0.0",
667 KIRKWOOD_PCIE_MEM_PHYS_BASE,
668 KIRKWOOD_PCIE_MEM_SIZE,
669 MVEBU_MBUS_NO_REMAP,
670 MVEBU_MBUS_PCI_MEM);
671 mvebu_mbus_add_window_remap_flags("pcie1.0",
672 KIRKWOOD_PCIE1_IO_PHYS_BASE,
673 KIRKWOOD_PCIE1_IO_SIZE,
674 KIRKWOOD_PCIE1_IO_BUS_BASE,
675 MVEBU_MBUS_PCI_IO);
676 mvebu_mbus_add_window_remap_flags("pcie1.0",
677 KIRKWOOD_PCIE1_MEM_PHYS_BASE,
678 KIRKWOOD_PCIE1_MEM_SIZE,
679 MVEBU_MBUS_NO_REMAP,
680 MVEBU_MBUS_PCI_MEM);
681 mvebu_mbus_add_window("nand", KIRKWOOD_NAND_MEM_PHYS_BASE,
682 KIRKWOOD_NAND_MEM_SIZE);
683 mvebu_mbus_add_window("sram", KIRKWOOD_SRAM_PHYS_BASE,
684 KIRKWOOD_SRAM_SIZE);
685}
686
653void __init kirkwood_l2_init(void) 687void __init kirkwood_l2_init(void)
654{ 688{
655#ifdef CONFIG_CACHE_FEROCEON_L2 689#ifdef CONFIG_CACHE_FEROCEON_L2
@@ -675,7 +709,7 @@ void __init kirkwood_init(void)
675 */ 709 */
676 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); 710 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
677 711
678 kirkwood_setup_cpu_mbus(); 712 kirkwood_setup_wins();
679 713
680 kirkwood_l2_init(); 714 kirkwood_l2_init();
681 715
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 5ed70565c843..e24f74305b34 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -30,7 +30,7 @@ void kirkwood_init(void);
30void kirkwood_init_early(void); 30void kirkwood_init_early(void);
31void kirkwood_init_irq(void); 31void kirkwood_init_irq(void);
32 32
33void kirkwood_setup_cpu_mbus(void); 33void kirkwood_setup_wins(void);
34 34
35void kirkwood_enable_pcie(void); 35void kirkwood_enable_pcie(void);
36void kirkwood_pcie_id(u32 *dev, u32 *rev); 36void kirkwood_pcie_id(u32 *dev, u32 *rev);
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index a05563a31c95..92976cef3910 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -60,8 +60,9 @@
60 * Register Map 60 * Register Map
61 */ 61 */
62#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x00000) 62#define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x00000)
63#define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000) 63#define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000)
64#define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE + 0x1500) 64#define DDR_WINDOW_CPU_BASE (DDR_PHYS_BASE + 0x1500)
65#define DDR_WINDOW_CPU_SZ (0x20)
65#define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418) 66#define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418)
66 67
67#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x10000) 68#define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x10000)
@@ -80,6 +81,8 @@
80 81
81#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x20000) 82#define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x20000)
82#define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000) 83#define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000)
84#define BRIDGE_WINS_BASE (BRIDGE_PHYS_BASE)
85#define BRIDGE_WINS_SZ (0x80)
83 86
84#define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x30000) 87#define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x30000)
85 88
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index d96ad4c09972..7f43e6c2f8c0 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -17,7 +17,6 @@
17#include <asm/mach/pci.h> 17#include <asm/mach/pci.h>
18#include <plat/pcie.h> 18#include <plat/pcie.h>
19#include <mach/bridge-regs.h> 19#include <mach/bridge-regs.h>
20#include <plat/addr-map.h>
21#include "common.h" 20#include "common.h"
22 21
23static void kirkwood_enable_pcie_clk(const char *port) 22static void kirkwood_enable_pcie_clk(const char *port)
diff --git a/arch/arm/mach-mv78xx0/Makefile b/arch/arm/mach-mv78xx0/Makefile
index 67a13f9bfe64..7cd04634d302 100644
--- a/arch/arm/mach-mv78xx0/Makefile
+++ b/arch/arm/mach-mv78xx0/Makefile
@@ -1,4 +1,4 @@
1obj-y += common.o addr-map.o mpp.o irq.o pcie.o 1obj-y += common.o mpp.o irq.o pcie.o
2obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o 2obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o
3obj-$(CONFIG_MACH_RD78X00_MASA) += rd78x00-masa-setup.o 3obj-$(CONFIG_MACH_RD78X00_MASA) += rd78x00-masa-setup.o
4obj-$(CONFIG_MACH_TERASTATION_WXL) += buffalo-wxl-setup.o 4obj-$(CONFIG_MACH_TERASTATION_WXL) += buffalo-wxl-setup.o
diff --git a/arch/arm/mach-mv78xx0/addr-map.c b/arch/arm/mach-mv78xx0/addr-map.c
deleted file mode 100644
index 26e9876b50e9..000000000000
--- a/arch/arm/mach-mv78xx0/addr-map.c
+++ /dev/null
@@ -1,93 +0,0 @@
1/*
2 * arch/arm/mach-mv78xx0/addr-map.c
3 *
4 * Address map functions for Marvell MV78xx0 SoCs
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mbus.h>
14#include <linux/io.h>
15#include <plat/addr-map.h>
16#include <mach/mv78xx0.h>
17#include "common.h"
18
19/*
20 * Generic Address Decode Windows bit settings
21 */
22#define TARGET_DEV_BUS 1
23#define TARGET_PCIE0 4
24#define TARGET_PCIE1 8
25#define TARGET_PCIE(i) ((i) ? TARGET_PCIE1 : TARGET_PCIE0)
26#define ATTR_DEV_SPI_ROM 0x1f
27#define ATTR_DEV_BOOT 0x2f
28#define ATTR_DEV_CS3 0x37
29#define ATTR_DEV_CS2 0x3b
30#define ATTR_DEV_CS1 0x3d
31#define ATTR_DEV_CS0 0x3e
32#define ATTR_PCIE_IO(l) (0xf0 & ~(0x10 << (l)))
33#define ATTR_PCIE_MEM(l) (0xf8 & ~(0x10 << (l)))
34
35/*
36 * CPU Address Decode Windows registers
37 */
38#define WIN0_OFF(n) (BRIDGE_VIRT_BASE + 0x0000 + ((n) << 4))
39#define WIN8_OFF(n) (BRIDGE_VIRT_BASE + 0x0900 + (((n) - 8) << 4))
40
41static void __init __iomem *win_cfg_base(const struct orion_addr_map_cfg *cfg, int win)
42{
43 /*
44 * Find the control register base address for this window.
45 *
46 * BRIDGE_VIRT_BASE points to the right (CPU0's or CPU1's)
47 * MBUS bridge depending on which CPU core we're running on,
48 * so we don't need to take that into account here.
49 */
50
51 return (win < 8) ? WIN0_OFF(win) : WIN8_OFF(win);
52}
53
54/*
55 * Description of the windows needed by the platform code
56 */
57static struct orion_addr_map_cfg addr_map_cfg __initdata = {
58 .num_wins = 14,
59 .remappable_wins = 8,
60 .win_cfg_base = win_cfg_base,
61};
62
63void __init mv78xx0_setup_cpu_mbus(void)
64{
65 /*
66 * Disable, clear and configure windows.
67 */
68 orion_config_wins(&addr_map_cfg, NULL);
69
70 /*
71 * Setup MBUS dram target info.
72 */
73 if (mv78xx0_core_index() == 0)
74 orion_setup_cpu_mbus_target(&addr_map_cfg,
75 (void __iomem *) DDR_WINDOW_CPU0_BASE);
76 else
77 orion_setup_cpu_mbus_target(&addr_map_cfg,
78 (void __iomem *) DDR_WINDOW_CPU1_BASE);
79}
80
81void __init mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size,
82 int maj, int min)
83{
84 orion_setup_cpu_win(&addr_map_cfg, window, base, size,
85 TARGET_PCIE(maj), ATTR_PCIE_IO(min), 0);
86}
87
88void __init mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size,
89 int maj, int min)
90{
91 orion_setup_cpu_win(&addr_map_cfg, window, base, size,
92 TARGET_PCIE(maj), ATTR_PCIE_MEM(min), -1);
93}
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 0efa14498ebc..749a7f8c4992 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -334,6 +334,14 @@ void __init mv78xx0_uart3_init(void)
334void __init mv78xx0_init_early(void) 334void __init mv78xx0_init_early(void)
335{ 335{
336 orion_time_set_base(TIMER_VIRT_BASE); 336 orion_time_set_base(TIMER_VIRT_BASE);
337 if (mv78xx0_core_index() == 0)
338 mvebu_mbus_init("marvell,mv78xx0-mbus",
339 BRIDGE_WINS_CPU0_BASE, BRIDGE_WINS_SZ,
340 DDR_WINDOW_CPU0_BASE, DDR_WINDOW_CPU_SZ);
341 else
342 mvebu_mbus_init("marvell,mv78xx0-mbus",
343 BRIDGE_WINS_CPU1_BASE, BRIDGE_WINS_SZ,
344 DDR_WINDOW_CPU1_BASE, DDR_WINDOW_CPU_SZ);
337} 345}
338 346
339void __init_refok mv78xx0_timer_init(void) 347void __init_refok mv78xx0_timer_init(void)
@@ -397,8 +405,6 @@ void __init mv78xx0_init(void)
397 printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000); 405 printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000);
398 printk("TCLK = %dMHz\n", (get_tclk() + 499999) / 1000000); 406 printk("TCLK = %dMHz\n", (get_tclk() + 499999) / 1000000);
399 407
400 mv78xx0_setup_cpu_mbus();
401
402#ifdef CONFIG_CACHE_FEROCEON_L2 408#ifdef CONFIG_CACHE_FEROCEON_L2
403 feroceon_l2_init(is_l2_writethrough()); 409 feroceon_l2_init(is_l2_writethrough());
404#endif 410#endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
index 46200a183cf2..723748d8ba7d 100644
--- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
+++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
@@ -60,13 +60,18 @@
60 */ 60 */
61#define BRIDGE_VIRT_BASE (MV78XX0_CORE_REGS_VIRT_BASE) 61#define BRIDGE_VIRT_BASE (MV78XX0_CORE_REGS_VIRT_BASE)
62#define BRIDGE_PHYS_BASE (MV78XX0_CORE_REGS_PHYS_BASE) 62#define BRIDGE_PHYS_BASE (MV78XX0_CORE_REGS_PHYS_BASE)
63#define BRIDGE_WINS_CPU0_BASE (MV78XX0_CORE0_REGS_PHYS_BASE)
64#define BRIDGE_WINS_CPU1_BASE (MV78XX0_CORE1_REGS_PHYS_BASE)
65#define BRIDGE_WINS_SZ (0xA000)
63 66
64/* 67/*
65 * Register Map 68 * Register Map
66 */ 69 */
67#define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x00000) 70#define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x00000)
68#define DDR_WINDOW_CPU0_BASE (DDR_VIRT_BASE + 0x1500) 71#define DDR_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x00000)
69#define DDR_WINDOW_CPU1_BASE (DDR_VIRT_BASE + 0x1570) 72#define DDR_WINDOW_CPU0_BASE (DDR_PHYS_BASE + 0x1500)
73#define DDR_WINDOW_CPU1_BASE (DDR_PHYS_BASE + 0x1570)
74#define DDR_WINDOW_CPU_SZ (0x20)
70 75
71#define DEV_BUS_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x10000) 76#define DEV_BUS_PHYS_BASE (MV78XX0_REGS_PHYS_BASE + 0x10000)
72#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x10000) 77#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE + 0x10000)
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c
index ee8c0b51df2c..dc26a654c496 100644
--- a/arch/arm/mach-mv78xx0/pcie.c
+++ b/arch/arm/mach-mv78xx0/pcie.c
@@ -10,11 +10,11 @@
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/mbus.h>
13#include <video/vga.h> 14#include <video/vga.h>
14#include <asm/irq.h> 15#include <asm/irq.h>
15#include <asm/mach/pci.h> 16#include <asm/mach/pci.h>
16#include <plat/pcie.h> 17#include <plat/pcie.h>
17#include <plat/addr-map.h>
18#include <mach/mv78xx0.h> 18#include <mach/mv78xx0.h>
19#include "common.h" 19#include "common.h"
20 20
@@ -54,7 +54,6 @@ static void __init mv78xx0_pcie_preinit(void)
54 int i; 54 int i;
55 u32 size_each; 55 u32 size_each;
56 u32 start; 56 u32 start;
57 int win = 0;
58 57
59 pcie_io_space.name = "PCIe I/O Space"; 58 pcie_io_space.name = "PCIe I/O Space";
60 pcie_io_space.start = MV78XX0_PCIE_IO_PHYS_BASE(0); 59 pcie_io_space.start = MV78XX0_PCIE_IO_PHYS_BASE(0);
@@ -72,6 +71,7 @@ static void __init mv78xx0_pcie_preinit(void)
72 start = MV78XX0_PCIE_MEM_PHYS_BASE; 71 start = MV78XX0_PCIE_MEM_PHYS_BASE;
73 for (i = 0; i < num_pcie_ports; i++) { 72 for (i = 0; i < num_pcie_ports; i++) {
74 struct pcie_port *pp = pcie_port + i; 73 struct pcie_port *pp = pcie_port + i;
74 char winname[MVEBU_MBUS_MAX_WINNAME_SZ];
75 75
76 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), 76 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
77 "PCIe %d.%d MEM", pp->maj, pp->min); 77 "PCIe %d.%d MEM", pp->maj, pp->min);
@@ -85,12 +85,17 @@ static void __init mv78xx0_pcie_preinit(void)
85 if (request_resource(&iomem_resource, &pp->res)) 85 if (request_resource(&iomem_resource, &pp->res))
86 panic("can't allocate PCIe MEM sub-space"); 86 panic("can't allocate PCIe MEM sub-space");
87 87
88 mv78xx0_setup_pcie_mem_win(win + i + 8, pp->res.start, 88 snprintf(winname, sizeof(winname), "pcie%d.%d",
89 resource_size(&pp->res), 89 pp->maj, pp->min);
90 pp->maj, pp->min); 90
91 91 mvebu_mbus_add_window_remap_flags(winname,
92 mv78xx0_setup_pcie_io_win(win + i, i * SZ_64K, SZ_64K, 92 pp->res.start,
93 pp->maj, pp->min); 93 resource_size(&pp->res),
94 MVEBU_MBUS_NO_REMAP,
95 MVEBU_MBUS_PCI_MEM);
96 mvebu_mbus_add_window_remap_flags(winname,
97 i * SZ_64K, SZ_64K,
98 0, MVEBU_MBUS_PCI_IO);
94 } 99 }
95} 100}
96 101
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 440b13ef1fed..e11acbb0a46d 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -13,6 +13,8 @@ config ARCH_MVEBU
13 select MVEBU_CLK_CORE 13 select MVEBU_CLK_CORE
14 select MVEBU_CLK_CPU 14 select MVEBU_CLK_CPU
15 select MVEBU_CLK_GATING 15 select MVEBU_CLK_GATING
16 select MVEBU_MBUS
17 select ZONE_DMA if ARM_LPAE
16 18
17if ARCH_MVEBU 19if ARCH_MVEBU
18 20
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index da93bcbc74c1..ba769e082ad4 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -5,6 +5,6 @@ AFLAGS_coherency_ll.o := -Wa,-march=armv7-a
5 5
6obj-y += system-controller.o 6obj-y += system-controller.o
7obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o 7obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
8obj-$(CONFIG_ARCH_MVEBU) += addr-map.o coherency.o coherency_ll.o pmsu.o irq-armada-370-xp.o 8obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o irq-armada-370-xp.o
9obj-$(CONFIG_SMP) += platsmp.o headsmp.o 9obj-$(CONFIG_SMP) += platsmp.o headsmp.o
10obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 10obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-mvebu/addr-map.c b/arch/arm/mach-mvebu/addr-map.c
deleted file mode 100644
index ab9b3bd4fef5..000000000000
--- a/arch/arm/mach-mvebu/addr-map.c
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * Address map functions for Marvell 370 / XP SoCs
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mbus.h>
16#include <linux/io.h>
17#include <linux/of.h>
18#include <linux/of_address.h>
19#include <plat/addr-map.h>
20
21/*
22 * Generic Address Decode Windows bit settings
23 */
24#define ARMADA_XP_TARGET_DEV_BUS 1
25#define ARMADA_XP_ATTR_DEV_BOOTROM 0x1D
26#define ARMADA_XP_TARGET_ETH1 3
27#define ARMADA_XP_TARGET_PCIE_0_2 4
28#define ARMADA_XP_TARGET_ETH0 7
29#define ARMADA_XP_TARGET_PCIE_1_3 8
30
31#define ARMADA_370_TARGET_DEV_BUS 1
32#define ARMADA_370_ATTR_DEV_BOOTROM 0x1D
33#define ARMADA_370_TARGET_PCIE_0 4
34#define ARMADA_370_TARGET_PCIE_1 8
35
36#define ARMADA_WINDOW_8_PLUS_OFFSET 0x90
37#define ARMADA_SDRAM_ADDR_DECODING_OFFSET 0x180
38
39static const struct __initdata orion_addr_map_info
40armada_xp_addr_map_info[] = {
41 /*
42 * Window for the BootROM, needed for SMP on Armada XP
43 */
44 { 0, 0xfff00000, SZ_1M, ARMADA_XP_TARGET_DEV_BUS,
45 ARMADA_XP_ATTR_DEV_BOOTROM, -1 },
46 /* End marker */
47 { -1, 0, 0, 0, 0, 0 },
48};
49
50static const struct __initdata orion_addr_map_info
51armada_370_addr_map_info[] = {
52 /* End marker */
53 { -1, 0, 0, 0, 0, 0 },
54};
55
56static struct of_device_id of_addr_decoding_controller_table[] = {
57 { .compatible = "marvell,armada-addr-decoding-controller" },
58 { /* end of list */ },
59};
60
61static void __iomem *
62armada_cfg_base(const struct orion_addr_map_cfg *cfg, int win)
63{
64 unsigned int offset;
65
66 /* The register layout is a bit annoying and the below code
67 * tries to cope with it.
68 * - At offset 0x0, there are the registers for the first 8
69 * windows, with 4 registers of 32 bits per window (ctrl,
70 * base, remap low, remap high)
71 * - Then at offset 0x80, there is a hole of 0x10 bytes for
72 * the internal registers base address and internal units
73 * sync barrier register.
74 * - Then at offset 0x90, there the registers for 12
75 * windows, with only 2 registers of 32 bits per window
76 * (ctrl, base).
77 */
78 if (win < 8)
79 offset = (win << 4);
80 else
81 offset = ARMADA_WINDOW_8_PLUS_OFFSET + ((win - 8) << 3);
82
83 return cfg->bridge_virt_base + offset;
84}
85
86static struct __initdata orion_addr_map_cfg addr_map_cfg = {
87 .num_wins = 20,
88 .remappable_wins = 8,
89 .win_cfg_base = armada_cfg_base,
90};
91
92static int __init armada_setup_cpu_mbus(void)
93{
94 struct device_node *np;
95 void __iomem *mbus_unit_addr_decoding_base;
96 void __iomem *sdram_addr_decoding_base;
97
98 np = of_find_matching_node(NULL, of_addr_decoding_controller_table);
99 if (!np)
100 return -ENODEV;
101
102 mbus_unit_addr_decoding_base = of_iomap(np, 0);
103 BUG_ON(!mbus_unit_addr_decoding_base);
104
105 sdram_addr_decoding_base =
106 mbus_unit_addr_decoding_base +
107 ARMADA_SDRAM_ADDR_DECODING_OFFSET;
108
109 addr_map_cfg.bridge_virt_base = mbus_unit_addr_decoding_base;
110
111 if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"))
112 addr_map_cfg.hw_io_coherency = 1;
113
114 /*
115 * Disable, clear and configure windows.
116 */
117 if (of_machine_is_compatible("marvell,armadaxp"))
118 orion_config_wins(&addr_map_cfg, armada_xp_addr_map_info);
119 else if (of_machine_is_compatible("marvell,armada370"))
120 orion_config_wins(&addr_map_cfg, armada_370_addr_map_info);
121 else {
122 pr_err("Unsupported SoC\n");
123 return -EINVAL;
124 }
125
126 /*
127 * Setup MBUS dram target info.
128 */
129 orion_setup_cpu_mbus_target(&addr_map_cfg,
130 sdram_addr_decoding_base);
131 return 0;
132}
133
134/* Using a early_initcall is needed so that this initialization gets
135 * done before the SMP initialization, which requires the BootROM to
136 * be remapped. */
137early_initcall(armada_setup_cpu_mbus);
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index a5ea616d6d12..12d3655830d1 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -19,6 +19,7 @@
19#include <linux/time-armada-370-xp.h> 19#include <linux/time-armada-370-xp.h>
20#include <linux/clk/mvebu.h> 20#include <linux/clk/mvebu.h>
21#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
22#include <linux/mbus.h>
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 24#include <asm/mach/map.h>
24#include <asm/mach/time.h> 25#include <asm/mach/time.h>
@@ -48,12 +49,29 @@ void __init armada_370_xp_timer_and_clk_init(void)
48 49
49void __init armada_370_xp_init_early(void) 50void __init armada_370_xp_init_early(void)
50{ 51{
52 char *mbus_soc_name;
53
51 /* 54 /*
52 * Some Armada 370/XP devices allocate their coherent buffers 55 * Some Armada 370/XP devices allocate their coherent buffers
53 * from atomic context. Increase size of atomic coherent pool 56 * from atomic context. Increase size of atomic coherent pool
54 * to make sure such the allocations won't fail. 57 * to make sure such the allocations won't fail.
55 */ 58 */
56 init_dma_coherent_pool_size(SZ_1M); 59 init_dma_coherent_pool_size(SZ_1M);
60
61 /*
62 * This initialization will be replaced by a DT-based
63 * initialization once the mvebu-mbus driver gains DT support.
64 */
65 if (of_machine_is_compatible("marvell,armada370"))
66 mbus_soc_name = "marvell,armada370-mbus";
67 else
68 mbus_soc_name = "marvell,armadaxp-mbus";
69
70 mvebu_mbus_init(mbus_soc_name,
71 ARMADA_370_XP_MBUS_WINS_BASE,
72 ARMADA_370_XP_MBUS_WINS_SIZE,
73 ARMADA_370_XP_SDRAM_WINS_BASE,
74 ARMADA_370_XP_SDRAM_WINS_SIZE);
57} 75}
58 76
59static void __init armada_370_xp_dt_init(void) 77static void __init armada_370_xp_dt_init(void)
diff --git a/arch/arm/mach-mvebu/armada-370-xp.h b/arch/arm/mach-mvebu/armada-370-xp.h
index c6a7d74fddfe..2070e1b4f342 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.h
+++ b/arch/arm/mach-mvebu/armada-370-xp.h
@@ -16,9 +16,15 @@
16#define __MACH_ARMADA_370_XP_H 16#define __MACH_ARMADA_370_XP_H
17 17
18#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000 18#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000
19#define ARMADA_370_XP_REGS_VIRT_BASE IOMEM(0xfeb00000) 19#define ARMADA_370_XP_REGS_VIRT_BASE IOMEM(0xfec00000)
20#define ARMADA_370_XP_REGS_SIZE SZ_1M 20#define ARMADA_370_XP_REGS_SIZE SZ_1M
21 21
22/* These defines can go away once mvebu-mbus has a DT binding */
23#define ARMADA_370_XP_MBUS_WINS_BASE (ARMADA_370_XP_REGS_PHYS_BASE + 0x20000)
24#define ARMADA_370_XP_MBUS_WINS_SIZE 0x100
25#define ARMADA_370_XP_SDRAM_WINS_BASE (ARMADA_370_XP_REGS_PHYS_BASE + 0x20180)
26#define ARMADA_370_XP_SDRAM_WINS_SIZE 0x20
27
22#ifdef CONFIG_SMP 28#ifdef CONFIG_SMP
23#include <linux/cpumask.h> 29#include <linux/cpumask.h>
24 30
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index fe16aaf7c19c..875ea748391c 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -21,6 +21,7 @@
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/mbus.h>
24#include <asm/cacheflush.h> 25#include <asm/cacheflush.h>
25#include <asm/smp_plat.h> 26#include <asm/smp_plat.h>
26#include "common.h" 27#include "common.h"
@@ -109,6 +110,7 @@ void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
109 set_secondary_cpus_clock(); 110 set_secondary_cpus_clock();
110 flush_cache_all(); 111 flush_cache_all();
111 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); 112 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
113 mvebu_mbus_add_window("bootrom", 0xfff00000, SZ_1M);
112} 114}
113 115
114struct smp_operations armada_xp_smp_ops __initdata = { 116struct smp_operations armada_xp_smp_ops __initdata = {
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
index 3d3c8a973062..80db7269760e 100644
--- a/arch/arm/mach-mxs/Makefile
+++ b/arch/arm/mach-mxs/Makefile
@@ -1,6 +1,2 @@
1# Common support
2obj-y := icoll.o ocotp.o system.o timer.o mm.o
3
4obj-$(CONFIG_PM) += pm.o 1obj-$(CONFIG_PM) += pm.o
5
6obj-$(CONFIG_MACH_MXS_DT) += mach-mxs.o 2obj-$(CONFIG_MACH_MXS_DT) += mach-mxs.o
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
deleted file mode 100644
index be5a9c93cb2a..000000000000
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __MACH_MXS_COMMON_H__
12#define __MACH_MXS_COMMON_H__
13
14extern const u32 *mxs_get_ocotp(void);
15extern int mxs_reset_block(void __iomem *);
16extern void mxs_timer_init(void);
17extern void mxs_restart(char, const char *);
18extern int mxs_saif_clkmux_select(unsigned int clkmux);
19
20extern int mx23_clocks_init(void);
21extern void mx23_map_io(void);
22
23extern int mx28_clocks_init(void);
24extern void mx28_map_io(void);
25
26extern void icoll_init_irq(void);
27extern void icoll_handle_irq(struct pt_regs *);
28
29#endif /* __MACH_MXS_COMMON_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/debug-macro.S b/arch/arm/mach-mxs/include/mach/debug-macro.S
index 90c6b7836ad3..d86951551ca1 100644
--- a/arch/arm/mach-mxs/include/mach/debug-macro.S
+++ b/arch/arm/mach-mxs/include/mach/debug-macro.S
@@ -11,16 +11,13 @@
11 * 11 *
12 */ 12 */
13 13
14#include <mach/mx23.h>
15#include <mach/mx28.h>
16
17#ifdef CONFIG_DEBUG_IMX23_UART 14#ifdef CONFIG_DEBUG_IMX23_UART
18#define UART_PADDR MX23_DUART_BASE_ADDR 15#define UART_PADDR 0x80070000
19#elif defined (CONFIG_DEBUG_IMX28_UART) 16#elif defined (CONFIG_DEBUG_IMX28_UART)
20#define UART_PADDR MX28_DUART_BASE_ADDR 17#define UART_PADDR 0x80074000
21#endif 18#endif
22 19
23#define UART_VADDR MXS_IO_ADDRESS(UART_PADDR) 20#define UART_VADDR 0xfe100000
24 21
25 .macro addruart, rp, rv, tmp 22 .macro addruart, rp, rv, tmp
26 ldr \rp, =UART_PADDR @ physical 23 ldr \rp, =UART_PADDR @ physical
diff --git a/arch/arm/mach-mxs/include/mach/digctl.h b/arch/arm/mach-mxs/include/mach/digctl.h
deleted file mode 100644
index 17964066303f..000000000000
--- a/arch/arm/mach-mxs/include/mach/digctl.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __MACH_DIGCTL_H__
10#define __MACH_DIGCTL_H__
11
12/* MXS DIGCTL SAIF CLKMUX */
13#define MXS_DIGCTL_SAIF_CLKMUX_DIRECT 0x0
14#define MXS_DIGCTL_SAIF_CLKMUX_CROSSINPUT 0x1
15#define MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0 0x2
16#define MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR1 0x3
17
18#define HW_DIGCTL_CTRL 0x0
19#define BP_DIGCTL_CTRL_SAIF_CLKMUX 10
20#define BM_DIGCTL_CTRL_SAIF_CLKMUX (0x3 << 10)
21#define HW_DIGCTL_CHIPID 0x310
22#endif
diff --git a/arch/arm/mach-mxs/include/mach/hardware.h b/arch/arm/mach-mxs/include/mach/hardware.h
deleted file mode 100644
index 4c0e8a64d8c7..000000000000
--- a/arch/arm/mach-mxs/include/mach/hardware.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#ifndef __MACH_MXS_HARDWARE_H__
21#define __MACH_MXS_HARDWARE_H__
22
23#endif /* __MACH_MXS_HARDWARE_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/mx23.h b/arch/arm/mach-mxs/include/mach/mx23.h
deleted file mode 100644
index 599094bc99de..000000000000
--- a/arch/arm/mach-mxs/include/mach/mx23.h
+++ /dev/null
@@ -1,169 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef __MACH_MX23_H__
20#define __MACH_MX23_H__
21
22#include <mach/mxs.h>
23
24/*
25 * OCRAM
26 */
27#define MX23_OCRAM_BASE_ADDR 0x00000000
28#define MX23_OCRAM_SIZE SZ_32K
29
30/*
31 * IO
32 */
33#define MX23_IO_BASE_ADDR 0x80000000
34#define MX23_IO_SIZE SZ_1M
35
36#define MX23_ICOLL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x000000)
37#define MX23_APBH_DMA_BASE_ADDR (MX23_IO_BASE_ADDR + 0x004000)
38#define MX23_BCH_BASE_ADDR (MX23_IO_BASE_ADDR + 0x00a000)
39#define MX23_GPMI_BASE_ADDR (MX23_IO_BASE_ADDR + 0x00c000)
40#define MX23_SSP1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x010000)
41#define MX23_PINCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x018000)
42#define MX23_DIGCTL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x01c000)
43#define MX23_ETM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x020000)
44#define MX23_APBX_DMA_BASE_ADDR (MX23_IO_BASE_ADDR + 0x024000)
45#define MX23_DCP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x028000)
46#define MX23_PXP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02a000)
47#define MX23_OCOTP_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02c000)
48#define MX23_AXI_AHB0_BASE_ADDR (MX23_IO_BASE_ADDR + 0x02e000)
49#define MX23_LCDIF_BASE_ADDR (MX23_IO_BASE_ADDR + 0x030000)
50#define MX23_SSP2_BASE_ADDR (MX23_IO_BASE_ADDR + 0x034000)
51#define MX23_TVENC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x038000)
52#define MX23_CLKCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x040000)
53#define MX23_SAIF0_BASE_ADDR (MX23_IO_BASE_ADDR + 0x042000)
54#define MX23_POWER_BASE_ADDR (MX23_IO_BASE_ADDR + 0x044000)
55#define MX23_SAIF1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x046000)
56#define MX23_AUDIOOUT_BASE_ADDR (MX23_IO_BASE_ADDR + 0x048000)
57#define MX23_AUDIOIN_BASE_ADDR (MX23_IO_BASE_ADDR + 0x04c000)
58#define MX23_LRADC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x050000)
59#define MX23_SPDIF_BASE_ADDR (MX23_IO_BASE_ADDR + 0x054000)
60#define MX23_I2C_BASE_ADDR (MX23_IO_BASE_ADDR + 0x058000)
61#define MX23_RTC_BASE_ADDR (MX23_IO_BASE_ADDR + 0x05c000)
62#define MX23_PWM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x064000)
63#define MX23_TIMROT_BASE_ADDR (MX23_IO_BASE_ADDR + 0x068000)
64#define MX23_AUART1_BASE_ADDR (MX23_IO_BASE_ADDR + 0x06c000)
65#define MX23_AUART2_BASE_ADDR (MX23_IO_BASE_ADDR + 0x06e000)
66#define MX23_DUART_BASE_ADDR (MX23_IO_BASE_ADDR + 0x070000)
67#define MX23_USBPHY_BASE_ADDR (MX23_IO_BASE_ADDR + 0x07c000)
68#define MX23_USBCTRL_BASE_ADDR (MX23_IO_BASE_ADDR + 0x080000)
69#define MX23_DRAM_BASE_ADDR (MX23_IO_BASE_ADDR + 0x0e0000)
70
71#define MX23_IO_P2V(x) MXS_IO_P2V(x)
72#define MX23_IO_ADDRESS(x) IOMEM(MX23_IO_P2V(x))
73
74/*
75 * IRQ
76 */
77#define MX23_INT_DUART 0
78#define MX23_INT_COMMS_RX 1
79#define MX23_INT_COMMS_TX 1
80#define MX23_INT_SSP2_ERROR 2
81#define MX23_INT_VDD5V 3
82#define MX23_INT_HEADPHONE_SHORT 4
83#define MX23_INT_DAC_DMA 5
84#define MX23_INT_DAC_ERROR 6
85#define MX23_INT_ADC_DMA 7
86#define MX23_INT_ADC_ERROR 8
87#define MX23_INT_SPDIF_DMA 9
88#define MX23_INT_SAIF2_DMA 9
89#define MX23_INT_SPDIF_ERROR 10
90#define MX23_INT_SAIF1_IRQ 10
91#define MX23_INT_SAIF2_IRQ 10
92#define MX23_INT_USB_CTRL 11
93#define MX23_INT_USB_WAKEUP 12
94#define MX23_INT_GPMI_DMA 13
95#define MX23_INT_SSP1_DMA 14
96#define MX23_INT_SSP1_ERROR 15
97#define MX23_INT_GPIO0 16
98#define MX23_INT_GPIO1 17
99#define MX23_INT_GPIO2 18
100#define MX23_INT_SAIF1_DMA 19
101#define MX23_INT_SSP2_DMA 20
102#define MX23_INT_ECC8_IRQ 21
103#define MX23_INT_RTC_ALARM 22
104#define MX23_INT_AUART1_TX_DMA 23
105#define MX23_INT_AUART1 24
106#define MX23_INT_AUART1_RX_DMA 25
107#define MX23_INT_I2C_DMA 26
108#define MX23_INT_I2C_ERROR 27
109#define MX23_INT_TIMER0 28
110#define MX23_INT_TIMER1 29
111#define MX23_INT_TIMER2 30
112#define MX23_INT_TIMER3 31
113#define MX23_INT_BATT_BRNOUT 32
114#define MX23_INT_VDDD_BRNOUT 33
115#define MX23_INT_VDDIO_BRNOUT 34
116#define MX23_INT_VDD18_BRNOUT 35
117#define MX23_INT_TOUCH_DETECT 36
118#define MX23_INT_LRADC_CH0 37
119#define MX23_INT_LRADC_CH1 38
120#define MX23_INT_LRADC_CH2 39
121#define MX23_INT_LRADC_CH3 40
122#define MX23_INT_LRADC_CH4 41
123#define MX23_INT_LRADC_CH5 42
124#define MX23_INT_LRADC_CH6 43
125#define MX23_INT_LRADC_CH7 44
126#define MX23_INT_LCDIF_DMA 45
127#define MX23_INT_LCDIF_ERROR 46
128#define MX23_INT_DIGCTL_DEBUG_TRAP 47
129#define MX23_INT_RTC_1MSEC 48
130#define MX23_INT_DRI_DMA 49
131#define MX23_INT_DRI_ATTENTION 50
132#define MX23_INT_GPMI_ATTENTION 51
133#define MX23_INT_IR 52
134#define MX23_INT_DCP_VMI 53
135#define MX23_INT_DCP 54
136#define MX23_INT_BCH 56
137#define MX23_INT_PXP 57
138#define MX23_INT_AUART2_TX_DMA 58
139#define MX23_INT_AUART2 59
140#define MX23_INT_AUART2_RX_DMA 60
141#define MX23_INT_VDAC_DETECT 61
142#define MX23_INT_VDD5V_DROOP 64
143#define MX23_INT_DCDC4P2_BO 65
144
145/*
146 * APBH DMA
147 */
148#define MX23_DMA_SSP1 1
149#define MX23_DMA_SSP2 2
150#define MX23_DMA_GPMI0 4
151#define MX23_DMA_GPMI1 5
152#define MX23_DMA_GPMI2 6
153#define MX23_DMA_GPMI3 7
154
155/*
156 * APBX DMA
157 */
158#define MX23_DMA_ADC 0
159#define MX23_DMA_DAC 1
160#define MX23_DMA_SPDIF 2
161#define MX23_DMA_I2C 3
162#define MX23_DMA_SAIF0 4
163#define MX23_DMA_UART0_RX 6
164#define MX23_DMA_UART0_TX 7
165#define MX23_DMA_UART1_RX 8
166#define MX23_DMA_UART1_TX 9
167#define MX23_DMA_SAIF1 10
168
169#endif /* __MACH_MX23_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/mx28.h b/arch/arm/mach-mxs/include/mach/mx28.h
deleted file mode 100644
index 30c7990f3c01..000000000000
--- a/arch/arm/mach-mxs/include/mach/mx28.h
+++ /dev/null
@@ -1,225 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef __MACH_MX28_H__
20#define __MACH_MX28_H__
21
22#include <mach/mxs.h>
23
24/*
25 * OCRAM
26 */
27#define MX28_OCRAM_BASE_ADDR 0x00000000
28#define MX28_OCRAM_SIZE SZ_128K
29
30/*
31 * IO
32 */
33#define MX28_IO_BASE_ADDR 0x80000000
34#define MX28_IO_SIZE SZ_1M
35
36#define MX28_ICOLL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x000000)
37#define MX28_HSADC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x002000)
38#define MX28_APBH_DMA_BASE_ADDR (MX28_IO_BASE_ADDR + 0x004000)
39#define MX28_PERFMON_BASE_ADDR (MX28_IO_BASE_ADDR + 0x006000)
40#define MX28_BCH_BASE_ADDR (MX28_IO_BASE_ADDR + 0x00a000)
41#define MX28_GPMI_BASE_ADDR (MX28_IO_BASE_ADDR + 0x00c000)
42#define MX28_SSP0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x010000)
43#define MX28_SSP1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x012000)
44#define MX28_SSP2_BASE_ADDR (MX28_IO_BASE_ADDR + 0x014000)
45#define MX28_SSP3_BASE_ADDR (MX28_IO_BASE_ADDR + 0x016000)
46#define MX28_PINCTRL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x018000)
47#define MX28_DIGCTL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x01c000)
48#define MX28_ETM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x022000)
49#define MX28_APBX_DMA_BASE_ADDR (MX28_IO_BASE_ADDR + 0x024000)
50#define MX28_DCP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x028000)
51#define MX28_PXP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02a000)
52#define MX28_OCOTP_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02c000)
53#define MX28_AXI_AHB0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x02e000)
54#define MX28_LCDIF_BASE_ADDR (MX28_IO_BASE_ADDR + 0x030000)
55#define MX28_CAN0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x032000)
56#define MX28_CAN1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x034000)
57#define MX28_SIMDBG_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c000)
58#define MX28_SIMGPMISEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c200)
59#define MX28_SIMSSPSEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c300)
60#define MX28_SIMMEMSEL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c400)
61#define MX28_GPIOMON_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c500)
62#define MX28_SIMENET_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c700)
63#define MX28_ARMJTAG_BASE_ADDR (MX28_IO_BASE_ADDR + 0x03c800)
64#define MX28_CLKCTRL_BASE_ADDR (MX28_IO_BASE_ADDR + 0x040000)
65#define MX28_SAIF0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x042000)
66#define MX28_POWER_BASE_ADDR (MX28_IO_BASE_ADDR + 0x044000)
67#define MX28_SAIF1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x046000)
68#define MX28_LRADC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x050000)
69#define MX28_SPDIF_BASE_ADDR (MX28_IO_BASE_ADDR + 0x054000)
70#define MX28_RTC_BASE_ADDR (MX28_IO_BASE_ADDR + 0x056000)
71#define MX28_I2C0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x058000)
72#define MX28_I2C1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x05a000)
73#define MX28_PWM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x064000)
74#define MX28_TIMROT_BASE_ADDR (MX28_IO_BASE_ADDR + 0x068000)
75#define MX28_AUART0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06a000)
76#define MX28_AUART1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06c000)
77#define MX28_AUART2_BASE_ADDR (MX28_IO_BASE_ADDR + 0x06e000)
78#define MX28_AUART3_BASE_ADDR (MX28_IO_BASE_ADDR + 0x070000)
79#define MX28_AUART4_BASE_ADDR (MX28_IO_BASE_ADDR + 0x072000)
80#define MX28_DUART_BASE_ADDR (MX28_IO_BASE_ADDR + 0x074000)
81#define MX28_USBPHY0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x07C000)
82#define MX28_USBPHY1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x07e000)
83#define MX28_USBCTRL0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x080000)
84#define MX28_USBCTRL1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x090000)
85#define MX28_DFLPT_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0c0000)
86#define MX28_DRAM_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0e0000)
87#define MX28_ENET_MAC0_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0f0000)
88#define MX28_ENET_MAC1_BASE_ADDR (MX28_IO_BASE_ADDR + 0x0f4000)
89
90#define MX28_IO_P2V(x) MXS_IO_P2V(x)
91#define MX28_IO_ADDRESS(x) IOMEM(MX28_IO_P2V(x))
92
93/*
94 * IRQ
95 */
96#define MX28_INT_BATT_BRNOUT 0
97#define MX28_INT_VDDD_BRNOUT 1
98#define MX28_INT_VDDIO_BRNOUT 2
99#define MX28_INT_VDDA_BRNOUT 3
100#define MX28_INT_VDD5V_DROOP 4
101#define MX28_INT_DCDC4P2_BRNOUT 5
102#define MX28_INT_VDD5V 6
103#define MX28_INT_CAN0 8
104#define MX28_INT_CAN1 9
105#define MX28_INT_LRADC_TOUCH 10
106#define MX28_INT_HSADC 13
107#define MX28_INT_LRADC_THRESH0 14
108#define MX28_INT_LRADC_THRESH1 15
109#define MX28_INT_LRADC_CH0 16
110#define MX28_INT_LRADC_CH1 17
111#define MX28_INT_LRADC_CH2 18
112#define MX28_INT_LRADC_CH3 19
113#define MX28_INT_LRADC_CH4 20
114#define MX28_INT_LRADC_CH5 21
115#define MX28_INT_LRADC_CH6 22
116#define MX28_INT_LRADC_CH7 23
117#define MX28_INT_LRADC_BUTTON0 24
118#define MX28_INT_LRADC_BUTTON1 25
119#define MX28_INT_PERFMON 27
120#define MX28_INT_RTC_1MSEC 28
121#define MX28_INT_RTC_ALARM 29
122#define MX28_INT_COMMS 31
123#define MX28_INT_EMI_ERR 32
124#define MX28_INT_LCDIF 38
125#define MX28_INT_PXP 39
126#define MX28_INT_BCH 41
127#define MX28_INT_GPMI 42
128#define MX28_INT_SPDIF_ERROR 45
129#define MX28_INT_DUART 47
130#define MX28_INT_TIMER0 48
131#define MX28_INT_TIMER1 49
132#define MX28_INT_TIMER2 50
133#define MX28_INT_TIMER3 51
134#define MX28_INT_DCP_VMI 52
135#define MX28_INT_DCP 53
136#define MX28_INT_DCP_SECURE 54
137#define MX28_INT_SAIF1 58
138#define MX28_INT_SAIF0 59
139#define MX28_INT_SPDIF_DMA 66
140#define MX28_INT_I2C0_DMA 68
141#define MX28_INT_I2C1_DMA 69
142#define MX28_INT_AUART0_RX_DMA 70
143#define MX28_INT_AUART0_TX_DMA 71
144#define MX28_INT_AUART1_RX_DMA 72
145#define MX28_INT_AUART1_TX_DMA 73
146#define MX28_INT_AUART2_RX_DMA 74
147#define MX28_INT_AUART2_TX_DMA 75
148#define MX28_INT_AUART3_RX_DMA 76
149#define MX28_INT_AUART3_TX_DMA 77
150#define MX28_INT_AUART4_RX_DMA 78
151#define MX28_INT_AUART4_TX_DMA 79
152#define MX28_INT_SAIF0_DMA 80
153#define MX28_INT_SAIF1_DMA 81
154#define MX28_INT_SSP0_DMA 82
155#define MX28_INT_SSP1_DMA 83
156#define MX28_INT_SSP2_DMA 84
157#define MX28_INT_SSP3_DMA 85
158#define MX28_INT_LCDIF_DMA 86
159#define MX28_INT_HSADC_DMA 87
160#define MX28_INT_GPMI_DMA 88
161#define MX28_INT_DIGCTL_DEBUG_TRAP 89
162#define MX28_INT_USB1 92
163#define MX28_INT_USB0 93
164#define MX28_INT_USB1_WAKEUP 94
165#define MX28_INT_USB0_WAKEUP 95
166#define MX28_INT_SSP0_ERROR 96
167#define MX28_INT_SSP1_ERROR 97
168#define MX28_INT_SSP2_ERROR 98
169#define MX28_INT_SSP3_ERROR 99
170#define MX28_INT_ENET_SWI 100
171#define MX28_INT_ENET_MAC0 101
172#define MX28_INT_ENET_MAC1 102
173#define MX28_INT_ENET_MAC0_1588 103
174#define MX28_INT_ENET_MAC1_1588 104
175#define MX28_INT_I2C1_ERROR 110
176#define MX28_INT_I2C0_ERROR 111
177#define MX28_INT_AUART0 112
178#define MX28_INT_AUART1 113
179#define MX28_INT_AUART2 114
180#define MX28_INT_AUART3 115
181#define MX28_INT_AUART4 116
182#define MX28_INT_GPIO4 123
183#define MX28_INT_GPIO3 124
184#define MX28_INT_GPIO2 125
185#define MX28_INT_GPIO1 126
186#define MX28_INT_GPIO0 127
187
188/*
189 * APBH DMA
190 */
191#define MX28_DMA_SSP0 0
192#define MX28_DMA_SSP1 1
193#define MX28_DMA_SSP2 2
194#define MX28_DMA_SSP3 3
195#define MX28_DMA_GPMI0 4
196#define MX28_DMA_GPMI1 5
197#define MX28_DMA_GPMI2 6
198#define MX28_DMA_GPMI3 7
199#define MX28_DMA_GPMI4 8
200#define MX28_DMA_GPMI5 9
201#define MX28_DMA_GPMI6 10
202#define MX28_DMA_GPMI7 11
203#define MX28_DMA_HSADC 12
204#define MX28_DMA_LCDIF 13
205
206/*
207 * APBX DMA
208 */
209#define MX28_DMA_AUART4_RX 0
210#define MX28_DMA_AUART4_TX 1
211#define MX28_DMA_SPDIF_TX 2
212#define MX28_DMA_SAIF0 4
213#define MX28_DMA_SAIF1 5
214#define MX28_DMA_I2C0 6
215#define MX28_DMA_I2C1 7
216#define MX28_DMA_AUART0_RX 8
217#define MX28_DMA_AUART0_TX 9
218#define MX28_DMA_AUART1_RX 10
219#define MX28_DMA_AUART1_TX 11
220#define MX28_DMA_AUART2_RX 12
221#define MX28_DMA_AUART2_TX 13
222#define MX28_DMA_AUART3_RX 14
223#define MX28_DMA_AUART3_TX 15
224
225#endif /* __MACH_MX28_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h
deleted file mode 100644
index 7d4fb6d0afda..000000000000
--- a/arch/arm/mach-mxs/include/mach/mxs.h
+++ /dev/null
@@ -1,117 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef __MACH_MXS_H__
20#define __MACH_MXS_H__
21
22#ifndef __ASSEMBLER__
23#include <linux/io.h>
24#endif
25#include <asm/mach-types.h>
26#include <mach/digctl.h>
27#include <mach/hardware.h>
28
29/*
30 * IO addresses common to MXS-based
31 */
32#define MXS_IO_BASE_ADDR 0x80000000
33#define MXS_IO_SIZE SZ_1M
34
35#define MXS_ICOLL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x000000)
36#define MXS_APBH_DMA_BASE_ADDR (MXS_IO_BASE_ADDR + 0x004000)
37#define MXS_BCH_BASE_ADDR (MXS_IO_BASE_ADDR + 0x00a000)
38#define MXS_GPMI_BASE_ADDR (MXS_IO_BASE_ADDR + 0x00c000)
39#define MXS_PINCTRL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x018000)
40#define MXS_DIGCTL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x01c000)
41#define MXS_APBX_DMA_BASE_ADDR (MXS_IO_BASE_ADDR + 0x024000)
42#define MXS_DCP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x028000)
43#define MXS_PXP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02a000)
44#define MXS_OCOTP_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02c000)
45#define MXS_AXI_AHB0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x02e000)
46#define MXS_LCDIF_BASE_ADDR (MXS_IO_BASE_ADDR + 0x030000)
47#define MXS_CLKCTRL_BASE_ADDR (MXS_IO_BASE_ADDR + 0x040000)
48#define MXS_SAIF0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x042000)
49#define MXS_POWER_BASE_ADDR (MXS_IO_BASE_ADDR + 0x044000)
50#define MXS_SAIF1_BASE_ADDR (MXS_IO_BASE_ADDR + 0x046000)
51#define MXS_LRADC_BASE_ADDR (MXS_IO_BASE_ADDR + 0x050000)
52#define MXS_SPDIF_BASE_ADDR (MXS_IO_BASE_ADDR + 0x054000)
53#define MXS_I2C0_BASE_ADDR (MXS_IO_BASE_ADDR + 0x058000)
54#define MXS_PWM_BASE_ADDR (MXS_IO_BASE_ADDR + 0x064000)
55#define MXS_TIMROT_BASE_ADDR (MXS_IO_BASE_ADDR + 0x068000)
56#define MXS_AUART1_BASE_ADDR (MXS_IO_BASE_ADDR + 0x06c000)
57#define MXS_AUART2_BASE_ADDR (MXS_IO_BASE_ADDR + 0x06e000)
58#define MXS_DRAM_BASE_ADDR (MXS_IO_BASE_ADDR + 0x0e0000)
59
60/*
61 * It maps the whole address space to [0xf4000000, 0xf50fffff].
62 *
63 * OCRAM 0x00000000+0x020000 -> 0xf4000000+0x020000
64 * IO 0x80000000+0x100000 -> 0xf5000000+0x100000
65 */
66#define MXS_IO_P2V(x) (0xf4000000 + \
67 (((x) & 0x80000000) >> 7) + \
68 (((x) & 0x000fffff)))
69
70#define MXS_IO_ADDRESS(x) IOMEM(MXS_IO_P2V(x))
71
72#define mxs_map_entry(soc, name, _type) { \
73 .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR), \
74 .pfn = __phys_to_pfn(soc ## _ ## name ## _BASE_ADDR), \
75 .length = soc ## _ ## name ## _SIZE, \
76 .type = _type, \
77}
78
79#define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr))
80
81#define MXS_SET_ADDR 0x4
82#define MXS_CLR_ADDR 0x8
83#define MXS_TOG_ADDR 0xc
84
85#ifndef __ASSEMBLER__
86static inline void __mxs_setl(u32 mask, void __iomem *reg)
87{
88 __raw_writel(mask, reg + MXS_SET_ADDR);
89}
90
91static inline void __mxs_clrl(u32 mask, void __iomem *reg)
92{
93 __raw_writel(mask, reg + MXS_CLR_ADDR);
94}
95
96static inline void __mxs_togl(u32 mask, void __iomem *reg)
97{
98 __raw_writel(mask, reg + MXS_TOG_ADDR);
99}
100
101/*
102 * MXS CPU types
103 */
104#define MXS_CHIPID (MXS_IO_ADDRESS(MXS_DIGCTL_BASE_ADDR) + HW_DIGCTL_CHIPID)
105
106static inline int cpu_is_mx23(void)
107{
108 return ((__raw_readl(MXS_CHIPID) >> 16) == 0x3780);
109}
110
111static inline int cpu_is_mx28(void)
112{
113 return ((__raw_readl(MXS_CHIPID) >> 16) == 0x2800);
114}
115#endif
116
117#endif /* __MACH_MXS_H__ */
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index e7b781d3788f..f39ab808694d 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -11,122 +11,52 @@
11 */ 11 */
12 12
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/clk/mxs.h>
14#include <linux/clkdev.h> 15#include <linux/clkdev.h>
16#include <linux/clocksource.h>
15#include <linux/can/platform/flexcan.h> 17#include <linux/can/platform/flexcan.h>
16#include <linux/delay.h> 18#include <linux/delay.h>
17#include <linux/err.h> 19#include <linux/err.h>
18#include <linux/gpio.h> 20#include <linux/gpio.h>
19#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/irqchip.h>
23#include <linux/irqchip/mxs.h>
20#include <linux/micrel_phy.h> 24#include <linux/micrel_phy.h>
21#include <linux/mxsfb.h> 25#include <linux/of_address.h>
22#include <linux/of_platform.h> 26#include <linux/of_platform.h>
23#include <linux/phy.h> 27#include <linux/phy.h>
24#include <linux/pinctrl/consumer.h> 28#include <linux/pinctrl/consumer.h>
25#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
26#include <asm/mach/time.h> 31#include <asm/mach/time.h>
27#include <mach/common.h> 32#include <asm/system_misc.h>
28#include <mach/digctl.h>
29#include <mach/mxs.h>
30
31static struct fb_videomode mx23evk_video_modes[] = {
32 {
33 .name = "Samsung-LMS430HF02",
34 .refresh = 60,
35 .xres = 480,
36 .yres = 272,
37 .pixclock = 108096, /* picosecond (9.2 MHz) */
38 .left_margin = 15,
39 .right_margin = 8,
40 .upper_margin = 12,
41 .lower_margin = 4,
42 .hsync_len = 1,
43 .vsync_len = 1,
44 },
45};
46 33
47static struct fb_videomode mx28evk_video_modes[] = { 34/* MXS DIGCTL SAIF CLKMUX */
48 { 35#define MXS_DIGCTL_SAIF_CLKMUX_DIRECT 0x0
49 .name = "Seiko-43WVF1G", 36#define MXS_DIGCTL_SAIF_CLKMUX_CROSSINPUT 0x1
50 .refresh = 60, 37#define MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0 0x2
51 .xres = 800, 38#define MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR1 0x3
52 .yres = 480,
53 .pixclock = 29851, /* picosecond (33.5 MHz) */
54 .left_margin = 89,
55 .right_margin = 164,
56 .upper_margin = 23,
57 .lower_margin = 10,
58 .hsync_len = 10,
59 .vsync_len = 10,
60 },
61};
62 39
63static struct fb_videomode m28evk_video_modes[] = { 40#define MXS_GPIO_NR(bank, nr) ((bank) * 32 + (nr))
64 {
65 .name = "Ampire AM-800480R2TMQW-T01H",
66 .refresh = 60,
67 .xres = 800,
68 .yres = 480,
69 .pixclock = 30066, /* picosecond (33.26 MHz) */
70 .left_margin = 0,
71 .right_margin = 256,
72 .upper_margin = 0,
73 .lower_margin = 45,
74 .hsync_len = 1,
75 .vsync_len = 1,
76 },
77};
78 41
79static struct fb_videomode apx4devkit_video_modes[] = { 42#define MXS_SET_ADDR 0x4
80 { 43#define MXS_CLR_ADDR 0x8
81 .name = "HannStar PJ70112A", 44#define MXS_TOG_ADDR 0xc
82 .refresh = 60,
83 .xres = 800,
84 .yres = 480,
85 .pixclock = 33333, /* picosecond (30.00 MHz) */
86 .left_margin = 88,
87 .right_margin = 40,
88 .upper_margin = 32,
89 .lower_margin = 13,
90 .hsync_len = 48,
91 .vsync_len = 3,
92 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
93 },
94};
95 45
96static struct fb_videomode apf28dev_video_modes[] = { 46static inline void __mxs_setl(u32 mask, void __iomem *reg)
97 { 47{
98 .name = "LW700", 48 __raw_writel(mask, reg + MXS_SET_ADDR);
99 .refresh = 60, 49}
100 .xres = 800,
101 .yres = 480,
102 .pixclock = 30303, /* picosecond */
103 .left_margin = 96,
104 .right_margin = 96, /* at least 3 & 1 */
105 .upper_margin = 0x14,
106 .lower_margin = 0x15,
107 .hsync_len = 64,
108 .vsync_len = 4,
109 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
110 },
111};
112 50
113static struct fb_videomode cfa10049_video_modes[] = { 51static inline void __mxs_clrl(u32 mask, void __iomem *reg)
114 { 52{
115 .name = "Himax HX8357-B", 53 __raw_writel(mask, reg + MXS_CLR_ADDR);
116 .refresh = 60, 54}
117 .xres = 320,
118 .yres = 480,
119 .pixclock = 108506, /* picosecond (9.216 MHz) */
120 .left_margin = 2,
121 .right_margin = 2,
122 .upper_margin = 2,
123 .lower_margin = 2,
124 .hsync_len = 15,
125 .vsync_len = 15,
126 },
127};
128 55
129static struct mxsfb_platform_data mxsfb_pdata __initdata; 56static inline void __mxs_togl(u32 mask, void __iomem *reg)
57{
58 __raw_writel(mask, reg + MXS_TOG_ADDR);
59}
130 60
131/* 61/*
132 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers 62 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
@@ -158,21 +88,85 @@ static void mx28evk_flexcan1_switch(int enable)
158static struct flexcan_platform_data flexcan_pdata[2]; 88static struct flexcan_platform_data flexcan_pdata[2];
159 89
160static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = { 90static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
161 OF_DEV_AUXDATA("fsl,imx23-lcdif", 0x80030000, NULL, &mxsfb_pdata),
162 OF_DEV_AUXDATA("fsl,imx28-lcdif", 0x80030000, NULL, &mxsfb_pdata),
163 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]), 91 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]),
164 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]), 92 OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]),
165 { /* sentinel */ } 93 { /* sentinel */ }
166}; 94};
167 95
168static void __init imx23_timer_init(void) 96#define OCOTP_WORD_OFFSET 0x20
169{ 97#define OCOTP_WORD_COUNT 0x20
170 mx23_clocks_init(); 98
171} 99#define BM_OCOTP_CTRL_BUSY (1 << 8)
100#define BM_OCOTP_CTRL_ERROR (1 << 9)
101#define BM_OCOTP_CTRL_RD_BANK_OPEN (1 << 12)
102
103static DEFINE_MUTEX(ocotp_mutex);
104static u32 ocotp_words[OCOTP_WORD_COUNT];
172 105
173static void __init imx28_timer_init(void) 106static const u32 *mxs_get_ocotp(void)
174{ 107{
175 mx28_clocks_init(); 108 struct device_node *np;
109 void __iomem *ocotp_base;
110 int timeout = 0x400;
111 size_t i;
112 static int once;
113
114 if (once)
115 return ocotp_words;
116
117 np = of_find_compatible_node(NULL, NULL, "fsl,ocotp");
118 ocotp_base = of_iomap(np, 0);
119 WARN_ON(!ocotp_base);
120
121 mutex_lock(&ocotp_mutex);
122
123 /*
124 * clk_enable(hbus_clk) for ocotp can be skipped
125 * as it must be on when system is running.
126 */
127
128 /* try to clear ERROR bit */
129 __mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
130
131 /* check both BUSY and ERROR cleared */
132 while ((__raw_readl(ocotp_base) &
133 (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
134 cpu_relax();
135
136 if (unlikely(!timeout))
137 goto error_unlock;
138
139 /* open OCOTP banks for read */
140 __mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
141
142 /* approximately wait 32 hclk cycles */
143 udelay(1);
144
145 /* poll BUSY bit becoming cleared */
146 timeout = 0x400;
147 while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
148 cpu_relax();
149
150 if (unlikely(!timeout))
151 goto error_unlock;
152
153 for (i = 0; i < OCOTP_WORD_COUNT; i++)
154 ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
155 i * 0x10);
156
157 /* close banks for power saving */
158 __mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
159
160 once = 1;
161
162 mutex_unlock(&ocotp_mutex);
163
164 return ocotp_words;
165
166error_unlock:
167 mutex_unlock(&ocotp_mutex);
168 pr_err("%s: timeout in reading OCOTP\n", __func__);
169 return NULL;
176} 170}
177 171
178enum mac_oui { 172enum mac_oui {
@@ -243,16 +237,6 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
243 } 237 }
244} 238}
245 239
246static void __init imx23_evk_init(void)
247{
248 mxsfb_pdata.mode_list = mx23evk_video_modes;
249 mxsfb_pdata.mode_count = ARRAY_SIZE(mx23evk_video_modes);
250 mxsfb_pdata.default_bpp = 32;
251 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
252 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
253 MXSFB_SYNC_DOTCLK_FAILING_ACT;
254}
255
256static inline void enable_clk_enet_out(void) 240static inline void enable_clk_enet_out(void)
257{ 241{
258 struct clk *clk = clk_get_sys("enet_out", NULL); 242 struct clk *clk = clk_get_sys("enet_out", NULL);
@@ -263,16 +247,8 @@ static inline void enable_clk_enet_out(void)
263 247
264static void __init imx28_evk_init(void) 248static void __init imx28_evk_init(void)
265{ 249{
266 enable_clk_enet_out();
267 update_fec_mac_prop(OUI_FSL); 250 update_fec_mac_prop(OUI_FSL);
268 251
269 mxsfb_pdata.mode_list = mx28evk_video_modes;
270 mxsfb_pdata.mode_count = ARRAY_SIZE(mx28evk_video_modes);
271 mxsfb_pdata.default_bpp = 32;
272 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
273 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
274 MXSFB_SYNC_DOTCLK_FAILING_ACT;
275
276 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0); 252 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
277} 253}
278 254
@@ -285,20 +261,6 @@ static void __init imx28_evk_post_init(void)
285 } 261 }
286} 262}
287 263
288static void __init m28evk_init(void)
289{
290 mxsfb_pdata.mode_list = m28evk_video_modes;
291 mxsfb_pdata.mode_count = ARRAY_SIZE(m28evk_video_modes);
292 mxsfb_pdata.default_bpp = 16;
293 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
294 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
295}
296
297static void __init sc_sps1_init(void)
298{
299 enable_clk_enet_out();
300}
301
302static int apx4devkit_phy_fixup(struct phy_device *phy) 264static int apx4devkit_phy_fixup(struct phy_device *phy)
303{ 265{
304 phy->dev_flags |= MICREL_PHY_50MHZ_CLK; 266 phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
@@ -312,13 +274,6 @@ static void __init apx4devkit_init(void)
312 if (IS_BUILTIN(CONFIG_PHYLIB)) 274 if (IS_BUILTIN(CONFIG_PHYLIB))
313 phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK, 275 phy_register_fixup_for_uid(PHY_ID_KSZ8051, MICREL_PHY_ID_MASK,
314 apx4devkit_phy_fixup); 276 apx4devkit_phy_fixup);
315
316 mxsfb_pdata.mode_list = apx4devkit_video_modes;
317 mxsfb_pdata.mode_count = ARRAY_SIZE(apx4devkit_video_modes);
318 mxsfb_pdata.default_bpp = 32;
319 mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
320 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
321 MXSFB_SYNC_DOTCLK_FAILING_ACT;
322} 277}
323 278
324#define ENET0_MDC__GPIO_4_0 MXS_GPIO_NR(4, 0) 279#define ENET0_MDC__GPIO_4_0 MXS_GPIO_NR(4, 0)
@@ -397,52 +352,24 @@ static void __init tx28_post_init(void)
397 352
398static void __init cfa10049_init(void) 353static void __init cfa10049_init(void)
399{ 354{
400 enable_clk_enet_out();
401 update_fec_mac_prop(OUI_CRYSTALFONTZ); 355 update_fec_mac_prop(OUI_CRYSTALFONTZ);
402
403 mxsfb_pdata.mode_list = cfa10049_video_modes;
404 mxsfb_pdata.mode_count = ARRAY_SIZE(cfa10049_video_modes);
405 mxsfb_pdata.default_bpp = 32;
406 mxsfb_pdata.ld_intf_width = STMLCDIF_18BIT;
407 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
408} 356}
409 357
410static void __init cfa10037_init(void) 358static void __init cfa10037_init(void)
411{ 359{
412 enable_clk_enet_out();
413 update_fec_mac_prop(OUI_CRYSTALFONTZ); 360 update_fec_mac_prop(OUI_CRYSTALFONTZ);
414} 361}
415 362
416static void __init apf28_init(void)
417{
418 enable_clk_enet_out();
419
420 mxsfb_pdata.mode_list = apf28dev_video_modes;
421 mxsfb_pdata.mode_count = ARRAY_SIZE(apf28dev_video_modes);
422 mxsfb_pdata.default_bpp = 16;
423 mxsfb_pdata.ld_intf_width = STMLCDIF_16BIT;
424 mxsfb_pdata.sync = MXSFB_SYNC_DATA_ENABLE_HIGH_ACT |
425 MXSFB_SYNC_DOTCLK_FAILING_ACT;
426}
427
428static void __init mxs_machine_init(void) 363static void __init mxs_machine_init(void)
429{ 364{
430 if (of_machine_is_compatible("fsl,imx28-evk")) 365 if (of_machine_is_compatible("fsl,imx28-evk"))
431 imx28_evk_init(); 366 imx28_evk_init();
432 else if (of_machine_is_compatible("fsl,imx23-evk"))
433 imx23_evk_init();
434 else if (of_machine_is_compatible("denx,m28evk"))
435 m28evk_init();
436 else if (of_machine_is_compatible("bluegiga,apx4devkit")) 367 else if (of_machine_is_compatible("bluegiga,apx4devkit"))
437 apx4devkit_init(); 368 apx4devkit_init();
438 else if (of_machine_is_compatible("crystalfontz,cfa10037")) 369 else if (of_machine_is_compatible("crystalfontz,cfa10037"))
439 cfa10037_init(); 370 cfa10037_init();
440 else if (of_machine_is_compatible("crystalfontz,cfa10049")) 371 else if (of_machine_is_compatible("crystalfontz,cfa10049"))
441 cfa10049_init(); 372 cfa10049_init();
442 else if (of_machine_is_compatible("armadeus,imx28-apf28"))
443 apf28_init();
444 else if (of_machine_is_compatible("schulercontrol,imx28-sps1"))
445 sc_sps1_init();
446 373
447 of_platform_populate(NULL, of_default_bus_match_table, 374 of_platform_populate(NULL, of_default_bus_match_table,
448 mxs_auxdata_lookup, NULL); 375 mxs_auxdata_lookup, NULL);
@@ -454,32 +381,62 @@ static void __init mxs_machine_init(void)
454 imx28_evk_post_init(); 381 imx28_evk_post_init();
455} 382}
456 383
457static const char *imx23_dt_compat[] __initdata = { 384#define MX23_CLKCTRL_RESET_OFFSET 0x120
458 "fsl,imx23", 385#define MX28_CLKCTRL_RESET_OFFSET 0x1e0
459 NULL, 386#define MXS_CLKCTRL_RESET_CHIP (1 << 1)
460}; 387
388/*
389 * Reset the system. It is called by machine_restart().
390 */
391static void mxs_restart(char mode, const char *cmd)
392{
393 struct device_node *np;
394 void __iomem *reset_addr;
395
396 np = of_find_compatible_node(NULL, NULL, "fsl,clkctrl");
397 reset_addr = of_iomap(np, 0);
398 if (!reset_addr)
399 goto soft;
400
401 if (of_device_is_compatible(np, "fsl,imx23-clkctrl"))
402 reset_addr += MX23_CLKCTRL_RESET_OFFSET;
403 else
404 reset_addr += MX28_CLKCTRL_RESET_OFFSET;
405
406 /* reset the chip */
407 __mxs_setl(MXS_CLKCTRL_RESET_CHIP, reset_addr);
408
409 pr_err("Failed to assert the chip reset\n");
410
411 /* Delay to allow the serial port to show the message */
412 mdelay(50);
413
414soft:
415 /* We'll take a jump through zero as a poor second */
416 soft_restart(0);
417}
461 418
462static const char *imx28_dt_compat[] __initdata = { 419static void __init mxs_timer_init(void)
420{
421 if (of_machine_is_compatible("fsl,imx23"))
422 mx23_clocks_init();
423 else
424 mx28_clocks_init();
425 clocksource_of_init();
426}
427
428static const char *mxs_dt_compat[] __initdata = {
463 "fsl,imx28", 429 "fsl,imx28",
430 "fsl,imx23",
464 NULL, 431 NULL,
465}; 432};
466 433
467DT_MACHINE_START(IMX23, "Freescale i.MX23 (Device Tree)") 434DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)")
468 .map_io = mx23_map_io, 435 .map_io = debug_ll_io_init,
469 .init_irq = icoll_init_irq, 436 .init_irq = irqchip_init,
470 .handle_irq = icoll_handle_irq,
471 .init_time = imx23_timer_init,
472 .init_machine = mxs_machine_init,
473 .dt_compat = imx23_dt_compat,
474 .restart = mxs_restart,
475MACHINE_END
476
477DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)")
478 .map_io = mx28_map_io,
479 .init_irq = icoll_init_irq,
480 .handle_irq = icoll_handle_irq, 437 .handle_irq = icoll_handle_irq,
481 .init_time = imx28_timer_init, 438 .init_time = mxs_timer_init,
482 .init_machine = mxs_machine_init, 439 .init_machine = mxs_machine_init,
483 .dt_compat = imx28_dt_compat, 440 .dt_compat = mxs_dt_compat,
484 .restart = mxs_restart, 441 .restart = mxs_restart,
485MACHINE_END 442MACHINE_END
diff --git a/arch/arm/mach-mxs/mm.c b/arch/arm/mach-mxs/mm.c
deleted file mode 100644
index e63b7d87acbd..000000000000
--- a/arch/arm/mach-mxs/mm.c
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
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 * Create static mapping between physical to virtual memory.
12 */
13
14#include <linux/mm.h>
15#include <linux/init.h>
16
17#include <asm/mach/map.h>
18
19#include <mach/mx23.h>
20#include <mach/mx28.h>
21#include <mach/common.h>
22
23/*
24 * Define the MX23 memory map.
25 */
26static struct map_desc mx23_io_desc[] __initdata = {
27 mxs_map_entry(MX23, OCRAM, MT_DEVICE),
28 mxs_map_entry(MX23, IO, MT_DEVICE),
29};
30
31/*
32 * Define the MX28 memory map.
33 */
34static struct map_desc mx28_io_desc[] __initdata = {
35 mxs_map_entry(MX28, OCRAM, MT_DEVICE),
36 mxs_map_entry(MX28, IO, MT_DEVICE),
37};
38
39/*
40 * This function initializes the memory map. It is called during the
41 * system startup to create static physical to virtual memory mappings
42 * for the IO modules.
43 */
44void __init mx23_map_io(void)
45{
46 iotable_init(mx23_io_desc, ARRAY_SIZE(mx23_io_desc));
47}
48
49void __init mx28_map_io(void)
50{
51 iotable_init(mx28_io_desc, ARRAY_SIZE(mx28_io_desc));
52}
diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
deleted file mode 100644
index 1dff46703753..000000000000
--- a/arch/arm/mach-mxs/ocotp.c
+++ /dev/null
@@ -1,93 +0,0 @@
1/*
2 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include <linux/delay.h>
16#include <linux/err.h>
17#include <linux/mutex.h>
18
19#include <asm/processor.h> /* for cpu_relax() */
20
21#include <mach/mxs.h>
22#include <mach/common.h>
23
24#define OCOTP_WORD_OFFSET 0x20
25#define OCOTP_WORD_COUNT 0x20
26
27#define BM_OCOTP_CTRL_BUSY (1 << 8)
28#define BM_OCOTP_CTRL_ERROR (1 << 9)
29#define BM_OCOTP_CTRL_RD_BANK_OPEN (1 << 12)
30
31static DEFINE_MUTEX(ocotp_mutex);
32static u32 ocotp_words[OCOTP_WORD_COUNT];
33
34const u32 *mxs_get_ocotp(void)
35{
36 void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
37 int timeout = 0x400;
38 size_t i;
39 static int once = 0;
40
41 if (once)
42 return ocotp_words;
43
44 mutex_lock(&ocotp_mutex);
45
46 /*
47 * clk_enable(hbus_clk) for ocotp can be skipped
48 * as it must be on when system is running.
49 */
50
51 /* try to clear ERROR bit */
52 __mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
53
54 /* check both BUSY and ERROR cleared */
55 while ((__raw_readl(ocotp_base) &
56 (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
57 cpu_relax();
58
59 if (unlikely(!timeout))
60 goto error_unlock;
61
62 /* open OCOTP banks for read */
63 __mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
64
65 /* approximately wait 32 hclk cycles */
66 udelay(1);
67
68 /* poll BUSY bit becoming cleared */
69 timeout = 0x400;
70 while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
71 cpu_relax();
72
73 if (unlikely(!timeout))
74 goto error_unlock;
75
76 for (i = 0; i < OCOTP_WORD_COUNT; i++)
77 ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
78 i * 0x10);
79
80 /* close banks for power saving */
81 __mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
82
83 once = 1;
84
85 mutex_unlock(&ocotp_mutex);
86
87 return ocotp_words;
88
89error_unlock:
90 mutex_unlock(&ocotp_mutex);
91 pr_err("%s: timeout in reading OCOTP\n", __func__);
92 return NULL;
93}
diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c
deleted file mode 100644
index 30042e23bfa7..000000000000
--- a/arch/arm/mach-mxs/system.c
+++ /dev/null
@@ -1,139 +0,0 @@
1/*
2 * Copyright (C) 1999 ARM Limited
3 * Copyright (C) 2000 Deep Blue Solutions Ltd
4 * Copyright 2006-2007,2010 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
6 * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, yanok@emcraft.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/kernel.h>
20#include <linux/clk.h>
21#include <linux/io.h>
22#include <linux/err.h>
23#include <linux/delay.h>
24#include <linux/init.h>
25#include <linux/module.h>
26
27#include <asm/proc-fns.h>
28#include <asm/system_misc.h>
29
30#include <mach/mxs.h>
31#include <mach/common.h>
32
33#define MX23_CLKCTRL_RESET_OFFSET 0x120
34#define MX28_CLKCTRL_RESET_OFFSET 0x1e0
35#define MXS_CLKCTRL_RESET_CHIP (1 << 1)
36
37#define MXS_MODULE_CLKGATE (1 << 30)
38#define MXS_MODULE_SFTRST (1 << 31)
39
40static void __iomem *mxs_clkctrl_reset_addr;
41
42/*
43 * Reset the system. It is called by machine_restart().
44 */
45void mxs_restart(char mode, const char *cmd)
46{
47 /* reset the chip */
48 __mxs_setl(MXS_CLKCTRL_RESET_CHIP, mxs_clkctrl_reset_addr);
49
50 pr_err("Failed to assert the chip reset\n");
51
52 /* Delay to allow the serial port to show the message */
53 mdelay(50);
54
55 /* We'll take a jump through zero as a poor second */
56 soft_restart(0);
57}
58
59static int __init mxs_arch_reset_init(void)
60{
61 struct clk *clk;
62
63 mxs_clkctrl_reset_addr = MXS_IO_ADDRESS(MXS_CLKCTRL_BASE_ADDR) +
64 (cpu_is_mx23() ? MX23_CLKCTRL_RESET_OFFSET :
65 MX28_CLKCTRL_RESET_OFFSET);
66
67 clk = clk_get_sys("rtc", NULL);
68 if (!IS_ERR(clk))
69 clk_prepare_enable(clk);
70
71 return 0;
72}
73core_initcall(mxs_arch_reset_init);
74
75/*
76 * Clear the bit and poll it cleared. This is usually called with
77 * a reset address and mask being either SFTRST(bit 31) or CLKGATE
78 * (bit 30).
79 */
80static int clear_poll_bit(void __iomem *addr, u32 mask)
81{
82 int timeout = 0x400;
83
84 /* clear the bit */
85 __mxs_clrl(mask, addr);
86
87 /*
88 * SFTRST needs 3 GPMI clocks to settle, the reference manual
89 * recommends to wait 1us.
90 */
91 udelay(1);
92
93 /* poll the bit becoming clear */
94 while ((__raw_readl(addr) & mask) && --timeout)
95 /* nothing */;
96
97 return !timeout;
98}
99
100int mxs_reset_block(void __iomem *reset_addr)
101{
102 int ret;
103 int timeout = 0x400;
104
105 /* clear and poll SFTRST */
106 ret = clear_poll_bit(reset_addr, MXS_MODULE_SFTRST);
107 if (unlikely(ret))
108 goto error;
109
110 /* clear CLKGATE */
111 __mxs_clrl(MXS_MODULE_CLKGATE, reset_addr);
112
113 /* set SFTRST to reset the block */
114 __mxs_setl(MXS_MODULE_SFTRST, reset_addr);
115 udelay(1);
116
117 /* poll CLKGATE becoming set */
118 while ((!(__raw_readl(reset_addr) & MXS_MODULE_CLKGATE)) && --timeout)
119 /* nothing */;
120 if (unlikely(!timeout))
121 goto error;
122
123 /* clear and poll SFTRST */
124 ret = clear_poll_bit(reset_addr, MXS_MODULE_SFTRST);
125 if (unlikely(ret))
126 goto error;
127
128 /* clear and poll CLKGATE */
129 ret = clear_poll_bit(reset_addr, MXS_MODULE_CLKGATE);
130 if (unlikely(ret))
131 goto error;
132
133 return 0;
134
135error:
136 pr_err("%s(%p): module reset timeout\n", __func__, reset_addr);
137 return -ETIMEDOUT;
138}
139EXPORT_SYMBOL(mxs_reset_block);
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 903da8eb886c..cdd05f2e67ee 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -55,12 +55,6 @@ config MACH_OMAP_H3
55 TI OMAP 1710 H3 board support. Say Y here if you have such 55 TI OMAP 1710 H3 board support. Say Y here if you have such
56 a board. 56 a board.
57 57
58config MACH_OMAP_HTCWIZARD
59 bool "HTC Wizard"
60 depends on ARCH_OMAP850
61 help
62 HTC Wizard smartphone support (AKA QTEK 9100, ...)
63
64config MACH_HERALD 58config MACH_HERALD
65 bool "HTC Herald" 59 bool "HTC Herald"
66 depends on ARCH_OMAP850 60 depends on ARCH_OMAP850
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 8111cd9ff3e5..b9c0ed3f648c 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -408,7 +408,7 @@ config OMAP3_SDRC_AC_TIMING
408 408
409config OMAP4_ERRATA_I688 409config OMAP4_ERRATA_I688
410 bool "OMAP4 errata: Async Bridge Corruption" 410 bool "OMAP4 errata: Async Bridge Corruption"
411 depends on ARCH_OMAP4 && !ARCH_MULTIPLATFORM 411 depends on (ARCH_OMAP4 || SOC_OMAP5) && !ARCH_MULTIPLATFORM
412 select ARCH_HAS_BARRIERS 412 select ARCH_HAS_BARRIERS
413 help 413 help
414 If a data is stalled inside asynchronous bridge because of back 414 If a data is stalled inside asynchronous bridge because of back
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index a3e0aaa4886b..cb0596b631cf 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -166,7 +166,7 @@ static void __init sdp2430_display_init(void)
166 omap_display_init(&sdp2430_dss_data); 166 omap_display_init(&sdp2430_dss_data);
167} 167}
168 168
169#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE) 169#if IS_ENABLED(CONFIG_SMC91X)
170 170
171static struct omap_smc91x_platform_data board_smc91x_data = { 171static struct omap_smc91x_platform_data board_smc91x_data = {
172 .cs = 5, 172 .cs = 5,
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index ce812decfaca..7eb9651dd0f7 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -445,16 +445,23 @@ static void enable_board_wakeup_source(void)
445 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); 445 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
446} 446}
447 447
448static struct usbhs_phy_data phy_data[] __initdata = {
449 {
450 .port = 1,
451 .reset_gpio = 57,
452 .vcc_gpio = -EINVAL,
453 },
454 {
455 .port = 2,
456 .reset_gpio = 61,
457 .vcc_gpio = -EINVAL,
458 },
459};
460
448static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 461static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
449 462
450 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 463 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
451 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 464 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
452 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
453
454 .phy_reset = true,
455 .reset_gpio_port[0] = 57,
456 .reset_gpio_port[1] = 61,
457 .reset_gpio_port[2] = -EINVAL
458}; 465};
459 466
460#ifdef CONFIG_OMAP_MUX 467#ifdef CONFIG_OMAP_MUX
@@ -606,6 +613,8 @@ static void __init omap_3430sdp_init(void)
606 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); 613 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
607 sdp3430_display_init(); 614 sdp3430_display_init();
608 enable_board_wakeup_source(); 615 enable_board_wakeup_source();
616
617 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
609 usbhs_init(&usbhs_bdata); 618 usbhs_init(&usbhs_bdata);
610} 619}
611 620
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 67447bd4564f..20d6d8189240 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -53,16 +53,23 @@ static void enable_board_wakeup_source(void)
53 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); 53 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
54} 54}
55 55
56static struct usbhs_phy_data phy_data[] __initdata = {
57 {
58 .port = 1,
59 .reset_gpio = 126,
60 .vcc_gpio = -EINVAL,
61 },
62 {
63 .port = 2,
64 .reset_gpio = 61,
65 .vcc_gpio = -EINVAL,
66 },
67};
68
56static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 69static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
57 70
58 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 71 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
59 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 72 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
60 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
61
62 .phy_reset = true,
63 .reset_gpio_port[0] = 126,
64 .reset_gpio_port[1] = 61,
65 .reset_gpio_port[2] = -EINVAL
66}; 73};
67 74
68#ifdef CONFIG_OMAP_MUX 75#ifdef CONFIG_OMAP_MUX
@@ -199,6 +206,8 @@ static void __init omap_sdp_init(void)
199 board_smc91x_init(); 206 board_smc91x_init();
200 board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16); 207 board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
201 enable_board_wakeup_source(); 208 enable_board_wakeup_source();
209
210 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
202 usbhs_init(&usbhs_bdata); 211 usbhs_init(&usbhs_bdata);
203} 212}
204 213
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 7d3358b2e593..fc53911d0d13 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -47,15 +47,17 @@ static struct omap_board_mux board_mux[] __initdata = {
47}; 47};
48#endif 48#endif
49 49
50static struct usbhs_phy_data phy_data[] __initdata = {
51 {
52 .port = 1,
53 .reset_gpio = GPIO_USB_NRESET,
54 .vcc_gpio = GPIO_USB_POWER,
55 .vcc_polarity = 1,
56 },
57};
58
50static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 59static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
51 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 60 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
52 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
53 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
54
55 .phy_reset = true,
56 .reset_gpio_port[0] = GPIO_USB_NRESET,
57 .reset_gpio_port[1] = -EINVAL,
58 .reset_gpio_port[2] = -EINVAL
59}; 61};
60 62
61static struct mtd_partition crane_nand_partitions[] = { 63static struct mtd_partition crane_nand_partitions[] = {
@@ -131,13 +133,7 @@ static void __init am3517_crane_init(void)
131 return; 133 return;
132 } 134 }
133 135
134 ret = gpio_request_one(GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH, 136 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
135 "usb_ehci_enable");
136 if (ret < 0) {
137 pr_err("Can not request GPIO %d\n", GPIO_USB_POWER);
138 return;
139 }
140
141 usbhs_init(&usbhs_bdata); 137 usbhs_init(&usbhs_bdata);
142 am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1); 138 am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1);
143} 139}
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 9fb85908a61e..191f9762ba63 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -274,6 +274,14 @@ static __init void am3517_evm_mcbsp1_init(void)
274 omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0); 274 omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0);
275} 275}
276 276
277static struct usbhs_phy_data phy_data[] __initdata = {
278 {
279 .port = 1,
280 .reset_gpio = 57,
281 .vcc_gpio = -EINVAL,
282 },
283};
284
277static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 285static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
278 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 286 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
279#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ 287#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
@@ -282,12 +290,6 @@ static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
282#else 290#else
283 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 291 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
284#endif 292#endif
285 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
286
287 .phy_reset = true,
288 .reset_gpio_port[0] = 57,
289 .reset_gpio_port[1] = -EINVAL,
290 .reset_gpio_port[2] = -EINVAL
291}; 293};
292 294
293#ifdef CONFIG_OMAP_MUX 295#ifdef CONFIG_OMAP_MUX
@@ -349,7 +351,6 @@ static struct omap2_hsmmc_info mmc[] = {
349 {} /* Terminator */ 351 {} /* Terminator */
350}; 352};
351 353
352
353static void __init am3517_evm_init(void) 354static void __init am3517_evm_init(void)
354{ 355{
355 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 356 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -361,6 +362,8 @@ static void __init am3517_evm_init(void)
361 362
362 /* Configure GPIO for EHCI port */ 363 /* Configure GPIO for EHCI port */
363 omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); 364 omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
365
366 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
364 usbhs_init(&usbhs_bdata); 367 usbhs_init(&usbhs_bdata);
365 am3517_evm_hecc_init(&am3517_evm_hecc_pdata); 368 am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
366 /* DSS */ 369 /* DSS */
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index af2bb219e214..7fda3f5f8a7f 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -419,15 +419,22 @@ static struct omap2_hsmmc_info mmc[] = {
419 {} /* Terminator */ 419 {} /* Terminator */
420}; 420};
421 421
422static struct usbhs_phy_data phy_data[] __initdata = {
423 {
424 .port = 1,
425 .reset_gpio = OMAP_MAX_GPIO_LINES + 6,
426 .vcc_gpio = -EINVAL,
427 },
428 {
429 .port = 2,
430 .reset_gpio = OMAP_MAX_GPIO_LINES + 7,
431 .vcc_gpio = -EINVAL,
432 },
433};
434
422static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 435static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
423 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 436 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
424 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 437 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
425 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
426
427 .phy_reset = true,
428 .reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6,
429 .reset_gpio_port[1] = OMAP_MAX_GPIO_LINES + 7,
430 .reset_gpio_port[2] = -EINVAL
431}; 438};
432 439
433static void __init cm_t35_init_usbh(void) 440static void __init cm_t35_init_usbh(void)
@@ -444,6 +451,7 @@ static void __init cm_t35_init_usbh(void)
444 msleep(1); 451 msleep(1);
445 } 452 }
446 453
454 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
447 usbhs_init(&usbhs_bdata); 455 usbhs_init(&usbhs_bdata);
448} 456}
449 457
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index a66da808cc4a..6920f6cfc97c 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -188,15 +188,22 @@ static inline void cm_t3517_init_rtc(void) {}
188#define HSUSB2_RESET_GPIO (147) 188#define HSUSB2_RESET_GPIO (147)
189#define USB_HUB_RESET_GPIO (152) 189#define USB_HUB_RESET_GPIO (152)
190 190
191static struct usbhs_phy_data phy_data[] __initdata = {
192 {
193 .port = 1,
194 .reset_gpio = HSUSB1_RESET_GPIO,
195 .vcc_gpio = -EINVAL,
196 },
197 {
198 .port = 2,
199 .reset_gpio = HSUSB2_RESET_GPIO,
200 .vcc_gpio = -EINVAL,
201 },
202};
203
191static struct usbhs_omap_platform_data cm_t3517_ehci_pdata __initdata = { 204static struct usbhs_omap_platform_data cm_t3517_ehci_pdata __initdata = {
192 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 205 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
193 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 206 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
194 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
195
196 .phy_reset = true,
197 .reset_gpio_port[0] = HSUSB1_RESET_GPIO,
198 .reset_gpio_port[1] = HSUSB2_RESET_GPIO,
199 .reset_gpio_port[2] = -EINVAL,
200}; 207};
201 208
202static int __init cm_t3517_init_usbh(void) 209static int __init cm_t3517_init_usbh(void)
@@ -213,6 +220,7 @@ static int __init cm_t3517_init_usbh(void)
213 msleep(1); 220 msleep(1);
214 } 221 }
215 222
223 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
216 usbhs_init(&cm_t3517_ehci_pdata); 224 usbhs_init(&cm_t3517_ehci_pdata);
217 225
218 return 0; 226 return 0;
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 53056c3b0836..42fbf1ef12a9 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -437,15 +437,7 @@ static struct platform_device *devkit8000_devices[] __initdata = {
437}; 437};
438 438
439static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 439static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
440
441 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 440 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
442 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
443 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
444
445 .phy_reset = true,
446 .reset_gpio_port[0] = -EINVAL,
447 .reset_gpio_port[1] = -EINVAL,
448 .reset_gpio_port[2] = -EINVAL
449}; 441};
450 442
451#ifdef CONFIG_OMAP_MUX 443#ifdef CONFIG_OMAP_MUX
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index e54a48060198..afa509afb27c 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -110,6 +110,7 @@ MACHINE_END
110 110
111static const char *omap3_gp_boards_compat[] __initdata = { 111static const char *omap3_gp_boards_compat[] __initdata = {
112 "ti,omap3-beagle", 112 "ti,omap3-beagle",
113 "timll,omap3-devkit8000",
113 NULL, 114 NULL,
114}; 115};
115 116
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 812c829fa46f..5b4ec51c385f 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -246,7 +246,7 @@ static u32 is_gpmc_muxed(void)
246 return 0; 246 return 0;
247} 247}
248 248
249#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE) 249#if IS_ENABLED(CONFIG_SMC91X)
250 250
251static struct omap_smc91x_platform_data board_smc91x_data = { 251static struct omap_smc91x_platform_data board_smc91x_data = {
252 .cs = 1, 252 .cs = 1,
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index bf92678a01d0..95ccec0eeab9 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -527,26 +527,28 @@ static void __init igep_i2c_init(void)
527 omap3_pmic_init("twl4030", &igep_twldata); 527 omap3_pmic_init("twl4030", &igep_twldata);
528} 528}
529 529
530static struct usbhs_phy_data igep2_phy_data[] __initdata = {
531 {
532 .port = 1,
533 .reset_gpio = IGEP2_GPIO_USBH_NRESET,
534 .vcc_gpio = -EINVAL,
535 },
536};
537
538static struct usbhs_phy_data igep3_phy_data[] __initdata = {
539 {
540 .port = 2,
541 .reset_gpio = IGEP3_GPIO_USBH_NRESET,
542 .vcc_gpio = -EINVAL,
543 },
544};
545
530static struct usbhs_omap_platform_data igep2_usbhs_bdata __initdata = { 546static struct usbhs_omap_platform_data igep2_usbhs_bdata __initdata = {
531 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 547 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
532 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
533 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
534
535 .phy_reset = true,
536 .reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
537 .reset_gpio_port[1] = -EINVAL,
538 .reset_gpio_port[2] = -EINVAL,
539}; 548};
540 549
541static struct usbhs_omap_platform_data igep3_usbhs_bdata __initdata = { 550static struct usbhs_omap_platform_data igep3_usbhs_bdata __initdata = {
542 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
543 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 551 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
544 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
545
546 .phy_reset = true,
547 .reset_gpio_port[0] = -EINVAL,
548 .reset_gpio_port[1] = IGEP3_GPIO_USBH_NRESET,
549 .reset_gpio_port[2] = -EINVAL,
550}; 552};
551 553
552#ifdef CONFIG_OMAP_MUX 554#ifdef CONFIG_OMAP_MUX
@@ -642,8 +644,10 @@ static void __init igep_init(void)
642 if (machine_is_igep0020()) { 644 if (machine_is_igep0020()) {
643 omap_display_init(&igep2_dss_data); 645 omap_display_init(&igep2_dss_data);
644 igep2_init_smsc911x(); 646 igep2_init_smsc911x();
647 usbhs_init_phys(igep2_phy_data, ARRAY_SIZE(igep2_phy_data));
645 usbhs_init(&igep2_usbhs_bdata); 648 usbhs_init(&igep2_usbhs_bdata);
646 } else { 649 } else {
650 usbhs_init_phys(igep3_phy_data, ARRAY_SIZE(igep3_phy_data));
647 usbhs_init(&igep3_usbhs_bdata); 651 usbhs_init(&igep3_usbhs_bdata);
648 } 652 }
649} 653}
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index c3558f93d42c..5382215a49bc 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -33,6 +33,7 @@
33#include <linux/mtd/nand.h> 33#include <linux/mtd/nand.h>
34#include <linux/mmc/host.h> 34#include <linux/mmc/host.h>
35#include <linux/usb/phy.h> 35#include <linux/usb/phy.h>
36#include <linux/usb/nop-usb-xceiv.h>
36 37
37#include <linux/regulator/machine.h> 38#include <linux/regulator/machine.h>
38#include <linux/i2c/twl.h> 39#include <linux/i2c/twl.h>
@@ -277,6 +278,21 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = {
277 278
278static struct gpio_led gpio_leds[]; 279static struct gpio_led gpio_leds[];
279 280
281/* PHY's VCC regulator might be added later, so flag that we need it */
282static struct nop_usb_xceiv_platform_data hsusb2_phy_data = {
283 .needs_vcc = true,
284};
285
286static struct usbhs_phy_data phy_data[] = {
287 {
288 .port = 2,
289 .reset_gpio = 147,
290 .vcc_gpio = -1, /* updated in beagle_twl_gpio_setup */
291 .vcc_polarity = 1, /* updated in beagle_twl_gpio_setup */
292 .platform_data = &hsusb2_phy_data,
293 },
294};
295
280static int beagle_twl_gpio_setup(struct device *dev, 296static int beagle_twl_gpio_setup(struct device *dev,
281 unsigned gpio, unsigned ngpio) 297 unsigned gpio, unsigned ngpio)
282{ 298{
@@ -318,9 +334,11 @@ static int beagle_twl_gpio_setup(struct device *dev,
318 } 334 }
319 dvi_panel.power_down_gpio = beagle_config.dvi_pd_gpio; 335 dvi_panel.power_down_gpio = beagle_config.dvi_pd_gpio;
320 336
321 gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level, 337 /* TWL4030_GPIO_MAX i.e. LED_GPO controls HS USB Port 2 power */
322 "nEN_USB_PWR"); 338 phy_data[0].vcc_gpio = gpio + TWL4030_GPIO_MAX;
339 phy_data[0].vcc_polarity = beagle_config.usb_pwr_level;
323 340
341 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
324 return 0; 342 return 0;
325} 343}
326 344
@@ -453,15 +471,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = {
453}; 471};
454 472
455static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 473static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
456
457 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
458 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 474 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
459 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
460
461 .phy_reset = true,
462 .reset_gpio_port[0] = -EINVAL,
463 .reset_gpio_port[1] = 147,
464 .reset_gpio_port[2] = -EINVAL
465}; 475};
466 476
467#ifdef CONFIG_OMAP_MUX 477#ifdef CONFIG_OMAP_MUX
@@ -543,7 +553,9 @@ static void __init omap3_beagle_init(void)
543 553
544 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 554 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
545 usb_musb_init(NULL); 555 usb_musb_init(NULL);
556
546 usbhs_init(&usbhs_bdata); 557 usbhs_init(&usbhs_bdata);
558
547 board_nand_init(omap3beagle_nand_partitions, 559 board_nand_init(omap3beagle_nand_partitions,
548 ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS, 560 ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
549 NAND_BUSWIDTH_16, NULL); 561 NAND_BUSWIDTH_16, NULL);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 48789e0bb915..2de92facc8a3 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -496,7 +496,7 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
496static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = { 496static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = {
497 REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"), /* OMAP ISP */ 497 REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"), /* OMAP ISP */
498 REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"), /* OMAP ISP */ 498 REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"), /* OMAP ISP */
499 REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"), 499 REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"), /* hsusb port 2 */
500 REGULATOR_SUPPLY("vaux2", NULL), 500 REGULATOR_SUPPLY("vaux2", NULL),
501}; 501};
502 502
@@ -539,17 +539,16 @@ static int __init omap3_evm_i2c_init(void)
539 return 0; 539 return 0;
540} 540}
541 541
542static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 542static struct usbhs_phy_data phy_data[] __initdata = {
543 {
544 .port = 2,
545 .reset_gpio = -1, /* set at runtime */
546 .vcc_gpio = -EINVAL,
547 },
548};
543 549
544 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 550static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
545 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 551 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
546 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
547
548 .phy_reset = true,
549 /* PHY reset GPIO will be runtime programmed based on EVM version */
550 .reset_gpio_port[0] = -EINVAL,
551 .reset_gpio_port[1] = -EINVAL,
552 .reset_gpio_port[2] = -EINVAL
553}; 552};
554 553
555#ifdef CONFIG_OMAP_MUX 554#ifdef CONFIG_OMAP_MUX
@@ -725,7 +724,7 @@ static void __init omap3_evm_init(void)
725 724
726 /* setup EHCI phy reset config */ 725 /* setup EHCI phy reset config */
727 omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP); 726 omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
728 usbhs_bdata.reset_gpio_port[1] = 21; 727 phy_data[0].reset_gpio = 21;
729 728
730 /* EVM REV >= E can supply 500mA with EXTVBUS programming */ 729 /* EVM REV >= E can supply 500mA with EXTVBUS programming */
731 musb_board_data.power = 500; 730 musb_board_data.power = 500;
@@ -733,10 +732,12 @@ static void __init omap3_evm_init(void)
733 } else { 732 } else {
734 /* setup EHCI phy reset on MDC */ 733 /* setup EHCI phy reset on MDC */
735 omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); 734 omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
736 usbhs_bdata.reset_gpio_port[1] = 135; 735 phy_data[0].reset_gpio = 135;
737 } 736 }
738 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 737 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
739 usb_musb_init(&musb_board_data); 738 usb_musb_init(&musb_board_data);
739
740 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
740 usbhs_init(&usbhs_bdata); 741 usbhs_init(&usbhs_bdata);
741 board_nand_init(omap3evm_nand_partitions, 742 board_nand_init(omap3evm_nand_partitions,
742 ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS, 743 ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS,
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 2bba362148a0..1004d2aaa68f 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -346,7 +346,7 @@ static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = {
346}; 346};
347 347
348static struct regulator_consumer_supply pandora_usb_phy_supply[] = { 348static struct regulator_consumer_supply pandora_usb_phy_supply[] = {
349 REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"), 349 REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"), /* hsusb port 2 */
350}; 350};
351 351
352/* ads7846 on SPI and 2 nub controllers on I2C */ 352/* ads7846 on SPI and 2 nub controllers on I2C */
@@ -561,6 +561,14 @@ fail:
561 printk(KERN_ERR "wl1251 board initialisation failed\n"); 561 printk(KERN_ERR "wl1251 board initialisation failed\n");
562} 562}
563 563
564static struct usbhs_phy_data phy_data[] __initdata = {
565 {
566 .port = 2,
567 .reset_gpio = 16,
568 .vcc_gpio = -EINVAL,
569 },
570};
571
564static struct platform_device *omap3pandora_devices[] __initdata = { 572static struct platform_device *omap3pandora_devices[] __initdata = {
565 &pandora_leds_gpio, 573 &pandora_leds_gpio,
566 &pandora_keys_gpio, 574 &pandora_keys_gpio,
@@ -569,15 +577,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
569}; 577};
570 578
571static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 579static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
572
573 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
574 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 580 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
575 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
576
577 .phy_reset = true,
578 .reset_gpio_port[0] = -EINVAL,
579 .reset_gpio_port[1] = 16,
580 .reset_gpio_port[2] = -EINVAL
581}; 581};
582 582
583#ifdef CONFIG_OMAP_MUX 583#ifdef CONFIG_OMAP_MUX
@@ -601,7 +601,10 @@ static void __init omap3pandora_init(void)
601 spi_register_board_info(omap3pandora_spi_board_info, 601 spi_register_board_info(omap3pandora_spi_board_info,
602 ARRAY_SIZE(omap3pandora_spi_board_info)); 602 ARRAY_SIZE(omap3pandora_spi_board_info));
603 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); 603 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
604
605 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
604 usbhs_init(&usbhs_bdata); 606 usbhs_init(&usbhs_bdata);
607
605 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 608 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
606 usb_musb_init(NULL); 609 usb_musb_init(NULL);
607 gpmc_nand_init(&pandora_nand_data, NULL); 610 gpmc_nand_init(&pandora_nand_data, NULL);
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 95c10b3aa678..bf0956489899 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -358,19 +358,20 @@ static int __init omap3_stalker_i2c_init(void)
358 358
359#define OMAP3_STALKER_TS_GPIO 175 359#define OMAP3_STALKER_TS_GPIO 175
360 360
361static struct usbhs_phy_data phy_data[] __initdata = {
362 {
363 .port = 2,
364 .reset_gpio = 21,
365 .vcc_gpio = -EINVAL,
366 },
367};
368
361static struct platform_device *omap3_stalker_devices[] __initdata = { 369static struct platform_device *omap3_stalker_devices[] __initdata = {
362 &keys_gpio, 370 &keys_gpio,
363}; 371};
364 372
365static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 373static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
366 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
367 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 374 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
368 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
369
370 .phy_reset = true,
371 .reset_gpio_port[0] = -EINVAL,
372 .reset_gpio_port[1] = 21,
373 .reset_gpio_port[2] = -EINVAL,
374}; 375};
375 376
376#ifdef CONFIG_OMAP_MUX 377#ifdef CONFIG_OMAP_MUX
@@ -407,6 +408,8 @@ static void __init omap3_stalker_init(void)
407 omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL); 408 omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
408 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 409 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
409 usb_musb_init(NULL); 410 usb_musb_init(NULL);
411
412 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
410 usbhs_init(&usbhs_bdata); 413 usbhs_init(&usbhs_bdata);
411 omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL); 414 omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
412 415
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index bcd44fbcd877..7da48bc42bbf 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -305,21 +305,22 @@ static struct omap_board_mux board_mux[] __initdata = {
305}; 305};
306#endif 306#endif
307 307
308static struct usbhs_phy_data phy_data[] __initdata = {
309 {
310 .port = 2,
311 .reset_gpio = 147,
312 .vcc_gpio = -EINVAL,
313 },
314};
315
308static struct platform_device *omap3_touchbook_devices[] __initdata = { 316static struct platform_device *omap3_touchbook_devices[] __initdata = {
309 &leds_gpio, 317 &leds_gpio,
310 &keys_gpio, 318 &keys_gpio,
311}; 319};
312 320
313static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 321static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
314
315 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 322 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
316 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 323 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
317 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
318
319 .phy_reset = true,
320 .reset_gpio_port[0] = -EINVAL,
321 .reset_gpio_port[1] = 147,
322 .reset_gpio_port[2] = -EINVAL
323}; 324};
324 325
325static void omap3_touchbook_poweroff(void) 326static void omap3_touchbook_poweroff(void)
@@ -368,6 +369,8 @@ static void __init omap3_touchbook_init(void)
368 omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata); 369 omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
369 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 370 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
370 usb_musb_init(NULL); 371 usb_musb_init(NULL);
372
373 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
371 usbhs_init(&usbhs_bdata); 374 usbhs_init(&usbhs_bdata);
372 board_nand_init(omap3touchbook_nand_partitions, 375 board_nand_init(omap3touchbook_nand_partitions,
373 ARRAY_SIZE(omap3touchbook_nand_partitions), NAND_CS, 376 ARRAY_SIZE(omap3touchbook_nand_partitions), NAND_CS,
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index b02c2f00609b..a71ad345f20d 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -31,6 +31,7 @@
31#include <linux/ti_wilink_st.h> 31#include <linux/ti_wilink_st.h>
32#include <linux/usb/musb.h> 32#include <linux/usb/musb.h>
33#include <linux/usb/phy.h> 33#include <linux/usb/phy.h>
34#include <linux/usb/nop-usb-xceiv.h>
34#include <linux/wl12xx.h> 35#include <linux/wl12xx.h>
35#include <linux/irqchip/arm-gic.h> 36#include <linux/irqchip/arm-gic.h>
36#include <linux/platform_data/omap-abe-twl6040.h> 37#include <linux/platform_data/omap-abe-twl6040.h>
@@ -132,6 +133,22 @@ static struct platform_device btwilink_device = {
132 .id = -1, 133 .id = -1,
133}; 134};
134 135
136/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
137static struct nop_usb_xceiv_platform_data hsusb1_phy_data = {
138 /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
139 .clk_rate = 19200000,
140};
141
142static struct usbhs_phy_data phy_data[] __initdata = {
143 {
144 .port = 1,
145 .reset_gpio = GPIO_HUB_NRESET,
146 .vcc_gpio = GPIO_HUB_POWER,
147 .vcc_polarity = 1,
148 .platform_data = &hsusb1_phy_data,
149 },
150};
151
135static struct platform_device *panda_devices[] __initdata = { 152static struct platform_device *panda_devices[] __initdata = {
136 &leds_gpio, 153 &leds_gpio,
137 &wl1271_device, 154 &wl1271_device,
@@ -142,49 +159,19 @@ static struct platform_device *panda_devices[] __initdata = {
142 159
143static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 160static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
144 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 161 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
145 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
146 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
147 .phy_reset = false,
148 .reset_gpio_port[0] = -EINVAL,
149 .reset_gpio_port[1] = -EINVAL,
150 .reset_gpio_port[2] = -EINVAL
151};
152
153static struct gpio panda_ehci_gpios[] __initdata = {
154 { GPIO_HUB_POWER, GPIOF_OUT_INIT_LOW, "hub_power" },
155 { GPIO_HUB_NRESET, GPIOF_OUT_INIT_LOW, "hub_nreset" },
156}; 162};
157 163
158static void __init omap4_ehci_init(void) 164static void __init omap4_ehci_init(void)
159{ 165{
160 int ret; 166 int ret;
161 struct clk *phy_ref_clk;
162 167
163 /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */ 168 /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
164 phy_ref_clk = clk_get(NULL, "auxclk3_ck"); 169 ret = clk_add_alias("main_clk", "nop_usb_xceiv.1", "auxclk3_ck", NULL);
165 if (IS_ERR(phy_ref_clk)) { 170 if (ret)
166 pr_err("Cannot request auxclk3\n"); 171 pr_err("Failed to add main_clk alias to auxclk3_ck\n");
167 return;
168 }
169 clk_set_rate(phy_ref_clk, 19200000);
170 clk_prepare_enable(phy_ref_clk);
171
172 /* disable the power to the usb hub prior to init and reset phy+hub */
173 ret = gpio_request_array(panda_ehci_gpios,
174 ARRAY_SIZE(panda_ehci_gpios));
175 if (ret) {
176 pr_err("Unable to initialize EHCI power/reset\n");
177 return;
178 }
179
180 gpio_export(GPIO_HUB_POWER, 0);
181 gpio_export(GPIO_HUB_NRESET, 0);
182 gpio_set_value(GPIO_HUB_NRESET, 1);
183 172
173 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
184 usbhs_init(&usbhs_bdata); 174 usbhs_init(&usbhs_bdata);
185
186 /* enable power to hub */
187 gpio_set_value(GPIO_HUB_POWER, 1);
188} 175}
189 176
190static struct omap_musb_board_data musb_board_data = { 177static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 86bab51154ee..ab79a4422bcc 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -458,14 +458,16 @@ static int __init overo_spi_init(void)
458 return 0; 458 return 0;
459} 459}
460 460
461static struct usbhs_phy_data phy_data[] __initdata = {
462 {
463 .port = 2,
464 .reset_gpio = OVERO_GPIO_USBH_NRESET,
465 .vcc_gpio = -EINVAL,
466 },
467};
468
461static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 469static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
462 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
463 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 470 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
464 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
465 .phy_reset = true,
466 .reset_gpio_port[0] = -EINVAL,
467 .reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET,
468 .reset_gpio_port[2] = -EINVAL
469}; 471};
470 472
471#ifdef CONFIG_OMAP_MUX 473#ifdef CONFIG_OMAP_MUX
@@ -502,6 +504,8 @@ static void __init overo_init(void)
502 ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL); 504 ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
503 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); 505 usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
504 usb_musb_init(NULL); 506 usb_musb_init(NULL);
507
508 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
505 usbhs_init(&usbhs_bdata); 509 usbhs_init(&usbhs_bdata);
506 overo_spi_init(); 510 overo_spi_init();
507 overo_init_smsc911x(); 511 overo_init_smsc911x();
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 5e4d4c9fe61a..1a3dd865d8eb 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -92,14 +92,16 @@ static struct mtd_partition zoom_nand_partitions[] = {
92 }, 92 },
93}; 93};
94 94
95static struct usbhs_phy_data phy_data[] __initdata = {
96 {
97 .port = 2,
98 .reset_gpio = ZOOM3_EHCI_RESET_GPIO,
99 .vcc_gpio = -EINVAL,
100 },
101};
102
95static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 103static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
96 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
97 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 104 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
98 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
99 .phy_reset = true,
100 .reset_gpio_port[0] = -EINVAL,
101 .reset_gpio_port[1] = ZOOM3_EHCI_RESET_GPIO,
102 .reset_gpio_port[2] = -EINVAL,
103}; 105};
104 106
105static void __init omap_zoom_init(void) 107static void __init omap_zoom_init(void)
@@ -109,6 +111,8 @@ static void __init omap_zoom_init(void)
109 } else if (machine_is_omap_zoom3()) { 111 } else if (machine_is_omap_zoom3()) {
110 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); 112 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
111 omap_mux_init_gpio(ZOOM3_EHCI_RESET_GPIO, OMAP_PIN_OUTPUT); 113 omap_mux_init_gpio(ZOOM3_EHCI_RESET_GPIO, OMAP_PIN_OUTPUT);
114
115 usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
112 usbhs_init(&usbhs_bdata); 116 usbhs_init(&usbhs_bdata);
113 } 117 }
114 118
diff --git a/arch/arm/mach-omap2/cclock33xx_data.c b/arch/arm/mach-omap2/cclock33xx_data.c
index 476b82066cb6..7f091c85384e 100644
--- a/arch/arm/mach-omap2/cclock33xx_data.c
+++ b/arch/arm/mach-omap2/cclock33xx_data.c
@@ -958,6 +958,14 @@ int __init am33xx_clk_init(void)
958 958
959 clk_set_parent(&timer3_fck, &sys_clkin_ck); 959 clk_set_parent(&timer3_fck, &sys_clkin_ck);
960 clk_set_parent(&timer6_fck, &sys_clkin_ck); 960 clk_set_parent(&timer6_fck, &sys_clkin_ck);
961 /*
962 * The On-Chip 32K RC Osc clock is not an accurate clock-source as per
963 * the design/spec, so as a result, for example, timer which supposed
964 * to get expired @60Sec, but will expire somewhere ~@40Sec, which is
965 * not expected by any use-case, so change WDT1 clock source to PRCM
966 * 32KHz clock.
967 */
968 clk_set_parent(&wdt1_fck, &clkdiv32k_ick);
961 969
962 return 0; 970 return 0;
963} 971}
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index 3aed4b0b9563..3a0296cfcace 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -307,10 +307,10 @@ static int omap3_noncore_dpll_program(struct clk_hw_omap *clk, u16 freqsel)
307 _omap3_noncore_dpll_bypass(clk); 307 _omap3_noncore_dpll_bypass(clk);
308 308
309 /* 309 /*
310 * Set jitter correction. No jitter correction for OMAP4 and 3630 310 * Set jitter correction. Jitter correction applicable for OMAP343X
311 * since freqsel field is no longer present 311 * only since freqsel field is no longer present on other devices.
312 */ 312 */
313 if (!soc_is_am33xx() && !cpu_is_omap44xx() && !cpu_is_omap3630()) { 313 if (cpu_is_omap343x()) {
314 v = __raw_readl(dd->control_reg); 314 v = __raw_readl(dd->control_reg);
315 v &= ~dd->freqsel_mask; 315 v &= ~dd->freqsel_mask;
316 v |= freqsel << __ffs(dd->freqsel_mask); 316 v |= freqsel << __ffs(dd->freqsel_mask);
@@ -480,29 +480,30 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
480 if (!dd) 480 if (!dd)
481 return -EINVAL; 481 return -EINVAL;
482 482
483 __clk_prepare(dd->clk_bypass);
484 clk_enable(dd->clk_bypass);
485 __clk_prepare(dd->clk_ref);
486 clk_enable(dd->clk_ref);
487
488 if (__clk_get_rate(dd->clk_bypass) == rate && 483 if (__clk_get_rate(dd->clk_bypass) == rate &&
489 (dd->modes & (1 << DPLL_LOW_POWER_BYPASS))) { 484 (dd->modes & (1 << DPLL_LOW_POWER_BYPASS))) {
490 pr_debug("%s: %s: set rate: entering bypass.\n", 485 pr_debug("%s: %s: set rate: entering bypass.\n",
491 __func__, __clk_get_name(hw->clk)); 486 __func__, __clk_get_name(hw->clk));
492 487
488 __clk_prepare(dd->clk_bypass);
489 clk_enable(dd->clk_bypass);
493 ret = _omap3_noncore_dpll_bypass(clk); 490 ret = _omap3_noncore_dpll_bypass(clk);
494 if (!ret) 491 if (!ret)
495 new_parent = dd->clk_bypass; 492 new_parent = dd->clk_bypass;
493 clk_disable(dd->clk_bypass);
494 __clk_unprepare(dd->clk_bypass);
496 } else { 495 } else {
496 __clk_prepare(dd->clk_ref);
497 clk_enable(dd->clk_ref);
498
497 if (dd->last_rounded_rate != rate) 499 if (dd->last_rounded_rate != rate)
498 rate = __clk_round_rate(hw->clk, rate); 500 rate = __clk_round_rate(hw->clk, rate);
499 501
500 if (dd->last_rounded_rate == 0) 502 if (dd->last_rounded_rate == 0)
501 return -EINVAL; 503 return -EINVAL;
502 504
503 /* No freqsel on AM335x, OMAP4 and OMAP3630 */ 505 /* Freqsel is available only on OMAP343X devices */
504 if (!soc_is_am33xx() && !cpu_is_omap44xx() && 506 if (cpu_is_omap343x()) {
505 !cpu_is_omap3630()) {
506 freqsel = _omap3_dpll_compute_freqsel(clk, 507 freqsel = _omap3_dpll_compute_freqsel(clk,
507 dd->last_rounded_n); 508 dd->last_rounded_n);
508 WARN_ON(!freqsel); 509 WARN_ON(!freqsel);
@@ -514,6 +515,8 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
514 ret = omap3_noncore_dpll_program(clk, freqsel); 515 ret = omap3_noncore_dpll_program(clk, freqsel);
515 if (!ret) 516 if (!ret)
516 new_parent = dd->clk_ref; 517 new_parent = dd->clk_ref;
518 clk_disable(dd->clk_ref);
519 __clk_unprepare(dd->clk_ref);
517 } 520 }
518 /* 521 /*
519 * FIXME - this is all wrong. common code handles reparenting and 522 * FIXME - this is all wrong. common code handles reparenting and
@@ -525,11 +528,6 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
525 if (!ret) 528 if (!ret)
526 __clk_reparent(hw->clk, new_parent); 529 __clk_reparent(hw->clk, new_parent);
527 530
528 clk_disable(dd->clk_ref);
529 __clk_unprepare(dd->clk_ref);
530 clk_disable(dd->clk_bypass);
531 __clk_unprepare(dd->clk_bypass);
532
533 return 0; 531 return 0;
534} 532}
535 533
diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c
index b155500e84a8..b8208b4b1bd9 100644
--- a/arch/arm/mach-omap2/dsp.c
+++ b/arch/arm/mach-omap2/dsp.c
@@ -26,7 +26,7 @@
26#include "control.h" 26#include "control.h"
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_TIDSPBRIDGE_DVFS
30#include "omap-pm.h" 30#include "omap-pm.h"
31#endif 31#endif
32 32
@@ -35,7 +35,7 @@
35static struct platform_device *omap_dsp_pdev; 35static struct platform_device *omap_dsp_pdev;
36 36
37static struct omap_dsp_platform_data omap_dsp_pdata __initdata = { 37static struct omap_dsp_platform_data omap_dsp_pdata __initdata = {
38#ifdef CONFIG_BRIDGE_DVFS 38#ifdef CONFIG_TIDSPBRIDGE_DVFS
39 .dsp_set_min_opp = omap_pm_dsp_set_min_opp, 39 .dsp_set_min_opp = omap_pm_dsp_set_min_opp,
40 .dsp_get_opp = omap_pm_dsp_get_opp, 40 .dsp_get_opp = omap_pm_dsp_get_opp,
41 .cpu_set_freq = omap_pm_cpu_set_freq, 41 .cpu_set_freq = omap_pm_cpu_set_freq,
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 8a68f1ec66b9..ff0bc9e51aa7 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -529,22 +529,28 @@ void __init omap5xxx_check_revision(void)
529 case 0xb942: 529 case 0xb942:
530 switch (rev) { 530 switch (rev) {
531 case 0: 531 case 0:
532 default:
533 omap_revision = OMAP5430_REV_ES1_0; 532 omap_revision = OMAP5430_REV_ES1_0;
533 break;
534 case 1:
535 default:
536 omap_revision = OMAP5430_REV_ES2_0;
534 } 537 }
535 break; 538 break;
536 539
537 case 0xb998: 540 case 0xb998:
538 switch (rev) { 541 switch (rev) {
539 case 0: 542 case 0:
540 default:
541 omap_revision = OMAP5432_REV_ES1_0; 543 omap_revision = OMAP5432_REV_ES1_0;
544 break;
545 case 1:
546 default:
547 omap_revision = OMAP5432_REV_ES2_0;
542 } 548 }
543 break; 549 break;
544 550
545 default: 551 default:
546 /* Unknown default to latest silicon rev as default*/ 552 /* Unknown default to latest silicon rev as default*/
547 omap_revision = OMAP5430_REV_ES1_0; 553 omap_revision = OMAP5430_REV_ES2_0;
548 } 554 }
549 555
550 pr_info("OMAP%04x ES%d.0\n", 556 pr_info("OMAP%04x ES%d.0\n",
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 5c445ca1e271..e210fa830f8d 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -277,6 +277,14 @@ static struct map_desc omap54xx_io_desc[] __initdata = {
277 .length = L4_PER_54XX_SIZE, 277 .length = L4_PER_54XX_SIZE,
278 .type = MT_DEVICE, 278 .type = MT_DEVICE,
279 }, 279 },
280#ifdef CONFIG_OMAP4_ERRATA_I688
281 {
282 .virtual = OMAP4_SRAM_VA,
283 .pfn = __phys_to_pfn(OMAP4_SRAM_PA),
284 .length = PAGE_SIZE,
285 .type = MT_MEMORY_SO,
286 },
287#endif
280}; 288};
281#endif 289#endif
282 290
@@ -329,6 +337,7 @@ void __init omap4_map_io(void)
329void __init omap5_map_io(void) 337void __init omap5_map_io(void)
330{ 338{
331 iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc)); 339 iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc));
340 omap_barriers_init();
332} 341}
333#endif 342#endif
334/* 343/*
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 708bb115a27f..2aeb928efdfd 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -240,15 +240,21 @@ void __iomem *omap4_get_sar_ram_base(void)
240 */ 240 */
241static int __init omap4_sar_ram_init(void) 241static int __init omap4_sar_ram_init(void)
242{ 242{
243 unsigned long sar_base;
244
243 /* 245 /*
244 * To avoid code running on other OMAPs in 246 * To avoid code running on other OMAPs in
245 * multi-omap builds 247 * multi-omap builds
246 */ 248 */
247 if (!cpu_is_omap44xx()) 249 if (cpu_is_omap44xx())
250 sar_base = OMAP44XX_SAR_RAM_BASE;
251 else if (soc_is_omap54xx())
252 sar_base = OMAP54XX_SAR_RAM_BASE;
253 else
248 return -ENOMEM; 254 return -ENOMEM;
249 255
250 /* Static mapping, never released */ 256 /* Static mapping, never released */
251 sar_ram_base = ioremap(OMAP44XX_SAR_RAM_BASE, SZ_16K); 257 sar_ram_base = ioremap(sar_base, SZ_16K);
252 if (WARN_ON(!sar_ram_base)) 258 if (WARN_ON(!sar_ram_base))
253 return -ENOMEM; 259 return -ENOMEM;
254 260
diff --git a/arch/arm/mach-omap2/omap4-sar-layout.h b/arch/arm/mach-omap2/omap4-sar-layout.h
index e170fe803b04..937417523b8e 100644
--- a/arch/arm/mach-omap2/omap4-sar-layout.h
+++ b/arch/arm/mach-omap2/omap4-sar-layout.h
@@ -48,13 +48,13 @@
48#define SAR_BACKUP_STATUS_WAKEUPGEN 0x10 48#define SAR_BACKUP_STATUS_WAKEUPGEN 0x10
49 49
50/* WakeUpGen save restore offset from OMAP54XX_SAR_RAM_BASE */ 50/* WakeUpGen save restore offset from OMAP54XX_SAR_RAM_BASE */
51#define OMAP5_WAKEUPGENENB_OFFSET_CPU0 (SAR_BANK3_OFFSET + 0x8d4) 51#define OMAP5_WAKEUPGENENB_OFFSET_CPU0 (SAR_BANK3_OFFSET + 0x9dc)
52#define OMAP5_WAKEUPGENENB_SECURE_OFFSET_CPU0 (SAR_BANK3_OFFSET + 0x8e8) 52#define OMAP5_WAKEUPGENENB_SECURE_OFFSET_CPU0 (SAR_BANK3_OFFSET + 0x9f0)
53#define OMAP5_WAKEUPGENENB_OFFSET_CPU1 (SAR_BANK3_OFFSET + 0x8fc) 53#define OMAP5_WAKEUPGENENB_OFFSET_CPU1 (SAR_BANK3_OFFSET + 0xa04)
54#define OMAP5_WAKEUPGENENB_SECURE_OFFSET_CPU1 (SAR_BANK3_OFFSET + 0x910) 54#define OMAP5_WAKEUPGENENB_SECURE_OFFSET_CPU1 (SAR_BANK3_OFFSET + 0xa18)
55#define OMAP5_AUXCOREBOOT0_OFFSET (SAR_BANK3_OFFSET + 0x924) 55#define OMAP5_AUXCOREBOOT0_OFFSET (SAR_BANK3_OFFSET + 0xa2c)
56#define OMAP5_AUXCOREBOOT1_OFFSET (SAR_BANK3_OFFSET + 0x928) 56#define OMAP5_AUXCOREBOOT1_OFFSET (SAR_BANK3_OFFSET + 0x930)
57#define OMAP5_AMBA_IF_MODE_OFFSET (SAR_BANK3_OFFSET + 0x92c) 57#define OMAP5_AMBA_IF_MODE_OFFSET (SAR_BANK3_OFFSET + 0xa34)
58#define OMAP5_SAR_BACKUP_STATUS_OFFSET (SAR_BANK3_OFFSET + 0x800) 58#define OMAP5_SAR_BACKUP_STATUS_OFFSET (SAR_BANK3_OFFSET + 0x800)
59 59
60#endif 60#endif
diff --git a/arch/arm/mach-omap2/omap54xx.h b/arch/arm/mach-omap2/omap54xx.h
index a2582bb3cab3..a086ba15868b 100644
--- a/arch/arm/mach-omap2/omap54xx.h
+++ b/arch/arm/mach-omap2/omap54xx.h
@@ -28,5 +28,6 @@
28#define OMAP54XX_PRCM_MPU_BASE 0x48243000 28#define OMAP54XX_PRCM_MPU_BASE 0x48243000
29#define OMAP54XX_SCM_BASE 0x4a002000 29#define OMAP54XX_SCM_BASE 0x4a002000
30#define OMAP54XX_CTRL_BASE 0x4a002800 30#define OMAP54XX_CTRL_BASE 0x4a002800
31#define OMAP54XX_SAR_RAM_BASE 0x4ae26000
31 32
32#endif /* __ASM_SOC_OMAP555554XX_H */ 33#endif /* __ASM_SOC_OMAP555554XX_H */
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index a202a4785104..39771c12d8b6 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -138,6 +138,8 @@
138#include <linux/spinlock.h> 138#include <linux/spinlock.h>
139#include <linux/slab.h> 139#include <linux/slab.h>
140#include <linux/bootmem.h> 140#include <linux/bootmem.h>
141#include <linux/of.h>
142#include <linux/of_address.h>
141 143
142#include <asm/system_misc.h> 144#include <asm/system_misc.h>
143 145
@@ -610,8 +612,6 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
610 612
611 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 613 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
612 614
613 oh->_int_flags |= _HWMOD_WAKEUP_ENABLED;
614
615 return 0; 615 return 0;
616} 616}
617 617
@@ -645,8 +645,6 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
645 645
646 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 646 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
647 647
648 oh->_int_flags &= ~_HWMOD_WAKEUP_ENABLED;
649
650 return 0; 648 return 0;
651} 649}
652 650
@@ -2353,6 +2351,34 @@ static int _shutdown(struct omap_hwmod *oh)
2353} 2351}
2354 2352
2355/** 2353/**
2354 * of_dev_hwmod_lookup - look up needed hwmod from dt blob
2355 * @np: struct device_node *
2356 * @oh: struct omap_hwmod *
2357 *
2358 * Parse the dt blob and find out needed hwmod. Recursive function is
2359 * implemented to take care hierarchical dt blob parsing.
2360 * Return: The device node on success or NULL on failure.
2361 */
2362static struct device_node *of_dev_hwmod_lookup(struct device_node *np,
2363 struct omap_hwmod *oh)
2364{
2365 struct device_node *np0 = NULL, *np1 = NULL;
2366 const char *p;
2367
2368 for_each_child_of_node(np, np0) {
2369 if (of_find_property(np0, "ti,hwmods", NULL)) {
2370 p = of_get_property(np0, "ti,hwmods", NULL);
2371 if (!strcmp(p, oh->name))
2372 return np0;
2373 np1 = of_dev_hwmod_lookup(np0, oh);
2374 if (np1)
2375 return np1;
2376 }
2377 }
2378 return NULL;
2379}
2380
2381/**
2356 * _init_mpu_rt_base - populate the virtual address for a hwmod 2382 * _init_mpu_rt_base - populate the virtual address for a hwmod
2357 * @oh: struct omap_hwmod * to locate the virtual address 2383 * @oh: struct omap_hwmod * to locate the virtual address
2358 * 2384 *
@@ -2364,7 +2390,8 @@ static int _shutdown(struct omap_hwmod *oh)
2364static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data) 2390static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
2365{ 2391{
2366 struct omap_hwmod_addr_space *mem; 2392 struct omap_hwmod_addr_space *mem;
2367 void __iomem *va_start; 2393 void __iomem *va_start = NULL;
2394 struct device_node *np;
2368 2395
2369 if (!oh) 2396 if (!oh)
2370 return; 2397 return;
@@ -2378,10 +2405,18 @@ static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
2378 if (!mem) { 2405 if (!mem) {
2379 pr_debug("omap_hwmod: %s: no MPU register target found\n", 2406 pr_debug("omap_hwmod: %s: no MPU register target found\n",
2380 oh->name); 2407 oh->name);
2381 return; 2408
2409 /* Extract the IO space from device tree blob */
2410 if (!of_have_populated_dt())
2411 return;
2412
2413 np = of_dev_hwmod_lookup(of_find_node_by_name(NULL, "ocp"), oh);
2414 if (np)
2415 va_start = of_iomap(np, 0);
2416 } else {
2417 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
2382 } 2418 }
2383 2419
2384 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
2385 if (!va_start) { 2420 if (!va_start) {
2386 pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name); 2421 pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name);
2387 return; 2422 return;
@@ -2413,7 +2448,8 @@ static int __init _init(struct omap_hwmod *oh, void *data)
2413 if (oh->_state != _HWMOD_STATE_REGISTERED) 2448 if (oh->_state != _HWMOD_STATE_REGISTERED)
2414 return 0; 2449 return 0;
2415 2450
2416 _init_mpu_rt_base(oh, NULL); 2451 if (oh->class->sysc)
2452 _init_mpu_rt_base(oh, NULL);
2417 2453
2418 r = _init_clocks(oh, NULL); 2454 r = _init_clocks(oh, NULL);
2419 if (IS_ERR_VALUE(r)) { 2455 if (IS_ERR_VALUE(r)) {
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index d5dc935f6060..fe5962921f07 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -482,15 +482,13 @@ struct omap_hwmod_omap4_prcm {
482 * These are for internal use only and are managed by the omap_hwmod code. 482 * These are for internal use only and are managed by the omap_hwmod code.
483 * 483 *
484 * _HWMOD_NO_MPU_PORT: no path exists for the MPU to write to this module 484 * _HWMOD_NO_MPU_PORT: no path exists for the MPU to write to this module
485 * _HWMOD_WAKEUP_ENABLED: set when the omap_hwmod code has enabled ENAWAKEUP
486 * _HWMOD_SYSCONFIG_LOADED: set when the OCP_SYSCONFIG value has been cached 485 * _HWMOD_SYSCONFIG_LOADED: set when the OCP_SYSCONFIG value has been cached
487 * _HWMOD_SKIP_ENABLE: set if hwmod enabled during init (HWMOD_INIT_NO_IDLE) - 486 * _HWMOD_SKIP_ENABLE: set if hwmod enabled during init (HWMOD_INIT_NO_IDLE) -
488 * causes the first call to _enable() to only update the pinmux 487 * causes the first call to _enable() to only update the pinmux
489 */ 488 */
490#define _HWMOD_NO_MPU_PORT (1 << 0) 489#define _HWMOD_NO_MPU_PORT (1 << 0)
491#define _HWMOD_WAKEUP_ENABLED (1 << 1) 490#define _HWMOD_SYSCONFIG_LOADED (1 << 1)
492#define _HWMOD_SYSCONFIG_LOADED (1 << 2) 491#define _HWMOD_SKIP_ENABLE (1 << 2)
493#define _HWMOD_SKIP_ENABLE (1 << 3)
494 492
495/* 493/*
496 * omap_hwmod._state definitions 494 * omap_hwmod._state definitions
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index 26eee4a556ad..31bea1ce3de1 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -28,6 +28,7 @@
28#include "prm-regbits-33xx.h" 28#include "prm-regbits-33xx.h"
29#include "i2c.h" 29#include "i2c.h"
30#include "mmc.h" 30#include "mmc.h"
31#include "wd_timer.h"
31 32
32/* 33/*
33 * IP blocks 34 * IP blocks
@@ -2087,8 +2088,21 @@ static struct omap_hwmod am33xx_uart6_hwmod = {
2087}; 2088};
2088 2089
2089/* 'wd_timer' class */ 2090/* 'wd_timer' class */
2091static struct omap_hwmod_class_sysconfig wdt_sysc = {
2092 .rev_offs = 0x0,
2093 .sysc_offs = 0x10,
2094 .syss_offs = 0x14,
2095 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SIDLEMODE |
2096 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
2097 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2098 SIDLE_SMART_WKUP),
2099 .sysc_fields = &omap_hwmod_sysc_type1,
2100};
2101
2090static struct omap_hwmod_class am33xx_wd_timer_hwmod_class = { 2102static struct omap_hwmod_class am33xx_wd_timer_hwmod_class = {
2091 .name = "wd_timer", 2103 .name = "wd_timer",
2104 .sysc = &wdt_sysc,
2105 .pre_shutdown = &omap2_wd_timer_disable,
2092}; 2106};
2093 2107
2094/* 2108/*
@@ -2099,6 +2113,7 @@ static struct omap_hwmod am33xx_wd_timer1_hwmod = {
2099 .name = "wd_timer2", 2113 .name = "wd_timer2",
2100 .class = &am33xx_wd_timer_hwmod_class, 2114 .class = &am33xx_wd_timer_hwmod_class,
2101 .clkdm_name = "l4_wkup_clkdm", 2115 .clkdm_name = "l4_wkup_clkdm",
2116 .flags = HWMOD_SWSUP_SIDLE,
2102 .main_clk = "wdt1_fck", 2117 .main_clk = "wdt1_fck",
2103 .prcm = { 2118 .prcm = {
2104 .omap4 = { 2119 .omap4 = {
diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
index 9debf822687c..9ace8eae7ee8 100644
--- a/arch/arm/mach-omap2/pmu.c
+++ b/arch/arm/mach-omap2/pmu.c
@@ -11,6 +11,8 @@
11 * the Free Software Foundation; either version 2 of the License, or 11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version. 12 * (at your option) any later version.
13 */ 13 */
14#include <linux/of.h>
15
14#include <asm/pmu.h> 16#include <asm/pmu.h>
15 17
16#include "soc.h" 18#include "soc.h"
@@ -63,6 +65,15 @@ static int __init omap_init_pmu(void)
63 unsigned oh_num; 65 unsigned oh_num;
64 char **oh_names; 66 char **oh_names;
65 67
68 /* XXX Remove this check when the CTI driver is available */
69 if (cpu_is_omap443x()) {
70 pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
71 return 0;
72 }
73
74 if (of_have_populated_dt())
75 return 0;
76
66 /* 77 /*
67 * To create an ARM-PMU device the following HWMODs 78 * To create an ARM-PMU device the following HWMODs
68 * are required for the various OMAP2+ devices. 79 * are required for the various OMAP2+ devices.
@@ -75,9 +86,6 @@ static int __init omap_init_pmu(void)
75 if (cpu_is_omap443x()) { 86 if (cpu_is_omap443x()) {
76 oh_num = ARRAY_SIZE(omap4430_pmu_oh_names); 87 oh_num = ARRAY_SIZE(omap4430_pmu_oh_names);
77 oh_names = omap4430_pmu_oh_names; 88 oh_names = omap4430_pmu_oh_names;
78 /* XXX Remove the next two lines when CTI driver available */
79 pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
80 return 0;
81 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 89 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
82 oh_num = ARRAY_SIZE(omap3_pmu_oh_names); 90 oh_num = ARRAY_SIZE(omap3_pmu_oh_names);
83 oh_names = omap3_pmu_oh_names; 91 oh_names = omap3_pmu_oh_names;
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 8e61d80bf6b3..89cad4a605dd 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -52,7 +52,6 @@ enum {
52#define ALREADYACTIVE_SWITCH 0 52#define ALREADYACTIVE_SWITCH 0
53#define FORCEWAKEUP_SWITCH 1 53#define FORCEWAKEUP_SWITCH 1
54#define LOWPOWERSTATE_SWITCH 2 54#define LOWPOWERSTATE_SWITCH 2
55#define ERROR_SWITCH 3
56 55
57/* pwrdm_list contains all registered struct powerdomains */ 56/* pwrdm_list contains all registered struct powerdomains */
58static LIST_HEAD(pwrdm_list); 57static LIST_HEAD(pwrdm_list);
@@ -233,10 +232,7 @@ static u8 _pwrdm_save_clkdm_state_and_activate(struct powerdomain *pwrdm,
233{ 232{
234 u8 sleep_switch; 233 u8 sleep_switch;
235 234
236 if (curr_pwrst < 0) { 235 if (curr_pwrst < PWRDM_POWER_ON) {
237 WARN_ON(1);
238 sleep_switch = ERROR_SWITCH;
239 } else if (curr_pwrst < PWRDM_POWER_ON) {
240 if (curr_pwrst > pwrst && 236 if (curr_pwrst > pwrst &&
241 pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE && 237 pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE &&
242 arch_pwrdm->pwrdm_set_lowpwrstchange) { 238 arch_pwrdm->pwrdm_set_lowpwrstchange) {
@@ -1091,7 +1087,8 @@ int pwrdm_post_transition(struct powerdomain *pwrdm)
1091 */ 1087 */
1092int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 pwrst) 1088int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 pwrst)
1093{ 1089{
1094 u8 curr_pwrst, next_pwrst, sleep_switch; 1090 u8 next_pwrst, sleep_switch;
1091 int curr_pwrst;
1095 int ret = 0; 1092 int ret = 0;
1096 bool hwsup = false; 1093 bool hwsup = false;
1097 1094
@@ -1107,16 +1104,17 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 pwrst)
1107 pwrdm_lock(pwrdm); 1104 pwrdm_lock(pwrdm);
1108 1105
1109 curr_pwrst = pwrdm_read_pwrst(pwrdm); 1106 curr_pwrst = pwrdm_read_pwrst(pwrdm);
1107 if (curr_pwrst < 0) {
1108 ret = -EINVAL;
1109 goto osps_out;
1110 }
1111
1110 next_pwrst = pwrdm_read_next_pwrst(pwrdm); 1112 next_pwrst = pwrdm_read_next_pwrst(pwrdm);
1111 if (curr_pwrst == pwrst && next_pwrst == pwrst) 1113 if (curr_pwrst == pwrst && next_pwrst == pwrst)
1112 goto osps_out; 1114 goto osps_out;
1113 1115
1114 sleep_switch = _pwrdm_save_clkdm_state_and_activate(pwrdm, curr_pwrst, 1116 sleep_switch = _pwrdm_save_clkdm_state_and_activate(pwrdm, curr_pwrst,
1115 pwrst, &hwsup); 1117 pwrst, &hwsup);
1116 if (sleep_switch == ERROR_SWITCH) {
1117 ret = -EINVAL;
1118 goto osps_out;
1119 }
1120 1118
1121 ret = pwrdm_set_next_pwrst(pwrdm, pwrst); 1119 ret = pwrdm_set_next_pwrst(pwrdm, pwrst);
1122 if (ret) 1120 if (ret)
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index d35f98aabf7a..415c7e0c9393 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -81,13 +81,13 @@ static struct prm_reset_src_map omap44xx_prm_reset_src_map[] = {
81/* 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 */
82u32 omap4_prm_read_inst_reg(s16 inst, u16 reg) 82u32 omap4_prm_read_inst_reg(s16 inst, u16 reg)
83{ 83{
84 return __raw_readl(OMAP44XX_PRM_REGADDR(inst, reg)); 84 return __raw_readl(prm_base + inst + reg);
85} 85}
86 86
87/* Write into a register in a CM/PRM instance in the PRM module */ 87/* Write into a register in a CM/PRM instance in the PRM module */
88void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 reg) 88void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 reg)
89{ 89{
90 __raw_writel(val, OMAP44XX_PRM_REGADDR(inst, reg)); 90 __raw_writel(val, prm_base + inst + reg);
91} 91}
92 92
93/* Read-modify-write a register in a PRM module. Caller must lock */ 93/* Read-modify-write a register in a PRM module. Caller must lock */
@@ -650,7 +650,7 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
650 650
651int __init omap44xx_prm_init(void) 651int __init omap44xx_prm_init(void)
652{ 652{
653 if (!cpu_is_omap44xx()) 653 if (!cpu_is_omap44xx() && !soc_is_omap54xx())
654 return 0; 654 return 0;
655 655
656 return prm_register(&omap44xx_prm_ll_data); 656 return prm_register(&omap44xx_prm_ll_data);
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index c62116bbc760..18fdeeb3a44a 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -413,7 +413,9 @@ IS_OMAP_TYPE(3430, 0x3430)
413 413
414#define OMAP54XX_CLASS 0x54000054 414#define OMAP54XX_CLASS 0x54000054
415#define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8)) 415#define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8))
416#define OMAP5430_REV_ES2_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x20 << 8))
416#define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8)) 417#define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8))
418#define OMAP5432_REV_ES2_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x20 << 8))
417 419
418void omap2xxx_check_revision(void); 420void omap2xxx_check_revision(void);
419void omap3xxx_check_revision(void); 421void omap3xxx_check_revision(void);
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index f62b509ed08d..95e79a582f58 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -62,6 +62,7 @@
62#define OMAP2_MPU_SOURCE "sys_ck" 62#define OMAP2_MPU_SOURCE "sys_ck"
63#define OMAP3_MPU_SOURCE OMAP2_MPU_SOURCE 63#define OMAP3_MPU_SOURCE OMAP2_MPU_SOURCE
64#define OMAP4_MPU_SOURCE "sys_clkin_ck" 64#define OMAP4_MPU_SOURCE "sys_clkin_ck"
65#define OMAP5_MPU_SOURCE "sys_clkin"
65#define OMAP2_32K_SOURCE "func_32k_ck" 66#define OMAP2_32K_SOURCE "func_32k_ck"
66#define OMAP3_32K_SOURCE "omap_32k_fck" 67#define OMAP3_32K_SOURCE "omap_32k_fck"
67#define OMAP4_32K_SOURCE "sys_32k_ck" 68#define OMAP4_32K_SOURCE "sys_32k_ck"
@@ -143,7 +144,12 @@ static struct property device_disabled = {
143}; 144};
144 145
145static struct of_device_id omap_timer_match[] __initdata = { 146static struct of_device_id omap_timer_match[] __initdata = {
146 { .compatible = "ti,omap2-timer", }, 147 { .compatible = "ti,omap2420-timer", },
148 { .compatible = "ti,omap3430-timer", },
149 { .compatible = "ti,omap4430-timer", },
150 { .compatible = "ti,omap5430-timer", },
151 { .compatible = "ti,am335x-timer", },
152 { .compatible = "ti,am335x-timer-1ms", },
147 { } 153 { }
148}; 154};
149 155
@@ -487,7 +493,7 @@ static void __init realtime_counter_init(void)
487 pr_err("%s: ioremap failed\n", __func__); 493 pr_err("%s: ioremap failed\n", __func__);
488 return; 494 return;
489 } 495 }
490 sys_clk = clk_get(NULL, "sys_clkin_ck"); 496 sys_clk = clk_get(NULL, OMAP5_MPU_SOURCE);
491 if (IS_ERR(sys_clk)) { 497 if (IS_ERR(sys_clk)) {
492 pr_err("%s: failed to get system clock handle\n", __func__); 498 pr_err("%s: failed to get system clock handle\n", __func__);
493 iounmap(base); 499 iounmap(base);
@@ -601,7 +607,7 @@ void __init omap4_local_timer_init(void)
601 int err; 607 int err;
602 608
603 if (of_have_populated_dt()) { 609 if (of_have_populated_dt()) {
604 twd_local_timer_of_register(); 610 clocksource_of_init();
605 return; 611 return;
606 } 612 }
607 613
@@ -620,7 +626,7 @@ void __init omap4_local_timer_init(void)
620 626
621#ifdef CONFIG_SOC_OMAP5 627#ifdef CONFIG_SOC_OMAP5
622OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon", 628OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
623 2, OMAP4_MPU_SOURCE); 629 2, OMAP5_MPU_SOURCE);
624void __init omap5_realtime_timer_init(void) 630void __init omap5_realtime_timer_init(void)
625{ 631{
626 int err; 632 int err;
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 5706bdccf45e..aa27d7f5cbb7 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -22,8 +22,12 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
25 25#include <linux/regulator/machine.h>
26#include <asm/io.h> 26#include <linux/regulator/fixed.h>
27#include <linux/string.h>
28#include <linux/io.h>
29#include <linux/gpio.h>
30#include <linux/usb/phy.h>
27 31
28#include "soc.h" 32#include "soc.h"
29#include "omap_device.h" 33#include "omap_device.h"
@@ -526,3 +530,155 @@ void __init usbhs_init(struct usbhs_omap_platform_data *pdata)
526} 530}
527 531
528#endif 532#endif
533
534/* Template for PHY regulators */
535static struct fixed_voltage_config hsusb_reg_config = {
536 /* .supply_name filled later */
537 .microvolts = 3300000,
538 .gpio = -1, /* updated later */
539 .startup_delay = 70000, /* 70msec */
540 .enable_high = 1, /* updated later */
541 .enabled_at_boot = 0, /* keep in RESET */
542 /* .init_data filled later */
543};
544
545static const char *nop_name = "nop_usb_xceiv"; /* NOP PHY driver */
546static const char *reg_name = "reg-fixed-voltage"; /* Regulator driver */
547
548/**
549 * usbhs_add_regulator - Add a gpio based fixed voltage regulator device
550 * @name: name for the regulator
551 * @dev_id: device id of the device this regulator supplies power to
552 * @dev_supply: supply name that the device expects
553 * @gpio: GPIO number
554 * @polarity: 1 - Active high, 0 - Active low
555 */
556static int usbhs_add_regulator(char *name, char *dev_id, char *dev_supply,
557 int gpio, int polarity)
558{
559 struct regulator_consumer_supply *supplies;
560 struct regulator_init_data *reg_data;
561 struct fixed_voltage_config *config;
562 struct platform_device *pdev;
563 int ret;
564
565 supplies = kzalloc(sizeof(*supplies), GFP_KERNEL);
566 if (!supplies)
567 return -ENOMEM;
568
569 supplies->supply = dev_supply;
570 supplies->dev_name = dev_id;
571
572 reg_data = kzalloc(sizeof(*reg_data), GFP_KERNEL);
573 if (!reg_data)
574 return -ENOMEM;
575
576 reg_data->constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS;
577 reg_data->consumer_supplies = supplies;
578 reg_data->num_consumer_supplies = 1;
579
580 config = kmemdup(&hsusb_reg_config, sizeof(hsusb_reg_config),
581 GFP_KERNEL);
582 if (!config)
583 return -ENOMEM;
584
585 config->supply_name = name;
586 config->gpio = gpio;
587 config->enable_high = polarity;
588 config->init_data = reg_data;
589
590 /* create a regulator device */
591 pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
592 if (!pdev)
593 return -ENOMEM;
594
595 pdev->id = PLATFORM_DEVID_AUTO;
596 pdev->name = reg_name;
597 pdev->dev.platform_data = config;
598
599 ret = platform_device_register(pdev);
600 if (ret)
601 pr_err("%s: Failed registering regulator %s for %s\n",
602 __func__, name, dev_id);
603
604 return ret;
605}
606
607int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
608{
609 char *rail_name;
610 int i, len;
611 struct platform_device *pdev;
612 char *phy_id;
613
614 /* the phy_id will be something like "nop_usb_xceiv.1" */
615 len = strlen(nop_name) + 3; /* 3 -> ".1" and NULL terminator */
616
617 for (i = 0; i < num_phys; i++) {
618
619 if (!phy->port) {
620 pr_err("%s: Invalid port 0. Must start from 1\n",
621 __func__);
622 continue;
623 }
624
625 /* do we need a NOP PHY device ? */
626 if (!gpio_is_valid(phy->reset_gpio) &&
627 !gpio_is_valid(phy->vcc_gpio))
628 continue;
629
630 /* create a NOP PHY device */
631 pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
632 if (!pdev)
633 return -ENOMEM;
634
635 pdev->id = phy->port;
636 pdev->name = nop_name;
637 pdev->dev.platform_data = phy->platform_data;
638
639 phy_id = kmalloc(len, GFP_KERNEL);
640 if (!phy_id)
641 return -ENOMEM;
642
643 scnprintf(phy_id, len, "nop_usb_xceiv.%d\n",
644 pdev->id);
645
646 if (platform_device_register(pdev)) {
647 pr_err("%s: Failed to register device %s\n",
648 __func__, phy_id);
649 continue;
650 }
651
652 usb_bind_phy("ehci-omap.0", phy->port - 1, phy_id);
653
654 /* Do we need RESET regulator ? */
655 if (gpio_is_valid(phy->reset_gpio)) {
656
657 rail_name = kmalloc(13, GFP_KERNEL);
658 if (!rail_name)
659 return -ENOMEM;
660
661 scnprintf(rail_name, 13, "hsusb%d_reset", phy->port);
662
663 usbhs_add_regulator(rail_name, phy_id, "reset",
664 phy->reset_gpio, 1);
665 }
666
667 /* Do we need VCC regulator ? */
668 if (gpio_is_valid(phy->vcc_gpio)) {
669
670 rail_name = kmalloc(13, GFP_KERNEL);
671 if (!rail_name)
672 return -ENOMEM;
673
674 scnprintf(rail_name, 13, "hsusb%d_vcc", phy->port);
675
676 usbhs_add_regulator(rail_name, phy_id, "vcc",
677 phy->vcc_gpio, phy->vcc_polarity);
678 }
679
680 phy++;
681 }
682
683 return 0;
684}
diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
index 3319f5cf47a3..e7261ebcf7b0 100644
--- a/arch/arm/mach-omap2/usb.h
+++ b/arch/arm/mach-omap2/usb.h
@@ -53,8 +53,17 @@
53#define USBPHY_OTGSESSEND_EN (1 << 20) 53#define USBPHY_OTGSESSEND_EN (1 << 20)
54#define USBPHY_DATA_POLARITY (1 << 23) 54#define USBPHY_DATA_POLARITY (1 << 23)
55 55
56struct usbhs_phy_data {
57 int port; /* 1 indexed port number */
58 int reset_gpio;
59 int vcc_gpio;
60 bool vcc_polarity; /* 1 active high, 0 active low */
61 void *platform_data;
62};
63
56extern void usb_musb_init(struct omap_musb_board_data *board_data); 64extern void usb_musb_init(struct omap_musb_board_data *board_data);
57extern void usbhs_init(struct usbhs_omap_platform_data *pdata); 65extern void usbhs_init(struct usbhs_omap_platform_data *pdata);
66extern int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys);
58 67
59extern void am35x_musb_reset(void); 68extern void am35x_musb_reset(void);
60extern void am35x_musb_phy_power(u8 on); 69extern void am35x_musb_phy_power(u8 on);
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
index 9e809a7c05c0..45da805fb236 100644
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -1,4 +1,4 @@
1obj-y += common.o addr-map.o pci.o irq.o mpp.o 1obj-y += common.o pci.o irq.o mpp.o
2obj-$(CONFIG_MACH_DB88F5281) += db88f5281-setup.o 2obj-$(CONFIG_MACH_DB88F5281) += db88f5281-setup.o
3obj-$(CONFIG_MACH_RD88F5182) += rd88f5182-setup.o 3obj-$(CONFIG_MACH_RD88F5182) += rd88f5182-setup.o
4obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o 4obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o
diff --git a/arch/arm/mach-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c
deleted file mode 100644
index b5efc0fd31cb..000000000000
--- a/arch/arm/mach-orion5x/addr-map.c
+++ /dev/null
@@ -1,155 +0,0 @@
1/*
2 * arch/arm/mach-orion5x/addr-map.c
3 *
4 * Address map functions for Marvell Orion 5x SoCs
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mbus.h>
16#include <linux/io.h>
17#include <mach/hardware.h>
18#include <plat/addr-map.h>
19#include "common.h"
20
21/*
22 * The Orion has fully programmable address map. There's a separate address
23 * map for each of the device _master_ interfaces, e.g. CPU, PCI, PCIe, USB,
24 * Gigabit Ethernet, DMA/XOR engines, etc. Each interface has its own
25 * address decode windows that allow it to access any of the Orion resources.
26 *
27 * CPU address decoding --
28 * Linux assumes that it is the boot loader that already setup the access to
29 * DDR and internal registers.
30 * Setup access to PCI and PCIe IO/MEM space is issued by this file.
31 * Setup access to various devices located on the device bus interface (e.g.
32 * flashes, RTC, etc) should be issued by machine-setup.c according to
33 * specific board population (by using orion5x_setup_*_win()).
34 *
35 * Non-CPU Masters address decoding --
36 * Unlike the CPU, we setup the access from Orion's master interfaces to DDR
37 * banks only (the typical use case).
38 * Setup access for each master to DDR is issued by platform device setup.
39 */
40
41/*
42 * Generic Address Decode Windows bit settings
43 */
44#define TARGET_DEV_BUS 1
45#define TARGET_PCI 3
46#define TARGET_PCIE 4
47#define TARGET_SRAM 9
48#define ATTR_PCIE_MEM 0x59
49#define ATTR_PCIE_IO 0x51
50#define ATTR_PCIE_WA 0x79
51#define ATTR_PCI_MEM 0x59
52#define ATTR_PCI_IO 0x51
53#define ATTR_DEV_CS0 0x1e
54#define ATTR_DEV_CS1 0x1d
55#define ATTR_DEV_CS2 0x1b
56#define ATTR_DEV_BOOT 0xf
57#define ATTR_SRAM 0x0
58
59static int __initdata win_alloc_count;
60
61static int __init cpu_win_can_remap(const struct orion_addr_map_cfg *cfg,
62 const int win)
63{
64 u32 dev, rev;
65
66 orion5x_pcie_id(&dev, &rev);
67 if ((dev == MV88F5281_DEV_ID && win < 4)
68 || (dev == MV88F5182_DEV_ID && win < 2)
69 || (dev == MV88F5181_DEV_ID && win < 2)
70 || (dev == MV88F6183_DEV_ID && win < 4))
71 return 1;
72
73 return 0;
74}
75
76/*
77 * Description of the windows needed by the platform code
78 */
79static struct orion_addr_map_cfg addr_map_cfg __initdata = {
80 .num_wins = 8,
81 .cpu_win_can_remap = cpu_win_can_remap,
82 .bridge_virt_base = ORION5X_BRIDGE_VIRT_BASE,
83};
84
85static const struct __initdata orion_addr_map_info addr_map_info[] = {
86 /*
87 * Setup windows for PCI+PCIe IO+MEM space.
88 */
89 { 0, ORION5X_PCIE_IO_PHYS_BASE, ORION5X_PCIE_IO_SIZE,
90 TARGET_PCIE, ATTR_PCIE_IO, ORION5X_PCIE_IO_BUS_BASE
91 },
92 { 1, ORION5X_PCI_IO_PHYS_BASE, ORION5X_PCI_IO_SIZE,
93 TARGET_PCI, ATTR_PCI_IO, ORION5X_PCI_IO_BUS_BASE
94 },
95 { 2, ORION5X_PCIE_MEM_PHYS_BASE, ORION5X_PCIE_MEM_SIZE,
96 TARGET_PCIE, ATTR_PCIE_MEM, -1
97 },
98 { 3, ORION5X_PCI_MEM_PHYS_BASE, ORION5X_PCI_MEM_SIZE,
99 TARGET_PCI, ATTR_PCI_MEM, -1
100 },
101 /* End marker */
102 { -1, 0, 0, 0, 0, 0 }
103};
104
105void __init orion5x_setup_cpu_mbus_bridge(void)
106{
107 /*
108 * Disable, clear and configure windows.
109 */
110 orion_config_wins(&addr_map_cfg, addr_map_info);
111 win_alloc_count = 4;
112
113 /*
114 * Setup MBUS dram target info.
115 */
116 orion_setup_cpu_mbus_target(&addr_map_cfg,
117 (void __iomem *) ORION5X_DDR_WINDOW_CPU_BASE);
118}
119
120void __init orion5x_setup_dev_boot_win(u32 base, u32 size)
121{
122 orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size,
123 TARGET_DEV_BUS, ATTR_DEV_BOOT, -1);
124}
125
126void __init orion5x_setup_dev0_win(u32 base, u32 size)
127{
128 orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size,
129 TARGET_DEV_BUS, ATTR_DEV_CS0, -1);
130}
131
132void __init orion5x_setup_dev1_win(u32 base, u32 size)
133{
134 orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size,
135 TARGET_DEV_BUS, ATTR_DEV_CS1, -1);
136}
137
138void __init orion5x_setup_dev2_win(u32 base, u32 size)
139{
140 orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size,
141 TARGET_DEV_BUS, ATTR_DEV_CS2, -1);
142}
143
144void __init orion5x_setup_pcie_wa_win(u32 base, u32 size)
145{
146 orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++, base, size,
147 TARGET_PCIE, ATTR_PCIE_WA, -1);
148}
149
150void __init orion5x_setup_sram_win(void)
151{
152 orion_setup_cpu_win(&addr_map_cfg, win_alloc_count++,
153 ORION5X_SRAM_PHYS_BASE, ORION5X_SRAM_SIZE,
154 TARGET_SRAM, ATTR_SRAM, -1);
155}
diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c
index 35a8014529ca..6bbc8786c1e3 100644
--- a/arch/arm/mach-orion5x/board-dt.c
+++ b/arch/arm/mach-orion5x/board-dt.c
@@ -41,7 +41,7 @@ static void __init orion5x_dt_init(void)
41 /* 41 /*
42 * Setup Orion address map 42 * Setup Orion address map
43 */ 43 */
44 orion5x_setup_cpu_mbus_bridge(); 44 orion5x_setup_wins();
45 45
46 /* Setup root of clk tree */ 46 /* Setup root of clk tree */
47 clk_init(); 47 clk_init();
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index d068f1431c40..8e468e3a6015 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -34,7 +34,6 @@
34#include <linux/platform_data/usb-ehci-orion.h> 34#include <linux/platform_data/usb-ehci-orion.h>
35#include <plat/time.h> 35#include <plat/time.h>
36#include <plat/common.h> 36#include <plat/common.h>
37#include <plat/addr-map.h>
38#include "common.h" 37#include "common.h"
39 38
40/***************************************************************************** 39/*****************************************************************************
@@ -174,7 +173,8 @@ void __init orion5x_xor_init(void)
174 ****************************************************************************/ 173 ****************************************************************************/
175static void __init orion5x_crypto_init(void) 174static void __init orion5x_crypto_init(void)
176{ 175{
177 orion5x_setup_sram_win(); 176 mvebu_mbus_add_window("sram", ORION5X_SRAM_PHYS_BASE,
177 ORION5X_SRAM_SIZE);
178 orion_crypto_init(ORION5X_CRYPTO_PHYS_BASE, ORION5X_SRAM_PHYS_BASE, 178 orion_crypto_init(ORION5X_CRYPTO_PHYS_BASE, ORION5X_SRAM_PHYS_BASE,
179 SZ_8K, IRQ_ORION5X_CESA); 179 SZ_8K, IRQ_ORION5X_CESA);
180} 180}
@@ -193,6 +193,9 @@ void __init orion5x_wdt_init(void)
193 ****************************************************************************/ 193 ****************************************************************************/
194void __init orion5x_init_early(void) 194void __init orion5x_init_early(void)
195{ 195{
196 u32 rev, dev;
197 const char *mbus_soc_name;
198
196 orion_time_set_base(TIMER_VIRT_BASE); 199 orion_time_set_base(TIMER_VIRT_BASE);
197 200
198 /* 201 /*
@@ -201,6 +204,46 @@ void __init orion5x_init_early(void)
201 * the allocations won't fail. 204 * the allocations won't fail.
202 */ 205 */
203 init_dma_coherent_pool_size(SZ_1M); 206 init_dma_coherent_pool_size(SZ_1M);
207
208 /* Initialize the MBUS driver */
209 orion5x_pcie_id(&dev, &rev);
210 if (dev == MV88F5281_DEV_ID)
211 mbus_soc_name = "marvell,orion5x-88f5281-mbus";
212 else if (dev == MV88F5182_DEV_ID)
213 mbus_soc_name = "marvell,orion5x-88f5182-mbus";
214 else if (dev == MV88F5181_DEV_ID)
215 mbus_soc_name = "marvell,orion5x-88f5181-mbus";
216 else if (dev == MV88F6183_DEV_ID)
217 mbus_soc_name = "marvell,orion5x-88f6183-mbus";
218 else
219 mbus_soc_name = NULL;
220 mvebu_mbus_init(mbus_soc_name, ORION5X_BRIDGE_WINS_BASE,
221 ORION5X_BRIDGE_WINS_SZ,
222 ORION5X_DDR_WINS_BASE, ORION5X_DDR_WINS_SZ);
223}
224
225void orion5x_setup_wins(void)
226{
227 /*
228 * The PCIe windows will no longer be statically allocated
229 * here once Orion5x is migrated to the pci-mvebu driver.
230 */
231 mvebu_mbus_add_window_remap_flags("pcie0.0", ORION5X_PCIE_IO_PHYS_BASE,
232 ORION5X_PCIE_IO_SIZE,
233 ORION5X_PCIE_IO_BUS_BASE,
234 MVEBU_MBUS_PCI_IO);
235 mvebu_mbus_add_window_remap_flags("pcie0.0", ORION5X_PCIE_MEM_PHYS_BASE,
236 ORION5X_PCIE_MEM_SIZE,
237 MVEBU_MBUS_NO_REMAP,
238 MVEBU_MBUS_PCI_MEM);
239 mvebu_mbus_add_window_remap_flags("pci0.0", ORION5X_PCI_IO_PHYS_BASE,
240 ORION5X_PCI_IO_SIZE,
241 ORION5X_PCI_IO_BUS_BASE,
242 MVEBU_MBUS_PCI_IO);
243 mvebu_mbus_add_window_remap_flags("pci0.0", ORION5X_PCI_MEM_PHYS_BASE,
244 ORION5X_PCI_MEM_SIZE,
245 MVEBU_MBUS_NO_REMAP,
246 MVEBU_MBUS_PCI_MEM);
204} 247}
205 248
206int orion5x_tclk; 249int orion5x_tclk;
@@ -282,7 +325,7 @@ void __init orion5x_init(void)
282 /* 325 /*
283 * Setup Orion address map 326 * Setup Orion address map
284 */ 327 */
285 orion5x_setup_cpu_mbus_bridge(); 328 orion5x_setup_wins();
286 329
287 /* Setup root of clk tree */ 330 /* Setup root of clk tree */
288 clk_init(); 331 clk_init();
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index e60345760283..cdaa01f3d186 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -17,18 +17,7 @@ void clk_init(void);
17extern int orion5x_tclk; 17extern int orion5x_tclk;
18extern void orion5x_timer_init(void); 18extern void orion5x_timer_init(void);
19 19
20/* 20void orion5x_setup_wins(void);
21 * Enumerations and functions for Orion windows mapping. Used by Orion core
22 * functions to map its interfaces and by the machine-setup to map its on-
23 * board devices. Details in /mach-orion/addr-map.c
24 */
25void orion5x_setup_cpu_mbus_bridge(void);
26void orion5x_setup_dev_boot_win(u32 base, u32 size);
27void orion5x_setup_dev0_win(u32 base, u32 size);
28void orion5x_setup_dev1_win(u32 base, u32 size);
29void orion5x_setup_dev2_win(u32 base, u32 size);
30void orion5x_setup_pcie_wa_win(u32 base, u32 size);
31void orion5x_setup_sram_win(void);
32 21
33void orion5x_ehci0_init(void); 22void orion5x_ehci0_init(void);
34void orion5x_ehci1_init(void); 23void orion5x_ehci1_init(void);
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
index 57d0af74874d..16c88bbabc98 100644
--- a/arch/arm/mach-orion5x/d2net-setup.c
+++ b/arch/arm/mach-orion5x/d2net-setup.c
@@ -317,8 +317,8 @@ static void __init d2net_init(void)
317 d2net_sata_power_init(); 317 d2net_sata_power_init();
318 orion5x_sata_init(&d2net_sata_data); 318 orion5x_sata_init(&d2net_sata_data);
319 319
320 orion5x_setup_dev_boot_win(D2NET_NOR_BOOT_BASE, 320 mvebu_mbus_add_window("devbus-boot", D2NET_NOR_BOOT_BASE,
321 D2NET_NOR_BOOT_SIZE); 321 D2NET_NOR_BOOT_SIZE);
322 platform_device_register(&d2net_nor_flash); 322 platform_device_register(&d2net_nor_flash);
323 323
324 platform_device_register(&d2net_gpio_buttons); 324 platform_device_register(&d2net_gpio_buttons);
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c
index 76665640087b..4e1263da38bb 100644
--- a/arch/arm/mach-orion5x/db88f5281-setup.c
+++ b/arch/arm/mach-orion5x/db88f5281-setup.c
@@ -340,16 +340,19 @@ static void __init db88f5281_init(void)
340 orion5x_uart0_init(); 340 orion5x_uart0_init();
341 orion5x_uart1_init(); 341 orion5x_uart1_init();
342 342
343 orion5x_setup_dev_boot_win(DB88F5281_NOR_BOOT_BASE, 343 mvebu_mbus_add_window("devbus-boot", DB88F5281_NOR_BOOT_BASE,
344 DB88F5281_NOR_BOOT_SIZE); 344 DB88F5281_NOR_BOOT_SIZE);
345 platform_device_register(&db88f5281_boot_flash); 345 platform_device_register(&db88f5281_boot_flash);
346 346
347 orion5x_setup_dev0_win(DB88F5281_7SEG_BASE, DB88F5281_7SEG_SIZE); 347 mvebu_mbus_add_window("devbus-cs0", DB88F5281_7SEG_BASE,
348 DB88F5281_7SEG_SIZE);
348 349
349 orion5x_setup_dev1_win(DB88F5281_NOR_BASE, DB88F5281_NOR_SIZE); 350 mvebu_mbus_add_window("devbus-cs1", DB88F5281_NOR_BASE,
351 DB88F5281_NOR_SIZE);
350 platform_device_register(&db88f5281_nor_flash); 352 platform_device_register(&db88f5281_nor_flash);
351 353
352 orion5x_setup_dev2_win(DB88F5281_NAND_BASE, DB88F5281_NAND_SIZE); 354 mvebu_mbus_add_window("devbus-cs2", DB88F5281_NAND_BASE,
355 DB88F5281_NAND_SIZE);
353 platform_device_register(&db88f5281_nand_flash); 356 platform_device_register(&db88f5281_nand_flash);
354 357
355 i2c_register_board_info(0, &db88f5281_i2c_rtc, 1); 358 i2c_register_board_info(0, &db88f5281_i2c_rtc, 1);
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 6eb1732757fd..9e6baf581ed3 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -611,7 +611,8 @@ static void __init dns323_init(void)
611 /* setup flash mapping 611 /* setup flash mapping
612 * CS3 holds a 8 MB Spansion S29GL064M90TFIR4 612 * CS3 holds a 8 MB Spansion S29GL064M90TFIR4
613 */ 613 */
614 orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE); 614 mvebu_mbus_add_window("devbus-boot", DNS323_NOR_BOOT_BASE,
615 DNS323_NOR_BOOT_SIZE);
615 platform_device_register(&dns323_nor_flash); 616 platform_device_register(&dns323_nor_flash);
616 617
617 /* Sort out LEDs, Buttons and i2c devices */ 618 /* Sort out LEDs, Buttons and i2c devices */
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c
index d675e727803d..147615510dd0 100644
--- a/arch/arm/mach-orion5x/edmini_v2-setup.c
+++ b/arch/arm/mach-orion5x/edmini_v2-setup.c
@@ -154,8 +154,8 @@ void __init edmini_v2_init(void)
154 orion5x_ehci0_init(); 154 orion5x_ehci0_init();
155 orion5x_eth_init(&edmini_v2_eth_data); 155 orion5x_eth_init(&edmini_v2_eth_data);
156 156
157 orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE, 157 mvebu_mbus_add_window("devbus-boot", EDMINI_V2_NOR_BOOT_BASE,
158 EDMINI_V2_NOR_BOOT_SIZE); 158 EDMINI_V2_NOR_BOOT_SIZE);
159 platform_device_register(&edmini_v2_nor_flash); 159 platform_device_register(&edmini_v2_nor_flash);
160 160
161 pr_notice("edmini_v2: USB device port, flash write and power-off " 161 pr_notice("edmini_v2: USB device port, flash write and power-off "
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h
index d265f5484a8e..b78ff3248868 100644
--- a/arch/arm/mach-orion5x/include/mach/orion5x.h
+++ b/arch/arm/mach-orion5x/include/mach/orion5x.h
@@ -66,8 +66,10 @@
66 * Orion Registers Map 66 * Orion Registers Map
67 ******************************************************************************/ 67 ******************************************************************************/
68 68
69#define ORION5X_DDR_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x00000)
70#define ORION5X_DDR_WINS_BASE (ORION5X_DDR_PHYS_BASE + 0x1500)
71#define ORION5X_DDR_WINS_SZ (0x10)
69#define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x00000) 72#define ORION5X_DDR_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x00000)
70#define ORION5X_DDR_WINDOW_CPU_BASE (ORION5X_DDR_VIRT_BASE + 0x1500)
71#define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x10000) 73#define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x10000)
72#define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x10000) 74#define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x10000)
73#define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE + (x)) 75#define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE + (x))
@@ -81,6 +83,8 @@
81 83
82#define ORION5X_BRIDGE_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x20000) 84#define ORION5X_BRIDGE_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x20000)
83#define ORION5X_BRIDGE_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x20000) 85#define ORION5X_BRIDGE_PHYS_BASE (ORION5X_REGS_PHYS_BASE + 0x20000)
86#define ORION5X_BRIDGE_WINS_BASE (ORION5X_BRIDGE_PHYS_BASE)
87#define ORION5X_BRIDGE_WINS_SZ (0x80)
84 88
85#define ORION5X_PCI_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x30000) 89#define ORION5X_PCI_VIRT_BASE (ORION5X_REGS_VIRT_BASE + 0x30000)
86 90
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index b98403526218..aae10e4a917c 100644
--- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -359,13 +359,13 @@ static void __init kurobox_pro_init(void)
359 orion5x_uart1_init(); 359 orion5x_uart1_init();
360 orion5x_xor_init(); 360 orion5x_xor_init();
361 361
362 orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE, 362 mvebu_mbus_add_window("devbus-boot", KUROBOX_PRO_NOR_BOOT_BASE,
363 KUROBOX_PRO_NOR_BOOT_SIZE); 363 KUROBOX_PRO_NOR_BOOT_SIZE);
364 platform_device_register(&kurobox_pro_nor_flash); 364 platform_device_register(&kurobox_pro_nor_flash);
365 365
366 if (machine_is_kurobox_pro()) { 366 if (machine_is_kurobox_pro()) {
367 orion5x_setup_dev0_win(KUROBOX_PRO_NAND_BASE, 367 mvebu_mbus_add_window("devbus-cs0", KUROBOX_PRO_NAND_BASE,
368 KUROBOX_PRO_NAND_SIZE); 368 KUROBOX_PRO_NAND_SIZE);
369 platform_device_register(&kurobox_pro_nand_flash); 369 platform_device_register(&kurobox_pro_nand_flash);
370 } 370 }
371 371
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
index 044da5b6a6ae..24f4e14e5893 100644
--- a/arch/arm/mach-orion5x/ls-chl-setup.c
+++ b/arch/arm/mach-orion5x/ls-chl-setup.c
@@ -294,8 +294,8 @@ static void __init lschl_init(void)
294 orion5x_uart0_init(); 294 orion5x_uart0_init();
295 orion5x_xor_init(); 295 orion5x_xor_init();
296 296
297 orion5x_setup_dev_boot_win(LSCHL_NOR_BOOT_BASE, 297 mvebu_mbus_add_window("devbus-boot", LSCHL_NOR_BOOT_BASE,
298 LSCHL_NOR_BOOT_SIZE); 298 LSCHL_NOR_BOOT_SIZE);
299 platform_device_register(&lschl_nor_flash); 299 platform_device_register(&lschl_nor_flash);
300 300
301 platform_device_register(&lschl_leds); 301 platform_device_register(&lschl_leds);
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c
index d49f93423f52..fc653bb41e78 100644
--- a/arch/arm/mach-orion5x/ls_hgl-setup.c
+++ b/arch/arm/mach-orion5x/ls_hgl-setup.c
@@ -243,8 +243,8 @@ static void __init ls_hgl_init(void)
243 orion5x_uart0_init(); 243 orion5x_uart0_init();
244 orion5x_xor_init(); 244 orion5x_xor_init();
245 245
246 orion5x_setup_dev_boot_win(LS_HGL_NOR_BOOT_BASE, 246 mvebu_mbus_add_window("devbus-boot", LS_HGL_NOR_BOOT_BASE,
247 LS_HGL_NOR_BOOT_SIZE); 247 LS_HGL_NOR_BOOT_SIZE);
248 platform_device_register(&ls_hgl_nor_flash); 248 platform_device_register(&ls_hgl_nor_flash);
249 249
250 platform_device_register(&ls_hgl_button_device); 250 platform_device_register(&ls_hgl_button_device);
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index 8e3965c6c0fe..18e66e617dc2 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -244,8 +244,8 @@ static void __init lsmini_init(void)
244 orion5x_uart0_init(); 244 orion5x_uart0_init();
245 orion5x_xor_init(); 245 orion5x_xor_init();
246 246
247 orion5x_setup_dev_boot_win(LSMINI_NOR_BOOT_BASE, 247 mvebu_mbus_add_window("devbus-boot", LSMINI_NOR_BOOT_BASE,
248 LSMINI_NOR_BOOT_SIZE); 248 LSMINI_NOR_BOOT_SIZE);
249 platform_device_register(&lsmini_nor_flash); 249 platform_device_register(&lsmini_nor_flash);
250 250
251 platform_device_register(&lsmini_button_device); 251 platform_device_register(&lsmini_button_device);
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c
index 0ec94a1f2b16..827acbafc9dc 100644
--- a/arch/arm/mach-orion5x/mss2-setup.c
+++ b/arch/arm/mach-orion5x/mss2-setup.c
@@ -241,7 +241,8 @@ static void __init mss2_init(void)
241 orion5x_uart0_init(); 241 orion5x_uart0_init();
242 orion5x_xor_init(); 242 orion5x_xor_init();
243 243
244 orion5x_setup_dev_boot_win(MSS2_NOR_BOOT_BASE, MSS2_NOR_BOOT_SIZE); 244 mvebu_mbus_add_window("devbus-boot", MSS2_NOR_BOOT_BASE,
245 MSS2_NOR_BOOT_SIZE);
245 platform_device_register(&mss2_nor_flash); 246 platform_device_register(&mss2_nor_flash);
246 247
247 platform_device_register(&mss2_button_device); 248 platform_device_register(&mss2_button_device);
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c
index 18143f2a9093..92600ae2b4b6 100644
--- a/arch/arm/mach-orion5x/mv2120-setup.c
+++ b/arch/arm/mach-orion5x/mv2120-setup.c
@@ -204,7 +204,8 @@ static void __init mv2120_init(void)
204 orion5x_uart0_init(); 204 orion5x_uart0_init();
205 orion5x_xor_init(); 205 orion5x_xor_init();
206 206
207 orion5x_setup_dev_boot_win(MV2120_NOR_BOOT_BASE, MV2120_NOR_BOOT_SIZE); 207 mvebu_mbus_add_window("devbus-boot", MV2120_NOR_BOOT_BASE,
208 MV2120_NOR_BOOT_SIZE);
208 platform_device_register(&mv2120_nor_flash); 209 platform_device_register(&mv2120_nor_flash);
209 210
210 platform_device_register(&mv2120_button_device); 211 platform_device_register(&mv2120_button_device);
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
index 282e503b003e..dd0641a0d074 100644
--- a/arch/arm/mach-orion5x/net2big-setup.c
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -397,8 +397,8 @@ static void __init net2big_init(void)
397 net2big_sata_power_init(); 397 net2big_sata_power_init();
398 orion5x_sata_init(&net2big_sata_data); 398 orion5x_sata_init(&net2big_sata_data);
399 399
400 orion5x_setup_dev_boot_win(NET2BIG_NOR_BOOT_BASE, 400 mvebu_mbus_add_window("devbus-boot", NET2BIG_NOR_BOOT_BASE,
401 NET2BIG_NOR_BOOT_SIZE); 401 NET2BIG_NOR_BOOT_SIZE);
402 platform_device_register(&net2big_nor_flash); 402 platform_device_register(&net2big_nor_flash);
403 403
404 platform_device_register(&net2big_gpio_buttons); 404 platform_device_register(&net2big_gpio_buttons);
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
index d9c7c3bf0d9c..503368023bb1 100644
--- a/arch/arm/mach-orion5x/pci.c
+++ b/arch/arm/mach-orion5x/pci.c
@@ -157,8 +157,11 @@ static int __init pcie_setup(struct pci_sys_data *sys)
157 if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) { 157 if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
158 printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config " 158 printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config "
159 "read transaction workaround\n"); 159 "read transaction workaround\n");
160 orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE, 160 mvebu_mbus_add_window_remap_flags("pcie0.0",
161 ORION5X_PCIE_WA_SIZE); 161 ORION5X_PCIE_WA_PHYS_BASE,
162 ORION5X_PCIE_WA_SIZE,
163 MVEBU_MBUS_NO_REMAP,
164 MVEBU_MBUS_PCI_WA);
162 pcie_ops.read = pcie_rd_conf_wa; 165 pcie_ops.read = pcie_rd_conf_wa;
163 } 166 }
164 167
@@ -402,8 +405,9 @@ static void __init orion5x_pci_master_slave_enable(void)
402 orion5x_pci_hw_wr_conf(bus_nr, 0, func, reg, 4, val | 0x7); 405 orion5x_pci_hw_wr_conf(bus_nr, 0, func, reg, 4, val | 0x7);
403} 406}
404 407
405static void __init orion5x_setup_pci_wins(struct mbus_dram_target_info *dram) 408static void __init orion5x_setup_pci_wins(void)
406{ 409{
410 const struct mbus_dram_target_info *dram = mv_mbus_dram_info();
407 u32 win_enable; 411 u32 win_enable;
408 int bus; 412 int bus;
409 int i; 413 int i;
@@ -420,7 +424,7 @@ static void __init orion5x_setup_pci_wins(struct mbus_dram_target_info *dram)
420 bus = orion5x_pci_local_bus_nr(); 424 bus = orion5x_pci_local_bus_nr();
421 425
422 for (i = 0; i < dram->num_cs; i++) { 426 for (i = 0; i < dram->num_cs; i++) {
423 struct mbus_dram_window *cs = dram->cs + i; 427 const struct mbus_dram_window *cs = dram->cs + i;
424 u32 func = PCI_CONF_FUNC_BAR_CS(cs->cs_index); 428 u32 func = PCI_CONF_FUNC_BAR_CS(cs->cs_index);
425 u32 reg; 429 u32 reg;
426 u32 val; 430 u32 val;
@@ -467,7 +471,7 @@ static int __init pci_setup(struct pci_sys_data *sys)
467 /* 471 /*
468 * Point PCI unit MBUS decode windows to DRAM space. 472 * Point PCI unit MBUS decode windows to DRAM space.
469 */ 473 */
470 orion5x_setup_pci_wins(&orion_mbus_dram_info); 474 orion5x_setup_pci_wins();
471 475
472 /* 476 /*
473 * Master + Slave enable 477 * Master + Slave enable
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index d6e72f672afb..1c4498bf650a 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -123,8 +123,8 @@ static void __init rd88f5181l_fxo_init(void)
123 orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ); 123 orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
124 orion5x_uart0_init(); 124 orion5x_uart0_init();
125 125
126 orion5x_setup_dev_boot_win(RD88F5181L_FXO_NOR_BOOT_BASE, 126 mvebu_mbus_add_window("devbus-boot", RD88F5181L_FXO_NOR_BOOT_BASE,
127 RD88F5181L_FXO_NOR_BOOT_SIZE); 127 RD88F5181L_FXO_NOR_BOOT_SIZE);
128 platform_device_register(&rd88f5181l_fxo_nor_boot_flash); 128 platform_device_register(&rd88f5181l_fxo_nor_boot_flash);
129} 129}
130 130
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index c8b7913310e5..adabe34c4fc6 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -130,8 +130,8 @@ static void __init rd88f5181l_ge_init(void)
130 orion5x_i2c_init(); 130 orion5x_i2c_init();
131 orion5x_uart0_init(); 131 orion5x_uart0_init();
132 132
133 orion5x_setup_dev_boot_win(RD88F5181L_GE_NOR_BOOT_BASE, 133 mvebu_mbus_add_window("devbus-boot", RD88F5181L_GE_NOR_BOOT_BASE,
134 RD88F5181L_GE_NOR_BOOT_SIZE); 134 RD88F5181L_GE_NOR_BOOT_SIZE);
135 platform_device_register(&rd88f5181l_ge_nor_boot_flash); 135 platform_device_register(&rd88f5181l_ge_nor_boot_flash);
136 136
137 i2c_register_board_info(0, &rd88f5181l_ge_i2c_rtc, 1); 137 i2c_register_board_info(0, &rd88f5181l_ge_i2c_rtc, 1);
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index f9e156725d7c..66e77ec91532 100644
--- a/arch/arm/mach-orion5x/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -264,10 +264,11 @@ static void __init rd88f5182_init(void)
264 orion5x_uart0_init(); 264 orion5x_uart0_init();
265 orion5x_xor_init(); 265 orion5x_xor_init();
266 266
267 orion5x_setup_dev_boot_win(RD88F5182_NOR_BOOT_BASE, 267 mvebu_mbus_add_window("devbus-boot", RD88F5182_NOR_BOOT_BASE,
268 RD88F5182_NOR_BOOT_SIZE); 268 RD88F5182_NOR_BOOT_SIZE);
269 269
270 orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE); 270 mvebu_mbus_add_window("devbus-cs1", RD88F5182_NOR_BASE,
271 RD88F5182_NOR_SIZE);
271 platform_device_register(&rd88f5182_nor_flash); 272 platform_device_register(&rd88f5182_nor_flash);
272 platform_device_register(&rd88f5182_gpio_leds); 273 platform_device_register(&rd88f5182_gpio_leds);
273 274
diff --git a/arch/arm/mach-orion5x/terastation_pro2-setup.c b/arch/arm/mach-orion5x/terastation_pro2-setup.c
index acc0877ec1c9..a0bfa53e7556 100644
--- a/arch/arm/mach-orion5x/terastation_pro2-setup.c
+++ b/arch/arm/mach-orion5x/terastation_pro2-setup.c
@@ -329,8 +329,8 @@ static void __init tsp2_init(void)
329 /* 329 /*
330 * Configure peripherals. 330 * Configure peripherals.
331 */ 331 */
332 orion5x_setup_dev_boot_win(TSP2_NOR_BOOT_BASE, 332 mvebu_mbus_add_window("devbus-boot", TSP2_NOR_BOOT_BASE,
333 TSP2_NOR_BOOT_SIZE); 333 TSP2_NOR_BOOT_SIZE);
334 platform_device_register(&tsp2_nor_flash); 334 platform_device_register(&tsp2_nor_flash);
335 335
336 orion5x_ehci0_init(); 336 orion5x_ehci0_init();
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index 9c17f0c2b488..80174f0f168e 100644
--- a/arch/arm/mach-orion5x/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -286,8 +286,8 @@ static void __init qnap_ts209_init(void)
286 /* 286 /*
287 * Configure peripherals. 287 * Configure peripherals.
288 */ 288 */
289 orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE, 289 mvebu_mbus_add_window("devbus-boot", QNAP_TS209_NOR_BOOT_BASE,
290 QNAP_TS209_NOR_BOOT_SIZE); 290 QNAP_TS209_NOR_BOOT_SIZE);
291 platform_device_register(&qnap_ts209_nor_flash); 291 platform_device_register(&qnap_ts209_nor_flash);
292 292
293 orion5x_ehci0_init(); 293 orion5x_ehci0_init();
diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c
index 8cc5ab6c503e..92592790d6da 100644
--- a/arch/arm/mach-orion5x/ts409-setup.c
+++ b/arch/arm/mach-orion5x/ts409-setup.c
@@ -277,8 +277,8 @@ static void __init qnap_ts409_init(void)
277 /* 277 /*
278 * Configure peripherals. 278 * Configure peripherals.
279 */ 279 */
280 orion5x_setup_dev_boot_win(QNAP_TS409_NOR_BOOT_BASE, 280 mvebu_mbus_add_window("devbus-boot", QNAP_TS409_NOR_BOOT_BASE,
281 QNAP_TS409_NOR_BOOT_SIZE); 281 QNAP_TS409_NOR_BOOT_SIZE);
282 platform_device_register(&qnap_ts409_nor_flash); 282 platform_device_register(&qnap_ts409_nor_flash);
283 283
284 orion5x_ehci0_init(); 284 orion5x_ehci0_init();
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 66552ca7e05d..6b84863c018d 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -127,8 +127,8 @@ static void __init wnr854t_init(void)
127 orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ); 127 orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
128 orion5x_uart0_init(); 128 orion5x_uart0_init();
129 129
130 orion5x_setup_dev_boot_win(WNR854T_NOR_BOOT_BASE, 130 mvebu_mbus_add_window("devbus-boot", WNR854T_NOR_BOOT_BASE,
131 WNR854T_NOR_BOOT_SIZE); 131 WNR854T_NOR_BOOT_SIZE);
132 platform_device_register(&wnr854t_nor_flash); 132 platform_device_register(&wnr854t_nor_flash);
133} 133}
134 134
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index 2c5408e2e689..fae684bc54f2 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -213,8 +213,8 @@ static void __init wrt350n_v2_init(void)
213 orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ); 213 orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
214 orion5x_uart0_init(); 214 orion5x_uart0_init();
215 215
216 orion5x_setup_dev_boot_win(WRT350N_V2_NOR_BOOT_BASE, 216 mvebu_mbus_add_window("devbus-boot", WRT350N_V2_NOR_BOOT_BASE,
217 WRT350N_V2_NOR_BOOT_SIZE); 217 WRT350N_V2_NOR_BOOT_SIZE);
218 platform_device_register(&wrt350n_v2_nor_flash); 218 platform_device_register(&wrt350n_v2_nor_flash);
219 platform_device_register(&wrt350n_v2_leds); 219 platform_device_register(&wrt350n_v2_leds);
220 platform_device_register(&wrt350n_v2_button_device); 220 platform_device_register(&wrt350n_v2_button_device);
diff --git a/arch/arm/mach-spear13xx/spear13xx.c b/arch/arm/mach-spear13xx/spear13xx.c
index c7d2b4a8d8cc..25a10191b021 100644
--- a/arch/arm/mach-spear13xx/spear13xx.c
+++ b/arch/arm/mach-spear13xx/spear13xx.c
@@ -15,12 +15,12 @@
15 15
16#include <linux/amba/pl022.h> 16#include <linux/amba/pl022.h>
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/clocksource.h>
18#include <linux/dw_dmac.h> 19#include <linux/dw_dmac.h>
19#include <linux/err.h> 20#include <linux/err.h>
20#include <linux/of.h> 21#include <linux/of.h>
21#include <asm/hardware/cache-l2x0.h> 22#include <asm/hardware/cache-l2x0.h>
22#include <asm/mach/map.h> 23#include <asm/mach/map.h>
23#include <asm/smp_twd.h>
24#include <mach/dma.h> 24#include <mach/dma.h>
25#include <mach/generic.h> 25#include <mach/generic.h>
26#include <mach/spear.h> 26#include <mach/spear.h>
@@ -179,5 +179,5 @@ void __init spear13xx_timer_init(void)
179 clk_put(pclk); 179 clk_put(pclk);
180 180
181 spear_setup_of_timer(); 181 spear_setup_of_timer();
182 twd_local_timer_of_register(); 182 clocksource_of_init();
183} 183}
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index f6b46ae2b7f8..e40326d0e29f 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -10,6 +10,7 @@ obj-y += pm.o
10obj-y += reset.o 10obj-y += reset.o
11obj-y += reset-handler.o 11obj-y += reset-handler.o
12obj-y += sleep.o 12obj-y += sleep.o
13obj-y += tegra.o
13obj-$(CONFIG_CPU_IDLE) += cpuidle.o 14obj-$(CONFIG_CPU_IDLE) += cpuidle.o
14obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_speedo.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
@@ -27,9 +28,7 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
27obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o 28obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
28obj-$(CONFIG_TEGRA_PCI) += pcie.o 29obj-$(CONFIG_TEGRA_PCI) += pcie.o
29 30
30obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o 31obj-$(CONFIG_ARCH_TEGRA_114_SOC) += tegra114_speedo.o
31obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
32obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra114.o
33ifeq ($(CONFIG_CPU_IDLE),y) 32ifeq ($(CONFIG_CPU_IDLE),y)
34obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o 33obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
35endif 34endif
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c
deleted file mode 100644
index 085d63637b62..000000000000
--- a/arch/arm/mach-tegra/board-dt-tegra114.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * NVIDIA Tegra114 device tree board support
3 *
4 * Copyright (C) 2013 NVIDIA Corporation
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#include <linux/of.h>
18#include <linux/of_platform.h>
19#include <linux/clocksource.h>
20
21#include <asm/mach/arch.h>
22
23#include "board.h"
24#include "common.h"
25
26static void __init tegra114_dt_init(void)
27{
28 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
29}
30
31static const char * const tegra114_dt_board_compat[] = {
32 "nvidia,tegra114",
33 NULL,
34};
35
36DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
37 .smp = smp_ops(tegra_smp_ops),
38 .map_io = tegra_map_common_io,
39 .init_early = tegra114_init_early,
40 .init_irq = tegra_dt_init_irq,
41 .init_time = clocksource_of_init,
42 .init_machine = tegra114_dt_init,
43 .init_late = tegra_init_late,
44 .restart = tegra_assert_system_reset,
45 .dt_compat = tegra114_dt_board_compat,
46MACHINE_END
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
deleted file mode 100644
index bf68567e549d..000000000000
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * arch/arm/mach-tegra/board-dt-tegra30.c
3 *
4 * NVIDIA Tegra30 device tree board support
5 *
6 * Copyright (C) 2011 NVIDIA Corporation
7 *
8 * Derived from:
9 *
10 * arch/arm/mach-tegra/board-dt-tegra20.c
11 *
12 * Copyright (C) 2010 Secret Lab Technologies, Ltd.
13 * Copyright (C) 2010 Google, Inc.
14 *
15 * This software is licensed under the terms of the GNU General Public
16 * License version 2, as published by the Free Software Foundation, and
17 * may be copied, distributed, and modified under those terms.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 */
25
26#include <linux/clocksource.h>
27#include <linux/kernel.h>
28#include <linux/of.h>
29#include <linux/of_address.h>
30#include <linux/of_fdt.h>
31#include <linux/of_irq.h>
32#include <linux/of_platform.h>
33
34#include <asm/mach/arch.h>
35
36#include "board.h"
37#include "common.h"
38#include "iomap.h"
39
40static void __init tegra30_dt_init(void)
41{
42 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
43}
44
45static const char *tegra30_dt_board_compat[] = {
46 "nvidia,tegra30",
47 NULL
48};
49
50DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
51 .smp = smp_ops(tegra_smp_ops),
52 .map_io = tegra_map_common_io,
53 .init_early = tegra30_init_early,
54 .init_irq = tegra_dt_init_irq,
55 .init_time = clocksource_of_init,
56 .init_machine = tegra30_dt_init,
57 .init_late = tegra_init_late,
58 .restart = tegra_assert_system_reset,
59 .dt_compat = tegra30_dt_board_compat,
60MACHINE_END
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c
index 3cdc1bb8254c..d195db09ea32 100644
--- a/arch/arm/mach-tegra/board-harmony-pcie.c
+++ b/arch/arm/mach-tegra/board-harmony-pcie.c
@@ -62,7 +62,11 @@ int __init harmony_pcie_init(void)
62 goto err_reg; 62 goto err_reg;
63 } 63 }
64 64
65 regulator_enable(regulator); 65 err = regulator_enable(regulator);
66 if (err) {
67 pr_err("%s: regulator_enable failed: %d\n", __func__, err);
68 goto err_en;
69 }
66 70
67 err = tegra_pcie_init(true, true); 71 err = tegra_pcie_init(true, true);
68 if (err) { 72 if (err) {
@@ -74,6 +78,7 @@ int __init harmony_pcie_init(void)
74 78
75err_pcie: 79err_pcie:
76 regulator_disable(regulator); 80 regulator_disable(regulator);
81err_en:
77 regulator_put(regulator); 82 regulator_put(regulator);
78err_reg: 83err_reg:
79 gpio_free(en_vdd_1v05); 84 gpio_free(en_vdd_1v05);
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 86851c81a350..60431de585ca 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -26,9 +26,7 @@
26 26
27void tegra_assert_system_reset(char mode, const char *cmd); 27void tegra_assert_system_reset(char mode, const char *cmd);
28 28
29void __init tegra20_init_early(void); 29void __init tegra_init_early(void);
30void __init tegra30_init_early(void);
31void __init tegra114_init_early(void);
32void __init tegra_map_common_io(void); 30void __init tegra_map_common_io(void);
33void __init tegra_init_irq(void); 31void __init tegra_init_irq(void);
34void __init tegra_dt_init_irq(void); 32void __init tegra_dt_init_irq(void);
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 5449a3f2977b..eb1f3c8c74cc 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -33,6 +33,7 @@
33#include "common.h" 33#include "common.h"
34#include "fuse.h" 34#include "fuse.h"
35#include "iomap.h" 35#include "iomap.h"
36#include "irq.h"
36#include "pmc.h" 37#include "pmc.h"
37#include "apbio.h" 38#include "apbio.h"
38#include "sleep.h" 39#include "sleep.h"
@@ -61,8 +62,10 @@ u32 tegra_uart_config[4] = {
61void __init tegra_dt_init_irq(void) 62void __init tegra_dt_init_irq(void)
62{ 63{
63 tegra_clocks_init(); 64 tegra_clocks_init();
65 tegra_pmc_init();
64 tegra_init_irq(); 66 tegra_init_irq();
65 irqchip_init(); 67 irqchip_init();
68 tegra_legacy_irq_syscore_init();
66} 69}
67#endif 70#endif
68 71
@@ -94,40 +97,18 @@ static void __init tegra_init_cache(void)
94 97
95} 98}
96 99
97static void __init tegra_init_early(void) 100void __init tegra_init_early(void)
98{ 101{
99 tegra_cpu_reset_handler_init(); 102 tegra_cpu_reset_handler_init();
100 tegra_apb_io_init(); 103 tegra_apb_io_init();
101 tegra_init_fuse(); 104 tegra_init_fuse();
102 tegra_init_cache(); 105 tegra_init_cache();
103 tegra_pmc_init();
104 tegra_powergate_init(); 106 tegra_powergate_init();
107 tegra_hotplug_init();
105} 108}
106 109
107#ifdef CONFIG_ARCH_TEGRA_2x_SOC
108void __init tegra20_init_early(void)
109{
110 tegra_init_early();
111 tegra20_hotplug_init();
112}
113#endif
114
115#ifdef CONFIG_ARCH_TEGRA_3x_SOC
116void __init tegra30_init_early(void)
117{
118 tegra_init_early();
119 tegra30_hotplug_init();
120}
121#endif
122
123#ifdef CONFIG_ARCH_TEGRA_114_SOC
124void __init tegra114_init_early(void)
125{
126 tegra_init_early();
127}
128#endif
129
130void __init tegra_init_late(void) 110void __init tegra_init_late(void)
131{ 111{
112 tegra_init_suspend();
132 tegra_powergate_debugfs_init(); 113 tegra_powergate_debugfs_init();
133} 114}
diff --git a/arch/arm/mach-tegra/cpuidle-tegra20.c b/arch/arm/mach-tegra/cpuidle-tegra20.c
index 825ced4f7a40..8bbbdebed882 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra20.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra20.c
@@ -130,10 +130,6 @@ static bool tegra20_cpu_cluster_power_down(struct cpuidle_device *dev,
130 struct cpuidle_driver *drv, 130 struct cpuidle_driver *drv,
131 int index) 131 int index)
132{ 132{
133 struct cpuidle_state *state = &drv->states[index];
134 u32 cpu_on_time = state->exit_latency;
135 u32 cpu_off_time = state->target_residency - state->exit_latency;
136
137 while (tegra20_cpu_is_resettable_soon()) 133 while (tegra20_cpu_is_resettable_soon())
138 cpu_relax(); 134 cpu_relax();
139 135
@@ -142,7 +138,7 @@ static bool tegra20_cpu_cluster_power_down(struct cpuidle_device *dev,
142 138
143 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu); 139 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
144 140
145 tegra_idle_lp2_last(cpu_on_time, cpu_off_time); 141 tegra_idle_lp2_last();
146 142
147 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu); 143 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
148 144
diff --git a/arch/arm/mach-tegra/cpuidle-tegra30.c b/arch/arm/mach-tegra/cpuidle-tegra30.c
index 8b50cf4ddd6f..c0931c8bb3e5 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra30.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra30.c
@@ -72,10 +72,6 @@ static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev,
72 struct cpuidle_driver *drv, 72 struct cpuidle_driver *drv,
73 int index) 73 int index)
74{ 74{
75 struct cpuidle_state *state = &drv->states[index];
76 u32 cpu_on_time = state->exit_latency;
77 u32 cpu_off_time = state->target_residency - state->exit_latency;
78
79 /* All CPUs entering LP2 is not working. 75 /* All CPUs entering LP2 is not working.
80 * Don't let CPU0 enter LP2 when any secondary CPU is online. 76 * Don't let CPU0 enter LP2 when any secondary CPU is online.
81 */ 77 */
@@ -86,7 +82,7 @@ static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev,
86 82
87 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu); 83 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
88 84
89 tegra_idle_lp2_last(cpu_on_time, cpu_off_time); 85 tegra_idle_lp2_last();
90 86
91 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu); 87 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
92 88
@@ -102,12 +98,8 @@ static bool tegra30_cpu_core_power_down(struct cpuidle_device *dev,
102 98
103 smp_wmb(); 99 smp_wmb();
104 100
105 save_cpu_arch_register();
106
107 cpu_suspend(0, tegra30_sleep_cpu_secondary_finish); 101 cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
108 102
109 restore_cpu_arch_register();
110
111 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu); 103 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
112 104
113 return true; 105 return true;
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
index f7db0782a6b6..e035cd284a6e 100644
--- a/arch/arm/mach-tegra/fuse.c
+++ b/arch/arm/mach-tegra/fuse.c
@@ -2,6 +2,7 @@
2 * arch/arm/mach-tegra/fuse.c 2 * arch/arm/mach-tegra/fuse.c
3 * 3 *
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
5 * 6 *
6 * Author: 7 * Author:
7 * Colin Cross <ccross@android.com> 8 * Colin Cross <ccross@android.com>
@@ -137,6 +138,9 @@ void tegra_init_fuse(void)
137 tegra_fuse_spare_bit = TEGRA30_FUSE_SPARE_BIT; 138 tegra_fuse_spare_bit = TEGRA30_FUSE_SPARE_BIT;
138 tegra_init_speedo_data = &tegra30_init_speedo_data; 139 tegra_init_speedo_data = &tegra30_init_speedo_data;
139 break; 140 break;
141 case TEGRA114:
142 tegra_init_speedo_data = &tegra114_init_speedo_data;
143 break;
140 default: 144 default:
141 pr_warn("Tegra: unknown chip id %d\n", tegra_chip_id); 145 pr_warn("Tegra: unknown chip id %d\n", tegra_chip_id);
142 tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT; 146 tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT;
diff --git a/arch/arm/mach-tegra/fuse.h b/arch/arm/mach-tegra/fuse.h
index da78434678c7..aacc00d05980 100644
--- a/arch/arm/mach-tegra/fuse.h
+++ b/arch/arm/mach-tegra/fuse.h
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (C) 2010 Google, Inc. 2 * Copyright (C) 2010 Google, Inc.
3 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
3 * 4 *
4 * Author: 5 * Author:
5 * Colin Cross <ccross@android.com> 6 * Colin Cross <ccross@android.com>
@@ -66,4 +67,10 @@ void tegra30_init_speedo_data(void);
66static inline void tegra30_init_speedo_data(void) {} 67static inline void tegra30_init_speedo_data(void) {}
67#endif 68#endif
68 69
70#ifdef CONFIG_ARCH_TEGRA_114_SOC
71void tegra114_init_speedo_data(void);
72#else
73static inline void tegra114_init_speedo_data(void) {}
74#endif
75
69#endif 76#endif
diff --git a/arch/arm/mach-tegra/headsmp.S b/arch/arm/mach-tegra/headsmp.S
index fd473f2b4c3d..045c16f2dd51 100644
--- a/arch/arm/mach-tegra/headsmp.S
+++ b/arch/arm/mach-tegra/headsmp.S
@@ -7,8 +7,5 @@
7 7
8ENTRY(tegra_secondary_startup) 8ENTRY(tegra_secondary_startup)
9 bl v7_invalidate_l1 9 bl v7_invalidate_l1
10 /* Enable coresight */
11 mov32 r0, 0xC5ACCE55
12 mcr p14, 0, r0, c7, c12, 6
13 b secondary_startup 10 b secondary_startup
14ENDPROC(tegra_secondary_startup) 11ENDPROC(tegra_secondary_startup)
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index a599f6e36dea..8da9f78475da 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -1,8 +1,7 @@
1/* 1/*
2 *
3 * Copyright (C) 2002 ARM Ltd. 2 * Copyright (C) 2002 ARM Ltd.
4 * All Rights Reserved 3 * All Rights Reserved
5 * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved. 4 * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
6 * 5 *
7 * 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
8 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -15,6 +14,7 @@
15#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
16#include <asm/smp_plat.h> 15#include <asm/smp_plat.h>
17 16
17#include "fuse.h"
18#include "sleep.h" 18#include "sleep.h"
19 19
20static void (*tegra_hotplug_shutdown)(void); 20static void (*tegra_hotplug_shutdown)(void);
@@ -56,18 +56,13 @@ int tegra_cpu_disable(unsigned int cpu)
56 return cpu == 0 ? -EPERM : 0; 56 return cpu == 0 ? -EPERM : 0;
57} 57}
58 58
59#ifdef CONFIG_ARCH_TEGRA_2x_SOC 59void __init tegra_hotplug_init(void)
60extern void tegra20_hotplug_shutdown(void);
61void __init tegra20_hotplug_init(void)
62{ 60{
63 tegra_hotplug_shutdown = tegra20_hotplug_shutdown; 61 if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
64} 62 return;
65#endif
66 63
67#ifdef CONFIG_ARCH_TEGRA_3x_SOC 64 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20)
68extern void tegra30_hotplug_shutdown(void); 65 tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
69void __init tegra30_hotplug_init(void) 66 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30)
70{ 67 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
71 tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
72} 68}
73#endif
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index 1952e82797cc..0de4eed1493d 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -4,7 +4,7 @@
4 * Author: 4 * Author:
5 * Colin Cross <ccross@android.com> 5 * Colin Cross <ccross@android.com>
6 * 6 *
7 * Copyright (C) 2010, NVIDIA Corporation 7 * Copyright (C) 2010,2013, NVIDIA Corporation
8 * 8 *
9 * This software is licensed under the terms of the GNU General Public 9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and 10 * License version 2, as published by the Free Software Foundation, and
@@ -23,6 +23,7 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/of.h> 24#include <linux/of.h>
25#include <linux/irqchip/arm-gic.h> 25#include <linux/irqchip/arm-gic.h>
26#include <linux/syscore_ops.h>
26 27
27#include "board.h" 28#include "board.h"
28#include "iomap.h" 29#include "iomap.h"
@@ -43,6 +44,7 @@
43#define ICTLR_COP_IEP_CLASS 0x3c 44#define ICTLR_COP_IEP_CLASS 0x3c
44 45
45#define FIRST_LEGACY_IRQ 32 46#define FIRST_LEGACY_IRQ 32
47#define TEGRA_MAX_NUM_ICTLRS 5
46 48
47#define SGI_MASK 0xFFFF 49#define SGI_MASK 0xFFFF
48 50
@@ -56,6 +58,15 @@ static void __iomem *ictlr_reg_base[] = {
56 IO_ADDRESS(TEGRA_QUINARY_ICTLR_BASE), 58 IO_ADDRESS(TEGRA_QUINARY_ICTLR_BASE),
57}; 59};
58 60
61#ifdef CONFIG_PM_SLEEP
62static u32 cop_ier[TEGRA_MAX_NUM_ICTLRS];
63static u32 cop_iep[TEGRA_MAX_NUM_ICTLRS];
64static u32 cpu_ier[TEGRA_MAX_NUM_ICTLRS];
65static u32 cpu_iep[TEGRA_MAX_NUM_ICTLRS];
66
67static u32 ictlr_wake_mask[TEGRA_MAX_NUM_ICTLRS];
68#endif
69
59bool tegra_pending_sgi(void) 70bool tegra_pending_sgi(void)
60{ 71{
61 u32 pending_set; 72 u32 pending_set;
@@ -125,6 +136,87 @@ static int tegra_retrigger(struct irq_data *d)
125 return 1; 136 return 1;
126} 137}
127 138
139#ifdef CONFIG_PM_SLEEP
140static int tegra_set_wake(struct irq_data *d, unsigned int enable)
141{
142 u32 irq = d->irq;
143 u32 index, mask;
144
145 if (irq < FIRST_LEGACY_IRQ ||
146 irq >= FIRST_LEGACY_IRQ + num_ictlrs * 32)
147 return -EINVAL;
148
149 index = ((irq - FIRST_LEGACY_IRQ) / 32);
150 mask = BIT((irq - FIRST_LEGACY_IRQ) % 32);
151 if (enable)
152 ictlr_wake_mask[index] |= mask;
153 else
154 ictlr_wake_mask[index] &= ~mask;
155
156 return 0;
157}
158
159static int tegra_legacy_irq_suspend(void)
160{
161 unsigned long flags;
162 int i;
163
164 local_irq_save(flags);
165 for (i = 0; i < num_ictlrs; i++) {
166 void __iomem *ictlr = ictlr_reg_base[i];
167 /* Save interrupt state */
168 cpu_ier[i] = readl_relaxed(ictlr + ICTLR_CPU_IER);
169 cpu_iep[i] = readl_relaxed(ictlr + ICTLR_CPU_IEP_CLASS);
170 cop_ier[i] = readl_relaxed(ictlr + ICTLR_COP_IER);
171 cop_iep[i] = readl_relaxed(ictlr + ICTLR_COP_IEP_CLASS);
172
173 /* Disable COP interrupts */
174 writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR);
175
176 /* Disable CPU interrupts */
177 writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR);
178
179 /* Enable the wakeup sources of ictlr */
180 writel_relaxed(ictlr_wake_mask[i], ictlr + ICTLR_CPU_IER_SET);
181 }
182 local_irq_restore(flags);
183
184 return 0;
185}
186
187static void tegra_legacy_irq_resume(void)
188{
189 unsigned long flags;
190 int i;
191
192 local_irq_save(flags);
193 for (i = 0; i < num_ictlrs; i++) {
194 void __iomem *ictlr = ictlr_reg_base[i];
195 writel_relaxed(cpu_iep[i], ictlr + ICTLR_CPU_IEP_CLASS);
196 writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR);
197 writel_relaxed(cpu_ier[i], ictlr + ICTLR_CPU_IER_SET);
198 writel_relaxed(cop_iep[i], ictlr + ICTLR_COP_IEP_CLASS);
199 writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR);
200 writel_relaxed(cop_ier[i], ictlr + ICTLR_COP_IER_SET);
201 }
202 local_irq_restore(flags);
203}
204
205static struct syscore_ops tegra_legacy_irq_syscore_ops = {
206 .suspend = tegra_legacy_irq_suspend,
207 .resume = tegra_legacy_irq_resume,
208};
209
210int tegra_legacy_irq_syscore_init(void)
211{
212 register_syscore_ops(&tegra_legacy_irq_syscore_ops);
213
214 return 0;
215}
216#else
217#define tegra_set_wake NULL
218#endif
219
128void __init tegra_init_irq(void) 220void __init tegra_init_irq(void)
129{ 221{
130 int i; 222 int i;
@@ -150,6 +242,8 @@ void __init tegra_init_irq(void)
150 gic_arch_extn.irq_mask = tegra_mask; 242 gic_arch_extn.irq_mask = tegra_mask;
151 gic_arch_extn.irq_unmask = tegra_unmask; 243 gic_arch_extn.irq_unmask = tegra_unmask;
152 gic_arch_extn.irq_retrigger = tegra_retrigger; 244 gic_arch_extn.irq_retrigger = tegra_retrigger;
245 gic_arch_extn.irq_set_wake = tegra_set_wake;
246 gic_arch_extn.flags = IRQCHIP_MASK_ON_SUSPEND;
153 247
154 /* 248 /*
155 * Check if there is a devicetree present, since the GIC will be 249 * Check if there is a devicetree present, since the GIC will be
diff --git a/arch/arm/mach-tegra/irq.h b/arch/arm/mach-tegra/irq.h
index 5142649bba05..bc05ce5613fb 100644
--- a/arch/arm/mach-tegra/irq.h
+++ b/arch/arm/mach-tegra/irq.h
@@ -19,4 +19,10 @@
19 19
20bool tegra_pending_sgi(void); 20bool tegra_pending_sgi(void);
21 21
22#ifdef CONFIG_PM_SLEEP
23int tegra_legacy_irq_syscore_init(void);
24#else
25static inline int tegra_legacy_irq_syscore_init(void) { return 0; }
26#endif
27
22#endif 28#endif
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 2c6b3d55213b..516aab28fe34 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -26,22 +26,16 @@
26#include <asm/smp_scu.h> 26#include <asm/smp_scu.h>
27#include <asm/smp_plat.h> 27#include <asm/smp_plat.h>
28 28
29#include <mach/powergate.h>
30
31#include "fuse.h" 29#include "fuse.h"
32#include "flowctrl.h" 30#include "flowctrl.h"
33#include "reset.h" 31#include "reset.h"
32#include "pmc.h"
34 33
35#include "common.h" 34#include "common.h"
36#include "iomap.h" 35#include "iomap.h"
37 36
38extern void tegra_secondary_startup(void);
39
40static cpumask_t tegra_cpu_init_mask; 37static cpumask_t tegra_cpu_init_mask;
41 38
42#define EVP_CPU_RESET_VECTOR \
43 (IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100)
44
45static void __cpuinit tegra_secondary_init(unsigned int cpu) 39static void __cpuinit tegra_secondary_init(unsigned int cpu)
46{ 40{
47 /* 41 /*
@@ -54,25 +48,43 @@ static void __cpuinit tegra_secondary_init(unsigned int cpu)
54 cpumask_set_cpu(cpu, &tegra_cpu_init_mask); 48 cpumask_set_cpu(cpu, &tegra_cpu_init_mask);
55} 49}
56 50
57static int tegra20_power_up_cpu(unsigned int cpu) 51
52static int tegra20_boot_secondary(unsigned int cpu, struct task_struct *idle)
58{ 53{
59 /* Enable the CPU clock. */ 54 cpu = cpu_logical_map(cpu);
60 tegra_enable_cpu_clock(cpu); 55
56 /*
57 * Force the CPU into reset. The CPU must remain in reset when
58 * the flow controller state is cleared (which will cause the
59 * flow controller to stop driving reset if the CPU has been
60 * power-gated via the flow controller). This will have no
61 * effect on first boot of the CPU since it should already be
62 * in reset.
63 */
64 tegra_put_cpu_in_reset(cpu);
61 65
62 /* Clear flow controller CSR. */ 66 /*
63 flowctrl_write_cpu_csr(cpu, 0); 67 * Unhalt the CPU. If the flow controller was used to
68 * power-gate the CPU this will cause the flow controller to
69 * stop driving reset. The CPU will remain in reset because the
70 * clock and reset block is now driving reset.
71 */
72 flowctrl_write_cpu_halt(cpu, 0);
64 73
74 tegra_enable_cpu_clock(cpu);
75 flowctrl_write_cpu_csr(cpu, 0); /* Clear flow controller CSR. */
76 tegra_cpu_out_of_reset(cpu);
65 return 0; 77 return 0;
66} 78}
67 79
68static int tegra30_power_up_cpu(unsigned int cpu) 80static int tegra30_boot_secondary(unsigned int cpu, struct task_struct *idle)
69{ 81{
70 int ret, pwrgateid; 82 int ret;
71 unsigned long timeout; 83 unsigned long timeout;
72 84
73 pwrgateid = tegra_cpu_powergate_id(cpu); 85 cpu = cpu_logical_map(cpu);
74 if (pwrgateid < 0) 86 tegra_put_cpu_in_reset(cpu);
75 return pwrgateid; 87 flowctrl_write_cpu_halt(cpu, 0);
76 88
77 /* 89 /*
78 * The power up sequence of cold boot CPU and warm boot CPU 90 * The power up sequence of cold boot CPU and warm boot CPU
@@ -85,13 +97,13 @@ static int tegra30_power_up_cpu(unsigned int cpu)
85 * the IO clamps. 97 * the IO clamps.
86 * For cold boot CPU, do not wait. After the cold boot CPU be 98 * For cold boot CPU, do not wait. After the cold boot CPU be
87 * booted, it will run to tegra_secondary_init() and set 99 * booted, it will run to tegra_secondary_init() and set
88 * tegra_cpu_init_mask which influences what tegra30_power_up_cpu() 100 * tegra_cpu_init_mask which influences what tegra30_boot_secondary()
89 * next time around. 101 * next time around.
90 */ 102 */
91 if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) { 103 if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) {
92 timeout = jiffies + msecs_to_jiffies(50); 104 timeout = jiffies + msecs_to_jiffies(50);
93 do { 105 do {
94 if (!tegra_powergate_is_powered(pwrgateid)) 106 if (tegra_pmc_cpu_is_powered(cpu))
95 goto remove_clamps; 107 goto remove_clamps;
96 udelay(10); 108 udelay(10);
97 } while (time_before(jiffies, timeout)); 109 } while (time_before(jiffies, timeout));
@@ -103,14 +115,14 @@ static int tegra30_power_up_cpu(unsigned int cpu)
103 * be un-gated by un-toggling the power gate register 115 * be un-gated by un-toggling the power gate register
104 * manually. 116 * manually.
105 */ 117 */
106 if (!tegra_powergate_is_powered(pwrgateid)) { 118 if (!tegra_pmc_cpu_is_powered(cpu)) {
107 ret = tegra_powergate_power_on(pwrgateid); 119 ret = tegra_pmc_cpu_power_on(cpu);
108 if (ret) 120 if (ret)
109 return ret; 121 return ret;
110 122
111 /* Wait for the power to come up. */ 123 /* Wait for the power to come up. */
112 timeout = jiffies + msecs_to_jiffies(100); 124 timeout = jiffies + msecs_to_jiffies(100);
113 while (tegra_powergate_is_powered(pwrgateid)) { 125 while (tegra_pmc_cpu_is_powered(cpu)) {
114 if (time_after(jiffies, timeout)) 126 if (time_after(jiffies, timeout))
115 return -ETIMEDOUT; 127 return -ETIMEDOUT;
116 udelay(10); 128 udelay(10);
@@ -123,57 +135,34 @@ remove_clamps:
123 udelay(10); 135 udelay(10);
124 136
125 /* Remove I/O clamps. */ 137 /* Remove I/O clamps. */
126 ret = tegra_powergate_remove_clamping(pwrgateid); 138 ret = tegra_pmc_cpu_remove_clamping(cpu);
127 udelay(10); 139 if (ret)
140 return ret;
128 141
129 /* Clear flow controller CSR. */ 142 udelay(10);
130 flowctrl_write_cpu_csr(cpu, 0);
131 143
144 flowctrl_write_cpu_csr(cpu, 0); /* Clear flow controller CSR. */
145 tegra_cpu_out_of_reset(cpu);
132 return 0; 146 return 0;
133} 147}
134 148
135static int __cpuinit tegra_boot_secondary(unsigned int cpu, struct task_struct *idle) 149static int tegra114_boot_secondary(unsigned int cpu, struct task_struct *idle)
136{ 150{
137 int status;
138
139 cpu = cpu_logical_map(cpu); 151 cpu = cpu_logical_map(cpu);
152 return tegra_pmc_cpu_power_on(cpu);
153}
140 154
141 /* 155static int __cpuinit tegra_boot_secondary(unsigned int cpu,
142 * Force the CPU into reset. The CPU must remain in reset when the 156 struct task_struct *idle)
143 * flow controller state is cleared (which will cause the flow 157{
144 * controller to stop driving reset if the CPU has been power-gated 158 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && tegra_chip_id == TEGRA20)
145 * via the flow controller). This will have no effect on first boot 159 return tegra20_boot_secondary(cpu, idle);
146 * of the CPU since it should already be in reset. 160 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC) && tegra_chip_id == TEGRA30)
147 */ 161 return tegra30_boot_secondary(cpu, idle);
148 tegra_put_cpu_in_reset(cpu); 162 if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) && tegra_chip_id == TEGRA114)
149 163 return tegra114_boot_secondary(cpu, idle);
150 /* 164
151 * Unhalt the CPU. If the flow controller was used to power-gate the 165 return -EINVAL;
152 * CPU this will cause the flow controller to stop driving reset.
153 * The CPU will remain in reset because the clock and reset block
154 * is now driving reset.
155 */
156 flowctrl_write_cpu_halt(cpu, 0);
157
158 switch (tegra_chip_id) {
159 case TEGRA20:
160 status = tegra20_power_up_cpu(cpu);
161 break;
162 case TEGRA30:
163 status = tegra30_power_up_cpu(cpu);
164 break;
165 default:
166 status = -EINVAL;
167 break;
168 }
169
170 if (status)
171 goto done;
172
173 /* Take the CPU out of reset. */
174 tegra_cpu_out_of_reset(cpu);
175done:
176 return status;
177} 166}
178 167
179static void __init tegra_smp_prepare_cpus(unsigned int max_cpus) 168static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index 523604de666f..84d8742bdb1e 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -22,7 +22,7 @@
22#include <linux/cpumask.h> 22#include <linux/cpumask.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/cpu_pm.h> 24#include <linux/cpu_pm.h>
25#include <linux/clk.h> 25#include <linux/suspend.h>
26#include <linux/err.h> 26#include <linux/err.h>
27#include <linux/clk/tegra.h> 27#include <linux/clk/tegra.h>
28 28
@@ -37,67 +37,14 @@
37#include "reset.h" 37#include "reset.h"
38#include "flowctrl.h" 38#include "flowctrl.h"
39#include "fuse.h" 39#include "fuse.h"
40#include "pmc.h"
40#include "sleep.h" 41#include "sleep.h"
41 42#include "pmc.h"
42#define TEGRA_POWER_CPU_PWRREQ_OE (1 << 16) /* CPU pwr req enable */
43
44#define PMC_CTRL 0x0
45#define PMC_CPUPWRGOOD_TIMER 0xc8
46#define PMC_CPUPWROFF_TIMER 0xcc
47 43
48#ifdef CONFIG_PM_SLEEP 44#ifdef CONFIG_PM_SLEEP
49static unsigned int g_diag_reg;
50static DEFINE_SPINLOCK(tegra_lp2_lock); 45static DEFINE_SPINLOCK(tegra_lp2_lock);
51static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
52static struct clk *tegra_pclk;
53void (*tegra_tear_down_cpu)(void); 46void (*tegra_tear_down_cpu)(void);
54 47
55void save_cpu_arch_register(void)
56{
57 /* read diagnostic register */
58 asm("mrc p15, 0, %0, c15, c0, 1" : "=r"(g_diag_reg) : : "cc");
59 return;
60}
61
62void restore_cpu_arch_register(void)
63{
64 /* write diagnostic register */
65 asm("mcr p15, 0, %0, c15, c0, 1" : : "r"(g_diag_reg) : "cc");
66 return;
67}
68
69static void set_power_timers(unsigned long us_on, unsigned long us_off)
70{
71 unsigned long long ticks;
72 unsigned long long pclk;
73 unsigned long rate;
74 static unsigned long tegra_last_pclk;
75
76 if (tegra_pclk == NULL) {
77 tegra_pclk = clk_get_sys(NULL, "pclk");
78 WARN_ON(IS_ERR(tegra_pclk));
79 }
80
81 rate = clk_get_rate(tegra_pclk);
82
83 if (WARN_ON_ONCE(rate <= 0))
84 pclk = 100000000;
85 else
86 pclk = rate;
87
88 if ((rate != tegra_last_pclk)) {
89 ticks = (us_on * pclk) + 999999ull;
90 do_div(ticks, 1000000);
91 writel((unsigned long)ticks, pmc + PMC_CPUPWRGOOD_TIMER);
92
93 ticks = (us_off * pclk) + 999999ull;
94 do_div(ticks, 1000000);
95 writel((unsigned long)ticks, pmc + PMC_CPUPWROFF_TIMER);
96 wmb();
97 }
98 tegra_last_pclk = pclk;
99}
100
101/* 48/*
102 * restore_cpu_complex 49 * restore_cpu_complex
103 * 50 *
@@ -119,8 +66,6 @@ static void restore_cpu_complex(void)
119 tegra_cpu_clock_resume(); 66 tegra_cpu_clock_resume();
120 67
121 flowctrl_cpu_suspend_exit(cpu); 68 flowctrl_cpu_suspend_exit(cpu);
122
123 restore_cpu_arch_register();
124} 69}
125 70
126/* 71/*
@@ -145,8 +90,6 @@ static void suspend_cpu_complex(void)
145 tegra_cpu_clock_suspend(); 90 tegra_cpu_clock_suspend();
146 91
147 flowctrl_cpu_suspend_enter(cpu); 92 flowctrl_cpu_suspend_enter(cpu);
148
149 save_cpu_arch_register();
150} 93}
151 94
152void tegra_clear_cpu_in_lp2(int phy_cpu_id) 95void tegra_clear_cpu_in_lp2(int phy_cpu_id)
@@ -197,16 +140,9 @@ static int tegra_sleep_cpu(unsigned long v2p)
197 return 0; 140 return 0;
198} 141}
199 142
200void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time) 143void tegra_idle_lp2_last(void)
201{ 144{
202 u32 mode; 145 tegra_pmc_pm_set(TEGRA_SUSPEND_LP2);
203
204 /* Only the last cpu down does the final suspend steps */
205 mode = readl(pmc + PMC_CTRL);
206 mode |= TEGRA_POWER_CPU_PWRREQ_OE;
207 writel(mode, pmc + PMC_CTRL);
208
209 set_power_timers(cpu_on_time, cpu_off_time);
210 146
211 cpu_cluster_pm_enter(); 147 cpu_cluster_pm_enter();
212 suspend_cpu_complex(); 148 suspend_cpu_complex();
@@ -216,4 +152,81 @@ void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time)
216 restore_cpu_complex(); 152 restore_cpu_complex();
217 cpu_cluster_pm_exit(); 153 cpu_cluster_pm_exit();
218} 154}
155
156enum tegra_suspend_mode tegra_pm_validate_suspend_mode(
157 enum tegra_suspend_mode mode)
158{
159 /* Tegra114 didn't support any suspending mode yet. */
160 if (tegra_chip_id == TEGRA114)
161 return TEGRA_SUSPEND_NONE;
162
163 /*
164 * The Tegra devices only support suspending to LP2 currently.
165 */
166 if (mode > TEGRA_SUSPEND_LP2)
167 return TEGRA_SUSPEND_LP2;
168
169 return mode;
170}
171
172static const char *lp_state[TEGRA_MAX_SUSPEND_MODE] = {
173 [TEGRA_SUSPEND_NONE] = "none",
174 [TEGRA_SUSPEND_LP2] = "LP2",
175 [TEGRA_SUSPEND_LP1] = "LP1",
176 [TEGRA_SUSPEND_LP0] = "LP0",
177};
178
179static int __cpuinit tegra_suspend_enter(suspend_state_t state)
180{
181 enum tegra_suspend_mode mode = tegra_pmc_get_suspend_mode();
182
183 if (WARN_ON(mode < TEGRA_SUSPEND_NONE ||
184 mode >= TEGRA_MAX_SUSPEND_MODE))
185 return -EINVAL;
186
187 pr_info("Entering suspend state %s\n", lp_state[mode]);
188
189 tegra_pmc_pm_set(mode);
190
191 local_fiq_disable();
192
193 suspend_cpu_complex();
194 switch (mode) {
195 case TEGRA_SUSPEND_LP2:
196 tegra_set_cpu_in_lp2(0);
197 break;
198 default:
199 break;
200 }
201
202 cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu);
203
204 switch (mode) {
205 case TEGRA_SUSPEND_LP2:
206 tegra_clear_cpu_in_lp2(0);
207 break;
208 default:
209 break;
210 }
211 restore_cpu_complex();
212
213 local_fiq_enable();
214
215 return 0;
216}
217
218static const struct platform_suspend_ops tegra_suspend_ops = {
219 .valid = suspend_valid_only_mem,
220 .enter = tegra_suspend_enter,
221};
222
223void __init tegra_init_suspend(void)
224{
225 if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NONE)
226 return;
227
228 tegra_pmc_suspend_init();
229
230 suspend_set_ops(&tegra_suspend_ops);
231}
219#endif 232#endif
diff --git a/arch/arm/mach-tegra/pm.h b/arch/arm/mach-tegra/pm.h
index 787335cc964c..9d2d038bf12e 100644
--- a/arch/arm/mach-tegra/pm.h
+++ b/arch/arm/mach-tegra/pm.h
@@ -21,6 +21,8 @@
21#ifndef _MACH_TEGRA_PM_H_ 21#ifndef _MACH_TEGRA_PM_H_
22#define _MACH_TEGRA_PM_H_ 22#define _MACH_TEGRA_PM_H_
23 23
24#include "pmc.h"
25
24extern unsigned long l2x0_saved_regs_addr; 26extern unsigned long l2x0_saved_regs_addr;
25 27
26void save_cpu_arch_register(void); 28void save_cpu_arch_register(void);
@@ -29,7 +31,20 @@ void restore_cpu_arch_register(void);
29void tegra_clear_cpu_in_lp2(int phy_cpu_id); 31void tegra_clear_cpu_in_lp2(int phy_cpu_id);
30bool tegra_set_cpu_in_lp2(int phy_cpu_id); 32bool tegra_set_cpu_in_lp2(int phy_cpu_id);
31 33
32void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time); 34void tegra_idle_lp2_last(void);
33extern void (*tegra_tear_down_cpu)(void); 35extern void (*tegra_tear_down_cpu)(void);
34 36
37#ifdef CONFIG_PM_SLEEP
38enum tegra_suspend_mode tegra_pm_validate_suspend_mode(
39 enum tegra_suspend_mode mode);
40void tegra_init_suspend(void);
41#else
42enum tegra_suspend_mode tegra_pm_validate_suspend_mode(
43 enum tegra_suspend_mode mode)
44{
45 return TEGRA_SUSPEND_NONE;
46}
47static inline void tegra_init_suspend(void) {}
48#endif
49
35#endif /* _MACH_TEGRA_PM_H_ */ 50#endif /* _MACH_TEGRA_PM_H_ */
diff --git a/arch/arm/mach-tegra/pmc.c b/arch/arm/mach-tegra/pmc.c
index d4fdb5fcec20..32360e540ce6 100644
--- a/arch/arm/mach-tegra/pmc.c
+++ b/arch/arm/mach-tegra/pmc.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved. 2 * Copyright (C) 2012,2013 NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 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, 5 * under the terms and conditions of the GNU General Public License,
@@ -16,59 +16,313 @@
16 */ 16 */
17 17
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/clk.h>
19#include <linux/io.h> 20#include <linux/io.h>
20#include <linux/of.h> 21#include <linux/of.h>
22#include <linux/of_address.h>
21 23
22#include "iomap.h" 24#include "fuse.h"
25#include "pm.h"
26#include "pmc.h"
27#include "sleep.h"
23 28
24#define PMC_CTRL 0x0 29#define TEGRA_POWER_EFFECT_LP0 (1 << 14) /* LP0 when CPU pwr gated */
25#define PMC_CTRL_INTR_LOW (1 << 17) 30#define TEGRA_POWER_CPU_PWRREQ_POLARITY (1 << 15) /* CPU pwr req polarity */
31#define TEGRA_POWER_CPU_PWRREQ_OE (1 << 16) /* CPU pwr req enable */
32
33#define PMC_CTRL 0x0
34#define PMC_CTRL_INTR_LOW (1 << 17)
35#define PMC_PWRGATE_TOGGLE 0x30
36#define PMC_PWRGATE_TOGGLE_START (1 << 8)
37#define PMC_REMOVE_CLAMPING 0x34
38#define PMC_PWRGATE_STATUS 0x38
39
40#define PMC_CPUPWRGOOD_TIMER 0xc8
41#define PMC_CPUPWROFF_TIMER 0xcc
42
43#define TEGRA_POWERGATE_PCIE 3
44#define TEGRA_POWERGATE_VDEC 4
45#define TEGRA_POWERGATE_CPU1 9
46#define TEGRA_POWERGATE_CPU2 10
47#define TEGRA_POWERGATE_CPU3 11
48
49static u8 tegra_cpu_domains[] = {
50 0xFF, /* not available for CPU0 */
51 TEGRA_POWERGATE_CPU1,
52 TEGRA_POWERGATE_CPU2,
53 TEGRA_POWERGATE_CPU3,
54};
55static DEFINE_SPINLOCK(tegra_powergate_lock);
56
57static void __iomem *tegra_pmc_base;
58static bool tegra_pmc_invert_interrupt;
59static struct clk *tegra_pclk;
60
61struct pmc_pm_data {
62 u32 cpu_good_time; /* CPU power good time in uS */
63 u32 cpu_off_time; /* CPU power off time in uS */
64 u32 core_osc_time; /* Core power good osc time in uS */
65 u32 core_pmu_time; /* Core power good pmu time in uS */
66 u32 core_off_time; /* Core power off time in uS */
67 bool corereq_high; /* Core power request active-high */
68 bool sysclkreq_high; /* System clock request active-high */
69 bool combined_req; /* Combined pwr req for CPU & Core */
70 bool cpu_pwr_good_en; /* CPU power good signal is enabled */
71 u32 lp0_vec_phy_addr; /* The phy addr of LP0 warm boot code */
72 u32 lp0_vec_size; /* The size of LP0 warm boot code */
73 enum tegra_suspend_mode suspend_mode;
74};
75static struct pmc_pm_data pmc_pm_data;
26 76
27static inline u32 tegra_pmc_readl(u32 reg) 77static inline u32 tegra_pmc_readl(u32 reg)
28{ 78{
29 return readl(IO_ADDRESS(TEGRA_PMC_BASE + reg)); 79 return readl(tegra_pmc_base + reg);
30} 80}
31 81
32static inline void tegra_pmc_writel(u32 val, u32 reg) 82static inline void tegra_pmc_writel(u32 val, u32 reg)
33{ 83{
34 writel(val, IO_ADDRESS(TEGRA_PMC_BASE + reg)); 84 writel(val, tegra_pmc_base + reg);
85}
86
87static int tegra_pmc_get_cpu_powerdomain_id(int cpuid)
88{
89 if (cpuid <= 0 || cpuid >= num_possible_cpus())
90 return -EINVAL;
91 return tegra_cpu_domains[cpuid];
92}
93
94static bool tegra_pmc_powergate_is_powered(int id)
95{
96 return (tegra_pmc_readl(PMC_PWRGATE_STATUS) >> id) & 1;
97}
98
99static int tegra_pmc_powergate_set(int id, bool new_state)
100{
101 bool old_state;
102 unsigned long flags;
103
104 spin_lock_irqsave(&tegra_powergate_lock, flags);
105
106 old_state = tegra_pmc_powergate_is_powered(id);
107 WARN_ON(old_state == new_state);
108
109 tegra_pmc_writel(PMC_PWRGATE_TOGGLE_START | id, PMC_PWRGATE_TOGGLE);
110
111 spin_unlock_irqrestore(&tegra_powergate_lock, flags);
112
113 return 0;
114}
115
116static int tegra_pmc_powergate_remove_clamping(int id)
117{
118 u32 mask;
119
120 /*
121 * Tegra has a bug where PCIE and VDE clamping masks are
122 * swapped relatively to the partition ids.
123 */
124 if (id == TEGRA_POWERGATE_VDEC)
125 mask = (1 << TEGRA_POWERGATE_PCIE);
126 else if (id == TEGRA_POWERGATE_PCIE)
127 mask = (1 << TEGRA_POWERGATE_VDEC);
128 else
129 mask = (1 << id);
130
131 tegra_pmc_writel(mask, PMC_REMOVE_CLAMPING);
132
133 return 0;
134}
135
136bool tegra_pmc_cpu_is_powered(int cpuid)
137{
138 int id;
139
140 id = tegra_pmc_get_cpu_powerdomain_id(cpuid);
141 if (id < 0)
142 return false;
143 return tegra_pmc_powergate_is_powered(id);
35} 144}
36 145
37#ifdef CONFIG_OF 146int tegra_pmc_cpu_power_on(int cpuid)
147{
148 int id;
149
150 id = tegra_pmc_get_cpu_powerdomain_id(cpuid);
151 if (id < 0)
152 return id;
153 return tegra_pmc_powergate_set(id, true);
154}
155
156int tegra_pmc_cpu_remove_clamping(int cpuid)
157{
158 int id;
159
160 id = tegra_pmc_get_cpu_powerdomain_id(cpuid);
161 if (id < 0)
162 return id;
163 return tegra_pmc_powergate_remove_clamping(id);
164}
165
166#ifdef CONFIG_PM_SLEEP
167static void set_power_timers(u32 us_on, u32 us_off, unsigned long rate)
168{
169 unsigned long long ticks;
170 unsigned long long pclk;
171 static unsigned long tegra_last_pclk;
172
173 if (WARN_ON_ONCE(rate <= 0))
174 pclk = 100000000;
175 else
176 pclk = rate;
177
178 if ((rate != tegra_last_pclk)) {
179 ticks = (us_on * pclk) + 999999ull;
180 do_div(ticks, 1000000);
181 tegra_pmc_writel((unsigned long)ticks, PMC_CPUPWRGOOD_TIMER);
182
183 ticks = (us_off * pclk) + 999999ull;
184 do_div(ticks, 1000000);
185 tegra_pmc_writel((unsigned long)ticks, PMC_CPUPWROFF_TIMER);
186 wmb();
187 }
188 tegra_last_pclk = pclk;
189}
190
191enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void)
192{
193 return pmc_pm_data.suspend_mode;
194}
195
196void tegra_pmc_pm_set(enum tegra_suspend_mode mode)
197{
198 u32 reg;
199 unsigned long rate = 0;
200
201 reg = tegra_pmc_readl(PMC_CTRL);
202 reg |= TEGRA_POWER_CPU_PWRREQ_OE;
203 reg &= ~TEGRA_POWER_EFFECT_LP0;
204
205 switch (mode) {
206 case TEGRA_SUSPEND_LP2:
207 rate = clk_get_rate(tegra_pclk);
208 break;
209 default:
210 break;
211 }
212
213 set_power_timers(pmc_pm_data.cpu_good_time, pmc_pm_data.cpu_off_time,
214 rate);
215
216 tegra_pmc_writel(reg, PMC_CTRL);
217}
218
219void tegra_pmc_suspend_init(void)
220{
221 u32 reg;
222
223 /* Always enable CPU power request */
224 reg = tegra_pmc_readl(PMC_CTRL);
225 reg |= TEGRA_POWER_CPU_PWRREQ_OE;
226 tegra_pmc_writel(reg, PMC_CTRL);
227}
228#endif
229
38static const struct of_device_id matches[] __initconst = { 230static const struct of_device_id matches[] __initconst = {
231 { .compatible = "nvidia,tegra114-pmc" },
232 { .compatible = "nvidia,tegra30-pmc" },
39 { .compatible = "nvidia,tegra20-pmc" }, 233 { .compatible = "nvidia,tegra20-pmc" },
40 { } 234 { }
41}; 235};
42#endif
43 236
44void __init tegra_pmc_init(void) 237static void tegra_pmc_parse_dt(void)
45{ 238{
46 /* 239 struct device_node *np;
47 * For now, Harmony is the only board that uses the PMC, and it wants 240 u32 prop;
48 * the signal inverted. Seaboard would too if it used the PMC. 241 enum tegra_suspend_mode suspend_mode;
49 * Hopefully by the time other boards want to use the PMC, everything 242 u32 core_good_time[2] = {0, 0};
50 * will be device-tree, or they also want it inverted. 243 u32 lp0_vec[2] = {0, 0};
51 */
52 bool invert_interrupt = true;
53 u32 val;
54 244
55#ifdef CONFIG_OF 245 np = of_find_matching_node(NULL, matches);
56 if (of_have_populated_dt()) { 246 BUG_ON(!np);
57 struct device_node *np;
58 247
59 invert_interrupt = false; 248 tegra_pmc_base = of_iomap(np, 0);
60 249
61 np = of_find_matching_node(NULL, matches); 250 tegra_pmc_invert_interrupt = of_property_read_bool(np,
62 if (np) { 251 "nvidia,invert-interrupt");
63 if (of_find_property(np, "nvidia,invert-interrupt", 252 tegra_pclk = of_clk_get_by_name(np, "pclk");
64 NULL)) 253 WARN_ON(IS_ERR(tegra_pclk));
65 invert_interrupt = true; 254
255 /* Grabbing the power management configurations */
256 if (of_property_read_u32(np, "nvidia,suspend-mode", &prop)) {
257 suspend_mode = TEGRA_SUSPEND_NONE;
258 } else {
259 switch (prop) {
260 case 0:
261 suspend_mode = TEGRA_SUSPEND_LP0;
262 break;
263 case 1:
264 suspend_mode = TEGRA_SUSPEND_LP1;
265 break;
266 case 2:
267 suspend_mode = TEGRA_SUSPEND_LP2;
268 break;
269 default:
270 suspend_mode = TEGRA_SUSPEND_NONE;
271 break;
66 } 272 }
67 } 273 }
68#endif 274 suspend_mode = tegra_pm_validate_suspend_mode(suspend_mode);
275
276 if (of_property_read_u32(np, "nvidia,cpu-pwr-good-time", &prop))
277 suspend_mode = TEGRA_SUSPEND_NONE;
278 pmc_pm_data.cpu_good_time = prop;
279
280 if (of_property_read_u32(np, "nvidia,cpu-pwr-off-time", &prop))
281 suspend_mode = TEGRA_SUSPEND_NONE;
282 pmc_pm_data.cpu_off_time = prop;
283
284 if (of_property_read_u32_array(np, "nvidia,core-pwr-good-time",
285 core_good_time, ARRAY_SIZE(core_good_time)))
286 suspend_mode = TEGRA_SUSPEND_NONE;
287 pmc_pm_data.core_osc_time = core_good_time[0];
288 pmc_pm_data.core_pmu_time = core_good_time[1];
289
290 if (of_property_read_u32(np, "nvidia,core-pwr-off-time",
291 &prop))
292 suspend_mode = TEGRA_SUSPEND_NONE;
293 pmc_pm_data.core_off_time = prop;
294
295 pmc_pm_data.corereq_high = of_property_read_bool(np,
296 "nvidia,core-power-req-active-high");
297
298 pmc_pm_data.sysclkreq_high = of_property_read_bool(np,
299 "nvidia,sys-clock-req-active-high");
300
301 pmc_pm_data.combined_req = of_property_read_bool(np,
302 "nvidia,combined-power-req");
303
304 pmc_pm_data.cpu_pwr_good_en = of_property_read_bool(np,
305 "nvidia,cpu-pwr-good-en");
306
307 if (of_property_read_u32_array(np, "nvidia,lp0-vec", lp0_vec,
308 ARRAY_SIZE(lp0_vec)))
309 if (suspend_mode == TEGRA_SUSPEND_LP0)
310 suspend_mode = TEGRA_SUSPEND_LP1;
311
312 pmc_pm_data.lp0_vec_phy_addr = lp0_vec[0];
313 pmc_pm_data.lp0_vec_size = lp0_vec[1];
314
315 pmc_pm_data.suspend_mode = suspend_mode;
316}
317
318void __init tegra_pmc_init(void)
319{
320 u32 val;
321
322 tegra_pmc_parse_dt();
69 323
70 val = tegra_pmc_readl(PMC_CTRL); 324 val = tegra_pmc_readl(PMC_CTRL);
71 if (invert_interrupt) 325 if (tegra_pmc_invert_interrupt)
72 val |= PMC_CTRL_INTR_LOW; 326 val |= PMC_CTRL_INTR_LOW;
73 else 327 else
74 val &= ~PMC_CTRL_INTR_LOW; 328 val &= ~PMC_CTRL_INTR_LOW;
diff --git a/arch/arm/mach-tegra/pmc.h b/arch/arm/mach-tegra/pmc.h
index 8995ee4a8768..e1c2df272f7d 100644
--- a/arch/arm/mach-tegra/pmc.h
+++ b/arch/arm/mach-tegra/pmc.h
@@ -18,6 +18,24 @@
18#ifndef __MACH_TEGRA_PMC_H 18#ifndef __MACH_TEGRA_PMC_H
19#define __MACH_TEGRA_PMC_H 19#define __MACH_TEGRA_PMC_H
20 20
21enum tegra_suspend_mode {
22 TEGRA_SUSPEND_NONE = 0,
23 TEGRA_SUSPEND_LP2, /* CPU voltage off */
24 TEGRA_SUSPEND_LP1, /* CPU voltage off, DRAM self-refresh */
25 TEGRA_SUSPEND_LP0, /* CPU + core voltage off, DRAM self-refresh */
26 TEGRA_MAX_SUSPEND_MODE,
27};
28
29#ifdef CONFIG_PM_SLEEP
30enum tegra_suspend_mode tegra_pmc_get_suspend_mode(void);
31void tegra_pmc_pm_set(enum tegra_suspend_mode mode);
32void tegra_pmc_suspend_init(void);
33#endif
34
35bool tegra_pmc_cpu_is_powered(int cpuid);
36int tegra_pmc_cpu_power_on(int cpuid);
37int tegra_pmc_cpu_remove_clamping(int cpuid);
38
21void tegra_pmc_init(void); 39void tegra_pmc_init(void);
22 40
23#endif 41#endif
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index 54382ceade4a..1676aba5e7b8 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -41,9 +41,6 @@
41 */ 41 */
42ENTRY(tegra_resume) 42ENTRY(tegra_resume)
43 bl v7_invalidate_l1 43 bl v7_invalidate_l1
44 /* Enable coresight */
45 mov32 r0, 0xC5ACCE55
46 mcr p14, 0, r0, c7, c12, 6
47 44
48 cpu_id r0 45 cpu_id r0
49 cmp r0, #0 @ CPU0? 46 cmp r0, #0 @ CPU0?
@@ -99,6 +96,8 @@ ENTRY(__tegra_cpu_reset_handler_start)
99 * 96 *
100 * Register usage within the reset handler: 97 * Register usage within the reset handler:
101 * 98 *
99 * Others: scratch
100 * R6 = SoC ID << 8
102 * R7 = CPU present (to the OS) mask 101 * R7 = CPU present (to the OS) mask
103 * R8 = CPU in LP1 state mask 102 * R8 = CPU in LP1 state mask
104 * R9 = CPU in LP2 state mask 103 * R9 = CPU in LP2 state mask
@@ -114,6 +113,40 @@ ENTRY(__tegra_cpu_reset_handler_start)
114ENTRY(__tegra_cpu_reset_handler) 113ENTRY(__tegra_cpu_reset_handler)
115 114
116 cpsid aif, 0x13 @ SVC mode, interrupts disabled 115 cpsid aif, 0x13 @ SVC mode, interrupts disabled
116
117 mov32 r6, TEGRA_APB_MISC_BASE
118 ldr r6, [r6, #APB_MISC_GP_HIDREV]
119 and r6, r6, #0xff00
120#ifdef CONFIG_ARCH_TEGRA_2x_SOC
121t20_check:
122 cmp r6, #(0x20 << 8)
123 bne after_t20_check
124t20_errata:
125 # Tegra20 is a Cortex-A9 r1p1
126 mrc p15, 0, r0, c1, c0, 0 @ read system control register
127 orr r0, r0, #1 << 14 @ erratum 716044
128 mcr p15, 0, r0, c1, c0, 0 @ write system control register
129 mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register
130 orr r0, r0, #1 << 4 @ erratum 742230
131 orr r0, r0, #1 << 11 @ erratum 751472
132 mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register
133 b after_errata
134after_t20_check:
135#endif
136#ifdef CONFIG_ARCH_TEGRA_3x_SOC
137t30_check:
138 cmp r6, #(0x30 << 8)
139 bne after_t30_check
140t30_errata:
141 # Tegra30 is a Cortex-A9 r2p9
142 mrc p15, 0, r0, c15, c0, 1 @ read diagnostic register
143 orr r0, r0, #1 << 6 @ erratum 743622
144 orr r0, r0, #1 << 11 @ erratum 751472
145 mcr p15, 0, r0, c15, c0, 1 @ write diagnostic register
146 b after_errata
147after_t30_check:
148#endif
149after_errata:
117 mrc p15, 0, r10, c0, c0, 5 @ MPIDR 150 mrc p15, 0, r10, c0, c0, 5 @ MPIDR
118 and r10, r10, #0x3 @ R10 = CPU number 151 and r10, r10, #0x3 @ R10 = CPU number
119 mov r11, #1 152 mov r11, #1
@@ -129,16 +162,13 @@ ENTRY(__tegra_cpu_reset_handler)
129 162
130#ifdef CONFIG_ARCH_TEGRA_2x_SOC 163#ifdef CONFIG_ARCH_TEGRA_2x_SOC
131 /* Are we on Tegra20? */ 164 /* Are we on Tegra20? */
132 mov32 r6, TEGRA_APB_MISC_BASE 165 cmp r6, #(0x20 << 8)
133 ldr r0, [r6, #APB_MISC_GP_HIDREV]
134 and r0, r0, #0xff00
135 cmp r0, #(0x20 << 8)
136 bne 1f 166 bne 1f
137 /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */ 167 /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */
138 mov32 r6, TEGRA_PMC_BASE 168 mov32 r5, TEGRA_PMC_BASE
139 mov r0, #0 169 mov r0, #0
140 cmp r10, #0 170 cmp r10, #0
141 strne r0, [r6, #PMC_SCRATCH41] 171 strne r0, [r5, #PMC_SCRATCH41]
1421: 1721:
143#endif 173#endif
144 174
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index 4ffae541726e..970ebd5138b9 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved. 2 * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 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, 5 * under the terms and conditions of the GNU General Public License,
@@ -124,11 +124,11 @@ int tegra_sleep_cpu_finish(unsigned long);
124void tegra_disable_clean_inv_dcache(void); 124void tegra_disable_clean_inv_dcache(void);
125 125
126#ifdef CONFIG_HOTPLUG_CPU 126#ifdef CONFIG_HOTPLUG_CPU
127void tegra20_hotplug_init(void); 127void tegra20_hotplug_shutdown(void);
128void tegra30_hotplug_init(void); 128void tegra30_hotplug_shutdown(void);
129void tegra_hotplug_init(void);
129#else 130#else
130static inline void tegra20_hotplug_init(void) {} 131static inline void tegra_hotplug_init(void) {}
131static inline void tegra30_hotplug_init(void) {}
132#endif 132#endif
133 133
134void tegra20_cpu_shutdown(int cpu); 134void tegra20_cpu_shutdown(int cpu);
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/tegra.c
index a0edf2510280..61749e2d8111 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * nVidia Tegra device tree board support 2 * NVIDIA Tegra SoC device tree board support
3 * 3 *
4 * Copyright (C) 2011, 2013, NVIDIA Corporation
4 * Copyright (C) 2010 Secret Lab Technologies, Ltd. 5 * Copyright (C) 2010 Secret Lab Technologies, Ltd.
5 * Copyright (C) 2010 Google, Inc. 6 * Copyright (C) 2010 Google, Inc.
6 * 7 *
@@ -32,7 +33,10 @@
32#include <linux/io.h> 33#include <linux/io.h>
33#include <linux/i2c.h> 34#include <linux/i2c.h>
34#include <linux/i2c-tegra.h> 35#include <linux/i2c-tegra.h>
36#include <linux/slab.h>
37#include <linux/sys_soc.h>
35#include <linux/usb/tegra_usb_phy.h> 38#include <linux/usb/tegra_usb_phy.h>
39#include <linux/clk/tegra.h>
36 40
37#include <asm/mach-types.h> 41#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
@@ -41,6 +45,7 @@
41 45
42#include "board.h" 46#include "board.h"
43#include "common.h" 47#include "common.h"
48#include "fuse.h"
44#include "iomap.h" 49#include "iomap.h"
45 50
46static struct tegra_ehci_platform_data tegra_ehci1_pdata = { 51static struct tegra_ehci_platform_data tegra_ehci1_pdata = {
@@ -79,12 +84,38 @@ static struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
79 84
80static void __init tegra_dt_init(void) 85static void __init tegra_dt_init(void)
81{ 86{
87 struct soc_device_attribute *soc_dev_attr;
88 struct soc_device *soc_dev;
89 struct device *parent = NULL;
90
91 tegra_clocks_apply_init_table();
92
93 soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
94 if (!soc_dev_attr)
95 goto out;
96
97 soc_dev_attr->family = kasprintf(GFP_KERNEL, "Tegra");
98 soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d", tegra_revision);
99 soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%d", tegra_chip_id);
100
101 soc_dev = soc_device_register(soc_dev_attr);
102 if (IS_ERR(soc_dev)) {
103 kfree(soc_dev_attr->family);
104 kfree(soc_dev_attr->revision);
105 kfree(soc_dev_attr->soc_id);
106 kfree(soc_dev_attr);
107 goto out;
108 }
109
110 parent = soc_device_to_device(soc_dev);
111
82 /* 112 /*
83 * Finished with the static registrations now; fill in the missing 113 * Finished with the static registrations now; fill in the missing
84 * devices 114 * devices
85 */ 115 */
116out:
86 of_platform_populate(NULL, of_default_bus_match_table, 117 of_platform_populate(NULL, of_default_bus_match_table,
87 tegra20_auxdata_lookup, NULL); 118 tegra20_auxdata_lookup, parent);
88} 119}
89 120
90static void __init trimslice_init(void) 121static void __init trimslice_init(void)
@@ -111,7 +142,8 @@ static void __init harmony_init(void)
111 142
112static void __init paz00_init(void) 143static void __init paz00_init(void)
113{ 144{
114 tegra_paz00_wifikill_init(); 145 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
146 tegra_paz00_wifikill_init();
115} 147}
116 148
117static struct { 149static struct {
@@ -137,19 +169,21 @@ static void __init tegra_dt_init_late(void)
137 } 169 }
138} 170}
139 171
140static const char *tegra20_dt_board_compat[] = { 172static const char * const tegra_dt_board_compat[] = {
173 "nvidia,tegra114",
174 "nvidia,tegra30",
141 "nvidia,tegra20", 175 "nvidia,tegra20",
142 NULL 176 NULL
143}; 177};
144 178
145DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)") 179DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
146 .map_io = tegra_map_common_io, 180 .map_io = tegra_map_common_io,
147 .smp = smp_ops(tegra_smp_ops), 181 .smp = smp_ops(tegra_smp_ops),
148 .init_early = tegra20_init_early, 182 .init_early = tegra_init_early,
149 .init_irq = tegra_dt_init_irq, 183 .init_irq = tegra_dt_init_irq,
150 .init_time = clocksource_of_init, 184 .init_time = clocksource_of_init,
151 .init_machine = tegra_dt_init, 185 .init_machine = tegra_dt_init,
152 .init_late = tegra_dt_init_late, 186 .init_late = tegra_dt_init_late,
153 .restart = tegra_assert_system_reset, 187 .restart = tegra_assert_system_reset,
154 .dt_compat = tegra20_dt_board_compat, 188 .dt_compat = tegra_dt_board_compat,
155MACHINE_END 189MACHINE_END
diff --git a/arch/arm/mach-tegra/tegra114_speedo.c b/arch/arm/mach-tegra/tegra114_speedo.c
new file mode 100644
index 000000000000..5218d4853cd3
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra114_speedo.c
@@ -0,0 +1,104 @@
1/*
2 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <linux/kernel.h>
18#include <linux/bug.h>
19
20#include "fuse.h"
21
22#define CORE_PROCESS_CORNERS_NUM 2
23#define CPU_PROCESS_CORNERS_NUM 2
24
25enum {
26 THRESHOLD_INDEX_0,
27 THRESHOLD_INDEX_1,
28 THRESHOLD_INDEX_COUNT,
29};
30
31static const u32 core_process_speedos[][CORE_PROCESS_CORNERS_NUM] = {
32 {1123, UINT_MAX},
33 {0, UINT_MAX},
34};
35
36static const u32 cpu_process_speedos[][CPU_PROCESS_CORNERS_NUM] = {
37 {1695, UINT_MAX},
38 {0, UINT_MAX},
39};
40
41static void rev_sku_to_speedo_ids(int rev, int sku, int *threshold)
42{
43 u32 tmp;
44
45 switch (sku) {
46 case 0x00:
47 case 0x10:
48 case 0x05:
49 case 0x06:
50 tegra_cpu_speedo_id = 1;
51 tegra_soc_speedo_id = 0;
52 *threshold = THRESHOLD_INDEX_0;
53 break;
54
55 case 0x03:
56 case 0x04:
57 tegra_cpu_speedo_id = 2;
58 tegra_soc_speedo_id = 1;
59 *threshold = THRESHOLD_INDEX_1;
60 break;
61
62 default:
63 pr_err("Tegra114 Unknown SKU %d\n", sku);
64 tegra_cpu_speedo_id = 0;
65 tegra_soc_speedo_id = 0;
66 *threshold = THRESHOLD_INDEX_0;
67 break;
68 }
69
70 if (rev == TEGRA_REVISION_A01) {
71 tmp = tegra_fuse_readl(0x270) << 1;
72 tmp |= tegra_fuse_readl(0x26c);
73 if (!tmp)
74 tegra_cpu_speedo_id = 0;
75 }
76}
77
78void tegra114_init_speedo_data(void)
79{
80 u32 cpu_speedo_val;
81 u32 core_speedo_val;
82 int threshold;
83 int i;
84
85 BUILD_BUG_ON(ARRAY_SIZE(cpu_process_speedos) !=
86 THRESHOLD_INDEX_COUNT);
87 BUILD_BUG_ON(ARRAY_SIZE(core_process_speedos) !=
88 THRESHOLD_INDEX_COUNT);
89
90 rev_sku_to_speedo_ids(tegra_revision, tegra_sku_id, &threshold);
91
92 cpu_speedo_val = tegra_fuse_readl(0x12c) + 1024;
93 core_speedo_val = tegra_fuse_readl(0x134);
94
95 for (i = 0; i < CPU_PROCESS_CORNERS_NUM; i++)
96 if (cpu_speedo_val < cpu_process_speedos[threshold][i])
97 break;
98 tegra_cpu_process_id = i;
99
100 for (i = 0; i < CORE_PROCESS_CORNERS_NUM; i++)
101 if (core_speedo_val < core_process_speedos[threshold][i])
102 break;
103 tegra_core_process_id = i;
104}
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
index a6af0b8732ba..d07bbe7f04a6 100644
--- a/arch/arm/mach-ux500/timer.c
+++ b/arch/arm/mach-ux500/timer.c
@@ -7,6 +7,7 @@
7#include <linux/io.h> 7#include <linux/io.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/clksrc-dbx500-prcmu.h> 9#include <linux/clksrc-dbx500-prcmu.h>
10#include <linux/clocksource.h>
10#include <linux/of.h> 11#include <linux/of.h>
11#include <linux/of_address.h> 12#include <linux/of_address.h>
12#include <linux/platform_data/clocksource-nomadik-mtu.h> 13#include <linux/platform_data/clocksource-nomadik-mtu.h>
@@ -32,7 +33,7 @@ static void __init ux500_twd_init(void)
32 twd_local_timer = &u8500_twd_local_timer; 33 twd_local_timer = &u8500_twd_local_timer;
33 34
34 if (of_have_populated_dt()) 35 if (of_have_populated_dt())
35 twd_local_timer_of_register(); 36 clocksource_of_init();
36 else { 37 else {
37 err = twd_local_timer_register(twd_local_timer); 38 err = twd_local_timer_register(twd_local_timer);
38 if (err) 39 if (err)
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 915683cb67d6..d0ad78998cb6 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -5,6 +5,7 @@
5#include <linux/amba/bus.h> 5#include <linux/amba/bus.h>
6#include <linux/amba/mmci.h> 6#include <linux/amba/mmci.h>
7#include <linux/io.h> 7#include <linux/io.h>
8#include <linux/clocksource.h>
8#include <linux/smp.h> 9#include <linux/smp.h>
9#include <linux/init.h> 10#include <linux/init.h>
10#include <linux/irqchip.h> 11#include <linux/irqchip.h>
@@ -25,7 +26,6 @@
25#include <asm/arch_timer.h> 26#include <asm/arch_timer.h>
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27#include <asm/sizes.h> 28#include <asm/sizes.h>
28#include <asm/smp_twd.h>
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31#include <asm/mach/time.h> 31#include <asm/mach/time.h>
@@ -435,6 +435,7 @@ static void __init v2m_dt_timer_init(void)
435 435
436 vexpress_clk_of_init(); 436 vexpress_clk_of_init();
437 437
438 clocksource_of_init();
438 do { 439 do {
439 node = of_find_compatible_node(node, NULL, "arm,sp804"); 440 node = of_find_compatible_node(node, NULL, "arm,sp804");
440 } while (node && vexpress_get_site_by_node(node) != VEXPRESS_SITE_MB); 441 } while (node && vexpress_get_site_by_node(node) != VEXPRESS_SITE_MB);
@@ -445,8 +446,7 @@ static void __init v2m_dt_timer_init(void)
445 irq_of_parse_and_map(node, 0)); 446 irq_of_parse_and_map(node, 0));
446 } 447 }
447 448
448 if (arch_timer_of_register() != 0) 449 arch_timer_of_register();
449 twd_local_timer_of_register();
450 450
451 if (arch_timer_sched_clock_init() != 0) 451 if (arch_timer_sched_clock_init() != 0)
452 versatile_sched_clock_init(vexpress_get_24mhz_clock_base(), 452 versatile_sched_clock_init(vexpress_get_24mhz_clock_base(),
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index a0daa2fb5de6..5d0af13adb9b 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -52,6 +52,13 @@ static u32 omap_reserved_systimers;
52static LIST_HEAD(omap_timer_list); 52static LIST_HEAD(omap_timer_list);
53static DEFINE_SPINLOCK(dm_timer_lock); 53static DEFINE_SPINLOCK(dm_timer_lock);
54 54
55enum {
56 REQUEST_ANY = 0,
57 REQUEST_BY_ID,
58 REQUEST_BY_CAP,
59 REQUEST_BY_NODE,
60};
61
55/** 62/**
56 * omap_dm_timer_read_reg - read timer registers in posted and non-posted mode 63 * omap_dm_timer_read_reg - read timer registers in posted and non-posted mode
57 * @timer: timer pointer over which read operation to perform 64 * @timer: timer pointer over which read operation to perform
@@ -178,29 +185,82 @@ int omap_dm_timer_reserve_systimer(int id)
178 return 0; 185 return 0;
179} 186}
180 187
181struct omap_dm_timer *omap_dm_timer_request(void) 188static struct omap_dm_timer *_omap_dm_timer_request(int req_type, void *data)
182{ 189{
183 struct omap_dm_timer *timer = NULL, *t; 190 struct omap_dm_timer *timer = NULL, *t;
191 struct device_node *np = NULL;
184 unsigned long flags; 192 unsigned long flags;
185 int ret = 0; 193 u32 cap = 0;
194 int id = 0;
195
196 switch (req_type) {
197 case REQUEST_BY_ID:
198 id = *(int *)data;
199 break;
200 case REQUEST_BY_CAP:
201 cap = *(u32 *)data;
202 break;
203 case REQUEST_BY_NODE:
204 np = (struct device_node *)data;
205 break;
206 default:
207 /* REQUEST_ANY */
208 break;
209 }
186 210
187 spin_lock_irqsave(&dm_timer_lock, flags); 211 spin_lock_irqsave(&dm_timer_lock, flags);
188 list_for_each_entry(t, &omap_timer_list, node) { 212 list_for_each_entry(t, &omap_timer_list, node) {
189 if (t->reserved) 213 if (t->reserved)
190 continue; 214 continue;
191 215
192 timer = t; 216 switch (req_type) {
193 timer->reserved = 1; 217 case REQUEST_BY_ID:
194 break; 218 if (id == t->pdev->id) {
219 timer = t;
220 timer->reserved = 1;
221 goto found;
222 }
223 break;
224 case REQUEST_BY_CAP:
225 if (cap == (t->capability & cap)) {
226 /*
227 * If timer is not NULL, we have already found
228 * one timer but it was not an exact match
229 * because it had more capabilites that what
230 * was required. Therefore, unreserve the last
231 * timer found and see if this one is a better
232 * match.
233 */
234 if (timer)
235 timer->reserved = 0;
236 timer = t;
237 timer->reserved = 1;
238
239 /* Exit loop early if we find an exact match */
240 if (t->capability == cap)
241 goto found;
242 }
243 break;
244 case REQUEST_BY_NODE:
245 if (np == t->pdev->dev.of_node) {
246 timer = t;
247 timer->reserved = 1;
248 goto found;
249 }
250 break;
251 default:
252 /* REQUEST_ANY */
253 timer = t;
254 timer->reserved = 1;
255 goto found;
256 }
195 } 257 }
258found:
196 spin_unlock_irqrestore(&dm_timer_lock, flags); 259 spin_unlock_irqrestore(&dm_timer_lock, flags);
197 260
198 if (timer) { 261 if (timer && omap_dm_timer_prepare(timer)) {
199 ret = omap_dm_timer_prepare(timer); 262 timer->reserved = 0;
200 if (ret) { 263 timer = NULL;
201 timer->reserved = 0;
202 timer = NULL;
203 }
204 } 264 }
205 265
206 if (!timer) 266 if (!timer)
@@ -208,43 +268,23 @@ struct omap_dm_timer *omap_dm_timer_request(void)
208 268
209 return timer; 269 return timer;
210} 270}
271
272struct omap_dm_timer *omap_dm_timer_request(void)
273{
274 return _omap_dm_timer_request(REQUEST_ANY, NULL);
275}
211EXPORT_SYMBOL_GPL(omap_dm_timer_request); 276EXPORT_SYMBOL_GPL(omap_dm_timer_request);
212 277
213struct omap_dm_timer *omap_dm_timer_request_specific(int id) 278struct omap_dm_timer *omap_dm_timer_request_specific(int id)
214{ 279{
215 struct omap_dm_timer *timer = NULL, *t;
216 unsigned long flags;
217 int ret = 0;
218
219 /* Requesting timer by ID is not supported when device tree is used */ 280 /* Requesting timer by ID is not supported when device tree is used */
220 if (of_have_populated_dt()) { 281 if (of_have_populated_dt()) {
221 pr_warn("%s: Please use omap_dm_timer_request_by_cap()\n", 282 pr_warn("%s: Please use omap_dm_timer_request_by_cap/node()\n",
222 __func__); 283 __func__);
223 return NULL; 284 return NULL;
224 } 285 }
225 286
226 spin_lock_irqsave(&dm_timer_lock, flags); 287 return _omap_dm_timer_request(REQUEST_BY_ID, &id);
227 list_for_each_entry(t, &omap_timer_list, node) {
228 if (t->pdev->id == id && !t->reserved) {
229 timer = t;
230 timer->reserved = 1;
231 break;
232 }
233 }
234 spin_unlock_irqrestore(&dm_timer_lock, flags);
235
236 if (timer) {
237 ret = omap_dm_timer_prepare(timer);
238 if (ret) {
239 timer->reserved = 0;
240 timer = NULL;
241 }
242 }
243
244 if (!timer)
245 pr_debug("%s: timer%d request failed!\n", __func__, id);
246
247 return timer;
248} 288}
249EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific); 289EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific);
250 290
@@ -259,46 +299,25 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific);
259 */ 299 */
260struct omap_dm_timer *omap_dm_timer_request_by_cap(u32 cap) 300struct omap_dm_timer *omap_dm_timer_request_by_cap(u32 cap)
261{ 301{
262 struct omap_dm_timer *timer = NULL, *t; 302 return _omap_dm_timer_request(REQUEST_BY_CAP, &cap);
263 unsigned long flags; 303}
304EXPORT_SYMBOL_GPL(omap_dm_timer_request_by_cap);
264 305
265 if (!cap) 306/**
307 * omap_dm_timer_request_by_node - Request a timer by device-tree node
308 * @np: Pointer to device-tree timer node
309 *
310 * Request a timer based upon a device node pointer. Returns pointer to
311 * timer handle on success and a NULL pointer on failure.
312 */
313struct omap_dm_timer *omap_dm_timer_request_by_node(struct device_node *np)
314{
315 if (!np)
266 return NULL; 316 return NULL;
267 317
268 spin_lock_irqsave(&dm_timer_lock, flags); 318 return _omap_dm_timer_request(REQUEST_BY_NODE, np);
269 list_for_each_entry(t, &omap_timer_list, node) {
270 if ((!t->reserved) && ((t->capability & cap) == cap)) {
271 /*
272 * If timer is not NULL, we have already found one timer
273 * but it was not an exact match because it had more
274 * capabilites that what was required. Therefore,
275 * unreserve the last timer found and see if this one
276 * is a better match.
277 */
278 if (timer)
279 timer->reserved = 0;
280
281 timer = t;
282 timer->reserved = 1;
283
284 /* Exit loop early if we find an exact match */
285 if (t->capability == cap)
286 break;
287 }
288 }
289 spin_unlock_irqrestore(&dm_timer_lock, flags);
290
291 if (timer && omap_dm_timer_prepare(timer)) {
292 timer->reserved = 0;
293 timer = NULL;
294 }
295
296 if (!timer)
297 pr_debug("%s: timer request failed!\n", __func__);
298
299 return timer;
300} 319}
301EXPORT_SYMBOL_GPL(omap_dm_timer_request_by_cap); 320EXPORT_SYMBOL_GPL(omap_dm_timer_request_by_node);
302 321
303int omap_dm_timer_free(struct omap_dm_timer *timer) 322int omap_dm_timer_free(struct omap_dm_timer *timer)
304{ 323{
@@ -315,7 +334,21 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_free);
315 334
316void omap_dm_timer_enable(struct omap_dm_timer *timer) 335void omap_dm_timer_enable(struct omap_dm_timer *timer)
317{ 336{
337 int c;
338
318 pm_runtime_get_sync(&timer->pdev->dev); 339 pm_runtime_get_sync(&timer->pdev->dev);
340
341 if (!(timer->capability & OMAP_TIMER_ALWON)) {
342 if (timer->get_context_loss_count) {
343 c = timer->get_context_loss_count(&timer->pdev->dev);
344 if (c != timer->ctx_loss_count) {
345 omap_timer_restore_context(timer);
346 timer->ctx_loss_count = c;
347 }
348 } else {
349 omap_timer_restore_context(timer);
350 }
351 }
319} 352}
320EXPORT_SYMBOL_GPL(omap_dm_timer_enable); 353EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
321 354
@@ -410,13 +443,6 @@ int omap_dm_timer_start(struct omap_dm_timer *timer)
410 443
411 omap_dm_timer_enable(timer); 444 omap_dm_timer_enable(timer);
412 445
413 if (!(timer->capability & OMAP_TIMER_ALWON)) {
414 if (timer->get_context_loss_count &&
415 timer->get_context_loss_count(&timer->pdev->dev) !=
416 timer->ctx_loss_count)
417 omap_timer_restore_context(timer);
418 }
419
420 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 446 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
421 if (!(l & OMAP_TIMER_CTRL_ST)) { 447 if (!(l & OMAP_TIMER_CTRL_ST)) {
422 l |= OMAP_TIMER_CTRL_ST; 448 l |= OMAP_TIMER_CTRL_ST;
@@ -441,12 +467,6 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer)
441 467
442 __omap_dm_timer_stop(timer, timer->posted, rate); 468 __omap_dm_timer_stop(timer, timer->posted, rate);
443 469
444 if (!(timer->capability & OMAP_TIMER_ALWON)) {
445 if (timer->get_context_loss_count)
446 timer->ctx_loss_count =
447 timer->get_context_loss_count(&timer->pdev->dev);
448 }
449
450 /* 470 /*
451 * Since the register values are computed and written within 471 * Since the register values are computed and written within
452 * __omap_dm_timer_stop, we need to use read to retrieve the 472 * __omap_dm_timer_stop, we need to use read to retrieve the
@@ -553,13 +573,6 @@ int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
553 573
554 omap_dm_timer_enable(timer); 574 omap_dm_timer_enable(timer);
555 575
556 if (!(timer->capability & OMAP_TIMER_ALWON)) {
557 if (timer->get_context_loss_count &&
558 timer->get_context_loss_count(&timer->pdev->dev) !=
559 timer->ctx_loss_count)
560 omap_timer_restore_context(timer);
561 }
562
563 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 576 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
564 if (autoreload) { 577 if (autoreload) {
565 l |= OMAP_TIMER_CTRL_AR; 578 l |= OMAP_TIMER_CTRL_AR;
@@ -770,6 +783,8 @@ int omap_dm_timers_active(void)
770} 783}
771EXPORT_SYMBOL_GPL(omap_dm_timers_active); 784EXPORT_SYMBOL_GPL(omap_dm_timers_active);
772 785
786static const struct of_device_id omap_timer_match[];
787
773/** 788/**
774 * omap_dm_timer_probe - probe function called for every registered device 789 * omap_dm_timer_probe - probe function called for every registered device
775 * @pdev: pointer to current timer platform device 790 * @pdev: pointer to current timer platform device
@@ -783,7 +798,11 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
783 struct omap_dm_timer *timer; 798 struct omap_dm_timer *timer;
784 struct resource *mem, *irq; 799 struct resource *mem, *irq;
785 struct device *dev = &pdev->dev; 800 struct device *dev = &pdev->dev;
786 struct dmtimer_platform_data *pdata = pdev->dev.platform_data; 801 const struct of_device_id *match;
802 const struct dmtimer_platform_data *pdata;
803
804 match = of_match_device(of_match_ptr(omap_timer_match), dev);
805 pdata = match ? match->data : dev->platform_data;
787 806
788 if (!pdata && !dev->of_node) { 807 if (!pdata && !dev->of_node) {
789 dev_err(dev, "%s: no platform data.\n", __func__); 808 dev_err(dev, "%s: no platform data.\n", __func__);
@@ -823,12 +842,14 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
823 timer->capability |= OMAP_TIMER_SECURE; 842 timer->capability |= OMAP_TIMER_SECURE;
824 } else { 843 } else {
825 timer->id = pdev->id; 844 timer->id = pdev->id;
826 timer->errata = pdata->timer_errata;
827 timer->capability = pdata->timer_capability; 845 timer->capability = pdata->timer_capability;
828 timer->reserved = omap_dm_timer_reserved_systimer(timer->id); 846 timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
829 timer->get_context_loss_count = pdata->get_context_loss_count; 847 timer->get_context_loss_count = pdata->get_context_loss_count;
830 } 848 }
831 849
850 if (pdata)
851 timer->errata = pdata->timer_errata;
852
832 timer->irq = irq->start; 853 timer->irq = irq->start;
833 timer->pdev = pdev; 854 timer->pdev = pdev;
834 855
@@ -881,8 +902,34 @@ static int omap_dm_timer_remove(struct platform_device *pdev)
881 return ret; 902 return ret;
882} 903}
883 904
905static const struct dmtimer_platform_data omap3plus_pdata = {
906 .timer_errata = OMAP_TIMER_ERRATA_I103_I767,
907};
908
884static const struct of_device_id omap_timer_match[] = { 909static const struct of_device_id omap_timer_match[] = {
885 { .compatible = "ti,omap2-timer", }, 910 {
911 .compatible = "ti,omap2420-timer",
912 },
913 {
914 .compatible = "ti,omap3430-timer",
915 .data = &omap3plus_pdata,
916 },
917 {
918 .compatible = "ti,omap4430-timer",
919 .data = &omap3plus_pdata,
920 },
921 {
922 .compatible = "ti,omap5430-timer",
923 .data = &omap3plus_pdata,
924 },
925 {
926 .compatible = "ti,am335x-timer",
927 .data = &omap3plus_pdata,
928 },
929 {
930 .compatible = "ti,am335x-timer-1ms",
931 .data = &omap3plus_pdata,
932 },
886 {}, 933 {},
887}; 934};
888MODULE_DEVICE_TABLE(of, omap_timer_match); 935MODULE_DEVICE_TABLE(of, omap_timer_match);
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index a3fbc48c332e..fb92abb91628 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -128,6 +128,7 @@ int omap_dm_timer_reserve_systimer(int id);
128struct omap_dm_timer *omap_dm_timer_request(void); 128struct omap_dm_timer *omap_dm_timer_request(void);
129struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); 129struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
130struct omap_dm_timer *omap_dm_timer_request_by_cap(u32 cap); 130struct omap_dm_timer *omap_dm_timer_request_by_cap(u32 cap);
131struct omap_dm_timer *omap_dm_timer_request_by_node(struct device_node *np);
131int omap_dm_timer_free(struct omap_dm_timer *timer); 132int omap_dm_timer_free(struct omap_dm_timer *timer);
132void omap_dm_timer_enable(struct omap_dm_timer *timer); 133void omap_dm_timer_enable(struct omap_dm_timer *timer);
133void omap_dm_timer_disable(struct omap_dm_timer *timer); 134void omap_dm_timer_disable(struct omap_dm_timer *timer);
diff --git a/arch/arm/plat-orion/Makefile b/arch/arm/plat-orion/Makefile
index a82cecb84948..2eca54b65906 100644
--- a/arch/arm/plat-orion/Makefile
+++ b/arch/arm/plat-orion/Makefile
@@ -3,8 +3,6 @@
3# 3#
4ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include 4ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
5 5
6obj-y += addr-map.o
7
8orion-gpio-$(CONFIG_GENERIC_GPIO) += gpio.o 6orion-gpio-$(CONFIG_GENERIC_GPIO) += gpio.o
9obj-$(CONFIG_PLAT_ORION_LEGACY) += irq.o pcie.o time.o common.o mpp.o 7obj-$(CONFIG_PLAT_ORION_LEGACY) += irq.o pcie.o time.o common.o mpp.o
10obj-$(CONFIG_PLAT_ORION_LEGACY) += $(orion-gpio-y) 8obj-$(CONFIG_PLAT_ORION_LEGACY) += $(orion-gpio-y)
diff --git a/arch/arm/plat-orion/addr-map.c b/arch/arm/plat-orion/addr-map.c
deleted file mode 100644
index 807ac8e5cbc0..000000000000
--- a/arch/arm/plat-orion/addr-map.c
+++ /dev/null
@@ -1,178 +0,0 @@
1/*
2 * arch/arm/plat-orion/addr-map.c
3 *
4 * Address map functions for Marvell Orion based SoCs
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/mbus.h>
15#include <linux/io.h>
16#include <plat/addr-map.h>
17
18struct mbus_dram_target_info orion_mbus_dram_info;
19
20const struct mbus_dram_target_info *mv_mbus_dram_info(void)
21{
22 return &orion_mbus_dram_info;
23}
24EXPORT_SYMBOL_GPL(mv_mbus_dram_info);
25
26/*
27 * DDR target is the same on all Orion platforms.
28 */
29#define TARGET_DDR 0
30
31/*
32 * Helpers to get DDR bank info
33 */
34#define DDR_BASE_CS_OFF(n) (0x0000 + ((n) << 3))
35#define DDR_SIZE_CS_OFF(n) (0x0004 + ((n) << 3))
36
37/*
38 * CPU Address Decode Windows registers
39 */
40#define WIN_CTRL_OFF 0x0000
41#define WIN_BASE_OFF 0x0004
42#define WIN_REMAP_LO_OFF 0x0008
43#define WIN_REMAP_HI_OFF 0x000c
44
45#define ATTR_HW_COHERENCY (0x1 << 4)
46
47/*
48 * Default implementation
49 */
50static void __init __iomem *
51orion_win_cfg_base(const struct orion_addr_map_cfg *cfg, int win)
52{
53 return cfg->bridge_virt_base + (win << 4);
54}
55
56/*
57 * Default implementation
58 */
59static int __init orion_cpu_win_can_remap(const struct orion_addr_map_cfg *cfg,
60 const int win)
61{
62 if (win < cfg->remappable_wins)
63 return 1;
64
65 return 0;
66}
67
68void __init orion_setup_cpu_win(const struct orion_addr_map_cfg *cfg,
69 const int win, const u32 base,
70 const u32 size, const u8 target,
71 const u8 attr, const int remap)
72{
73 void __iomem *addr = cfg->win_cfg_base(cfg, win);
74 u32 ctrl, base_high, remap_addr;
75
76 if (win >= cfg->num_wins) {
77 printk(KERN_ERR "setup_cpu_win: trying to allocate window "
78 "%d when only %d allowed\n", win, cfg->num_wins);
79 }
80
81 base_high = base & 0xffff0000;
82 ctrl = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1;
83
84 writel(base_high, addr + WIN_BASE_OFF);
85 writel(ctrl, addr + WIN_CTRL_OFF);
86 if (cfg->cpu_win_can_remap(cfg, win)) {
87 if (remap < 0)
88 remap_addr = base;
89 else
90 remap_addr = remap;
91 writel(remap_addr & 0xffff0000, addr + WIN_REMAP_LO_OFF);
92 writel(0, addr + WIN_REMAP_HI_OFF);
93 }
94}
95
96/*
97 * Configure a number of windows.
98 */
99static void __init orion_setup_cpu_wins(const struct orion_addr_map_cfg * cfg,
100 const struct orion_addr_map_info *info)
101{
102 while (info->win != -1) {
103 orion_setup_cpu_win(cfg, info->win, info->base, info->size,
104 info->target, info->attr, info->remap);
105 info++;
106 }
107}
108
109static void __init orion_disable_wins(const struct orion_addr_map_cfg * cfg)
110{
111 void __iomem *addr;
112 int i;
113
114 for (i = 0; i < cfg->num_wins; i++) {
115 addr = cfg->win_cfg_base(cfg, i);
116
117 writel(0, addr + WIN_BASE_OFF);
118 writel(0, addr + WIN_CTRL_OFF);
119 if (cfg->cpu_win_can_remap(cfg, i)) {
120 writel(0, addr + WIN_REMAP_LO_OFF);
121 writel(0, addr + WIN_REMAP_HI_OFF);
122 }
123 }
124}
125
126/*
127 * Disable, clear and configure windows.
128 */
129void __init orion_config_wins(struct orion_addr_map_cfg * cfg,
130 const struct orion_addr_map_info *info)
131{
132 if (!cfg->cpu_win_can_remap)
133 cfg->cpu_win_can_remap = orion_cpu_win_can_remap;
134
135 if (!cfg->win_cfg_base)
136 cfg->win_cfg_base = orion_win_cfg_base;
137
138 orion_disable_wins(cfg);
139
140 if (info)
141 orion_setup_cpu_wins(cfg, info);
142}
143
144/*
145 * Setup MBUS dram target info.
146 */
147void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg,
148 const void __iomem *ddr_window_cpu_base)
149{
150 int i;
151 int cs;
152
153 orion_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
154
155 for (i = 0, cs = 0; i < 4; i++) {
156 u32 base = readl(ddr_window_cpu_base + DDR_BASE_CS_OFF(i));
157 u32 size = readl(ddr_window_cpu_base + DDR_SIZE_CS_OFF(i));
158
159 /*
160 * We only take care of entries for which the chip
161 * select is enabled, and that don't have high base
162 * address bits set (devices can only access the first
163 * 32 bits of the memory).
164 */
165 if ((size & 1) && !(base & 0xF)) {
166 struct mbus_dram_window *w;
167
168 w = &orion_mbus_dram_info.cs[cs++];
169 w->cs_index = i;
170 w->mbus_attr = 0xf & ~(1 << i);
171 if (cfg->hw_io_coherency)
172 w->mbus_attr |= ATTR_HW_COHERENCY;
173 w->base = base & 0xffff0000;
174 w->size = (size | 0x0000ffff) + 1;
175 }
176 }
177 orion_mbus_dram_info.num_cs = cs;
178}
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index c29ee7ea200b..e39c2ba6e2fb 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -439,6 +439,64 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
439 } 439 }
440} 440}
441 441
442#ifdef CONFIG_DEBUG_FS
443#include <linux/seq_file.h>
444
445static void orion_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
446{
447 struct orion_gpio_chip *ochip =
448 container_of(chip, struct orion_gpio_chip, chip);
449 u32 out, io_conf, blink, in_pol, data_in, cause, edg_msk, lvl_msk;
450 int i;
451
452 out = readl_relaxed(GPIO_OUT(ochip));
453 io_conf = readl_relaxed(GPIO_IO_CONF(ochip));
454 blink = readl_relaxed(GPIO_BLINK_EN(ochip));
455 in_pol = readl_relaxed(GPIO_IN_POL(ochip));
456 data_in = readl_relaxed(GPIO_DATA_IN(ochip));
457 cause = readl_relaxed(GPIO_EDGE_CAUSE(ochip));
458 edg_msk = readl_relaxed(GPIO_EDGE_MASK(ochip));
459 lvl_msk = readl_relaxed(GPIO_LEVEL_MASK(ochip));
460
461 for (i = 0; i < chip->ngpio; i++) {
462 const char *label;
463 u32 msk;
464 bool is_out;
465
466 label = gpiochip_is_requested(chip, i);
467 if (!label)
468 continue;
469
470 msk = 1 << i;
471 is_out = !(io_conf & msk);
472
473 seq_printf(s, " gpio-%-3d (%-20.20s)", chip->base + i, label);
474
475 if (is_out) {
476 seq_printf(s, " out %s %s\n",
477 out & msk ? "hi" : "lo",
478 blink & msk ? "(blink )" : "");
479 continue;
480 }
481
482 seq_printf(s, " in %s (act %s) - IRQ",
483 (data_in ^ in_pol) & msk ? "hi" : "lo",
484 in_pol & msk ? "lo" : "hi");
485 if (!((edg_msk | lvl_msk) & msk)) {
486 seq_printf(s, " disabled\n");
487 continue;
488 }
489 if (edg_msk & msk)
490 seq_printf(s, " edge ");
491 if (lvl_msk & msk)
492 seq_printf(s, " level");
493 seq_printf(s, " (%s)\n", cause & msk ? "pending" : "clear ");
494 }
495}
496#else
497#define orion_gpio_dbg_show NULL
498#endif
499
442void __init orion_gpio_init(struct device_node *np, 500void __init orion_gpio_init(struct device_node *np,
443 int gpio_base, int ngpio, 501 int gpio_base, int ngpio,
444 void __iomem *base, int mask_offset, 502 void __iomem *base, int mask_offset,
@@ -471,6 +529,7 @@ void __init orion_gpio_init(struct device_node *np,
471#ifdef CONFIG_OF 529#ifdef CONFIG_OF
472 ochip->chip.of_node = np; 530 ochip->chip.of_node = np;
473#endif 531#endif
532 ochip->chip.dbg_show = orion_gpio_dbg_show;
474 533
475 spin_lock_init(&ochip->lock); 534 spin_lock_init(&ochip->lock);
476 ochip->base = (void __iomem *)base; 535 ochip->base = (void __iomem *)base;
diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c
index f20a321088a2..8b8c06d2e9c4 100644
--- a/arch/arm/plat-orion/pcie.c
+++ b/arch/arm/plat-orion/pcie.c
@@ -120,12 +120,14 @@ void __init orion_pcie_reset(void __iomem *base)
120 * BAR[0,2] -> disabled, BAR[1] -> covers all DRAM banks 120 * BAR[0,2] -> disabled, BAR[1] -> covers all DRAM banks
121 * WIN[0-3] -> DRAM bank[0-3] 121 * WIN[0-3] -> DRAM bank[0-3]
122 */ 122 */
123static void __init orion_pcie_setup_wins(void __iomem *base, 123static void __init orion_pcie_setup_wins(void __iomem *base)
124 struct mbus_dram_target_info *dram)
125{ 124{
125 const struct mbus_dram_target_info *dram;
126 u32 size; 126 u32 size;
127 int i; 127 int i;
128 128
129 dram = mv_mbus_dram_info();
130
129 /* 131 /*
130 * First, disable and clear BARs and windows. 132 * First, disable and clear BARs and windows.
131 */ 133 */
@@ -150,7 +152,7 @@ static void __init orion_pcie_setup_wins(void __iomem *base,
150 */ 152 */
151 size = 0; 153 size = 0;
152 for (i = 0; i < dram->num_cs; i++) { 154 for (i = 0; i < dram->num_cs; i++) {
153 struct mbus_dram_window *cs = dram->cs + i; 155 const struct mbus_dram_window *cs = dram->cs + i;
154 156
155 writel(cs->base & 0xffff0000, base + PCIE_WIN04_BASE_OFF(i)); 157 writel(cs->base & 0xffff0000, base + PCIE_WIN04_BASE_OFF(i));
156 writel(0, base + PCIE_WIN04_REMAP_OFF(i)); 158 writel(0, base + PCIE_WIN04_REMAP_OFF(i));
@@ -184,7 +186,7 @@ void __init orion_pcie_setup(void __iomem *base)
184 /* 186 /*
185 * Point PCIe unit MBUS decode windows to DRAM space. 187 * Point PCIe unit MBUS decode windows to DRAM space.
186 */ 188 */
187 orion_pcie_setup_wins(base, &orion_mbus_dram_info); 189 orion_pcie_setup_wins(base);
188 190
189 /* 191 /*
190 * Master + slave enable. 192 * Master + slave enable.
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 0f51ed687dc8..b05ecab915c4 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -4,6 +4,13 @@
4 4
5menu "Bus devices" 5menu "Bus devices"
6 6
7config MVEBU_MBUS
8 bool
9 depends on PLAT_ORION
10 help
11 Driver needed for the MBus configuration on Marvell EBU SoCs
12 (Kirkwood, Dove, Orion5x, MV78XX0 and Armada 370/XP).
13
7config OMAP_OCP2SCP 14config OMAP_OCP2SCP
8 tristate "OMAP OCP2SCP DRIVER" 15 tristate "OMAP OCP2SCP DRIVER"
9 depends on ARCH_OMAP2PLUS 16 depends on ARCH_OMAP2PLUS
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index 45d997c85453..3c7b53c12091 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -2,6 +2,7 @@
2# Makefile for the bus drivers. 2# Makefile for the bus drivers.
3# 3#
4 4
5obj-$(CONFIG_MVEBU_MBUS) += mvebu-mbus.o
5obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o 6obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o
6 7
7# Interconnect bus driver for OMAP SoCs. 8# Interconnect bus driver for OMAP SoCs.
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
new file mode 100644
index 000000000000..8740f46b4d0d
--- /dev/null
+++ b/drivers/bus/mvebu-mbus.c
@@ -0,0 +1,870 @@
1/*
2 * Address map functions for Marvell EBU SoCs (Kirkwood, Armada
3 * 370/XP, Dove, Orion5x and MV78xx0)
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 *
9 * The Marvell EBU SoCs have a configurable physical address space:
10 * the physical address at which certain devices (PCIe, NOR, NAND,
11 * etc.) sit can be configured. The configuration takes place through
12 * two sets of registers:
13 *
14 * - One to configure the access of the CPU to the devices. Depending
15 * on the families, there are between 8 and 20 configurable windows,
16 * each can be use to create a physical memory window that maps to a
17 * specific device. Devices are identified by a tuple (target,
18 * attribute).
19 *
20 * - One to configure the access to the CPU to the SDRAM. There are
21 * either 2 (for Dove) or 4 (for other families) windows to map the
22 * SDRAM into the physical address space.
23 *
24 * This driver:
25 *
26 * - Reads out the SDRAM address decoding windows at initialization
27 * time, and fills the mvebu_mbus_dram_info structure with these
28 * informations. The exported function mv_mbus_dram_info() allow
29 * device drivers to get those informations related to the SDRAM
30 * address decoding windows. This is because devices also have their
31 * own windows (configured through registers that are part of each
32 * device register space), and therefore the drivers for Marvell
33 * devices have to configure those device -> SDRAM windows to ensure
34 * that DMA works properly.
35 *
36 * - Provides an API for platform code or device drivers to
37 * dynamically add or remove address decoding windows for the CPU ->
38 * device accesses. This API is mvebu_mbus_add_window(),
39 * mvebu_mbus_add_window_remap_flags() and
40 * mvebu_mbus_del_window(). Since the (target, attribute) values
41 * differ from one SoC family to another, the API uses a 'const char
42 * *' string to identify devices, and this driver is responsible for
43 * knowing the mapping between the name of a device and its
44 * corresponding (target, attribute) in the current SoC family.
45 *
46 * - Provides a debugfs interface in /sys/kernel/debug/mvebu-mbus/ to
47 * see the list of CPU -> SDRAM windows and their configuration
48 * (file 'sdram') and the list of CPU -> devices windows and their
49 * configuration (file 'devices').
50 */
51
52#include <linux/kernel.h>
53#include <linux/module.h>
54#include <linux/init.h>
55#include <linux/mbus.h>
56#include <linux/io.h>
57#include <linux/ioport.h>
58#include <linux/of.h>
59#include <linux/of_address.h>
60#include <linux/debugfs.h>
61
62/*
63 * DDR target is the same on all platforms.
64 */
65#define TARGET_DDR 0
66
67/*
68 * CPU Address Decode Windows registers
69 */
70#define WIN_CTRL_OFF 0x0000
71#define WIN_CTRL_ENABLE BIT(0)
72#define WIN_CTRL_TGT_MASK 0xf0
73#define WIN_CTRL_TGT_SHIFT 4
74#define WIN_CTRL_ATTR_MASK 0xff00
75#define WIN_CTRL_ATTR_SHIFT 8
76#define WIN_CTRL_SIZE_MASK 0xffff0000
77#define WIN_CTRL_SIZE_SHIFT 16
78#define WIN_BASE_OFF 0x0004
79#define WIN_BASE_LOW 0xffff0000
80#define WIN_BASE_HIGH 0xf
81#define WIN_REMAP_LO_OFF 0x0008
82#define WIN_REMAP_LOW 0xffff0000
83#define WIN_REMAP_HI_OFF 0x000c
84
85#define ATTR_HW_COHERENCY (0x1 << 4)
86
87#define DDR_BASE_CS_OFF(n) (0x0000 + ((n) << 3))
88#define DDR_BASE_CS_HIGH_MASK 0xf
89#define DDR_BASE_CS_LOW_MASK 0xff000000
90#define DDR_SIZE_CS_OFF(n) (0x0004 + ((n) << 3))
91#define DDR_SIZE_ENABLED BIT(0)
92#define DDR_SIZE_CS_MASK 0x1c
93#define DDR_SIZE_CS_SHIFT 2
94#define DDR_SIZE_MASK 0xff000000
95
96#define DOVE_DDR_BASE_CS_OFF(n) ((n) << 4)
97
98struct mvebu_mbus_mapping {
99 const char *name;
100 u8 target;
101 u8 attr;
102 u8 attrmask;
103};
104
105/*
106 * Masks used for the 'attrmask' field of mvebu_mbus_mapping. They
107 * allow to get the real attribute value, discarding the special bits
108 * used to select a PCI MEM region or a PCI WA region. This allows the
109 * debugfs code to reverse-match the name of a device from its
110 * target/attr values.
111 *
112 * For all devices except PCI, all bits of 'attr' must be
113 * considered. For most SoCs, only bit 3 should be ignored (it allows
114 * to select between PCI MEM and PCI I/O). On Orion5x however, there
115 * is the special bit 5 to select a PCI WA region.
116 */
117#define MAPDEF_NOMASK 0xff
118#define MAPDEF_PCIMASK 0xf7
119#define MAPDEF_ORIONPCIMASK 0xd7
120
121/* Macro used to define one mvebu_mbus_mapping entry */
122#define MAPDEF(__n, __t, __a, __m) \
123 { .name = __n, .target = __t, .attr = __a, .attrmask = __m }
124
125struct mvebu_mbus_state;
126
127struct mvebu_mbus_soc_data {
128 unsigned int num_wins;
129 unsigned int num_remappable_wins;
130 unsigned int (*win_cfg_offset)(const int win);
131 void (*setup_cpu_target)(struct mvebu_mbus_state *s);
132 int (*show_cpu_target)(struct mvebu_mbus_state *s,
133 struct seq_file *seq, void *v);
134 const struct mvebu_mbus_mapping *map;
135};
136
137struct mvebu_mbus_state {
138 void __iomem *mbuswins_base;
139 void __iomem *sdramwins_base;
140 struct dentry *debugfs_root;
141 struct dentry *debugfs_sdram;
142 struct dentry *debugfs_devs;
143 const struct mvebu_mbus_soc_data *soc;
144 int hw_io_coherency;
145};
146
147static struct mvebu_mbus_state mbus_state;
148
149static struct mbus_dram_target_info mvebu_mbus_dram_info;
150const struct mbus_dram_target_info *mv_mbus_dram_info(void)
151{
152 return &mvebu_mbus_dram_info;
153}
154EXPORT_SYMBOL_GPL(mv_mbus_dram_info);
155
156/*
157 * Functions to manipulate the address decoding windows
158 */
159
160static void mvebu_mbus_read_window(struct mvebu_mbus_state *mbus,
161 int win, int *enabled, u64 *base,
162 u32 *size, u8 *target, u8 *attr,
163 u64 *remap)
164{
165 void __iomem *addr = mbus->mbuswins_base +
166 mbus->soc->win_cfg_offset(win);
167 u32 basereg = readl(addr + WIN_BASE_OFF);
168 u32 ctrlreg = readl(addr + WIN_CTRL_OFF);
169
170 if (!(ctrlreg & WIN_CTRL_ENABLE)) {
171 *enabled = 0;
172 return;
173 }
174
175 *enabled = 1;
176 *base = ((u64)basereg & WIN_BASE_HIGH) << 32;
177 *base |= (basereg & WIN_BASE_LOW);
178 *size = (ctrlreg | ~WIN_CTRL_SIZE_MASK) + 1;
179
180 if (target)
181 *target = (ctrlreg & WIN_CTRL_TGT_MASK) >> WIN_CTRL_TGT_SHIFT;
182
183 if (attr)
184 *attr = (ctrlreg & WIN_CTRL_ATTR_MASK) >> WIN_CTRL_ATTR_SHIFT;
185
186 if (remap) {
187 if (win < mbus->soc->num_remappable_wins) {
188 u32 remap_low = readl(addr + WIN_REMAP_LO_OFF);
189 u32 remap_hi = readl(addr + WIN_REMAP_HI_OFF);
190 *remap = ((u64)remap_hi << 32) | remap_low;
191 } else
192 *remap = 0;
193 }
194}
195
196static void mvebu_mbus_disable_window(struct mvebu_mbus_state *mbus,
197 int win)
198{
199 void __iomem *addr;
200
201 addr = mbus->mbuswins_base + mbus->soc->win_cfg_offset(win);
202
203 writel(0, addr + WIN_BASE_OFF);
204 writel(0, addr + WIN_CTRL_OFF);
205 if (win < mbus->soc->num_remappable_wins) {
206 writel(0, addr + WIN_REMAP_LO_OFF);
207 writel(0, addr + WIN_REMAP_HI_OFF);
208 }
209}
210
211/* Checks whether the given window number is available */
212static int mvebu_mbus_window_is_free(struct mvebu_mbus_state *mbus,
213 const int win)
214{
215 void __iomem *addr = mbus->mbuswins_base +
216 mbus->soc->win_cfg_offset(win);
217 u32 ctrl = readl(addr + WIN_CTRL_OFF);
218 return !(ctrl & WIN_CTRL_ENABLE);
219}
220
221/*
222 * Checks whether the given (base, base+size) area doesn't overlap an
223 * existing region
224 */
225static int mvebu_mbus_window_conflicts(struct mvebu_mbus_state *mbus,
226 phys_addr_t base, size_t size,
227 u8 target, u8 attr)
228{
229 u64 end = (u64)base + size;
230 int win;
231
232 for (win = 0; win < mbus->soc->num_wins; win++) {
233 u64 wbase, wend;
234 u32 wsize;
235 u8 wtarget, wattr;
236 int enabled;
237
238 mvebu_mbus_read_window(mbus, win,
239 &enabled, &wbase, &wsize,
240 &wtarget, &wattr, NULL);
241
242 if (!enabled)
243 continue;
244
245 wend = wbase + wsize;
246
247 /*
248 * Check if the current window overlaps with the
249 * proposed physical range
250 */
251 if ((u64)base < wend && end > wbase)
252 return 0;
253
254 /*
255 * Check if target/attribute conflicts
256 */
257 if (target == wtarget && attr == wattr)
258 return 0;
259 }
260
261 return 1;
262}
263
264static int mvebu_mbus_find_window(struct mvebu_mbus_state *mbus,
265 phys_addr_t base, size_t size)
266{
267 int win;
268
269 for (win = 0; win < mbus->soc->num_wins; win++) {
270 u64 wbase;
271 u32 wsize;
272 int enabled;
273
274 mvebu_mbus_read_window(mbus, win,
275 &enabled, &wbase, &wsize,
276 NULL, NULL, NULL);
277
278 if (!enabled)
279 continue;
280
281 if (base == wbase && size == wsize)
282 return win;
283 }
284
285 return -ENODEV;
286}
287
288static int mvebu_mbus_setup_window(struct mvebu_mbus_state *mbus,
289 int win, phys_addr_t base, size_t size,
290 phys_addr_t remap, u8 target,
291 u8 attr)
292{
293 void __iomem *addr = mbus->mbuswins_base +
294 mbus->soc->win_cfg_offset(win);
295 u32 ctrl, remap_addr;
296
297 ctrl = ((size - 1) & WIN_CTRL_SIZE_MASK) |
298 (attr << WIN_CTRL_ATTR_SHIFT) |
299 (target << WIN_CTRL_TGT_SHIFT) |
300 WIN_CTRL_ENABLE;
301
302 writel(base & WIN_BASE_LOW, addr + WIN_BASE_OFF);
303 writel(ctrl, addr + WIN_CTRL_OFF);
304 if (win < mbus->soc->num_remappable_wins) {
305 if (remap == MVEBU_MBUS_NO_REMAP)
306 remap_addr = base;
307 else
308 remap_addr = remap;
309 writel(remap_addr & WIN_REMAP_LOW, addr + WIN_REMAP_LO_OFF);
310 writel(0, addr + WIN_REMAP_HI_OFF);
311 }
312
313 return 0;
314}
315
316static int mvebu_mbus_alloc_window(struct mvebu_mbus_state *mbus,
317 phys_addr_t base, size_t size,
318 phys_addr_t remap, u8 target,
319 u8 attr)
320{
321 int win;
322
323 if (remap == MVEBU_MBUS_NO_REMAP) {
324 for (win = mbus->soc->num_remappable_wins;
325 win < mbus->soc->num_wins; win++)
326 if (mvebu_mbus_window_is_free(mbus, win))
327 return mvebu_mbus_setup_window(mbus, win, base,
328 size, remap,
329 target, attr);
330 }
331
332
333 for (win = 0; win < mbus->soc->num_wins; win++)
334 if (mvebu_mbus_window_is_free(mbus, win))
335 return mvebu_mbus_setup_window(mbus, win, base, size,
336 remap, target, attr);
337
338 return -ENOMEM;
339}
340
341/*
342 * Debugfs debugging
343 */
344
345/* Common function used for Dove, Kirkwood, Armada 370/XP and Orion 5x */
346static int mvebu_sdram_debug_show_orion(struct mvebu_mbus_state *mbus,
347 struct seq_file *seq, void *v)
348{
349 int i;
350
351 for (i = 0; i < 4; i++) {
352 u32 basereg = readl(mbus->sdramwins_base + DDR_BASE_CS_OFF(i));
353 u32 sizereg = readl(mbus->sdramwins_base + DDR_SIZE_CS_OFF(i));
354 u64 base;
355 u32 size;
356
357 if (!(sizereg & DDR_SIZE_ENABLED)) {
358 seq_printf(seq, "[%d] disabled\n", i);
359 continue;
360 }
361
362 base = ((u64)basereg & DDR_BASE_CS_HIGH_MASK) << 32;
363 base |= basereg & DDR_BASE_CS_LOW_MASK;
364 size = (sizereg | ~DDR_SIZE_MASK);
365
366 seq_printf(seq, "[%d] %016llx - %016llx : cs%d\n",
367 i, (unsigned long long)base,
368 (unsigned long long)base + size + 1,
369 (sizereg & DDR_SIZE_CS_MASK) >> DDR_SIZE_CS_SHIFT);
370 }
371
372 return 0;
373}
374
375/* Special function for Dove */
376static int mvebu_sdram_debug_show_dove(struct mvebu_mbus_state *mbus,
377 struct seq_file *seq, void *v)
378{
379 int i;
380
381 for (i = 0; i < 2; i++) {
382 u32 map = readl(mbus->sdramwins_base + DOVE_DDR_BASE_CS_OFF(i));
383 u64 base;
384 u32 size;
385
386 if (!(map & 1)) {
387 seq_printf(seq, "[%d] disabled\n", i);
388 continue;
389 }
390
391 base = map & 0xff800000;
392 size = 0x100000 << (((map & 0x000f0000) >> 16) - 4);
393
394 seq_printf(seq, "[%d] %016llx - %016llx : cs%d\n",
395 i, (unsigned long long)base,
396 (unsigned long long)base + size, i);
397 }
398
399 return 0;
400}
401
402static int mvebu_sdram_debug_show(struct seq_file *seq, void *v)
403{
404 struct mvebu_mbus_state *mbus = &mbus_state;
405 return mbus->soc->show_cpu_target(mbus, seq, v);
406}
407
408static int mvebu_sdram_debug_open(struct inode *inode, struct file *file)
409{
410 return single_open(file, mvebu_sdram_debug_show, inode->i_private);
411}
412
413static const struct file_operations mvebu_sdram_debug_fops = {
414 .open = mvebu_sdram_debug_open,
415 .read = seq_read,
416 .llseek = seq_lseek,
417 .release = single_release,
418};
419
420static int mvebu_devs_debug_show(struct seq_file *seq, void *v)
421{
422 struct mvebu_mbus_state *mbus = &mbus_state;
423 int win;
424
425 for (win = 0; win < mbus->soc->num_wins; win++) {
426 u64 wbase, wremap;
427 u32 wsize;
428 u8 wtarget, wattr;
429 int enabled, i;
430 const char *name;
431
432 mvebu_mbus_read_window(mbus, win,
433 &enabled, &wbase, &wsize,
434 &wtarget, &wattr, &wremap);
435
436 if (!enabled) {
437 seq_printf(seq, "[%02d] disabled\n", win);
438 continue;
439 }
440
441
442 for (i = 0; mbus->soc->map[i].name; i++)
443 if (mbus->soc->map[i].target == wtarget &&
444 mbus->soc->map[i].attr ==
445 (wattr & mbus->soc->map[i].attrmask))
446 break;
447
448 name = mbus->soc->map[i].name ?: "unknown";
449
450 seq_printf(seq, "[%02d] %016llx - %016llx : %s",
451 win, (unsigned long long)wbase,
452 (unsigned long long)(wbase + wsize), name);
453
454 if (win < mbus->soc->num_remappable_wins) {
455 seq_printf(seq, " (remap %016llx)\n",
456 (unsigned long long)wremap);
457 } else
458 seq_printf(seq, "\n");
459 }
460
461 return 0;
462}
463
464static int mvebu_devs_debug_open(struct inode *inode, struct file *file)
465{
466 return single_open(file, mvebu_devs_debug_show, inode->i_private);
467}
468
469static const struct file_operations mvebu_devs_debug_fops = {
470 .open = mvebu_devs_debug_open,
471 .read = seq_read,
472 .llseek = seq_lseek,
473 .release = single_release,
474};
475
476/*
477 * SoC-specific functions and definitions
478 */
479
480static unsigned int orion_mbus_win_offset(int win)
481{
482 return win << 4;
483}
484
485static unsigned int armada_370_xp_mbus_win_offset(int win)
486{
487 /* The register layout is a bit annoying and the below code
488 * tries to cope with it.
489 * - At offset 0x0, there are the registers for the first 8
490 * windows, with 4 registers of 32 bits per window (ctrl,
491 * base, remap low, remap high)
492 * - Then at offset 0x80, there is a hole of 0x10 bytes for
493 * the internal registers base address and internal units
494 * sync barrier register.
495 * - Then at offset 0x90, there the registers for 12
496 * windows, with only 2 registers of 32 bits per window
497 * (ctrl, base).
498 */
499 if (win < 8)
500 return win << 4;
501 else
502 return 0x90 + ((win - 8) << 3);
503}
504
505static unsigned int mv78xx0_mbus_win_offset(int win)
506{
507 if (win < 8)
508 return win << 4;
509 else
510 return 0x900 + ((win - 8) << 4);
511}
512
513static void __init
514mvebu_mbus_default_setup_cpu_target(struct mvebu_mbus_state *mbus)
515{
516 int i;
517 int cs;
518
519 mvebu_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
520
521 for (i = 0, cs = 0; i < 4; i++) {
522 u32 base = readl(mbus->sdramwins_base + DDR_BASE_CS_OFF(i));
523 u32 size = readl(mbus->sdramwins_base + DDR_SIZE_CS_OFF(i));
524
525 /*
526 * We only take care of entries for which the chip
527 * select is enabled, and that don't have high base
528 * address bits set (devices can only access the first
529 * 32 bits of the memory).
530 */
531 if ((size & DDR_SIZE_ENABLED) &&
532 !(base & DDR_BASE_CS_HIGH_MASK)) {
533 struct mbus_dram_window *w;
534
535 w = &mvebu_mbus_dram_info.cs[cs++];
536 w->cs_index = i;
537 w->mbus_attr = 0xf & ~(1 << i);
538 if (mbus->hw_io_coherency)
539 w->mbus_attr |= ATTR_HW_COHERENCY;
540 w->base = base & DDR_BASE_CS_LOW_MASK;
541 w->size = (size | ~DDR_SIZE_MASK) + 1;
542 }
543 }
544 mvebu_mbus_dram_info.num_cs = cs;
545}
546
547static void __init
548mvebu_mbus_dove_setup_cpu_target(struct mvebu_mbus_state *mbus)
549{
550 int i;
551 int cs;
552
553 mvebu_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
554
555 for (i = 0, cs = 0; i < 2; i++) {
556 u32 map = readl(mbus->sdramwins_base + DOVE_DDR_BASE_CS_OFF(i));
557
558 /*
559 * Chip select enabled?
560 */
561 if (map & 1) {
562 struct mbus_dram_window *w;
563
564 w = &mvebu_mbus_dram_info.cs[cs++];
565 w->cs_index = i;
566 w->mbus_attr = 0; /* CS address decoding done inside */
567 /* the DDR controller, no need to */
568 /* provide attributes */
569 w->base = map & 0xff800000;
570 w->size = 0x100000 << (((map & 0x000f0000) >> 16) - 4);
571 }
572 }
573
574 mvebu_mbus_dram_info.num_cs = cs;
575}
576
577static const struct mvebu_mbus_mapping armada_370_map[] = {
578 MAPDEF("bootrom", 1, 0xe0, MAPDEF_NOMASK),
579 MAPDEF("devbus-boot", 1, 0x2f, MAPDEF_NOMASK),
580 MAPDEF("devbus-cs0", 1, 0x3e, MAPDEF_NOMASK),
581 MAPDEF("devbus-cs1", 1, 0x3d, MAPDEF_NOMASK),
582 MAPDEF("devbus-cs2", 1, 0x3b, MAPDEF_NOMASK),
583 MAPDEF("devbus-cs3", 1, 0x37, MAPDEF_NOMASK),
584 MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
585 MAPDEF("pcie1.0", 8, 0xe0, MAPDEF_PCIMASK),
586 {},
587};
588
589static const struct mvebu_mbus_soc_data armada_370_mbus_data = {
590 .num_wins = 20,
591 .num_remappable_wins = 8,
592 .win_cfg_offset = armada_370_xp_mbus_win_offset,
593 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
594 .show_cpu_target = mvebu_sdram_debug_show_orion,
595 .map = armada_370_map,
596};
597
598static const struct mvebu_mbus_mapping armada_xp_map[] = {
599 MAPDEF("bootrom", 1, 0x1d, MAPDEF_NOMASK),
600 MAPDEF("devbus-boot", 1, 0x2f, MAPDEF_NOMASK),
601 MAPDEF("devbus-cs0", 1, 0x3e, MAPDEF_NOMASK),
602 MAPDEF("devbus-cs1", 1, 0x3d, MAPDEF_NOMASK),
603 MAPDEF("devbus-cs2", 1, 0x3b, MAPDEF_NOMASK),
604 MAPDEF("devbus-cs3", 1, 0x37, MAPDEF_NOMASK),
605 MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
606 MAPDEF("pcie0.1", 4, 0xd0, MAPDEF_PCIMASK),
607 MAPDEF("pcie0.2", 4, 0xb0, MAPDEF_PCIMASK),
608 MAPDEF("pcie0.3", 4, 0x70, MAPDEF_PCIMASK),
609 MAPDEF("pcie1.0", 8, 0xe0, MAPDEF_PCIMASK),
610 MAPDEF("pcie1.1", 8, 0xd0, MAPDEF_PCIMASK),
611 MAPDEF("pcie1.2", 8, 0xb0, MAPDEF_PCIMASK),
612 MAPDEF("pcie1.3", 8, 0x70, MAPDEF_PCIMASK),
613 MAPDEF("pcie2.0", 4, 0xf0, MAPDEF_PCIMASK),
614 MAPDEF("pcie3.0", 8, 0xf0, MAPDEF_PCIMASK),
615 {},
616};
617
618static const struct mvebu_mbus_soc_data armada_xp_mbus_data = {
619 .num_wins = 20,
620 .num_remappable_wins = 8,
621 .win_cfg_offset = armada_370_xp_mbus_win_offset,
622 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
623 .show_cpu_target = mvebu_sdram_debug_show_orion,
624 .map = armada_xp_map,
625};
626
627static const struct mvebu_mbus_mapping kirkwood_map[] = {
628 MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
629 MAPDEF("pcie1.0", 4, 0xd0, MAPDEF_PCIMASK),
630 MAPDEF("sram", 3, 0x01, MAPDEF_NOMASK),
631 MAPDEF("nand", 1, 0x2f, MAPDEF_NOMASK),
632 {},
633};
634
635static const struct mvebu_mbus_soc_data kirkwood_mbus_data = {
636 .num_wins = 8,
637 .num_remappable_wins = 4,
638 .win_cfg_offset = orion_mbus_win_offset,
639 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
640 .show_cpu_target = mvebu_sdram_debug_show_orion,
641 .map = kirkwood_map,
642};
643
644static const struct mvebu_mbus_mapping dove_map[] = {
645 MAPDEF("pcie0.0", 0x4, 0xe0, MAPDEF_PCIMASK),
646 MAPDEF("pcie1.0", 0x8, 0xe0, MAPDEF_PCIMASK),
647 MAPDEF("cesa", 0x3, 0x01, MAPDEF_NOMASK),
648 MAPDEF("bootrom", 0x1, 0xfd, MAPDEF_NOMASK),
649 MAPDEF("scratchpad", 0xd, 0x0, MAPDEF_NOMASK),
650 {},
651};
652
653static const struct mvebu_mbus_soc_data dove_mbus_data = {
654 .num_wins = 8,
655 .num_remappable_wins = 4,
656 .win_cfg_offset = orion_mbus_win_offset,
657 .setup_cpu_target = mvebu_mbus_dove_setup_cpu_target,
658 .show_cpu_target = mvebu_sdram_debug_show_dove,
659 .map = dove_map,
660};
661
662static const struct mvebu_mbus_mapping orion5x_map[] = {
663 MAPDEF("pcie0.0", 4, 0x51, MAPDEF_ORIONPCIMASK),
664 MAPDEF("pci0.0", 3, 0x51, MAPDEF_ORIONPCIMASK),
665 MAPDEF("devbus-boot", 1, 0x0f, MAPDEF_NOMASK),
666 MAPDEF("devbus-cs0", 1, 0x1e, MAPDEF_NOMASK),
667 MAPDEF("devbus-cs1", 1, 0x1d, MAPDEF_NOMASK),
668 MAPDEF("devbus-cs2", 1, 0x1b, MAPDEF_NOMASK),
669 MAPDEF("sram", 0, 0x00, MAPDEF_NOMASK),
670 {},
671};
672
673/*
674 * Some variants of Orion5x have 4 remappable windows, some other have
675 * only two of them.
676 */
677static const struct mvebu_mbus_soc_data orion5x_4win_mbus_data = {
678 .num_wins = 8,
679 .num_remappable_wins = 4,
680 .win_cfg_offset = orion_mbus_win_offset,
681 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
682 .show_cpu_target = mvebu_sdram_debug_show_orion,
683 .map = orion5x_map,
684};
685
686static const struct mvebu_mbus_soc_data orion5x_2win_mbus_data = {
687 .num_wins = 8,
688 .num_remappable_wins = 2,
689 .win_cfg_offset = orion_mbus_win_offset,
690 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
691 .show_cpu_target = mvebu_sdram_debug_show_orion,
692 .map = orion5x_map,
693};
694
695static const struct mvebu_mbus_mapping mv78xx0_map[] = {
696 MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
697 MAPDEF("pcie0.1", 4, 0xd0, MAPDEF_PCIMASK),
698 MAPDEF("pcie0.2", 4, 0xb0, MAPDEF_PCIMASK),
699 MAPDEF("pcie0.3", 4, 0x70, MAPDEF_PCIMASK),
700 MAPDEF("pcie1.0", 8, 0xe0, MAPDEF_PCIMASK),
701 MAPDEF("pcie1.1", 8, 0xd0, MAPDEF_PCIMASK),
702 MAPDEF("pcie1.2", 8, 0xb0, MAPDEF_PCIMASK),
703 MAPDEF("pcie1.3", 8, 0x70, MAPDEF_PCIMASK),
704 MAPDEF("pcie2.0", 4, 0xf0, MAPDEF_PCIMASK),
705 MAPDEF("pcie3.0", 8, 0xf0, MAPDEF_PCIMASK),
706 {},
707};
708
709static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = {
710 .num_wins = 14,
711 .num_remappable_wins = 8,
712 .win_cfg_offset = mv78xx0_mbus_win_offset,
713 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
714 .show_cpu_target = mvebu_sdram_debug_show_orion,
715 .map = mv78xx0_map,
716};
717
718/*
719 * The driver doesn't yet have a DT binding because the details of
720 * this DT binding still need to be sorted out. However, as a
721 * preparation, we already use of_device_id to match a SoC description
722 * string against the SoC specific details of this driver.
723 */
724static const struct of_device_id of_mvebu_mbus_ids[] = {
725 { .compatible = "marvell,armada370-mbus",
726 .data = &armada_370_mbus_data, },
727 { .compatible = "marvell,armadaxp-mbus",
728 .data = &armada_xp_mbus_data, },
729 { .compatible = "marvell,kirkwood-mbus",
730 .data = &kirkwood_mbus_data, },
731 { .compatible = "marvell,dove-mbus",
732 .data = &dove_mbus_data, },
733 { .compatible = "marvell,orion5x-88f5281-mbus",
734 .data = &orion5x_4win_mbus_data, },
735 { .compatible = "marvell,orion5x-88f5182-mbus",
736 .data = &orion5x_2win_mbus_data, },
737 { .compatible = "marvell,orion5x-88f5181-mbus",
738 .data = &orion5x_2win_mbus_data, },
739 { .compatible = "marvell,orion5x-88f6183-mbus",
740 .data = &orion5x_4win_mbus_data, },
741 { .compatible = "marvell,mv78xx0-mbus",
742 .data = &mv78xx0_mbus_data, },
743 { },
744};
745
746/*
747 * Public API of the driver
748 */
749int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base,
750 size_t size, phys_addr_t remap,
751 unsigned int flags)
752{
753 struct mvebu_mbus_state *s = &mbus_state;
754 u8 target, attr;
755 int i;
756
757 if (!s->soc->map)
758 return -ENODEV;
759
760 for (i = 0; s->soc->map[i].name; i++)
761 if (!strcmp(s->soc->map[i].name, devname))
762 break;
763
764 if (!s->soc->map[i].name) {
765 pr_err("mvebu-mbus: unknown device '%s'\n", devname);
766 return -ENODEV;
767 }
768
769 target = s->soc->map[i].target;
770 attr = s->soc->map[i].attr;
771
772 if (flags == MVEBU_MBUS_PCI_MEM)
773 attr |= 0x8;
774 else if (flags == MVEBU_MBUS_PCI_WA)
775 attr |= 0x28;
776
777 if (!mvebu_mbus_window_conflicts(s, base, size, target, attr)) {
778 pr_err("mvebu-mbus: cannot add window '%s', conflicts with another window\n",
779 devname);
780 return -EINVAL;
781 }
782
783 return mvebu_mbus_alloc_window(s, base, size, remap, target, attr);
784
785}
786
787int mvebu_mbus_add_window(const char *devname, phys_addr_t base, size_t size)
788{
789 return mvebu_mbus_add_window_remap_flags(devname, base, size,
790 MVEBU_MBUS_NO_REMAP, 0);
791}
792
793int mvebu_mbus_del_window(phys_addr_t base, size_t size)
794{
795 int win;
796
797 win = mvebu_mbus_find_window(&mbus_state, base, size);
798 if (win < 0)
799 return win;
800
801 mvebu_mbus_disable_window(&mbus_state, win);
802 return 0;
803}
804
805static __init int mvebu_mbus_debugfs_init(void)
806{
807 struct mvebu_mbus_state *s = &mbus_state;
808
809 /*
810 * If no base has been initialized, doesn't make sense to
811 * register the debugfs entries. We may be on a multiplatform
812 * kernel that isn't running a Marvell EBU SoC.
813 */
814 if (!s->mbuswins_base)
815 return 0;
816
817 s->debugfs_root = debugfs_create_dir("mvebu-mbus", NULL);
818 if (s->debugfs_root) {
819 s->debugfs_sdram = debugfs_create_file("sdram", S_IRUGO,
820 s->debugfs_root, NULL,
821 &mvebu_sdram_debug_fops);
822 s->debugfs_devs = debugfs_create_file("devices", S_IRUGO,
823 s->debugfs_root, NULL,
824 &mvebu_devs_debug_fops);
825 }
826
827 return 0;
828}
829fs_initcall(mvebu_mbus_debugfs_init);
830
831int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base,
832 size_t mbuswins_size,
833 phys_addr_t sdramwins_phys_base,
834 size_t sdramwins_size)
835{
836 struct mvebu_mbus_state *mbus = &mbus_state;
837 const struct of_device_id *of_id;
838 int win;
839
840 for (of_id = of_mvebu_mbus_ids; of_id->compatible; of_id++)
841 if (!strcmp(of_id->compatible, soc))
842 break;
843
844 if (!of_id->compatible) {
845 pr_err("mvebu-mbus: could not find a matching SoC family\n");
846 return -ENODEV;
847 }
848
849 mbus->soc = of_id->data;
850
851 mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
852 if (!mbus->mbuswins_base)
853 return -ENOMEM;
854
855 mbus->sdramwins_base = ioremap(sdramwins_phys_base, sdramwins_size);
856 if (!mbus->sdramwins_base) {
857 iounmap(mbus_state.mbuswins_base);
858 return -ENOMEM;
859 }
860
861 if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"))
862 mbus->hw_io_coherency = 1;
863
864 for (win = 0; win < mbus->soc->num_wins; win++)
865 mvebu_mbus_disable_window(mbus, win);
866
867 mbus->soc->setup_cpu_target(mbus);
868
869 return 0;
870}
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index a47e6ee98b8c..a64caefdba12 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -63,6 +63,14 @@ config CLK_TWL6040
63 McPDM. McPDM module is using the external bit clock on the McPDM bus 63 McPDM. McPDM module is using the external bit clock on the McPDM bus
64 as functional clock. 64 as functional clock.
65 65
66config COMMON_CLK_AXI_CLKGEN
67 tristate "AXI clkgen driver"
68 depends on ARCH_ZYNQ || MICROBLAZE
69 help
70 ---help---
71 Support for the Analog Devices axi-clkgen pcore clock generator for Xilinx
72 FPGAs. It is commonly used in Analog Devices' reference designs.
73
66endmenu 74endmenu
67 75
68source "drivers/clk/mvebu/Kconfig" 76source "drivers/clk/mvebu/Kconfig"
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index 0147022b9813..17e8dc4e417c 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_COMMON_CLK) += clk-fixed-factor.o
7obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o 7obj-$(CONFIG_COMMON_CLK) += clk-fixed-rate.o
8obj-$(CONFIG_COMMON_CLK) += clk-gate.o 8obj-$(CONFIG_COMMON_CLK) += clk-gate.o
9obj-$(CONFIG_COMMON_CLK) += clk-mux.o 9obj-$(CONFIG_COMMON_CLK) += clk-mux.o
10obj-$(CONFIG_COMMON_CLK) += clk-composite.o
10 11
11# SoCs specific 12# SoCs specific
12obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835.o 13obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835.o
@@ -23,6 +24,7 @@ ifeq ($(CONFIG_COMMON_CLK), y)
23obj-$(CONFIG_ARCH_MMP) += mmp/ 24obj-$(CONFIG_ARCH_MMP) += mmp/
24endif 25endif
25obj-$(CONFIG_MACH_LOONGSON1) += clk-ls1x.o 26obj-$(CONFIG_MACH_LOONGSON1) += clk-ls1x.o
27obj-$(CONFIG_ARCH_SUNXI) += sunxi/
26obj-$(CONFIG_ARCH_U8500) += ux500/ 28obj-$(CONFIG_ARCH_U8500) += ux500/
27obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o 29obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o
28obj-$(CONFIG_ARCH_ZYNQ) += clk-zynq.o 30obj-$(CONFIG_ARCH_ZYNQ) += clk-zynq.o
@@ -32,6 +34,7 @@ obj-$(CONFIG_PLAT_SAMSUNG) += samsung/
32obj-$(CONFIG_X86) += x86/ 34obj-$(CONFIG_X86) += x86/
33 35
34# Chip specific 36# Chip specific
37obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o
35obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o 38obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
36obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o 39obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o
37obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o 40obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o
diff --git a/drivers/clk/clk-axi-clkgen.c b/drivers/clk/clk-axi-clkgen.c
new file mode 100644
index 000000000000..8137327847c3
--- /dev/null
+++ b/drivers/clk/clk-axi-clkgen.c
@@ -0,0 +1,331 @@
1/*
2 * AXI clkgen driver
3 *
4 * Copyright 2012-2013 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2.
8 *
9 */
10
11#include <linux/platform_device.h>
12#include <linux/clk-provider.h>
13#include <linux/clk.h>
14#include <linux/slab.h>
15#include <linux/io.h>
16#include <linux/of.h>
17#include <linux/module.h>
18#include <linux/err.h>
19
20#define AXI_CLKGEN_REG_UPDATE_ENABLE 0x04
21#define AXI_CLKGEN_REG_CLK_OUT1 0x08
22#define AXI_CLKGEN_REG_CLK_OUT2 0x0c
23#define AXI_CLKGEN_REG_CLK_DIV 0x10
24#define AXI_CLKGEN_REG_CLK_FB1 0x14
25#define AXI_CLKGEN_REG_CLK_FB2 0x18
26#define AXI_CLKGEN_REG_LOCK1 0x1c
27#define AXI_CLKGEN_REG_LOCK2 0x20
28#define AXI_CLKGEN_REG_LOCK3 0x24
29#define AXI_CLKGEN_REG_FILTER1 0x28
30#define AXI_CLKGEN_REG_FILTER2 0x2c
31
32struct axi_clkgen {
33 void __iomem *base;
34 struct clk_hw clk_hw;
35};
36
37static uint32_t axi_clkgen_lookup_filter(unsigned int m)
38{
39 switch (m) {
40 case 0:
41 return 0x01001990;
42 case 1:
43 return 0x01001190;
44 case 2:
45 return 0x01009890;
46 case 3:
47 return 0x01001890;
48 case 4:
49 return 0x01008890;
50 case 5 ... 8:
51 return 0x01009090;
52 case 9 ... 11:
53 return 0x01000890;
54 case 12:
55 return 0x08009090;
56 case 13 ... 22:
57 return 0x01001090;
58 case 23 ... 36:
59 return 0x01008090;
60 case 37 ... 46:
61 return 0x08001090;
62 default:
63 return 0x08008090;
64 }
65}
66
67static const uint32_t axi_clkgen_lock_table[] = {
68 0x060603e8, 0x060603e8, 0x080803e8, 0x0b0b03e8,
69 0x0e0e03e8, 0x111103e8, 0x131303e8, 0x161603e8,
70 0x191903e8, 0x1c1c03e8, 0x1f1f0384, 0x1f1f0339,
71 0x1f1f02ee, 0x1f1f02bc, 0x1f1f028a, 0x1f1f0271,
72 0x1f1f023f, 0x1f1f0226, 0x1f1f020d, 0x1f1f01f4,
73 0x1f1f01db, 0x1f1f01c2, 0x1f1f01a9, 0x1f1f0190,
74 0x1f1f0190, 0x1f1f0177, 0x1f1f015e, 0x1f1f015e,
75 0x1f1f0145, 0x1f1f0145, 0x1f1f012c, 0x1f1f012c,
76 0x1f1f012c, 0x1f1f0113, 0x1f1f0113, 0x1f1f0113,
77};
78
79static uint32_t axi_clkgen_lookup_lock(unsigned int m)
80{
81 if (m < ARRAY_SIZE(axi_clkgen_lock_table))
82 return axi_clkgen_lock_table[m];
83 return 0x1f1f00fa;
84}
85
86static const unsigned int fpfd_min = 10000;
87static const unsigned int fpfd_max = 300000;
88static const unsigned int fvco_min = 600000;
89static const unsigned int fvco_max = 1200000;
90
91static void axi_clkgen_calc_params(unsigned long fin, unsigned long fout,
92 unsigned int *best_d, unsigned int *best_m, unsigned int *best_dout)
93{
94 unsigned long d, d_min, d_max, _d_min, _d_max;
95 unsigned long m, m_min, m_max;
96 unsigned long f, dout, best_f, fvco;
97
98 fin /= 1000;
99 fout /= 1000;
100
101 best_f = ULONG_MAX;
102 *best_d = 0;
103 *best_m = 0;
104 *best_dout = 0;
105
106 d_min = max_t(unsigned long, DIV_ROUND_UP(fin, fpfd_max), 1);
107 d_max = min_t(unsigned long, fin / fpfd_min, 80);
108
109 m_min = max_t(unsigned long, DIV_ROUND_UP(fvco_min, fin) * d_min, 1);
110 m_max = min_t(unsigned long, fvco_max * d_max / fin, 64);
111
112 for (m = m_min; m <= m_max; m++) {
113 _d_min = max(d_min, DIV_ROUND_UP(fin * m, fvco_max));
114 _d_max = min(d_max, fin * m / fvco_min);
115
116 for (d = _d_min; d <= _d_max; d++) {
117 fvco = fin * m / d;
118
119 dout = DIV_ROUND_CLOSEST(fvco, fout);
120 dout = clamp_t(unsigned long, dout, 1, 128);
121 f = fvco / dout;
122 if (abs(f - fout) < abs(best_f - fout)) {
123 best_f = f;
124 *best_d = d;
125 *best_m = m;
126 *best_dout = dout;
127 if (best_f == fout)
128 return;
129 }
130 }
131 }
132}
133
134static void axi_clkgen_calc_clk_params(unsigned int divider, unsigned int *low,
135 unsigned int *high, unsigned int *edge, unsigned int *nocount)
136{
137 if (divider == 1)
138 *nocount = 1;
139 else
140 *nocount = 0;
141
142 *high = divider / 2;
143 *edge = divider % 2;
144 *low = divider - *high;
145}
146
147static void axi_clkgen_write(struct axi_clkgen *axi_clkgen,
148 unsigned int reg, unsigned int val)
149{
150 writel(val, axi_clkgen->base + reg);
151}
152
153static void axi_clkgen_read(struct axi_clkgen *axi_clkgen,
154 unsigned int reg, unsigned int *val)
155{
156 *val = readl(axi_clkgen->base + reg);
157}
158
159static struct axi_clkgen *clk_hw_to_axi_clkgen(struct clk_hw *clk_hw)
160{
161 return container_of(clk_hw, struct axi_clkgen, clk_hw);
162}
163
164static int axi_clkgen_set_rate(struct clk_hw *clk_hw,
165 unsigned long rate, unsigned long parent_rate)
166{
167 struct axi_clkgen *axi_clkgen = clk_hw_to_axi_clkgen(clk_hw);
168 unsigned int d, m, dout;
169 unsigned int nocount;
170 unsigned int high;
171 unsigned int edge;
172 unsigned int low;
173 uint32_t filter;
174 uint32_t lock;
175
176 if (parent_rate == 0 || rate == 0)
177 return -EINVAL;
178
179 axi_clkgen_calc_params(parent_rate, rate, &d, &m, &dout);
180
181 if (d == 0 || dout == 0 || m == 0)
182 return -EINVAL;
183
184 filter = axi_clkgen_lookup_filter(m - 1);
185 lock = axi_clkgen_lookup_lock(m - 1);
186
187 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_UPDATE_ENABLE, 0);
188
189 axi_clkgen_calc_clk_params(dout, &low, &high, &edge, &nocount);
190 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_CLK_OUT1,
191 (high << 6) | low);
192 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_CLK_OUT2,
193 (edge << 7) | (nocount << 6));
194
195 axi_clkgen_calc_clk_params(d, &low, &high, &edge, &nocount);
196 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_CLK_DIV,
197 (edge << 13) | (nocount << 12) | (high << 6) | low);
198
199 axi_clkgen_calc_clk_params(m, &low, &high, &edge, &nocount);
200 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_CLK_FB1,
201 (high << 6) | low);
202 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_CLK_FB2,
203 (edge << 7) | (nocount << 6));
204
205 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_LOCK1, lock & 0x3ff);
206 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_LOCK2,
207 (((lock >> 16) & 0x1f) << 10) | 0x1);
208 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_LOCK3,
209 (((lock >> 24) & 0x1f) << 10) | 0x3e9);
210 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_FILTER1, filter >> 16);
211 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_FILTER2, filter);
212
213 axi_clkgen_write(axi_clkgen, AXI_CLKGEN_REG_UPDATE_ENABLE, 1);
214
215 return 0;
216}
217
218static long axi_clkgen_round_rate(struct clk_hw *hw, unsigned long rate,
219 unsigned long *parent_rate)
220{
221 unsigned int d, m, dout;
222
223 axi_clkgen_calc_params(*parent_rate, rate, &d, &m, &dout);
224
225 if (d == 0 || dout == 0 || m == 0)
226 return -EINVAL;
227
228 return *parent_rate / d * m / dout;
229}
230
231static unsigned long axi_clkgen_recalc_rate(struct clk_hw *clk_hw,
232 unsigned long parent_rate)
233{
234 struct axi_clkgen *axi_clkgen = clk_hw_to_axi_clkgen(clk_hw);
235 unsigned int d, m, dout;
236 unsigned int reg;
237 unsigned long long tmp;
238
239 axi_clkgen_read(axi_clkgen, AXI_CLKGEN_REG_CLK_OUT1, &reg);
240 dout = (reg & 0x3f) + ((reg >> 6) & 0x3f);
241 axi_clkgen_read(axi_clkgen, AXI_CLKGEN_REG_CLK_DIV, &reg);
242 d = (reg & 0x3f) + ((reg >> 6) & 0x3f);
243 axi_clkgen_read(axi_clkgen, AXI_CLKGEN_REG_CLK_FB1, &reg);
244 m = (reg & 0x3f) + ((reg >> 6) & 0x3f);
245
246 if (d == 0 || dout == 0)
247 return 0;
248
249 tmp = (unsigned long long)(parent_rate / d) * m;
250 do_div(tmp, dout);
251
252 if (tmp > ULONG_MAX)
253 return ULONG_MAX;
254
255 return tmp;
256}
257
258static const struct clk_ops axi_clkgen_ops = {
259 .recalc_rate = axi_clkgen_recalc_rate,
260 .round_rate = axi_clkgen_round_rate,
261 .set_rate = axi_clkgen_set_rate,
262};
263
264static int axi_clkgen_probe(struct platform_device *pdev)
265{
266 struct axi_clkgen *axi_clkgen;
267 struct clk_init_data init;
268 const char *parent_name;
269 const char *clk_name;
270 struct resource *mem;
271 struct clk *clk;
272
273 axi_clkgen = devm_kzalloc(&pdev->dev, sizeof(*axi_clkgen), GFP_KERNEL);
274 if (!axi_clkgen)
275 return -ENOMEM;
276
277 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
278 axi_clkgen->base = devm_ioremap_resource(&pdev->dev, mem);
279 if (IS_ERR(axi_clkgen->base))
280 return PTR_ERR(axi_clkgen->base);
281
282 parent_name = of_clk_get_parent_name(pdev->dev.of_node, 0);
283 if (!parent_name)
284 return -EINVAL;
285
286 clk_name = pdev->dev.of_node->name;
287 of_property_read_string(pdev->dev.of_node, "clock-output-names",
288 &clk_name);
289
290 init.name = clk_name;
291 init.ops = &axi_clkgen_ops;
292 init.flags = 0;
293 init.parent_names = &parent_name;
294 init.num_parents = 1;
295
296 axi_clkgen->clk_hw.init = &init;
297 clk = devm_clk_register(&pdev->dev, &axi_clkgen->clk_hw);
298 if (IS_ERR(clk))
299 return PTR_ERR(clk);
300
301 return of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get,
302 clk);
303}
304
305static int axi_clkgen_remove(struct platform_device *pdev)
306{
307 of_clk_del_provider(pdev->dev.of_node);
308
309 return 0;
310}
311
312static const struct of_device_id axi_clkgen_ids[] = {
313 { .compatible = "adi,axi-clkgen-1.00.a" },
314 { },
315};
316MODULE_DEVICE_TABLE(of, axi_clkgen_ids);
317
318static struct platform_driver axi_clkgen_driver = {
319 .driver = {
320 .name = "adi-axi-clkgen",
321 .owner = THIS_MODULE,
322 .of_match_table = axi_clkgen_ids,
323 },
324 .probe = axi_clkgen_probe,
325 .remove = axi_clkgen_remove,
326};
327module_platform_driver(axi_clkgen_driver);
328
329MODULE_LICENSE("GPL v2");
330MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
331MODULE_DESCRIPTION("Driver for the Analog Devices' AXI clkgen pcore clock generator");
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
new file mode 100644
index 000000000000..097dee4fd209
--- /dev/null
+++ b/drivers/clk/clk-composite.c
@@ -0,0 +1,201 @@
1/*
2 * Copyright (c) 2013 NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <linux/clk.h>
18#include <linux/clk-provider.h>
19#include <linux/err.h>
20#include <linux/slab.h>
21
22#define to_clk_composite(_hw) container_of(_hw, struct clk_composite, hw)
23
24static u8 clk_composite_get_parent(struct clk_hw *hw)
25{
26 struct clk_composite *composite = to_clk_composite(hw);
27 const struct clk_ops *mux_ops = composite->mux_ops;
28 struct clk_hw *mux_hw = composite->mux_hw;
29
30 mux_hw->clk = hw->clk;
31
32 return mux_ops->get_parent(mux_hw);
33}
34
35static int clk_composite_set_parent(struct clk_hw *hw, u8 index)
36{
37 struct clk_composite *composite = to_clk_composite(hw);
38 const struct clk_ops *mux_ops = composite->mux_ops;
39 struct clk_hw *mux_hw = composite->mux_hw;
40
41 mux_hw->clk = hw->clk;
42
43 return mux_ops->set_parent(mux_hw, index);
44}
45
46static unsigned long clk_composite_recalc_rate(struct clk_hw *hw,
47 unsigned long parent_rate)
48{
49 struct clk_composite *composite = to_clk_composite(hw);
50 const struct clk_ops *div_ops = composite->div_ops;
51 struct clk_hw *div_hw = composite->div_hw;
52
53 div_hw->clk = hw->clk;
54
55 return div_ops->recalc_rate(div_hw, parent_rate);
56}
57
58static long clk_composite_round_rate(struct clk_hw *hw, unsigned long rate,
59 unsigned long *prate)
60{
61 struct clk_composite *composite = to_clk_composite(hw);
62 const struct clk_ops *div_ops = composite->div_ops;
63 struct clk_hw *div_hw = composite->div_hw;
64
65 div_hw->clk = hw->clk;
66
67 return div_ops->round_rate(div_hw, rate, prate);
68}
69
70static int clk_composite_set_rate(struct clk_hw *hw, unsigned long rate,
71 unsigned long parent_rate)
72{
73 struct clk_composite *composite = to_clk_composite(hw);
74 const struct clk_ops *div_ops = composite->div_ops;
75 struct clk_hw *div_hw = composite->div_hw;
76
77 div_hw->clk = hw->clk;
78
79 return div_ops->set_rate(div_hw, rate, parent_rate);
80}
81
82static int clk_composite_is_enabled(struct clk_hw *hw)
83{
84 struct clk_composite *composite = to_clk_composite(hw);
85 const struct clk_ops *gate_ops = composite->gate_ops;
86 struct clk_hw *gate_hw = composite->gate_hw;
87
88 gate_hw->clk = hw->clk;
89
90 return gate_ops->is_enabled(gate_hw);
91}
92
93static int clk_composite_enable(struct clk_hw *hw)
94{
95 struct clk_composite *composite = to_clk_composite(hw);
96 const struct clk_ops *gate_ops = composite->gate_ops;
97 struct clk_hw *gate_hw = composite->gate_hw;
98
99 gate_hw->clk = hw->clk;
100
101 return gate_ops->enable(gate_hw);
102}
103
104static void clk_composite_disable(struct clk_hw *hw)
105{
106 struct clk_composite *composite = to_clk_composite(hw);
107 const struct clk_ops *gate_ops = composite->gate_ops;
108 struct clk_hw *gate_hw = composite->gate_hw;
109
110 gate_hw->clk = hw->clk;
111
112 gate_ops->disable(gate_hw);
113}
114
115struct clk *clk_register_composite(struct device *dev, const char *name,
116 const char **parent_names, int num_parents,
117 struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
118 struct clk_hw *div_hw, const struct clk_ops *div_ops,
119 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
120 unsigned long flags)
121{
122 struct clk *clk;
123 struct clk_init_data init;
124 struct clk_composite *composite;
125 struct clk_ops *clk_composite_ops;
126
127 composite = kzalloc(sizeof(*composite), GFP_KERNEL);
128 if (!composite) {
129 pr_err("%s: could not allocate composite clk\n", __func__);
130 return ERR_PTR(-ENOMEM);
131 }
132
133 init.name = name;
134 init.flags = flags | CLK_IS_BASIC;
135 init.parent_names = parent_names;
136 init.num_parents = num_parents;
137
138 clk_composite_ops = &composite->ops;
139
140 if (mux_hw && mux_ops) {
141 if (!mux_ops->get_parent || !mux_ops->set_parent) {
142 clk = ERR_PTR(-EINVAL);
143 goto err;
144 }
145
146 composite->mux_hw = mux_hw;
147 composite->mux_ops = mux_ops;
148 clk_composite_ops->get_parent = clk_composite_get_parent;
149 clk_composite_ops->set_parent = clk_composite_set_parent;
150 }
151
152 if (div_hw && div_ops) {
153 if (!div_ops->recalc_rate || !div_ops->round_rate ||
154 !div_ops->set_rate) {
155 clk = ERR_PTR(-EINVAL);
156 goto err;
157 }
158
159 composite->div_hw = div_hw;
160 composite->div_ops = div_ops;
161 clk_composite_ops->recalc_rate = clk_composite_recalc_rate;
162 clk_composite_ops->round_rate = clk_composite_round_rate;
163 clk_composite_ops->set_rate = clk_composite_set_rate;
164 }
165
166 if (gate_hw && gate_ops) {
167 if (!gate_ops->is_enabled || !gate_ops->enable ||
168 !gate_ops->disable) {
169 clk = ERR_PTR(-EINVAL);
170 goto err;
171 }
172
173 composite->gate_hw = gate_hw;
174 composite->gate_ops = gate_ops;
175 clk_composite_ops->is_enabled = clk_composite_is_enabled;
176 clk_composite_ops->enable = clk_composite_enable;
177 clk_composite_ops->disable = clk_composite_disable;
178 }
179
180 init.ops = clk_composite_ops;
181 composite->hw.init = &init;
182
183 clk = clk_register(dev, &composite->hw);
184 if (IS_ERR(clk))
185 goto err;
186
187 if (composite->mux_hw)
188 composite->mux_hw->clk = clk;
189
190 if (composite->div_hw)
191 composite->div_hw->clk = clk;
192
193 if (composite->gate_hw)
194 composite->gate_hw->clk = clk;
195
196 return clk;
197
198err:
199 kfree(composite);
200 return clk;
201}
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 508c032edce4..25b1734560d0 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -32,6 +32,7 @@
32static u8 clk_mux_get_parent(struct clk_hw *hw) 32static u8 clk_mux_get_parent(struct clk_hw *hw)
33{ 33{
34 struct clk_mux *mux = to_clk_mux(hw); 34 struct clk_mux *mux = to_clk_mux(hw);
35 int num_parents = __clk_get_num_parents(hw->clk);
35 u32 val; 36 u32 val;
36 37
37 /* 38 /*
@@ -42,7 +43,16 @@ static u8 clk_mux_get_parent(struct clk_hw *hw)
42 * val = 0x4 really means "bit 2, index starts at bit 0" 43 * val = 0x4 really means "bit 2, index starts at bit 0"
43 */ 44 */
44 val = readl(mux->reg) >> mux->shift; 45 val = readl(mux->reg) >> mux->shift;
45 val &= (1 << mux->width) - 1; 46 val &= mux->mask;
47
48 if (mux->table) {
49 int i;
50
51 for (i = 0; i < num_parents; i++)
52 if (mux->table[i] == val)
53 return i;
54 return -EINVAL;
55 }
46 56
47 if (val && (mux->flags & CLK_MUX_INDEX_BIT)) 57 if (val && (mux->flags & CLK_MUX_INDEX_BIT))
48 val = ffs(val) - 1; 58 val = ffs(val) - 1;
@@ -50,7 +60,7 @@ static u8 clk_mux_get_parent(struct clk_hw *hw)
50 if (val && (mux->flags & CLK_MUX_INDEX_ONE)) 60 if (val && (mux->flags & CLK_MUX_INDEX_ONE))
51 val--; 61 val--;
52 62
53 if (val >= __clk_get_num_parents(hw->clk)) 63 if (val >= num_parents)
54 return -EINVAL; 64 return -EINVAL;
55 65
56 return val; 66 return val;
@@ -62,17 +72,22 @@ static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
62 u32 val; 72 u32 val;
63 unsigned long flags = 0; 73 unsigned long flags = 0;
64 74
65 if (mux->flags & CLK_MUX_INDEX_BIT) 75 if (mux->table)
66 index = (1 << ffs(index)); 76 index = mux->table[index];
67 77
68 if (mux->flags & CLK_MUX_INDEX_ONE) 78 else {
69 index++; 79 if (mux->flags & CLK_MUX_INDEX_BIT)
80 index = (1 << ffs(index));
81
82 if (mux->flags & CLK_MUX_INDEX_ONE)
83 index++;
84 }
70 85
71 if (mux->lock) 86 if (mux->lock)
72 spin_lock_irqsave(mux->lock, flags); 87 spin_lock_irqsave(mux->lock, flags);
73 88
74 val = readl(mux->reg); 89 val = readl(mux->reg);
75 val &= ~(((1 << mux->width) - 1) << mux->shift); 90 val &= ~(mux->mask << mux->shift);
76 val |= index << mux->shift; 91 val |= index << mux->shift;
77 writel(val, mux->reg); 92 writel(val, mux->reg);
78 93
@@ -88,10 +103,10 @@ const struct clk_ops clk_mux_ops = {
88}; 103};
89EXPORT_SYMBOL_GPL(clk_mux_ops); 104EXPORT_SYMBOL_GPL(clk_mux_ops);
90 105
91struct clk *clk_register_mux(struct device *dev, const char *name, 106struct clk *clk_register_mux_table(struct device *dev, const char *name,
92 const char **parent_names, u8 num_parents, unsigned long flags, 107 const char **parent_names, u8 num_parents, unsigned long flags,
93 void __iomem *reg, u8 shift, u8 width, 108 void __iomem *reg, u8 shift, u32 mask,
94 u8 clk_mux_flags, spinlock_t *lock) 109 u8 clk_mux_flags, u32 *table, spinlock_t *lock)
95{ 110{
96 struct clk_mux *mux; 111 struct clk_mux *mux;
97 struct clk *clk; 112 struct clk *clk;
@@ -113,9 +128,10 @@ struct clk *clk_register_mux(struct device *dev, const char *name,
113 /* struct clk_mux assignments */ 128 /* struct clk_mux assignments */
114 mux->reg = reg; 129 mux->reg = reg;
115 mux->shift = shift; 130 mux->shift = shift;
116 mux->width = width; 131 mux->mask = mask;
117 mux->flags = clk_mux_flags; 132 mux->flags = clk_mux_flags;
118 mux->lock = lock; 133 mux->lock = lock;
134 mux->table = table;
119 mux->hw.init = &init; 135 mux->hw.init = &init;
120 136
121 clk = clk_register(dev, &mux->hw); 137 clk = clk_register(dev, &mux->hw);
@@ -125,3 +141,15 @@ struct clk *clk_register_mux(struct device *dev, const char *name,
125 141
126 return clk; 142 return clk;
127} 143}
144
145struct clk *clk_register_mux(struct device *dev, const char *name,
146 const char **parent_names, u8 num_parents, unsigned long flags,
147 void __iomem *reg, u8 shift, u8 width,
148 u8 clk_mux_flags, spinlock_t *lock)
149{
150 u32 mask = BIT(width) - 1;
151
152 return clk_register_mux_table(dev, name, parent_names, num_parents,
153 flags, reg, shift, mask, clk_mux_flags,
154 NULL, lock);
155}
diff --git a/drivers/clk/clk-prima2.c b/drivers/clk/clk-prima2.c
index f8e9d0c27be2..643ca653fef0 100644
--- a/drivers/clk/clk-prima2.c
+++ b/drivers/clk/clk-prima2.c
@@ -1113,7 +1113,7 @@ void __init sirfsoc_of_clk_init(void)
1113 1113
1114 for (i = pll1; i < maxclk; i++) { 1114 for (i = pll1; i < maxclk; i++) {
1115 prima2_clks[i] = clk_register(NULL, prima2_clk_hw_array[i]); 1115 prima2_clks[i] = clk_register(NULL, prima2_clk_hw_array[i]);
1116 BUG_ON(!prima2_clks[i]); 1116 BUG_ON(IS_ERR(prima2_clks[i]));
1117 } 1117 }
1118 clk_register_clkdev(prima2_clks[cpu], NULL, "cpu"); 1118 clk_register_clkdev(prima2_clks[cpu], NULL, "cpu");
1119 clk_register_clkdev(prima2_clks[io], NULL, "io"); 1119 clk_register_clkdev(prima2_clks[io], NULL, "io");
diff --git a/drivers/clk/clk-zynq.c b/drivers/clk/clk-zynq.c
index b14a25f39255..32062977f453 100644
--- a/drivers/clk/clk-zynq.c
+++ b/drivers/clk/clk-zynq.c
@@ -20,6 +20,7 @@
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/clk-provider.h> 22#include <linux/clk-provider.h>
23#include <linux/clk/zynq.h>
23 24
24static void __iomem *slcr_base; 25static void __iomem *slcr_base;
25 26
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ed87b2405806..0230c9d95975 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -19,14 +19,77 @@
19#include <linux/of.h> 19#include <linux/of.h>
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/sched.h>
22 23
23static DEFINE_SPINLOCK(enable_lock); 24static DEFINE_SPINLOCK(enable_lock);
24static DEFINE_MUTEX(prepare_lock); 25static DEFINE_MUTEX(prepare_lock);
25 26
27static struct task_struct *prepare_owner;
28static struct task_struct *enable_owner;
29
30static int prepare_refcnt;
31static int enable_refcnt;
32
26static HLIST_HEAD(clk_root_list); 33static HLIST_HEAD(clk_root_list);
27static HLIST_HEAD(clk_orphan_list); 34static HLIST_HEAD(clk_orphan_list);
28static LIST_HEAD(clk_notifier_list); 35static LIST_HEAD(clk_notifier_list);
29 36
37/*** locking ***/
38static void clk_prepare_lock(void)
39{
40 if (!mutex_trylock(&prepare_lock)) {
41 if (prepare_owner == current) {
42 prepare_refcnt++;
43 return;
44 }
45 mutex_lock(&prepare_lock);
46 }
47 WARN_ON_ONCE(prepare_owner != NULL);
48 WARN_ON_ONCE(prepare_refcnt != 0);
49 prepare_owner = current;
50 prepare_refcnt = 1;
51}
52
53static void clk_prepare_unlock(void)
54{
55 WARN_ON_ONCE(prepare_owner != current);
56 WARN_ON_ONCE(prepare_refcnt == 0);
57
58 if (--prepare_refcnt)
59 return;
60 prepare_owner = NULL;
61 mutex_unlock(&prepare_lock);
62}
63
64static unsigned long clk_enable_lock(void)
65{
66 unsigned long flags;
67
68 if (!spin_trylock_irqsave(&enable_lock, flags)) {
69 if (enable_owner == current) {
70 enable_refcnt++;
71 return flags;
72 }
73 spin_lock_irqsave(&enable_lock, flags);
74 }
75 WARN_ON_ONCE(enable_owner != NULL);
76 WARN_ON_ONCE(enable_refcnt != 0);
77 enable_owner = current;
78 enable_refcnt = 1;
79 return flags;
80}
81
82static void clk_enable_unlock(unsigned long flags)
83{
84 WARN_ON_ONCE(enable_owner != current);
85 WARN_ON_ONCE(enable_refcnt == 0);
86
87 if (--enable_refcnt)
88 return;
89 enable_owner = NULL;
90 spin_unlock_irqrestore(&enable_lock, flags);
91}
92
30/*** debugfs support ***/ 93/*** debugfs support ***/
31 94
32#ifdef CONFIG_COMMON_CLK_DEBUG 95#ifdef CONFIG_COMMON_CLK_DEBUG
@@ -69,7 +132,7 @@ static int clk_summary_show(struct seq_file *s, void *data)
69 seq_printf(s, " clock enable_cnt prepare_cnt rate\n"); 132 seq_printf(s, " clock enable_cnt prepare_cnt rate\n");
70 seq_printf(s, "---------------------------------------------------------------------\n"); 133 seq_printf(s, "---------------------------------------------------------------------\n");
71 134
72 mutex_lock(&prepare_lock); 135 clk_prepare_lock();
73 136
74 hlist_for_each_entry(c, &clk_root_list, child_node) 137 hlist_for_each_entry(c, &clk_root_list, child_node)
75 clk_summary_show_subtree(s, c, 0); 138 clk_summary_show_subtree(s, c, 0);
@@ -77,7 +140,7 @@ static int clk_summary_show(struct seq_file *s, void *data)
77 hlist_for_each_entry(c, &clk_orphan_list, child_node) 140 hlist_for_each_entry(c, &clk_orphan_list, child_node)
78 clk_summary_show_subtree(s, c, 0); 141 clk_summary_show_subtree(s, c, 0);
79 142
80 mutex_unlock(&prepare_lock); 143 clk_prepare_unlock();
81 144
82 return 0; 145 return 0;
83} 146}
@@ -130,7 +193,7 @@ static int clk_dump(struct seq_file *s, void *data)
130 193
131 seq_printf(s, "{"); 194 seq_printf(s, "{");
132 195
133 mutex_lock(&prepare_lock); 196 clk_prepare_lock();
134 197
135 hlist_for_each_entry(c, &clk_root_list, child_node) { 198 hlist_for_each_entry(c, &clk_root_list, child_node) {
136 if (!first_node) 199 if (!first_node)
@@ -144,7 +207,7 @@ static int clk_dump(struct seq_file *s, void *data)
144 clk_dump_subtree(s, c, 0); 207 clk_dump_subtree(s, c, 0);
145 } 208 }
146 209
147 mutex_unlock(&prepare_lock); 210 clk_prepare_unlock();
148 211
149 seq_printf(s, "}"); 212 seq_printf(s, "}");
150 return 0; 213 return 0;
@@ -316,7 +379,7 @@ static int __init clk_debug_init(void)
316 if (!orphandir) 379 if (!orphandir)
317 return -ENOMEM; 380 return -ENOMEM;
318 381
319 mutex_lock(&prepare_lock); 382 clk_prepare_lock();
320 383
321 hlist_for_each_entry(clk, &clk_root_list, child_node) 384 hlist_for_each_entry(clk, &clk_root_list, child_node)
322 clk_debug_create_subtree(clk, rootdir); 385 clk_debug_create_subtree(clk, rootdir);
@@ -326,7 +389,7 @@ static int __init clk_debug_init(void)
326 389
327 inited = 1; 390 inited = 1;
328 391
329 mutex_unlock(&prepare_lock); 392 clk_prepare_unlock();
330 393
331 return 0; 394 return 0;
332} 395}
@@ -336,6 +399,31 @@ static inline int clk_debug_register(struct clk *clk) { return 0; }
336#endif 399#endif
337 400
338/* caller must hold prepare_lock */ 401/* caller must hold prepare_lock */
402static void clk_unprepare_unused_subtree(struct clk *clk)
403{
404 struct clk *child;
405
406 if (!clk)
407 return;
408
409 hlist_for_each_entry(child, &clk->children, child_node)
410 clk_unprepare_unused_subtree(child);
411
412 if (clk->prepare_count)
413 return;
414
415 if (clk->flags & CLK_IGNORE_UNUSED)
416 return;
417
418 if (__clk_is_prepared(clk)) {
419 if (clk->ops->unprepare_unused)
420 clk->ops->unprepare_unused(clk->hw);
421 else if (clk->ops->unprepare)
422 clk->ops->unprepare(clk->hw);
423 }
424}
425
426/* caller must hold prepare_lock */
339static void clk_disable_unused_subtree(struct clk *clk) 427static void clk_disable_unused_subtree(struct clk *clk)
340{ 428{
341 struct clk *child; 429 struct clk *child;
@@ -347,7 +435,7 @@ static void clk_disable_unused_subtree(struct clk *clk)
347 hlist_for_each_entry(child, &clk->children, child_node) 435 hlist_for_each_entry(child, &clk->children, child_node)
348 clk_disable_unused_subtree(child); 436 clk_disable_unused_subtree(child);
349 437
350 spin_lock_irqsave(&enable_lock, flags); 438 flags = clk_enable_lock();
351 439
352 if (clk->enable_count) 440 if (clk->enable_count)
353 goto unlock_out; 441 goto unlock_out;
@@ -368,7 +456,7 @@ static void clk_disable_unused_subtree(struct clk *clk)
368 } 456 }
369 457
370unlock_out: 458unlock_out:
371 spin_unlock_irqrestore(&enable_lock, flags); 459 clk_enable_unlock(flags);
372 460
373out: 461out:
374 return; 462 return;
@@ -378,7 +466,7 @@ static int clk_disable_unused(void)
378{ 466{
379 struct clk *clk; 467 struct clk *clk;
380 468
381 mutex_lock(&prepare_lock); 469 clk_prepare_lock();
382 470
383 hlist_for_each_entry(clk, &clk_root_list, child_node) 471 hlist_for_each_entry(clk, &clk_root_list, child_node)
384 clk_disable_unused_subtree(clk); 472 clk_disable_unused_subtree(clk);
@@ -386,7 +474,13 @@ static int clk_disable_unused(void)
386 hlist_for_each_entry(clk, &clk_orphan_list, child_node) 474 hlist_for_each_entry(clk, &clk_orphan_list, child_node)
387 clk_disable_unused_subtree(clk); 475 clk_disable_unused_subtree(clk);
388 476
389 mutex_unlock(&prepare_lock); 477 hlist_for_each_entry(clk, &clk_root_list, child_node)
478 clk_unprepare_unused_subtree(clk);
479
480 hlist_for_each_entry(clk, &clk_orphan_list, child_node)
481 clk_unprepare_unused_subtree(clk);
482
483 clk_prepare_unlock();
390 484
391 return 0; 485 return 0;
392} 486}
@@ -451,6 +545,27 @@ unsigned long __clk_get_flags(struct clk *clk)
451 return !clk ? 0 : clk->flags; 545 return !clk ? 0 : clk->flags;
452} 546}
453 547
548bool __clk_is_prepared(struct clk *clk)
549{
550 int ret;
551
552 if (!clk)
553 return false;
554
555 /*
556 * .is_prepared is optional for clocks that can prepare
557 * fall back to software usage counter if it is missing
558 */
559 if (!clk->ops->is_prepared) {
560 ret = clk->prepare_count ? 1 : 0;
561 goto out;
562 }
563
564 ret = clk->ops->is_prepared(clk->hw);
565out:
566 return !!ret;
567}
568
454bool __clk_is_enabled(struct clk *clk) 569bool __clk_is_enabled(struct clk *clk)
455{ 570{
456 int ret; 571 int ret;
@@ -548,9 +663,9 @@ void __clk_unprepare(struct clk *clk)
548 */ 663 */
549void clk_unprepare(struct clk *clk) 664void clk_unprepare(struct clk *clk)
550{ 665{
551 mutex_lock(&prepare_lock); 666 clk_prepare_lock();
552 __clk_unprepare(clk); 667 __clk_unprepare(clk);
553 mutex_unlock(&prepare_lock); 668 clk_prepare_unlock();
554} 669}
555EXPORT_SYMBOL_GPL(clk_unprepare); 670EXPORT_SYMBOL_GPL(clk_unprepare);
556 671
@@ -596,9 +711,9 @@ int clk_prepare(struct clk *clk)
596{ 711{
597 int ret; 712 int ret;
598 713
599 mutex_lock(&prepare_lock); 714 clk_prepare_lock();
600 ret = __clk_prepare(clk); 715 ret = __clk_prepare(clk);
601 mutex_unlock(&prepare_lock); 716 clk_prepare_unlock();
602 717
603 return ret; 718 return ret;
604} 719}
@@ -640,9 +755,9 @@ void clk_disable(struct clk *clk)
640{ 755{
641 unsigned long flags; 756 unsigned long flags;
642 757
643 spin_lock_irqsave(&enable_lock, flags); 758 flags = clk_enable_lock();
644 __clk_disable(clk); 759 __clk_disable(clk);
645 spin_unlock_irqrestore(&enable_lock, flags); 760 clk_enable_unlock(flags);
646} 761}
647EXPORT_SYMBOL_GPL(clk_disable); 762EXPORT_SYMBOL_GPL(clk_disable);
648 763
@@ -693,9 +808,9 @@ int clk_enable(struct clk *clk)
693 unsigned long flags; 808 unsigned long flags;
694 int ret; 809 int ret;
695 810
696 spin_lock_irqsave(&enable_lock, flags); 811 flags = clk_enable_lock();
697 ret = __clk_enable(clk); 812 ret = __clk_enable(clk);
698 spin_unlock_irqrestore(&enable_lock, flags); 813 clk_enable_unlock(flags);
699 814
700 return ret; 815 return ret;
701} 816}
@@ -740,9 +855,9 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
740{ 855{
741 unsigned long ret; 856 unsigned long ret;
742 857
743 mutex_lock(&prepare_lock); 858 clk_prepare_lock();
744 ret = __clk_round_rate(clk, rate); 859 ret = __clk_round_rate(clk, rate);
745 mutex_unlock(&prepare_lock); 860 clk_prepare_unlock();
746 861
747 return ret; 862 return ret;
748} 863}
@@ -837,13 +952,13 @@ unsigned long clk_get_rate(struct clk *clk)
837{ 952{
838 unsigned long rate; 953 unsigned long rate;
839 954
840 mutex_lock(&prepare_lock); 955 clk_prepare_lock();
841 956
842 if (clk && (clk->flags & CLK_GET_RATE_NOCACHE)) 957 if (clk && (clk->flags & CLK_GET_RATE_NOCACHE))
843 __clk_recalc_rates(clk, 0); 958 __clk_recalc_rates(clk, 0);
844 959
845 rate = __clk_get_rate(clk); 960 rate = __clk_get_rate(clk);
846 mutex_unlock(&prepare_lock); 961 clk_prepare_unlock();
847 962
848 return rate; 963 return rate;
849} 964}
@@ -974,7 +1089,7 @@ static struct clk *clk_propagate_rate_change(struct clk *clk, unsigned long even
974 int ret = NOTIFY_DONE; 1089 int ret = NOTIFY_DONE;
975 1090
976 if (clk->rate == clk->new_rate) 1091 if (clk->rate == clk->new_rate)
977 return 0; 1092 return NULL;
978 1093
979 if (clk->notifier_count) { 1094 if (clk->notifier_count) {
980 ret = __clk_notify(clk, event, clk->rate, clk->new_rate); 1095 ret = __clk_notify(clk, event, clk->rate, clk->new_rate);
@@ -1048,7 +1163,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
1048 int ret = 0; 1163 int ret = 0;
1049 1164
1050 /* prevent racing with updates to the clock topology */ 1165 /* prevent racing with updates to the clock topology */
1051 mutex_lock(&prepare_lock); 1166 clk_prepare_lock();
1052 1167
1053 /* bail early if nothing to do */ 1168 /* bail early if nothing to do */
1054 if (rate == clk->rate) 1169 if (rate == clk->rate)
@@ -1080,7 +1195,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
1080 clk_change_rate(top); 1195 clk_change_rate(top);
1081 1196
1082out: 1197out:
1083 mutex_unlock(&prepare_lock); 1198 clk_prepare_unlock();
1084 1199
1085 return ret; 1200 return ret;
1086} 1201}
@@ -1096,9 +1211,9 @@ struct clk *clk_get_parent(struct clk *clk)
1096{ 1211{
1097 struct clk *parent; 1212 struct clk *parent;
1098 1213
1099 mutex_lock(&prepare_lock); 1214 clk_prepare_lock();
1100 parent = __clk_get_parent(clk); 1215 parent = __clk_get_parent(clk);
1101 mutex_unlock(&prepare_lock); 1216 clk_prepare_unlock();
1102 1217
1103 return parent; 1218 return parent;
1104} 1219}
@@ -1242,19 +1357,19 @@ static int __clk_set_parent(struct clk *clk, struct clk *parent)
1242 __clk_prepare(parent); 1357 __clk_prepare(parent);
1243 1358
1244 /* FIXME replace with clk_is_enabled(clk) someday */ 1359 /* FIXME replace with clk_is_enabled(clk) someday */
1245 spin_lock_irqsave(&enable_lock, flags); 1360 flags = clk_enable_lock();
1246 if (clk->enable_count) 1361 if (clk->enable_count)
1247 __clk_enable(parent); 1362 __clk_enable(parent);
1248 spin_unlock_irqrestore(&enable_lock, flags); 1363 clk_enable_unlock(flags);
1249 1364
1250 /* change clock input source */ 1365 /* change clock input source */
1251 ret = clk->ops->set_parent(clk->hw, i); 1366 ret = clk->ops->set_parent(clk->hw, i);
1252 1367
1253 /* clean up old prepare and enable */ 1368 /* clean up old prepare and enable */
1254 spin_lock_irqsave(&enable_lock, flags); 1369 flags = clk_enable_lock();
1255 if (clk->enable_count) 1370 if (clk->enable_count)
1256 __clk_disable(old_parent); 1371 __clk_disable(old_parent);
1257 spin_unlock_irqrestore(&enable_lock, flags); 1372 clk_enable_unlock(flags);
1258 1373
1259 if (clk->prepare_count) 1374 if (clk->prepare_count)
1260 __clk_unprepare(old_parent); 1375 __clk_unprepare(old_parent);
@@ -1286,7 +1401,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
1286 return -ENOSYS; 1401 return -ENOSYS;
1287 1402
1288 /* prevent racing with updates to the clock topology */ 1403 /* prevent racing with updates to the clock topology */
1289 mutex_lock(&prepare_lock); 1404 clk_prepare_lock();
1290 1405
1291 if (clk->parent == parent) 1406 if (clk->parent == parent)
1292 goto out; 1407 goto out;
@@ -1315,7 +1430,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
1315 __clk_reparent(clk, parent); 1430 __clk_reparent(clk, parent);
1316 1431
1317out: 1432out:
1318 mutex_unlock(&prepare_lock); 1433 clk_prepare_unlock();
1319 1434
1320 return ret; 1435 return ret;
1321} 1436}
@@ -1338,7 +1453,7 @@ int __clk_init(struct device *dev, struct clk *clk)
1338 if (!clk) 1453 if (!clk)
1339 return -EINVAL; 1454 return -EINVAL;
1340 1455
1341 mutex_lock(&prepare_lock); 1456 clk_prepare_lock();
1342 1457
1343 /* check to see if a clock with this name is already registered */ 1458 /* check to see if a clock with this name is already registered */
1344 if (__clk_lookup(clk->name)) { 1459 if (__clk_lookup(clk->name)) {
@@ -1462,7 +1577,7 @@ int __clk_init(struct device *dev, struct clk *clk)
1462 clk_debug_register(clk); 1577 clk_debug_register(clk);
1463 1578
1464out: 1579out:
1465 mutex_unlock(&prepare_lock); 1580 clk_prepare_unlock();
1466 1581
1467 return ret; 1582 return ret;
1468} 1583}
@@ -1696,7 +1811,7 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb)
1696 if (!clk || !nb) 1811 if (!clk || !nb)
1697 return -EINVAL; 1812 return -EINVAL;
1698 1813
1699 mutex_lock(&prepare_lock); 1814 clk_prepare_lock();
1700 1815
1701 /* search the list of notifiers for this clk */ 1816 /* search the list of notifiers for this clk */
1702 list_for_each_entry(cn, &clk_notifier_list, node) 1817 list_for_each_entry(cn, &clk_notifier_list, node)
@@ -1720,7 +1835,7 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb)
1720 clk->notifier_count++; 1835 clk->notifier_count++;
1721 1836
1722out: 1837out:
1723 mutex_unlock(&prepare_lock); 1838 clk_prepare_unlock();
1724 1839
1725 return ret; 1840 return ret;
1726} 1841}
@@ -1745,7 +1860,7 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb)
1745 if (!clk || !nb) 1860 if (!clk || !nb)
1746 return -EINVAL; 1861 return -EINVAL;
1747 1862
1748 mutex_lock(&prepare_lock); 1863 clk_prepare_lock();
1749 1864
1750 list_for_each_entry(cn, &clk_notifier_list, node) 1865 list_for_each_entry(cn, &clk_notifier_list, node)
1751 if (cn->clk == clk) 1866 if (cn->clk == clk)
@@ -1766,7 +1881,7 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb)
1766 ret = -ENOENT; 1881 ret = -ENOENT;
1767 } 1882 }
1768 1883
1769 mutex_unlock(&prepare_lock); 1884 clk_prepare_unlock();
1770 1885
1771 return ret; 1886 return ret;
1772} 1887}
diff --git a/drivers/clk/mxs/clk-imx23.c b/drivers/clk/mxs/clk-imx23.c
index b5c06f9766f6..f6a74872f14e 100644
--- a/drivers/clk/mxs/clk-imx23.c
+++ b/drivers/clk/mxs/clk-imx23.c
@@ -15,12 +15,15 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/of.h> 17#include <linux/of.h>
18#include <mach/common.h> 18#include <linux/of_address.h>
19#include <mach/mx23.h>
20#include "clk.h" 19#include "clk.h"
21 20
22#define DIGCTRL MX23_IO_ADDRESS(MX23_DIGCTL_BASE_ADDR) 21static void __iomem *clkctrl;
23#define CLKCTRL MX23_IO_ADDRESS(MX23_CLKCTRL_BASE_ADDR) 22static void __iomem *digctrl;
23
24#define CLKCTRL clkctrl
25#define DIGCTRL digctrl
26
24#define PLLCTRL0 (CLKCTRL + 0x0000) 27#define PLLCTRL0 (CLKCTRL + 0x0000)
25#define CPU (CLKCTRL + 0x0020) 28#define CPU (CLKCTRL + 0x0020)
26#define HBUS (CLKCTRL + 0x0030) 29#define HBUS (CLKCTRL + 0x0030)
@@ -48,10 +51,10 @@ static void __init clk_misc_init(void)
48 u32 val; 51 u32 val;
49 52
50 /* Gate off cpu clock in WFI for power saving */ 53 /* Gate off cpu clock in WFI for power saving */
51 __mxs_setl(1 << BP_CPU_INTERRUPT_WAIT, CPU); 54 writel_relaxed(1 << BP_CPU_INTERRUPT_WAIT, CPU + SET);
52 55
53 /* Clear BYPASS for SAIF */ 56 /* Clear BYPASS for SAIF */
54 __mxs_clrl(1 << BP_CLKSEQ_BYPASS_SAIF, CLKSEQ); 57 writel_relaxed(1 << BP_CLKSEQ_BYPASS_SAIF, CLKSEQ + CLR);
55 58
56 /* SAIF has to use frac div for functional operation */ 59 /* SAIF has to use frac div for functional operation */
57 val = readl_relaxed(SAIF); 60 val = readl_relaxed(SAIF);
@@ -62,14 +65,14 @@ static void __init clk_misc_init(void)
62 * Source ssp clock from ref_io than ref_xtal, 65 * Source ssp clock from ref_io than ref_xtal,
63 * as ref_xtal only provides 24 MHz as maximum. 66 * as ref_xtal only provides 24 MHz as maximum.
64 */ 67 */
65 __mxs_clrl(1 << BP_CLKSEQ_BYPASS_SSP, CLKSEQ); 68 writel_relaxed(1 << BP_CLKSEQ_BYPASS_SSP, CLKSEQ + CLR);
66 69
67 /* 70 /*
68 * 480 MHz seems too high to be ssp clock source directly, 71 * 480 MHz seems too high to be ssp clock source directly,
69 * so set frac to get a 288 MHz ref_io. 72 * so set frac to get a 288 MHz ref_io.
70 */ 73 */
71 __mxs_clrl(0x3f << BP_FRAC_IOFRAC, FRAC); 74 writel_relaxed(0x3f << BP_FRAC_IOFRAC, FRAC + CLR);
72 __mxs_setl(30 << BP_FRAC_IOFRAC, FRAC); 75 writel_relaxed(30 << BP_FRAC_IOFRAC, FRAC + SET);
73} 76}
74 77
75static const char *sel_pll[] __initconst = { "pll", "ref_xtal", }; 78static const char *sel_pll[] __initconst = { "pll", "ref_xtal", };
@@ -101,6 +104,14 @@ int __init mx23_clocks_init(void)
101 struct device_node *np; 104 struct device_node *np;
102 u32 i; 105 u32 i;
103 106
107 np = of_find_compatible_node(NULL, NULL, "fsl,imx23-digctl");
108 digctrl = of_iomap(np, 0);
109 WARN_ON(!digctrl);
110
111 np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl");
112 clkctrl = of_iomap(np, 0);
113 WARN_ON(!clkctrl);
114
104 clk_misc_init(); 115 clk_misc_init();
105 116
106 clks[ref_xtal] = mxs_clk_fixed("ref_xtal", 24000000); 117 clks[ref_xtal] = mxs_clk_fixed("ref_xtal", 24000000);
@@ -153,19 +164,12 @@ int __init mx23_clocks_init(void)
153 return PTR_ERR(clks[i]); 164 return PTR_ERR(clks[i]);
154 } 165 }
155 166
156 np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl"); 167 clk_data.clks = clks;
157 if (np) { 168 clk_data.clk_num = ARRAY_SIZE(clks);
158 clk_data.clks = clks; 169 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
159 clk_data.clk_num = ARRAY_SIZE(clks);
160 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
161 }
162
163 clk_register_clkdev(clks[clk32k], NULL, "timrot");
164 170
165 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 171 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
166 clk_prepare_enable(clks[clks_init_on[i]]); 172 clk_prepare_enable(clks[clks_init_on[i]]);
167 173
168 mxs_timer_init();
169
170 return 0; 174 return 0;
171} 175}
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c
index 76ce6c6d1113..d0e5eed146de 100644
--- a/drivers/clk/mxs/clk-imx28.c
+++ b/drivers/clk/mxs/clk-imx28.c
@@ -15,11 +15,12 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/of.h> 17#include <linux/of.h>
18#include <mach/common.h> 18#include <linux/of_address.h>
19#include <mach/mx28.h>
20#include "clk.h" 19#include "clk.h"
21 20
22#define CLKCTRL MX28_IO_ADDRESS(MX28_CLKCTRL_BASE_ADDR) 21static void __iomem *clkctrl;
22#define CLKCTRL clkctrl
23
23#define PLL0CTRL0 (CLKCTRL + 0x0000) 24#define PLL0CTRL0 (CLKCTRL + 0x0000)
24#define PLL1CTRL0 (CLKCTRL + 0x0020) 25#define PLL1CTRL0 (CLKCTRL + 0x0020)
25#define PLL2CTRL0 (CLKCTRL + 0x0040) 26#define PLL2CTRL0 (CLKCTRL + 0x0040)
@@ -53,7 +54,8 @@
53#define BP_FRAC0_IO1FRAC 16 54#define BP_FRAC0_IO1FRAC 16
54#define BP_FRAC0_IO0FRAC 24 55#define BP_FRAC0_IO0FRAC 24
55 56
56#define DIGCTRL MX28_IO_ADDRESS(MX28_DIGCTL_BASE_ADDR) 57static void __iomem *digctrl;
58#define DIGCTRL digctrl
57#define BP_SAIF_CLKMUX 10 59#define BP_SAIF_CLKMUX 10
58 60
59/* 61/*
@@ -72,8 +74,8 @@ int mxs_saif_clkmux_select(unsigned int clkmux)
72 if (clkmux > 0x3) 74 if (clkmux > 0x3)
73 return -EINVAL; 75 return -EINVAL;
74 76
75 __mxs_clrl(0x3 << BP_SAIF_CLKMUX, DIGCTRL); 77 writel_relaxed(0x3 << BP_SAIF_CLKMUX, DIGCTRL + CLR);
76 __mxs_setl(clkmux << BP_SAIF_CLKMUX, DIGCTRL); 78 writel_relaxed(clkmux << BP_SAIF_CLKMUX, DIGCTRL + SET);
77 79
78 return 0; 80 return 0;
79} 81}
@@ -83,13 +85,13 @@ static void __init clk_misc_init(void)
83 u32 val; 85 u32 val;
84 86
85 /* Gate off cpu clock in WFI for power saving */ 87 /* Gate off cpu clock in WFI for power saving */
86 __mxs_setl(1 << BP_CPU_INTERRUPT_WAIT, CPU); 88 writel_relaxed(1 << BP_CPU_INTERRUPT_WAIT, CPU + SET);
87 89
88 /* 0 is a bad default value for a divider */ 90 /* 0 is a bad default value for a divider */
89 __mxs_setl(1 << BP_ENET_DIV_TIME, ENET); 91 writel_relaxed(1 << BP_ENET_DIV_TIME, ENET + SET);
90 92
91 /* Clear BYPASS for SAIF */ 93 /* Clear BYPASS for SAIF */
92 __mxs_clrl(0x3 << BP_CLKSEQ_BYPASS_SAIF0, CLKSEQ); 94 writel_relaxed(0x3 << BP_CLKSEQ_BYPASS_SAIF0, CLKSEQ + CLR);
93 95
94 /* SAIF has to use frac div for functional operation */ 96 /* SAIF has to use frac div for functional operation */
95 val = readl_relaxed(SAIF0); 97 val = readl_relaxed(SAIF0);
@@ -109,7 +111,7 @@ static void __init clk_misc_init(void)
109 * Source ssp clock from ref_io than ref_xtal, 111 * Source ssp clock from ref_io than ref_xtal,
110 * as ref_xtal only provides 24 MHz as maximum. 112 * as ref_xtal only provides 24 MHz as maximum.
111 */ 113 */
112 __mxs_clrl(0xf << BP_CLKSEQ_BYPASS_SSP0, CLKSEQ); 114 writel_relaxed(0xf << BP_CLKSEQ_BYPASS_SSP0, CLKSEQ + CLR);
113 115
114 /* 116 /*
115 * 480 MHz seems too high to be ssp clock source directly, 117 * 480 MHz seems too high to be ssp clock source directly,
@@ -156,6 +158,14 @@ int __init mx28_clocks_init(void)
156 struct device_node *np; 158 struct device_node *np;
157 u32 i; 159 u32 i;
158 160
161 np = of_find_compatible_node(NULL, NULL, "fsl,imx28-digctl");
162 digctrl = of_iomap(np, 0);
163 WARN_ON(!digctrl);
164
165 np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl");
166 clkctrl = of_iomap(np, 0);
167 WARN_ON(!clkctrl);
168
159 clk_misc_init(); 169 clk_misc_init();
160 170
161 clks[ref_xtal] = mxs_clk_fixed("ref_xtal", 24000000); 171 clks[ref_xtal] = mxs_clk_fixed("ref_xtal", 24000000);
@@ -231,20 +241,14 @@ int __init mx28_clocks_init(void)
231 return PTR_ERR(clks[i]); 241 return PTR_ERR(clks[i]);
232 } 242 }
233 243
234 np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl"); 244 clk_data.clks = clks;
235 if (np) { 245 clk_data.clk_num = ARRAY_SIZE(clks);
236 clk_data.clks = clks; 246 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
237 clk_data.clk_num = ARRAY_SIZE(clks);
238 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
239 }
240 247
241 clk_register_clkdev(clks[xbus], NULL, "timrot");
242 clk_register_clkdev(clks[enet_out], NULL, "enet_out"); 248 clk_register_clkdev(clks[enet_out], NULL, "enet_out");
243 249
244 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) 250 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
245 clk_prepare_enable(clks[clks_init_on[i]]); 251 clk_prepare_enable(clks[clks_init_on[i]]);
246 252
247 mxs_timer_init();
248
249 return 0; 253 return 0;
250} 254}
diff --git a/drivers/clk/mxs/clk.c b/drivers/clk/mxs/clk.c
index b24d56067c80..5301bce8957b 100644
--- a/drivers/clk/mxs/clk.c
+++ b/drivers/clk/mxs/clk.c
@@ -13,6 +13,7 @@
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/jiffies.h> 14#include <linux/jiffies.h>
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include "clk.h"
16 17
17DEFINE_SPINLOCK(mxs_lock); 18DEFINE_SPINLOCK(mxs_lock);
18 19
diff --git a/drivers/clk/spear/spear1340_clock.c b/drivers/clk/spear/spear1340_clock.c
index 82abea366b78..35e7e2698e10 100644
--- a/drivers/clk/spear/spear1340_clock.c
+++ b/drivers/clk/spear/spear1340_clock.c
@@ -960,47 +960,47 @@ void __init spear1340_clk_init(void)
960 SPEAR1340_SPDIF_IN_CLK_ENB, 0, &_lock); 960 SPEAR1340_SPDIF_IN_CLK_ENB, 0, &_lock);
961 clk_register_clkdev(clk, NULL, "d0100000.spdif-in"); 961 clk_register_clkdev(clk, NULL, "d0100000.spdif-in");
962 962
963 clk = clk_register_gate(NULL, "acp_clk", "acp_mclk", 0, 963 clk = clk_register_gate(NULL, "acp_clk", "ahb_clk", 0,
964 SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_ACP_CLK_ENB, 0, 964 SPEAR1340_PERIP2_CLK_ENB, SPEAR1340_ACP_CLK_ENB, 0,
965 &_lock); 965 &_lock);
966 clk_register_clkdev(clk, NULL, "acp_clk"); 966 clk_register_clkdev(clk, NULL, "acp_clk");
967 967
968 clk = clk_register_gate(NULL, "plgpio_clk", "plgpio_mclk", 0, 968 clk = clk_register_gate(NULL, "plgpio_clk", "ahb_clk", 0,
969 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_PLGPIO_CLK_ENB, 0, 969 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_PLGPIO_CLK_ENB, 0,
970 &_lock); 970 &_lock);
971 clk_register_clkdev(clk, NULL, "e2800000.gpio"); 971 clk_register_clkdev(clk, NULL, "e2800000.gpio");
972 972
973 clk = clk_register_gate(NULL, "video_dec_clk", "video_dec_mclk", 0, 973 clk = clk_register_gate(NULL, "video_dec_clk", "ahb_clk", 0,
974 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_DEC_CLK_ENB, 974 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_DEC_CLK_ENB,
975 0, &_lock); 975 0, &_lock);
976 clk_register_clkdev(clk, NULL, "video_dec"); 976 clk_register_clkdev(clk, NULL, "video_dec");
977 977
978 clk = clk_register_gate(NULL, "video_enc_clk", "video_enc_mclk", 0, 978 clk = clk_register_gate(NULL, "video_enc_clk", "ahb_clk", 0,
979 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_ENC_CLK_ENB, 979 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_ENC_CLK_ENB,
980 0, &_lock); 980 0, &_lock);
981 clk_register_clkdev(clk, NULL, "video_enc"); 981 clk_register_clkdev(clk, NULL, "video_enc");
982 982
983 clk = clk_register_gate(NULL, "video_in_clk", "video_in_mclk", 0, 983 clk = clk_register_gate(NULL, "video_in_clk", "ahb_clk", 0,
984 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_IN_CLK_ENB, 0, 984 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_VIDEO_IN_CLK_ENB, 0,
985 &_lock); 985 &_lock);
986 clk_register_clkdev(clk, NULL, "spear_vip"); 986 clk_register_clkdev(clk, NULL, "spear_vip");
987 987
988 clk = clk_register_gate(NULL, "cam0_clk", "cam0_mclk", 0, 988 clk = clk_register_gate(NULL, "cam0_clk", "ahb_clk", 0,
989 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM0_CLK_ENB, 0, 989 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM0_CLK_ENB, 0,
990 &_lock); 990 &_lock);
991 clk_register_clkdev(clk, NULL, "d0200000.cam0"); 991 clk_register_clkdev(clk, NULL, "d0200000.cam0");
992 992
993 clk = clk_register_gate(NULL, "cam1_clk", "cam1_mclk", 0, 993 clk = clk_register_gate(NULL, "cam1_clk", "ahb_clk", 0,
994 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM1_CLK_ENB, 0, 994 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM1_CLK_ENB, 0,
995 &_lock); 995 &_lock);
996 clk_register_clkdev(clk, NULL, "d0300000.cam1"); 996 clk_register_clkdev(clk, NULL, "d0300000.cam1");
997 997
998 clk = clk_register_gate(NULL, "cam2_clk", "cam2_mclk", 0, 998 clk = clk_register_gate(NULL, "cam2_clk", "ahb_clk", 0,
999 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM2_CLK_ENB, 0, 999 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM2_CLK_ENB, 0,
1000 &_lock); 1000 &_lock);
1001 clk_register_clkdev(clk, NULL, "d0400000.cam2"); 1001 clk_register_clkdev(clk, NULL, "d0400000.cam2");
1002 1002
1003 clk = clk_register_gate(NULL, "cam3_clk", "cam3_mclk", 0, 1003 clk = clk_register_gate(NULL, "cam3_clk", "ahb_clk", 0,
1004 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM3_CLK_ENB, 0, 1004 SPEAR1340_PERIP3_CLK_ENB, SPEAR1340_CAM3_CLK_ENB, 0,
1005 &_lock); 1005 &_lock);
1006 clk_register_clkdev(clk, NULL, "d0500000.cam3"); 1006 clk_register_clkdev(clk, NULL, "d0500000.cam3");
diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
new file mode 100644
index 000000000000..b5bac917612c
--- /dev/null
+++ b/drivers/clk/sunxi/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile for sunxi specific clk
3#
4
5obj-y += clk-sunxi.o clk-factors.o
diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c
new file mode 100644
index 000000000000..88523f91d9b7
--- /dev/null
+++ b/drivers/clk/sunxi/clk-factors.c
@@ -0,0 +1,180 @@
1/*
2 * Copyright (C) 2013 Emilio López <emilio@elopez.com.ar>
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 * Adjustable factor-based clock implementation
9 */
10
11#include <linux/clk-provider.h>
12#include <linux/module.h>
13#include <linux/slab.h>
14#include <linux/io.h>
15#include <linux/err.h>
16#include <linux/string.h>
17
18#include <linux/delay.h>
19
20#include "clk-factors.h"
21
22/*
23 * DOC: basic adjustable factor-based clock that cannot gate
24 *
25 * Traits of this clock:
26 * prepare - clk_prepare only ensures that parents are prepared
27 * enable - clk_enable only ensures that parents are enabled
28 * rate - rate is adjustable.
29 * clk->rate = (parent->rate * N * (K + 1) >> P) / (M + 1)
30 * parent - fixed parent. No clk_set_parent support
31 */
32
33struct clk_factors {
34 struct clk_hw hw;
35 void __iomem *reg;
36 struct clk_factors_config *config;
37 void (*get_factors) (u32 *rate, u32 parent, u8 *n, u8 *k, u8 *m, u8 *p);
38 spinlock_t *lock;
39};
40
41#define to_clk_factors(_hw) container_of(_hw, struct clk_factors, hw)
42
43#define SETMASK(len, pos) (((-1U) >> (31-len)) << (pos))
44#define CLRMASK(len, pos) (~(SETMASK(len, pos)))
45#define FACTOR_GET(bit, len, reg) (((reg) & SETMASK(len, bit)) >> (bit))
46
47#define FACTOR_SET(bit, len, reg, val) \
48 (((reg) & CLRMASK(len, bit)) | (val << (bit)))
49
50static unsigned long clk_factors_recalc_rate(struct clk_hw *hw,
51 unsigned long parent_rate)
52{
53 u8 n = 1, k = 0, p = 0, m = 0;
54 u32 reg;
55 unsigned long rate;
56 struct clk_factors *factors = to_clk_factors(hw);
57 struct clk_factors_config *config = factors->config;
58
59 /* Fetch the register value */
60 reg = readl(factors->reg);
61
62 /* Get each individual factor if applicable */
63 if (config->nwidth != SUNXI_FACTORS_NOT_APPLICABLE)
64 n = FACTOR_GET(config->nshift, config->nwidth, reg);
65 if (config->kwidth != SUNXI_FACTORS_NOT_APPLICABLE)
66 k = FACTOR_GET(config->kshift, config->kwidth, reg);
67 if (config->mwidth != SUNXI_FACTORS_NOT_APPLICABLE)
68 m = FACTOR_GET(config->mshift, config->mwidth, reg);
69 if (config->pwidth != SUNXI_FACTORS_NOT_APPLICABLE)
70 p = FACTOR_GET(config->pshift, config->pwidth, reg);
71
72 /* Calculate the rate */
73 rate = (parent_rate * n * (k + 1) >> p) / (m + 1);
74
75 return rate;
76}
77
78static long clk_factors_round_rate(struct clk_hw *hw, unsigned long rate,
79 unsigned long *parent_rate)
80{
81 struct clk_factors *factors = to_clk_factors(hw);
82 factors->get_factors((u32 *)&rate, (u32)*parent_rate,
83 NULL, NULL, NULL, NULL);
84
85 return rate;
86}
87
88static int clk_factors_set_rate(struct clk_hw *hw, unsigned long rate,
89 unsigned long parent_rate)
90{
91 u8 n, k, m, p;
92 u32 reg;
93 struct clk_factors *factors = to_clk_factors(hw);
94 struct clk_factors_config *config = factors->config;
95 unsigned long flags = 0;
96
97 factors->get_factors((u32 *)&rate, (u32)parent_rate, &n, &k, &m, &p);
98
99 if (factors->lock)
100 spin_lock_irqsave(factors->lock, flags);
101
102 /* Fetch the register value */
103 reg = readl(factors->reg);
104
105 /* Set up the new factors - macros do not do anything if width is 0 */
106 reg = FACTOR_SET(config->nshift, config->nwidth, reg, n);
107 reg = FACTOR_SET(config->kshift, config->kwidth, reg, k);
108 reg = FACTOR_SET(config->mshift, config->mwidth, reg, m);
109 reg = FACTOR_SET(config->pshift, config->pwidth, reg, p);
110
111 /* Apply them now */
112 writel(reg, factors->reg);
113
114 /* delay 500us so pll stabilizes */
115 __delay((rate >> 20) * 500 / 2);
116
117 if (factors->lock)
118 spin_unlock_irqrestore(factors->lock, flags);
119
120 return 0;
121}
122
123static const struct clk_ops clk_factors_ops = {
124 .recalc_rate = clk_factors_recalc_rate,
125 .round_rate = clk_factors_round_rate,
126 .set_rate = clk_factors_set_rate,
127};
128
129/**
130 * clk_register_factors - register a factors clock with
131 * the clock framework
132 * @dev: device registering this clock
133 * @name: name of this clock
134 * @parent_name: name of clock's parent
135 * @flags: framework-specific flags
136 * @reg: register address to adjust factors
137 * @config: shift and width of factors n, k, m and p
138 * @get_factors: function to calculate the factors for a given frequency
139 * @lock: shared register lock for this clock
140 */
141struct clk *clk_register_factors(struct device *dev, const char *name,
142 const char *parent_name,
143 unsigned long flags, void __iomem *reg,
144 struct clk_factors_config *config,
145 void (*get_factors)(u32 *rate, u32 parent,
146 u8 *n, u8 *k, u8 *m, u8 *p),
147 spinlock_t *lock)
148{
149 struct clk_factors *factors;
150 struct clk *clk;
151 struct clk_init_data init;
152
153 /* allocate the factors */
154 factors = kzalloc(sizeof(struct clk_factors), GFP_KERNEL);
155 if (!factors) {
156 pr_err("%s: could not allocate factors clk\n", __func__);
157 return ERR_PTR(-ENOMEM);
158 }
159
160 init.name = name;
161 init.ops = &clk_factors_ops;
162 init.flags = flags;
163 init.parent_names = (parent_name ? &parent_name : NULL);
164 init.num_parents = (parent_name ? 1 : 0);
165
166 /* struct clk_factors assignments */
167 factors->reg = reg;
168 factors->config = config;
169 factors->lock = lock;
170 factors->hw.init = &init;
171 factors->get_factors = get_factors;
172
173 /* register the clock */
174 clk = clk_register(dev, &factors->hw);
175
176 if (IS_ERR(clk))
177 kfree(factors);
178
179 return clk;
180}
diff --git a/drivers/clk/sunxi/clk-factors.h b/drivers/clk/sunxi/clk-factors.h
new file mode 100644
index 000000000000..f49851cc4380
--- /dev/null
+++ b/drivers/clk/sunxi/clk-factors.h
@@ -0,0 +1,27 @@
1#ifndef __MACH_SUNXI_CLK_FACTORS_H
2#define __MACH_SUNXI_CLK_FACTORS_H
3
4#include <linux/clk-provider.h>
5#include <linux/clkdev.h>
6
7#define SUNXI_FACTORS_NOT_APPLICABLE (0)
8
9struct clk_factors_config {
10 u8 nshift;
11 u8 nwidth;
12 u8 kshift;
13 u8 kwidth;
14 u8 mshift;
15 u8 mwidth;
16 u8 pshift;
17 u8 pwidth;
18};
19
20struct clk *clk_register_factors(struct device *dev, const char *name,
21 const char *parent_name,
22 unsigned long flags, void __iomem *reg,
23 struct clk_factors_config *config,
24 void (*get_factors) (u32 *rate, u32 parent_rate,
25 u8 *n, u8 *k, u8 *m, u8 *p),
26 spinlock_t *lock);
27#endif
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
new file mode 100644
index 000000000000..d528a2496690
--- /dev/null
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -0,0 +1,362 @@
1/*
2 * Copyright 2013 Emilio López
3 *
4 * Emilio López <emilio@elopez.com.ar>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <linux/clk-provider.h>
18#include <linux/clkdev.h>
19#include <linux/clk/sunxi.h>
20#include <linux/of.h>
21#include <linux/of_address.h>
22
23#include "clk-factors.h"
24
25static DEFINE_SPINLOCK(clk_lock);
26
27/**
28 * sunxi_osc_clk_setup() - Setup function for gatable oscillator
29 */
30
31#define SUNXI_OSC24M_GATE 0
32
33static void __init sunxi_osc_clk_setup(struct device_node *node)
34{
35 struct clk *clk;
36 const char *clk_name = node->name;
37 const char *parent;
38 void *reg;
39
40 reg = of_iomap(node, 0);
41
42 parent = of_clk_get_parent_name(node, 0);
43
44 clk = clk_register_gate(NULL, clk_name, parent, CLK_IGNORE_UNUSED,
45 reg, SUNXI_OSC24M_GATE, 0, &clk_lock);
46
47 if (clk) {
48 of_clk_add_provider(node, of_clk_src_simple_get, clk);
49 clk_register_clkdev(clk, clk_name, NULL);
50 }
51}
52
53
54
55/**
56 * sunxi_get_pll1_factors() - calculates n, k, m, p factors for PLL1
57 * PLL1 rate is calculated as follows
58 * rate = (parent_rate * n * (k + 1) >> p) / (m + 1);
59 * parent_rate is always 24Mhz
60 */
61
62static void sunxi_get_pll1_factors(u32 *freq, u32 parent_rate,
63 u8 *n, u8 *k, u8 *m, u8 *p)
64{
65 u8 div;
66
67 /* Normalize value to a 6M multiple */
68 div = *freq / 6000000;
69 *freq = 6000000 * div;
70
71 /* we were called to round the frequency, we can now return */
72 if (n == NULL)
73 return;
74
75 /* m is always zero for pll1 */
76 *m = 0;
77
78 /* k is 1 only on these cases */
79 if (*freq >= 768000000 || *freq == 42000000 || *freq == 54000000)
80 *k = 1;
81 else
82 *k = 0;
83
84 /* p will be 3 for divs under 10 */
85 if (div < 10)
86 *p = 3;
87
88 /* p will be 2 for divs between 10 - 20 and odd divs under 32 */
89 else if (div < 20 || (div < 32 && (div & 1)))
90 *p = 2;
91
92 /* p will be 1 for even divs under 32, divs under 40 and odd pairs
93 * of divs between 40-62 */
94 else if (div < 40 || (div < 64 && (div & 2)))
95 *p = 1;
96
97 /* any other entries have p = 0 */
98 else
99 *p = 0;
100
101 /* calculate a suitable n based on k and p */
102 div <<= *p;
103 div /= (*k + 1);
104 *n = div / 4;
105}
106
107
108
109/**
110 * sunxi_get_apb1_factors() - calculates m, p factors for APB1
111 * APB1 rate is calculated as follows
112 * rate = (parent_rate >> p) / (m + 1);
113 */
114
115static void sunxi_get_apb1_factors(u32 *freq, u32 parent_rate,
116 u8 *n, u8 *k, u8 *m, u8 *p)
117{
118 u8 calcm, calcp;
119
120 if (parent_rate < *freq)
121 *freq = parent_rate;
122
123 parent_rate = (parent_rate + (*freq - 1)) / *freq;
124
125 /* Invalid rate! */
126 if (parent_rate > 32)
127 return;
128
129 if (parent_rate <= 4)
130 calcp = 0;
131 else if (parent_rate <= 8)
132 calcp = 1;
133 else if (parent_rate <= 16)
134 calcp = 2;
135 else
136 calcp = 3;
137
138 calcm = (parent_rate >> calcp) - 1;
139
140 *freq = (parent_rate >> calcp) / (calcm + 1);
141
142 /* we were called to round the frequency, we can now return */
143 if (n == NULL)
144 return;
145
146 *m = calcm;
147 *p = calcp;
148}
149
150
151
152/**
153 * sunxi_factors_clk_setup() - Setup function for factor clocks
154 */
155
156struct factors_data {
157 struct clk_factors_config *table;
158 void (*getter) (u32 *rate, u32 parent_rate, u8 *n, u8 *k, u8 *m, u8 *p);
159};
160
161static struct clk_factors_config pll1_config = {
162 .nshift = 8,
163 .nwidth = 5,
164 .kshift = 4,
165 .kwidth = 2,
166 .mshift = 0,
167 .mwidth = 2,
168 .pshift = 16,
169 .pwidth = 2,
170};
171
172static struct clk_factors_config apb1_config = {
173 .mshift = 0,
174 .mwidth = 5,
175 .pshift = 16,
176 .pwidth = 2,
177};
178
179static const __initconst struct factors_data pll1_data = {
180 .table = &pll1_config,
181 .getter = sunxi_get_pll1_factors,
182};
183
184static const __initconst struct factors_data apb1_data = {
185 .table = &apb1_config,
186 .getter = sunxi_get_apb1_factors,
187};
188
189static void __init sunxi_factors_clk_setup(struct device_node *node,
190 struct factors_data *data)
191{
192 struct clk *clk;
193 const char *clk_name = node->name;
194 const char *parent;
195 void *reg;
196
197 reg = of_iomap(node, 0);
198
199 parent = of_clk_get_parent_name(node, 0);
200
201 clk = clk_register_factors(NULL, clk_name, parent, CLK_IGNORE_UNUSED,
202 reg, data->table, data->getter, &clk_lock);
203
204 if (clk) {
205 of_clk_add_provider(node, of_clk_src_simple_get, clk);
206 clk_register_clkdev(clk, clk_name, NULL);
207 }
208}
209
210
211
212/**
213 * sunxi_mux_clk_setup() - Setup function for muxes
214 */
215
216#define SUNXI_MUX_GATE_WIDTH 2
217
218struct mux_data {
219 u8 shift;
220};
221
222static const __initconst struct mux_data cpu_data = {
223 .shift = 16,
224};
225
226static const __initconst struct mux_data apb1_mux_data = {
227 .shift = 24,
228};
229
230static void __init sunxi_mux_clk_setup(struct device_node *node,
231 struct mux_data *data)
232{
233 struct clk *clk;
234 const char *clk_name = node->name;
235 const char **parents = kmalloc(sizeof(char *) * 5, GFP_KERNEL);
236 void *reg;
237 int i = 0;
238
239 reg = of_iomap(node, 0);
240
241 while (i < 5 && (parents[i] = of_clk_get_parent_name(node, i)) != NULL)
242 i++;
243
244 clk = clk_register_mux(NULL, clk_name, parents, i, 0, reg,
245 data->shift, SUNXI_MUX_GATE_WIDTH,
246 0, &clk_lock);
247
248 if (clk) {
249 of_clk_add_provider(node, of_clk_src_simple_get, clk);
250 clk_register_clkdev(clk, clk_name, NULL);
251 }
252}
253
254
255
256/**
257 * sunxi_divider_clk_setup() - Setup function for simple divider clocks
258 */
259
260#define SUNXI_DIVISOR_WIDTH 2
261
262struct div_data {
263 u8 shift;
264 u8 pow;
265};
266
267static const __initconst struct div_data axi_data = {
268 .shift = 0,
269 .pow = 0,
270};
271
272static const __initconst struct div_data ahb_data = {
273 .shift = 4,
274 .pow = 1,
275};
276
277static const __initconst struct div_data apb0_data = {
278 .shift = 8,
279 .pow = 1,
280};
281
282static void __init sunxi_divider_clk_setup(struct device_node *node,
283 struct div_data *data)
284{
285 struct clk *clk;
286 const char *clk_name = node->name;
287 const char *clk_parent;
288 void *reg;
289
290 reg = of_iomap(node, 0);
291
292 clk_parent = of_clk_get_parent_name(node, 0);
293
294 clk = clk_register_divider(NULL, clk_name, clk_parent, 0,
295 reg, data->shift, SUNXI_DIVISOR_WIDTH,
296 data->pow ? CLK_DIVIDER_POWER_OF_TWO : 0,
297 &clk_lock);
298 if (clk) {
299 of_clk_add_provider(node, of_clk_src_simple_get, clk);
300 clk_register_clkdev(clk, clk_name, NULL);
301 }
302}
303
304
305/* Matches for of_clk_init */
306static const __initconst struct of_device_id clk_match[] = {
307 {.compatible = "fixed-clock", .data = of_fixed_clk_setup,},
308 {.compatible = "allwinner,sun4i-osc-clk", .data = sunxi_osc_clk_setup,},
309 {}
310};
311
312/* Matches for factors clocks */
313static const __initconst struct of_device_id clk_factors_match[] = {
314 {.compatible = "allwinner,sun4i-pll1-clk", .data = &pll1_data,},
315 {.compatible = "allwinner,sun4i-apb1-clk", .data = &apb1_data,},
316 {}
317};
318
319/* Matches for divider clocks */
320static const __initconst struct of_device_id clk_div_match[] = {
321 {.compatible = "allwinner,sun4i-axi-clk", .data = &axi_data,},
322 {.compatible = "allwinner,sun4i-ahb-clk", .data = &ahb_data,},
323 {.compatible = "allwinner,sun4i-apb0-clk", .data = &apb0_data,},
324 {}
325};
326
327/* Matches for mux clocks */
328static const __initconst struct of_device_id clk_mux_match[] = {
329 {.compatible = "allwinner,sun4i-cpu-clk", .data = &cpu_data,},
330 {.compatible = "allwinner,sun4i-apb1-mux-clk", .data = &apb1_mux_data,},
331 {}
332};
333
334static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_match,
335 void *function)
336{
337 struct device_node *np;
338 const struct div_data *data;
339 const struct of_device_id *match;
340 void (*setup_function)(struct device_node *, const void *) = function;
341
342 for_each_matching_node(np, clk_match) {
343 match = of_match_node(clk_match, np);
344 data = match->data;
345 setup_function(np, data);
346 }
347}
348
349void __init sunxi_init_clocks(void)
350{
351 /* Register all the simple sunxi clocks on DT */
352 of_clk_init(clk_match);
353
354 /* Register factor clocks */
355 of_sunxi_table_clock_setup(clk_factors_match, sunxi_factors_clk_setup);
356
357 /* Register divider clocks */
358 of_sunxi_table_clock_setup(clk_div_match, sunxi_divider_clk_setup);
359
360 /* Register mux clocks */
361 of_sunxi_table_clock_setup(clk_mux_match, sunxi_mux_clk_setup);
362}
diff --git a/drivers/clk/tegra/Makefile b/drivers/clk/tegra/Makefile
index 2b41b0f4f731..f49fac2d193a 100644
--- a/drivers/clk/tegra/Makefile
+++ b/drivers/clk/tegra/Makefile
@@ -9,3 +9,4 @@ obj-y += clk-super.o
9 9
10obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o 10obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o
11obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o 11obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o
12obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o
diff --git a/drivers/clk/tegra/clk-periph-gate.c b/drivers/clk/tegra/clk-periph-gate.c
index 6dd533251e7b..bafee9895a24 100644
--- a/drivers/clk/tegra/clk-periph-gate.c
+++ b/drivers/clk/tegra/clk-periph-gate.c
@@ -41,7 +41,9 @@ static DEFINE_SPINLOCK(periph_ref_lock);
41#define write_rst_clr(val, gate) \ 41#define write_rst_clr(val, gate) \
42 writel_relaxed(val, gate->clk_base + (gate->regs->rst_clr_reg)) 42 writel_relaxed(val, gate->clk_base + (gate->regs->rst_clr_reg))
43 43
44#define periph_clk_to_bit(periph) (1 << (gate->clk_num % 32)) 44#define periph_clk_to_bit(gate) (1 << (gate->clk_num % 32))
45
46#define LVL2_CLK_GATE_OVRE 0x554
45 47
46/* Peripheral gate clock ops */ 48/* Peripheral gate clock ops */
47static int clk_periph_is_enabled(struct clk_hw *hw) 49static int clk_periph_is_enabled(struct clk_hw *hw)
@@ -83,6 +85,13 @@ static int clk_periph_enable(struct clk_hw *hw)
83 } 85 }
84 } 86 }
85 87
88 if (gate->flags & TEGRA_PERIPH_WAR_1005168) {
89 writel_relaxed(0, gate->clk_base + LVL2_CLK_GATE_OVRE);
90 writel_relaxed(BIT(22), gate->clk_base + LVL2_CLK_GATE_OVRE);
91 udelay(1);
92 writel_relaxed(0, gate->clk_base + LVL2_CLK_GATE_OVRE);
93 }
94
86 spin_unlock_irqrestore(&periph_ref_lock, flags); 95 spin_unlock_irqrestore(&periph_ref_lock, flags);
87 96
88 return 0; 97 return 0;
diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c
index 788486e6331a..b2309d37a963 100644
--- a/drivers/clk/tegra/clk-periph.c
+++ b/drivers/clk/tegra/clk-periph.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/clk-provider.h> 18#include <linux/clk-provider.h>
19#include <linux/export.h>
19#include <linux/slab.h> 20#include <linux/slab.h>
20#include <linux/err.h> 21#include <linux/err.h>
21 22
@@ -128,6 +129,7 @@ void tegra_periph_reset_deassert(struct clk *c)
128 129
129 tegra_periph_reset(gate, 0); 130 tegra_periph_reset(gate, 0);
130} 131}
132EXPORT_SYMBOL(tegra_periph_reset_deassert);
131 133
132void tegra_periph_reset_assert(struct clk *c) 134void tegra_periph_reset_assert(struct clk *c)
133{ 135{
@@ -147,6 +149,7 @@ void tegra_periph_reset_assert(struct clk *c)
147 149
148 tegra_periph_reset(gate, 1); 150 tegra_periph_reset(gate, 1);
149} 151}
152EXPORT_SYMBOL(tegra_periph_reset_assert);
150 153
151const struct clk_ops tegra_clk_periph_ops = { 154const struct clk_ops tegra_clk_periph_ops = {
152 .get_parent = clk_periph_get_parent, 155 .get_parent = clk_periph_get_parent,
@@ -170,14 +173,15 @@ const struct clk_ops tegra_clk_periph_nodiv_ops = {
170static struct clk *_tegra_clk_register_periph(const char *name, 173static struct clk *_tegra_clk_register_periph(const char *name,
171 const char **parent_names, int num_parents, 174 const char **parent_names, int num_parents,
172 struct tegra_clk_periph *periph, 175 struct tegra_clk_periph *periph,
173 void __iomem *clk_base, u32 offset, bool div) 176 void __iomem *clk_base, u32 offset, bool div,
177 unsigned long flags)
174{ 178{
175 struct clk *clk; 179 struct clk *clk;
176 struct clk_init_data init; 180 struct clk_init_data init;
177 181
178 init.name = name; 182 init.name = name;
179 init.ops = div ? &tegra_clk_periph_ops : &tegra_clk_periph_nodiv_ops; 183 init.ops = div ? &tegra_clk_periph_ops : &tegra_clk_periph_nodiv_ops;
180 init.flags = div ? 0 : CLK_SET_RATE_PARENT; 184 init.flags = flags;
181 init.parent_names = parent_names; 185 init.parent_names = parent_names;
182 init.num_parents = num_parents; 186 init.num_parents = num_parents;
183 187
@@ -202,10 +206,10 @@ static struct clk *_tegra_clk_register_periph(const char *name,
202struct clk *tegra_clk_register_periph(const char *name, 206struct clk *tegra_clk_register_periph(const char *name,
203 const char **parent_names, int num_parents, 207 const char **parent_names, int num_parents,
204 struct tegra_clk_periph *periph, void __iomem *clk_base, 208 struct tegra_clk_periph *periph, void __iomem *clk_base,
205 u32 offset) 209 u32 offset, unsigned long flags)
206{ 210{
207 return _tegra_clk_register_periph(name, parent_names, num_parents, 211 return _tegra_clk_register_periph(name, parent_names, num_parents,
208 periph, clk_base, offset, true); 212 periph, clk_base, offset, true, flags);
209} 213}
210 214
211struct clk *tegra_clk_register_periph_nodiv(const char *name, 215struct clk *tegra_clk_register_periph_nodiv(const char *name,
@@ -214,5 +218,5 @@ struct clk *tegra_clk_register_periph_nodiv(const char *name,
214 u32 offset) 218 u32 offset)
215{ 219{
216 return _tegra_clk_register_periph(name, parent_names, num_parents, 220 return _tegra_clk_register_periph(name, parent_names, num_parents,
217 periph, clk_base, offset, false); 221 periph, clk_base, offset, false, CLK_SET_RATE_PARENT);
218} 222}
diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
index 165f24734c1b..17c2cc086eb4 100644
--- a/drivers/clk/tegra/clk-pll.c
+++ b/drivers/clk/tegra/clk-pll.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2012, 2013, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 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, 5 * under the terms and conditions of the GNU General Public License,
@@ -79,6 +79,48 @@
79#define PLLE_SS_CTRL 0x68 79#define PLLE_SS_CTRL 0x68
80#define PLLE_SS_DISABLE (7 << 10) 80#define PLLE_SS_DISABLE (7 << 10)
81 81
82#define PLLE_AUX_PLLP_SEL BIT(2)
83#define PLLE_AUX_ENABLE_SWCTL BIT(4)
84#define PLLE_AUX_SEQ_ENABLE BIT(24)
85#define PLLE_AUX_PLLRE_SEL BIT(28)
86
87#define PLLE_MISC_PLLE_PTS BIT(8)
88#define PLLE_MISC_IDDQ_SW_VALUE BIT(13)
89#define PLLE_MISC_IDDQ_SW_CTRL BIT(14)
90#define PLLE_MISC_VREG_BG_CTRL_SHIFT 4
91#define PLLE_MISC_VREG_BG_CTRL_MASK (3 << PLLE_MISC_VREG_BG_CTRL_SHIFT)
92#define PLLE_MISC_VREG_CTRL_SHIFT 2
93#define PLLE_MISC_VREG_CTRL_MASK (2 << PLLE_MISC_VREG_CTRL_SHIFT)
94
95#define PLLCX_MISC_STROBE BIT(31)
96#define PLLCX_MISC_RESET BIT(30)
97#define PLLCX_MISC_SDM_DIV_SHIFT 28
98#define PLLCX_MISC_SDM_DIV_MASK (0x3 << PLLCX_MISC_SDM_DIV_SHIFT)
99#define PLLCX_MISC_FILT_DIV_SHIFT 26
100#define PLLCX_MISC_FILT_DIV_MASK (0x3 << PLLCX_MISC_FILT_DIV_SHIFT)
101#define PLLCX_MISC_ALPHA_SHIFT 18
102#define PLLCX_MISC_DIV_LOW_RANGE \
103 ((0x1 << PLLCX_MISC_SDM_DIV_SHIFT) | \
104 (0x1 << PLLCX_MISC_FILT_DIV_SHIFT))
105#define PLLCX_MISC_DIV_HIGH_RANGE \
106 ((0x2 << PLLCX_MISC_SDM_DIV_SHIFT) | \
107 (0x2 << PLLCX_MISC_FILT_DIV_SHIFT))
108#define PLLCX_MISC_COEF_LOW_RANGE \
109 ((0x14 << PLLCX_MISC_KA_SHIFT) | (0x38 << PLLCX_MISC_KB_SHIFT))
110#define PLLCX_MISC_KA_SHIFT 2
111#define PLLCX_MISC_KB_SHIFT 9
112#define PLLCX_MISC_DEFAULT (PLLCX_MISC_COEF_LOW_RANGE | \
113 (0x19 << PLLCX_MISC_ALPHA_SHIFT) | \
114 PLLCX_MISC_DIV_LOW_RANGE | \
115 PLLCX_MISC_RESET)
116#define PLLCX_MISC1_DEFAULT 0x000d2308
117#define PLLCX_MISC2_DEFAULT 0x30211200
118#define PLLCX_MISC3_DEFAULT 0x200
119
120#define PMC_PLLM_WB0_OVERRIDE 0x1dc
121#define PMC_PLLM_WB0_OVERRIDE_2 0x2b0
122#define PMC_PLLM_WB0_OVERRIDE_2_DIVP_MASK BIT(27)
123
82#define PMC_SATA_PWRGT 0x1ac 124#define PMC_SATA_PWRGT 0x1ac
83#define PMC_SATA_PWRGT_PLLE_IDDQ_VALUE BIT(5) 125#define PMC_SATA_PWRGT_PLLE_IDDQ_VALUE BIT(5)
84#define PMC_SATA_PWRGT_PLLE_IDDQ_SWCTL BIT(4) 126#define PMC_SATA_PWRGT_PLLE_IDDQ_SWCTL BIT(4)
@@ -101,6 +143,24 @@
101#define divn_max(p) (divn_mask(p)) 143#define divn_max(p) (divn_mask(p))
102#define divp_max(p) (1 << (divp_mask(p))) 144#define divp_max(p) (1 << (divp_mask(p)))
103 145
146
147#ifdef CONFIG_ARCH_TEGRA_114_SOC
148/* PLLXC has 4-bit PDIV, but entry 15 is not allowed in h/w */
149#define PLLXC_PDIV_MAX 14
150
151/* non-monotonic mapping below is not a typo */
152static u8 pllxc_p[PLLXC_PDIV_MAX + 1] = {
153 /* PDIV: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 */
154 /* p: */ 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 12, 16, 20, 24, 32
155};
156
157#define PLLCX_PDIV_MAX 7
158static u8 pllcx_p[PLLCX_PDIV_MAX + 1] = {
159 /* PDIV: 0, 1, 2, 3, 4, 5, 6, 7 */
160 /* p: */ 1, 2, 3, 4, 6, 8, 12, 16
161};
162#endif
163
104static void clk_pll_enable_lock(struct tegra_clk_pll *pll) 164static void clk_pll_enable_lock(struct tegra_clk_pll *pll)
105{ 165{
106 u32 val; 166 u32 val;
@@ -108,25 +168,36 @@ static void clk_pll_enable_lock(struct tegra_clk_pll *pll)
108 if (!(pll->flags & TEGRA_PLL_USE_LOCK)) 168 if (!(pll->flags & TEGRA_PLL_USE_LOCK))
109 return; 169 return;
110 170
171 if (!(pll->flags & TEGRA_PLL_HAS_LOCK_ENABLE))
172 return;
173
111 val = pll_readl_misc(pll); 174 val = pll_readl_misc(pll);
112 val |= BIT(pll->params->lock_enable_bit_idx); 175 val |= BIT(pll->params->lock_enable_bit_idx);
113 pll_writel_misc(val, pll); 176 pll_writel_misc(val, pll);
114} 177}
115 178
116static int clk_pll_wait_for_lock(struct tegra_clk_pll *pll, 179static int clk_pll_wait_for_lock(struct tegra_clk_pll *pll)
117 void __iomem *lock_addr, u32 lock_bit_idx)
118{ 180{
119 int i; 181 int i;
120 u32 val; 182 u32 val, lock_mask;
183 void __iomem *lock_addr;
121 184
122 if (!(pll->flags & TEGRA_PLL_USE_LOCK)) { 185 if (!(pll->flags & TEGRA_PLL_USE_LOCK)) {
123 udelay(pll->params->lock_delay); 186 udelay(pll->params->lock_delay);
124 return 0; 187 return 0;
125 } 188 }
126 189
190 lock_addr = pll->clk_base;
191 if (pll->flags & TEGRA_PLL_LOCK_MISC)
192 lock_addr += pll->params->misc_reg;
193 else
194 lock_addr += pll->params->base_reg;
195
196 lock_mask = pll->params->lock_mask;
197
127 for (i = 0; i < pll->params->lock_delay; i++) { 198 for (i = 0; i < pll->params->lock_delay; i++) {
128 val = readl_relaxed(lock_addr); 199 val = readl_relaxed(lock_addr);
129 if (val & BIT(lock_bit_idx)) { 200 if ((val & lock_mask) == lock_mask) {
130 udelay(PLL_POST_LOCK_DELAY); 201 udelay(PLL_POST_LOCK_DELAY);
131 return 0; 202 return 0;
132 } 203 }
@@ -155,7 +226,7 @@ static int clk_pll_is_enabled(struct clk_hw *hw)
155 return val & PLL_BASE_ENABLE ? 1 : 0; 226 return val & PLL_BASE_ENABLE ? 1 : 0;
156} 227}
157 228
158static int _clk_pll_enable(struct clk_hw *hw) 229static void _clk_pll_enable(struct clk_hw *hw)
159{ 230{
160 struct tegra_clk_pll *pll = to_clk_pll(hw); 231 struct tegra_clk_pll *pll = to_clk_pll(hw);
161 u32 val; 232 u32 val;
@@ -163,7 +234,8 @@ static int _clk_pll_enable(struct clk_hw *hw)
163 clk_pll_enable_lock(pll); 234 clk_pll_enable_lock(pll);
164 235
165 val = pll_readl_base(pll); 236 val = pll_readl_base(pll);
166 val &= ~PLL_BASE_BYPASS; 237 if (pll->flags & TEGRA_PLL_BYPASS)
238 val &= ~PLL_BASE_BYPASS;
167 val |= PLL_BASE_ENABLE; 239 val |= PLL_BASE_ENABLE;
168 pll_writel_base(val, pll); 240 pll_writel_base(val, pll);
169 241
@@ -172,11 +244,6 @@ static int _clk_pll_enable(struct clk_hw *hw)
172 val |= PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE; 244 val |= PMC_PLLP_WB0_OVERRIDE_PLLM_ENABLE;
173 writel_relaxed(val, pll->pmc + PMC_PLLP_WB0_OVERRIDE); 245 writel_relaxed(val, pll->pmc + PMC_PLLP_WB0_OVERRIDE);
174 } 246 }
175
176 clk_pll_wait_for_lock(pll, pll->clk_base + pll->params->base_reg,
177 pll->params->lock_bit_idx);
178
179 return 0;
180} 247}
181 248
182static void _clk_pll_disable(struct clk_hw *hw) 249static void _clk_pll_disable(struct clk_hw *hw)
@@ -185,7 +252,9 @@ static void _clk_pll_disable(struct clk_hw *hw)
185 u32 val; 252 u32 val;
186 253
187 val = pll_readl_base(pll); 254 val = pll_readl_base(pll);
188 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE); 255 if (pll->flags & TEGRA_PLL_BYPASS)
256 val &= ~PLL_BASE_BYPASS;
257 val &= ~PLL_BASE_ENABLE;
189 pll_writel_base(val, pll); 258 pll_writel_base(val, pll);
190 259
191 if (pll->flags & TEGRA_PLLM) { 260 if (pll->flags & TEGRA_PLLM) {
@@ -204,7 +273,9 @@ static int clk_pll_enable(struct clk_hw *hw)
204 if (pll->lock) 273 if (pll->lock)
205 spin_lock_irqsave(pll->lock, flags); 274 spin_lock_irqsave(pll->lock, flags);
206 275
207 ret = _clk_pll_enable(hw); 276 _clk_pll_enable(hw);
277
278 ret = clk_pll_wait_for_lock(pll);
208 279
209 if (pll->lock) 280 if (pll->lock)
210 spin_unlock_irqrestore(pll->lock, flags); 281 spin_unlock_irqrestore(pll->lock, flags);
@@ -241,8 +312,6 @@ static int _get_table_rate(struct clk_hw *hw,
241 if (sel->input_rate == 0) 312 if (sel->input_rate == 0)
242 return -EINVAL; 313 return -EINVAL;
243 314
244 BUG_ON(sel->p < 1);
245
246 cfg->input_rate = sel->input_rate; 315 cfg->input_rate = sel->input_rate;
247 cfg->output_rate = sel->output_rate; 316 cfg->output_rate = sel->output_rate;
248 cfg->m = sel->m; 317 cfg->m = sel->m;
@@ -257,6 +326,7 @@ static int _calc_rate(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
257 unsigned long rate, unsigned long parent_rate) 326 unsigned long rate, unsigned long parent_rate)
258{ 327{
259 struct tegra_clk_pll *pll = to_clk_pll(hw); 328 struct tegra_clk_pll *pll = to_clk_pll(hw);
329 struct pdiv_map *p_tohw = pll->params->pdiv_tohw;
260 unsigned long cfreq; 330 unsigned long cfreq;
261 u32 p_div = 0; 331 u32 p_div = 0;
262 332
@@ -290,88 +360,119 @@ static int _calc_rate(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
290 cfg->output_rate <<= 1) 360 cfg->output_rate <<= 1)
291 p_div++; 361 p_div++;
292 362
293 cfg->p = 1 << p_div;
294 cfg->m = parent_rate / cfreq; 363 cfg->m = parent_rate / cfreq;
295 cfg->n = cfg->output_rate / cfreq; 364 cfg->n = cfg->output_rate / cfreq;
296 cfg->cpcon = OUT_OF_TABLE_CPCON; 365 cfg->cpcon = OUT_OF_TABLE_CPCON;
297 366
298 if (cfg->m > divm_max(pll) || cfg->n > divn_max(pll) || 367 if (cfg->m > divm_max(pll) || cfg->n > divn_max(pll) ||
299 cfg->p > divp_max(pll) || cfg->output_rate > pll->params->vco_max) { 368 (1 << p_div) > divp_max(pll)
369 || cfg->output_rate > pll->params->vco_max) {
300 pr_err("%s: Failed to set %s rate %lu\n", 370 pr_err("%s: Failed to set %s rate %lu\n",
301 __func__, __clk_get_name(hw->clk), rate); 371 __func__, __clk_get_name(hw->clk), rate);
302 return -EINVAL; 372 return -EINVAL;
303 } 373 }
304 374
375 if (p_tohw) {
376 p_div = 1 << p_div;
377 while (p_tohw->pdiv) {
378 if (p_div <= p_tohw->pdiv) {
379 cfg->p = p_tohw->hw_val;
380 break;
381 }
382 p_tohw++;
383 }
384 if (!p_tohw->pdiv)
385 return -EINVAL;
386 } else
387 cfg->p = p_div;
388
305 return 0; 389 return 0;
306} 390}
307 391
308static int _program_pll(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg, 392static void _update_pll_mnp(struct tegra_clk_pll *pll,
309 unsigned long rate) 393 struct tegra_clk_pll_freq_table *cfg)
310{ 394{
311 struct tegra_clk_pll *pll = to_clk_pll(hw); 395 u32 val;
312 unsigned long flags = 0;
313 u32 divp, val, old_base;
314 int state;
315
316 divp = __ffs(cfg->p);
317
318 if (pll->flags & TEGRA_PLLU)
319 divp ^= 1;
320 396
321 if (pll->lock) 397 val = pll_readl_base(pll);
322 spin_lock_irqsave(pll->lock, flags);
323 398
324 old_base = val = pll_readl_base(pll);
325 val &= ~((divm_mask(pll) << pll->divm_shift) | 399 val &= ~((divm_mask(pll) << pll->divm_shift) |
326 (divn_mask(pll) << pll->divn_shift) | 400 (divn_mask(pll) << pll->divn_shift) |
327 (divp_mask(pll) << pll->divp_shift)); 401 (divp_mask(pll) << pll->divp_shift));
328 val |= ((cfg->m << pll->divm_shift) | 402 val |= ((cfg->m << pll->divm_shift) |
329 (cfg->n << pll->divn_shift) | 403 (cfg->n << pll->divn_shift) |
330 (divp << pll->divp_shift)); 404 (cfg->p << pll->divp_shift));
331 if (val == old_base) { 405
332 if (pll->lock) 406 pll_writel_base(val, pll);
333 spin_unlock_irqrestore(pll->lock, flags); 407}
334 return 0; 408
409static void _get_pll_mnp(struct tegra_clk_pll *pll,
410 struct tegra_clk_pll_freq_table *cfg)
411{
412 u32 val;
413
414 val = pll_readl_base(pll);
415
416 cfg->m = (val >> pll->divm_shift) & (divm_mask(pll));
417 cfg->n = (val >> pll->divn_shift) & (divn_mask(pll));
418 cfg->p = (val >> pll->divp_shift) & (divp_mask(pll));
419}
420
421static void _update_pll_cpcon(struct tegra_clk_pll *pll,
422 struct tegra_clk_pll_freq_table *cfg,
423 unsigned long rate)
424{
425 u32 val;
426
427 val = pll_readl_misc(pll);
428
429 val &= ~(PLL_MISC_CPCON_MASK << PLL_MISC_CPCON_SHIFT);
430 val |= cfg->cpcon << PLL_MISC_CPCON_SHIFT;
431
432 if (pll->flags & TEGRA_PLL_SET_LFCON) {
433 val &= ~(PLL_MISC_LFCON_MASK << PLL_MISC_LFCON_SHIFT);
434 if (cfg->n >= PLLDU_LFCON_SET_DIVN)
435 val |= 1 << PLL_MISC_LFCON_SHIFT;
436 } else if (pll->flags & TEGRA_PLL_SET_DCCON) {
437 val &= ~(1 << PLL_MISC_DCCON_SHIFT);
438 if (rate >= (pll->params->vco_max >> 1))
439 val |= 1 << PLL_MISC_DCCON_SHIFT;
335 } 440 }
336 441
442 pll_writel_misc(val, pll);
443}
444
445static int _program_pll(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
446 unsigned long rate)
447{
448 struct tegra_clk_pll *pll = to_clk_pll(hw);
449 int state, ret = 0;
450
337 state = clk_pll_is_enabled(hw); 451 state = clk_pll_is_enabled(hw);
338 452
339 if (state) { 453 if (state)
340 _clk_pll_disable(hw); 454 _clk_pll_disable(hw);
341 val &= ~(PLL_BASE_BYPASS | PLL_BASE_ENABLE);
342 }
343 pll_writel_base(val, pll);
344 455
345 if (pll->flags & TEGRA_PLL_HAS_CPCON) { 456 _update_pll_mnp(pll, cfg);
346 val = pll_readl_misc(pll);
347 val &= ~(PLL_MISC_CPCON_MASK << PLL_MISC_CPCON_SHIFT);
348 val |= cfg->cpcon << PLL_MISC_CPCON_SHIFT;
349 if (pll->flags & TEGRA_PLL_SET_LFCON) {
350 val &= ~(PLL_MISC_LFCON_MASK << PLL_MISC_LFCON_SHIFT);
351 if (cfg->n >= PLLDU_LFCON_SET_DIVN)
352 val |= 0x1 << PLL_MISC_LFCON_SHIFT;
353 } else if (pll->flags & TEGRA_PLL_SET_DCCON) {
354 val &= ~(0x1 << PLL_MISC_DCCON_SHIFT);
355 if (rate >= (pll->params->vco_max >> 1))
356 val |= 0x1 << PLL_MISC_DCCON_SHIFT;
357 }
358 pll_writel_misc(val, pll);
359 }
360 457
361 if (pll->lock) 458 if (pll->flags & TEGRA_PLL_HAS_CPCON)
362 spin_unlock_irqrestore(pll->lock, flags); 459 _update_pll_cpcon(pll, cfg, rate);
363 460
364 if (state) 461 if (state) {
365 clk_pll_enable(hw); 462 _clk_pll_enable(hw);
463 ret = clk_pll_wait_for_lock(pll);
464 }
366 465
367 return 0; 466 return ret;
368} 467}
369 468
370static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, 469static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
371 unsigned long parent_rate) 470 unsigned long parent_rate)
372{ 471{
373 struct tegra_clk_pll *pll = to_clk_pll(hw); 472 struct tegra_clk_pll *pll = to_clk_pll(hw);
374 struct tegra_clk_pll_freq_table cfg; 473 struct tegra_clk_pll_freq_table cfg, old_cfg;
474 unsigned long flags = 0;
475 int ret = 0;
375 476
376 if (pll->flags & TEGRA_PLL_FIXED) { 477 if (pll->flags & TEGRA_PLL_FIXED) {
377 if (rate != pll->fixed_rate) { 478 if (rate != pll->fixed_rate) {
@@ -387,7 +488,18 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
387 _calc_rate(hw, &cfg, rate, parent_rate)) 488 _calc_rate(hw, &cfg, rate, parent_rate))
388 return -EINVAL; 489 return -EINVAL;
389 490
390 return _program_pll(hw, &cfg, rate); 491 if (pll->lock)
492 spin_lock_irqsave(pll->lock, flags);
493
494 _get_pll_mnp(pll, &old_cfg);
495
496 if (old_cfg.m != cfg.m || old_cfg.n != cfg.n || old_cfg.p != cfg.p)
497 ret = _program_pll(hw, &cfg, rate);
498
499 if (pll->lock)
500 spin_unlock_irqrestore(pll->lock, flags);
501
502 return ret;
391} 503}
392 504
393static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate, 505static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
@@ -409,7 +521,7 @@ static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
409 return -EINVAL; 521 return -EINVAL;
410 522
411 output_rate *= cfg.n; 523 output_rate *= cfg.n;
412 do_div(output_rate, cfg.m * cfg.p); 524 do_div(output_rate, cfg.m * (1 << cfg.p));
413 525
414 return output_rate; 526 return output_rate;
415} 527}
@@ -418,11 +530,15 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hw,
418 unsigned long parent_rate) 530 unsigned long parent_rate)
419{ 531{
420 struct tegra_clk_pll *pll = to_clk_pll(hw); 532 struct tegra_clk_pll *pll = to_clk_pll(hw);
421 u32 val = pll_readl_base(pll); 533 struct tegra_clk_pll_freq_table cfg;
422 u32 divn = 0, divm = 0, divp = 0; 534 struct pdiv_map *p_tohw = pll->params->pdiv_tohw;
535 u32 val;
423 u64 rate = parent_rate; 536 u64 rate = parent_rate;
537 int pdiv;
538
539 val = pll_readl_base(pll);
424 540
425 if (val & PLL_BASE_BYPASS) 541 if ((pll->flags & TEGRA_PLL_BYPASS) && (val & PLL_BASE_BYPASS))
426 return parent_rate; 542 return parent_rate;
427 543
428 if ((pll->flags & TEGRA_PLL_FIXED) && !(val & PLL_BASE_OVERRIDE)) { 544 if ((pll->flags & TEGRA_PLL_FIXED) && !(val & PLL_BASE_OVERRIDE)) {
@@ -435,16 +551,29 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hw,
435 return pll->fixed_rate; 551 return pll->fixed_rate;
436 } 552 }
437 553
438 divp = (val >> pll->divp_shift) & (divp_mask(pll)); 554 _get_pll_mnp(pll, &cfg);
439 if (pll->flags & TEGRA_PLLU)
440 divp ^= 1;
441 555
442 divn = (val >> pll->divn_shift) & (divn_mask(pll)); 556 if (p_tohw) {
443 divm = (val >> pll->divm_shift) & (divm_mask(pll)); 557 while (p_tohw->pdiv) {
444 divm *= (1 << divp); 558 if (cfg.p == p_tohw->hw_val) {
559 pdiv = p_tohw->pdiv;
560 break;
561 }
562 p_tohw++;
563 }
564
565 if (!p_tohw->pdiv) {
566 WARN_ON(1);
567 pdiv = 1;
568 }
569 } else
570 pdiv = 1 << cfg.p;
571
572 cfg.m *= pdiv;
573
574 rate *= cfg.n;
575 do_div(rate, cfg.m);
445 576
446 rate *= divn;
447 do_div(rate, divm);
448 return rate; 577 return rate;
449} 578}
450 579
@@ -538,8 +667,8 @@ static int clk_plle_enable(struct clk_hw *hw)
538 val |= (PLL_BASE_BYPASS | PLL_BASE_ENABLE); 667 val |= (PLL_BASE_BYPASS | PLL_BASE_ENABLE);
539 pll_writel_base(val, pll); 668 pll_writel_base(val, pll);
540 669
541 clk_pll_wait_for_lock(pll, pll->clk_base + pll->params->misc_reg, 670 clk_pll_wait_for_lock(pll);
542 pll->params->lock_bit_idx); 671
543 return 0; 672 return 0;
544} 673}
545 674
@@ -577,28 +706,531 @@ const struct clk_ops tegra_clk_plle_ops = {
577 .enable = clk_plle_enable, 706 .enable = clk_plle_enable,
578}; 707};
579 708
580static struct clk *_tegra_clk_register_pll(const char *name, 709#ifdef CONFIG_ARCH_TEGRA_114_SOC
581 const char *parent_name, void __iomem *clk_base, 710
582 void __iomem *pmc, unsigned long flags, 711static int _pll_fixed_mdiv(struct tegra_clk_pll_params *pll_params,
583 unsigned long fixed_rate, 712 unsigned long parent_rate)
584 struct tegra_clk_pll_params *pll_params, u8 pll_flags, 713{
585 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock, 714 if (parent_rate > pll_params->cf_max)
586 const struct clk_ops *ops) 715 return 2;
716 else
717 return 1;
718}
719
720static int clk_pll_iddq_enable(struct clk_hw *hw)
721{
722 struct tegra_clk_pll *pll = to_clk_pll(hw);
723 unsigned long flags = 0;
724
725 u32 val;
726 int ret;
727
728 if (pll->lock)
729 spin_lock_irqsave(pll->lock, flags);
730
731 val = pll_readl(pll->params->iddq_reg, pll);
732 val &= ~BIT(pll->params->iddq_bit_idx);
733 pll_writel(val, pll->params->iddq_reg, pll);
734 udelay(2);
735
736 _clk_pll_enable(hw);
737
738 ret = clk_pll_wait_for_lock(pll);
739
740 if (pll->lock)
741 spin_unlock_irqrestore(pll->lock, flags);
742
743 return 0;
744}
745
746static void clk_pll_iddq_disable(struct clk_hw *hw)
747{
748 struct tegra_clk_pll *pll = to_clk_pll(hw);
749 unsigned long flags = 0;
750 u32 val;
751
752 if (pll->lock)
753 spin_lock_irqsave(pll->lock, flags);
754
755 _clk_pll_disable(hw);
756
757 val = pll_readl(pll->params->iddq_reg, pll);
758 val |= BIT(pll->params->iddq_bit_idx);
759 pll_writel(val, pll->params->iddq_reg, pll);
760 udelay(2);
761
762 if (pll->lock)
763 spin_unlock_irqrestore(pll->lock, flags);
764}
765
766static int _calc_dynamic_ramp_rate(struct clk_hw *hw,
767 struct tegra_clk_pll_freq_table *cfg,
768 unsigned long rate, unsigned long parent_rate)
769{
770 struct tegra_clk_pll *pll = to_clk_pll(hw);
771 unsigned int p;
772
773 if (!rate)
774 return -EINVAL;
775
776 p = DIV_ROUND_UP(pll->params->vco_min, rate);
777 cfg->m = _pll_fixed_mdiv(pll->params, parent_rate);
778 cfg->p = p;
779 cfg->output_rate = rate * cfg->p;
780 cfg->n = cfg->output_rate * cfg->m / parent_rate;
781
782 if (cfg->n > divn_max(pll) || cfg->output_rate > pll->params->vco_max)
783 return -EINVAL;
784
785 return 0;
786}
787
788static int _pll_ramp_calc_pll(struct clk_hw *hw,
789 struct tegra_clk_pll_freq_table *cfg,
790 unsigned long rate, unsigned long parent_rate)
791{
792 struct tegra_clk_pll *pll = to_clk_pll(hw);
793 int err = 0;
794
795 err = _get_table_rate(hw, cfg, rate, parent_rate);
796 if (err < 0)
797 err = _calc_dynamic_ramp_rate(hw, cfg, rate, parent_rate);
798 else if (cfg->m != _pll_fixed_mdiv(pll->params, parent_rate)) {
799 WARN_ON(1);
800 err = -EINVAL;
801 goto out;
802 }
803
804 if (!cfg->p || (cfg->p > pll->params->max_p))
805 err = -EINVAL;
806
807out:
808 return err;
809}
810
811static int clk_pllxc_set_rate(struct clk_hw *hw, unsigned long rate,
812 unsigned long parent_rate)
813{
814 struct tegra_clk_pll *pll = to_clk_pll(hw);
815 struct tegra_clk_pll_freq_table cfg, old_cfg;
816 unsigned long flags = 0;
817 int ret = 0;
818 u8 old_p;
819
820 ret = _pll_ramp_calc_pll(hw, &cfg, rate, parent_rate);
821 if (ret < 0)
822 return ret;
823
824 if (pll->lock)
825 spin_lock_irqsave(pll->lock, flags);
826
827 _get_pll_mnp(pll, &old_cfg);
828
829 old_p = pllxc_p[old_cfg.p];
830 if (old_cfg.m != cfg.m || old_cfg.n != cfg.n || old_p != cfg.p) {
831 cfg.p -= 1;
832 ret = _program_pll(hw, &cfg, rate);
833 }
834
835 if (pll->lock)
836 spin_unlock_irqrestore(pll->lock, flags);
837
838 return ret;
839}
840
841static long clk_pll_ramp_round_rate(struct clk_hw *hw, unsigned long rate,
842 unsigned long *prate)
843{
844 struct tegra_clk_pll_freq_table cfg;
845 int ret = 0;
846 u64 output_rate = *prate;
847
848 ret = _pll_ramp_calc_pll(hw, &cfg, rate, *prate);
849 if (ret < 0)
850 return ret;
851
852 output_rate *= cfg.n;
853 do_div(output_rate, cfg.m * cfg.p);
854
855 return output_rate;
856}
857
858static int clk_pllm_set_rate(struct clk_hw *hw, unsigned long rate,
859 unsigned long parent_rate)
860{
861 struct tegra_clk_pll_freq_table cfg;
862 struct tegra_clk_pll *pll = to_clk_pll(hw);
863 unsigned long flags = 0;
864 int state, ret = 0;
865 u32 val;
866
867 if (pll->lock)
868 spin_lock_irqsave(pll->lock, flags);
869
870 state = clk_pll_is_enabled(hw);
871 if (state) {
872 if (rate != clk_get_rate(hw->clk)) {
873 pr_err("%s: Cannot change active PLLM\n", __func__);
874 ret = -EINVAL;
875 goto out;
876 }
877 goto out;
878 }
879
880 ret = _pll_ramp_calc_pll(hw, &cfg, rate, parent_rate);
881 if (ret < 0)
882 goto out;
883
884 cfg.p -= 1;
885
886 val = readl_relaxed(pll->pmc + PMC_PLLM_WB0_OVERRIDE);
887 if (val & PMC_PLLP_WB0_OVERRIDE_PLLM_OVERRIDE) {
888 val = readl_relaxed(pll->pmc + PMC_PLLM_WB0_OVERRIDE_2);
889 val = cfg.p ? (val | PMC_PLLM_WB0_OVERRIDE_2_DIVP_MASK) :
890 (val & ~PMC_PLLM_WB0_OVERRIDE_2_DIVP_MASK);
891 writel_relaxed(val, pll->pmc + PMC_PLLM_WB0_OVERRIDE_2);
892
893 val = readl_relaxed(pll->pmc + PMC_PLLM_WB0_OVERRIDE);
894 val &= ~(divn_mask(pll) | divm_mask(pll));
895 val |= (cfg.m << pll->divm_shift) | (cfg.n << pll->divn_shift);
896 writel_relaxed(val, pll->pmc + PMC_PLLM_WB0_OVERRIDE);
897 } else
898 _update_pll_mnp(pll, &cfg);
899
900
901out:
902 if (pll->lock)
903 spin_unlock_irqrestore(pll->lock, flags);
904
905 return ret;
906}
907
908static void _pllcx_strobe(struct tegra_clk_pll *pll)
909{
910 u32 val;
911
912 val = pll_readl_misc(pll);
913 val |= PLLCX_MISC_STROBE;
914 pll_writel_misc(val, pll);
915 udelay(2);
916
917 val &= ~PLLCX_MISC_STROBE;
918 pll_writel_misc(val, pll);
919}
920
921static int clk_pllc_enable(struct clk_hw *hw)
922{
923 struct tegra_clk_pll *pll = to_clk_pll(hw);
924 u32 val;
925 int ret = 0;
926 unsigned long flags = 0;
927
928 if (pll->lock)
929 spin_lock_irqsave(pll->lock, flags);
930
931 _clk_pll_enable(hw);
932 udelay(2);
933
934 val = pll_readl_misc(pll);
935 val &= ~PLLCX_MISC_RESET;
936 pll_writel_misc(val, pll);
937 udelay(2);
938
939 _pllcx_strobe(pll);
940
941 ret = clk_pll_wait_for_lock(pll);
942
943 if (pll->lock)
944 spin_unlock_irqrestore(pll->lock, flags);
945
946 return ret;
947}
948
949static void _clk_pllc_disable(struct clk_hw *hw)
950{
951 struct tegra_clk_pll *pll = to_clk_pll(hw);
952 u32 val;
953
954 _clk_pll_disable(hw);
955
956 val = pll_readl_misc(pll);
957 val |= PLLCX_MISC_RESET;
958 pll_writel_misc(val, pll);
959 udelay(2);
960}
961
962static void clk_pllc_disable(struct clk_hw *hw)
963{
964 struct tegra_clk_pll *pll = to_clk_pll(hw);
965 unsigned long flags = 0;
966
967 if (pll->lock)
968 spin_lock_irqsave(pll->lock, flags);
969
970 _clk_pllc_disable(hw);
971
972 if (pll->lock)
973 spin_unlock_irqrestore(pll->lock, flags);
974}
975
976static int _pllcx_update_dynamic_coef(struct tegra_clk_pll *pll,
977 unsigned long input_rate, u32 n)
978{
979 u32 val, n_threshold;
980
981 switch (input_rate) {
982 case 12000000:
983 n_threshold = 70;
984 break;
985 case 13000000:
986 case 26000000:
987 n_threshold = 71;
988 break;
989 case 16800000:
990 n_threshold = 55;
991 break;
992 case 19200000:
993 n_threshold = 48;
994 break;
995 default:
996 pr_err("%s: Unexpected reference rate %lu\n",
997 __func__, input_rate);
998 return -EINVAL;
999 }
1000
1001 val = pll_readl_misc(pll);
1002 val &= ~(PLLCX_MISC_SDM_DIV_MASK | PLLCX_MISC_FILT_DIV_MASK);
1003 val |= n <= n_threshold ?
1004 PLLCX_MISC_DIV_LOW_RANGE : PLLCX_MISC_DIV_HIGH_RANGE;
1005 pll_writel_misc(val, pll);
1006
1007 return 0;
1008}
1009
1010static int clk_pllc_set_rate(struct clk_hw *hw, unsigned long rate,
1011 unsigned long parent_rate)
1012{
1013 struct tegra_clk_pll_freq_table cfg;
1014 struct tegra_clk_pll *pll = to_clk_pll(hw);
1015 unsigned long flags = 0;
1016 int state, ret = 0;
1017 u32 val;
1018 u16 old_m, old_n;
1019 u8 old_p;
1020
1021 if (pll->lock)
1022 spin_lock_irqsave(pll->lock, flags);
1023
1024 ret = _pll_ramp_calc_pll(hw, &cfg, rate, parent_rate);
1025 if (ret < 0)
1026 goto out;
1027
1028 val = pll_readl_base(pll);
1029 old_m = (val >> pll->divm_shift) & (divm_mask(pll));
1030 old_n = (val >> pll->divn_shift) & (divn_mask(pll));
1031 old_p = pllcx_p[(val >> pll->divp_shift) & (divp_mask(pll))];
1032
1033 if (cfg.m != old_m) {
1034 WARN_ON(1);
1035 goto out;
1036 }
1037
1038 if (old_n == cfg.n && old_p == cfg.p)
1039 goto out;
1040
1041 cfg.p -= 1;
1042
1043 state = clk_pll_is_enabled(hw);
1044 if (state)
1045 _clk_pllc_disable(hw);
1046
1047 ret = _pllcx_update_dynamic_coef(pll, parent_rate, cfg.n);
1048 if (ret < 0)
1049 goto out;
1050
1051 _update_pll_mnp(pll, &cfg);
1052
1053 if (state)
1054 ret = clk_pllc_enable(hw);
1055
1056out:
1057 if (pll->lock)
1058 spin_unlock_irqrestore(pll->lock, flags);
1059
1060 return ret;
1061}
1062
1063static long _pllre_calc_rate(struct tegra_clk_pll *pll,
1064 struct tegra_clk_pll_freq_table *cfg,
1065 unsigned long rate, unsigned long parent_rate)
1066{
1067 u16 m, n;
1068 u64 output_rate = parent_rate;
1069
1070 m = _pll_fixed_mdiv(pll->params, parent_rate);
1071 n = rate * m / parent_rate;
1072
1073 output_rate *= n;
1074 do_div(output_rate, m);
1075
1076 if (cfg) {
1077 cfg->m = m;
1078 cfg->n = n;
1079 }
1080
1081 return output_rate;
1082}
1083static int clk_pllre_set_rate(struct clk_hw *hw, unsigned long rate,
1084 unsigned long parent_rate)
1085{
1086 struct tegra_clk_pll_freq_table cfg, old_cfg;
1087 struct tegra_clk_pll *pll = to_clk_pll(hw);
1088 unsigned long flags = 0;
1089 int state, ret = 0;
1090
1091 if (pll->lock)
1092 spin_lock_irqsave(pll->lock, flags);
1093
1094 _pllre_calc_rate(pll, &cfg, rate, parent_rate);
1095 _get_pll_mnp(pll, &old_cfg);
1096 cfg.p = old_cfg.p;
1097
1098 if (cfg.m != old_cfg.m || cfg.n != old_cfg.n) {
1099 state = clk_pll_is_enabled(hw);
1100 if (state)
1101 _clk_pll_disable(hw);
1102
1103 _update_pll_mnp(pll, &cfg);
1104
1105 if (state) {
1106 _clk_pll_enable(hw);
1107 ret = clk_pll_wait_for_lock(pll);
1108 }
1109 }
1110
1111 if (pll->lock)
1112 spin_unlock_irqrestore(pll->lock, flags);
1113
1114 return ret;
1115}
1116
1117static unsigned long clk_pllre_recalc_rate(struct clk_hw *hw,
1118 unsigned long parent_rate)
1119{
1120 struct tegra_clk_pll_freq_table cfg;
1121 struct tegra_clk_pll *pll = to_clk_pll(hw);
1122 u64 rate = parent_rate;
1123
1124 _get_pll_mnp(pll, &cfg);
1125
1126 rate *= cfg.n;
1127 do_div(rate, cfg.m);
1128
1129 return rate;
1130}
1131
1132static long clk_pllre_round_rate(struct clk_hw *hw, unsigned long rate,
1133 unsigned long *prate)
1134{
1135 struct tegra_clk_pll *pll = to_clk_pll(hw);
1136
1137 return _pllre_calc_rate(pll, NULL, rate, *prate);
1138}
1139
1140static int clk_plle_tegra114_enable(struct clk_hw *hw)
1141{
1142 struct tegra_clk_pll *pll = to_clk_pll(hw);
1143 struct tegra_clk_pll_freq_table sel;
1144 u32 val;
1145 int ret;
1146 unsigned long flags = 0;
1147 unsigned long input_rate = clk_get_rate(clk_get_parent(hw->clk));
1148
1149 if (_get_table_rate(hw, &sel, pll->fixed_rate, input_rate))
1150 return -EINVAL;
1151
1152 if (pll->lock)
1153 spin_lock_irqsave(pll->lock, flags);
1154
1155 val = pll_readl_base(pll);
1156 val &= ~BIT(29); /* Disable lock override */
1157 pll_writel_base(val, pll);
1158
1159 val = pll_readl(pll->params->aux_reg, pll);
1160 val |= PLLE_AUX_ENABLE_SWCTL;
1161 val &= ~PLLE_AUX_SEQ_ENABLE;
1162 pll_writel(val, pll->params->aux_reg, pll);
1163 udelay(1);
1164
1165 val = pll_readl_misc(pll);
1166 val |= PLLE_MISC_LOCK_ENABLE;
1167 val |= PLLE_MISC_IDDQ_SW_CTRL;
1168 val &= ~PLLE_MISC_IDDQ_SW_VALUE;
1169 val |= PLLE_MISC_PLLE_PTS;
1170 val |= PLLE_MISC_VREG_BG_CTRL_MASK | PLLE_MISC_VREG_CTRL_MASK;
1171 pll_writel_misc(val, pll);
1172 udelay(5);
1173
1174 val = pll_readl(PLLE_SS_CTRL, pll);
1175 val |= PLLE_SS_DISABLE;
1176 pll_writel(val, PLLE_SS_CTRL, pll);
1177
1178 val = pll_readl_base(pll);
1179 val &= ~(divm_mask(pll) | divn_mask(pll) | divp_mask(pll));
1180 val &= ~(PLLE_BASE_DIVCML_WIDTH << PLLE_BASE_DIVCML_SHIFT);
1181 val |= sel.m << pll->divm_shift;
1182 val |= sel.n << pll->divn_shift;
1183 val |= sel.cpcon << PLLE_BASE_DIVCML_SHIFT;
1184 pll_writel_base(val, pll);
1185 udelay(1);
1186
1187 _clk_pll_enable(hw);
1188 ret = clk_pll_wait_for_lock(pll);
1189
1190 if (ret < 0)
1191 goto out;
1192
1193 /* TODO: enable hw control of xusb brick pll */
1194
1195out:
1196 if (pll->lock)
1197 spin_unlock_irqrestore(pll->lock, flags);
1198
1199 return ret;
1200}
1201
1202static void clk_plle_tegra114_disable(struct clk_hw *hw)
1203{
1204 struct tegra_clk_pll *pll = to_clk_pll(hw);
1205 unsigned long flags = 0;
1206 u32 val;
1207
1208 if (pll->lock)
1209 spin_lock_irqsave(pll->lock, flags);
1210
1211 _clk_pll_disable(hw);
1212
1213 val = pll_readl_misc(pll);
1214 val |= PLLE_MISC_IDDQ_SW_CTRL | PLLE_MISC_IDDQ_SW_VALUE;
1215 pll_writel_misc(val, pll);
1216 udelay(1);
1217
1218 if (pll->lock)
1219 spin_unlock_irqrestore(pll->lock, flags);
1220}
1221#endif
1222
1223static struct tegra_clk_pll *_tegra_init_pll(void __iomem *clk_base,
1224 void __iomem *pmc, unsigned long fixed_rate,
1225 struct tegra_clk_pll_params *pll_params, u32 pll_flags,
1226 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock)
587{ 1227{
588 struct tegra_clk_pll *pll; 1228 struct tegra_clk_pll *pll;
589 struct clk *clk;
590 struct clk_init_data init;
591 1229
592 pll = kzalloc(sizeof(*pll), GFP_KERNEL); 1230 pll = kzalloc(sizeof(*pll), GFP_KERNEL);
593 if (!pll) 1231 if (!pll)
594 return ERR_PTR(-ENOMEM); 1232 return ERR_PTR(-ENOMEM);
595 1233
596 init.name = name;
597 init.ops = ops;
598 init.flags = flags;
599 init.parent_names = (parent_name ? &parent_name : NULL);
600 init.num_parents = (parent_name ? 1 : 0);
601
602 pll->clk_base = clk_base; 1234 pll->clk_base = clk_base;
603 pll->pmc = pmc; 1235 pll->pmc = pmc;
604 1236
@@ -615,34 +1247,336 @@ static struct clk *_tegra_clk_register_pll(const char *name,
615 pll->divm_shift = PLL_BASE_DIVM_SHIFT; 1247 pll->divm_shift = PLL_BASE_DIVM_SHIFT;
616 pll->divm_width = PLL_BASE_DIVM_WIDTH; 1248 pll->divm_width = PLL_BASE_DIVM_WIDTH;
617 1249
1250 return pll;
1251}
1252
1253static struct clk *_tegra_clk_register_pll(struct tegra_clk_pll *pll,
1254 const char *name, const char *parent_name, unsigned long flags,
1255 const struct clk_ops *ops)
1256{
1257 struct clk_init_data init;
1258
1259 init.name = name;
1260 init.ops = ops;
1261 init.flags = flags;
1262 init.parent_names = (parent_name ? &parent_name : NULL);
1263 init.num_parents = (parent_name ? 1 : 0);
1264
618 /* Data in .init is copied by clk_register(), so stack variable OK */ 1265 /* Data in .init is copied by clk_register(), so stack variable OK */
619 pll->hw.init = &init; 1266 pll->hw.init = &init;
620 1267
621 clk = clk_register(NULL, &pll->hw); 1268 return clk_register(NULL, &pll->hw);
622 if (IS_ERR(clk))
623 kfree(pll);
624
625 return clk;
626} 1269}
627 1270
628struct clk *tegra_clk_register_pll(const char *name, const char *parent_name, 1271struct clk *tegra_clk_register_pll(const char *name, const char *parent_name,
629 void __iomem *clk_base, void __iomem *pmc, 1272 void __iomem *clk_base, void __iomem *pmc,
630 unsigned long flags, unsigned long fixed_rate, 1273 unsigned long flags, unsigned long fixed_rate,
631 struct tegra_clk_pll_params *pll_params, u8 pll_flags, 1274 struct tegra_clk_pll_params *pll_params, u32 pll_flags,
632 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock) 1275 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock)
633{ 1276{
634 return _tegra_clk_register_pll(name, parent_name, clk_base, pmc, 1277 struct tegra_clk_pll *pll;
635 flags, fixed_rate, pll_params, pll_flags, freq_table, 1278 struct clk *clk;
636 lock, &tegra_clk_pll_ops); 1279
1280 pll_flags |= TEGRA_PLL_BYPASS;
1281 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1282 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags,
1283 freq_table, lock);
1284 if (IS_ERR(pll))
1285 return ERR_CAST(pll);
1286
1287 clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
1288 &tegra_clk_pll_ops);
1289 if (IS_ERR(clk))
1290 kfree(pll);
1291
1292 return clk;
637} 1293}
638 1294
639struct clk *tegra_clk_register_plle(const char *name, const char *parent_name, 1295struct clk *tegra_clk_register_plle(const char *name, const char *parent_name,
640 void __iomem *clk_base, void __iomem *pmc, 1296 void __iomem *clk_base, void __iomem *pmc,
641 unsigned long flags, unsigned long fixed_rate, 1297 unsigned long flags, unsigned long fixed_rate,
642 struct tegra_clk_pll_params *pll_params, u8 pll_flags, 1298 struct tegra_clk_pll_params *pll_params, u32 pll_flags,
643 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock) 1299 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock)
644{ 1300{
645 return _tegra_clk_register_pll(name, parent_name, clk_base, pmc, 1301 struct tegra_clk_pll *pll;
646 flags, fixed_rate, pll_params, pll_flags, freq_table, 1302 struct clk *clk;
647 lock, &tegra_clk_plle_ops); 1303
1304 pll_flags |= TEGRA_PLL_LOCK_MISC | TEGRA_PLL_BYPASS;
1305 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1306 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags,
1307 freq_table, lock);
1308 if (IS_ERR(pll))
1309 return ERR_CAST(pll);
1310
1311 clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
1312 &tegra_clk_plle_ops);
1313 if (IS_ERR(clk))
1314 kfree(pll);
1315
1316 return clk;
1317}
1318
1319#ifdef CONFIG_ARCH_TEGRA_114_SOC
1320const struct clk_ops tegra_clk_pllxc_ops = {
1321 .is_enabled = clk_pll_is_enabled,
1322 .enable = clk_pll_iddq_enable,
1323 .disable = clk_pll_iddq_disable,
1324 .recalc_rate = clk_pll_recalc_rate,
1325 .round_rate = clk_pll_ramp_round_rate,
1326 .set_rate = clk_pllxc_set_rate,
1327};
1328
1329const struct clk_ops tegra_clk_pllm_ops = {
1330 .is_enabled = clk_pll_is_enabled,
1331 .enable = clk_pll_iddq_enable,
1332 .disable = clk_pll_iddq_disable,
1333 .recalc_rate = clk_pll_recalc_rate,
1334 .round_rate = clk_pll_ramp_round_rate,
1335 .set_rate = clk_pllm_set_rate,
1336};
1337
1338const struct clk_ops tegra_clk_pllc_ops = {
1339 .is_enabled = clk_pll_is_enabled,
1340 .enable = clk_pllc_enable,
1341 .disable = clk_pllc_disable,
1342 .recalc_rate = clk_pll_recalc_rate,
1343 .round_rate = clk_pll_ramp_round_rate,
1344 .set_rate = clk_pllc_set_rate,
1345};
1346
1347const struct clk_ops tegra_clk_pllre_ops = {
1348 .is_enabled = clk_pll_is_enabled,
1349 .enable = clk_pll_iddq_enable,
1350 .disable = clk_pll_iddq_disable,
1351 .recalc_rate = clk_pllre_recalc_rate,
1352 .round_rate = clk_pllre_round_rate,
1353 .set_rate = clk_pllre_set_rate,
1354};
1355
1356const struct clk_ops tegra_clk_plle_tegra114_ops = {
1357 .is_enabled = clk_pll_is_enabled,
1358 .enable = clk_plle_tegra114_enable,
1359 .disable = clk_plle_tegra114_disable,
1360 .recalc_rate = clk_pll_recalc_rate,
1361};
1362
1363
1364struct clk *tegra_clk_register_pllxc(const char *name, const char *parent_name,
1365 void __iomem *clk_base, void __iomem *pmc,
1366 unsigned long flags, unsigned long fixed_rate,
1367 struct tegra_clk_pll_params *pll_params,
1368 u32 pll_flags,
1369 struct tegra_clk_pll_freq_table *freq_table,
1370 spinlock_t *lock)
1371{
1372 struct tegra_clk_pll *pll;
1373 struct clk *clk;
1374
1375 if (!pll_params->pdiv_tohw)
1376 return ERR_PTR(-EINVAL);
1377
1378 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1379 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags,
1380 freq_table, lock);
1381 if (IS_ERR(pll))
1382 return ERR_CAST(pll);
1383
1384 clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
1385 &tegra_clk_pllxc_ops);
1386 if (IS_ERR(clk))
1387 kfree(pll);
1388
1389 return clk;
1390}
1391
1392struct clk *tegra_clk_register_pllre(const char *name, const char *parent_name,
1393 void __iomem *clk_base, void __iomem *pmc,
1394 unsigned long flags, unsigned long fixed_rate,
1395 struct tegra_clk_pll_params *pll_params,
1396 u32 pll_flags,
1397 struct tegra_clk_pll_freq_table *freq_table,
1398 spinlock_t *lock, unsigned long parent_rate)
1399{
1400 u32 val;
1401 struct tegra_clk_pll *pll;
1402 struct clk *clk;
1403
1404 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1405 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags,
1406 freq_table, lock);
1407 if (IS_ERR(pll))
1408 return ERR_CAST(pll);
1409
1410 /* program minimum rate by default */
1411
1412 val = pll_readl_base(pll);
1413 if (val & PLL_BASE_ENABLE)
1414 WARN_ON(val & pll_params->iddq_bit_idx);
1415 else {
1416 int m;
1417
1418 m = _pll_fixed_mdiv(pll_params, parent_rate);
1419 val = m << PLL_BASE_DIVM_SHIFT;
1420 val |= (pll_params->vco_min / parent_rate)
1421 << PLL_BASE_DIVN_SHIFT;
1422 pll_writel_base(val, pll);
1423 }
1424
1425 /* disable lock override */
1426
1427 val = pll_readl_misc(pll);
1428 val &= ~BIT(29);
1429 pll_writel_misc(val, pll);
1430
1431 pll_flags |= TEGRA_PLL_LOCK_MISC;
1432 clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
1433 &tegra_clk_pllre_ops);
1434 if (IS_ERR(clk))
1435 kfree(pll);
1436
1437 return clk;
1438}
1439
1440struct clk *tegra_clk_register_pllm(const char *name, const char *parent_name,
1441 void __iomem *clk_base, void __iomem *pmc,
1442 unsigned long flags, unsigned long fixed_rate,
1443 struct tegra_clk_pll_params *pll_params,
1444 u32 pll_flags,
1445 struct tegra_clk_pll_freq_table *freq_table,
1446 spinlock_t *lock)
1447{
1448 struct tegra_clk_pll *pll;
1449 struct clk *clk;
1450
1451 if (!pll_params->pdiv_tohw)
1452 return ERR_PTR(-EINVAL);
1453
1454 pll_flags |= TEGRA_PLL_BYPASS;
1455 pll_flags |= TEGRA_PLL_HAS_LOCK_ENABLE;
1456 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags,
1457 freq_table, lock);
1458 if (IS_ERR(pll))
1459 return ERR_CAST(pll);
1460
1461 clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
1462 &tegra_clk_pllm_ops);
1463 if (IS_ERR(clk))
1464 kfree(pll);
1465
1466 return clk;
1467}
1468
1469struct clk *tegra_clk_register_pllc(const char *name, const char *parent_name,
1470 void __iomem *clk_base, void __iomem *pmc,
1471 unsigned long flags, unsigned long fixed_rate,
1472 struct tegra_clk_pll_params *pll_params,
1473 u32 pll_flags,
1474 struct tegra_clk_pll_freq_table *freq_table,
1475 spinlock_t *lock)
1476{
1477 struct clk *parent, *clk;
1478 struct pdiv_map *p_tohw = pll_params->pdiv_tohw;
1479 struct tegra_clk_pll *pll;
1480 struct tegra_clk_pll_freq_table cfg;
1481 unsigned long parent_rate;
1482
1483 if (!p_tohw)
1484 return ERR_PTR(-EINVAL);
1485
1486 parent = __clk_lookup(parent_name);
1487 if (IS_ERR(parent)) {
1488 WARN(1, "parent clk %s of %s must be registered first\n",
1489 name, parent_name);
1490 return ERR_PTR(-EINVAL);
1491 }
1492
1493 pll_flags |= TEGRA_PLL_BYPASS;
1494 pll = _tegra_init_pll(clk_base, pmc, fixed_rate, pll_params, pll_flags,
1495 freq_table, lock);
1496 if (IS_ERR(pll))
1497 return ERR_CAST(pll);
1498
1499 parent_rate = __clk_get_rate(parent);
1500
1501 /*
1502 * Most of PLLC register fields are shadowed, and can not be read
1503 * directly from PLL h/w. Hence, actual PLLC boot state is unknown.
1504 * Initialize PLL to default state: disabled, reset; shadow registers
1505 * loaded with default parameters; dividers are preset for half of
1506 * minimum VCO rate (the latter assured that shadowed divider settings
1507 * are within supported range).
1508 */
1509
1510 cfg.m = _pll_fixed_mdiv(pll_params, parent_rate);
1511 cfg.n = cfg.m * pll_params->vco_min / parent_rate;
1512
1513 while (p_tohw->pdiv) {
1514 if (p_tohw->pdiv == 2) {
1515 cfg.p = p_tohw->hw_val;
1516 break;
1517 }
1518 p_tohw++;
1519 }
1520
1521 if (!p_tohw->pdiv) {
1522 WARN_ON(1);
1523 return ERR_PTR(-EINVAL);
1524 }
1525
1526 pll_writel_base(0, pll);
1527 _update_pll_mnp(pll, &cfg);
1528
1529 pll_writel_misc(PLLCX_MISC_DEFAULT, pll);
1530 pll_writel(PLLCX_MISC1_DEFAULT, pll_params->ext_misc_reg[0], pll);
1531 pll_writel(PLLCX_MISC2_DEFAULT, pll_params->ext_misc_reg[1], pll);
1532 pll_writel(PLLCX_MISC3_DEFAULT, pll_params->ext_misc_reg[2], pll);
1533
1534 _pllcx_update_dynamic_coef(pll, parent_rate, cfg.n);
1535
1536 clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
1537 &tegra_clk_pllc_ops);
1538 if (IS_ERR(clk))
1539 kfree(pll);
1540
1541 return clk;
1542}
1543
1544struct clk *tegra_clk_register_plle_tegra114(const char *name,
1545 const char *parent_name,
1546 void __iomem *clk_base, unsigned long flags,
1547 unsigned long fixed_rate,
1548 struct tegra_clk_pll_params *pll_params,
1549 struct tegra_clk_pll_freq_table *freq_table,
1550 spinlock_t *lock)
1551{
1552 struct tegra_clk_pll *pll;
1553 struct clk *clk;
1554 u32 val, val_aux;
1555
1556 pll = _tegra_init_pll(clk_base, NULL, fixed_rate, pll_params,
1557 TEGRA_PLL_HAS_LOCK_ENABLE, freq_table, lock);
1558 if (IS_ERR(pll))
1559 return ERR_CAST(pll);
1560
1561 /* ensure parent is set to pll_re_vco */
1562
1563 val = pll_readl_base(pll);
1564 val_aux = pll_readl(pll_params->aux_reg, pll);
1565
1566 if (val & PLL_BASE_ENABLE) {
1567 if (!(val_aux & PLLE_AUX_PLLRE_SEL))
1568 WARN(1, "pll_e enabled with unsupported parent %s\n",
1569 (val & PLLE_AUX_PLLP_SEL) ? "pllp_out0" : "pll_ref");
1570 } else {
1571 val_aux |= PLLE_AUX_PLLRE_SEL;
1572 pll_writel(val, pll_params->aux_reg, pll);
1573 }
1574
1575 clk = _tegra_clk_register_pll(pll, name, parent_name, flags,
1576 &tegra_clk_plle_tegra114_ops);
1577 if (IS_ERR(clk))
1578 kfree(pll);
1579
1580 return clk;
648} 1581}
1582#endif
diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
new file mode 100644
index 000000000000..d78e16ee161c
--- /dev/null
+++ b/drivers/clk/tegra/clk-tegra114.c
@@ -0,0 +1,2085 @@
1/*
2 * Copyright (c) 2012, 2013, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <linux/io.h>
18#include <linux/clk.h>
19#include <linux/clk-provider.h>
20#include <linux/clkdev.h>
21#include <linux/of.h>
22#include <linux/of_address.h>
23#include <linux/delay.h>
24#include <linux/clk/tegra.h>
25
26#include "clk.h"
27
28#define RST_DEVICES_L 0x004
29#define RST_DEVICES_H 0x008
30#define RST_DEVICES_U 0x00C
31#define RST_DEVICES_V 0x358
32#define RST_DEVICES_W 0x35C
33#define RST_DEVICES_X 0x28C
34#define RST_DEVICES_SET_L 0x300
35#define RST_DEVICES_CLR_L 0x304
36#define RST_DEVICES_SET_H 0x308
37#define RST_DEVICES_CLR_H 0x30c
38#define RST_DEVICES_SET_U 0x310
39#define RST_DEVICES_CLR_U 0x314
40#define RST_DEVICES_SET_V 0x430
41#define RST_DEVICES_CLR_V 0x434
42#define RST_DEVICES_SET_W 0x438
43#define RST_DEVICES_CLR_W 0x43c
44#define RST_DEVICES_NUM 5
45
46#define CLK_OUT_ENB_L 0x010
47#define CLK_OUT_ENB_H 0x014
48#define CLK_OUT_ENB_U 0x018
49#define CLK_OUT_ENB_V 0x360
50#define CLK_OUT_ENB_W 0x364
51#define CLK_OUT_ENB_X 0x280
52#define CLK_OUT_ENB_SET_L 0x320
53#define CLK_OUT_ENB_CLR_L 0x324
54#define CLK_OUT_ENB_SET_H 0x328
55#define CLK_OUT_ENB_CLR_H 0x32c
56#define CLK_OUT_ENB_SET_U 0x330
57#define CLK_OUT_ENB_CLR_U 0x334
58#define CLK_OUT_ENB_SET_V 0x440
59#define CLK_OUT_ENB_CLR_V 0x444
60#define CLK_OUT_ENB_SET_W 0x448
61#define CLK_OUT_ENB_CLR_W 0x44c
62#define CLK_OUT_ENB_SET_X 0x284
63#define CLK_OUT_ENB_CLR_X 0x288
64#define CLK_OUT_ENB_NUM 6
65
66#define PLLC_BASE 0x80
67#define PLLC_MISC2 0x88
68#define PLLC_MISC 0x8c
69#define PLLC2_BASE 0x4e8
70#define PLLC2_MISC 0x4ec
71#define PLLC3_BASE 0x4fc
72#define PLLC3_MISC 0x500
73#define PLLM_BASE 0x90
74#define PLLM_MISC 0x9c
75#define PLLP_BASE 0xa0
76#define PLLP_MISC 0xac
77#define PLLX_BASE 0xe0
78#define PLLX_MISC 0xe4
79#define PLLX_MISC2 0x514
80#define PLLX_MISC3 0x518
81#define PLLD_BASE 0xd0
82#define PLLD_MISC 0xdc
83#define PLLD2_BASE 0x4b8
84#define PLLD2_MISC 0x4bc
85#define PLLE_BASE 0xe8
86#define PLLE_MISC 0xec
87#define PLLA_BASE 0xb0
88#define PLLA_MISC 0xbc
89#define PLLU_BASE 0xc0
90#define PLLU_MISC 0xcc
91#define PLLRE_BASE 0x4c4
92#define PLLRE_MISC 0x4c8
93
94#define PLL_MISC_LOCK_ENABLE 18
95#define PLLC_MISC_LOCK_ENABLE 24
96#define PLLDU_MISC_LOCK_ENABLE 22
97#define PLLE_MISC_LOCK_ENABLE 9
98#define PLLRE_MISC_LOCK_ENABLE 30
99
100#define PLLC_IDDQ_BIT 26
101#define PLLX_IDDQ_BIT 3
102#define PLLRE_IDDQ_BIT 16
103
104#define PLL_BASE_LOCK BIT(27)
105#define PLLE_MISC_LOCK BIT(11)
106#define PLLRE_MISC_LOCK BIT(24)
107#define PLLCX_BASE_LOCK (BIT(26)|BIT(27))
108
109#define PLLE_AUX 0x48c
110#define PLLC_OUT 0x84
111#define PLLM_OUT 0x94
112#define PLLP_OUTA 0xa4
113#define PLLP_OUTB 0xa8
114#define PLLA_OUT 0xb4
115
116#define AUDIO_SYNC_CLK_I2S0 0x4a0
117#define AUDIO_SYNC_CLK_I2S1 0x4a4
118#define AUDIO_SYNC_CLK_I2S2 0x4a8
119#define AUDIO_SYNC_CLK_I2S3 0x4ac
120#define AUDIO_SYNC_CLK_I2S4 0x4b0
121#define AUDIO_SYNC_CLK_SPDIF 0x4b4
122
123#define AUDIO_SYNC_DOUBLER 0x49c
124
125#define PMC_CLK_OUT_CNTRL 0x1a8
126#define PMC_DPD_PADS_ORIDE 0x1c
127#define PMC_DPD_PADS_ORIDE_BLINK_ENB 20
128#define PMC_CTRL 0
129#define PMC_CTRL_BLINK_ENB 7
130
131#define OSC_CTRL 0x50
132#define OSC_CTRL_OSC_FREQ_SHIFT 28
133#define OSC_CTRL_PLL_REF_DIV_SHIFT 26
134
135#define PLLXC_SW_MAX_P 6
136
137#define CCLKG_BURST_POLICY 0x368
138#define CCLKLP_BURST_POLICY 0x370
139#define SCLK_BURST_POLICY 0x028
140#define SYSTEM_CLK_RATE 0x030
141
142#define UTMIP_PLL_CFG2 0x488
143#define UTMIP_PLL_CFG2_STABLE_COUNT(x) (((x) & 0xffff) << 6)
144#define UTMIP_PLL_CFG2_ACTIVE_DLY_COUNT(x) (((x) & 0x3f) << 18)
145#define UTMIP_PLL_CFG2_FORCE_PD_SAMP_A_POWERDOWN BIT(0)
146#define UTMIP_PLL_CFG2_FORCE_PD_SAMP_B_POWERDOWN BIT(2)
147#define UTMIP_PLL_CFG2_FORCE_PD_SAMP_C_POWERDOWN BIT(4)
148
149#define UTMIP_PLL_CFG1 0x484
150#define UTMIP_PLL_CFG1_ENABLE_DLY_COUNT(x) (((x) & 0x1f) << 6)
151#define UTMIP_PLL_CFG1_XTAL_FREQ_COUNT(x) (((x) & 0xfff) << 0)
152#define UTMIP_PLL_CFG1_FORCE_PLLU_POWERUP BIT(17)
153#define UTMIP_PLL_CFG1_FORCE_PLLU_POWERDOWN BIT(16)
154#define UTMIP_PLL_CFG1_FORCE_PLL_ENABLE_POWERUP BIT(15)
155#define UTMIP_PLL_CFG1_FORCE_PLL_ENABLE_POWERDOWN BIT(14)
156#define UTMIP_PLL_CFG1_FORCE_PLL_ACTIVE_POWERDOWN BIT(12)
157
158#define UTMIPLL_HW_PWRDN_CFG0 0x52c
159#define UTMIPLL_HW_PWRDN_CFG0_SEQ_START_STATE BIT(25)
160#define UTMIPLL_HW_PWRDN_CFG0_SEQ_ENABLE BIT(24)
161#define UTMIPLL_HW_PWRDN_CFG0_USE_LOCKDET BIT(6)
162#define UTMIPLL_HW_PWRDN_CFG0_SEQ_RESET_INPUT_VALUE BIT(5)
163#define UTMIPLL_HW_PWRDN_CFG0_SEQ_IN_SWCTL BIT(4)
164#define UTMIPLL_HW_PWRDN_CFG0_CLK_ENABLE_SWCTL BIT(2)
165#define UTMIPLL_HW_PWRDN_CFG0_IDDQ_OVERRIDE BIT(1)
166#define UTMIPLL_HW_PWRDN_CFG0_IDDQ_SWCTL BIT(0)
167
168#define CLK_SOURCE_I2S0 0x1d8
169#define CLK_SOURCE_I2S1 0x100
170#define CLK_SOURCE_I2S2 0x104
171#define CLK_SOURCE_NDFLASH 0x160
172#define CLK_SOURCE_I2S3 0x3bc
173#define CLK_SOURCE_I2S4 0x3c0
174#define CLK_SOURCE_SPDIF_OUT 0x108
175#define CLK_SOURCE_SPDIF_IN 0x10c
176#define CLK_SOURCE_PWM 0x110
177#define CLK_SOURCE_ADX 0x638
178#define CLK_SOURCE_AMX 0x63c
179#define CLK_SOURCE_HDA 0x428
180#define CLK_SOURCE_HDA2CODEC_2X 0x3e4
181#define CLK_SOURCE_SBC1 0x134
182#define CLK_SOURCE_SBC2 0x118
183#define CLK_SOURCE_SBC3 0x11c
184#define CLK_SOURCE_SBC4 0x1b4
185#define CLK_SOURCE_SBC5 0x3c8
186#define CLK_SOURCE_SBC6 0x3cc
187#define CLK_SOURCE_SATA_OOB 0x420
188#define CLK_SOURCE_SATA 0x424
189#define CLK_SOURCE_NDSPEED 0x3f8
190#define CLK_SOURCE_VFIR 0x168
191#define CLK_SOURCE_SDMMC1 0x150
192#define CLK_SOURCE_SDMMC2 0x154
193#define CLK_SOURCE_SDMMC3 0x1bc
194#define CLK_SOURCE_SDMMC4 0x164
195#define CLK_SOURCE_VDE 0x1c8
196#define CLK_SOURCE_CSITE 0x1d4
197#define CLK_SOURCE_LA 0x1f8
198#define CLK_SOURCE_TRACE 0x634
199#define CLK_SOURCE_OWR 0x1cc
200#define CLK_SOURCE_NOR 0x1d0
201#define CLK_SOURCE_MIPI 0x174
202#define CLK_SOURCE_I2C1 0x124
203#define CLK_SOURCE_I2C2 0x198
204#define CLK_SOURCE_I2C3 0x1b8
205#define CLK_SOURCE_I2C4 0x3c4
206#define CLK_SOURCE_I2C5 0x128
207#define CLK_SOURCE_UARTA 0x178
208#define CLK_SOURCE_UARTB 0x17c
209#define CLK_SOURCE_UARTC 0x1a0
210#define CLK_SOURCE_UARTD 0x1c0
211#define CLK_SOURCE_UARTE 0x1c4
212#define CLK_SOURCE_UARTA_DBG 0x178
213#define CLK_SOURCE_UARTB_DBG 0x17c
214#define CLK_SOURCE_UARTC_DBG 0x1a0
215#define CLK_SOURCE_UARTD_DBG 0x1c0
216#define CLK_SOURCE_UARTE_DBG 0x1c4
217#define CLK_SOURCE_3D 0x158
218#define CLK_SOURCE_2D 0x15c
219#define CLK_SOURCE_VI_SENSOR 0x1a8
220#define CLK_SOURCE_VI 0x148
221#define CLK_SOURCE_EPP 0x16c
222#define CLK_SOURCE_MSENC 0x1f0
223#define CLK_SOURCE_TSEC 0x1f4
224#define CLK_SOURCE_HOST1X 0x180
225#define CLK_SOURCE_HDMI 0x18c
226#define CLK_SOURCE_DISP1 0x138
227#define CLK_SOURCE_DISP2 0x13c
228#define CLK_SOURCE_CILAB 0x614
229#define CLK_SOURCE_CILCD 0x618
230#define CLK_SOURCE_CILE 0x61c
231#define CLK_SOURCE_DSIALP 0x620
232#define CLK_SOURCE_DSIBLP 0x624
233#define CLK_SOURCE_TSENSOR 0x3b8
234#define CLK_SOURCE_D_AUDIO 0x3d0
235#define CLK_SOURCE_DAM0 0x3d8
236#define CLK_SOURCE_DAM1 0x3dc
237#define CLK_SOURCE_DAM2 0x3e0
238#define CLK_SOURCE_ACTMON 0x3e8
239#define CLK_SOURCE_EXTERN1 0x3ec
240#define CLK_SOURCE_EXTERN2 0x3f0
241#define CLK_SOURCE_EXTERN3 0x3f4
242#define CLK_SOURCE_I2CSLOW 0x3fc
243#define CLK_SOURCE_SE 0x42c
244#define CLK_SOURCE_MSELECT 0x3b4
245#define CLK_SOURCE_SOC_THERM 0x644
246#define CLK_SOURCE_XUSB_HOST_SRC 0x600
247#define CLK_SOURCE_XUSB_FALCON_SRC 0x604
248#define CLK_SOURCE_XUSB_FS_SRC 0x608
249#define CLK_SOURCE_XUSB_SS_SRC 0x610
250#define CLK_SOURCE_XUSB_DEV_SRC 0x60c
251#define CLK_SOURCE_EMC 0x19c
252
253static int periph_clk_enb_refcnt[CLK_OUT_ENB_NUM * 32];
254
255static void __iomem *clk_base;
256static void __iomem *pmc_base;
257
258static DEFINE_SPINLOCK(pll_d_lock);
259static DEFINE_SPINLOCK(pll_d2_lock);
260static DEFINE_SPINLOCK(pll_u_lock);
261static DEFINE_SPINLOCK(pll_div_lock);
262static DEFINE_SPINLOCK(pll_re_lock);
263static DEFINE_SPINLOCK(clk_doubler_lock);
264static DEFINE_SPINLOCK(clk_out_lock);
265static DEFINE_SPINLOCK(sysrate_lock);
266
267static struct pdiv_map pllxc_p[] = {
268 { .pdiv = 1, .hw_val = 0 },
269 { .pdiv = 2, .hw_val = 1 },
270 { .pdiv = 3, .hw_val = 2 },
271 { .pdiv = 4, .hw_val = 3 },
272 { .pdiv = 5, .hw_val = 4 },
273 { .pdiv = 6, .hw_val = 5 },
274 { .pdiv = 8, .hw_val = 6 },
275 { .pdiv = 10, .hw_val = 7 },
276 { .pdiv = 12, .hw_val = 8 },
277 { .pdiv = 16, .hw_val = 9 },
278 { .pdiv = 12, .hw_val = 10 },
279 { .pdiv = 16, .hw_val = 11 },
280 { .pdiv = 20, .hw_val = 12 },
281 { .pdiv = 24, .hw_val = 13 },
282 { .pdiv = 32, .hw_val = 14 },
283 { .pdiv = 0, .hw_val = 0 },
284};
285
286static struct tegra_clk_pll_freq_table pll_c_freq_table[] = {
287 { 12000000, 624000000, 104, 0, 2},
288 { 12000000, 600000000, 100, 0, 2},
289 { 13000000, 600000000, 92, 0, 2}, /* actual: 598.0 MHz */
290 { 16800000, 600000000, 71, 0, 2}, /* actual: 596.4 MHz */
291 { 19200000, 600000000, 62, 0, 2}, /* actual: 595.2 MHz */
292 { 26000000, 600000000, 92, 1, 2}, /* actual: 598.0 MHz */
293 { 0, 0, 0, 0, 0, 0 },
294};
295
296static struct tegra_clk_pll_params pll_c_params = {
297 .input_min = 12000000,
298 .input_max = 800000000,
299 .cf_min = 12000000,
300 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */
301 .vco_min = 600000000,
302 .vco_max = 1400000000,
303 .base_reg = PLLC_BASE,
304 .misc_reg = PLLC_MISC,
305 .lock_mask = PLL_BASE_LOCK,
306 .lock_enable_bit_idx = PLLC_MISC_LOCK_ENABLE,
307 .lock_delay = 300,
308 .iddq_reg = PLLC_MISC,
309 .iddq_bit_idx = PLLC_IDDQ_BIT,
310 .max_p = PLLXC_SW_MAX_P,
311 .dyn_ramp_reg = PLLC_MISC2,
312 .stepa_shift = 17,
313 .stepb_shift = 9,
314 .pdiv_tohw = pllxc_p,
315};
316
317static struct pdiv_map pllc_p[] = {
318 { .pdiv = 1, .hw_val = 0 },
319 { .pdiv = 2, .hw_val = 1 },
320 { .pdiv = 4, .hw_val = 3 },
321 { .pdiv = 8, .hw_val = 5 },
322 { .pdiv = 16, .hw_val = 7 },
323 { .pdiv = 0, .hw_val = 0 },
324};
325
326static struct tegra_clk_pll_freq_table pll_cx_freq_table[] = {
327 {12000000, 600000000, 100, 0, 2},
328 {13000000, 600000000, 92, 0, 2}, /* actual: 598.0 MHz */
329 {16800000, 600000000, 71, 0, 2}, /* actual: 596.4 MHz */
330 {19200000, 600000000, 62, 0, 2}, /* actual: 595.2 MHz */
331 {26000000, 600000000, 92, 1, 2}, /* actual: 598.0 MHz */
332 {0, 0, 0, 0, 0, 0},
333};
334
335static struct tegra_clk_pll_params pll_c2_params = {
336 .input_min = 12000000,
337 .input_max = 48000000,
338 .cf_min = 12000000,
339 .cf_max = 19200000,
340 .vco_min = 600000000,
341 .vco_max = 1200000000,
342 .base_reg = PLLC2_BASE,
343 .misc_reg = PLLC2_MISC,
344 .lock_mask = PLL_BASE_LOCK,
345 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
346 .lock_delay = 300,
347 .pdiv_tohw = pllc_p,
348 .ext_misc_reg[0] = 0x4f0,
349 .ext_misc_reg[1] = 0x4f4,
350 .ext_misc_reg[2] = 0x4f8,
351};
352
353static struct tegra_clk_pll_params pll_c3_params = {
354 .input_min = 12000000,
355 .input_max = 48000000,
356 .cf_min = 12000000,
357 .cf_max = 19200000,
358 .vco_min = 600000000,
359 .vco_max = 1200000000,
360 .base_reg = PLLC3_BASE,
361 .misc_reg = PLLC3_MISC,
362 .lock_mask = PLL_BASE_LOCK,
363 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
364 .lock_delay = 300,
365 .pdiv_tohw = pllc_p,
366 .ext_misc_reg[0] = 0x504,
367 .ext_misc_reg[1] = 0x508,
368 .ext_misc_reg[2] = 0x50c,
369};
370
371static struct pdiv_map pllm_p[] = {
372 { .pdiv = 1, .hw_val = 0 },
373 { .pdiv = 2, .hw_val = 1 },
374 { .pdiv = 0, .hw_val = 0 },
375};
376
377static struct tegra_clk_pll_freq_table pll_m_freq_table[] = {
378 {12000000, 800000000, 66, 0, 1}, /* actual: 792.0 MHz */
379 {13000000, 800000000, 61, 0, 1}, /* actual: 793.0 MHz */
380 {16800000, 800000000, 47, 0, 1}, /* actual: 789.6 MHz */
381 {19200000, 800000000, 41, 0, 1}, /* actual: 787.2 MHz */
382 {26000000, 800000000, 61, 1, 1}, /* actual: 793.0 MHz */
383 {0, 0, 0, 0, 0, 0},
384};
385
386static struct tegra_clk_pll_params pll_m_params = {
387 .input_min = 12000000,
388 .input_max = 500000000,
389 .cf_min = 12000000,
390 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */
391 .vco_min = 400000000,
392 .vco_max = 1066000000,
393 .base_reg = PLLM_BASE,
394 .misc_reg = PLLM_MISC,
395 .lock_mask = PLL_BASE_LOCK,
396 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
397 .lock_delay = 300,
398 .max_p = 2,
399 .pdiv_tohw = pllm_p,
400};
401
402static struct tegra_clk_pll_freq_table pll_p_freq_table[] = {
403 {12000000, 216000000, 432, 12, 1, 8},
404 {13000000, 216000000, 432, 13, 1, 8},
405 {16800000, 216000000, 360, 14, 1, 8},
406 {19200000, 216000000, 360, 16, 1, 8},
407 {26000000, 216000000, 432, 26, 1, 8},
408 {0, 0, 0, 0, 0, 0},
409};
410
411static struct tegra_clk_pll_params pll_p_params = {
412 .input_min = 2000000,
413 .input_max = 31000000,
414 .cf_min = 1000000,
415 .cf_max = 6000000,
416 .vco_min = 200000000,
417 .vco_max = 700000000,
418 .base_reg = PLLP_BASE,
419 .misc_reg = PLLP_MISC,
420 .lock_mask = PLL_BASE_LOCK,
421 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
422 .lock_delay = 300,
423};
424
425static struct tegra_clk_pll_freq_table pll_a_freq_table[] = {
426 {9600000, 282240000, 147, 5, 0, 4},
427 {9600000, 368640000, 192, 5, 0, 4},
428 {9600000, 240000000, 200, 8, 0, 8},
429
430 {28800000, 282240000, 245, 25, 0, 8},
431 {28800000, 368640000, 320, 25, 0, 8},
432 {28800000, 240000000, 200, 24, 0, 8},
433 {0, 0, 0, 0, 0, 0},
434};
435
436
437static struct tegra_clk_pll_params pll_a_params = {
438 .input_min = 2000000,
439 .input_max = 31000000,
440 .cf_min = 1000000,
441 .cf_max = 6000000,
442 .vco_min = 200000000,
443 .vco_max = 700000000,
444 .base_reg = PLLA_BASE,
445 .misc_reg = PLLA_MISC,
446 .lock_mask = PLL_BASE_LOCK,
447 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
448 .lock_delay = 300,
449};
450
451static struct tegra_clk_pll_freq_table pll_d_freq_table[] = {
452 {12000000, 216000000, 864, 12, 2, 12},
453 {13000000, 216000000, 864, 13, 2, 12},
454 {16800000, 216000000, 720, 14, 2, 12},
455 {19200000, 216000000, 720, 16, 2, 12},
456 {26000000, 216000000, 864, 26, 2, 12},
457
458 {12000000, 594000000, 594, 12, 0, 12},
459 {13000000, 594000000, 594, 13, 0, 12},
460 {16800000, 594000000, 495, 14, 0, 12},
461 {19200000, 594000000, 495, 16, 0, 12},
462 {26000000, 594000000, 594, 26, 0, 12},
463
464 {12000000, 1000000000, 1000, 12, 0, 12},
465 {13000000, 1000000000, 1000, 13, 0, 12},
466 {19200000, 1000000000, 625, 12, 0, 12},
467 {26000000, 1000000000, 1000, 26, 0, 12},
468
469 {0, 0, 0, 0, 0, 0},
470};
471
472static struct tegra_clk_pll_params pll_d_params = {
473 .input_min = 2000000,
474 .input_max = 40000000,
475 .cf_min = 1000000,
476 .cf_max = 6000000,
477 .vco_min = 500000000,
478 .vco_max = 1000000000,
479 .base_reg = PLLD_BASE,
480 .misc_reg = PLLD_MISC,
481 .lock_mask = PLL_BASE_LOCK,
482 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
483 .lock_delay = 1000,
484};
485
486static struct tegra_clk_pll_params pll_d2_params = {
487 .input_min = 2000000,
488 .input_max = 40000000,
489 .cf_min = 1000000,
490 .cf_max = 6000000,
491 .vco_min = 500000000,
492 .vco_max = 1000000000,
493 .base_reg = PLLD2_BASE,
494 .misc_reg = PLLD2_MISC,
495 .lock_mask = PLL_BASE_LOCK,
496 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
497 .lock_delay = 1000,
498};
499
500static struct pdiv_map pllu_p[] = {
501 { .pdiv = 1, .hw_val = 1 },
502 { .pdiv = 2, .hw_val = 0 },
503 { .pdiv = 0, .hw_val = 0 },
504};
505
506static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
507 {12000000, 480000000, 960, 12, 0, 12},
508 {13000000, 480000000, 960, 13, 0, 12},
509 {16800000, 480000000, 400, 7, 0, 5},
510 {19200000, 480000000, 200, 4, 0, 3},
511 {26000000, 480000000, 960, 26, 0, 12},
512 {0, 0, 0, 0, 0, 0},
513};
514
515static struct tegra_clk_pll_params pll_u_params = {
516 .input_min = 2000000,
517 .input_max = 40000000,
518 .cf_min = 1000000,
519 .cf_max = 6000000,
520 .vco_min = 480000000,
521 .vco_max = 960000000,
522 .base_reg = PLLU_BASE,
523 .misc_reg = PLLU_MISC,
524 .lock_mask = PLL_BASE_LOCK,
525 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
526 .lock_delay = 1000,
527 .pdiv_tohw = pllu_p,
528};
529
530static struct tegra_clk_pll_freq_table pll_x_freq_table[] = {
531 /* 1 GHz */
532 {12000000, 1000000000, 83, 0, 1}, /* actual: 996.0 MHz */
533 {13000000, 1000000000, 76, 0, 1}, /* actual: 988.0 MHz */
534 {16800000, 1000000000, 59, 0, 1}, /* actual: 991.2 MHz */
535 {19200000, 1000000000, 52, 0, 1}, /* actual: 998.4 MHz */
536 {26000000, 1000000000, 76, 1, 1}, /* actual: 988.0 MHz */
537
538 {0, 0, 0, 0, 0, 0},
539};
540
541static struct tegra_clk_pll_params pll_x_params = {
542 .input_min = 12000000,
543 .input_max = 800000000,
544 .cf_min = 12000000,
545 .cf_max = 19200000, /* s/w policy, h/w capability 50 MHz */
546 .vco_min = 700000000,
547 .vco_max = 2400000000U,
548 .base_reg = PLLX_BASE,
549 .misc_reg = PLLX_MISC,
550 .lock_mask = PLL_BASE_LOCK,
551 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
552 .lock_delay = 300,
553 .iddq_reg = PLLX_MISC3,
554 .iddq_bit_idx = PLLX_IDDQ_BIT,
555 .max_p = PLLXC_SW_MAX_P,
556 .dyn_ramp_reg = PLLX_MISC2,
557 .stepa_shift = 16,
558 .stepb_shift = 24,
559 .pdiv_tohw = pllxc_p,
560};
561
562static struct tegra_clk_pll_freq_table pll_e_freq_table[] = {
563 /* PLLE special case: use cpcon field to store cml divider value */
564 {336000000, 100000000, 100, 21, 16, 11},
565 {312000000, 100000000, 200, 26, 24, 13},
566 {0, 0, 0, 0, 0, 0},
567};
568
569static struct tegra_clk_pll_params pll_e_params = {
570 .input_min = 12000000,
571 .input_max = 1000000000,
572 .cf_min = 12000000,
573 .cf_max = 75000000,
574 .vco_min = 1600000000,
575 .vco_max = 2400000000U,
576 .base_reg = PLLE_BASE,
577 .misc_reg = PLLE_MISC,
578 .aux_reg = PLLE_AUX,
579 .lock_mask = PLLE_MISC_LOCK,
580 .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE,
581 .lock_delay = 300,
582};
583
584static struct tegra_clk_pll_params pll_re_vco_params = {
585 .input_min = 12000000,
586 .input_max = 1000000000,
587 .cf_min = 12000000,
588 .cf_max = 19200000, /* s/w policy, h/w capability 38 MHz */
589 .vco_min = 300000000,
590 .vco_max = 600000000,
591 .base_reg = PLLRE_BASE,
592 .misc_reg = PLLRE_MISC,
593 .lock_mask = PLLRE_MISC_LOCK,
594 .lock_enable_bit_idx = PLLRE_MISC_LOCK_ENABLE,
595 .lock_delay = 300,
596 .iddq_reg = PLLRE_MISC,
597 .iddq_bit_idx = PLLRE_IDDQ_BIT,
598};
599
600/* Peripheral clock registers */
601
602static struct tegra_clk_periph_regs periph_l_regs = {
603 .enb_reg = CLK_OUT_ENB_L,
604 .enb_set_reg = CLK_OUT_ENB_SET_L,
605 .enb_clr_reg = CLK_OUT_ENB_CLR_L,
606 .rst_reg = RST_DEVICES_L,
607 .rst_set_reg = RST_DEVICES_SET_L,
608 .rst_clr_reg = RST_DEVICES_CLR_L,
609};
610
611static struct tegra_clk_periph_regs periph_h_regs = {
612 .enb_reg = CLK_OUT_ENB_H,
613 .enb_set_reg = CLK_OUT_ENB_SET_H,
614 .enb_clr_reg = CLK_OUT_ENB_CLR_H,
615 .rst_reg = RST_DEVICES_H,
616 .rst_set_reg = RST_DEVICES_SET_H,
617 .rst_clr_reg = RST_DEVICES_CLR_H,
618};
619
620static struct tegra_clk_periph_regs periph_u_regs = {
621 .enb_reg = CLK_OUT_ENB_U,
622 .enb_set_reg = CLK_OUT_ENB_SET_U,
623 .enb_clr_reg = CLK_OUT_ENB_CLR_U,
624 .rst_reg = RST_DEVICES_U,
625 .rst_set_reg = RST_DEVICES_SET_U,
626 .rst_clr_reg = RST_DEVICES_CLR_U,
627};
628
629static struct tegra_clk_periph_regs periph_v_regs = {
630 .enb_reg = CLK_OUT_ENB_V,
631 .enb_set_reg = CLK_OUT_ENB_SET_V,
632 .enb_clr_reg = CLK_OUT_ENB_CLR_V,
633 .rst_reg = RST_DEVICES_V,
634 .rst_set_reg = RST_DEVICES_SET_V,
635 .rst_clr_reg = RST_DEVICES_CLR_V,
636};
637
638static struct tegra_clk_periph_regs periph_w_regs = {
639 .enb_reg = CLK_OUT_ENB_W,
640 .enb_set_reg = CLK_OUT_ENB_SET_W,
641 .enb_clr_reg = CLK_OUT_ENB_CLR_W,
642 .rst_reg = RST_DEVICES_W,
643 .rst_set_reg = RST_DEVICES_SET_W,
644 .rst_clr_reg = RST_DEVICES_CLR_W,
645};
646
647/* possible OSC frequencies in Hz */
648static unsigned long tegra114_input_freq[] = {
649 [0] = 13000000,
650 [1] = 16800000,
651 [4] = 19200000,
652 [5] = 38400000,
653 [8] = 12000000,
654 [9] = 48000000,
655 [12] = 260000000,
656};
657
658#define MASK(x) (BIT(x) - 1)
659
660#define TEGRA_INIT_DATA_MUX(_name, _con_id, _dev_id, _parents, _offset, \
661 _clk_num, _regs, _gate_flags, _clk_id) \
662 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
663 30, MASK(2), 0, 0, 8, 1, 0, _regs, _clk_num, \
664 periph_clk_enb_refcnt, _gate_flags, _clk_id, \
665 _parents##_idx, 0)
666
667#define TEGRA_INIT_DATA_MUX_FLAGS(_name, _con_id, _dev_id, _parents, _offset,\
668 _clk_num, _regs, _gate_flags, _clk_id, flags)\
669 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
670 30, MASK(2), 0, 0, 8, 1, 0, _regs, _clk_num, \
671 periph_clk_enb_refcnt, _gate_flags, _clk_id, \
672 _parents##_idx, flags)
673
674#define TEGRA_INIT_DATA_MUX8(_name, _con_id, _dev_id, _parents, _offset, \
675 _clk_num, _regs, _gate_flags, _clk_id) \
676 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
677 29, MASK(3), 0, 0, 8, 1, 0, _regs, _clk_num, \
678 periph_clk_enb_refcnt, _gate_flags, _clk_id, \
679 _parents##_idx, 0)
680
681#define TEGRA_INIT_DATA_INT(_name, _con_id, _dev_id, _parents, _offset, \
682 _clk_num, _regs, _gate_flags, _clk_id) \
683 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
684 30, MASK(2), 0, 0, 8, 1, TEGRA_DIVIDER_INT, _regs,\
685 _clk_num, periph_clk_enb_refcnt, _gate_flags, \
686 _clk_id, _parents##_idx, 0)
687
688#define TEGRA_INIT_DATA_INT_FLAGS(_name, _con_id, _dev_id, _parents, _offset,\
689 _clk_num, _regs, _gate_flags, _clk_id, flags)\
690 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
691 30, MASK(2), 0, 0, 8, 1, TEGRA_DIVIDER_INT, _regs,\
692 _clk_num, periph_clk_enb_refcnt, _gate_flags, \
693 _clk_id, _parents##_idx, flags)
694
695#define TEGRA_INIT_DATA_INT8(_name, _con_id, _dev_id, _parents, _offset,\
696 _clk_num, _regs, _gate_flags, _clk_id) \
697 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
698 29, MASK(3), 0, 0, 8, 1, TEGRA_DIVIDER_INT, _regs,\
699 _clk_num, periph_clk_enb_refcnt, _gate_flags, \
700 _clk_id, _parents##_idx, 0)
701
702#define TEGRA_INIT_DATA_UART(_name, _con_id, _dev_id, _parents, _offset,\
703 _clk_num, _regs, _clk_id) \
704 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
705 30, MASK(2), 0, 0, 16, 1, TEGRA_DIVIDER_UART, _regs,\
706 _clk_num, periph_clk_enb_refcnt, 0, _clk_id, \
707 _parents##_idx, 0)
708
709#define TEGRA_INIT_DATA_I2C(_name, _con_id, _dev_id, _parents, _offset,\
710 _clk_num, _regs, _clk_id) \
711 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
712 30, MASK(2), 0, 0, 16, 0, 0, _regs, _clk_num, \
713 periph_clk_enb_refcnt, 0, _clk_id, _parents##_idx, 0)
714
715#define TEGRA_INIT_DATA_NODIV(_name, _con_id, _dev_id, _parents, _offset, \
716 _mux_shift, _mux_mask, _clk_num, _regs, \
717 _gate_flags, _clk_id) \
718 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset,\
719 _mux_shift, _mux_mask, 0, 0, 0, 0, 0, _regs, \
720 _clk_num, periph_clk_enb_refcnt, _gate_flags, \
721 _clk_id, _parents##_idx, 0)
722
723#define TEGRA_INIT_DATA_XUSB(_name, _con_id, _dev_id, _parents, _offset, \
724 _clk_num, _regs, _gate_flags, _clk_id) \
725 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parents, _offset, \
726 29, MASK(3), 0, 0, 8, 1, TEGRA_DIVIDER_INT, _regs, \
727 _clk_num, periph_clk_enb_refcnt, _gate_flags, \
728 _clk_id, _parents##_idx, 0)
729
730#define TEGRA_INIT_DATA_AUDIO(_name, _con_id, _dev_id, _offset, _clk_num,\
731 _regs, _gate_flags, _clk_id) \
732 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, mux_d_audio_clk, \
733 _offset, 16, 0xE01F, 0, 0, 8, 1, 0, _regs, _clk_num, \
734 periph_clk_enb_refcnt, _gate_flags , _clk_id, \
735 mux_d_audio_clk_idx, 0)
736
737enum tegra114_clk {
738 rtc = 4, timer = 5, uarta = 6, sdmmc2 = 9, i2s1 = 11, i2c1 = 12,
739 ndflash = 13, sdmmc1 = 14, sdmmc4 = 15, pwm = 17, i2s2 = 18, epp = 19,
740 gr_2d = 21, usbd = 22, isp = 23, gr_3d = 24, disp2 = 26, disp1 = 27,
741 host1x = 28, vcp = 29, i2s0 = 30, apbdma = 34, kbc = 36, kfuse = 40,
742 sbc1 = 41, nor = 42, sbc2 = 44, sbc3 = 46, i2c5 = 47, dsia = 48,
743 mipi = 50, hdmi = 51, csi = 52, i2c2 = 54, uartc = 55, mipi_cal = 56,
744 emc, usb2, usb3, vde = 61, bsea = 62, bsev = 63, uartd = 65,
745 i2c3 = 67, sbc4 = 68, sdmmc3 = 69, owr = 71, csite = 73,
746 la = 76, trace = 77, soc_therm = 78, dtv = 79, ndspeed = 80,
747 i2cslow = 81, dsib = 82, tsec = 83, xusb_host = 89, msenc = 91,
748 csus = 92, mselect = 99, tsensor = 100, i2s3 = 101, i2s4 = 102,
749 i2c4 = 103, sbc5 = 104, sbc6 = 105, d_audio, apbif = 107, dam0, dam1,
750 dam2, hda2codec_2x = 111, audio0_2x = 113, audio1_2x, audio2_2x,
751 audio3_2x, audio4_2x, spdif_2x, actmon = 119, extern1 = 120,
752 extern2 = 121, extern3 = 122, hda = 125, se = 127, hda2hdmi = 128,
753 cilab = 144, cilcd = 145, cile = 146, dsialp = 147, dsiblp = 148,
754 dds = 150, dp2 = 152, amx = 153, adx = 154, xusb_ss = 156, uartb = 192,
755 vfir, spdif_in, spdif_out, vi, vi_sensor, fuse, fuse_burn, clk_32k,
756 clk_m, clk_m_div2, clk_m_div4, pll_ref, pll_c, pll_c_out1, pll_c2,
757 pll_c3, pll_m, pll_m_out1, pll_p, pll_p_out1, pll_p_out2, pll_p_out3,
758 pll_p_out4, pll_a, pll_a_out0, pll_d, pll_d_out0, pll_d2, pll_d2_out0,
759 pll_u, pll_u_480M, pll_u_60M, pll_u_48M, pll_u_12M, pll_x, pll_x_out0,
760 pll_re_vco, pll_re_out, pll_e_out0, spdif_in_sync, i2s0_sync,
761 i2s1_sync, i2s2_sync, i2s3_sync, i2s4_sync, vimclk_sync, audio0,
762 audio1, audio2, audio3, audio4, spdif, clk_out_1, clk_out_2, clk_out_3,
763 blink, xusb_host_src = 252, xusb_falcon_src, xusb_fs_src, xusb_ss_src,
764 xusb_dev_src, xusb_dev, xusb_hs_src, sclk, hclk, pclk, cclk_g, cclk_lp,
765
766 /* Mux clocks */
767
768 audio0_mux = 300, audio1_mux, audio2_mux, audio3_mux, audio4_mux,
769 spdif_mux, clk_out_1_mux, clk_out_2_mux, clk_out_3_mux, dsia_mux,
770 dsib_mux, clk_max,
771};
772
773struct utmi_clk_param {
774 /* Oscillator Frequency in KHz */
775 u32 osc_frequency;
776 /* UTMIP PLL Enable Delay Count */
777 u8 enable_delay_count;
778 /* UTMIP PLL Stable count */
779 u8 stable_count;
780 /* UTMIP PLL Active delay count */
781 u8 active_delay_count;
782 /* UTMIP PLL Xtal frequency count */
783 u8 xtal_freq_count;
784};
785
786static const struct utmi_clk_param utmi_parameters[] = {
787 {.osc_frequency = 13000000, .enable_delay_count = 0x02,
788 .stable_count = 0x33, .active_delay_count = 0x05,
789 .xtal_freq_count = 0x7F},
790 {.osc_frequency = 19200000, .enable_delay_count = 0x03,
791 .stable_count = 0x4B, .active_delay_count = 0x06,
792 .xtal_freq_count = 0xBB},
793 {.osc_frequency = 12000000, .enable_delay_count = 0x02,
794 .stable_count = 0x2F, .active_delay_count = 0x04,
795 .xtal_freq_count = 0x76},
796 {.osc_frequency = 26000000, .enable_delay_count = 0x04,
797 .stable_count = 0x66, .active_delay_count = 0x09,
798 .xtal_freq_count = 0xFE},
799 {.osc_frequency = 16800000, .enable_delay_count = 0x03,
800 .stable_count = 0x41, .active_delay_count = 0x0A,
801 .xtal_freq_count = 0xA4},
802};
803
804/* peripheral mux definitions */
805
806#define MUX_I2S_SPDIF(_id) \
807static const char *mux_pllaout0_##_id##_2x_pllp_clkm[] = { "pll_a_out0", \
808 #_id, "pll_p",\
809 "clk_m"};
810MUX_I2S_SPDIF(audio0)
811MUX_I2S_SPDIF(audio1)
812MUX_I2S_SPDIF(audio2)
813MUX_I2S_SPDIF(audio3)
814MUX_I2S_SPDIF(audio4)
815MUX_I2S_SPDIF(audio)
816
817#define mux_pllaout0_audio0_2x_pllp_clkm_idx NULL
818#define mux_pllaout0_audio1_2x_pllp_clkm_idx NULL
819#define mux_pllaout0_audio2_2x_pllp_clkm_idx NULL
820#define mux_pllaout0_audio3_2x_pllp_clkm_idx NULL
821#define mux_pllaout0_audio4_2x_pllp_clkm_idx NULL
822#define mux_pllaout0_audio_2x_pllp_clkm_idx NULL
823
824static const char *mux_pllp_pllc_pllm_clkm[] = {
825 "pll_p", "pll_c", "pll_m", "clk_m"
826};
827#define mux_pllp_pllc_pllm_clkm_idx NULL
828
829static const char *mux_pllp_pllc_pllm[] = { "pll_p", "pll_c", "pll_m" };
830#define mux_pllp_pllc_pllm_idx NULL
831
832static const char *mux_pllp_pllc_clk32_clkm[] = {
833 "pll_p", "pll_c", "clk_32k", "clk_m"
834};
835#define mux_pllp_pllc_clk32_clkm_idx NULL
836
837static const char *mux_plla_pllc_pllp_clkm[] = {
838 "pll_a_out0", "pll_c", "pll_p", "clk_m"
839};
840#define mux_plla_pllc_pllp_clkm_idx mux_pllp_pllc_pllm_clkm_idx
841
842static const char *mux_pllp_pllc2_c_c3_pllm_clkm[] = {
843 "pll_p", "pll_c2", "pll_c", "pll_c3", "pll_m", "clk_m"
844};
845static u32 mux_pllp_pllc2_c_c3_pllm_clkm_idx[] = {
846 [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 6,
847};
848
849static const char *mux_pllp_clkm[] = {
850 "pll_p", "clk_m"
851};
852static u32 mux_pllp_clkm_idx[] = {
853 [0] = 0, [1] = 3,
854};
855
856static const char *mux_pllm_pllc2_c_c3_pllp_plla[] = {
857 "pll_m", "pll_c2", "pll_c", "pll_c3", "pll_p", "pll_a_out0"
858};
859#define mux_pllm_pllc2_c_c3_pllp_plla_idx mux_pllp_pllc2_c_c3_pllm_clkm_idx
860
861static const char *mux_pllp_pllm_plld_plla_pllc_plld2_clkm[] = {
862 "pll_p", "pll_m", "pll_d_out0", "pll_a_out0", "pll_c",
863 "pll_d2_out0", "clk_m"
864};
865#define mux_pllp_pllm_plld_plla_pllc_plld2_clkm_idx NULL
866
867static const char *mux_pllm_pllc_pllp_plla[] = {
868 "pll_m", "pll_c", "pll_p", "pll_a_out0"
869};
870#define mux_pllm_pllc_pllp_plla_idx mux_pllp_pllc_pllm_clkm_idx
871
872static const char *mux_pllp_pllc_clkm[] = {
873 "pll_p", "pll_c", "pll_m"
874};
875static u32 mux_pllp_pllc_clkm_idx[] = {
876 [0] = 0, [1] = 1, [2] = 3,
877};
878
879static const char *mux_pllp_pllc_clkm_clk32[] = {
880 "pll_p", "pll_c", "clk_m", "clk_32k"
881};
882#define mux_pllp_pllc_clkm_clk32_idx NULL
883
884static const char *mux_plla_clk32_pllp_clkm_plle[] = {
885 "pll_a_out0", "clk_32k", "pll_p", "clk_m", "pll_e_out0"
886};
887#define mux_plla_clk32_pllp_clkm_plle_idx NULL
888
889static const char *mux_clkm_pllp_pllc_pllre[] = {
890 "clk_m", "pll_p", "pll_c", "pll_re_out"
891};
892static u32 mux_clkm_pllp_pllc_pllre_idx[] = {
893 [0] = 0, [1] = 1, [2] = 3, [3] = 5,
894};
895
896static const char *mux_clkm_48M_pllp_480M[] = {
897 "clk_m", "pll_u_48M", "pll_p", "pll_u_480M"
898};
899#define mux_clkm_48M_pllp_480M_idx NULL
900
901static const char *mux_clkm_pllre_clk32_480M_pllc_ref[] = {
902 "clk_m", "pll_re_out", "clk_32k", "pll_u_480M", "pll_c", "pll_ref"
903};
904static u32 mux_clkm_pllre_clk32_480M_pllc_ref_idx[] = {
905 [0] = 0, [1] = 1, [2] = 3, [3] = 3, [4] = 4, [5] = 7,
906};
907
908static const char *mux_plld_out0_plld2_out0[] = {
909 "pll_d_out0", "pll_d2_out0",
910};
911#define mux_plld_out0_plld2_out0_idx NULL
912
913static const char *mux_d_audio_clk[] = {
914 "pll_a_out0", "pll_p", "clk_m", "spdif_in_sync", "i2s0_sync",
915 "i2s1_sync", "i2s2_sync", "i2s3_sync", "i2s4_sync", "vimclk_sync",
916};
917static u32 mux_d_audio_clk_idx[] = {
918 [0] = 0, [1] = 0x8000, [2] = 0xc000, [3] = 0xE000, [4] = 0xE001,
919 [5] = 0xE002, [6] = 0xE003, [7] = 0xE004, [8] = 0xE005, [9] = 0xE007,
920};
921
922static const char *mux_pllmcp_clkm[] = {
923 "pll_m_out0", "pll_c_out0", "pll_p_out0", "clk_m", "pll_m_ud",
924};
925
926static const struct clk_div_table pll_re_div_table[] = {
927 { .val = 0, .div = 1 },
928 { .val = 1, .div = 2 },
929 { .val = 2, .div = 3 },
930 { .val = 3, .div = 4 },
931 { .val = 4, .div = 5 },
932 { .val = 5, .div = 6 },
933 { .val = 0, .div = 0 },
934};
935
936static struct clk *clks[clk_max];
937static struct clk_onecell_data clk_data;
938
939static unsigned long osc_freq;
940static unsigned long pll_ref_freq;
941
942static int __init tegra114_osc_clk_init(void __iomem *clk_base)
943{
944 struct clk *clk;
945 u32 val, pll_ref_div;
946
947 val = readl_relaxed(clk_base + OSC_CTRL);
948
949 osc_freq = tegra114_input_freq[val >> OSC_CTRL_OSC_FREQ_SHIFT];
950 if (!osc_freq) {
951 WARN_ON(1);
952 return -EINVAL;
953 }
954
955 /* clk_m */
956 clk = clk_register_fixed_rate(NULL, "clk_m", NULL, CLK_IS_ROOT,
957 osc_freq);
958 clk_register_clkdev(clk, "clk_m", NULL);
959 clks[clk_m] = clk;
960
961 /* pll_ref */
962 val = (val >> OSC_CTRL_PLL_REF_DIV_SHIFT) & 3;
963 pll_ref_div = 1 << val;
964 clk = clk_register_fixed_factor(NULL, "pll_ref", "clk_m",
965 CLK_SET_RATE_PARENT, 1, pll_ref_div);
966 clk_register_clkdev(clk, "pll_ref", NULL);
967 clks[pll_ref] = clk;
968
969 pll_ref_freq = osc_freq / pll_ref_div;
970
971 return 0;
972}
973
974static void __init tegra114_fixed_clk_init(void __iomem *clk_base)
975{
976 struct clk *clk;
977
978 /* clk_32k */
979 clk = clk_register_fixed_rate(NULL, "clk_32k", NULL, CLK_IS_ROOT,
980 32768);
981 clk_register_clkdev(clk, "clk_32k", NULL);
982 clks[clk_32k] = clk;
983
984 /* clk_m_div2 */
985 clk = clk_register_fixed_factor(NULL, "clk_m_div2", "clk_m",
986 CLK_SET_RATE_PARENT, 1, 2);
987 clk_register_clkdev(clk, "clk_m_div2", NULL);
988 clks[clk_m_div2] = clk;
989
990 /* clk_m_div4 */
991 clk = clk_register_fixed_factor(NULL, "clk_m_div4", "clk_m",
992 CLK_SET_RATE_PARENT, 1, 4);
993 clk_register_clkdev(clk, "clk_m_div4", NULL);
994 clks[clk_m_div4] = clk;
995
996}
997
998static __init void tegra114_utmi_param_configure(void __iomem *clk_base)
999{
1000 u32 reg;
1001 int i;
1002
1003 for (i = 0; i < ARRAY_SIZE(utmi_parameters); i++) {
1004 if (osc_freq == utmi_parameters[i].osc_frequency)
1005 break;
1006 }
1007
1008 if (i >= ARRAY_SIZE(utmi_parameters)) {
1009 pr_err("%s: Unexpected oscillator freq %lu\n", __func__,
1010 osc_freq);
1011 return;
1012 }
1013
1014 reg = readl_relaxed(clk_base + UTMIP_PLL_CFG2);
1015
1016 /* Program UTMIP PLL stable and active counts */
1017 /* [FIXME] arclk_rst.h says WRONG! This should be 1ms -> 0x50 Check! */
1018 reg &= ~UTMIP_PLL_CFG2_STABLE_COUNT(~0);
1019 reg |= UTMIP_PLL_CFG2_STABLE_COUNT(utmi_parameters[i].stable_count);
1020
1021 reg &= ~UTMIP_PLL_CFG2_ACTIVE_DLY_COUNT(~0);
1022
1023 reg |= UTMIP_PLL_CFG2_ACTIVE_DLY_COUNT(utmi_parameters[i].
1024 active_delay_count);
1025
1026 /* Remove power downs from UTMIP PLL control bits */
1027 reg &= ~UTMIP_PLL_CFG2_FORCE_PD_SAMP_A_POWERDOWN;
1028 reg &= ~UTMIP_PLL_CFG2_FORCE_PD_SAMP_B_POWERDOWN;
1029 reg &= ~UTMIP_PLL_CFG2_FORCE_PD_SAMP_C_POWERDOWN;
1030
1031 writel_relaxed(reg, clk_base + UTMIP_PLL_CFG2);
1032
1033 /* Program UTMIP PLL delay and oscillator frequency counts */
1034 reg = readl_relaxed(clk_base + UTMIP_PLL_CFG1);
1035 reg &= ~UTMIP_PLL_CFG1_ENABLE_DLY_COUNT(~0);
1036
1037 reg |= UTMIP_PLL_CFG1_ENABLE_DLY_COUNT(utmi_parameters[i].
1038 enable_delay_count);
1039
1040 reg &= ~UTMIP_PLL_CFG1_XTAL_FREQ_COUNT(~0);
1041 reg |= UTMIP_PLL_CFG1_XTAL_FREQ_COUNT(utmi_parameters[i].
1042 xtal_freq_count);
1043
1044 /* Remove power downs from UTMIP PLL control bits */
1045 reg &= ~UTMIP_PLL_CFG1_FORCE_PLL_ENABLE_POWERDOWN;
1046 reg &= ~UTMIP_PLL_CFG1_FORCE_PLL_ACTIVE_POWERDOWN;
1047 reg &= ~UTMIP_PLL_CFG1_FORCE_PLLU_POWERUP;
1048 reg &= ~UTMIP_PLL_CFG1_FORCE_PLLU_POWERDOWN;
1049 writel_relaxed(reg, clk_base + UTMIP_PLL_CFG1);
1050
1051 /* Setup HW control of UTMIPLL */
1052 reg = readl_relaxed(clk_base + UTMIPLL_HW_PWRDN_CFG0);
1053 reg |= UTMIPLL_HW_PWRDN_CFG0_USE_LOCKDET;
1054 reg &= ~UTMIPLL_HW_PWRDN_CFG0_CLK_ENABLE_SWCTL;
1055 reg |= UTMIPLL_HW_PWRDN_CFG0_SEQ_START_STATE;
1056 writel_relaxed(reg, clk_base + UTMIPLL_HW_PWRDN_CFG0);
1057
1058 reg = readl_relaxed(clk_base + UTMIP_PLL_CFG1);
1059 reg &= ~UTMIP_PLL_CFG1_FORCE_PLL_ENABLE_POWERUP;
1060 reg &= ~UTMIP_PLL_CFG1_FORCE_PLL_ENABLE_POWERDOWN;
1061 writel_relaxed(reg, clk_base + UTMIP_PLL_CFG1);
1062
1063 udelay(1);
1064
1065 /* Setup SW override of UTMIPLL assuming USB2.0
1066 ports are assigned to USB2 */
1067 reg = readl_relaxed(clk_base + UTMIPLL_HW_PWRDN_CFG0);
1068 reg |= UTMIPLL_HW_PWRDN_CFG0_IDDQ_SWCTL;
1069 reg &= ~UTMIPLL_HW_PWRDN_CFG0_IDDQ_OVERRIDE;
1070 writel_relaxed(reg, clk_base + UTMIPLL_HW_PWRDN_CFG0);
1071
1072 udelay(1);
1073
1074 /* Enable HW control UTMIPLL */
1075 reg = readl_relaxed(clk_base + UTMIPLL_HW_PWRDN_CFG0);
1076 reg |= UTMIPLL_HW_PWRDN_CFG0_SEQ_ENABLE;
1077 writel_relaxed(reg, clk_base + UTMIPLL_HW_PWRDN_CFG0);
1078}
1079
1080static void __init _clip_vco_min(struct tegra_clk_pll_params *pll_params)
1081{
1082 pll_params->vco_min =
1083 DIV_ROUND_UP(pll_params->vco_min, pll_ref_freq) * pll_ref_freq;
1084}
1085
1086static int __init _setup_dynamic_ramp(struct tegra_clk_pll_params *pll_params,
1087 void __iomem *clk_base)
1088{
1089 u32 val;
1090 u32 step_a, step_b;
1091
1092 switch (pll_ref_freq) {
1093 case 12000000:
1094 case 13000000:
1095 case 26000000:
1096 step_a = 0x2B;
1097 step_b = 0x0B;
1098 break;
1099 case 16800000:
1100 step_a = 0x1A;
1101 step_b = 0x09;
1102 break;
1103 case 19200000:
1104 step_a = 0x12;
1105 step_b = 0x08;
1106 break;
1107 default:
1108 pr_err("%s: Unexpected reference rate %lu\n",
1109 __func__, pll_ref_freq);
1110 WARN_ON(1);
1111 return -EINVAL;
1112 }
1113
1114 val = step_a << pll_params->stepa_shift;
1115 val |= step_b << pll_params->stepb_shift;
1116 writel_relaxed(val, clk_base + pll_params->dyn_ramp_reg);
1117
1118 return 0;
1119}
1120
1121static void __init _init_iddq(struct tegra_clk_pll_params *pll_params,
1122 void __iomem *clk_base)
1123{
1124 u32 val, val_iddq;
1125
1126 val = readl_relaxed(clk_base + pll_params->base_reg);
1127 val_iddq = readl_relaxed(clk_base + pll_params->iddq_reg);
1128
1129 if (val & BIT(30))
1130 WARN_ON(val_iddq & BIT(pll_params->iddq_bit_idx));
1131 else {
1132 val_iddq |= BIT(pll_params->iddq_bit_idx);
1133 writel_relaxed(val_iddq, clk_base + pll_params->iddq_reg);
1134 }
1135}
1136
1137static void __init tegra114_pll_init(void __iomem *clk_base,
1138 void __iomem *pmc)
1139{
1140 u32 val;
1141 struct clk *clk;
1142
1143 /* PLLC */
1144 _clip_vco_min(&pll_c_params);
1145 if (_setup_dynamic_ramp(&pll_c_params, clk_base) >= 0) {
1146 _init_iddq(&pll_c_params, clk_base);
1147 clk = tegra_clk_register_pllxc("pll_c", "pll_ref", clk_base,
1148 pmc, 0, 0, &pll_c_params, TEGRA_PLL_USE_LOCK,
1149 pll_c_freq_table, NULL);
1150 clk_register_clkdev(clk, "pll_c", NULL);
1151 clks[pll_c] = clk;
1152
1153 /* PLLC_OUT1 */
1154 clk = tegra_clk_register_divider("pll_c_out1_div", "pll_c",
1155 clk_base + PLLC_OUT, 0, TEGRA_DIVIDER_ROUND_UP,
1156 8, 8, 1, NULL);
1157 clk = tegra_clk_register_pll_out("pll_c_out1", "pll_c_out1_div",
1158 clk_base + PLLC_OUT, 1, 0,
1159 CLK_SET_RATE_PARENT, 0, NULL);
1160 clk_register_clkdev(clk, "pll_c_out1", NULL);
1161 clks[pll_c_out1] = clk;
1162 }
1163
1164 /* PLLC2 */
1165 _clip_vco_min(&pll_c2_params);
1166 clk = tegra_clk_register_pllc("pll_c2", "pll_ref", clk_base, pmc, 0, 0,
1167 &pll_c2_params, TEGRA_PLL_USE_LOCK,
1168 pll_cx_freq_table, NULL);
1169 clk_register_clkdev(clk, "pll_c2", NULL);
1170 clks[pll_c2] = clk;
1171
1172 /* PLLC3 */
1173 _clip_vco_min(&pll_c3_params);
1174 clk = tegra_clk_register_pllc("pll_c3", "pll_ref", clk_base, pmc, 0, 0,
1175 &pll_c3_params, TEGRA_PLL_USE_LOCK,
1176 pll_cx_freq_table, NULL);
1177 clk_register_clkdev(clk, "pll_c3", NULL);
1178 clks[pll_c3] = clk;
1179
1180 /* PLLP */
1181 clk = tegra_clk_register_pll("pll_p", "pll_ref", clk_base, pmc, 0,
1182 408000000, &pll_p_params,
1183 TEGRA_PLL_FIXED | TEGRA_PLL_USE_LOCK,
1184 pll_p_freq_table, NULL);
1185 clk_register_clkdev(clk, "pll_p", NULL);
1186 clks[pll_p] = clk;
1187
1188 /* PLLP_OUT1 */
1189 clk = tegra_clk_register_divider("pll_p_out1_div", "pll_p",
1190 clk_base + PLLP_OUTA, 0, TEGRA_DIVIDER_FIXED |
1191 TEGRA_DIVIDER_ROUND_UP, 8, 8, 1, &pll_div_lock);
1192 clk = tegra_clk_register_pll_out("pll_p_out1", "pll_p_out1_div",
1193 clk_base + PLLP_OUTA, 1, 0,
1194 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0,
1195 &pll_div_lock);
1196 clk_register_clkdev(clk, "pll_p_out1", NULL);
1197 clks[pll_p_out1] = clk;
1198
1199 /* PLLP_OUT2 */
1200 clk = tegra_clk_register_divider("pll_p_out2_div", "pll_p",
1201 clk_base + PLLP_OUTA, 0, TEGRA_DIVIDER_FIXED |
1202 TEGRA_DIVIDER_ROUND_UP, 24, 8, 1,
1203 &pll_div_lock);
1204 clk = tegra_clk_register_pll_out("pll_p_out2", "pll_p_out2_div",
1205 clk_base + PLLP_OUTA, 17, 16,
1206 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0,
1207 &pll_div_lock);
1208 clk_register_clkdev(clk, "pll_p_out2", NULL);
1209 clks[pll_p_out2] = clk;
1210
1211 /* PLLP_OUT3 */
1212 clk = tegra_clk_register_divider("pll_p_out3_div", "pll_p",
1213 clk_base + PLLP_OUTB, 0, TEGRA_DIVIDER_FIXED |
1214 TEGRA_DIVIDER_ROUND_UP, 8, 8, 1, &pll_div_lock);
1215 clk = tegra_clk_register_pll_out("pll_p_out3", "pll_p_out3_div",
1216 clk_base + PLLP_OUTB, 1, 0,
1217 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0,
1218 &pll_div_lock);
1219 clk_register_clkdev(clk, "pll_p_out3", NULL);
1220 clks[pll_p_out3] = clk;
1221
1222 /* PLLP_OUT4 */
1223 clk = tegra_clk_register_divider("pll_p_out4_div", "pll_p",
1224 clk_base + PLLP_OUTB, 0, TEGRA_DIVIDER_FIXED |
1225 TEGRA_DIVIDER_ROUND_UP, 24, 8, 1,
1226 &pll_div_lock);
1227 clk = tegra_clk_register_pll_out("pll_p_out4", "pll_p_out4_div",
1228 clk_base + PLLP_OUTB, 17, 16,
1229 CLK_IGNORE_UNUSED | CLK_SET_RATE_PARENT, 0,
1230 &pll_div_lock);
1231 clk_register_clkdev(clk, "pll_p_out4", NULL);
1232 clks[pll_p_out4] = clk;
1233
1234 /* PLLM */
1235 _clip_vco_min(&pll_m_params);
1236 clk = tegra_clk_register_pllm("pll_m", "pll_ref", clk_base, pmc,
1237 CLK_IGNORE_UNUSED | CLK_SET_RATE_GATE, 0,
1238 &pll_m_params, TEGRA_PLL_USE_LOCK,
1239 pll_m_freq_table, NULL);
1240 clk_register_clkdev(clk, "pll_m", NULL);
1241 clks[pll_m] = clk;
1242
1243 /* PLLM_OUT1 */
1244 clk = tegra_clk_register_divider("pll_m_out1_div", "pll_m",
1245 clk_base + PLLM_OUT, 0, TEGRA_DIVIDER_ROUND_UP,
1246 8, 8, 1, NULL);
1247 clk = tegra_clk_register_pll_out("pll_m_out1", "pll_m_out1_div",
1248 clk_base + PLLM_OUT, 1, 0, CLK_IGNORE_UNUSED |
1249 CLK_SET_RATE_PARENT, 0, NULL);
1250 clk_register_clkdev(clk, "pll_m_out1", NULL);
1251 clks[pll_m_out1] = clk;
1252
1253 /* PLLM_UD */
1254 clk = clk_register_fixed_factor(NULL, "pll_m_ud", "pll_m",
1255 CLK_SET_RATE_PARENT, 1, 1);
1256
1257 /* PLLX */
1258 _clip_vco_min(&pll_x_params);
1259 if (_setup_dynamic_ramp(&pll_x_params, clk_base) >= 0) {
1260 _init_iddq(&pll_x_params, clk_base);
1261 clk = tegra_clk_register_pllxc("pll_x", "pll_ref", clk_base,
1262 pmc, CLK_IGNORE_UNUSED, 0, &pll_x_params,
1263 TEGRA_PLL_USE_LOCK, pll_x_freq_table, NULL);
1264 clk_register_clkdev(clk, "pll_x", NULL);
1265 clks[pll_x] = clk;
1266 }
1267
1268 /* PLLX_OUT0 */
1269 clk = clk_register_fixed_factor(NULL, "pll_x_out0", "pll_x",
1270 CLK_SET_RATE_PARENT, 1, 2);
1271 clk_register_clkdev(clk, "pll_x_out0", NULL);
1272 clks[pll_x_out0] = clk;
1273
1274 /* PLLU */
1275 val = readl(clk_base + pll_u_params.base_reg);
1276 val &= ~BIT(24); /* disable PLLU_OVERRIDE */
1277 writel(val, clk_base + pll_u_params.base_reg);
1278
1279 clk = tegra_clk_register_pll("pll_u", "pll_ref", clk_base, pmc, 0,
1280 0, &pll_u_params, TEGRA_PLLU |
1281 TEGRA_PLL_HAS_CPCON | TEGRA_PLL_SET_LFCON |
1282 TEGRA_PLL_USE_LOCK, pll_u_freq_table, &pll_u_lock);
1283 clk_register_clkdev(clk, "pll_u", NULL);
1284 clks[pll_u] = clk;
1285
1286 tegra114_utmi_param_configure(clk_base);
1287
1288 /* PLLU_480M */
1289 clk = clk_register_gate(NULL, "pll_u_480M", "pll_u",
1290 CLK_SET_RATE_PARENT, clk_base + PLLU_BASE,
1291 22, 0, &pll_u_lock);
1292 clk_register_clkdev(clk, "pll_u_480M", NULL);
1293 clks[pll_u_480M] = clk;
1294
1295 /* PLLU_60M */
1296 clk = clk_register_fixed_factor(NULL, "pll_u_60M", "pll_u",
1297 CLK_SET_RATE_PARENT, 1, 8);
1298 clk_register_clkdev(clk, "pll_u_60M", NULL);
1299 clks[pll_u_60M] = clk;
1300
1301 /* PLLU_48M */
1302 clk = clk_register_fixed_factor(NULL, "pll_u_48M", "pll_u",
1303 CLK_SET_RATE_PARENT, 1, 10);
1304 clk_register_clkdev(clk, "pll_u_48M", NULL);
1305 clks[pll_u_48M] = clk;
1306
1307 /* PLLU_12M */
1308 clk = clk_register_fixed_factor(NULL, "pll_u_12M", "pll_u",
1309 CLK_SET_RATE_PARENT, 1, 40);
1310 clk_register_clkdev(clk, "pll_u_12M", NULL);
1311 clks[pll_u_12M] = clk;
1312
1313 /* PLLD */
1314 clk = tegra_clk_register_pll("pll_d", "pll_ref", clk_base, pmc, 0,
1315 0, &pll_d_params,
1316 TEGRA_PLL_HAS_CPCON | TEGRA_PLL_SET_LFCON |
1317 TEGRA_PLL_USE_LOCK, pll_d_freq_table, &pll_d_lock);
1318 clk_register_clkdev(clk, "pll_d", NULL);
1319 clks[pll_d] = clk;
1320
1321 /* PLLD_OUT0 */
1322 clk = clk_register_fixed_factor(NULL, "pll_d_out0", "pll_d",
1323 CLK_SET_RATE_PARENT, 1, 2);
1324 clk_register_clkdev(clk, "pll_d_out0", NULL);
1325 clks[pll_d_out0] = clk;
1326
1327 /* PLLD2 */
1328 clk = tegra_clk_register_pll("pll_d2", "pll_ref", clk_base, pmc, 0,
1329 0, &pll_d2_params,
1330 TEGRA_PLL_HAS_CPCON | TEGRA_PLL_SET_LFCON |
1331 TEGRA_PLL_USE_LOCK, pll_d_freq_table, &pll_d2_lock);
1332 clk_register_clkdev(clk, "pll_d2", NULL);
1333 clks[pll_d2] = clk;
1334
1335 /* PLLD2_OUT0 */
1336 clk = clk_register_fixed_factor(NULL, "pll_d2_out0", "pll_d2",
1337 CLK_SET_RATE_PARENT, 1, 2);
1338 clk_register_clkdev(clk, "pll_d2_out0", NULL);
1339 clks[pll_d2_out0] = clk;
1340
1341 /* PLLA */
1342 clk = tegra_clk_register_pll("pll_a", "pll_p_out1", clk_base, pmc, 0,
1343 0, &pll_a_params, TEGRA_PLL_HAS_CPCON |
1344 TEGRA_PLL_USE_LOCK, pll_a_freq_table, NULL);
1345 clk_register_clkdev(clk, "pll_a", NULL);
1346 clks[pll_a] = clk;
1347
1348 /* PLLA_OUT0 */
1349 clk = tegra_clk_register_divider("pll_a_out0_div", "pll_a",
1350 clk_base + PLLA_OUT, 0, TEGRA_DIVIDER_ROUND_UP,
1351 8, 8, 1, NULL);
1352 clk = tegra_clk_register_pll_out("pll_a_out0", "pll_a_out0_div",
1353 clk_base + PLLA_OUT, 1, 0, CLK_IGNORE_UNUSED |
1354 CLK_SET_RATE_PARENT, 0, NULL);
1355 clk_register_clkdev(clk, "pll_a_out0", NULL);
1356 clks[pll_a_out0] = clk;
1357
1358 /* PLLRE */
1359 _clip_vco_min(&pll_re_vco_params);
1360 clk = tegra_clk_register_pllre("pll_re_vco", "pll_ref", clk_base, pmc,
1361 0, 0, &pll_re_vco_params, TEGRA_PLL_USE_LOCK,
1362 NULL, &pll_re_lock, pll_ref_freq);
1363 clk_register_clkdev(clk, "pll_re_vco", NULL);
1364 clks[pll_re_vco] = clk;
1365
1366 clk = clk_register_divider_table(NULL, "pll_re_out", "pll_re_vco", 0,
1367 clk_base + PLLRE_BASE, 16, 4, 0,
1368 pll_re_div_table, &pll_re_lock);
1369 clk_register_clkdev(clk, "pll_re_out", NULL);
1370 clks[pll_re_out] = clk;
1371
1372 /* PLLE */
1373 clk = tegra_clk_register_plle_tegra114("pll_e_out0", "pll_re_vco",
1374 clk_base, 0, 100000000, &pll_e_params,
1375 pll_e_freq_table, NULL);
1376 clk_register_clkdev(clk, "pll_e_out0", NULL);
1377 clks[pll_e_out0] = clk;
1378}
1379
1380static const char *mux_audio_sync_clk[] = { "spdif_in_sync", "i2s0_sync",
1381 "i2s1_sync", "i2s2_sync", "i2s3_sync", "i2s4_sync", "vimclk_sync",
1382};
1383
1384static const char *clk_out1_parents[] = { "clk_m", "clk_m_div2",
1385 "clk_m_div4", "extern1",
1386};
1387
1388static const char *clk_out2_parents[] = { "clk_m", "clk_m_div2",
1389 "clk_m_div4", "extern2",
1390};
1391
1392static const char *clk_out3_parents[] = { "clk_m", "clk_m_div2",
1393 "clk_m_div4", "extern3",
1394};
1395
1396static void __init tegra114_audio_clk_init(void __iomem *clk_base)
1397{
1398 struct clk *clk;
1399
1400 /* spdif_in_sync */
1401 clk = tegra_clk_register_sync_source("spdif_in_sync", 24000000,
1402 24000000);
1403 clk_register_clkdev(clk, "spdif_in_sync", NULL);
1404 clks[spdif_in_sync] = clk;
1405
1406 /* i2s0_sync */
1407 clk = tegra_clk_register_sync_source("i2s0_sync", 24000000, 24000000);
1408 clk_register_clkdev(clk, "i2s0_sync", NULL);
1409 clks[i2s0_sync] = clk;
1410
1411 /* i2s1_sync */
1412 clk = tegra_clk_register_sync_source("i2s1_sync", 24000000, 24000000);
1413 clk_register_clkdev(clk, "i2s1_sync", NULL);
1414 clks[i2s1_sync] = clk;
1415
1416 /* i2s2_sync */
1417 clk = tegra_clk_register_sync_source("i2s2_sync", 24000000, 24000000);
1418 clk_register_clkdev(clk, "i2s2_sync", NULL);
1419 clks[i2s2_sync] = clk;
1420
1421 /* i2s3_sync */
1422 clk = tegra_clk_register_sync_source("i2s3_sync", 24000000, 24000000);
1423 clk_register_clkdev(clk, "i2s3_sync", NULL);
1424 clks[i2s3_sync] = clk;
1425
1426 /* i2s4_sync */
1427 clk = tegra_clk_register_sync_source("i2s4_sync", 24000000, 24000000);
1428 clk_register_clkdev(clk, "i2s4_sync", NULL);
1429 clks[i2s4_sync] = clk;
1430
1431 /* vimclk_sync */
1432 clk = tegra_clk_register_sync_source("vimclk_sync", 24000000, 24000000);
1433 clk_register_clkdev(clk, "vimclk_sync", NULL);
1434 clks[vimclk_sync] = clk;
1435
1436 /* audio0 */
1437 clk = clk_register_mux(NULL, "audio0_mux", mux_audio_sync_clk,
1438 ARRAY_SIZE(mux_audio_sync_clk), 0,
1439 clk_base + AUDIO_SYNC_CLK_I2S0, 0, 3, 0,
1440 NULL);
1441 clks[audio0_mux] = clk;
1442 clk = clk_register_gate(NULL, "audio0", "audio0_mux", 0,
1443 clk_base + AUDIO_SYNC_CLK_I2S0, 4,
1444 CLK_GATE_SET_TO_DISABLE, NULL);
1445 clk_register_clkdev(clk, "audio0", NULL);
1446 clks[audio0] = clk;
1447
1448 /* audio1 */
1449 clk = clk_register_mux(NULL, "audio1_mux", mux_audio_sync_clk,
1450 ARRAY_SIZE(mux_audio_sync_clk), 0,
1451 clk_base + AUDIO_SYNC_CLK_I2S1, 0, 3, 0,
1452 NULL);
1453 clks[audio1_mux] = clk;
1454 clk = clk_register_gate(NULL, "audio1", "audio1_mux", 0,
1455 clk_base + AUDIO_SYNC_CLK_I2S1, 4,
1456 CLK_GATE_SET_TO_DISABLE, NULL);
1457 clk_register_clkdev(clk, "audio1", NULL);
1458 clks[audio1] = clk;
1459
1460 /* audio2 */
1461 clk = clk_register_mux(NULL, "audio2_mux", mux_audio_sync_clk,
1462 ARRAY_SIZE(mux_audio_sync_clk), 0,
1463 clk_base + AUDIO_SYNC_CLK_I2S2, 0, 3, 0,
1464 NULL);
1465 clks[audio2_mux] = clk;
1466 clk = clk_register_gate(NULL, "audio2", "audio2_mux", 0,
1467 clk_base + AUDIO_SYNC_CLK_I2S2, 4,
1468 CLK_GATE_SET_TO_DISABLE, NULL);
1469 clk_register_clkdev(clk, "audio2", NULL);
1470 clks[audio2] = clk;
1471
1472 /* audio3 */
1473 clk = clk_register_mux(NULL, "audio3_mux", mux_audio_sync_clk,
1474 ARRAY_SIZE(mux_audio_sync_clk), 0,
1475 clk_base + AUDIO_SYNC_CLK_I2S3, 0, 3, 0,
1476 NULL);
1477 clks[audio3_mux] = clk;
1478 clk = clk_register_gate(NULL, "audio3", "audio3_mux", 0,
1479 clk_base + AUDIO_SYNC_CLK_I2S3, 4,
1480 CLK_GATE_SET_TO_DISABLE, NULL);
1481 clk_register_clkdev(clk, "audio3", NULL);
1482 clks[audio3] = clk;
1483
1484 /* audio4 */
1485 clk = clk_register_mux(NULL, "audio4_mux", mux_audio_sync_clk,
1486 ARRAY_SIZE(mux_audio_sync_clk), 0,
1487 clk_base + AUDIO_SYNC_CLK_I2S4, 0, 3, 0,
1488 NULL);
1489 clks[audio4_mux] = clk;
1490 clk = clk_register_gate(NULL, "audio4", "audio4_mux", 0,
1491 clk_base + AUDIO_SYNC_CLK_I2S4, 4,
1492 CLK_GATE_SET_TO_DISABLE, NULL);
1493 clk_register_clkdev(clk, "audio4", NULL);
1494 clks[audio4] = clk;
1495
1496 /* spdif */
1497 clk = clk_register_mux(NULL, "spdif_mux", mux_audio_sync_clk,
1498 ARRAY_SIZE(mux_audio_sync_clk), 0,
1499 clk_base + AUDIO_SYNC_CLK_SPDIF, 0, 3, 0,
1500 NULL);
1501 clks[spdif_mux] = clk;
1502 clk = clk_register_gate(NULL, "spdif", "spdif_mux", 0,
1503 clk_base + AUDIO_SYNC_CLK_SPDIF, 4,
1504 CLK_GATE_SET_TO_DISABLE, NULL);
1505 clk_register_clkdev(clk, "spdif", NULL);
1506 clks[spdif] = clk;
1507
1508 /* audio0_2x */
1509 clk = clk_register_fixed_factor(NULL, "audio0_doubler", "audio0",
1510 CLK_SET_RATE_PARENT, 2, 1);
1511 clk = tegra_clk_register_divider("audio0_div", "audio0_doubler",
1512 clk_base + AUDIO_SYNC_DOUBLER, 0, 0, 24, 1,
1513 0, &clk_doubler_lock);
1514 clk = tegra_clk_register_periph_gate("audio0_2x", "audio0_div",
1515 TEGRA_PERIPH_NO_RESET, clk_base,
1516 CLK_SET_RATE_PARENT, 113, &periph_v_regs,
1517 periph_clk_enb_refcnt);
1518 clk_register_clkdev(clk, "audio0_2x", NULL);
1519 clks[audio0_2x] = clk;
1520
1521 /* audio1_2x */
1522 clk = clk_register_fixed_factor(NULL, "audio1_doubler", "audio1",
1523 CLK_SET_RATE_PARENT, 2, 1);
1524 clk = tegra_clk_register_divider("audio1_div", "audio1_doubler",
1525 clk_base + AUDIO_SYNC_DOUBLER, 0, 0, 25, 1,
1526 0, &clk_doubler_lock);
1527 clk = tegra_clk_register_periph_gate("audio1_2x", "audio1_div",
1528 TEGRA_PERIPH_NO_RESET, clk_base,
1529 CLK_SET_RATE_PARENT, 114, &periph_v_regs,
1530 periph_clk_enb_refcnt);
1531 clk_register_clkdev(clk, "audio1_2x", NULL);
1532 clks[audio1_2x] = clk;
1533
1534 /* audio2_2x */
1535 clk = clk_register_fixed_factor(NULL, "audio2_doubler", "audio2",
1536 CLK_SET_RATE_PARENT, 2, 1);
1537 clk = tegra_clk_register_divider("audio2_div", "audio2_doubler",
1538 clk_base + AUDIO_SYNC_DOUBLER, 0, 0, 26, 1,
1539 0, &clk_doubler_lock);
1540 clk = tegra_clk_register_periph_gate("audio2_2x", "audio2_div",
1541 TEGRA_PERIPH_NO_RESET, clk_base,
1542 CLK_SET_RATE_PARENT, 115, &periph_v_regs,
1543 periph_clk_enb_refcnt);
1544 clk_register_clkdev(clk, "audio2_2x", NULL);
1545 clks[audio2_2x] = clk;
1546
1547 /* audio3_2x */
1548 clk = clk_register_fixed_factor(NULL, "audio3_doubler", "audio3",
1549 CLK_SET_RATE_PARENT, 2, 1);
1550 clk = tegra_clk_register_divider("audio3_div", "audio3_doubler",
1551 clk_base + AUDIO_SYNC_DOUBLER, 0, 0, 27, 1,
1552 0, &clk_doubler_lock);
1553 clk = tegra_clk_register_periph_gate("audio3_2x", "audio3_div",
1554 TEGRA_PERIPH_NO_RESET, clk_base,
1555 CLK_SET_RATE_PARENT, 116, &periph_v_regs,
1556 periph_clk_enb_refcnt);
1557 clk_register_clkdev(clk, "audio3_2x", NULL);
1558 clks[audio3_2x] = clk;
1559
1560 /* audio4_2x */
1561 clk = clk_register_fixed_factor(NULL, "audio4_doubler", "audio4",
1562 CLK_SET_RATE_PARENT, 2, 1);
1563 clk = tegra_clk_register_divider("audio4_div", "audio4_doubler",
1564 clk_base + AUDIO_SYNC_DOUBLER, 0, 0, 28, 1,
1565 0, &clk_doubler_lock);
1566 clk = tegra_clk_register_periph_gate("audio4_2x", "audio4_div",
1567 TEGRA_PERIPH_NO_RESET, clk_base,
1568 CLK_SET_RATE_PARENT, 117, &periph_v_regs,
1569 periph_clk_enb_refcnt);
1570 clk_register_clkdev(clk, "audio4_2x", NULL);
1571 clks[audio4_2x] = clk;
1572
1573 /* spdif_2x */
1574 clk = clk_register_fixed_factor(NULL, "spdif_doubler", "spdif",
1575 CLK_SET_RATE_PARENT, 2, 1);
1576 clk = tegra_clk_register_divider("spdif_div", "spdif_doubler",
1577 clk_base + AUDIO_SYNC_DOUBLER, 0, 0, 29, 1,
1578 0, &clk_doubler_lock);
1579 clk = tegra_clk_register_periph_gate("spdif_2x", "spdif_div",
1580 TEGRA_PERIPH_NO_RESET, clk_base,
1581 CLK_SET_RATE_PARENT, 118,
1582 &periph_v_regs, periph_clk_enb_refcnt);
1583 clk_register_clkdev(clk, "spdif_2x", NULL);
1584 clks[spdif_2x] = clk;
1585}
1586
1587static void __init tegra114_pmc_clk_init(void __iomem *pmc_base)
1588{
1589 struct clk *clk;
1590
1591 /* clk_out_1 */
1592 clk = clk_register_mux(NULL, "clk_out_1_mux", clk_out1_parents,
1593 ARRAY_SIZE(clk_out1_parents), 0,
1594 pmc_base + PMC_CLK_OUT_CNTRL, 6, 3, 0,
1595 &clk_out_lock);
1596 clks[clk_out_1_mux] = clk;
1597 clk = clk_register_gate(NULL, "clk_out_1", "clk_out_1_mux", 0,
1598 pmc_base + PMC_CLK_OUT_CNTRL, 2, 0,
1599 &clk_out_lock);
1600 clk_register_clkdev(clk, "extern1", "clk_out_1");
1601 clks[clk_out_1] = clk;
1602
1603 /* clk_out_2 */
1604 clk = clk_register_mux(NULL, "clk_out_2_mux", clk_out2_parents,
1605 ARRAY_SIZE(clk_out1_parents), 0,
1606 pmc_base + PMC_CLK_OUT_CNTRL, 14, 3, 0,
1607 &clk_out_lock);
1608 clks[clk_out_2_mux] = clk;
1609 clk = clk_register_gate(NULL, "clk_out_2", "clk_out_2_mux", 0,
1610 pmc_base + PMC_CLK_OUT_CNTRL, 10, 0,
1611 &clk_out_lock);
1612 clk_register_clkdev(clk, "extern2", "clk_out_2");
1613 clks[clk_out_2] = clk;
1614
1615 /* clk_out_3 */
1616 clk = clk_register_mux(NULL, "clk_out_3_mux", clk_out3_parents,
1617 ARRAY_SIZE(clk_out1_parents), 0,
1618 pmc_base + PMC_CLK_OUT_CNTRL, 22, 3, 0,
1619 &clk_out_lock);
1620 clks[clk_out_3_mux] = clk;
1621 clk = clk_register_gate(NULL, "clk_out_3", "clk_out_3_mux", 0,
1622 pmc_base + PMC_CLK_OUT_CNTRL, 18, 0,
1623 &clk_out_lock);
1624 clk_register_clkdev(clk, "extern3", "clk_out_3");
1625 clks[clk_out_3] = clk;
1626
1627 /* blink */
1628 clk = clk_register_gate(NULL, "blink_override", "clk_32k", 0,
1629 pmc_base + PMC_DPD_PADS_ORIDE,
1630 PMC_DPD_PADS_ORIDE_BLINK_ENB, 0, NULL);
1631 clk = clk_register_gate(NULL, "blink", "blink_override", 0,
1632 pmc_base + PMC_CTRL,
1633 PMC_CTRL_BLINK_ENB, 0, NULL);
1634 clk_register_clkdev(clk, "blink", NULL);
1635 clks[blink] = clk;
1636
1637}
1638
1639static const char *sclk_parents[] = { "clk_m", "pll_c_out1", "pll_p_out4",
1640 "pll_p_out3", "pll_p_out2", "unused",
1641 "clk_32k", "pll_m_out1" };
1642
1643static const char *cclk_g_parents[] = { "clk_m", "pll_c", "clk_32k", "pll_m",
1644 "pll_p", "pll_p_out4", "unused",
1645 "unused", "pll_x" };
1646
1647static const char *cclk_lp_parents[] = { "clk_m", "pll_c", "clk_32k", "pll_m",
1648 "pll_p", "pll_p_out4", "unused",
1649 "unused", "pll_x", "pll_x_out0" };
1650
1651static void __init tegra114_super_clk_init(void __iomem *clk_base)
1652{
1653 struct clk *clk;
1654
1655 /* CCLKG */
1656 clk = tegra_clk_register_super_mux("cclk_g", cclk_g_parents,
1657 ARRAY_SIZE(cclk_g_parents),
1658 CLK_SET_RATE_PARENT,
1659 clk_base + CCLKG_BURST_POLICY,
1660 0, 4, 0, 0, NULL);
1661 clk_register_clkdev(clk, "cclk_g", NULL);
1662 clks[cclk_g] = clk;
1663
1664 /* CCLKLP */
1665 clk = tegra_clk_register_super_mux("cclk_lp", cclk_lp_parents,
1666 ARRAY_SIZE(cclk_lp_parents),
1667 CLK_SET_RATE_PARENT,
1668 clk_base + CCLKLP_BURST_POLICY,
1669 0, 4, 8, 9, NULL);
1670 clk_register_clkdev(clk, "cclk_lp", NULL);
1671 clks[cclk_lp] = clk;
1672
1673 /* SCLK */
1674 clk = tegra_clk_register_super_mux("sclk", sclk_parents,
1675 ARRAY_SIZE(sclk_parents),
1676 CLK_SET_RATE_PARENT,
1677 clk_base + SCLK_BURST_POLICY,
1678 0, 4, 0, 0, NULL);
1679 clk_register_clkdev(clk, "sclk", NULL);
1680 clks[sclk] = clk;
1681
1682 /* HCLK */
1683 clk = clk_register_divider(NULL, "hclk_div", "sclk", 0,
1684 clk_base + SYSTEM_CLK_RATE, 4, 2, 0,
1685 &sysrate_lock);
1686 clk = clk_register_gate(NULL, "hclk", "hclk_div", CLK_SET_RATE_PARENT |
1687 CLK_IGNORE_UNUSED, clk_base + SYSTEM_CLK_RATE,
1688 7, CLK_GATE_SET_TO_DISABLE, &sysrate_lock);
1689 clk_register_clkdev(clk, "hclk", NULL);
1690 clks[hclk] = clk;
1691
1692 /* PCLK */
1693 clk = clk_register_divider(NULL, "pclk_div", "hclk", 0,
1694 clk_base + SYSTEM_CLK_RATE, 0, 2, 0,
1695 &sysrate_lock);
1696 clk = clk_register_gate(NULL, "pclk", "pclk_div", CLK_SET_RATE_PARENT |
1697 CLK_IGNORE_UNUSED, clk_base + SYSTEM_CLK_RATE,
1698 3, CLK_GATE_SET_TO_DISABLE, &sysrate_lock);
1699 clk_register_clkdev(clk, "pclk", NULL);
1700 clks[pclk] = clk;
1701}
1702
1703static struct tegra_periph_init_data tegra_periph_clk_list[] = {
1704 TEGRA_INIT_DATA_MUX("i2s0", NULL, "tegra30-i2s.0", mux_pllaout0_audio0_2x_pllp_clkm, CLK_SOURCE_I2S0, 30, &periph_l_regs, TEGRA_PERIPH_ON_APB, i2s0),
1705 TEGRA_INIT_DATA_MUX("i2s1", NULL, "tegra30-i2s.1", mux_pllaout0_audio1_2x_pllp_clkm, CLK_SOURCE_I2S1, 11, &periph_l_regs, TEGRA_PERIPH_ON_APB, i2s1),
1706 TEGRA_INIT_DATA_MUX("i2s2", NULL, "tegra30-i2s.2", mux_pllaout0_audio2_2x_pllp_clkm, CLK_SOURCE_I2S2, 18, &periph_l_regs, TEGRA_PERIPH_ON_APB, i2s2),
1707 TEGRA_INIT_DATA_MUX("i2s3", NULL, "tegra30-i2s.3", mux_pllaout0_audio3_2x_pllp_clkm, CLK_SOURCE_I2S3, 101, &periph_v_regs, TEGRA_PERIPH_ON_APB, i2s3),
1708 TEGRA_INIT_DATA_MUX("i2s4", NULL, "tegra30-i2s.4", mux_pllaout0_audio4_2x_pllp_clkm, CLK_SOURCE_I2S4, 102, &periph_v_regs, TEGRA_PERIPH_ON_APB, i2s4),
1709 TEGRA_INIT_DATA_MUX("spdif_out", "spdif_out", "tegra30-spdif", mux_pllaout0_audio_2x_pllp_clkm, CLK_SOURCE_SPDIF_OUT, 10, &periph_l_regs, TEGRA_PERIPH_ON_APB, spdif_out),
1710 TEGRA_INIT_DATA_MUX("spdif_in", "spdif_in", "tegra30-spdif", mux_pllp_pllc_pllm, CLK_SOURCE_SPDIF_IN, 10, &periph_l_regs, TEGRA_PERIPH_ON_APB, spdif_in),
1711 TEGRA_INIT_DATA_MUX("pwm", NULL, "pwm", mux_pllp_pllc_clk32_clkm, CLK_SOURCE_PWM, 17, &periph_l_regs, TEGRA_PERIPH_ON_APB, pwm),
1712 TEGRA_INIT_DATA_MUX("adx", NULL, "adx", mux_plla_pllc_pllp_clkm, CLK_SOURCE_ADX, 154, &periph_w_regs, TEGRA_PERIPH_ON_APB, adx),
1713 TEGRA_INIT_DATA_MUX("amx", NULL, "amx", mux_plla_pllc_pllp_clkm, CLK_SOURCE_AMX, 153, &periph_w_regs, TEGRA_PERIPH_ON_APB, amx),
1714 TEGRA_INIT_DATA_MUX("hda", "hda", "tegra30-hda", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_HDA, 125, &periph_v_regs, TEGRA_PERIPH_ON_APB, hda),
1715 TEGRA_INIT_DATA_MUX("hda2codec_2x", "hda2codec", "tegra30-hda", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_HDA2CODEC_2X, 111, &periph_v_regs, TEGRA_PERIPH_ON_APB, hda2codec_2x),
1716 TEGRA_INIT_DATA_MUX("sbc1", NULL, "tegra11-spi.0", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SBC1, 41, &periph_h_regs, TEGRA_PERIPH_ON_APB, sbc1),
1717 TEGRA_INIT_DATA_MUX("sbc2", NULL, "tegra11-spi.1", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SBC2, 44, &periph_h_regs, TEGRA_PERIPH_ON_APB, sbc2),
1718 TEGRA_INIT_DATA_MUX("sbc3", NULL, "tegra11-spi.2", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SBC3, 46, &periph_h_regs, TEGRA_PERIPH_ON_APB, sbc3),
1719 TEGRA_INIT_DATA_MUX("sbc4", NULL, "tegra11-spi.3", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SBC4, 68, &periph_u_regs, TEGRA_PERIPH_ON_APB, sbc4),
1720 TEGRA_INIT_DATA_MUX("sbc5", NULL, "tegra11-spi.4", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SBC5, 104, &periph_v_regs, TEGRA_PERIPH_ON_APB, sbc5),
1721 TEGRA_INIT_DATA_MUX("sbc6", NULL, "tegra11-spi.5", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SBC6, 105, &periph_v_regs, TEGRA_PERIPH_ON_APB, sbc6),
1722 TEGRA_INIT_DATA_MUX8("ndflash", NULL, "tegra_nand", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_NDFLASH, 13, &periph_u_regs, TEGRA_PERIPH_ON_APB, ndspeed),
1723 TEGRA_INIT_DATA_MUX8("ndspeed", NULL, "tegra_nand_speed", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_NDSPEED, 80, &periph_u_regs, TEGRA_PERIPH_ON_APB, ndspeed),
1724 TEGRA_INIT_DATA_MUX("vfir", NULL, "vfir", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_VFIR, 7, &periph_l_regs, TEGRA_PERIPH_ON_APB, vfir),
1725 TEGRA_INIT_DATA_MUX("sdmmc1", NULL, "sdhci-tegra.0", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SDMMC1, 14, &periph_l_regs, 0, sdmmc1),
1726 TEGRA_INIT_DATA_MUX("sdmmc2", NULL, "sdhci-tegra.1", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SDMMC2, 9, &periph_l_regs, 0, sdmmc2),
1727 TEGRA_INIT_DATA_MUX("sdmmc3", NULL, "sdhci-tegra.2", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SDMMC3, 69, &periph_u_regs, 0, sdmmc3),
1728 TEGRA_INIT_DATA_MUX("sdmmc4", NULL, "sdhci-tegra.3", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_SDMMC4, 15, &periph_l_regs, 0, sdmmc4),
1729 TEGRA_INIT_DATA_INT("vde", NULL, "vde", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_VDE, 61, &periph_h_regs, 0, vde),
1730 TEGRA_INIT_DATA_MUX_FLAGS("csite", NULL, "csite", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_CSITE, 73, &periph_u_regs, TEGRA_PERIPH_ON_APB, csite, CLK_IGNORE_UNUSED),
1731 TEGRA_INIT_DATA_MUX("la", NULL, "la", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_LA, 76, &periph_u_regs, TEGRA_PERIPH_ON_APB, la),
1732 TEGRA_INIT_DATA_MUX("trace", NULL, "trace", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_TRACE, 77, &periph_u_regs, TEGRA_PERIPH_ON_APB, trace),
1733 TEGRA_INIT_DATA_MUX("owr", NULL, "tegra_w1", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_OWR, 71, &periph_u_regs, TEGRA_PERIPH_ON_APB, owr),
1734 TEGRA_INIT_DATA_MUX("nor", NULL, "tegra-nor", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_NOR, 42, &periph_h_regs, 0, nor),
1735 TEGRA_INIT_DATA_MUX("mipi", NULL, "mipi", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_MIPI, 50, &periph_h_regs, TEGRA_PERIPH_ON_APB, mipi),
1736 TEGRA_INIT_DATA_I2C("i2c1", "div-clk", "tegra11-i2c.0", mux_pllp_clkm, CLK_SOURCE_I2C1, 12, &periph_l_regs, i2c1),
1737 TEGRA_INIT_DATA_I2C("i2c2", "div-clk", "tegra11-i2c.1", mux_pllp_clkm, CLK_SOURCE_I2C2, 54, &periph_h_regs, i2c2),
1738 TEGRA_INIT_DATA_I2C("i2c3", "div-clk", "tegra11-i2c.2", mux_pllp_clkm, CLK_SOURCE_I2C3, 67, &periph_u_regs, i2c3),
1739 TEGRA_INIT_DATA_I2C("i2c4", "div-clk", "tegra11-i2c.3", mux_pllp_clkm, CLK_SOURCE_I2C4, 103, &periph_v_regs, i2c4),
1740 TEGRA_INIT_DATA_I2C("i2c5", "div-clk", "tegra11-i2c.4", mux_pllp_clkm, CLK_SOURCE_I2C5, 47, &periph_h_regs, i2c5),
1741 TEGRA_INIT_DATA_UART("uarta", NULL, "tegra_uart.0", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_UARTA, 6, &periph_l_regs, uarta),
1742 TEGRA_INIT_DATA_UART("uartb", NULL, "tegra_uart.1", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_UARTB, 7, &periph_l_regs, uartb),
1743 TEGRA_INIT_DATA_UART("uartc", NULL, "tegra_uart.2", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_UARTC, 55, &periph_h_regs, uartc),
1744 TEGRA_INIT_DATA_UART("uartd", NULL, "tegra_uart.3", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_UARTD, 65, &periph_u_regs, uartd),
1745 TEGRA_INIT_DATA_INT("3d", NULL, "3d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_3D, 24, &periph_l_regs, 0, gr_3d),
1746 TEGRA_INIT_DATA_INT("2d", NULL, "2d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_2D, 21, &periph_l_regs, 0, gr_2d),
1747 TEGRA_INIT_DATA_MUX("vi_sensor", "vi_sensor", "tegra_camera", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_VI_SENSOR, 20, &periph_l_regs, TEGRA_PERIPH_NO_RESET, vi_sensor),
1748 TEGRA_INIT_DATA_INT8("vi", "vi", "tegra_camera", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_VI, 20, &periph_l_regs, 0, vi),
1749 TEGRA_INIT_DATA_INT8("epp", NULL, "epp", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_EPP, 19, &periph_l_regs, 0, epp),
1750 TEGRA_INIT_DATA_INT8("msenc", NULL, "msenc", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_MSENC, 91, &periph_h_regs, TEGRA_PERIPH_WAR_1005168, msenc),
1751 TEGRA_INIT_DATA_INT8("tsec", NULL, "tsec", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_TSEC, 83, &periph_u_regs, 0, tsec),
1752 TEGRA_INIT_DATA_INT8("host1x", NULL, "host1x", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_HOST1X, 28, &periph_l_regs, 0, host1x),
1753 TEGRA_INIT_DATA_MUX8("hdmi", NULL, "hdmi", mux_pllp_pllm_plld_plla_pllc_plld2_clkm, CLK_SOURCE_HDMI, 51, &periph_h_regs, 0, hdmi),
1754 TEGRA_INIT_DATA_MUX("cilab", "cilab", "tegra_camera", mux_pllp_pllc_clkm, CLK_SOURCE_CILAB, 144, &periph_w_regs, 0, cilab),
1755 TEGRA_INIT_DATA_MUX("cilcd", "cilcd", "tegra_camera", mux_pllp_pllc_clkm, CLK_SOURCE_CILCD, 145, &periph_w_regs, 0, cilcd),
1756 TEGRA_INIT_DATA_MUX("cile", "cile", "tegra_camera", mux_pllp_pllc_clkm, CLK_SOURCE_CILE, 146, &periph_w_regs, 0, cile),
1757 TEGRA_INIT_DATA_MUX("dsialp", "dsialp", "tegradc.0", mux_pllp_pllc_clkm, CLK_SOURCE_DSIALP, 147, &periph_w_regs, 0, dsialp),
1758 TEGRA_INIT_DATA_MUX("dsiblp", "dsiblp", "tegradc.1", mux_pllp_pllc_clkm, CLK_SOURCE_DSIBLP, 148, &periph_w_regs, 0, dsiblp),
1759 TEGRA_INIT_DATA_MUX("tsensor", NULL, "tegra-tsensor", mux_pllp_pllc_clkm_clk32, CLK_SOURCE_TSENSOR, 100, &periph_v_regs, TEGRA_PERIPH_ON_APB, tsensor),
1760 TEGRA_INIT_DATA_MUX("actmon", NULL, "actmon", mux_pllp_pllc_clk32_clkm, CLK_SOURCE_ACTMON, 119, &periph_v_regs, 0, actmon),
1761 TEGRA_INIT_DATA_MUX8("extern1", NULL, "extern1", mux_plla_clk32_pllp_clkm_plle, CLK_SOURCE_EXTERN1, 120, &periph_v_regs, 0, extern1),
1762 TEGRA_INIT_DATA_MUX8("extern2", NULL, "extern2", mux_plla_clk32_pllp_clkm_plle, CLK_SOURCE_EXTERN2, 121, &periph_v_regs, 0, extern2),
1763 TEGRA_INIT_DATA_MUX8("extern3", NULL, "extern3", mux_plla_clk32_pllp_clkm_plle, CLK_SOURCE_EXTERN3, 122, &periph_v_regs, 0, extern3),
1764 TEGRA_INIT_DATA_MUX("i2cslow", NULL, "i2cslow", mux_pllp_pllc_clk32_clkm, CLK_SOURCE_I2CSLOW, 81, &periph_u_regs, TEGRA_PERIPH_ON_APB, i2cslow),
1765 TEGRA_INIT_DATA_INT8("se", NULL, "se", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_SE, 127, &periph_v_regs, TEGRA_PERIPH_ON_APB, se),
1766 TEGRA_INIT_DATA_INT_FLAGS("mselect", NULL, "mselect", mux_pllp_clkm, CLK_SOURCE_MSELECT, 99, &periph_v_regs, 0, mselect, CLK_IGNORE_UNUSED),
1767 TEGRA_INIT_DATA_MUX8("soc_therm", NULL, "soc_therm", mux_pllm_pllc_pllp_plla, CLK_SOURCE_SOC_THERM, 78, &periph_u_regs, TEGRA_PERIPH_ON_APB, soc_therm),
1768 TEGRA_INIT_DATA_XUSB("xusb_host_src", "host_src", "tegra_xhci", mux_clkm_pllp_pllc_pllre, CLK_SOURCE_XUSB_HOST_SRC, 143, &periph_w_regs, TEGRA_PERIPH_ON_APB | TEGRA_PERIPH_NO_RESET, xusb_host_src),
1769 TEGRA_INIT_DATA_XUSB("xusb_falcon_src", "falcon_src", "tegra_xhci", mux_clkm_pllp_pllc_pllre, CLK_SOURCE_XUSB_FALCON_SRC, 143, &periph_w_regs, TEGRA_PERIPH_NO_RESET, xusb_falcon_src),
1770 TEGRA_INIT_DATA_XUSB("xusb_fs_src", "fs_src", "tegra_xhci", mux_clkm_48M_pllp_480M, CLK_SOURCE_XUSB_FS_SRC, 143, &periph_w_regs, TEGRA_PERIPH_NO_RESET, xusb_fs_src),
1771 TEGRA_INIT_DATA_XUSB("xusb_ss_src", "ss_src", "tegra_xhci", mux_clkm_pllre_clk32_480M_pllc_ref, CLK_SOURCE_XUSB_SS_SRC, 143, &periph_w_regs, TEGRA_PERIPH_NO_RESET, xusb_ss_src),
1772 TEGRA_INIT_DATA_XUSB("xusb_dev_src", "dev_src", "tegra_xhci", mux_clkm_pllp_pllc_pllre, CLK_SOURCE_XUSB_DEV_SRC, 95, &periph_u_regs, TEGRA_PERIPH_ON_APB | TEGRA_PERIPH_NO_RESET, xusb_dev_src),
1773 TEGRA_INIT_DATA_AUDIO("d_audio", "d_audio", "tegra30-ahub", CLK_SOURCE_D_AUDIO, 106, &periph_v_regs, TEGRA_PERIPH_ON_APB, d_audio),
1774 TEGRA_INIT_DATA_AUDIO("dam0", NULL, "tegra30-dam.0", CLK_SOURCE_DAM0, 108, &periph_v_regs, TEGRA_PERIPH_ON_APB, dam0),
1775 TEGRA_INIT_DATA_AUDIO("dam1", NULL, "tegra30-dam.1", CLK_SOURCE_DAM1, 109, &periph_v_regs, TEGRA_PERIPH_ON_APB, dam1),
1776 TEGRA_INIT_DATA_AUDIO("dam2", NULL, "tegra30-dam.2", CLK_SOURCE_DAM2, 110, &periph_v_regs, TEGRA_PERIPH_ON_APB, dam2),
1777};
1778
1779static struct tegra_periph_init_data tegra_periph_nodiv_clk_list[] = {
1780 TEGRA_INIT_DATA_NODIV("disp1", NULL, "tegradc.0", mux_pllp_pllm_plld_plla_pllc_plld2_clkm, CLK_SOURCE_DISP1, 29, 7, 27, &periph_l_regs, 0, disp1),
1781 TEGRA_INIT_DATA_NODIV("disp2", NULL, "tegradc.1", mux_pllp_pllm_plld_plla_pllc_plld2_clkm, CLK_SOURCE_DISP2, 29, 7, 26, &periph_l_regs, 0, disp2),
1782};
1783
1784static __init void tegra114_periph_clk_init(void __iomem *clk_base)
1785{
1786 struct tegra_periph_init_data *data;
1787 struct clk *clk;
1788 int i;
1789 u32 val;
1790
1791 /* apbdma */
1792 clk = tegra_clk_register_periph_gate("apbdma", "clk_m", 0, clk_base,
1793 0, 34, &periph_h_regs,
1794 periph_clk_enb_refcnt);
1795 clks[apbdma] = clk;
1796
1797 /* rtc */
1798 clk = tegra_clk_register_periph_gate("rtc", "clk_32k",
1799 TEGRA_PERIPH_ON_APB |
1800 TEGRA_PERIPH_NO_RESET, clk_base,
1801 0, 4, &periph_l_regs,
1802 periph_clk_enb_refcnt);
1803 clk_register_clkdev(clk, NULL, "rtc-tegra");
1804 clks[rtc] = clk;
1805
1806 /* kbc */
1807 clk = tegra_clk_register_periph_gate("kbc", "clk_32k",
1808 TEGRA_PERIPH_ON_APB |
1809 TEGRA_PERIPH_NO_RESET, clk_base,
1810 0, 36, &periph_h_regs,
1811 periph_clk_enb_refcnt);
1812 clks[kbc] = clk;
1813
1814 /* timer */
1815 clk = tegra_clk_register_periph_gate("timer", "clk_m", 0, clk_base,
1816 0, 5, &periph_l_regs,
1817 periph_clk_enb_refcnt);
1818 clk_register_clkdev(clk, NULL, "timer");
1819 clks[timer] = clk;
1820
1821 /* kfuse */
1822 clk = tegra_clk_register_periph_gate("kfuse", "clk_m",
1823 TEGRA_PERIPH_ON_APB, clk_base, 0, 40,
1824 &periph_h_regs, periph_clk_enb_refcnt);
1825 clks[kfuse] = clk;
1826
1827 /* fuse */
1828 clk = tegra_clk_register_periph_gate("fuse", "clk_m",
1829 TEGRA_PERIPH_ON_APB, clk_base, 0, 39,
1830 &periph_h_regs, periph_clk_enb_refcnt);
1831 clks[fuse] = clk;
1832
1833 /* fuse_burn */
1834 clk = tegra_clk_register_periph_gate("fuse_burn", "clk_m",
1835 TEGRA_PERIPH_ON_APB, clk_base, 0, 39,
1836 &periph_h_regs, periph_clk_enb_refcnt);
1837 clks[fuse_burn] = clk;
1838
1839 /* apbif */
1840 clk = tegra_clk_register_periph_gate("apbif", "clk_m",
1841 TEGRA_PERIPH_ON_APB, clk_base, 0, 107,
1842 &periph_v_regs, periph_clk_enb_refcnt);
1843 clks[apbif] = clk;
1844
1845 /* hda2hdmi */
1846 clk = tegra_clk_register_periph_gate("hda2hdmi", "clk_m",
1847 TEGRA_PERIPH_ON_APB, clk_base, 0, 128,
1848 &periph_w_regs, periph_clk_enb_refcnt);
1849 clks[hda2hdmi] = clk;
1850
1851 /* vcp */
1852 clk = tegra_clk_register_periph_gate("vcp", "clk_m", 0, clk_base, 0,
1853 29, &periph_l_regs,
1854 periph_clk_enb_refcnt);
1855 clks[vcp] = clk;
1856
1857 /* bsea */
1858 clk = tegra_clk_register_periph_gate("bsea", "clk_m", 0, clk_base,
1859 0, 62, &periph_h_regs,
1860 periph_clk_enb_refcnt);
1861 clks[bsea] = clk;
1862
1863 /* bsev */
1864 clk = tegra_clk_register_periph_gate("bsev", "clk_m", 0, clk_base,
1865 0, 63, &periph_h_regs,
1866 periph_clk_enb_refcnt);
1867 clks[bsev] = clk;
1868
1869 /* mipi-cal */
1870 clk = tegra_clk_register_periph_gate("mipi-cal", "clk_m", 0, clk_base,
1871 0, 56, &periph_h_regs,
1872 periph_clk_enb_refcnt);
1873 clks[mipi_cal] = clk;
1874
1875 /* usbd */
1876 clk = tegra_clk_register_periph_gate("usbd", "clk_m", 0, clk_base,
1877 0, 22, &periph_l_regs,
1878 periph_clk_enb_refcnt);
1879 clks[usbd] = clk;
1880
1881 /* usb2 */
1882 clk = tegra_clk_register_periph_gate("usb2", "clk_m", 0, clk_base,
1883 0, 58, &periph_h_regs,
1884 periph_clk_enb_refcnt);
1885 clks[usb2] = clk;
1886
1887 /* usb3 */
1888 clk = tegra_clk_register_periph_gate("usb3", "clk_m", 0, clk_base,
1889 0, 59, &periph_h_regs,
1890 periph_clk_enb_refcnt);
1891 clks[usb3] = clk;
1892
1893 /* csi */
1894 clk = tegra_clk_register_periph_gate("csi", "pll_p_out3", 0, clk_base,
1895 0, 52, &periph_h_regs,
1896 periph_clk_enb_refcnt);
1897 clks[csi] = clk;
1898
1899 /* isp */
1900 clk = tegra_clk_register_periph_gate("isp", "clk_m", 0, clk_base, 0,
1901 23, &periph_l_regs,
1902 periph_clk_enb_refcnt);
1903 clks[isp] = clk;
1904
1905 /* csus */
1906 clk = tegra_clk_register_periph_gate("csus", "clk_m",
1907 TEGRA_PERIPH_NO_RESET, clk_base, 0, 92,
1908 &periph_u_regs, periph_clk_enb_refcnt);
1909 clks[csus] = clk;
1910
1911 /* dds */
1912 clk = tegra_clk_register_periph_gate("dds", "clk_m",
1913 TEGRA_PERIPH_ON_APB, clk_base, 0, 150,
1914 &periph_w_regs, periph_clk_enb_refcnt);
1915 clks[dds] = clk;
1916
1917 /* dp2 */
1918 clk = tegra_clk_register_periph_gate("dp2", "clk_m",
1919 TEGRA_PERIPH_ON_APB, clk_base, 0, 152,
1920 &periph_w_regs, periph_clk_enb_refcnt);
1921 clks[dp2] = clk;
1922
1923 /* dtv */
1924 clk = tegra_clk_register_periph_gate("dtv", "clk_m",
1925 TEGRA_PERIPH_ON_APB, clk_base, 0, 79,
1926 &periph_u_regs, periph_clk_enb_refcnt);
1927 clks[dtv] = clk;
1928
1929 /* dsia */
1930 clk = clk_register_mux(NULL, "dsia_mux", mux_plld_out0_plld2_out0,
1931 ARRAY_SIZE(mux_plld_out0_plld2_out0), 0,
1932 clk_base + PLLD_BASE, 25, 1, 0, &pll_d_lock);
1933 clks[dsia_mux] = clk;
1934 clk = tegra_clk_register_periph_gate("dsia", "dsia_mux", 0, clk_base,
1935 0, 48, &periph_h_regs,
1936 periph_clk_enb_refcnt);
1937 clks[dsia] = clk;
1938
1939 /* dsib */
1940 clk = clk_register_mux(NULL, "dsib_mux", mux_plld_out0_plld2_out0,
1941 ARRAY_SIZE(mux_plld_out0_plld2_out0), 0,
1942 clk_base + PLLD2_BASE, 25, 1, 0, &pll_d2_lock);
1943 clks[dsib_mux] = clk;
1944 clk = tegra_clk_register_periph_gate("dsib", "dsib_mux", 0, clk_base,
1945 0, 82, &periph_u_regs,
1946 periph_clk_enb_refcnt);
1947 clks[dsib] = clk;
1948
1949 /* xusb_hs_src */
1950 val = readl(clk_base + CLK_SOURCE_XUSB_SS_SRC);
1951 val |= BIT(25); /* always select PLLU_60M */
1952 writel(val, clk_base + CLK_SOURCE_XUSB_SS_SRC);
1953
1954 clk = clk_register_fixed_factor(NULL, "xusb_hs_src", "pll_u_60M", 0,
1955 1, 1);
1956 clks[xusb_hs_src] = clk;
1957
1958 /* xusb_host */
1959 clk = tegra_clk_register_periph_gate("xusb_host", "xusb_host_src", 0,
1960 clk_base, 0, 89, &periph_u_regs,
1961 periph_clk_enb_refcnt);
1962 clks[xusb_host] = clk;
1963
1964 /* xusb_ss */
1965 clk = tegra_clk_register_periph_gate("xusb_ss", "xusb_ss_src", 0,
1966 clk_base, 0, 156, &periph_w_regs,
1967 periph_clk_enb_refcnt);
1968 clks[xusb_host] = clk;
1969
1970 /* xusb_dev */
1971 clk = tegra_clk_register_periph_gate("xusb_dev", "xusb_dev_src", 0,
1972 clk_base, 0, 95, &periph_u_regs,
1973 periph_clk_enb_refcnt);
1974 clks[xusb_dev] = clk;
1975
1976 /* emc */
1977 clk = clk_register_mux(NULL, "emc_mux", mux_pllmcp_clkm,
1978 ARRAY_SIZE(mux_pllmcp_clkm), 0,
1979 clk_base + CLK_SOURCE_EMC,
1980 29, 3, 0, NULL);
1981 clk = tegra_clk_register_periph_gate("emc", "emc_mux", 0, clk_base,
1982 CLK_IGNORE_UNUSED, 57, &periph_h_regs,
1983 periph_clk_enb_refcnt);
1984 clks[emc] = clk;
1985
1986 for (i = 0; i < ARRAY_SIZE(tegra_periph_clk_list); i++) {
1987 data = &tegra_periph_clk_list[i];
1988 clk = tegra_clk_register_periph(data->name, data->parent_names,
1989 data->num_parents, &data->periph,
1990 clk_base, data->offset, data->flags);
1991 clks[data->clk_id] = clk;
1992 }
1993
1994 for (i = 0; i < ARRAY_SIZE(tegra_periph_nodiv_clk_list); i++) {
1995 data = &tegra_periph_nodiv_clk_list[i];
1996 clk = tegra_clk_register_periph_nodiv(data->name,
1997 data->parent_names, data->num_parents,
1998 &data->periph, clk_base, data->offset);
1999 clks[data->clk_id] = clk;
2000 }
2001}
2002
2003static struct tegra_cpu_car_ops tegra114_cpu_car_ops;
2004
2005static const struct of_device_id pmc_match[] __initconst = {
2006 { .compatible = "nvidia,tegra114-pmc" },
2007 {},
2008};
2009
2010static __initdata struct tegra_clk_init_table init_table[] = {
2011 {uarta, pll_p, 408000000, 0},
2012 {uartb, pll_p, 408000000, 0},
2013 {uartc, pll_p, 408000000, 0},
2014 {uartd, pll_p, 408000000, 0},
2015 {pll_a, clk_max, 564480000, 1},
2016 {pll_a_out0, clk_max, 11289600, 1},
2017 {extern1, pll_a_out0, 0, 1},
2018 {clk_out_1_mux, extern1, 0, 1},
2019 {clk_out_1, clk_max, 0, 1},
2020 {i2s0, pll_a_out0, 11289600, 0},
2021 {i2s1, pll_a_out0, 11289600, 0},
2022 {i2s2, pll_a_out0, 11289600, 0},
2023 {i2s3, pll_a_out0, 11289600, 0},
2024 {i2s4, pll_a_out0, 11289600, 0},
2025 {clk_max, clk_max, 0, 0}, /* This MUST be the last entry. */
2026};
2027
2028static void __init tegra114_clock_apply_init_table(void)
2029{
2030 tegra_init_from_table(init_table, clks, clk_max);
2031}
2032
2033void __init tegra114_clock_init(struct device_node *np)
2034{
2035 struct device_node *node;
2036 int i;
2037
2038 clk_base = of_iomap(np, 0);
2039 if (!clk_base) {
2040 pr_err("ioremap tegra114 CAR failed\n");
2041 return;
2042 }
2043
2044 node = of_find_matching_node(NULL, pmc_match);
2045 if (!node) {
2046 pr_err("Failed to find pmc node\n");
2047 WARN_ON(1);
2048 return;
2049 }
2050
2051 pmc_base = of_iomap(node, 0);
2052 if (!pmc_base) {
2053 pr_err("Can't map pmc registers\n");
2054 WARN_ON(1);
2055 return;
2056 }
2057
2058 if (tegra114_osc_clk_init(clk_base) < 0)
2059 return;
2060
2061 tegra114_fixed_clk_init(clk_base);
2062 tegra114_pll_init(clk_base, pmc_base);
2063 tegra114_periph_clk_init(clk_base);
2064 tegra114_audio_clk_init(clk_base);
2065 tegra114_pmc_clk_init(pmc_base);
2066 tegra114_super_clk_init(clk_base);
2067
2068 for (i = 0; i < ARRAY_SIZE(clks); i++) {
2069 if (IS_ERR(clks[i])) {
2070 pr_err
2071 ("Tegra114 clk %d: register failed with %ld\n",
2072 i, PTR_ERR(clks[i]));
2073 }
2074 if (!clks[i])
2075 clks[i] = ERR_PTR(-EINVAL);
2076 }
2077
2078 clk_data.clks = clks;
2079 clk_data.clk_num = ARRAY_SIZE(clks);
2080 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
2081
2082 tegra_clk_apply_init_table = tegra114_clock_apply_init_table;
2083
2084 tegra_cpu_car_ops = &tegra114_cpu_car_ops;
2085}
diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c
index f873dcefe0de..8292a00c3de9 100644
--- a/drivers/clk/tegra/clk-tegra20.c
+++ b/drivers/clk/tegra/clk-tegra20.c
@@ -86,8 +86,8 @@
86#define PLLE_BASE 0xe8 86#define PLLE_BASE 0xe8
87#define PLLE_MISC 0xec 87#define PLLE_MISC 0xec
88 88
89#define PLL_BASE_LOCK 27 89#define PLL_BASE_LOCK BIT(27)
90#define PLLE_MISC_LOCK 11 90#define PLLE_MISC_LOCK BIT(11)
91 91
92#define PLL_MISC_LOCK_ENABLE 18 92#define PLL_MISC_LOCK_ENABLE 18
93#define PLLDU_MISC_LOCK_ENABLE 22 93#define PLLDU_MISC_LOCK_ENABLE 22
@@ -236,7 +236,7 @@ enum tegra20_clk {
236 dvc, dsi, mipi = 50, hdmi, csi, tvdac, i2c2, uartc, emc = 57, usb2, 236 dvc, dsi, mipi = 50, hdmi, csi, tvdac, i2c2, uartc, emc = 57, usb2,
237 usb3, mpe, vde, bsea, bsev, speedo, uartd, uarte, i2c3, sbc4, sdmmc3, 237 usb3, mpe, vde, bsea, bsev, speedo, uartd, uarte, i2c3, sbc4, sdmmc3,
238 pex, owr, afi, csite, pcie_xclk, avpucq = 75, la, irama = 84, iramb, 238 pex, owr, afi, csite, pcie_xclk, avpucq = 75, la, irama = 84, iramb,
239 iramc, iramd, cram2, audio_2x, clk_d, csus = 92, cdev1, cdev2, 239 iramc, iramd, cram2, audio_2x, clk_d, csus = 92, cdev2, cdev1,
240 uartb = 96, vfir, spdif_in, spdif_out, vi, vi_sensor, tvo, cve, 240 uartb = 96, vfir, spdif_in, spdif_out, vi, vi_sensor, tvo, cve,
241 osc, clk_32k, clk_m, sclk, cclk, hclk, pclk, blink, pll_a, pll_a_out0, 241 osc, clk_32k, clk_m, sclk, cclk, hclk, pclk, blink, pll_a, pll_a_out0,
242 pll_c, pll_c_out1, pll_d, pll_d_out0, pll_e, pll_m, pll_m_out1, 242 pll_c, pll_c_out1, pll_d, pll_d_out0, pll_e, pll_m, pll_m_out1,
@@ -248,125 +248,125 @@ static struct clk *clks[clk_max];
248static struct clk_onecell_data clk_data; 248static struct clk_onecell_data clk_data;
249 249
250static struct tegra_clk_pll_freq_table pll_c_freq_table[] = { 250static struct tegra_clk_pll_freq_table pll_c_freq_table[] = {
251 { 12000000, 600000000, 600, 12, 1, 8 }, 251 { 12000000, 600000000, 600, 12, 0, 8 },
252 { 13000000, 600000000, 600, 13, 1, 8 }, 252 { 13000000, 600000000, 600, 13, 0, 8 },
253 { 19200000, 600000000, 500, 16, 1, 6 }, 253 { 19200000, 600000000, 500, 16, 0, 6 },
254 { 26000000, 600000000, 600, 26, 1, 8 }, 254 { 26000000, 600000000, 600, 26, 0, 8 },
255 { 0, 0, 0, 0, 0, 0 }, 255 { 0, 0, 0, 0, 0, 0 },
256}; 256};
257 257
258static struct tegra_clk_pll_freq_table pll_m_freq_table[] = { 258static struct tegra_clk_pll_freq_table pll_m_freq_table[] = {
259 { 12000000, 666000000, 666, 12, 1, 8}, 259 { 12000000, 666000000, 666, 12, 0, 8},
260 { 13000000, 666000000, 666, 13, 1, 8}, 260 { 13000000, 666000000, 666, 13, 0, 8},
261 { 19200000, 666000000, 555, 16, 1, 8}, 261 { 19200000, 666000000, 555, 16, 0, 8},
262 { 26000000, 666000000, 666, 26, 1, 8}, 262 { 26000000, 666000000, 666, 26, 0, 8},
263 { 12000000, 600000000, 600, 12, 1, 8}, 263 { 12000000, 600000000, 600, 12, 0, 8},
264 { 13000000, 600000000, 600, 13, 1, 8}, 264 { 13000000, 600000000, 600, 13, 0, 8},
265 { 19200000, 600000000, 375, 12, 1, 6}, 265 { 19200000, 600000000, 375, 12, 0, 6},
266 { 26000000, 600000000, 600, 26, 1, 8}, 266 { 26000000, 600000000, 600, 26, 0, 8},
267 { 0, 0, 0, 0, 0, 0 }, 267 { 0, 0, 0, 0, 0, 0 },
268}; 268};
269 269
270static struct tegra_clk_pll_freq_table pll_p_freq_table[] = { 270static struct tegra_clk_pll_freq_table pll_p_freq_table[] = {
271 { 12000000, 216000000, 432, 12, 2, 8}, 271 { 12000000, 216000000, 432, 12, 1, 8},
272 { 13000000, 216000000, 432, 13, 2, 8}, 272 { 13000000, 216000000, 432, 13, 1, 8},
273 { 19200000, 216000000, 90, 4, 2, 1}, 273 { 19200000, 216000000, 90, 4, 1, 1},
274 { 26000000, 216000000, 432, 26, 2, 8}, 274 { 26000000, 216000000, 432, 26, 1, 8},
275 { 12000000, 432000000, 432, 12, 1, 8}, 275 { 12000000, 432000000, 432, 12, 0, 8},
276 { 13000000, 432000000, 432, 13, 1, 8}, 276 { 13000000, 432000000, 432, 13, 0, 8},
277 { 19200000, 432000000, 90, 4, 1, 1}, 277 { 19200000, 432000000, 90, 4, 0, 1},
278 { 26000000, 432000000, 432, 26, 1, 8}, 278 { 26000000, 432000000, 432, 26, 0, 8},
279 { 0, 0, 0, 0, 0, 0 }, 279 { 0, 0, 0, 0, 0, 0 },
280}; 280};
281 281
282static struct tegra_clk_pll_freq_table pll_a_freq_table[] = { 282static struct tegra_clk_pll_freq_table pll_a_freq_table[] = {
283 { 28800000, 56448000, 49, 25, 1, 1}, 283 { 28800000, 56448000, 49, 25, 0, 1},
284 { 28800000, 73728000, 64, 25, 1, 1}, 284 { 28800000, 73728000, 64, 25, 0, 1},
285 { 28800000, 24000000, 5, 6, 1, 1}, 285 { 28800000, 24000000, 5, 6, 0, 1},
286 { 0, 0, 0, 0, 0, 0 }, 286 { 0, 0, 0, 0, 0, 0 },
287}; 287};
288 288
289static struct tegra_clk_pll_freq_table pll_d_freq_table[] = { 289static struct tegra_clk_pll_freq_table pll_d_freq_table[] = {
290 { 12000000, 216000000, 216, 12, 1, 4}, 290 { 12000000, 216000000, 216, 12, 0, 4},
291 { 13000000, 216000000, 216, 13, 1, 4}, 291 { 13000000, 216000000, 216, 13, 0, 4},
292 { 19200000, 216000000, 135, 12, 1, 3}, 292 { 19200000, 216000000, 135, 12, 0, 3},
293 { 26000000, 216000000, 216, 26, 1, 4}, 293 { 26000000, 216000000, 216, 26, 0, 4},
294 294
295 { 12000000, 594000000, 594, 12, 1, 8}, 295 { 12000000, 594000000, 594, 12, 0, 8},
296 { 13000000, 594000000, 594, 13, 1, 8}, 296 { 13000000, 594000000, 594, 13, 0, 8},
297 { 19200000, 594000000, 495, 16, 1, 8}, 297 { 19200000, 594000000, 495, 16, 0, 8},
298 { 26000000, 594000000, 594, 26, 1, 8}, 298 { 26000000, 594000000, 594, 26, 0, 8},
299 299
300 { 12000000, 1000000000, 1000, 12, 1, 12}, 300 { 12000000, 1000000000, 1000, 12, 0, 12},
301 { 13000000, 1000000000, 1000, 13, 1, 12}, 301 { 13000000, 1000000000, 1000, 13, 0, 12},
302 { 19200000, 1000000000, 625, 12, 1, 8}, 302 { 19200000, 1000000000, 625, 12, 0, 8},
303 { 26000000, 1000000000, 1000, 26, 1, 12}, 303 { 26000000, 1000000000, 1000, 26, 0, 12},
304 304
305 { 0, 0, 0, 0, 0, 0 }, 305 { 0, 0, 0, 0, 0, 0 },
306}; 306};
307 307
308static struct tegra_clk_pll_freq_table pll_u_freq_table[] = { 308static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
309 { 12000000, 480000000, 960, 12, 2, 0}, 309 { 12000000, 480000000, 960, 12, 0, 0},
310 { 13000000, 480000000, 960, 13, 2, 0}, 310 { 13000000, 480000000, 960, 13, 0, 0},
311 { 19200000, 480000000, 200, 4, 2, 0}, 311 { 19200000, 480000000, 200, 4, 0, 0},
312 { 26000000, 480000000, 960, 26, 2, 0}, 312 { 26000000, 480000000, 960, 26, 0, 0},
313 { 0, 0, 0, 0, 0, 0 }, 313 { 0, 0, 0, 0, 0, 0 },
314}; 314};
315 315
316static struct tegra_clk_pll_freq_table pll_x_freq_table[] = { 316static struct tegra_clk_pll_freq_table pll_x_freq_table[] = {
317 /* 1 GHz */ 317 /* 1 GHz */
318 { 12000000, 1000000000, 1000, 12, 1, 12}, 318 { 12000000, 1000000000, 1000, 12, 0, 12},
319 { 13000000, 1000000000, 1000, 13, 1, 12}, 319 { 13000000, 1000000000, 1000, 13, 0, 12},
320 { 19200000, 1000000000, 625, 12, 1, 8}, 320 { 19200000, 1000000000, 625, 12, 0, 8},
321 { 26000000, 1000000000, 1000, 26, 1, 12}, 321 { 26000000, 1000000000, 1000, 26, 0, 12},
322 322
323 /* 912 MHz */ 323 /* 912 MHz */
324 { 12000000, 912000000, 912, 12, 1, 12}, 324 { 12000000, 912000000, 912, 12, 0, 12},
325 { 13000000, 912000000, 912, 13, 1, 12}, 325 { 13000000, 912000000, 912, 13, 0, 12},
326 { 19200000, 912000000, 760, 16, 1, 8}, 326 { 19200000, 912000000, 760, 16, 0, 8},
327 { 26000000, 912000000, 912, 26, 1, 12}, 327 { 26000000, 912000000, 912, 26, 0, 12},
328 328
329 /* 816 MHz */ 329 /* 816 MHz */
330 { 12000000, 816000000, 816, 12, 1, 12}, 330 { 12000000, 816000000, 816, 12, 0, 12},
331 { 13000000, 816000000, 816, 13, 1, 12}, 331 { 13000000, 816000000, 816, 13, 0, 12},
332 { 19200000, 816000000, 680, 16, 1, 8}, 332 { 19200000, 816000000, 680, 16, 0, 8},
333 { 26000000, 816000000, 816, 26, 1, 12}, 333 { 26000000, 816000000, 816, 26, 0, 12},
334 334
335 /* 760 MHz */ 335 /* 760 MHz */
336 { 12000000, 760000000, 760, 12, 1, 12}, 336 { 12000000, 760000000, 760, 12, 0, 12},
337 { 13000000, 760000000, 760, 13, 1, 12}, 337 { 13000000, 760000000, 760, 13, 0, 12},
338 { 19200000, 760000000, 950, 24, 1, 8}, 338 { 19200000, 760000000, 950, 24, 0, 8},
339 { 26000000, 760000000, 760, 26, 1, 12}, 339 { 26000000, 760000000, 760, 26, 0, 12},
340 340
341 /* 750 MHz */ 341 /* 750 MHz */
342 { 12000000, 750000000, 750, 12, 1, 12}, 342 { 12000000, 750000000, 750, 12, 0, 12},
343 { 13000000, 750000000, 750, 13, 1, 12}, 343 { 13000000, 750000000, 750, 13, 0, 12},
344 { 19200000, 750000000, 625, 16, 1, 8}, 344 { 19200000, 750000000, 625, 16, 0, 8},
345 { 26000000, 750000000, 750, 26, 1, 12}, 345 { 26000000, 750000000, 750, 26, 0, 12},
346 346
347 /* 608 MHz */ 347 /* 608 MHz */
348 { 12000000, 608000000, 608, 12, 1, 12}, 348 { 12000000, 608000000, 608, 12, 0, 12},
349 { 13000000, 608000000, 608, 13, 1, 12}, 349 { 13000000, 608000000, 608, 13, 0, 12},
350 { 19200000, 608000000, 380, 12, 1, 8}, 350 { 19200000, 608000000, 380, 12, 0, 8},
351 { 26000000, 608000000, 608, 26, 1, 12}, 351 { 26000000, 608000000, 608, 26, 0, 12},
352 352
353 /* 456 MHz */ 353 /* 456 MHz */
354 { 12000000, 456000000, 456, 12, 1, 12}, 354 { 12000000, 456000000, 456, 12, 0, 12},
355 { 13000000, 456000000, 456, 13, 1, 12}, 355 { 13000000, 456000000, 456, 13, 0, 12},
356 { 19200000, 456000000, 380, 16, 1, 8}, 356 { 19200000, 456000000, 380, 16, 0, 8},
357 { 26000000, 456000000, 456, 26, 1, 12}, 357 { 26000000, 456000000, 456, 26, 0, 12},
358 358
359 /* 312 MHz */ 359 /* 312 MHz */
360 { 12000000, 312000000, 312, 12, 1, 12}, 360 { 12000000, 312000000, 312, 12, 0, 12},
361 { 13000000, 312000000, 312, 13, 1, 12}, 361 { 13000000, 312000000, 312, 13, 0, 12},
362 { 19200000, 312000000, 260, 16, 1, 8}, 362 { 19200000, 312000000, 260, 16, 0, 8},
363 { 26000000, 312000000, 312, 26, 1, 12}, 363 { 26000000, 312000000, 312, 26, 0, 12},
364 364
365 { 0, 0, 0, 0, 0, 0 }, 365 { 0, 0, 0, 0, 0, 0 },
366}; 366};
367 367
368static struct tegra_clk_pll_freq_table pll_e_freq_table[] = { 368static struct tegra_clk_pll_freq_table pll_e_freq_table[] = {
369 { 12000000, 100000000, 200, 24, 1, 0 }, 369 { 12000000, 100000000, 200, 24, 0, 0 },
370 { 0, 0, 0, 0, 0, 0 }, 370 { 0, 0, 0, 0, 0, 0 },
371}; 371};
372 372
@@ -380,7 +380,7 @@ static struct tegra_clk_pll_params pll_c_params = {
380 .vco_max = 1400000000, 380 .vco_max = 1400000000,
381 .base_reg = PLLC_BASE, 381 .base_reg = PLLC_BASE,
382 .misc_reg = PLLC_MISC, 382 .misc_reg = PLLC_MISC,
383 .lock_bit_idx = PLL_BASE_LOCK, 383 .lock_mask = PLL_BASE_LOCK,
384 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 384 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
385 .lock_delay = 300, 385 .lock_delay = 300,
386}; 386};
@@ -394,7 +394,7 @@ static struct tegra_clk_pll_params pll_m_params = {
394 .vco_max = 1200000000, 394 .vco_max = 1200000000,
395 .base_reg = PLLM_BASE, 395 .base_reg = PLLM_BASE,
396 .misc_reg = PLLM_MISC, 396 .misc_reg = PLLM_MISC,
397 .lock_bit_idx = PLL_BASE_LOCK, 397 .lock_mask = PLL_BASE_LOCK,
398 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 398 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
399 .lock_delay = 300, 399 .lock_delay = 300,
400}; 400};
@@ -408,7 +408,7 @@ static struct tegra_clk_pll_params pll_p_params = {
408 .vco_max = 1400000000, 408 .vco_max = 1400000000,
409 .base_reg = PLLP_BASE, 409 .base_reg = PLLP_BASE,
410 .misc_reg = PLLP_MISC, 410 .misc_reg = PLLP_MISC,
411 .lock_bit_idx = PLL_BASE_LOCK, 411 .lock_mask = PLL_BASE_LOCK,
412 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 412 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
413 .lock_delay = 300, 413 .lock_delay = 300,
414}; 414};
@@ -422,7 +422,7 @@ static struct tegra_clk_pll_params pll_a_params = {
422 .vco_max = 1400000000, 422 .vco_max = 1400000000,
423 .base_reg = PLLA_BASE, 423 .base_reg = PLLA_BASE,
424 .misc_reg = PLLA_MISC, 424 .misc_reg = PLLA_MISC,
425 .lock_bit_idx = PLL_BASE_LOCK, 425 .lock_mask = PLL_BASE_LOCK,
426 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 426 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
427 .lock_delay = 300, 427 .lock_delay = 300,
428}; 428};
@@ -436,11 +436,17 @@ static struct tegra_clk_pll_params pll_d_params = {
436 .vco_max = 1000000000, 436 .vco_max = 1000000000,
437 .base_reg = PLLD_BASE, 437 .base_reg = PLLD_BASE,
438 .misc_reg = PLLD_MISC, 438 .misc_reg = PLLD_MISC,
439 .lock_bit_idx = PLL_BASE_LOCK, 439 .lock_mask = PLL_BASE_LOCK,
440 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, 440 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
441 .lock_delay = 1000, 441 .lock_delay = 1000,
442}; 442};
443 443
444static struct pdiv_map pllu_p[] = {
445 { .pdiv = 1, .hw_val = 1 },
446 { .pdiv = 2, .hw_val = 0 },
447 { .pdiv = 0, .hw_val = 0 },
448};
449
444static struct tegra_clk_pll_params pll_u_params = { 450static struct tegra_clk_pll_params pll_u_params = {
445 .input_min = 2000000, 451 .input_min = 2000000,
446 .input_max = 40000000, 452 .input_max = 40000000,
@@ -450,9 +456,10 @@ static struct tegra_clk_pll_params pll_u_params = {
450 .vco_max = 960000000, 456 .vco_max = 960000000,
451 .base_reg = PLLU_BASE, 457 .base_reg = PLLU_BASE,
452 .misc_reg = PLLU_MISC, 458 .misc_reg = PLLU_MISC,
453 .lock_bit_idx = PLL_BASE_LOCK, 459 .lock_mask = PLL_BASE_LOCK,
454 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, 460 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
455 .lock_delay = 1000, 461 .lock_delay = 1000,
462 .pdiv_tohw = pllu_p,
456}; 463};
457 464
458static struct tegra_clk_pll_params pll_x_params = { 465static struct tegra_clk_pll_params pll_x_params = {
@@ -464,7 +471,7 @@ static struct tegra_clk_pll_params pll_x_params = {
464 .vco_max = 1200000000, 471 .vco_max = 1200000000,
465 .base_reg = PLLX_BASE, 472 .base_reg = PLLX_BASE,
466 .misc_reg = PLLX_MISC, 473 .misc_reg = PLLX_MISC,
467 .lock_bit_idx = PLL_BASE_LOCK, 474 .lock_mask = PLL_BASE_LOCK,
468 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 475 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
469 .lock_delay = 300, 476 .lock_delay = 300,
470}; 477};
@@ -478,7 +485,7 @@ static struct tegra_clk_pll_params pll_e_params = {
478 .vco_max = 0, 485 .vco_max = 0,
479 .base_reg = PLLE_BASE, 486 .base_reg = PLLE_BASE,
480 .misc_reg = PLLE_MISC, 487 .misc_reg = PLLE_MISC,
481 .lock_bit_idx = PLLE_MISC_LOCK, 488 .lock_mask = PLLE_MISC_LOCK,
482 .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE, 489 .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE,
483 .lock_delay = 0, 490 .lock_delay = 0,
484}; 491};
@@ -711,8 +718,8 @@ static void tegra20_pll_init(void)
711} 718}
712 719
713static const char *cclk_parents[] = { "clk_m", "pll_c", "clk_32k", "pll_m", 720static const char *cclk_parents[] = { "clk_m", "pll_c", "clk_32k", "pll_m",
714 "pll_p_cclk", "pll_p_out4_cclk", 721 "pll_p", "pll_p_out4",
715 "pll_p_out3_cclk", "clk_d", "pll_x" }; 722 "pll_p_out3", "clk_d", "pll_x" };
716static const char *sclk_parents[] = { "clk_m", "pll_c_out1", "pll_p_out4", 723static const char *sclk_parents[] = { "clk_m", "pll_c_out1", "pll_p_out4",
717 "pll_p_out3", "pll_p_out2", "clk_d", 724 "pll_p_out3", "pll_p_out2", "clk_d",
718 "clk_32k", "pll_m_out1" }; 725 "clk_32k", "pll_m_out1" };
@@ -721,38 +728,6 @@ static void tegra20_super_clk_init(void)
721{ 728{
722 struct clk *clk; 729 struct clk *clk;
723 730
724 /*
725 * DIV_U71 dividers for CCLK, these dividers are used only
726 * if parent clock is fixed rate.
727 */
728
729 /*
730 * Clock input to cclk divided from pll_p using
731 * U71 divider of cclk.
732 */
733 clk = tegra_clk_register_divider("pll_p_cclk", "pll_p",
734 clk_base + SUPER_CCLK_DIVIDER, 0,
735 TEGRA_DIVIDER_INT, 16, 8, 1, NULL);
736 clk_register_clkdev(clk, "pll_p_cclk", NULL);
737
738 /*
739 * Clock input to cclk divided from pll_p_out3 using
740 * U71 divider of cclk.
741 */
742 clk = tegra_clk_register_divider("pll_p_out3_cclk", "pll_p_out3",
743 clk_base + SUPER_CCLK_DIVIDER, 0,
744 TEGRA_DIVIDER_INT, 16, 8, 1, NULL);
745 clk_register_clkdev(clk, "pll_p_out3_cclk", NULL);
746
747 /*
748 * Clock input to cclk divided from pll_p_out4 using
749 * U71 divider of cclk.
750 */
751 clk = tegra_clk_register_divider("pll_p_out4_cclk", "pll_p_out4",
752 clk_base + SUPER_CCLK_DIVIDER, 0,
753 TEGRA_DIVIDER_INT, 16, 8, 1, NULL);
754 clk_register_clkdev(clk, "pll_p_out4_cclk", NULL);
755
756 /* CCLK */ 731 /* CCLK */
757 clk = tegra_clk_register_super_mux("cclk", cclk_parents, 732 clk = tegra_clk_register_super_mux("cclk", cclk_parents,
758 ARRAY_SIZE(cclk_parents), CLK_SET_RATE_PARENT, 733 ARRAY_SIZE(cclk_parents), CLK_SET_RATE_PARENT,
@@ -1044,7 +1019,7 @@ static void __init tegra20_periph_clk_init(void)
1044 data = &tegra_periph_clk_list[i]; 1019 data = &tegra_periph_clk_list[i];
1045 clk = tegra_clk_register_periph(data->name, data->parent_names, 1020 clk = tegra_clk_register_periph(data->name, data->parent_names,
1046 data->num_parents, &data->periph, 1021 data->num_parents, &data->periph,
1047 clk_base, data->offset); 1022 clk_base, data->offset, data->flags);
1048 clk_register_clkdev(clk, data->con_id, data->dev_id); 1023 clk_register_clkdev(clk, data->con_id, data->dev_id);
1049 clks[data->clk_id] = clk; 1024 clks[data->clk_id] = clk;
1050 } 1025 }
@@ -1279,9 +1254,16 @@ static __initdata struct tegra_clk_init_table init_table[] = {
1279 {host1x, pll_c, 150000000, 0}, 1254 {host1x, pll_c, 150000000, 0},
1280 {disp1, pll_p, 600000000, 0}, 1255 {disp1, pll_p, 600000000, 0},
1281 {disp2, pll_p, 600000000, 0}, 1256 {disp2, pll_p, 600000000, 0},
1257 {gr2d, pll_c, 300000000, 0},
1258 {gr3d, pll_c, 300000000, 0},
1282 {clk_max, clk_max, 0, 0}, /* This MUST be the last entry */ 1259 {clk_max, clk_max, 0, 0}, /* This MUST be the last entry */
1283}; 1260};
1284 1261
1262static void __init tegra20_clock_apply_init_table(void)
1263{
1264 tegra_init_from_table(init_table, clks, clk_max);
1265}
1266
1285/* 1267/*
1286 * Some clocks may be used by different drivers depending on the board 1268 * Some clocks may be used by different drivers depending on the board
1287 * configuration. List those here to register them twice in the clock lookup 1269 * configuration. List those here to register them twice in the clock lookup
@@ -1348,7 +1330,7 @@ void __init tegra20_clock_init(struct device_node *np)
1348 clk_data.clk_num = ARRAY_SIZE(clks); 1330 clk_data.clk_num = ARRAY_SIZE(clks);
1349 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 1331 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
1350 1332
1351 tegra_init_from_table(init_table, clks, clk_max); 1333 tegra_clk_apply_init_table = tegra20_clock_apply_init_table;
1352 1334
1353 tegra_cpu_car_ops = &tegra20_cpu_car_ops; 1335 tegra_cpu_car_ops = &tegra20_cpu_car_ops;
1354} 1336}
diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
index ba6f51bc9f3b..2dc0c5602613 100644
--- a/drivers/clk/tegra/clk-tegra30.c
+++ b/drivers/clk/tegra/clk-tegra30.c
@@ -116,8 +116,8 @@
116#define PLLDU_MISC_LOCK_ENABLE 22 116#define PLLDU_MISC_LOCK_ENABLE 22
117#define PLLE_MISC_LOCK_ENABLE 9 117#define PLLE_MISC_LOCK_ENABLE 9
118 118
119#define PLL_BASE_LOCK 27 119#define PLL_BASE_LOCK BIT(27)
120#define PLLE_MISC_LOCK 11 120#define PLLE_MISC_LOCK BIT(11)
121 121
122#define PLLE_AUX 0x48c 122#define PLLE_AUX 0x48c
123#define PLLC_OUT 0x84 123#define PLLC_OUT 0x84
@@ -330,7 +330,7 @@ enum tegra30_clk {
330 usb3, mpe, vde, bsea, bsev, speedo, uartd, uarte, i2c3, sbc4, sdmmc3, 330 usb3, mpe, vde, bsea, bsev, speedo, uartd, uarte, i2c3, sbc4, sdmmc3,
331 pcie, owr, afi, csite, pciex, avpucq, la, dtv = 79, ndspeed, i2cslow, 331 pcie, owr, afi, csite, pciex, avpucq, la, dtv = 79, ndspeed, i2cslow,
332 dsib, irama = 84, iramb, iramc, iramd, cram2, audio_2x = 90, csus = 92, 332 dsib, irama = 84, iramb, iramc, iramd, cram2, audio_2x = 90, csus = 92,
333 cdev1, cdev2, cpu_g = 96, cpu_lp, gr3d2, mselect, tsensor, i2s3, i2s4, 333 cdev2, cdev1, cpu_g = 96, cpu_lp, gr3d2, mselect, tsensor, i2s3, i2s4,
334 i2c4, sbc5, sbc6, d_audio, apbif, dam0, dam1, dam2, hda2codec_2x, 334 i2c4, sbc5, sbc6, d_audio, apbif, dam0, dam1, dam2, hda2codec_2x,
335 atomics, audio0_2x, audio1_2x, audio2_2x, audio3_2x, audio4_2x, 335 atomics, audio0_2x, audio1_2x, audio2_2x, audio3_2x, audio4_2x,
336 spdif_2x, actmon, extern1, extern2, extern3, sata_oob, sata, hda, 336 spdif_2x, actmon, extern1, extern2, extern3, sata_oob, sata, hda,
@@ -374,164 +374,170 @@ static const struct utmi_clk_param utmi_parameters[] = {
374}; 374};
375 375
376static struct tegra_clk_pll_freq_table pll_c_freq_table[] = { 376static struct tegra_clk_pll_freq_table pll_c_freq_table[] = {
377 { 12000000, 1040000000, 520, 6, 1, 8}, 377 { 12000000, 1040000000, 520, 6, 0, 8},
378 { 13000000, 1040000000, 480, 6, 1, 8}, 378 { 13000000, 1040000000, 480, 6, 0, 8},
379 { 16800000, 1040000000, 495, 8, 1, 8}, /* actual: 1039.5 MHz */ 379 { 16800000, 1040000000, 495, 8, 0, 8}, /* actual: 1039.5 MHz */
380 { 19200000, 1040000000, 325, 6, 1, 6}, 380 { 19200000, 1040000000, 325, 6, 0, 6},
381 { 26000000, 1040000000, 520, 13, 1, 8}, 381 { 26000000, 1040000000, 520, 13, 0, 8},
382 382
383 { 12000000, 832000000, 416, 6, 1, 8}, 383 { 12000000, 832000000, 416, 6, 0, 8},
384 { 13000000, 832000000, 832, 13, 1, 8}, 384 { 13000000, 832000000, 832, 13, 0, 8},
385 { 16800000, 832000000, 396, 8, 1, 8}, /* actual: 831.6 MHz */ 385 { 16800000, 832000000, 396, 8, 0, 8}, /* actual: 831.6 MHz */
386 { 19200000, 832000000, 260, 6, 1, 8}, 386 { 19200000, 832000000, 260, 6, 0, 8},
387 { 26000000, 832000000, 416, 13, 1, 8}, 387 { 26000000, 832000000, 416, 13, 0, 8},
388 388
389 { 12000000, 624000000, 624, 12, 1, 8}, 389 { 12000000, 624000000, 624, 12, 0, 8},
390 { 13000000, 624000000, 624, 13, 1, 8}, 390 { 13000000, 624000000, 624, 13, 0, 8},
391 { 16800000, 600000000, 520, 14, 1, 8}, 391 { 16800000, 600000000, 520, 14, 0, 8},
392 { 19200000, 624000000, 520, 16, 1, 8}, 392 { 19200000, 624000000, 520, 16, 0, 8},
393 { 26000000, 624000000, 624, 26, 1, 8}, 393 { 26000000, 624000000, 624, 26, 0, 8},
394 394
395 { 12000000, 600000000, 600, 12, 1, 8}, 395 { 12000000, 600000000, 600, 12, 0, 8},
396 { 13000000, 600000000, 600, 13, 1, 8}, 396 { 13000000, 600000000, 600, 13, 0, 8},
397 { 16800000, 600000000, 500, 14, 1, 8}, 397 { 16800000, 600000000, 500, 14, 0, 8},
398 { 19200000, 600000000, 375, 12, 1, 6}, 398 { 19200000, 600000000, 375, 12, 0, 6},
399 { 26000000, 600000000, 600, 26, 1, 8}, 399 { 26000000, 600000000, 600, 26, 0, 8},
400 400
401 { 12000000, 520000000, 520, 12, 1, 8}, 401 { 12000000, 520000000, 520, 12, 0, 8},
402 { 13000000, 520000000, 520, 13, 1, 8}, 402 { 13000000, 520000000, 520, 13, 0, 8},
403 { 16800000, 520000000, 495, 16, 1, 8}, /* actual: 519.75 MHz */ 403 { 16800000, 520000000, 495, 16, 0, 8}, /* actual: 519.75 MHz */
404 { 19200000, 520000000, 325, 12, 1, 6}, 404 { 19200000, 520000000, 325, 12, 0, 6},
405 { 26000000, 520000000, 520, 26, 1, 8}, 405 { 26000000, 520000000, 520, 26, 0, 8},
406 406
407 { 12000000, 416000000, 416, 12, 1, 8}, 407 { 12000000, 416000000, 416, 12, 0, 8},
408 { 13000000, 416000000, 416, 13, 1, 8}, 408 { 13000000, 416000000, 416, 13, 0, 8},
409 { 16800000, 416000000, 396, 16, 1, 8}, /* actual: 415.8 MHz */ 409 { 16800000, 416000000, 396, 16, 0, 8}, /* actual: 415.8 MHz */
410 { 19200000, 416000000, 260, 12, 1, 6}, 410 { 19200000, 416000000, 260, 12, 0, 6},
411 { 26000000, 416000000, 416, 26, 1, 8}, 411 { 26000000, 416000000, 416, 26, 0, 8},
412 { 0, 0, 0, 0, 0, 0 }, 412 { 0, 0, 0, 0, 0, 0 },
413}; 413};
414 414
415static struct tegra_clk_pll_freq_table pll_m_freq_table[] = { 415static struct tegra_clk_pll_freq_table pll_m_freq_table[] = {
416 { 12000000, 666000000, 666, 12, 1, 8}, 416 { 12000000, 666000000, 666, 12, 0, 8},
417 { 13000000, 666000000, 666, 13, 1, 8}, 417 { 13000000, 666000000, 666, 13, 0, 8},
418 { 16800000, 666000000, 555, 14, 1, 8}, 418 { 16800000, 666000000, 555, 14, 0, 8},
419 { 19200000, 666000000, 555, 16, 1, 8}, 419 { 19200000, 666000000, 555, 16, 0, 8},
420 { 26000000, 666000000, 666, 26, 1, 8}, 420 { 26000000, 666000000, 666, 26, 0, 8},
421 { 12000000, 600000000, 600, 12, 1, 8}, 421 { 12000000, 600000000, 600, 12, 0, 8},
422 { 13000000, 600000000, 600, 13, 1, 8}, 422 { 13000000, 600000000, 600, 13, 0, 8},
423 { 16800000, 600000000, 500, 14, 1, 8}, 423 { 16800000, 600000000, 500, 14, 0, 8},
424 { 19200000, 600000000, 375, 12, 1, 6}, 424 { 19200000, 600000000, 375, 12, 0, 6},
425 { 26000000, 600000000, 600, 26, 1, 8}, 425 { 26000000, 600000000, 600, 26, 0, 8},
426 { 0, 0, 0, 0, 0, 0 }, 426 { 0, 0, 0, 0, 0, 0 },
427}; 427};
428 428
429static struct tegra_clk_pll_freq_table pll_p_freq_table[] = { 429static struct tegra_clk_pll_freq_table pll_p_freq_table[] = {
430 { 12000000, 216000000, 432, 12, 2, 8}, 430 { 12000000, 216000000, 432, 12, 1, 8},
431 { 13000000, 216000000, 432, 13, 2, 8}, 431 { 13000000, 216000000, 432, 13, 1, 8},
432 { 16800000, 216000000, 360, 14, 2, 8}, 432 { 16800000, 216000000, 360, 14, 1, 8},
433 { 19200000, 216000000, 360, 16, 2, 8}, 433 { 19200000, 216000000, 360, 16, 1, 8},
434 { 26000000, 216000000, 432, 26, 2, 8}, 434 { 26000000, 216000000, 432, 26, 1, 8},
435 { 0, 0, 0, 0, 0, 0 }, 435 { 0, 0, 0, 0, 0, 0 },
436}; 436};
437 437
438static struct tegra_clk_pll_freq_table pll_a_freq_table[] = { 438static struct tegra_clk_pll_freq_table pll_a_freq_table[] = {
439 { 9600000, 564480000, 294, 5, 1, 4}, 439 { 9600000, 564480000, 294, 5, 0, 4},
440 { 9600000, 552960000, 288, 5, 1, 4}, 440 { 9600000, 552960000, 288, 5, 0, 4},
441 { 9600000, 24000000, 5, 2, 1, 1}, 441 { 9600000, 24000000, 5, 2, 0, 1},
442 442
443 { 28800000, 56448000, 49, 25, 1, 1}, 443 { 28800000, 56448000, 49, 25, 0, 1},
444 { 28800000, 73728000, 64, 25, 1, 1}, 444 { 28800000, 73728000, 64, 25, 0, 1},
445 { 28800000, 24000000, 5, 6, 1, 1}, 445 { 28800000, 24000000, 5, 6, 0, 1},
446 { 0, 0, 0, 0, 0, 0 }, 446 { 0, 0, 0, 0, 0, 0 },
447}; 447};
448 448
449static struct tegra_clk_pll_freq_table pll_d_freq_table[] = { 449static struct tegra_clk_pll_freq_table pll_d_freq_table[] = {
450 { 12000000, 216000000, 216, 12, 1, 4}, 450 { 12000000, 216000000, 216, 12, 0, 4},
451 { 13000000, 216000000, 216, 13, 1, 4}, 451 { 13000000, 216000000, 216, 13, 0, 4},
452 { 16800000, 216000000, 180, 14, 1, 4}, 452 { 16800000, 216000000, 180, 14, 0, 4},
453 { 19200000, 216000000, 180, 16, 1, 4}, 453 { 19200000, 216000000, 180, 16, 0, 4},
454 { 26000000, 216000000, 216, 26, 1, 4}, 454 { 26000000, 216000000, 216, 26, 0, 4},
455 455
456 { 12000000, 594000000, 594, 12, 1, 8}, 456 { 12000000, 594000000, 594, 12, 0, 8},
457 { 13000000, 594000000, 594, 13, 1, 8}, 457 { 13000000, 594000000, 594, 13, 0, 8},
458 { 16800000, 594000000, 495, 14, 1, 8}, 458 { 16800000, 594000000, 495, 14, 0, 8},
459 { 19200000, 594000000, 495, 16, 1, 8}, 459 { 19200000, 594000000, 495, 16, 0, 8},
460 { 26000000, 594000000, 594, 26, 1, 8}, 460 { 26000000, 594000000, 594, 26, 0, 8},
461 461
462 { 12000000, 1000000000, 1000, 12, 1, 12}, 462 { 12000000, 1000000000, 1000, 12, 0, 12},
463 { 13000000, 1000000000, 1000, 13, 1, 12}, 463 { 13000000, 1000000000, 1000, 13, 0, 12},
464 { 19200000, 1000000000, 625, 12, 1, 8}, 464 { 19200000, 1000000000, 625, 12, 0, 8},
465 { 26000000, 1000000000, 1000, 26, 1, 12}, 465 { 26000000, 1000000000, 1000, 26, 0, 12},
466 466
467 { 0, 0, 0, 0, 0, 0 }, 467 { 0, 0, 0, 0, 0, 0 },
468}; 468};
469 469
470static struct pdiv_map pllu_p[] = {
471 { .pdiv = 1, .hw_val = 1 },
472 { .pdiv = 2, .hw_val = 0 },
473 { .pdiv = 0, .hw_val = 0 },
474};
475
470static struct tegra_clk_pll_freq_table pll_u_freq_table[] = { 476static struct tegra_clk_pll_freq_table pll_u_freq_table[] = {
471 { 12000000, 480000000, 960, 12, 2, 12}, 477 { 12000000, 480000000, 960, 12, 0, 12},
472 { 13000000, 480000000, 960, 13, 2, 12}, 478 { 13000000, 480000000, 960, 13, 0, 12},
473 { 16800000, 480000000, 400, 7, 2, 5}, 479 { 16800000, 480000000, 400, 7, 0, 5},
474 { 19200000, 480000000, 200, 4, 2, 3}, 480 { 19200000, 480000000, 200, 4, 0, 3},
475 { 26000000, 480000000, 960, 26, 2, 12}, 481 { 26000000, 480000000, 960, 26, 0, 12},
476 { 0, 0, 0, 0, 0, 0 }, 482 { 0, 0, 0, 0, 0, 0 },
477}; 483};
478 484
479static struct tegra_clk_pll_freq_table pll_x_freq_table[] = { 485static struct tegra_clk_pll_freq_table pll_x_freq_table[] = {
480 /* 1.7 GHz */ 486 /* 1.7 GHz */
481 { 12000000, 1700000000, 850, 6, 1, 8}, 487 { 12000000, 1700000000, 850, 6, 0, 8},
482 { 13000000, 1700000000, 915, 7, 1, 8}, /* actual: 1699.2 MHz */ 488 { 13000000, 1700000000, 915, 7, 0, 8}, /* actual: 1699.2 MHz */
483 { 16800000, 1700000000, 708, 7, 1, 8}, /* actual: 1699.2 MHz */ 489 { 16800000, 1700000000, 708, 7, 0, 8}, /* actual: 1699.2 MHz */
484 { 19200000, 1700000000, 885, 10, 1, 8}, /* actual: 1699.2 MHz */ 490 { 19200000, 1700000000, 885, 10, 0, 8}, /* actual: 1699.2 MHz */
485 { 26000000, 1700000000, 850, 13, 1, 8}, 491 { 26000000, 1700000000, 850, 13, 0, 8},
486 492
487 /* 1.6 GHz */ 493 /* 1.6 GHz */
488 { 12000000, 1600000000, 800, 6, 1, 8}, 494 { 12000000, 1600000000, 800, 6, 0, 8},
489 { 13000000, 1600000000, 738, 6, 1, 8}, /* actual: 1599.0 MHz */ 495 { 13000000, 1600000000, 738, 6, 0, 8}, /* actual: 1599.0 MHz */
490 { 16800000, 1600000000, 857, 9, 1, 8}, /* actual: 1599.7 MHz */ 496 { 16800000, 1600000000, 857, 9, 0, 8}, /* actual: 1599.7 MHz */
491 { 19200000, 1600000000, 500, 6, 1, 8}, 497 { 19200000, 1600000000, 500, 6, 0, 8},
492 { 26000000, 1600000000, 800, 13, 1, 8}, 498 { 26000000, 1600000000, 800, 13, 0, 8},
493 499
494 /* 1.5 GHz */ 500 /* 1.5 GHz */
495 { 12000000, 1500000000, 750, 6, 1, 8}, 501 { 12000000, 1500000000, 750, 6, 0, 8},
496 { 13000000, 1500000000, 923, 8, 1, 8}, /* actual: 1499.8 MHz */ 502 { 13000000, 1500000000, 923, 8, 0, 8}, /* actual: 1499.8 MHz */
497 { 16800000, 1500000000, 625, 7, 1, 8}, 503 { 16800000, 1500000000, 625, 7, 0, 8},
498 { 19200000, 1500000000, 625, 8, 1, 8}, 504 { 19200000, 1500000000, 625, 8, 0, 8},
499 { 26000000, 1500000000, 750, 13, 1, 8}, 505 { 26000000, 1500000000, 750, 13, 0, 8},
500 506
501 /* 1.4 GHz */ 507 /* 1.4 GHz */
502 { 12000000, 1400000000, 700, 6, 1, 8}, 508 { 12000000, 1400000000, 700, 6, 0, 8},
503 { 13000000, 1400000000, 969, 9, 1, 8}, /* actual: 1399.7 MHz */ 509 { 13000000, 1400000000, 969, 9, 0, 8}, /* actual: 1399.7 MHz */
504 { 16800000, 1400000000, 1000, 12, 1, 8}, 510 { 16800000, 1400000000, 1000, 12, 0, 8},
505 { 19200000, 1400000000, 875, 12, 1, 8}, 511 { 19200000, 1400000000, 875, 12, 0, 8},
506 { 26000000, 1400000000, 700, 13, 1, 8}, 512 { 26000000, 1400000000, 700, 13, 0, 8},
507 513
508 /* 1.3 GHz */ 514 /* 1.3 GHz */
509 { 12000000, 1300000000, 975, 9, 1, 8}, 515 { 12000000, 1300000000, 975, 9, 0, 8},
510 { 13000000, 1300000000, 1000, 10, 1, 8}, 516 { 13000000, 1300000000, 1000, 10, 0, 8},
511 { 16800000, 1300000000, 928, 12, 1, 8}, /* actual: 1299.2 MHz */ 517 { 16800000, 1300000000, 928, 12, 0, 8}, /* actual: 1299.2 MHz */
512 { 19200000, 1300000000, 812, 12, 1, 8}, /* actual: 1299.2 MHz */ 518 { 19200000, 1300000000, 812, 12, 0, 8}, /* actual: 1299.2 MHz */
513 { 26000000, 1300000000, 650, 13, 1, 8}, 519 { 26000000, 1300000000, 650, 13, 0, 8},
514 520
515 /* 1.2 GHz */ 521 /* 1.2 GHz */
516 { 12000000, 1200000000, 1000, 10, 1, 8}, 522 { 12000000, 1200000000, 1000, 10, 0, 8},
517 { 13000000, 1200000000, 923, 10, 1, 8}, /* actual: 1199.9 MHz */ 523 { 13000000, 1200000000, 923, 10, 0, 8}, /* actual: 1199.9 MHz */
518 { 16800000, 1200000000, 1000, 14, 1, 8}, 524 { 16800000, 1200000000, 1000, 14, 0, 8},
519 { 19200000, 1200000000, 1000, 16, 1, 8}, 525 { 19200000, 1200000000, 1000, 16, 0, 8},
520 { 26000000, 1200000000, 600, 13, 1, 8}, 526 { 26000000, 1200000000, 600, 13, 0, 8},
521 527
522 /* 1.1 GHz */ 528 /* 1.1 GHz */
523 { 12000000, 1100000000, 825, 9, 1, 8}, 529 { 12000000, 1100000000, 825, 9, 0, 8},
524 { 13000000, 1100000000, 846, 10, 1, 8}, /* actual: 1099.8 MHz */ 530 { 13000000, 1100000000, 846, 10, 0, 8}, /* actual: 1099.8 MHz */
525 { 16800000, 1100000000, 982, 15, 1, 8}, /* actual: 1099.8 MHz */ 531 { 16800000, 1100000000, 982, 15, 0, 8}, /* actual: 1099.8 MHz */
526 { 19200000, 1100000000, 859, 15, 1, 8}, /* actual: 1099.5 MHz */ 532 { 19200000, 1100000000, 859, 15, 0, 8}, /* actual: 1099.5 MHz */
527 { 26000000, 1100000000, 550, 13, 1, 8}, 533 { 26000000, 1100000000, 550, 13, 0, 8},
528 534
529 /* 1 GHz */ 535 /* 1 GHz */
530 { 12000000, 1000000000, 1000, 12, 1, 8}, 536 { 12000000, 1000000000, 1000, 12, 0, 8},
531 { 13000000, 1000000000, 1000, 13, 1, 8}, 537 { 13000000, 1000000000, 1000, 13, 0, 8},
532 { 16800000, 1000000000, 833, 14, 1, 8}, /* actual: 999.6 MHz */ 538 { 16800000, 1000000000, 833, 14, 0, 8}, /* actual: 999.6 MHz */
533 { 19200000, 1000000000, 625, 12, 1, 8}, 539 { 19200000, 1000000000, 625, 12, 0, 8},
534 { 26000000, 1000000000, 1000, 26, 1, 8}, 540 { 26000000, 1000000000, 1000, 26, 0, 8},
535 541
536 { 0, 0, 0, 0, 0, 0 }, 542 { 0, 0, 0, 0, 0, 0 },
537}; 543};
@@ -553,7 +559,7 @@ static struct tegra_clk_pll_params pll_c_params = {
553 .vco_max = 1400000000, 559 .vco_max = 1400000000,
554 .base_reg = PLLC_BASE, 560 .base_reg = PLLC_BASE,
555 .misc_reg = PLLC_MISC, 561 .misc_reg = PLLC_MISC,
556 .lock_bit_idx = PLL_BASE_LOCK, 562 .lock_mask = PLL_BASE_LOCK,
557 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 563 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
558 .lock_delay = 300, 564 .lock_delay = 300,
559}; 565};
@@ -567,7 +573,7 @@ static struct tegra_clk_pll_params pll_m_params = {
567 .vco_max = 1200000000, 573 .vco_max = 1200000000,
568 .base_reg = PLLM_BASE, 574 .base_reg = PLLM_BASE,
569 .misc_reg = PLLM_MISC, 575 .misc_reg = PLLM_MISC,
570 .lock_bit_idx = PLL_BASE_LOCK, 576 .lock_mask = PLL_BASE_LOCK,
571 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 577 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
572 .lock_delay = 300, 578 .lock_delay = 300,
573}; 579};
@@ -581,7 +587,7 @@ static struct tegra_clk_pll_params pll_p_params = {
581 .vco_max = 1400000000, 587 .vco_max = 1400000000,
582 .base_reg = PLLP_BASE, 588 .base_reg = PLLP_BASE,
583 .misc_reg = PLLP_MISC, 589 .misc_reg = PLLP_MISC,
584 .lock_bit_idx = PLL_BASE_LOCK, 590 .lock_mask = PLL_BASE_LOCK,
585 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 591 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
586 .lock_delay = 300, 592 .lock_delay = 300,
587}; 593};
@@ -595,7 +601,7 @@ static struct tegra_clk_pll_params pll_a_params = {
595 .vco_max = 1400000000, 601 .vco_max = 1400000000,
596 .base_reg = PLLA_BASE, 602 .base_reg = PLLA_BASE,
597 .misc_reg = PLLA_MISC, 603 .misc_reg = PLLA_MISC,
598 .lock_bit_idx = PLL_BASE_LOCK, 604 .lock_mask = PLL_BASE_LOCK,
599 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 605 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
600 .lock_delay = 300, 606 .lock_delay = 300,
601}; 607};
@@ -609,7 +615,7 @@ static struct tegra_clk_pll_params pll_d_params = {
609 .vco_max = 1000000000, 615 .vco_max = 1000000000,
610 .base_reg = PLLD_BASE, 616 .base_reg = PLLD_BASE,
611 .misc_reg = PLLD_MISC, 617 .misc_reg = PLLD_MISC,
612 .lock_bit_idx = PLL_BASE_LOCK, 618 .lock_mask = PLL_BASE_LOCK,
613 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, 619 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
614 .lock_delay = 1000, 620 .lock_delay = 1000,
615}; 621};
@@ -623,7 +629,7 @@ static struct tegra_clk_pll_params pll_d2_params = {
623 .vco_max = 1000000000, 629 .vco_max = 1000000000,
624 .base_reg = PLLD2_BASE, 630 .base_reg = PLLD2_BASE,
625 .misc_reg = PLLD2_MISC, 631 .misc_reg = PLLD2_MISC,
626 .lock_bit_idx = PLL_BASE_LOCK, 632 .lock_mask = PLL_BASE_LOCK,
627 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, 633 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
628 .lock_delay = 1000, 634 .lock_delay = 1000,
629}; 635};
@@ -637,9 +643,10 @@ static struct tegra_clk_pll_params pll_u_params = {
637 .vco_max = 960000000, 643 .vco_max = 960000000,
638 .base_reg = PLLU_BASE, 644 .base_reg = PLLU_BASE,
639 .misc_reg = PLLU_MISC, 645 .misc_reg = PLLU_MISC,
640 .lock_bit_idx = PLL_BASE_LOCK, 646 .lock_mask = PLL_BASE_LOCK,
641 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE, 647 .lock_enable_bit_idx = PLLDU_MISC_LOCK_ENABLE,
642 .lock_delay = 1000, 648 .lock_delay = 1000,
649 .pdiv_tohw = pllu_p,
643}; 650};
644 651
645static struct tegra_clk_pll_params pll_x_params = { 652static struct tegra_clk_pll_params pll_x_params = {
@@ -651,7 +658,7 @@ static struct tegra_clk_pll_params pll_x_params = {
651 .vco_max = 1700000000, 658 .vco_max = 1700000000,
652 .base_reg = PLLX_BASE, 659 .base_reg = PLLX_BASE,
653 .misc_reg = PLLX_MISC, 660 .misc_reg = PLLX_MISC,
654 .lock_bit_idx = PLL_BASE_LOCK, 661 .lock_mask = PLL_BASE_LOCK,
655 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE, 662 .lock_enable_bit_idx = PLL_MISC_LOCK_ENABLE,
656 .lock_delay = 300, 663 .lock_delay = 300,
657}; 664};
@@ -665,7 +672,7 @@ static struct tegra_clk_pll_params pll_e_params = {
665 .vco_max = 2400000000U, 672 .vco_max = 2400000000U,
666 .base_reg = PLLE_BASE, 673 .base_reg = PLLE_BASE,
667 .misc_reg = PLLE_MISC, 674 .misc_reg = PLLE_MISC,
668 .lock_bit_idx = PLLE_MISC_LOCK, 675 .lock_mask = PLLE_MISC_LOCK,
669 .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE, 676 .lock_enable_bit_idx = PLLE_MISC_LOCK_ENABLE,
670 .lock_delay = 300, 677 .lock_delay = 300,
671}; 678};
@@ -1661,7 +1668,7 @@ static void __init tegra30_periph_clk_init(void)
1661 data = &tegra_periph_clk_list[i]; 1668 data = &tegra_periph_clk_list[i];
1662 clk = tegra_clk_register_periph(data->name, data->parent_names, 1669 clk = tegra_clk_register_periph(data->name, data->parent_names,
1663 data->num_parents, &data->periph, 1670 data->num_parents, &data->periph,
1664 clk_base, data->offset); 1671 clk_base, data->offset, data->flags);
1665 clk_register_clkdev(clk, data->con_id, data->dev_id); 1672 clk_register_clkdev(clk, data->con_id, data->dev_id);
1666 clks[data->clk_id] = clk; 1673 clks[data->clk_id] = clk;
1667 } 1674 }
@@ -1911,9 +1918,16 @@ static __initdata struct tegra_clk_init_table init_table[] = {
1911 {disp1, pll_p, 600000000, 0}, 1918 {disp1, pll_p, 600000000, 0},
1912 {disp2, pll_p, 600000000, 0}, 1919 {disp2, pll_p, 600000000, 0},
1913 {twd, clk_max, 0, 1}, 1920 {twd, clk_max, 0, 1},
1921 {gr2d, pll_c, 300000000, 0},
1922 {gr3d, pll_c, 300000000, 0},
1914 {clk_max, clk_max, 0, 0}, /* This MUST be the last entry. */ 1923 {clk_max, clk_max, 0, 0}, /* This MUST be the last entry. */
1915}; 1924};
1916 1925
1926static void __init tegra30_clock_apply_init_table(void)
1927{
1928 tegra_init_from_table(init_table, clks, clk_max);
1929}
1930
1917/* 1931/*
1918 * Some clocks may be used by different drivers depending on the board 1932 * Some clocks may be used by different drivers depending on the board
1919 * configuration. List those here to register them twice in the clock lookup 1933 * configuration. List those here to register them twice in the clock lookup
@@ -1987,7 +2001,7 @@ void __init tegra30_clock_init(struct device_node *np)
1987 clk_data.clk_num = ARRAY_SIZE(clks); 2001 clk_data.clk_num = ARRAY_SIZE(clks);
1988 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 2002 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
1989 2003
1990 tegra_init_from_table(init_table, clks, clk_max); 2004 tegra_clk_apply_init_table = tegra30_clock_apply_init_table;
1991 2005
1992 tegra_cpu_car_ops = &tegra30_cpu_car_ops; 2006 tegra_cpu_car_ops = &tegra30_cpu_car_ops;
1993} 2007}
diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c
index a603b9af0ad3..923ca7ee4694 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -22,7 +22,8 @@
22#include "clk.h" 22#include "clk.h"
23 23
24/* Global data of Tegra CPU CAR ops */ 24/* Global data of Tegra CPU CAR ops */
25struct tegra_cpu_car_ops *tegra_cpu_car_ops; 25static struct tegra_cpu_car_ops dummy_car_ops;
26struct tegra_cpu_car_ops *tegra_cpu_car_ops = &dummy_car_ops;
26 27
27void __init tegra_init_dup_clks(struct tegra_clk_duplicate *dup_list, 28void __init tegra_init_dup_clks(struct tegra_clk_duplicate *dup_list,
28 struct clk *clks[], int clk_max) 29 struct clk *clks[], int clk_max)
@@ -76,6 +77,7 @@ void __init tegra_init_from_table(struct tegra_clk_init_table *tbl,
76static const struct of_device_id tegra_dt_clk_match[] = { 77static const struct of_device_id tegra_dt_clk_match[] = {
77 { .compatible = "nvidia,tegra20-car", .data = tegra20_clock_init }, 78 { .compatible = "nvidia,tegra20-car", .data = tegra20_clock_init },
78 { .compatible = "nvidia,tegra30-car", .data = tegra30_clock_init }, 79 { .compatible = "nvidia,tegra30-car", .data = tegra30_clock_init },
80 { .compatible = "nvidia,tegra114-car", .data = tegra114_clock_init },
79 { } 81 { }
80}; 82};
81 83
@@ -83,3 +85,13 @@ void __init tegra_clocks_init(void)
83{ 85{
84 of_clk_init(tegra_dt_clk_match); 86 of_clk_init(tegra_dt_clk_match);
85} 87}
88
89tegra_clk_apply_init_table_func tegra_clk_apply_init_table;
90
91void __init tegra_clocks_apply_init_table(void)
92{
93 if (!tegra_clk_apply_init_table)
94 return;
95
96 tegra_clk_apply_init_table();
97}
diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h
index 0744731c6229..e0565620d68e 100644
--- a/drivers/clk/tegra/clk.h
+++ b/drivers/clk/tegra/clk.h
@@ -1,4 +1,4 @@
1/* 1 /*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
@@ -117,6 +117,17 @@ struct tegra_clk_pll_freq_table {
117}; 117};
118 118
119/** 119/**
120 * struct pdiv_map - map post divider to hw value
121 *
122 * @pdiv: post divider
123 * @hw_val: value to be written to the PLL hw
124 */
125struct pdiv_map {
126 u8 pdiv;
127 u8 hw_val;
128};
129
130/**
120 * struct clk_pll_params - PLL parameters 131 * struct clk_pll_params - PLL parameters
121 * 132 *
122 * @input_min: Minimum input frequency 133 * @input_min: Minimum input frequency
@@ -143,9 +154,18 @@ struct tegra_clk_pll_params {
143 u32 base_reg; 154 u32 base_reg;
144 u32 misc_reg; 155 u32 misc_reg;
145 u32 lock_reg; 156 u32 lock_reg;
146 u32 lock_bit_idx; 157 u32 lock_mask;
147 u32 lock_enable_bit_idx; 158 u32 lock_enable_bit_idx;
159 u32 iddq_reg;
160 u32 iddq_bit_idx;
161 u32 aux_reg;
162 u32 dyn_ramp_reg;
163 u32 ext_misc_reg[3];
164 int stepa_shift;
165 int stepb_shift;
148 int lock_delay; 166 int lock_delay;
167 int max_p;
168 struct pdiv_map *pdiv_tohw;
149}; 169};
150 170
151/** 171/**
@@ -182,12 +202,16 @@ struct tegra_clk_pll_params {
182 * TEGRA_PLL_FIXED - We are not supposed to change output frequency 202 * TEGRA_PLL_FIXED - We are not supposed to change output frequency
183 * of some plls. 203 * of some plls.
184 * TEGRA_PLLE_CONFIGURE - Configure PLLE when enabling. 204 * TEGRA_PLLE_CONFIGURE - Configure PLLE when enabling.
205 * TEGRA_PLL_LOCK_MISC - Lock bit is in the misc register instead of the
206 * base register.
207 * TEGRA_PLL_BYPASS - PLL has bypass bit
208 * TEGRA_PLL_HAS_LOCK_ENABLE - PLL has bit to enable lock monitoring
185 */ 209 */
186struct tegra_clk_pll { 210struct tegra_clk_pll {
187 struct clk_hw hw; 211 struct clk_hw hw;
188 void __iomem *clk_base; 212 void __iomem *clk_base;
189 void __iomem *pmc; 213 void __iomem *pmc;
190 u8 flags; 214 u32 flags;
191 unsigned long fixed_rate; 215 unsigned long fixed_rate;
192 spinlock_t *lock; 216 spinlock_t *lock;
193 u8 divn_shift; 217 u8 divn_shift;
@@ -210,20 +234,64 @@ struct tegra_clk_pll {
210#define TEGRA_PLLM BIT(5) 234#define TEGRA_PLLM BIT(5)
211#define TEGRA_PLL_FIXED BIT(6) 235#define TEGRA_PLL_FIXED BIT(6)
212#define TEGRA_PLLE_CONFIGURE BIT(7) 236#define TEGRA_PLLE_CONFIGURE BIT(7)
237#define TEGRA_PLL_LOCK_MISC BIT(8)
238#define TEGRA_PLL_BYPASS BIT(9)
239#define TEGRA_PLL_HAS_LOCK_ENABLE BIT(10)
213 240
214extern const struct clk_ops tegra_clk_pll_ops; 241extern const struct clk_ops tegra_clk_pll_ops;
215extern const struct clk_ops tegra_clk_plle_ops; 242extern const struct clk_ops tegra_clk_plle_ops;
216struct clk *tegra_clk_register_pll(const char *name, const char *parent_name, 243struct clk *tegra_clk_register_pll(const char *name, const char *parent_name,
217 void __iomem *clk_base, void __iomem *pmc, 244 void __iomem *clk_base, void __iomem *pmc,
218 unsigned long flags, unsigned long fixed_rate, 245 unsigned long flags, unsigned long fixed_rate,
219 struct tegra_clk_pll_params *pll_params, u8 pll_flags, 246 struct tegra_clk_pll_params *pll_params, u32 pll_flags,
220 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock); 247 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock);
248
221struct clk *tegra_clk_register_plle(const char *name, const char *parent_name, 249struct clk *tegra_clk_register_plle(const char *name, const char *parent_name,
222 void __iomem *clk_base, void __iomem *pmc, 250 void __iomem *clk_base, void __iomem *pmc,
223 unsigned long flags, unsigned long fixed_rate, 251 unsigned long flags, unsigned long fixed_rate,
224 struct tegra_clk_pll_params *pll_params, u8 pll_flags, 252 struct tegra_clk_pll_params *pll_params, u32 pll_flags,
225 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock); 253 struct tegra_clk_pll_freq_table *freq_table, spinlock_t *lock);
226 254
255struct clk *tegra_clk_register_pllxc(const char *name, const char *parent_name,
256 void __iomem *clk_base, void __iomem *pmc,
257 unsigned long flags, unsigned long fixed_rate,
258 struct tegra_clk_pll_params *pll_params,
259 u32 pll_flags,
260 struct tegra_clk_pll_freq_table *freq_table,
261 spinlock_t *lock);
262
263struct clk *tegra_clk_register_pllm(const char *name, const char *parent_name,
264 void __iomem *clk_base, void __iomem *pmc,
265 unsigned long flags, unsigned long fixed_rate,
266 struct tegra_clk_pll_params *pll_params,
267 u32 pll_flags,
268 struct tegra_clk_pll_freq_table *freq_table,
269 spinlock_t *lock);
270
271struct clk *tegra_clk_register_pllc(const char *name, const char *parent_name,
272 void __iomem *clk_base, void __iomem *pmc,
273 unsigned long flags, unsigned long fixed_rate,
274 struct tegra_clk_pll_params *pll_params,
275 u32 pll_flags,
276 struct tegra_clk_pll_freq_table *freq_table,
277 spinlock_t *lock);
278
279struct clk *tegra_clk_register_pllre(const char *name, const char *parent_name,
280 void __iomem *clk_base, void __iomem *pmc,
281 unsigned long flags, unsigned long fixed_rate,
282 struct tegra_clk_pll_params *pll_params,
283 u32 pll_flags,
284 struct tegra_clk_pll_freq_table *freq_table,
285 spinlock_t *lock, unsigned long parent_rate);
286
287struct clk *tegra_clk_register_plle_tegra114(const char *name,
288 const char *parent_name,
289 void __iomem *clk_base, unsigned long flags,
290 unsigned long fixed_rate,
291 struct tegra_clk_pll_params *pll_params,
292 struct tegra_clk_pll_freq_table *freq_table,
293 spinlock_t *lock);
294
227/** 295/**
228 * struct tegra_clk_pll_out - PLL divider down clock 296 * struct tegra_clk_pll_out - PLL divider down clock
229 * 297 *
@@ -290,6 +358,7 @@ struct tegra_clk_periph_regs {
290 * TEGRA_PERIPH_ON_APB - If peripheral is in the APB bus then read the 358 * TEGRA_PERIPH_ON_APB - If peripheral is in the APB bus then read the
291 * bus to flush the write operation in apb bus. This flag indicates 359 * bus to flush the write operation in apb bus. This flag indicates
292 * that this peripheral is in apb bus. 360 * that this peripheral is in apb bus.
361 * TEGRA_PERIPH_WAR_1005168 - Apply workaround for Tegra114 MSENC bug
293 */ 362 */
294struct tegra_clk_periph_gate { 363struct tegra_clk_periph_gate {
295 u32 magic; 364 u32 magic;
@@ -309,6 +378,7 @@ struct tegra_clk_periph_gate {
309#define TEGRA_PERIPH_NO_RESET BIT(0) 378#define TEGRA_PERIPH_NO_RESET BIT(0)
310#define TEGRA_PERIPH_MANUAL_RESET BIT(1) 379#define TEGRA_PERIPH_MANUAL_RESET BIT(1)
311#define TEGRA_PERIPH_ON_APB BIT(2) 380#define TEGRA_PERIPH_ON_APB BIT(2)
381#define TEGRA_PERIPH_WAR_1005168 BIT(3)
312 382
313void tegra_periph_reset(struct tegra_clk_periph_gate *gate, bool assert); 383void tegra_periph_reset(struct tegra_clk_periph_gate *gate, bool assert);
314extern const struct clk_ops tegra_clk_periph_gate_ops; 384extern const struct clk_ops tegra_clk_periph_gate_ops;
@@ -349,21 +419,22 @@ extern const struct clk_ops tegra_clk_periph_ops;
349struct clk *tegra_clk_register_periph(const char *name, 419struct clk *tegra_clk_register_periph(const char *name,
350 const char **parent_names, int num_parents, 420 const char **parent_names, int num_parents,
351 struct tegra_clk_periph *periph, void __iomem *clk_base, 421 struct tegra_clk_periph *periph, void __iomem *clk_base,
352 u32 offset); 422 u32 offset, unsigned long flags);
353struct clk *tegra_clk_register_periph_nodiv(const char *name, 423struct clk *tegra_clk_register_periph_nodiv(const char *name,
354 const char **parent_names, int num_parents, 424 const char **parent_names, int num_parents,
355 struct tegra_clk_periph *periph, void __iomem *clk_base, 425 struct tegra_clk_periph *periph, void __iomem *clk_base,
356 u32 offset); 426 u32 offset);
357 427
358#define TEGRA_CLK_PERIPH(_mux_shift, _mux_width, _mux_flags, \ 428#define TEGRA_CLK_PERIPH(_mux_shift, _mux_mask, _mux_flags, \
359 _div_shift, _div_width, _div_frac_width, \ 429 _div_shift, _div_width, _div_frac_width, \
360 _div_flags, _clk_num, _enb_refcnt, _regs, \ 430 _div_flags, _clk_num, _enb_refcnt, _regs, \
361 _gate_flags) \ 431 _gate_flags, _table) \
362 { \ 432 { \
363 .mux = { \ 433 .mux = { \
364 .flags = _mux_flags, \ 434 .flags = _mux_flags, \
365 .shift = _mux_shift, \ 435 .shift = _mux_shift, \
366 .width = _mux_width, \ 436 .mask = _mux_mask, \
437 .table = _table, \
367 }, \ 438 }, \
368 .divider = { \ 439 .divider = { \
369 .flags = _div_flags, \ 440 .flags = _div_flags, \
@@ -391,28 +462,41 @@ struct tegra_periph_init_data {
391 u32 offset; 462 u32 offset;
392 const char *con_id; 463 const char *con_id;
393 const char *dev_id; 464 const char *dev_id;
465 unsigned long flags;
394}; 466};
395 467
396#define TEGRA_INIT_DATA(_name, _con_id, _dev_id, _parent_names, _offset, \ 468#define TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parent_names, _offset,\
397 _mux_shift, _mux_width, _mux_flags, _div_shift, \ 469 _mux_shift, _mux_mask, _mux_flags, _div_shift, \
398 _div_width, _div_frac_width, _div_flags, _regs, \ 470 _div_width, _div_frac_width, _div_flags, _regs, \
399 _clk_num, _enb_refcnt, _gate_flags, _clk_id) \ 471 _clk_num, _enb_refcnt, _gate_flags, _clk_id, _table,\
472 _flags) \
400 { \ 473 { \
401 .name = _name, \ 474 .name = _name, \
402 .clk_id = _clk_id, \ 475 .clk_id = _clk_id, \
403 .parent_names = _parent_names, \ 476 .parent_names = _parent_names, \
404 .num_parents = ARRAY_SIZE(_parent_names), \ 477 .num_parents = ARRAY_SIZE(_parent_names), \
405 .periph = TEGRA_CLK_PERIPH(_mux_shift, _mux_width, \ 478 .periph = TEGRA_CLK_PERIPH(_mux_shift, _mux_mask, \
406 _mux_flags, _div_shift, \ 479 _mux_flags, _div_shift, \
407 _div_width, _div_frac_width, \ 480 _div_width, _div_frac_width, \
408 _div_flags, _clk_num, \ 481 _div_flags, _clk_num, \
409 _enb_refcnt, _regs, \ 482 _enb_refcnt, _regs, \
410 _gate_flags), \ 483 _gate_flags, _table), \
411 .offset = _offset, \ 484 .offset = _offset, \
412 .con_id = _con_id, \ 485 .con_id = _con_id, \
413 .dev_id = _dev_id, \ 486 .dev_id = _dev_id, \
487 .flags = _flags \
414 } 488 }
415 489
490#define TEGRA_INIT_DATA(_name, _con_id, _dev_id, _parent_names, _offset,\
491 _mux_shift, _mux_width, _mux_flags, _div_shift, \
492 _div_width, _div_frac_width, _div_flags, _regs, \
493 _clk_num, _enb_refcnt, _gate_flags, _clk_id) \
494 TEGRA_INIT_DATA_TABLE(_name, _con_id, _dev_id, _parent_names, _offset,\
495 _mux_shift, BIT(_mux_width) - 1, _mux_flags, \
496 _div_shift, _div_width, _div_frac_width, _div_flags, \
497 _regs, _clk_num, _enb_refcnt, _gate_flags, _clk_id,\
498 NULL, 0)
499
416/** 500/**
417 * struct clk_super_mux - super clock 501 * struct clk_super_mux - super clock
418 * 502 *
@@ -499,4 +583,13 @@ void tegra30_clock_init(struct device_node *np);
499static inline void tegra30_clock_init(struct device_node *np) {} 583static inline void tegra30_clock_init(struct device_node *np) {}
500#endif /* CONFIG_ARCH_TEGRA_3x_SOC */ 584#endif /* CONFIG_ARCH_TEGRA_3x_SOC */
501 585
586#ifdef CONFIG_ARCH_TEGRA_114_SOC
587void tegra114_clock_init(struct device_node *np);
588#else
589static inline void tegra114_clock_init(struct device_node *np) {}
590#endif /* CONFIG_ARCH_TEGRA114_SOC */
591
592typedef void (*tegra_clk_apply_init_table_func)(void);
593extern tegra_clk_apply_init_table_func tegra_clk_apply_init_table;
594
502#endif /* TEGRA_CLK_H */ 595#endif /* TEGRA_CLK_H */
diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c
index 74faa7e3cf59..293a28854417 100644
--- a/drivers/clk/ux500/clk-prcmu.c
+++ b/drivers/clk/ux500/clk-prcmu.c
@@ -20,15 +20,23 @@
20struct clk_prcmu { 20struct clk_prcmu {
21 struct clk_hw hw; 21 struct clk_hw hw;
22 u8 cg_sel; 22 u8 cg_sel;
23 int is_prepared;
23 int is_enabled; 24 int is_enabled;
25 int opp_requested;
24}; 26};
25 27
26/* PRCMU clock operations. */ 28/* PRCMU clock operations. */
27 29
28static int clk_prcmu_prepare(struct clk_hw *hw) 30static int clk_prcmu_prepare(struct clk_hw *hw)
29{ 31{
32 int ret;
30 struct clk_prcmu *clk = to_clk_prcmu(hw); 33 struct clk_prcmu *clk = to_clk_prcmu(hw);
31 return prcmu_request_clock(clk->cg_sel, true); 34
35 ret = prcmu_request_clock(clk->cg_sel, true);
36 if (!ret)
37 clk->is_prepared = 1;
38
39 return ret;;
32} 40}
33 41
34static void clk_prcmu_unprepare(struct clk_hw *hw) 42static void clk_prcmu_unprepare(struct clk_hw *hw)
@@ -36,7 +44,15 @@ static void clk_prcmu_unprepare(struct clk_hw *hw)
36 struct clk_prcmu *clk = to_clk_prcmu(hw); 44 struct clk_prcmu *clk = to_clk_prcmu(hw);
37 if (prcmu_request_clock(clk->cg_sel, false)) 45 if (prcmu_request_clock(clk->cg_sel, false))
38 pr_err("clk_prcmu: %s failed to disable %s.\n", __func__, 46 pr_err("clk_prcmu: %s failed to disable %s.\n", __func__,
39 hw->init->name); 47 __clk_get_name(hw->clk));
48 else
49 clk->is_prepared = 0;
50}
51
52static int clk_prcmu_is_prepared(struct clk_hw *hw)
53{
54 struct clk_prcmu *clk = to_clk_prcmu(hw);
55 return clk->is_prepared;
40} 56}
41 57
42static int clk_prcmu_enable(struct clk_hw *hw) 58static int clk_prcmu_enable(struct clk_hw *hw)
@@ -79,58 +95,52 @@ static int clk_prcmu_set_rate(struct clk_hw *hw, unsigned long rate,
79 return prcmu_set_clock_rate(clk->cg_sel, rate); 95 return prcmu_set_clock_rate(clk->cg_sel, rate);
80} 96}
81 97
82static int request_ape_opp100(bool enable)
83{
84 static int reqs;
85 int err = 0;
86
87 if (enable) {
88 if (!reqs)
89 err = prcmu_qos_add_requirement(PRCMU_QOS_APE_OPP,
90 "clock", 100);
91 if (!err)
92 reqs++;
93 } else {
94 reqs--;
95 if (!reqs)
96 prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP,
97 "clock");
98 }
99 return err;
100}
101
102static int clk_prcmu_opp_prepare(struct clk_hw *hw) 98static int clk_prcmu_opp_prepare(struct clk_hw *hw)
103{ 99{
104 int err; 100 int err;
105 struct clk_prcmu *clk = to_clk_prcmu(hw); 101 struct clk_prcmu *clk = to_clk_prcmu(hw);
106 102
107 err = request_ape_opp100(true); 103 if (!clk->opp_requested) {
108 if (err) { 104 err = prcmu_qos_add_requirement(PRCMU_QOS_APE_OPP,
109 pr_err("clk_prcmu: %s failed to request APE OPP100 for %s.\n", 105 (char *)__clk_get_name(hw->clk),
110 __func__, hw->init->name); 106 100);
111 return err; 107 if (err) {
108 pr_err("clk_prcmu: %s fail req APE OPP for %s.\n",
109 __func__, __clk_get_name(hw->clk));
110 return err;
111 }
112 clk->opp_requested = 1;
112 } 113 }
113 114
114 err = prcmu_request_clock(clk->cg_sel, true); 115 err = prcmu_request_clock(clk->cg_sel, true);
115 if (err) 116 if (err) {
116 request_ape_opp100(false); 117 prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP,
118 (char *)__clk_get_name(hw->clk));
119 clk->opp_requested = 0;
120 return err;
121 }
117 122
118 return err; 123 clk->is_prepared = 1;
124 return 0;
119} 125}
120 126
121static void clk_prcmu_opp_unprepare(struct clk_hw *hw) 127static void clk_prcmu_opp_unprepare(struct clk_hw *hw)
122{ 128{
123 struct clk_prcmu *clk = to_clk_prcmu(hw); 129 struct clk_prcmu *clk = to_clk_prcmu(hw);
124 130
125 if (prcmu_request_clock(clk->cg_sel, false)) 131 if (prcmu_request_clock(clk->cg_sel, false)) {
126 goto out_error; 132 pr_err("clk_prcmu: %s failed to disable %s.\n", __func__,
127 if (request_ape_opp100(false)) 133 __clk_get_name(hw->clk));
128 goto out_error; 134 return;
129 return; 135 }
130 136
131out_error: 137 if (clk->opp_requested) {
132 pr_err("clk_prcmu: %s failed to disable %s.\n", __func__, 138 prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP,
133 hw->init->name); 139 (char *)__clk_get_name(hw->clk));
140 clk->opp_requested = 0;
141 }
142
143 clk->is_prepared = 0;
134} 144}
135 145
136static int clk_prcmu_opp_volt_prepare(struct clk_hw *hw) 146static int clk_prcmu_opp_volt_prepare(struct clk_hw *hw)
@@ -138,38 +148,49 @@ static int clk_prcmu_opp_volt_prepare(struct clk_hw *hw)
138 int err; 148 int err;
139 struct clk_prcmu *clk = to_clk_prcmu(hw); 149 struct clk_prcmu *clk = to_clk_prcmu(hw);
140 150
141 err = prcmu_request_ape_opp_100_voltage(true); 151 if (!clk->opp_requested) {
142 if (err) { 152 err = prcmu_request_ape_opp_100_voltage(true);
143 pr_err("clk_prcmu: %s failed to request APE OPP VOLT for %s.\n", 153 if (err) {
144 __func__, hw->init->name); 154 pr_err("clk_prcmu: %s fail req APE OPP VOLT for %s.\n",
145 return err; 155 __func__, __clk_get_name(hw->clk));
156 return err;
157 }
158 clk->opp_requested = 1;
146 } 159 }
147 160
148 err = prcmu_request_clock(clk->cg_sel, true); 161 err = prcmu_request_clock(clk->cg_sel, true);
149 if (err) 162 if (err) {
150 prcmu_request_ape_opp_100_voltage(false); 163 prcmu_request_ape_opp_100_voltage(false);
164 clk->opp_requested = 0;
165 return err;
166 }
151 167
152 return err; 168 clk->is_prepared = 1;
169 return 0;
153} 170}
154 171
155static void clk_prcmu_opp_volt_unprepare(struct clk_hw *hw) 172static void clk_prcmu_opp_volt_unprepare(struct clk_hw *hw)
156{ 173{
157 struct clk_prcmu *clk = to_clk_prcmu(hw); 174 struct clk_prcmu *clk = to_clk_prcmu(hw);
158 175
159 if (prcmu_request_clock(clk->cg_sel, false)) 176 if (prcmu_request_clock(clk->cg_sel, false)) {
160 goto out_error; 177 pr_err("clk_prcmu: %s failed to disable %s.\n", __func__,
161 if (prcmu_request_ape_opp_100_voltage(false)) 178 __clk_get_name(hw->clk));
162 goto out_error; 179 return;
163 return; 180 }
164 181
165out_error: 182 if (clk->opp_requested) {
166 pr_err("clk_prcmu: %s failed to disable %s.\n", __func__, 183 prcmu_request_ape_opp_100_voltage(false);
167 hw->init->name); 184 clk->opp_requested = 0;
185 }
186
187 clk->is_prepared = 0;
168} 188}
169 189
170static struct clk_ops clk_prcmu_scalable_ops = { 190static struct clk_ops clk_prcmu_scalable_ops = {
171 .prepare = clk_prcmu_prepare, 191 .prepare = clk_prcmu_prepare,
172 .unprepare = clk_prcmu_unprepare, 192 .unprepare = clk_prcmu_unprepare,
193 .is_prepared = clk_prcmu_is_prepared,
173 .enable = clk_prcmu_enable, 194 .enable = clk_prcmu_enable,
174 .disable = clk_prcmu_disable, 195 .disable = clk_prcmu_disable,
175 .is_enabled = clk_prcmu_is_enabled, 196 .is_enabled = clk_prcmu_is_enabled,
@@ -181,6 +202,7 @@ static struct clk_ops clk_prcmu_scalable_ops = {
181static struct clk_ops clk_prcmu_gate_ops = { 202static struct clk_ops clk_prcmu_gate_ops = {
182 .prepare = clk_prcmu_prepare, 203 .prepare = clk_prcmu_prepare,
183 .unprepare = clk_prcmu_unprepare, 204 .unprepare = clk_prcmu_unprepare,
205 .is_prepared = clk_prcmu_is_prepared,
184 .enable = clk_prcmu_enable, 206 .enable = clk_prcmu_enable,
185 .disable = clk_prcmu_disable, 207 .disable = clk_prcmu_disable,
186 .is_enabled = clk_prcmu_is_enabled, 208 .is_enabled = clk_prcmu_is_enabled,
@@ -202,6 +224,7 @@ static struct clk_ops clk_prcmu_rate_ops = {
202static struct clk_ops clk_prcmu_opp_gate_ops = { 224static struct clk_ops clk_prcmu_opp_gate_ops = {
203 .prepare = clk_prcmu_opp_prepare, 225 .prepare = clk_prcmu_opp_prepare,
204 .unprepare = clk_prcmu_opp_unprepare, 226 .unprepare = clk_prcmu_opp_unprepare,
227 .is_prepared = clk_prcmu_is_prepared,
205 .enable = clk_prcmu_enable, 228 .enable = clk_prcmu_enable,
206 .disable = clk_prcmu_disable, 229 .disable = clk_prcmu_disable,
207 .is_enabled = clk_prcmu_is_enabled, 230 .is_enabled = clk_prcmu_is_enabled,
@@ -211,6 +234,7 @@ static struct clk_ops clk_prcmu_opp_gate_ops = {
211static struct clk_ops clk_prcmu_opp_volt_scalable_ops = { 234static struct clk_ops clk_prcmu_opp_volt_scalable_ops = {
212 .prepare = clk_prcmu_opp_volt_prepare, 235 .prepare = clk_prcmu_opp_volt_prepare,
213 .unprepare = clk_prcmu_opp_volt_unprepare, 236 .unprepare = clk_prcmu_opp_volt_unprepare,
237 .is_prepared = clk_prcmu_is_prepared,
214 .enable = clk_prcmu_enable, 238 .enable = clk_prcmu_enable,
215 .disable = clk_prcmu_disable, 239 .disable = clk_prcmu_disable,
216 .is_enabled = clk_prcmu_is_enabled, 240 .is_enabled = clk_prcmu_is_enabled,
@@ -242,7 +266,9 @@ static struct clk *clk_reg_prcmu(const char *name,
242 } 266 }
243 267
244 clk->cg_sel = cg_sel; 268 clk->cg_sel = cg_sel;
269 clk->is_prepared = 1;
245 clk->is_enabled = 1; 270 clk->is_enabled = 1;
271 clk->opp_requested = 0;
246 /* "rate" can be used for changing the initial frequency */ 272 /* "rate" can be used for changing the initial frequency */
247 if (rate) 273 if (rate)
248 prcmu_set_clock_rate(cg_sel, rate); 274 prcmu_set_clock_rate(cg_sel, rate);
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index 1c1b15db7c4d..7c88173295aa 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o
16obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o 16obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o
17obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o 17obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o
18obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o 18obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o
19obj-$(CONFIG_ARCH_MXS) += mxs_timer.o
19obj-$(CONFIG_SUNXI_TIMER) += sunxi_timer.o 20obj-$(CONFIG_SUNXI_TIMER) += sunxi_timer.o
20obj-$(CONFIG_ARCH_TEGRA) += tegra20_timer.o 21obj-$(CONFIG_ARCH_TEGRA) += tegra20_timer.o
21obj-$(CONFIG_VT8500_TIMER) += vt8500_timer.o 22obj-$(CONFIG_VT8500_TIMER) += vt8500_timer.o
diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c
index 50c68fef944b..766611d29945 100644
--- a/drivers/clocksource/bcm2835_timer.c
+++ b/drivers/clocksource/bcm2835_timer.c
@@ -95,23 +95,13 @@ static irqreturn_t bcm2835_time_interrupt(int irq, void *dev_id)
95 } 95 }
96} 96}
97 97
98static struct of_device_id bcm2835_time_match[] __initconst = { 98static void __init bcm2835_timer_init(struct device_node *node)
99 { .compatible = "brcm,bcm2835-system-timer" },
100 {}
101};
102
103static void __init bcm2835_timer_init(void)
104{ 99{
105 struct device_node *node;
106 void __iomem *base; 100 void __iomem *base;
107 u32 freq; 101 u32 freq;
108 int irq; 102 int irq;
109 struct bcm2835_timer *timer; 103 struct bcm2835_timer *timer;
110 104
111 node = of_find_matching_node(NULL, bcm2835_time_match);
112 if (!node)
113 panic("No bcm2835 timer node");
114
115 base = of_iomap(node, 0); 105 base = of_iomap(node, 0);
116 if (!base) 106 if (!base)
117 panic("Can't remap registers"); 107 panic("Can't remap registers");
diff --git a/drivers/clocksource/clksrc-of.c b/drivers/clocksource/clksrc-of.c
index bdabdaa8d00f..3ef11fba781c 100644
--- a/drivers/clocksource/clksrc-of.c
+++ b/drivers/clocksource/clksrc-of.c
@@ -26,10 +26,10 @@ void __init clocksource_of_init(void)
26{ 26{
27 struct device_node *np; 27 struct device_node *np;
28 const struct of_device_id *match; 28 const struct of_device_id *match;
29 void (*init_func)(void); 29 void (*init_func)(struct device_node *);
30 30
31 for_each_matching_node_and_match(np, __clksrc_of_table, &match) { 31 for_each_matching_node_and_match(np, __clksrc_of_table, &match) {
32 init_func = match->data; 32 init_func = match->data;
33 init_func(); 33 init_func(np);
34 } 34 }
35} 35}
diff --git a/arch/arm/mach-mxs/timer.c b/drivers/clocksource/mxs_timer.c
index 421020498a1b..02af4204af86 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/drivers/clocksource/mxs_timer.c
@@ -26,12 +26,12 @@
26#include <linux/clockchips.h> 26#include <linux/clockchips.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_address.h>
29#include <linux/of_irq.h> 30#include <linux/of_irq.h>
31#include <linux/stmp_device.h>
30 32
31#include <asm/mach/time.h> 33#include <asm/mach/time.h>
32#include <asm/sched_clock.h> 34#include <asm/sched_clock.h>
33#include <mach/mxs.h>
34#include <mach/common.h>
35 35
36/* 36/*
37 * There are 2 versions of the timrot on Freescale MXS-based SoCs. 37 * There are 2 versions of the timrot on Freescale MXS-based SoCs.
@@ -79,25 +79,25 @@
79static struct clock_event_device mxs_clockevent_device; 79static struct clock_event_device mxs_clockevent_device;
80static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED; 80static enum clock_event_mode mxs_clockevent_mode = CLOCK_EVT_MODE_UNUSED;
81 81
82static void __iomem *mxs_timrot_base = MXS_IO_ADDRESS(MXS_TIMROT_BASE_ADDR); 82static void __iomem *mxs_timrot_base;
83static u32 timrot_major_version; 83static u32 timrot_major_version;
84 84
85static inline void timrot_irq_disable(void) 85static inline void timrot_irq_disable(void)
86{ 86{
87 __mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ_EN, 87 __raw_writel(BM_TIMROT_TIMCTRLn_IRQ_EN, mxs_timrot_base +
88 mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); 88 HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_CLR);
89} 89}
90 90
91static inline void timrot_irq_enable(void) 91static inline void timrot_irq_enable(void)
92{ 92{
93 __mxs_setl(BM_TIMROT_TIMCTRLn_IRQ_EN, 93 __raw_writel(BM_TIMROT_TIMCTRLn_IRQ_EN, mxs_timrot_base +
94 mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); 94 HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_SET);
95} 95}
96 96
97static void timrot_irq_acknowledge(void) 97static void timrot_irq_acknowledge(void)
98{ 98{
99 __mxs_clrl(BM_TIMROT_TIMCTRLn_IRQ, 99 __raw_writel(BM_TIMROT_TIMCTRLn_IRQ, mxs_timrot_base +
100 mxs_timrot_base + HW_TIMROT_TIMCTRLn(0)); 100 HW_TIMROT_TIMCTRLn(0) + STMP_OFFSET_REG_CLR);
101} 101}
102 102
103static cycle_t timrotv1_get_cycles(struct clocksource *cs) 103static cycle_t timrotv1_get_cycles(struct clocksource *cs)
@@ -242,19 +242,15 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)
242 return 0; 242 return 0;
243} 243}
244 244
245void __init mxs_timer_init(void) 245static void __init mxs_timer_init(struct device_node *np)
246{ 246{
247 struct device_node *np;
248 struct clk *timer_clk; 247 struct clk *timer_clk;
249 int irq; 248 int irq;
250 249
251 np = of_find_compatible_node(NULL, NULL, "fsl,timrot"); 250 mxs_timrot_base = of_iomap(np, 0);
252 if (!np) { 251 WARN_ON(!mxs_timrot_base);
253 pr_err("%s: failed find timrot node\n", __func__);
254 return;
255 }
256 252
257 timer_clk = clk_get_sys("timrot", NULL); 253 timer_clk = of_clk_get(np, 0);
258 if (IS_ERR(timer_clk)) { 254 if (IS_ERR(timer_clk)) {
259 pr_err("%s: failed to get clk\n", __func__); 255 pr_err("%s: failed to get clk\n", __func__);
260 return; 256 return;
@@ -265,11 +261,12 @@ void __init mxs_timer_init(void)
265 /* 261 /*
266 * Initialize timers to a known state 262 * Initialize timers to a known state
267 */ 263 */
268 mxs_reset_block(mxs_timrot_base + HW_TIMROT_ROTCTRL); 264 stmp_reset_block(mxs_timrot_base + HW_TIMROT_ROTCTRL);
269 265
270 /* get timrot version */ 266 /* get timrot version */
271 timrot_major_version = __raw_readl(mxs_timrot_base + 267 timrot_major_version = __raw_readl(mxs_timrot_base +
272 (cpu_is_mx23() ? MX23_TIMROT_VERSION_OFFSET : 268 (of_device_is_compatible(np, "fsl,imx23-timrot") ?
269 MX23_TIMROT_VERSION_OFFSET :
273 MX28_TIMROT_VERSION_OFFSET)); 270 MX28_TIMROT_VERSION_OFFSET));
274 timrot_major_version >>= BP_TIMROT_MAJOR_VERSION; 271 timrot_major_version >>= BP_TIMROT_MAJOR_VERSION;
275 272
@@ -304,3 +301,4 @@ void __init mxs_timer_init(void)
304 irq = irq_of_parse_and_map(np, 0); 301 irq = irq_of_parse_and_map(np, 0);
305 setup_irq(irq, &mxs_timer_irq); 302 setup_irq(irq, &mxs_timer_irq);
306} 303}
304CLOCKSOURCE_OF_DECLARE(mxs, "fsl,timrot", mxs_timer_init);
diff --git a/drivers/clocksource/sunxi_timer.c b/drivers/clocksource/sunxi_timer.c
index 4086b9167159..0ce85e29769b 100644
--- a/drivers/clocksource/sunxi_timer.c
+++ b/drivers/clocksource/sunxi_timer.c
@@ -23,7 +23,7 @@
23#include <linux/of_address.h> 23#include <linux/of_address.h>
24#include <linux/of_irq.h> 24#include <linux/of_irq.h>
25#include <linux/sunxi_timer.h> 25#include <linux/sunxi_timer.h>
26#include <linux/clk-provider.h> 26#include <linux/clk/sunxi.h>
27 27
28#define TIMER_CTL_REG 0x00 28#define TIMER_CTL_REG 0x00
29#define TIMER_CTL_ENABLE (1 << 0) 29#define TIMER_CTL_ENABLE (1 << 0)
@@ -123,7 +123,7 @@ void __init sunxi_timer_init(void)
123 if (irq <= 0) 123 if (irq <= 0)
124 panic("Can't parse IRQ"); 124 panic("Can't parse IRQ");
125 125
126 of_clk_init(NULL); 126 sunxi_init_clocks();
127 127
128 clk = of_clk_get(node, 0); 128 clk = of_clk_get(node, 0);
129 if (IS_ERR(clk)) 129 if (IS_ERR(clk))
diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c
index 0bde03feb095..ae877b021b54 100644
--- a/drivers/clocksource/tegra20_timer.c
+++ b/drivers/clocksource/tegra20_timer.c
@@ -154,29 +154,12 @@ static struct irqaction tegra_timer_irq = {
154 .dev_id = &tegra_clockevent, 154 .dev_id = &tegra_clockevent,
155}; 155};
156 156
157static const struct of_device_id timer_match[] __initconst = { 157static void __init tegra20_init_timer(struct device_node *np)
158 { .compatible = "nvidia,tegra20-timer" },
159 {}
160};
161
162static const struct of_device_id rtc_match[] __initconst = {
163 { .compatible = "nvidia,tegra20-rtc" },
164 {}
165};
166
167static void __init tegra20_init_timer(void)
168{ 158{
169 struct device_node *np;
170 struct clk *clk; 159 struct clk *clk;
171 unsigned long rate; 160 unsigned long rate;
172 int ret; 161 int ret;
173 162
174 np = of_find_matching_node(NULL, timer_match);
175 if (!np) {
176 pr_err("Failed to find timer DT node\n");
177 BUG();
178 }
179
180 timer_reg_base = of_iomap(np, 0); 163 timer_reg_base = of_iomap(np, 0);
181 if (!timer_reg_base) { 164 if (!timer_reg_base) {
182 pr_err("Can't map timer registers\n"); 165 pr_err("Can't map timer registers\n");
@@ -189,7 +172,7 @@ static void __init tegra20_init_timer(void)
189 BUG(); 172 BUG();
190 } 173 }
191 174
192 clk = clk_get_sys("timer", NULL); 175 clk = of_clk_get(np, 0);
193 if (IS_ERR(clk)) { 176 if (IS_ERR(clk)) {
194 pr_warn("Unable to get timer clock. Assuming 12Mhz input clock.\n"); 177 pr_warn("Unable to get timer clock. Assuming 12Mhz input clock.\n");
195 rate = 12000000; 178 rate = 12000000;
@@ -200,30 +183,6 @@ static void __init tegra20_init_timer(void)
200 183
201 of_node_put(np); 184 of_node_put(np);
202 185
203 np = of_find_matching_node(NULL, rtc_match);
204 if (!np) {
205 pr_err("Failed to find RTC DT node\n");
206 BUG();
207 }
208
209 rtc_base = of_iomap(np, 0);
210 if (!rtc_base) {
211 pr_err("Can't map RTC registers");
212 BUG();
213 }
214
215 /*
216 * rtc registers are used by read_persistent_clock, keep the rtc clock
217 * enabled
218 */
219 clk = clk_get_sys("rtc-tegra", NULL);
220 if (IS_ERR(clk))
221 pr_warn("Unable to get rtc-tegra clock\n");
222 else
223 clk_prepare_enable(clk);
224
225 of_node_put(np);
226
227 switch (rate) { 186 switch (rate) {
228 case 12000000: 187 case 12000000:
229 timer_writel(0x000b, TIMERUS_USEC_CFG); 188 timer_writel(0x000b, TIMERUS_USEC_CFG);
@@ -259,12 +218,34 @@ static void __init tegra20_init_timer(void)
259 tegra_clockevent.irq = tegra_timer_irq.irq; 218 tegra_clockevent.irq = tegra_timer_irq.irq;
260 clockevents_config_and_register(&tegra_clockevent, 1000000, 219 clockevents_config_and_register(&tegra_clockevent, 1000000,
261 0x1, 0x1fffffff); 220 0x1, 0x1fffffff);
262#ifdef CONFIG_HAVE_ARM_TWD 221}
263 twd_local_timer_of_register(); 222CLOCKSOURCE_OF_DECLARE(tegra20_timer, "nvidia,tegra20-timer", tegra20_init_timer);
264#endif 223
224static void __init tegra20_init_rtc(struct device_node *np)
225{
226 struct clk *clk;
227
228 rtc_base = of_iomap(np, 0);
229 if (!rtc_base) {
230 pr_err("Can't map RTC registers");
231 BUG();
232 }
233
234 /*
235 * rtc registers are used by read_persistent_clock, keep the rtc clock
236 * enabled
237 */
238 clk = of_clk_get(np, 0);
239 if (IS_ERR(clk))
240 pr_warn("Unable to get rtc-tegra clock\n");
241 else
242 clk_prepare_enable(clk);
243
244 of_node_put(np);
245
265 register_persistent_clock(NULL, tegra_read_persistent_clock); 246 register_persistent_clock(NULL, tegra_read_persistent_clock);
266} 247}
267CLOCKSOURCE_OF_DECLARE(tegra20, "nvidia,tegra20-timer", tegra20_init_timer); 248CLOCKSOURCE_OF_DECLARE(tegra20_rtc, "nvidia,tegra20-rtc", tegra20_init_rtc);
268 249
269#ifdef CONFIG_PM 250#ifdef CONFIG_PM
270static u32 usec_config; 251static u32 usec_config;
diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index 8efc86b5b5dd..242255285597 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -129,22 +129,10 @@ static struct irqaction irq = {
129 .dev_id = &clockevent, 129 .dev_id = &clockevent,
130}; 130};
131 131
132static struct of_device_id vt8500_timer_ids[] = { 132static void __init vt8500_timer_init(struct device_node *np)
133 { .compatible = "via,vt8500-timer" },
134 { }
135};
136
137static void __init vt8500_timer_init(void)
138{ 133{
139 struct device_node *np;
140 int timer_irq; 134 int timer_irq;
141 135
142 np = of_find_matching_node(NULL, vt8500_timer_ids);
143 if (!np) {
144 pr_err("%s: Timer description missing from Device Tree\n",
145 __func__);
146 return;
147 }
148 regbase = of_iomap(np, 0); 136 regbase = of_iomap(np, 0);
149 if (!regbase) { 137 if (!regbase) {
150 pr_err("%s: Missing iobase description in Device Tree\n", 138 pr_err("%s: Missing iobase description in Device Tree\n",
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 8f6d30d37c45..b48a79c28845 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -27,6 +27,7 @@
27#include <linux/stmp_device.h> 27#include <linux/stmp_device.h>
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_device.h> 29#include <linux/of_device.h>
30#include <linux/of_dma.h>
30 31
31#include <asm/irq.h> 32#include <asm/irq.h>
32 33
@@ -139,6 +140,8 @@ struct mxs_dma_engine {
139 struct dma_device dma_device; 140 struct dma_device dma_device;
140 struct device_dma_parameters dma_parms; 141 struct device_dma_parameters dma_parms;
141 struct mxs_dma_chan mxs_chans[MXS_DMA_CHANNELS]; 142 struct mxs_dma_chan mxs_chans[MXS_DMA_CHANNELS];
143 struct platform_device *pdev;
144 unsigned int nr_channels;
142}; 145};
143 146
144struct mxs_dma_type { 147struct mxs_dma_type {
@@ -350,10 +353,8 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan)
350 struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma; 353 struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
351 int ret; 354 int ret;
352 355
353 if (!data) 356 if (data)
354 return -EINVAL; 357 mxs_chan->chan_irq = data->chan_irq;
355
356 mxs_chan->chan_irq = data->chan_irq;
357 358
358 mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev, 359 mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev,
359 CCW_BLOCK_SIZE, &mxs_chan->ccw_phys, 360 CCW_BLOCK_SIZE, &mxs_chan->ccw_phys,
@@ -665,8 +666,55 @@ err_out:
665 return ret; 666 return ret;
666} 667}
667 668
669struct mxs_dma_filter_param {
670 struct device_node *of_node;
671 unsigned int chan_id;
672};
673
674static bool mxs_dma_filter_fn(struct dma_chan *chan, void *fn_param)
675{
676 struct mxs_dma_filter_param *param = fn_param;
677 struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
678 struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
679 int chan_irq;
680
681 if (mxs_dma->dma_device.dev->of_node != param->of_node)
682 return false;
683
684 if (chan->chan_id != param->chan_id)
685 return false;
686
687 chan_irq = platform_get_irq(mxs_dma->pdev, param->chan_id);
688 if (chan_irq < 0)
689 return false;
690
691 mxs_chan->chan_irq = chan_irq;
692
693 return true;
694}
695
696struct dma_chan *mxs_dma_xlate(struct of_phandle_args *dma_spec,
697 struct of_dma *ofdma)
698{
699 struct mxs_dma_engine *mxs_dma = ofdma->of_dma_data;
700 dma_cap_mask_t mask = mxs_dma->dma_device.cap_mask;
701 struct mxs_dma_filter_param param;
702
703 if (dma_spec->args_count != 1)
704 return NULL;
705
706 param.of_node = ofdma->of_node;
707 param.chan_id = dma_spec->args[0];
708
709 if (param.chan_id >= mxs_dma->nr_channels)
710 return NULL;
711
712 return dma_request_channel(mask, mxs_dma_filter_fn, &param);
713}
714
668static int __init mxs_dma_probe(struct platform_device *pdev) 715static int __init mxs_dma_probe(struct platform_device *pdev)
669{ 716{
717 struct device_node *np = pdev->dev.of_node;
670 const struct platform_device_id *id_entry; 718 const struct platform_device_id *id_entry;
671 const struct of_device_id *of_id; 719 const struct of_device_id *of_id;
672 const struct mxs_dma_type *dma_type; 720 const struct mxs_dma_type *dma_type;
@@ -674,10 +722,16 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
674 struct resource *iores; 722 struct resource *iores;
675 int ret, i; 723 int ret, i;
676 724
677 mxs_dma = kzalloc(sizeof(*mxs_dma), GFP_KERNEL); 725 mxs_dma = devm_kzalloc(&pdev->dev, sizeof(*mxs_dma), GFP_KERNEL);
678 if (!mxs_dma) 726 if (!mxs_dma)
679 return -ENOMEM; 727 return -ENOMEM;
680 728
729 ret = of_property_read_u32(np, "dma-channels", &mxs_dma->nr_channels);
730 if (ret) {
731 dev_err(&pdev->dev, "failed to read dma-channels\n");
732 return ret;
733 }
734
681 of_id = of_match_device(mxs_dma_dt_ids, &pdev->dev); 735 of_id = of_match_device(mxs_dma_dt_ids, &pdev->dev);
682 if (of_id) 736 if (of_id)
683 id_entry = of_id->data; 737 id_entry = of_id->data;
@@ -689,24 +743,13 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
689 mxs_dma->dev_id = dma_type->id; 743 mxs_dma->dev_id = dma_type->id;
690 744
691 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 745 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
746 mxs_dma->base = devm_ioremap_resource(&pdev->dev, iores);
747 if (IS_ERR(mxs_dma->base))
748 return PTR_ERR(mxs_dma->base);
692 749
693 if (!request_mem_region(iores->start, resource_size(iores), 750 mxs_dma->clk = devm_clk_get(&pdev->dev, NULL);
694 pdev->name)) { 751 if (IS_ERR(mxs_dma->clk))
695 ret = -EBUSY; 752 return PTR_ERR(mxs_dma->clk);
696 goto err_request_region;
697 }
698
699 mxs_dma->base = ioremap(iores->start, resource_size(iores));
700 if (!mxs_dma->base) {
701 ret = -ENOMEM;
702 goto err_ioremap;
703 }
704
705 mxs_dma->clk = clk_get(&pdev->dev, NULL);
706 if (IS_ERR(mxs_dma->clk)) {
707 ret = PTR_ERR(mxs_dma->clk);
708 goto err_clk;
709 }
710 753
711 dma_cap_set(DMA_SLAVE, mxs_dma->dma_device.cap_mask); 754 dma_cap_set(DMA_SLAVE, mxs_dma->dma_device.cap_mask);
712 dma_cap_set(DMA_CYCLIC, mxs_dma->dma_device.cap_mask); 755 dma_cap_set(DMA_CYCLIC, mxs_dma->dma_device.cap_mask);
@@ -732,8 +775,9 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
732 775
733 ret = mxs_dma_init(mxs_dma); 776 ret = mxs_dma_init(mxs_dma);
734 if (ret) 777 if (ret)
735 goto err_init; 778 return ret;
736 779
780 mxs_dma->pdev = pdev;
737 mxs_dma->dma_device.dev = &pdev->dev; 781 mxs_dma->dma_device.dev = &pdev->dev;
738 782
739 /* mxs_dma gets 65535 bytes maximum sg size */ 783 /* mxs_dma gets 65535 bytes maximum sg size */
@@ -751,22 +795,19 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
751 ret = dma_async_device_register(&mxs_dma->dma_device); 795 ret = dma_async_device_register(&mxs_dma->dma_device);
752 if (ret) { 796 if (ret) {
753 dev_err(mxs_dma->dma_device.dev, "unable to register\n"); 797 dev_err(mxs_dma->dma_device.dev, "unable to register\n");
754 goto err_init; 798 return ret;
799 }
800
801 ret = of_dma_controller_register(np, mxs_dma_xlate, mxs_dma);
802 if (ret) {
803 dev_err(mxs_dma->dma_device.dev,
804 "failed to register controller\n");
805 dma_async_device_unregister(&mxs_dma->dma_device);
755 } 806 }
756 807
757 dev_info(mxs_dma->dma_device.dev, "initialized\n"); 808 dev_info(mxs_dma->dma_device.dev, "initialized\n");
758 809
759 return 0; 810 return 0;
760
761err_init:
762 clk_put(mxs_dma->clk);
763err_clk:
764 iounmap(mxs_dma->base);
765err_ioremap:
766 release_mem_region(iores->start, resource_size(iores));
767err_request_region:
768 kfree(mxs_dma);
769 return ret;
770} 811}
771 812
772static struct platform_driver mxs_dma_driver = { 813static struct platform_driver mxs_dma_driver = {
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 414ad912232f..e3956359202c 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -72,6 +72,7 @@ struct tegra_gpio_bank {
72 u32 oe[4]; 72 u32 oe[4];
73 u32 int_enb[4]; 73 u32 int_enb[4];
74 u32 int_lvl[4]; 74 u32 int_lvl[4];
75 u32 wake_enb[4];
75#endif 76#endif
76}; 77};
77 78
@@ -333,15 +334,31 @@ static int tegra_gpio_suspend(struct device *dev)
333 bank->oe[p] = tegra_gpio_readl(GPIO_OE(gpio)); 334 bank->oe[p] = tegra_gpio_readl(GPIO_OE(gpio));
334 bank->int_enb[p] = tegra_gpio_readl(GPIO_INT_ENB(gpio)); 335 bank->int_enb[p] = tegra_gpio_readl(GPIO_INT_ENB(gpio));
335 bank->int_lvl[p] = tegra_gpio_readl(GPIO_INT_LVL(gpio)); 336 bank->int_lvl[p] = tegra_gpio_readl(GPIO_INT_LVL(gpio));
337
338 /* Enable gpio irq for wake up source */
339 tegra_gpio_writel(bank->wake_enb[p],
340 GPIO_INT_ENB(gpio));
336 } 341 }
337 } 342 }
338 local_irq_restore(flags); 343 local_irq_restore(flags);
339 return 0; 344 return 0;
340} 345}
341 346
342static int tegra_gpio_wake_enable(struct irq_data *d, unsigned int enable) 347static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
343{ 348{
344 struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d); 349 struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d);
350 int gpio = d->hwirq;
351 u32 port, bit, mask;
352
353 port = GPIO_PORT(gpio);
354 bit = GPIO_BIT(gpio);
355 mask = BIT(bit);
356
357 if (enable)
358 bank->wake_enb[port] |= mask;
359 else
360 bank->wake_enb[port] &= ~mask;
361
345 return irq_set_irq_wake(bank->irq, enable); 362 return irq_set_irq_wake(bank->irq, enable);
346} 363}
347#endif 364#endif
@@ -353,7 +370,7 @@ static struct irq_chip tegra_gpio_irq_chip = {
353 .irq_unmask = tegra_gpio_irq_unmask, 370 .irq_unmask = tegra_gpio_irq_unmask,
354 .irq_set_type = tegra_gpio_irq_set_type, 371 .irq_set_type = tegra_gpio_irq_set_type,
355#ifdef CONFIG_PM_SLEEP 372#ifdef CONFIG_PM_SLEEP
356 .irq_set_wake = tegra_gpio_wake_enable, 373 .irq_set_wake = tegra_gpio_irq_set_wake,
357#endif 374#endif
358}; 375};
359 376
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index 120f24646696..d1ba6b403b84 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -31,7 +31,6 @@
31#include <linux/of_i2c.h> 31#include <linux/of_i2c.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/dmaengine.h> 33#include <linux/dmaengine.h>
34#include <linux/fsl/mxs-dma.h>
35 34
36#define DRIVER_NAME "mxs-i2c" 35#define DRIVER_NAME "mxs-i2c"
37 36
@@ -113,9 +112,7 @@ struct mxs_i2c_dev {
113 uint32_t timing1; 112 uint32_t timing1;
114 113
115 /* DMA support components */ 114 /* DMA support components */
116 int dma_channel;
117 struct dma_chan *dmach; 115 struct dma_chan *dmach;
118 struct mxs_dma_data dma_data;
119 uint32_t pio_data[2]; 116 uint32_t pio_data[2];
120 uint32_t addr_data; 117 uint32_t addr_data;
121 struct scatterlist sg_io[2]; 118 struct scatterlist sg_io[2];
@@ -518,21 +515,6 @@ static const struct i2c_algorithm mxs_i2c_algo = {
518 .functionality = mxs_i2c_func, 515 .functionality = mxs_i2c_func,
519}; 516};
520 517
521static bool mxs_i2c_dma_filter(struct dma_chan *chan, void *param)
522{
523 struct mxs_i2c_dev *i2c = param;
524
525 if (!mxs_dma_is_apbx(chan))
526 return false;
527
528 if (chan->chan_id != i2c->dma_channel)
529 return false;
530
531 chan->private = &i2c->dma_data;
532
533 return true;
534}
535
536static void mxs_i2c_derive_timing(struct mxs_i2c_dev *i2c, int speed) 518static void mxs_i2c_derive_timing(struct mxs_i2c_dev *i2c, int speed)
537{ 519{
538 /* The I2C block clock run at 24MHz */ 520 /* The I2C block clock run at 24MHz */
@@ -577,17 +559,6 @@ static int mxs_i2c_get_ofdata(struct mxs_i2c_dev *i2c)
577 struct device_node *node = dev->of_node; 559 struct device_node *node = dev->of_node;
578 int ret; 560 int ret;
579 561
580 /*
581 * TODO: This is a temporary solution and should be changed
582 * to use generic DMA binding later when the helpers get in.
583 */
584 ret = of_property_read_u32(node, "fsl,i2c-dma-channel",
585 &i2c->dma_channel);
586 if (ret) {
587 dev_err(dev, "Failed to get DMA channel!\n");
588 return -ENODEV;
589 }
590
591 ret = of_property_read_u32(node, "clock-frequency", &speed); 562 ret = of_property_read_u32(node, "clock-frequency", &speed);
592 if (ret) { 563 if (ret) {
593 dev_warn(dev, "No I2C speed selected, using 100kHz\n"); 564 dev_warn(dev, "No I2C speed selected, using 100kHz\n");
@@ -607,8 +578,7 @@ static int mxs_i2c_probe(struct platform_device *pdev)
607 struct pinctrl *pinctrl; 578 struct pinctrl *pinctrl;
608 struct resource *res; 579 struct resource *res;
609 resource_size_t res_size; 580 resource_size_t res_size;
610 int err, irq, dmairq; 581 int err, irq;
611 dma_cap_mask_t mask;
612 582
613 pinctrl = devm_pinctrl_get_select_default(dev); 583 pinctrl = devm_pinctrl_get_select_default(dev);
614 if (IS_ERR(pinctrl)) 584 if (IS_ERR(pinctrl))
@@ -620,9 +590,8 @@ static int mxs_i2c_probe(struct platform_device *pdev)
620 590
621 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 591 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
622 irq = platform_get_irq(pdev, 0); 592 irq = platform_get_irq(pdev, 0);
623 dmairq = platform_get_irq(pdev, 1);
624 593
625 if (!res || irq < 0 || dmairq < 0) 594 if (!res || irq < 0)
626 return -ENOENT; 595 return -ENOENT;
627 596
628 res_size = resource_size(res); 597 res_size = resource_size(res);
@@ -648,10 +617,7 @@ static int mxs_i2c_probe(struct platform_device *pdev)
648 } 617 }
649 618
650 /* Setup the DMA */ 619 /* Setup the DMA */
651 dma_cap_zero(mask); 620 i2c->dmach = dma_request_slave_channel(dev, "rx-tx");
652 dma_cap_set(DMA_SLAVE, mask);
653 i2c->dma_data.chan_irq = dmairq;
654 i2c->dmach = dma_request_channel(mask, mxs_i2c_dma_filter, i2c);
655 if (!i2c->dmach) { 621 if (!i2c->dmach) {
656 dev_err(dev, "Failed to request dma\n"); 622 dev_err(dev, "Failed to request dma\n");
657 return -ENODEV; 623 return -ENODEV;
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index 98e3b87bdf1b..9d8f4f1c6e39 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -2,6 +2,7 @@ obj-$(CONFIG_IRQCHIP) += irqchip.o
2 2
3obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o 3obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o
4obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o 4obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o
5obj-$(CONFIG_ARCH_MXS) += irq-mxs.o
5obj-$(CONFIG_METAG) += irq-metag-ext.o 6obj-$(CONFIG_METAG) += irq-metag-ext.o
6obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o 7obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o
7obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o 8obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o
diff --git a/arch/arm/mach-mxs/icoll.c b/drivers/irqchip/irq-mxs.c
index e26eeba46598..29889bbdcc6d 100644
--- a/arch/arm/mach-mxs/icoll.c
+++ b/drivers/irqchip/irq-mxs.c
@@ -22,10 +22,12 @@
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 <linux/of_address.h>
25#include <linux/of_irq.h> 26#include <linux/of_irq.h>
27#include <linux/stmp_device.h>
26#include <asm/exception.h> 28#include <asm/exception.h>
27#include <mach/mxs.h> 29
28#include <mach/common.h> 30#include "irqchip.h"
29 31
30#define HW_ICOLL_VECTOR 0x0000 32#define HW_ICOLL_VECTOR 0x0000
31#define HW_ICOLL_LEVELACK 0x0010 33#define HW_ICOLL_LEVELACK 0x0010
@@ -38,7 +40,7 @@
38 40
39#define ICOLL_NUM_IRQS 128 41#define ICOLL_NUM_IRQS 128
40 42
41static void __iomem *icoll_base = MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR); 43static void __iomem *icoll_base;
42static struct irq_domain *icoll_domain; 44static struct irq_domain *icoll_domain;
43 45
44static void icoll_ack_irq(struct irq_data *d) 46static void icoll_ack_irq(struct irq_data *d)
@@ -103,23 +105,17 @@ static struct irq_domain_ops icoll_irq_domain_ops = {
103static void __init icoll_of_init(struct device_node *np, 105static void __init icoll_of_init(struct device_node *np,
104 struct device_node *interrupt_parent) 106 struct device_node *interrupt_parent)
105{ 107{
108 icoll_base = of_iomap(np, 0);
109 WARN_ON(!icoll_base);
110
106 /* 111 /*
107 * Interrupt Collector reset, which initializes the priority 112 * Interrupt Collector reset, which initializes the priority
108 * for each irq to level 0. 113 * for each irq to level 0.
109 */ 114 */
110 mxs_reset_block(icoll_base + HW_ICOLL_CTRL); 115 stmp_reset_block(icoll_base + HW_ICOLL_CTRL);
111 116
112 icoll_domain = irq_domain_add_linear(np, ICOLL_NUM_IRQS, 117 icoll_domain = irq_domain_add_linear(np, ICOLL_NUM_IRQS,
113 &icoll_irq_domain_ops, NULL); 118 &icoll_irq_domain_ops, NULL);
114 WARN_ON(!icoll_domain); 119 WARN_ON(!icoll_domain);
115} 120}
116 121IRQCHIP_DECLARE(mxs, "fsl,icoll", icoll_of_init);
117static const struct of_device_id icoll_of_match[] __initconst = {
118 {.compatible = "fsl,icoll", .data = icoll_of_init},
119 { /* sentinel */ }
120};
121
122void __init icoll_init_irq(void)
123{
124 of_irq_init(icoll_of_match);
125}
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 20636772c09b..f8a96d652e9e 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -34,6 +34,8 @@
34#include <linux/dma-mapping.h> 34#include <linux/dma-mapping.h>
35#include <linux/edma.h> 35#include <linux/edma.h>
36#include <linux/mmc/mmc.h> 36#include <linux/mmc/mmc.h>
37#include <linux/of.h>
38#include <linux/of_device.h>
37 39
38#include <linux/platform_data/mmc-davinci.h> 40#include <linux/platform_data/mmc-davinci.h>
39 41
@@ -522,14 +524,16 @@ static int __init davinci_acquire_dma_channels(struct mmc_davinci_host *host)
522 dma_cap_set(DMA_SLAVE, mask); 524 dma_cap_set(DMA_SLAVE, mask);
523 525
524 host->dma_tx = 526 host->dma_tx =
525 dma_request_channel(mask, edma_filter_fn, &host->txdma); 527 dma_request_slave_channel_compat(mask, edma_filter_fn,
528 &host->txdma, mmc_dev(host->mmc), "tx");
526 if (!host->dma_tx) { 529 if (!host->dma_tx) {
527 dev_err(mmc_dev(host->mmc), "Can't get dma_tx channel\n"); 530 dev_err(mmc_dev(host->mmc), "Can't get dma_tx channel\n");
528 return -ENODEV; 531 return -ENODEV;
529 } 532 }
530 533
531 host->dma_rx = 534 host->dma_rx =
532 dma_request_channel(mask, edma_filter_fn, &host->rxdma); 535 dma_request_slave_channel_compat(mask, edma_filter_fn,
536 &host->rxdma, mmc_dev(host->mmc), "rx");
533 if (!host->dma_rx) { 537 if (!host->dma_rx) {
534 dev_err(mmc_dev(host->mmc), "Can't get dma_rx channel\n"); 538 dev_err(mmc_dev(host->mmc), "Can't get dma_rx channel\n");
535 r = -ENODEV; 539 r = -ENODEV;
@@ -1157,16 +1161,86 @@ static void __init init_mmcsd_host(struct mmc_davinci_host *host)
1157 mmc_davinci_reset_ctrl(host, 0); 1161 mmc_davinci_reset_ctrl(host, 0);
1158} 1162}
1159 1163
1160static int __init davinci_mmcsd_probe(struct platform_device *pdev) 1164static struct platform_device_id davinci_mmc_devtype[] = {
1165 {
1166 .name = "dm6441-mmc",
1167 .driver_data = MMC_CTLR_VERSION_1,
1168 }, {
1169 .name = "da830-mmc",
1170 .driver_data = MMC_CTLR_VERSION_2,
1171 },
1172 {},
1173};
1174MODULE_DEVICE_TABLE(platform, davinci_mmc_devtype);
1175
1176static const struct of_device_id davinci_mmc_dt_ids[] = {
1177 {
1178 .compatible = "ti,dm6441-mmc",
1179 .data = &davinci_mmc_devtype[MMC_CTLR_VERSION_1],
1180 },
1181 {
1182 .compatible = "ti,da830-mmc",
1183 .data = &davinci_mmc_devtype[MMC_CTLR_VERSION_2],
1184 },
1185 {},
1186};
1187MODULE_DEVICE_TABLE(of, davinci_mmc_dt_ids);
1188
1189static struct davinci_mmc_config
1190 *mmc_parse_pdata(struct platform_device *pdev)
1161{ 1191{
1192 struct device_node *np;
1162 struct davinci_mmc_config *pdata = pdev->dev.platform_data; 1193 struct davinci_mmc_config *pdata = pdev->dev.platform_data;
1194 const struct of_device_id *match =
1195 of_match_device(of_match_ptr(davinci_mmc_dt_ids), &pdev->dev);
1196 u32 data;
1197
1198 np = pdev->dev.of_node;
1199 if (!np)
1200 return pdata;
1201
1202 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
1203 if (!pdata) {
1204 dev_err(&pdev->dev, "Failed to allocate memory for struct davinci_mmc_config\n");
1205 goto nodata;
1206 }
1207
1208 if (match)
1209 pdev->id_entry = match->data;
1210
1211 if (of_property_read_u32(np, "max-frequency", &pdata->max_freq))
1212 dev_info(&pdev->dev, "'max-frequency' property not specified, defaulting to 25MHz\n");
1213
1214 of_property_read_u32(np, "bus-width", &data);
1215 switch (data) {
1216 case 1:
1217 case 4:
1218 case 8:
1219 pdata->wires = data;
1220 break;
1221 default:
1222 pdata->wires = 1;
1223 dev_info(&pdev->dev, "Unsupported buswidth, defaulting to 1 bit\n");
1224 }
1225nodata:
1226 return pdata;
1227}
1228
1229static int __init davinci_mmcsd_probe(struct platform_device *pdev)
1230{
1231 struct davinci_mmc_config *pdata = NULL;
1163 struct mmc_davinci_host *host = NULL; 1232 struct mmc_davinci_host *host = NULL;
1164 struct mmc_host *mmc = NULL; 1233 struct mmc_host *mmc = NULL;
1165 struct resource *r, *mem = NULL; 1234 struct resource *r, *mem = NULL;
1166 int ret = 0, irq = 0; 1235 int ret = 0, irq = 0;
1167 size_t mem_size; 1236 size_t mem_size;
1237 const struct platform_device_id *id_entry;
1168 1238
1169 /* REVISIT: when we're fully converted, fail if pdata is NULL */ 1239 pdata = mmc_parse_pdata(pdev);
1240 if (pdata == NULL) {
1241 dev_err(&pdev->dev, "Couldn't get platform data\n");
1242 return -ENOENT;
1243 }
1170 1244
1171 ret = -ENODEV; 1245 ret = -ENODEV;
1172 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1246 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1237,7 +1311,9 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
1237 if (pdata && (pdata->wires == 8)) 1311 if (pdata && (pdata->wires == 8))
1238 mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); 1312 mmc->caps |= (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA);
1239 1313
1240 host->version = pdata->version; 1314 id_entry = platform_get_device_id(pdev);
1315 if (id_entry)
1316 host->version = id_entry->driver_data;
1241 1317
1242 mmc->ops = &mmc_davinci_ops; 1318 mmc->ops = &mmc_davinci_ops;
1243 mmc->f_min = 312500; 1319 mmc->f_min = 312500;
@@ -1406,8 +1482,10 @@ static struct platform_driver davinci_mmcsd_driver = {
1406 .name = "davinci_mmc", 1482 .name = "davinci_mmc",
1407 .owner = THIS_MODULE, 1483 .owner = THIS_MODULE,
1408 .pm = davinci_mmcsd_pm_ops, 1484 .pm = davinci_mmcsd_pm_ops,
1485 .of_match_table = of_match_ptr(davinci_mmc_dt_ids),
1409 }, 1486 },
1410 .remove = __exit_p(davinci_mmcsd_remove), 1487 .remove = __exit_p(davinci_mmcsd_remove),
1488 .id_table = davinci_mmc_devtype,
1411}; 1489};
1412 1490
1413static int __init davinci_mmcsd_init(void) 1491static int __init davinci_mmcsd_init(void)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 4efe3021b217..4fdc71113e6d 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -548,22 +548,6 @@ static const struct mmc_host_ops mxs_mmc_ops = {
548 .enable_sdio_irq = mxs_mmc_enable_sdio_irq, 548 .enable_sdio_irq = mxs_mmc_enable_sdio_irq,
549}; 549};
550 550
551static bool mxs_mmc_dma_filter(struct dma_chan *chan, void *param)
552{
553 struct mxs_mmc_host *host = param;
554 struct mxs_ssp *ssp = &host->ssp;
555
556 if (!mxs_dma_is_apbh(chan))
557 return false;
558
559 if (chan->chan_id != ssp->dma_channel)
560 return false;
561
562 chan->private = &ssp->dma_data;
563
564 return true;
565}
566
567static struct platform_device_id mxs_ssp_ids[] = { 551static struct platform_device_id mxs_ssp_ids[] = {
568 { 552 {
569 .name = "imx23-mmc", 553 .name = "imx23-mmc",
@@ -591,20 +575,17 @@ static int mxs_mmc_probe(struct platform_device *pdev)
591 struct device_node *np = pdev->dev.of_node; 575 struct device_node *np = pdev->dev.of_node;
592 struct mxs_mmc_host *host; 576 struct mxs_mmc_host *host;
593 struct mmc_host *mmc; 577 struct mmc_host *mmc;
594 struct resource *iores, *dmares; 578 struct resource *iores;
595 struct pinctrl *pinctrl; 579 struct pinctrl *pinctrl;
596 int ret = 0, irq_err, irq_dma; 580 int ret = 0, irq_err;
597 dma_cap_mask_t mask;
598 struct regulator *reg_vmmc; 581 struct regulator *reg_vmmc;
599 enum of_gpio_flags flags; 582 enum of_gpio_flags flags;
600 struct mxs_ssp *ssp; 583 struct mxs_ssp *ssp;
601 u32 bus_width = 0; 584 u32 bus_width = 0;
602 585
603 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 586 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
604 dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
605 irq_err = platform_get_irq(pdev, 0); 587 irq_err = platform_get_irq(pdev, 0);
606 irq_dma = platform_get_irq(pdev, 1); 588 if (!iores || irq_err < 0)
607 if (!iores || irq_err < 0 || irq_dma < 0)
608 return -EINVAL; 589 return -EINVAL;
609 590
610 mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev); 591 mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev);
@@ -620,23 +601,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
620 goto out_mmc_free; 601 goto out_mmc_free;
621 } 602 }
622 603
623 if (np) { 604 ssp->devid = (enum mxs_ssp_id) of_id->data;
624 ssp->devid = (enum mxs_ssp_id) of_id->data;
625 /*
626 * TODO: This is a temporary solution and should be changed
627 * to use generic DMA binding later when the helpers get in.
628 */
629 ret = of_property_read_u32(np, "fsl,ssp-dma-channel",
630 &ssp->dma_channel);
631 if (ret) {
632 dev_err(mmc_dev(host->mmc),
633 "failed to get dma channel\n");
634 goto out_mmc_free;
635 }
636 } else {
637 ssp->devid = pdev->id_entry->driver_data;
638 ssp->dma_channel = dmares->start;
639 }
640 605
641 host->mmc = mmc; 606 host->mmc = mmc;
642 host->sdio_irq_en = 0; 607 host->sdio_irq_en = 0;
@@ -666,10 +631,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
666 631
667 mxs_mmc_reset(host); 632 mxs_mmc_reset(host);
668 633
669 dma_cap_zero(mask); 634 ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx");
670 dma_cap_set(DMA_SLAVE, mask);
671 ssp->dma_data.chan_irq = irq_dma;
672 ssp->dmach = dma_request_channel(mask, mxs_mmc_dma_filter, host);
673 if (!ssp->dmach) { 635 if (!ssp->dmach) {
674 dev_err(mmc_dev(host->mmc), 636 dev_err(mmc_dev(host->mmc),
675 "%s: failed to request dma\n", __func__); 637 "%s: failed to request dma\n", __func__);
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 717881a3d1b8..25ecfa1822a8 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -36,7 +36,6 @@
36#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "gpmi-nand" 36#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "gpmi-nand"
37#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "bch" 37#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "bch"
38#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "bch" 38#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "bch"
39#define GPMI_NAND_DMA_INTERRUPT_RES_NAME "gpmi-dma"
40 39
41/* add our owner bbt descriptor */ 40/* add our owner bbt descriptor */
42static uint8_t scan_ff_pattern[] = { 0xff }; 41static uint8_t scan_ff_pattern[] = { 0xff };
@@ -420,28 +419,6 @@ static void release_bch_irq(struct gpmi_nand_data *this)
420 free_irq(i, this); 419 free_irq(i, this);
421} 420}
422 421
423static bool gpmi_dma_filter(struct dma_chan *chan, void *param)
424{
425 struct gpmi_nand_data *this = param;
426 int dma_channel = (int)this->private;
427
428 if (!mxs_dma_is_apbh(chan))
429 return false;
430 /*
431 * only catch the GPMI dma channels :
432 * for mx23 : MX23_DMA_GPMI0 ~ MX23_DMA_GPMI3
433 * (These four channels share the same IRQ!)
434 *
435 * for mx28 : MX28_DMA_GPMI0 ~ MX28_DMA_GPMI7
436 * (These eight channels share the same IRQ!)
437 */
438 if (dma_channel == chan->chan_id) {
439 chan->private = &this->dma_data;
440 return true;
441 }
442 return false;
443}
444
445static void release_dma_channels(struct gpmi_nand_data *this) 422static void release_dma_channels(struct gpmi_nand_data *this)
446{ 423{
447 unsigned int i; 424 unsigned int i;
@@ -455,36 +432,10 @@ static void release_dma_channels(struct gpmi_nand_data *this)
455static int acquire_dma_channels(struct gpmi_nand_data *this) 432static int acquire_dma_channels(struct gpmi_nand_data *this)
456{ 433{
457 struct platform_device *pdev = this->pdev; 434 struct platform_device *pdev = this->pdev;
458 struct resource *r_dma;
459 struct device_node *dn;
460 u32 dma_channel;
461 int ret;
462 struct dma_chan *dma_chan; 435 struct dma_chan *dma_chan;
463 dma_cap_mask_t mask;
464
465 /* dma channel, we only use the first one. */
466 dn = pdev->dev.of_node;
467 ret = of_property_read_u32(dn, "fsl,gpmi-dma-channel", &dma_channel);
468 if (ret) {
469 pr_err("unable to get DMA channel from dt.\n");
470 goto acquire_err;
471 }
472 this->private = (void *)dma_channel;
473
474 /* gpmi dma interrupt */
475 r_dma = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
476 GPMI_NAND_DMA_INTERRUPT_RES_NAME);
477 if (!r_dma) {
478 pr_err("Can't get resource for DMA\n");
479 goto acquire_err;
480 }
481 this->dma_data.chan_irq = r_dma->start;
482 436
483 /* request dma channel */ 437 /* request dma channel */
484 dma_cap_zero(mask); 438 dma_chan = dma_request_slave_channel(&pdev->dev, "rx-tx");
485 dma_cap_set(DMA_SLAVE, mask);
486
487 dma_chan = dma_request_channel(mask, gpmi_dma_filter, this);
488 if (!dma_chan) { 439 if (!dma_chan) {
489 pr_err("Failed to request DMA channel.\n"); 440 pr_err("Failed to request DMA channel.\n");
490 goto acquire_err; 441 goto acquire_err;
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
index 072947731277..a7685e3a8748 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
@@ -20,7 +20,7 @@
20#include <linux/mtd/nand.h> 20#include <linux/mtd/nand.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
23#include <linux/fsl/mxs-dma.h> 23#include <linux/dmaengine.h>
24 24
25#define GPMI_CLK_MAX 5 /* MX6Q needs five clocks */ 25#define GPMI_CLK_MAX 5 /* MX6Q needs five clocks */
26struct resources { 26struct resources {
@@ -180,7 +180,6 @@ struct gpmi_nand_data {
180 /* DMA channels */ 180 /* DMA channels */
181#define DMA_CHANS 8 181#define DMA_CHANS 8
182 struct dma_chan *dma_chans[DMA_CHANS]; 182 struct dma_chan *dma_chans[DMA_CHANS];
183 struct mxs_dma_data dma_data;
184 enum dma_ops_type last_dma_type; 183 enum dma_ops_type last_dma_type;
185 enum dma_ops_type dma_type; 184 enum dma_ops_type dma_type;
186 struct completion dma_done; 185 struct completion dma_done;
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index f292c3aa423f..cb5783d4b1e0 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1820,18 +1820,23 @@ fec_probe(struct platform_device *pdev)
1820 goto failed_clk; 1820 goto failed_clk;
1821 } 1821 }
1822 1822
1823 /* enet_out is optional, depends on board */
1824 fep->clk_enet_out = devm_clk_get(&pdev->dev, "enet_out");
1825 if (IS_ERR(fep->clk_enet_out))
1826 fep->clk_enet_out = NULL;
1827
1823 fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp"); 1828 fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp");
1824 fep->bufdesc_ex = 1829 fep->bufdesc_ex =
1825 pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX; 1830 pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX;
1826 if (IS_ERR(fep->clk_ptp)) { 1831 if (IS_ERR(fep->clk_ptp)) {
1827 ret = PTR_ERR(fep->clk_ptp); 1832 fep->clk_ptp = NULL;
1828 fep->bufdesc_ex = 0; 1833 fep->bufdesc_ex = 0;
1829 } 1834 }
1830 1835
1831 clk_prepare_enable(fep->clk_ahb); 1836 clk_prepare_enable(fep->clk_ahb);
1832 clk_prepare_enable(fep->clk_ipg); 1837 clk_prepare_enable(fep->clk_ipg);
1833 if (!IS_ERR(fep->clk_ptp)) 1838 clk_prepare_enable(fep->clk_enet_out);
1834 clk_prepare_enable(fep->clk_ptp); 1839 clk_prepare_enable(fep->clk_ptp);
1835 1840
1836 reg_phy = devm_regulator_get(&pdev->dev, "phy"); 1841 reg_phy = devm_regulator_get(&pdev->dev, "phy");
1837 if (!IS_ERR(reg_phy)) { 1842 if (!IS_ERR(reg_phy)) {
@@ -1896,8 +1901,8 @@ failed_irq:
1896failed_regulator: 1901failed_regulator:
1897 clk_disable_unprepare(fep->clk_ahb); 1902 clk_disable_unprepare(fep->clk_ahb);
1898 clk_disable_unprepare(fep->clk_ipg); 1903 clk_disable_unprepare(fep->clk_ipg);
1899 if (!IS_ERR(fep->clk_ptp)) 1904 clk_disable_unprepare(fep->clk_enet_out);
1900 clk_disable_unprepare(fep->clk_ptp); 1905 clk_disable_unprepare(fep->clk_ptp);
1901failed_pin: 1906failed_pin:
1902failed_clk: 1907failed_clk:
1903 iounmap(fep->hwp); 1908 iounmap(fep->hwp);
@@ -1923,6 +1928,7 @@ fec_drv_remove(struct platform_device *pdev)
1923 clk_disable_unprepare(fep->clk_ptp); 1928 clk_disable_unprepare(fep->clk_ptp);
1924 if (fep->ptp_clock) 1929 if (fep->ptp_clock)
1925 ptp_clock_unregister(fep->ptp_clock); 1930 ptp_clock_unregister(fep->ptp_clock);
1931 clk_disable_unprepare(fep->clk_enet_out);
1926 clk_disable_unprepare(fep->clk_ahb); 1932 clk_disable_unprepare(fep->clk_ahb);
1927 clk_disable_unprepare(fep->clk_ipg); 1933 clk_disable_unprepare(fep->clk_ipg);
1928 for (i = 0; i < FEC_IRQ_NUM; i++) { 1934 for (i = 0; i < FEC_IRQ_NUM; i++) {
@@ -1953,6 +1959,7 @@ fec_suspend(struct device *dev)
1953 fec_stop(ndev); 1959 fec_stop(ndev);
1954 netif_device_detach(ndev); 1960 netif_device_detach(ndev);
1955 } 1961 }
1962 clk_disable_unprepare(fep->clk_enet_out);
1956 clk_disable_unprepare(fep->clk_ahb); 1963 clk_disable_unprepare(fep->clk_ahb);
1957 clk_disable_unprepare(fep->clk_ipg); 1964 clk_disable_unprepare(fep->clk_ipg);
1958 1965
@@ -1965,6 +1972,7 @@ fec_resume(struct device *dev)
1965 struct net_device *ndev = dev_get_drvdata(dev); 1972 struct net_device *ndev = dev_get_drvdata(dev);
1966 struct fec_enet_private *fep = netdev_priv(ndev); 1973 struct fec_enet_private *fep = netdev_priv(ndev);
1967 1974
1975 clk_prepare_enable(fep->clk_enet_out);
1968 clk_prepare_enable(fep->clk_ahb); 1976 clk_prepare_enable(fep->clk_ahb);
1969 clk_prepare_enable(fep->clk_ipg); 1977 clk_prepare_enable(fep->clk_ipg);
1970 if (netif_running(ndev)) { 1978 if (netif_running(ndev)) {
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index eb4372962839..feabcb6a78b4 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -207,6 +207,7 @@ struct fec_enet_private {
207 207
208 struct clk *clk_ipg; 208 struct clk *clk_ipg;
209 struct clk *clk_ahb; 209 struct clk *clk_ahb;
210 struct clk *clk_enet_out;
210 struct clk *clk_ptp; 211 struct clk *clk_ptp;
211 212
212 /* The saved address of a sent-in-place packet/buffer, for skfree(). */ 213 /* The saved address of a sent-in-place packet/buffer, for skfree(). */
diff --git a/drivers/rtc/rtc-stmp3xxx.c b/drivers/rtc/rtc-stmp3xxx.c
index 98f0d3c30738..67d26128bc85 100644
--- a/drivers/rtc/rtc-stmp3xxx.c
+++ b/drivers/rtc/rtc-stmp3xxx.c
@@ -30,8 +30,6 @@
30#include <linux/stmp_device.h> 30#include <linux/stmp_device.h>
31#include <linux/stmp3xxx_rtc_wdt.h> 31#include <linux/stmp3xxx_rtc_wdt.h>
32 32
33#include <mach/common.h>
34
35#define STMP3XXX_RTC_CTRL 0x0 33#define STMP3XXX_RTC_CTRL 0x0
36#define STMP3XXX_RTC_CTRL_SET 0x4 34#define STMP3XXX_RTC_CTRL_SET 0x4
37#define STMP3XXX_RTC_CTRL_CLR 0x8 35#define STMP3XXX_RTC_CTRL_CLR 0x8
@@ -271,7 +269,7 @@ static int stmp3xxx_rtc_probe(struct platform_device *pdev)
271 269
272 platform_set_drvdata(pdev, rtc_data); 270 platform_set_drvdata(pdev, rtc_data);
273 271
274 mxs_reset_block(rtc_data->io); 272 stmp_reset_block(rtc_data->io);
275 writel(STMP3XXX_RTC_PERSISTENT0_ALARM_EN | 273 writel(STMP3XXX_RTC_PERSISTENT0_ALARM_EN |
276 STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE_EN | 274 STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE_EN |
277 STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE, 275 STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE,
@@ -319,7 +317,7 @@ static int stmp3xxx_rtc_resume(struct platform_device *dev)
319{ 317{
320 struct stmp3xxx_rtc_data *rtc_data = platform_get_drvdata(dev); 318 struct stmp3xxx_rtc_data *rtc_data = platform_get_drvdata(dev);
321 319
322 mxs_reset_block(rtc_data->io); 320 stmp_reset_block(rtc_data->io);
323 writel(STMP3XXX_RTC_PERSISTENT0_ALARM_EN | 321 writel(STMP3XXX_RTC_PERSISTENT0_ALARM_EN |
324 STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE_EN | 322 STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE_EN |
325 STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE, 323 STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE,
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 8234d2259722..2e8f24a1fb95 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -776,10 +776,10 @@ rx_dma_failed:
776#if defined(CONFIG_OF) 776#if defined(CONFIG_OF)
777static const struct of_device_id davinci_spi_of_match[] = { 777static const struct of_device_id davinci_spi_of_match[] = {
778 { 778 {
779 .compatible = "ti,dm644x-spi", 779 .compatible = "ti,dm6441-spi",
780 }, 780 },
781 { 781 {
782 .compatible = "ti,da8xx-spi", 782 .compatible = "ti,da830-spi",
783 .data = (void *)SPI_VERSION_2, 783 .data = (void *)SPI_VERSION_2,
784 }, 784 },
785 { }, 785 { },
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index 22a0af0147fb..7b1c014b0740 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -490,21 +490,6 @@ static int mxs_spi_transfer_one(struct spi_master *master,
490 return status; 490 return status;
491} 491}
492 492
493static bool mxs_ssp_dma_filter(struct dma_chan *chan, void *param)
494{
495 struct mxs_ssp *ssp = param;
496
497 if (!mxs_dma_is_apbh(chan))
498 return false;
499
500 if (chan->chan_id != ssp->dma_channel)
501 return false;
502
503 chan->private = &ssp->dma_data;
504
505 return true;
506}
507
508static const struct of_device_id mxs_spi_dt_ids[] = { 493static const struct of_device_id mxs_spi_dt_ids[] = {
509 { .compatible = "fsl,imx23-spi", .data = (void *) IMX23_SSP, }, 494 { .compatible = "fsl,imx23-spi", .data = (void *) IMX23_SSP, },
510 { .compatible = "fsl,imx28-spi", .data = (void *) IMX28_SSP, }, 495 { .compatible = "fsl,imx28-spi", .data = (void *) IMX28_SSP, },
@@ -520,13 +505,12 @@ static int mxs_spi_probe(struct platform_device *pdev)
520 struct spi_master *master; 505 struct spi_master *master;
521 struct mxs_spi *spi; 506 struct mxs_spi *spi;
522 struct mxs_ssp *ssp; 507 struct mxs_ssp *ssp;
523 struct resource *iores, *dmares; 508 struct resource *iores;
524 struct pinctrl *pinctrl; 509 struct pinctrl *pinctrl;
525 struct clk *clk; 510 struct clk *clk;
526 void __iomem *base; 511 void __iomem *base;
527 int devid, dma_channel, clk_freq; 512 int devid, clk_freq;
528 int ret = 0, irq_err, irq_dma; 513 int ret = 0, irq_err;
529 dma_cap_mask_t mask;
530 514
531 /* 515 /*
532 * Default clock speed for the SPI core. 160MHz seems to 516 * Default clock speed for the SPI core. 160MHz seems to
@@ -537,8 +521,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
537 521
538 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 522 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
539 irq_err = platform_get_irq(pdev, 0); 523 irq_err = platform_get_irq(pdev, 0);
540 irq_dma = platform_get_irq(pdev, 1); 524 if (!iores || irq_err < 0)
541 if (!iores || irq_err < 0 || irq_dma < 0)
542 return -EINVAL; 525 return -EINVAL;
543 526
544 base = devm_ioremap_resource(&pdev->dev, iores); 527 base = devm_ioremap_resource(&pdev->dev, iores);
@@ -553,32 +536,11 @@ static int mxs_spi_probe(struct platform_device *pdev)
553 if (IS_ERR(clk)) 536 if (IS_ERR(clk))
554 return PTR_ERR(clk); 537 return PTR_ERR(clk);
555 538
556 if (np) { 539 devid = (enum mxs_ssp_id) of_id->data;
557 devid = (enum mxs_ssp_id) of_id->data; 540 ret = of_property_read_u32(np, "clock-frequency",
558 /* 541 &clk_freq);
559 * TODO: This is a temporary solution and should be changed 542 if (ret)
560 * to use generic DMA binding later when the helpers get in.
561 */
562 ret = of_property_read_u32(np, "fsl,ssp-dma-channel",
563 &dma_channel);
564 if (ret) {
565 dev_err(&pdev->dev,
566 "Failed to get DMA channel\n");
567 return -EINVAL;
568 }
569
570 ret = of_property_read_u32(np, "clock-frequency",
571 &clk_freq);
572 if (ret)
573 clk_freq = clk_freq_default;
574 } else {
575 dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
576 if (!dmares)
577 return -EINVAL;
578 devid = pdev->id_entry->driver_data;
579 dma_channel = dmares->start;
580 clk_freq = clk_freq_default; 543 clk_freq = clk_freq_default;
581 }
582 544
583 master = spi_alloc_master(&pdev->dev, sizeof(*spi)); 545 master = spi_alloc_master(&pdev->dev, sizeof(*spi));
584 if (!master) 546 if (!master)
@@ -597,7 +559,6 @@ static int mxs_spi_probe(struct platform_device *pdev)
597 ssp->clk = clk; 559 ssp->clk = clk;
598 ssp->base = base; 560 ssp->base = base;
599 ssp->devid = devid; 561 ssp->devid = devid;
600 ssp->dma_channel = dma_channel;
601 562
602 init_completion(&spi->c); 563 init_completion(&spi->c);
603 564
@@ -606,10 +567,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
606 if (ret) 567 if (ret)
607 goto out_master_free; 568 goto out_master_free;
608 569
609 dma_cap_zero(mask); 570 ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx");
610 dma_cap_set(DMA_SLAVE, mask);
611 ssp->dma_data.chan_irq = irq_dma;
612 ssp->dmach = dma_request_channel(mask, mxs_ssp_dma_filter, ssp);
613 if (!ssp->dmach) { 571 if (!ssp->dmach) {
614 dev_err(ssp->dev, "Failed to request DMA\n"); 572 dev_err(ssp->dev, "Failed to request DMA\n");
615 goto out_master_free; 573 goto out_master_free;
diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index 55a459b61907..0eb5b4d759e5 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -36,9 +36,6 @@
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/input.h> 37#include <linux/input.h>
38 38
39#include <mach/mxs.h>
40#include <mach/common.h>
41
42#include <linux/iio/iio.h> 39#include <linux/iio/iio.h>
43#include <linux/iio/buffer.h> 40#include <linux/iio/buffer.h>
44#include <linux/iio/trigger.h> 41#include <linux/iio/trigger.h>
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index d549fe1fa42a..269a27caff33 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -35,7 +35,7 @@
35#include <linux/pinctrl/consumer.h> 35#include <linux/pinctrl/consumer.h>
36#include <linux/of_device.h> 36#include <linux/of_device.h>
37#include <linux/dma-mapping.h> 37#include <linux/dma-mapping.h>
38#include <linux/fsl/mxs-dma.h> 38#include <linux/dmaengine.h>
39 39
40#include <asm/cacheflush.h> 40#include <asm/cacheflush.h>
41 41
@@ -148,11 +148,6 @@ struct mxs_auart_port {
148 struct device *dev; 148 struct device *dev;
149 149
150 /* for DMA */ 150 /* for DMA */
151 struct mxs_dma_data dma_data;
152 int dma_channel_rx, dma_channel_tx;
153 int dma_irq_rx, dma_irq_tx;
154 int dma_channel;
155
156 struct scatterlist tx_sgl; 151 struct scatterlist tx_sgl;
157 struct dma_chan *tx_dma_chan; 152 struct dma_chan *tx_dma_chan;
158 void *tx_dma_buf; 153 void *tx_dma_buf;
@@ -440,20 +435,6 @@ static u32 mxs_auart_get_mctrl(struct uart_port *u)
440 return mctrl; 435 return mctrl;
441} 436}
442 437
443static bool mxs_auart_dma_filter(struct dma_chan *chan, void *param)
444{
445 struct mxs_auart_port *s = param;
446
447 if (!mxs_dma_is_apbx(chan))
448 return false;
449
450 if (s->dma_channel == chan->chan_id) {
451 chan->private = &s->dma_data;
452 return true;
453 }
454 return false;
455}
456
457static int mxs_auart_dma_prep_rx(struct mxs_auart_port *s); 438static int mxs_auart_dma_prep_rx(struct mxs_auart_port *s);
458static void dma_rx_callback(void *arg) 439static void dma_rx_callback(void *arg)
459{ 440{
@@ -545,21 +526,11 @@ static void mxs_auart_dma_exit(struct mxs_auart_port *s)
545 526
546static int mxs_auart_dma_init(struct mxs_auart_port *s) 527static int mxs_auart_dma_init(struct mxs_auart_port *s)
547{ 528{
548 dma_cap_mask_t mask;
549
550 if (auart_dma_enabled(s)) 529 if (auart_dma_enabled(s))
551 return 0; 530 return 0;
552 531
553 /* We do not get the right DMA channels. */
554 if (s->dma_channel_rx == -1 || s->dma_channel_tx == -1)
555 return -EINVAL;
556
557 /* init for RX */ 532 /* init for RX */
558 dma_cap_zero(mask); 533 s->rx_dma_chan = dma_request_slave_channel(s->dev, "rx");
559 dma_cap_set(DMA_SLAVE, mask);
560 s->dma_channel = s->dma_channel_rx;
561 s->dma_data.chan_irq = s->dma_irq_rx;
562 s->rx_dma_chan = dma_request_channel(mask, mxs_auart_dma_filter, s);
563 if (!s->rx_dma_chan) 534 if (!s->rx_dma_chan)
564 goto err_out; 535 goto err_out;
565 s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); 536 s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
@@ -567,9 +538,7 @@ static int mxs_auart_dma_init(struct mxs_auart_port *s)
567 goto err_out; 538 goto err_out;
568 539
569 /* init for TX */ 540 /* init for TX */
570 s->dma_channel = s->dma_channel_tx; 541 s->tx_dma_chan = dma_request_slave_channel(s->dev, "tx");
571 s->dma_data.chan_irq = s->dma_irq_tx;
572 s->tx_dma_chan = dma_request_channel(mask, mxs_auart_dma_filter, s);
573 if (!s->tx_dma_chan) 542 if (!s->tx_dma_chan)
574 goto err_out; 543 goto err_out;
575 s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA); 544 s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
@@ -1020,7 +989,6 @@ static int serial_mxs_probe_dt(struct mxs_auart_port *s,
1020 struct platform_device *pdev) 989 struct platform_device *pdev)
1021{ 990{
1022 struct device_node *np = pdev->dev.of_node; 991 struct device_node *np = pdev->dev.of_node;
1023 u32 dma_channel[2];
1024 int ret; 992 int ret;
1025 993
1026 if (!np) 994 if (!np)
@@ -1034,20 +1002,8 @@ static int serial_mxs_probe_dt(struct mxs_auart_port *s,
1034 } 1002 }
1035 s->port.line = ret; 1003 s->port.line = ret;
1036 1004
1037 s->dma_irq_rx = platform_get_irq(pdev, 1); 1005 s->flags |= MXS_AUART_DMA_CONFIG;
1038 s->dma_irq_tx = platform_get_irq(pdev, 2);
1039 1006
1040 ret = of_property_read_u32_array(np, "fsl,auart-dma-channel",
1041 dma_channel, 2);
1042 if (ret == 0) {
1043 s->dma_channel_rx = dma_channel[0];
1044 s->dma_channel_tx = dma_channel[1];
1045
1046 s->flags |= MXS_AUART_DMA_CONFIG;
1047 } else {
1048 s->dma_channel_rx = -1;
1049 s->dma_channel_tx = -1;
1050 }
1051 return 0; 1007 return 0;
1052} 1008}
1053 1009
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4c1546f71d56..e7718fdad1e1 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2437,6 +2437,8 @@ config FB_MXS
2437 select FB_CFB_FILLRECT 2437 select FB_CFB_FILLRECT
2438 select FB_CFB_COPYAREA 2438 select FB_CFB_COPYAREA
2439 select FB_CFB_IMAGEBLIT 2439 select FB_CFB_IMAGEBLIT
2440 select FB_MODE_HELPERS
2441 select OF_VIDEOMODE
2440 help 2442 help
2441 Framebuffer support for the MXS SoC. 2443 Framebuffer support for the MXS SoC.
2442 2444
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 45169cbaba6e..1b2c26d1658c 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -42,13 +42,15 @@
42#include <linux/module.h> 42#include <linux/module.h>
43#include <linux/kernel.h> 43#include <linux/kernel.h>
44#include <linux/of_device.h> 44#include <linux/of_device.h>
45#include <linux/of_gpio.h> 45#include <video/of_display_timing.h>
46#include <linux/platform_device.h> 46#include <linux/platform_device.h>
47#include <linux/clk.h> 47#include <linux/clk.h>
48#include <linux/dma-mapping.h> 48#include <linux/dma-mapping.h>
49#include <linux/io.h> 49#include <linux/io.h>
50#include <linux/pinctrl/consumer.h> 50#include <linux/pinctrl/consumer.h>
51#include <linux/mxsfb.h> 51#include <linux/fb.h>
52#include <linux/regulator/consumer.h>
53#include <video/videomode.h>
52 54
53#define REG_SET 4 55#define REG_SET 4
54#define REG_CLR 8 56#define REG_CLR 8
@@ -107,7 +109,7 @@
107#define VDCTRL0_ENABLE_PRESENT (1 << 28) 109#define VDCTRL0_ENABLE_PRESENT (1 << 28)
108#define VDCTRL0_VSYNC_ACT_HIGH (1 << 27) 110#define VDCTRL0_VSYNC_ACT_HIGH (1 << 27)
109#define VDCTRL0_HSYNC_ACT_HIGH (1 << 26) 111#define VDCTRL0_HSYNC_ACT_HIGH (1 << 26)
110#define VDCTRL0_DOTCLK_ACT_FAILING (1 << 25) 112#define VDCTRL0_DOTCLK_ACT_FALLING (1 << 25)
111#define VDCTRL0_ENABLE_ACT_HIGH (1 << 24) 113#define VDCTRL0_ENABLE_ACT_HIGH (1 << 24)
112#define VDCTRL0_VSYNC_PERIOD_UNIT (1 << 21) 114#define VDCTRL0_VSYNC_PERIOD_UNIT (1 << 21)
113#define VDCTRL0_VSYNC_PULSE_WIDTH_UNIT (1 << 20) 115#define VDCTRL0_VSYNC_PULSE_WIDTH_UNIT (1 << 20)
@@ -142,6 +144,14 @@
142#define BLUE 2 144#define BLUE 2
143#define TRANSP 3 145#define TRANSP 3
144 146
147#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */
148#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
149#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
150#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
151
152#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
153#define MXSFB_SYNC_DOTCLK_FALLING_ACT (1 << 7) /* negtive edge sampling */
154
145enum mxsfb_devtype { 155enum mxsfb_devtype {
146 MXSFB_V3, 156 MXSFB_V3,
147 MXSFB_V4, 157 MXSFB_V4,
@@ -168,8 +178,8 @@ struct mxsfb_info {
168 unsigned ld_intf_width; 178 unsigned ld_intf_width;
169 unsigned dotclk_delay; 179 unsigned dotclk_delay;
170 const struct mxsfb_devdata *devdata; 180 const struct mxsfb_devdata *devdata;
171 int mapped;
172 u32 sync; 181 u32 sync;
182 struct regulator *reg_lcd;
173}; 183};
174 184
175#define mxsfb_is_v3(host) (host->devdata->ipversion == 3) 185#define mxsfb_is_v3(host) (host->devdata->ipversion == 3)
@@ -329,9 +339,19 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
329{ 339{
330 struct mxsfb_info *host = to_imxfb_host(fb_info); 340 struct mxsfb_info *host = to_imxfb_host(fb_info);
331 u32 reg; 341 u32 reg;
342 int ret;
332 343
333 dev_dbg(&host->pdev->dev, "%s\n", __func__); 344 dev_dbg(&host->pdev->dev, "%s\n", __func__);
334 345
346 if (host->reg_lcd) {
347 ret = regulator_enable(host->reg_lcd);
348 if (ret) {
349 dev_err(&host->pdev->dev,
350 "lcd regulator enable failed: %d\n", ret);
351 return;
352 }
353 }
354
335 clk_prepare_enable(host->clk); 355 clk_prepare_enable(host->clk);
336 clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U); 356 clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U);
337 357
@@ -353,6 +373,7 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
353 struct mxsfb_info *host = to_imxfb_host(fb_info); 373 struct mxsfb_info *host = to_imxfb_host(fb_info);
354 unsigned loop; 374 unsigned loop;
355 u32 reg; 375 u32 reg;
376 int ret;
356 377
357 dev_dbg(&host->pdev->dev, "%s\n", __func__); 378 dev_dbg(&host->pdev->dev, "%s\n", __func__);
358 379
@@ -376,6 +397,13 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
376 clk_disable_unprepare(host->clk); 397 clk_disable_unprepare(host->clk);
377 398
378 host->enabled = 0; 399 host->enabled = 0;
400
401 if (host->reg_lcd) {
402 ret = regulator_disable(host->reg_lcd);
403 if (ret)
404 dev_err(&host->pdev->dev,
405 "lcd regulator disable failed: %d\n", ret);
406 }
379} 407}
380 408
381static int mxsfb_set_par(struct fb_info *fb_info) 409static int mxsfb_set_par(struct fb_info *fb_info)
@@ -459,8 +487,8 @@ static int mxsfb_set_par(struct fb_info *fb_info)
459 vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH; 487 vdctrl0 |= VDCTRL0_VSYNC_ACT_HIGH;
460 if (host->sync & MXSFB_SYNC_DATA_ENABLE_HIGH_ACT) 488 if (host->sync & MXSFB_SYNC_DATA_ENABLE_HIGH_ACT)
461 vdctrl0 |= VDCTRL0_ENABLE_ACT_HIGH; 489 vdctrl0 |= VDCTRL0_ENABLE_ACT_HIGH;
462 if (host->sync & MXSFB_SYNC_DOTCLK_FAILING_ACT) 490 if (host->sync & MXSFB_SYNC_DOTCLK_FALLING_ACT)
463 vdctrl0 |= VDCTRL0_DOTCLK_ACT_FAILING; 491 vdctrl0 |= VDCTRL0_DOTCLK_ACT_FALLING;
464 492
465 writel(vdctrl0, host->base + LCDC_VDCTRL0); 493 writel(vdctrl0, host->base + LCDC_VDCTRL0);
466 494
@@ -679,14 +707,105 @@ static int mxsfb_restore_mode(struct mxsfb_info *host)
679 return 0; 707 return 0;
680} 708}
681 709
710static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host)
711{
712 struct fb_info *fb_info = &host->fb_info;
713 struct fb_var_screeninfo *var = &fb_info->var;
714 struct device *dev = &host->pdev->dev;
715 struct device_node *np = host->pdev->dev.of_node;
716 struct device_node *display_np;
717 struct device_node *timings_np;
718 struct display_timings *timings;
719 u32 width;
720 int i;
721 int ret = 0;
722
723 display_np = of_parse_phandle(np, "display", 0);
724 if (!display_np) {
725 dev_err(dev, "failed to find display phandle\n");
726 return -ENOENT;
727 }
728
729 ret = of_property_read_u32(display_np, "bus-width", &width);
730 if (ret < 0) {
731 dev_err(dev, "failed to get property bus-width\n");
732 goto put_display_node;
733 }
734
735 switch (width) {
736 case 8:
737 host->ld_intf_width = STMLCDIF_8BIT;
738 break;
739 case 16:
740 host->ld_intf_width = STMLCDIF_16BIT;
741 break;
742 case 18:
743 host->ld_intf_width = STMLCDIF_18BIT;
744 break;
745 case 24:
746 host->ld_intf_width = STMLCDIF_24BIT;
747 break;
748 default:
749 dev_err(dev, "invalid bus-width value\n");
750 ret = -EINVAL;
751 goto put_display_node;
752 }
753
754 ret = of_property_read_u32(display_np, "bits-per-pixel",
755 &var->bits_per_pixel);
756 if (ret < 0) {
757 dev_err(dev, "failed to get property bits-per-pixel\n");
758 goto put_display_node;
759 }
760
761 timings = of_get_display_timings(display_np);
762 if (!timings) {
763 dev_err(dev, "failed to get display timings\n");
764 ret = -ENOENT;
765 goto put_display_node;
766 }
767
768 timings_np = of_find_node_by_name(display_np,
769 "display-timings");
770 if (!timings_np) {
771 dev_err(dev, "failed to find display-timings node\n");
772 ret = -ENOENT;
773 goto put_display_node;
774 }
775
776 for (i = 0; i < of_get_child_count(timings_np); i++) {
777 struct videomode vm;
778 struct fb_videomode fb_vm;
779
780 ret = videomode_from_timing(timings, &vm, i);
781 if (ret < 0)
782 goto put_timings_node;
783 ret = fb_videomode_from_videomode(&vm, &fb_vm);
784 if (ret < 0)
785 goto put_timings_node;
786
787 if (vm.data_flags & DISPLAY_FLAGS_DE_HIGH)
788 host->sync |= MXSFB_SYNC_DATA_ENABLE_HIGH_ACT;
789 if (vm.data_flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
790 host->sync |= MXSFB_SYNC_DOTCLK_FALLING_ACT;
791 fb_add_videomode(&fb_vm, &fb_info->modelist);
792 }
793
794put_timings_node:
795 of_node_put(timings_np);
796put_display_node:
797 of_node_put(display_np);
798 return ret;
799}
800
682static int mxsfb_init_fbinfo(struct mxsfb_info *host) 801static int mxsfb_init_fbinfo(struct mxsfb_info *host)
683{ 802{
684 struct fb_info *fb_info = &host->fb_info; 803 struct fb_info *fb_info = &host->fb_info;
685 struct fb_var_screeninfo *var = &fb_info->var; 804 struct fb_var_screeninfo *var = &fb_info->var;
686 struct mxsfb_platform_data *pdata = host->pdev->dev.platform_data;
687 dma_addr_t fb_phys; 805 dma_addr_t fb_phys;
688 void *fb_virt; 806 void *fb_virt;
689 unsigned fb_size = pdata->fb_size; 807 unsigned fb_size;
808 int ret;
690 809
691 fb_info->fbops = &mxsfb_ops; 810 fb_info->fbops = &mxsfb_ops;
692 fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST; 811 fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST;
@@ -696,40 +815,22 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host)
696 fb_info->fix.visual = FB_VISUAL_TRUECOLOR, 815 fb_info->fix.visual = FB_VISUAL_TRUECOLOR,
697 fb_info->fix.accel = FB_ACCEL_NONE; 816 fb_info->fix.accel = FB_ACCEL_NONE;
698 817
699 var->bits_per_pixel = pdata->default_bpp ? pdata->default_bpp : 16; 818 ret = mxsfb_init_fbinfo_dt(host);
819 if (ret)
820 return ret;
821
700 var->nonstd = 0; 822 var->nonstd = 0;
701 var->activate = FB_ACTIVATE_NOW; 823 var->activate = FB_ACTIVATE_NOW;
702 var->accel_flags = 0; 824 var->accel_flags = 0;
703 var->vmode = FB_VMODE_NONINTERLACED; 825 var->vmode = FB_VMODE_NONINTERLACED;
704 826
705 host->dotclk_delay = pdata->dotclk_delay;
706 host->ld_intf_width = pdata->ld_intf_width;
707
708 /* Memory allocation for framebuffer */ 827 /* Memory allocation for framebuffer */
709 if (pdata->fb_phys) { 828 fb_size = SZ_2M;
710 if (!fb_size) 829 fb_virt = alloc_pages_exact(fb_size, GFP_DMA);
711 return -EINVAL; 830 if (!fb_virt)
712 831 return -ENOMEM;
713 fb_phys = pdata->fb_phys;
714
715 if (!request_mem_region(fb_phys, fb_size, host->pdev->name))
716 return -ENOMEM;
717 832
718 fb_virt = ioremap(fb_phys, fb_size); 833 fb_phys = virt_to_phys(fb_virt);
719 if (!fb_virt) {
720 release_mem_region(fb_phys, fb_size);
721 return -ENOMEM;
722 }
723 host->mapped = 1;
724 } else {
725 if (!fb_size)
726 fb_size = SZ_2M; /* default */
727 fb_virt = alloc_pages_exact(fb_size, GFP_DMA);
728 if (!fb_virt)
729 return -ENOMEM;
730
731 fb_phys = virt_to_phys(fb_virt);
732 }
733 834
734 fb_info->fix.smem_start = fb_phys; 835 fb_info->fix.smem_start = fb_phys;
735 fb_info->screen_base = fb_virt; 836 fb_info->screen_base = fb_virt;
@@ -745,13 +846,7 @@ static void mxsfb_free_videomem(struct mxsfb_info *host)
745{ 846{
746 struct fb_info *fb_info = &host->fb_info; 847 struct fb_info *fb_info = &host->fb_info;
747 848
748 if (host->mapped) { 849 free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
749 iounmap(fb_info->screen_base);
750 release_mem_region(fb_info->fix.smem_start,
751 fb_info->screen_size);
752 } else {
753 free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
754 }
755} 850}
756 851
757static struct platform_device_id mxsfb_devtype[] = { 852static struct platform_device_id mxsfb_devtype[] = {
@@ -778,47 +873,35 @@ static int mxsfb_probe(struct platform_device *pdev)
778{ 873{
779 const struct of_device_id *of_id = 874 const struct of_device_id *of_id =
780 of_match_device(mxsfb_dt_ids, &pdev->dev); 875 of_match_device(mxsfb_dt_ids, &pdev->dev);
781 struct mxsfb_platform_data *pdata = pdev->dev.platform_data;
782 struct resource *res; 876 struct resource *res;
783 struct mxsfb_info *host; 877 struct mxsfb_info *host;
784 struct fb_info *fb_info; 878 struct fb_info *fb_info;
785 struct fb_modelist *modelist; 879 struct fb_modelist *modelist;
786 struct pinctrl *pinctrl; 880 struct pinctrl *pinctrl;
787 int panel_enable; 881 int ret;
788 enum of_gpio_flags flags;
789 int i, ret;
790 882
791 if (of_id) 883 if (of_id)
792 pdev->id_entry = of_id->data; 884 pdev->id_entry = of_id->data;
793 885
794 if (!pdata) {
795 dev_err(&pdev->dev, "No platformdata. Giving up\n");
796 return -ENODEV;
797 }
798
799 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 886 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
800 if (!res) { 887 if (!res) {
801 dev_err(&pdev->dev, "Cannot get memory IO resource\n"); 888 dev_err(&pdev->dev, "Cannot get memory IO resource\n");
802 return -ENODEV; 889 return -ENODEV;
803 } 890 }
804 891
805 if (!request_mem_region(res->start, resource_size(res), pdev->name))
806 return -EBUSY;
807
808 fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev); 892 fb_info = framebuffer_alloc(sizeof(struct mxsfb_info), &pdev->dev);
809 if (!fb_info) { 893 if (!fb_info) {
810 dev_err(&pdev->dev, "Failed to allocate fbdev\n"); 894 dev_err(&pdev->dev, "Failed to allocate fbdev\n");
811 ret = -ENOMEM; 895 return -ENOMEM;
812 goto error_alloc_info;
813 } 896 }
814 897
815 host = to_imxfb_host(fb_info); 898 host = to_imxfb_host(fb_info);
816 899
817 host->base = ioremap(res->start, resource_size(res)); 900 host->base = devm_ioremap_resource(&pdev->dev, res);
818 if (!host->base) { 901 if (IS_ERR(host->base)) {
819 dev_err(&pdev->dev, "ioremap failed\n"); 902 dev_err(&pdev->dev, "ioremap failed\n");
820 ret = -ENOMEM; 903 ret = PTR_ERR(host->base);
821 goto error_ioremap; 904 goto fb_release;
822 } 905 }
823 906
824 host->pdev = pdev; 907 host->pdev = pdev;
@@ -829,47 +912,31 @@ static int mxsfb_probe(struct platform_device *pdev)
829 pinctrl = devm_pinctrl_get_select_default(&pdev->dev); 912 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
830 if (IS_ERR(pinctrl)) { 913 if (IS_ERR(pinctrl)) {
831 ret = PTR_ERR(pinctrl); 914 ret = PTR_ERR(pinctrl);
832 goto error_getpin; 915 goto fb_release;
833 } 916 }
834 917
835 host->clk = clk_get(&host->pdev->dev, NULL); 918 host->clk = devm_clk_get(&host->pdev->dev, NULL);
836 if (IS_ERR(host->clk)) { 919 if (IS_ERR(host->clk)) {
837 ret = PTR_ERR(host->clk); 920 ret = PTR_ERR(host->clk);
838 goto error_getclock; 921 goto fb_release;
839 } 922 }
840 923
841 panel_enable = of_get_named_gpio_flags(pdev->dev.of_node, 924 host->reg_lcd = devm_regulator_get(&pdev->dev, "lcd");
842 "panel-enable-gpios", 0, &flags); 925 if (IS_ERR(host->reg_lcd))
843 if (gpio_is_valid(panel_enable)) { 926 host->reg_lcd = NULL;
844 unsigned long f = GPIOF_OUT_INIT_HIGH;
845 if (flags == OF_GPIO_ACTIVE_LOW)
846 f = GPIOF_OUT_INIT_LOW;
847 ret = devm_gpio_request_one(&pdev->dev, panel_enable,
848 f, "panel-enable");
849 if (ret) {
850 dev_err(&pdev->dev,
851 "failed to request gpio %d: %d\n",
852 panel_enable, ret);
853 goto error_panel_enable;
854 }
855 }
856 927
857 fb_info->pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL); 928 fb_info->pseudo_palette = devm_kzalloc(&pdev->dev, sizeof(u32) * 16,
929 GFP_KERNEL);
858 if (!fb_info->pseudo_palette) { 930 if (!fb_info->pseudo_palette) {
859 ret = -ENOMEM; 931 ret = -ENOMEM;
860 goto error_pseudo_pallette; 932 goto fb_release;
861 } 933 }
862 934
863 INIT_LIST_HEAD(&fb_info->modelist); 935 INIT_LIST_HEAD(&fb_info->modelist);
864 936
865 host->sync = pdata->sync;
866
867 ret = mxsfb_init_fbinfo(host); 937 ret = mxsfb_init_fbinfo(host);
868 if (ret != 0) 938 if (ret != 0)
869 goto error_init_fb; 939 goto fb_release;
870
871 for (i = 0; i < pdata->mode_count; i++)
872 fb_add_videomode(&pdata->mode_list[i], &fb_info->modelist);
873 940
874 modelist = list_first_entry(&fb_info->modelist, 941 modelist = list_first_entry(&fb_info->modelist,
875 struct fb_modelist, list); 942 struct fb_modelist, list);
@@ -883,7 +950,7 @@ static int mxsfb_probe(struct platform_device *pdev)
883 ret = register_framebuffer(fb_info); 950 ret = register_framebuffer(fb_info);
884 if (ret != 0) { 951 if (ret != 0) {
885 dev_err(&pdev->dev,"Failed to register framebuffer\n"); 952 dev_err(&pdev->dev,"Failed to register framebuffer\n");
886 goto error_register; 953 goto fb_destroy;
887 } 954 }
888 955
889 if (!host->enabled) { 956 if (!host->enabled) {
@@ -896,22 +963,12 @@ static int mxsfb_probe(struct platform_device *pdev)
896 963
897 return 0; 964 return 0;
898 965
899error_register: 966fb_destroy:
900 if (host->enabled) 967 if (host->enabled)
901 clk_disable_unprepare(host->clk); 968 clk_disable_unprepare(host->clk);
902 fb_destroy_modelist(&fb_info->modelist); 969 fb_destroy_modelist(&fb_info->modelist);
903error_init_fb: 970fb_release:
904 kfree(fb_info->pseudo_palette);
905error_pseudo_pallette:
906error_panel_enable:
907 clk_put(host->clk);
908error_getclock:
909error_getpin:
910 iounmap(host->base);
911error_ioremap:
912 framebuffer_release(fb_info); 971 framebuffer_release(fb_info);
913error_alloc_info:
914 release_mem_region(res->start, resource_size(res));
915 972
916 return ret; 973 return ret;
917} 974}
@@ -920,19 +977,14 @@ static int mxsfb_remove(struct platform_device *pdev)
920{ 977{
921 struct fb_info *fb_info = platform_get_drvdata(pdev); 978 struct fb_info *fb_info = platform_get_drvdata(pdev);
922 struct mxsfb_info *host = to_imxfb_host(fb_info); 979 struct mxsfb_info *host = to_imxfb_host(fb_info);
923 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
924 980
925 if (host->enabled) 981 if (host->enabled)
926 mxsfb_disable_controller(fb_info); 982 mxsfb_disable_controller(fb_info);
927 983
928 unregister_framebuffer(fb_info); 984 unregister_framebuffer(fb_info);
929 kfree(fb_info->pseudo_palette);
930 mxsfb_free_videomem(host); 985 mxsfb_free_videomem(host);
931 iounmap(host->base);
932 clk_put(host->clk);
933 986
934 framebuffer_release(fb_info); 987 framebuffer_release(fb_info);
935 release_mem_region(res->start, resource_size(res));
936 988
937 platform_set_drvdata(pdev, NULL); 989 platform_set_drvdata(pdev, NULL);
938 990
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index 9c7f5807824b..dd7adff76e81 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -152,7 +152,7 @@ struct clk {
152 }, \ 152 }, \
153 .reg = _reg, \ 153 .reg = _reg, \
154 .shift = _shift, \ 154 .shift = _shift, \
155 .width = _width, \ 155 .mask = BIT(_width) - 1, \
156 .flags = _mux_flags, \ 156 .flags = _mux_flags, \
157 .lock = _lock, \ 157 .lock = _lock, \
158 }; \ 158 }; \
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 7f197d7addb0..1f0352802794 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -45,6 +45,14 @@ struct clk_hw;
45 * undo any work done in the @prepare callback. Called with 45 * undo any work done in the @prepare callback. Called with
46 * prepare_lock held. 46 * prepare_lock held.
47 * 47 *
48 * @is_prepared: Queries the hardware to determine if the clock is prepared.
49 * This function is allowed to sleep. Optional, if this op is not
50 * set then the prepare count will be used.
51 *
52 * @unprepare_unused: Unprepare the clock atomically. Only called from
53 * clk_disable_unused for prepare clocks with special needs.
54 * Called with prepare mutex held. This function may sleep.
55 *
48 * @enable: Enable the clock atomically. This must not return until the 56 * @enable: Enable the clock atomically. This must not return until the
49 * clock is generating a valid clock signal, usable by consumer 57 * clock is generating a valid clock signal, usable by consumer
50 * devices. Called with enable_lock held. This function must not 58 * devices. Called with enable_lock held. This function must not
@@ -108,6 +116,8 @@ struct clk_hw;
108struct clk_ops { 116struct clk_ops {
109 int (*prepare)(struct clk_hw *hw); 117 int (*prepare)(struct clk_hw *hw);
110 void (*unprepare)(struct clk_hw *hw); 118 void (*unprepare)(struct clk_hw *hw);
119 int (*is_prepared)(struct clk_hw *hw);
120 void (*unprepare_unused)(struct clk_hw *hw);
111 int (*enable)(struct clk_hw *hw); 121 int (*enable)(struct clk_hw *hw);
112 void (*disable)(struct clk_hw *hw); 122 void (*disable)(struct clk_hw *hw);
113 int (*is_enabled)(struct clk_hw *hw); 123 int (*is_enabled)(struct clk_hw *hw);
@@ -287,8 +297,9 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name,
287struct clk_mux { 297struct clk_mux {
288 struct clk_hw hw; 298 struct clk_hw hw;
289 void __iomem *reg; 299 void __iomem *reg;
300 u32 *table;
301 u32 mask;
290 u8 shift; 302 u8 shift;
291 u8 width;
292 u8 flags; 303 u8 flags;
293 spinlock_t *lock; 304 spinlock_t *lock;
294}; 305};
@@ -297,11 +308,17 @@ struct clk_mux {
297#define CLK_MUX_INDEX_BIT BIT(1) 308#define CLK_MUX_INDEX_BIT BIT(1)
298 309
299extern const struct clk_ops clk_mux_ops; 310extern const struct clk_ops clk_mux_ops;
311
300struct clk *clk_register_mux(struct device *dev, const char *name, 312struct clk *clk_register_mux(struct device *dev, const char *name,
301 const char **parent_names, u8 num_parents, unsigned long flags, 313 const char **parent_names, u8 num_parents, unsigned long flags,
302 void __iomem *reg, u8 shift, u8 width, 314 void __iomem *reg, u8 shift, u8 width,
303 u8 clk_mux_flags, spinlock_t *lock); 315 u8 clk_mux_flags, spinlock_t *lock);
304 316
317struct clk *clk_register_mux_table(struct device *dev, const char *name,
318 const char **parent_names, u8 num_parents, unsigned long flags,
319 void __iomem *reg, u8 shift, u32 mask,
320 u8 clk_mux_flags, u32 *table, spinlock_t *lock);
321
305/** 322/**
306 * struct clk_fixed_factor - fixed multiplier and divider clock 323 * struct clk_fixed_factor - fixed multiplier and divider clock
307 * 324 *
@@ -325,6 +342,37 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
325 const char *parent_name, unsigned long flags, 342 const char *parent_name, unsigned long flags,
326 unsigned int mult, unsigned int div); 343 unsigned int mult, unsigned int div);
327 344
345/***
346 * struct clk_composite - aggregate clock of mux, divider and gate clocks
347 *
348 * @hw: handle between common and hardware-specific interfaces
349 * @mux_hw: handle between composite and hardware-specifix mux clock
350 * @div_hw: handle between composite and hardware-specifix divider clock
351 * @gate_hw: handle between composite and hardware-specifix gate clock
352 * @mux_ops: clock ops for mux
353 * @div_ops: clock ops for divider
354 * @gate_ops: clock ops for gate
355 */
356struct clk_composite {
357 struct clk_hw hw;
358 struct clk_ops ops;
359
360 struct clk_hw *mux_hw;
361 struct clk_hw *div_hw;
362 struct clk_hw *gate_hw;
363
364 const struct clk_ops *mux_ops;
365 const struct clk_ops *div_ops;
366 const struct clk_ops *gate_ops;
367};
368
369struct clk *clk_register_composite(struct device *dev, const char *name,
370 const char **parent_names, int num_parents,
371 struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
372 struct clk_hw *div_hw, const struct clk_ops *div_ops,
373 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
374 unsigned long flags);
375
328/** 376/**
329 * clk_register - allocate a new clock, register it and return an opaque cookie 377 * clk_register - allocate a new clock, register it and return an opaque cookie
330 * @dev: device that is registering this clock 378 * @dev: device that is registering this clock
@@ -351,6 +399,7 @@ unsigned int __clk_get_enable_count(struct clk *clk);
351unsigned int __clk_get_prepare_count(struct clk *clk); 399unsigned int __clk_get_prepare_count(struct clk *clk);
352unsigned long __clk_get_rate(struct clk *clk); 400unsigned long __clk_get_rate(struct clk *clk);
353unsigned long __clk_get_flags(struct clk *clk); 401unsigned long __clk_get_flags(struct clk *clk);
402bool __clk_is_prepared(struct clk *clk);
354bool __clk_is_enabled(struct clk *clk); 403bool __clk_is_enabled(struct clk *clk);
355struct clk *__clk_lookup(const char *name); 404struct clk *__clk_lookup(const char *name);
356 405
diff --git a/include/linux/clk/mxs.h b/include/linux/clk/mxs.h
new file mode 100644
index 000000000000..90c30dc3efc7
--- /dev/null
+++ b/include/linux/clk/mxs.h
@@ -0,0 +1,16 @@
1/*
2 * Copyright (C) 2013 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __LINUX_CLK_MXS_H
10#define __LINUX_CLK_MXS_H
11
12int mx23_clocks_init(void);
13int mx28_clocks_init(void);
14int mxs_saif_clkmux_select(unsigned int clkmux);
15
16#endif
diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h
new file mode 100644
index 000000000000..e074fdd5a236
--- /dev/null
+++ b/include/linux/clk/sunxi.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2012 Maxime Ripard
3 *
4 * Maxime Ripard <maxime.ripard@free-electrons.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __LINUX_CLK_SUNXI_H_
18#define __LINUX_CLK_SUNXI_H_
19
20void __init sunxi_init_clocks(void);
21
22#endif
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
index 404d6f940872..642789baec74 100644
--- a/include/linux/clk/tegra.h
+++ b/include/linux/clk/tegra.h
@@ -123,5 +123,6 @@ static inline void tegra_cpu_clock_resume(void)
123void tegra_periph_reset_deassert(struct clk *c); 123void tegra_periph_reset_deassert(struct clk *c);
124void tegra_periph_reset_assert(struct clk *c); 124void tegra_periph_reset_assert(struct clk *c);
125void tegra_clocks_init(void); 125void tegra_clocks_init(void);
126void tegra_clocks_apply_init_table(void);
126 127
127#endif /* __LINUX_CLK_TEGRA_H_ */ 128#endif /* __LINUX_CLK_TEGRA_H_ */
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 27cfda427dd9..08ed5e19d8c6 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -340,6 +340,7 @@ extern void clocksource_of_init(void);
340 __used __section(__clksrc_of_table) \ 340 __used __section(__clksrc_of_table) \
341 = { .compatible = compat, .data = fn }; 341 = { .compatible = compat, .data = fn };
342#else 342#else
343static inline void clocksource_of_init(void) {}
343#define CLOCKSOURCE_OF_DECLARE(name, compat, fn) 344#define CLOCKSOURCE_OF_DECLARE(name, compat, fn)
344#endif 345#endif
345 346
diff --git a/include/linux/irqchip/mxs.h b/include/linux/irqchip/mxs.h
new file mode 100644
index 000000000000..9039a538a919
--- /dev/null
+++ b/include/linux/irqchip/mxs.h
@@ -0,0 +1,14 @@
1/*
2 * Copyright (C) 2013 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __LINUX_IRQCHIP_MXS_H
10#define __LINUX_IRQCHIP_MXS_H
11
12extern void icoll_handle_irq(struct pt_regs *);
13
14#endif
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
index efa1a6d7aca8..dba482e31a13 100644
--- a/include/linux/mbus.h
+++ b/include/linux/mbus.h
@@ -32,6 +32,20 @@ struct mbus_dram_target_info
32 } cs[4]; 32 } cs[4];
33}; 33};
34 34
35/* Flags for PCI/PCIe address decoding regions */
36#define MVEBU_MBUS_PCI_IO 0x1
37#define MVEBU_MBUS_PCI_MEM 0x2
38#define MVEBU_MBUS_PCI_WA 0x3
39
40/*
41 * Magic value that explicits that we don't need a remapping-capable
42 * address decoding window.
43 */
44#define MVEBU_MBUS_NO_REMAP (0xffffffff)
45
46/* Maximum size of a mbus window name */
47#define MVEBU_MBUS_MAX_WINNAME_SZ 32
48
35/* 49/*
36 * The Marvell mbus is to be found only on SOCs from the Orion family 50 * The Marvell mbus is to be found only on SOCs from the Orion family
37 * at the moment. Provide a dummy stub for other architectures. 51 * at the moment. Provide a dummy stub for other architectures.
@@ -44,4 +58,15 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void)
44 return NULL; 58 return NULL;
45} 59}
46#endif 60#endif
47#endif 61
62int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base,
63 size_t size, phys_addr_t remap,
64 unsigned int flags);
65int mvebu_mbus_add_window(const char *devname, phys_addr_t base,
66 size_t size);
67int mvebu_mbus_del_window(phys_addr_t base, size_t size);
68int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base,
69 size_t mbus_size, phys_addr_t sdram_phys_base,
70 size_t sdram_size);
71
72#endif /* __LINUX_MBUS_H */
diff --git a/include/linux/mxsfb.h b/include/linux/mxsfb.h
deleted file mode 100644
index f80af8674342..000000000000
--- a/include/linux/mxsfb.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
14 * MA 02110-1301, USA.
15 */
16
17#ifndef __LINUX_MXSFB_H
18#define __LINUX_MXSFB_H
19
20#include <linux/fb.h>
21
22#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */
23#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
24#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
25#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
26
27#define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
28#define MXSFB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */
29
30struct mxsfb_platform_data {
31 struct fb_videomode *mode_list;
32 unsigned mode_count;
33
34 unsigned default_bpp;
35
36 unsigned dotclk_delay; /* refer manual HW_LCDIF_VDCTRL4 register */
37 unsigned ld_intf_width; /* refer STMLCDIF_* macros */
38
39 unsigned fb_size; /* Size of the video memory. If zero a
40 * default will be used
41 */
42 unsigned long fb_phys; /* physical address for the video memory. If
43 * zero the framebuffer memory will be dynamically
44 * allocated. If specified,fb_size must also be specified.
45 * fb_phys must be unused by Linux.
46 */
47 u32 sync; /* sync mask, contains MXSFB specifics not
48 * carried in fb_info->var.sync
49 */
50};
51
52#endif /* __LINUX_MXSFB_H */
diff --git a/include/linux/platform_data/mmc-davinci.h b/include/linux/platform_data/mmc-davinci.h
index 5ba6b22ce338..9cea4ee377b5 100644
--- a/include/linux/platform_data/mmc-davinci.h
+++ b/include/linux/platform_data/mmc-davinci.h
@@ -23,9 +23,6 @@ struct davinci_mmc_config {
23 /* any additional host capabilities: OR'd in to mmc->f_caps */ 23 /* any additional host capabilities: OR'd in to mmc->f_caps */
24 u32 caps; 24 u32 caps;
25 25
26 /* Version of the MMC/SD controller */
27 u8 version;
28
29 /* Number of sg segments */ 26 /* Number of sg segments */
30 u8 nr_sg; 27 u8 nr_sg;
31}; 28};
diff --git a/include/linux/spi/mxs-spi.h b/include/linux/spi/mxs-spi.h
index 61ae1306db23..4835486f58e5 100644
--- a/include/linux/spi/mxs-spi.h
+++ b/include/linux/spi/mxs-spi.h
@@ -24,7 +24,7 @@
24#ifndef __LINUX_SPI_MXS_SPI_H__ 24#ifndef __LINUX_SPI_MXS_SPI_H__
25#define __LINUX_SPI_MXS_SPI_H__ 25#define __LINUX_SPI_MXS_SPI_H__
26 26
27#include <linux/fsl/mxs-dma.h> 27#include <linux/dmaengine.h>
28 28
29#define ssp_is_old(host) ((host)->devid == IMX23_SSP) 29#define ssp_is_old(host) ((host)->devid == IMX23_SSP)
30 30
@@ -137,9 +137,7 @@ struct mxs_ssp {
137 unsigned int clk_rate; 137 unsigned int clk_rate;
138 enum mxs_ssp_id devid; 138 enum mxs_ssp_id devid;
139 139
140 int dma_channel;
141 struct dma_chan *dmach; 140 struct dma_chan *dmach;
142 struct mxs_dma_data dma_data;
143 unsigned int dma_dir; 141 unsigned int dma_dir;
144 enum dma_transfer_direction slave_dirn; 142 enum dma_transfer_direction slave_dirn;
145 u32 ssp_pio_words[SSP_PIO_NUM]; 143 u32 ssp_pio_words[SSP_PIO_NUM];
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h
index 28884c717411..148d35171aac 100644
--- a/include/linux/usb/nop-usb-xceiv.h
+++ b/include/linux/usb/nop-usb-xceiv.h
@@ -5,6 +5,11 @@
5 5
6struct nop_usb_xceiv_platform_data { 6struct nop_usb_xceiv_platform_data {
7 enum usb_phy_type type; 7 enum usb_phy_type type;
8 unsigned long clk_rate;
9
10 /* if set fails with -EPROBE_DEFER if can't get regulator */
11 unsigned int needs_vcc:1;
12 unsigned int needs_reset:1;
8}; 13};
9 14
10#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) 15#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 3a2aa1d19b93..41a6136e3535 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -33,11 +33,12 @@
33#include <sound/pcm_params.h> 33#include <sound/pcm_params.h>
34#include <sound/soc.h> 34#include <sound/soc.h>
35#include <asm/mach-types.h> 35#include <asm/mach-types.h>
36#include <mach/hardware.h>
37#include <mach/mxs.h>
38 36
39#include "mxs-saif.h" 37#include "mxs-saif.h"
40 38
39#define MXS_SET_ADDR 0x4
40#define MXS_CLR_ADDR 0x8
41
41static struct mxs_saif *mxs_saif[2]; 42static struct mxs_saif *mxs_saif[2];
42 43
43/* 44/*