Merge tag 'drivers_for_v3.9' of git://git.infradead.org/users/jcooper/linux into...
authorOlof Johansson <olof@lixom.net>
Tue, 5 Feb 2013 06:56:53 +0000 (22:56 -0800)
committerOlof Johansson <olof@lixom.net>
Tue, 5 Feb 2013 06:56:53 +0000 (22:56 -0800)
From Jason Cooper:
mvebu drivers for v3.9
 - use rtc-mv in mvebu armv7 SoCs
 - add pci-e hotplug for kirkwood

Depends on:
 - tags/mvebu_fixes_for_v3.8-rc6

* tag 'drivers_for_v3.9' of git://git.infradead.org/users/jcooper/linux:
  cpuidle: kirkwood: Move out of mach directory
  rtc: Add support of rtc-mv for MVEBU SoCs
  ARM: Kirkwood: Support basic hotplug for PCI-E
  arm: mvebu: i2c come back in defconfig
  arm: plat-orion: fix printing of "MPP config unavailable on this hardware"
  Dove: activate GPIO interrupts in DT

935 files changed:
Documentation/device-mapper/dm-raid.txt
Documentation/devicetree/bindings/arm/sirf.txt
Documentation/devicetree/bindings/arm/vt8500.txt
Documentation/devicetree/bindings/clock/imx31-clock.txt [new file with mode: 0644]
Documentation/hid/hid-sensor.txt [changed mode: 0755->0644]
Documentation/x86/boot.txt
Documentation/x86/zero-page.txt
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/emev2.dtsi
arch/arm/boot/dts/imx31.dtsi
arch/arm/boot/dts/marco-evb.dts [new file with mode: 0644]
arch/arm/boot/dts/marco.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sh73a0-reference.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sh73a0.dtsi [new file with mode: 0644]
arch/arm/boot/dts/wm8850-w70v2.dts [new file with mode: 0644]
arch/arm/boot/dts/wm8850.dtsi [new file with mode: 0644]
arch/arm/common/Kconfig
arch/arm/common/Makefile
arch/arm/common/gic.c [deleted file]
arch/arm/common/vic.c [deleted file]
arch/arm/configs/imx_v6_v7_defconfig
arch/arm/configs/prima2_defconfig
arch/arm/include/asm/hardware/gic.h [deleted file]
arch/arm/include/asm/hardware/vic.h [deleted file]
arch/arm/include/asm/mach/arch.h
arch/arm/include/asm/mach/irq.h
arch/arm/include/asm/mach/time.h
arch/arm/include/debug/imx.S
arch/arm/include/debug/vt8500.S [new file with mode: 0644]
arch/arm/kernel/irq.c
arch/arm/kernel/smp.c
arch/arm/kernel/smp_twd.c
arch/arm/kernel/time.c
arch/arm/mach-at91/at91rm9200_time.c
arch/arm/mach-at91/at91sam926x_time.c
arch/arm/mach-at91/at91x40_time.c
arch/arm/mach-at91/board-1arm.c
arch/arm/mach-at91/board-afeb-9260v1.c
arch/arm/mach-at91/board-cam60.c
arch/arm/mach-at91/board-carmeva.c
arch/arm/mach-at91/board-cpu9krea.c
arch/arm/mach-at91/board-cpuat91.c
arch/arm/mach-at91/board-csb337.c
arch/arm/mach-at91/board-csb637.c
arch/arm/mach-at91/board-dt.c
arch/arm/mach-at91/board-eb01.c
arch/arm/mach-at91/board-eb9200.c
arch/arm/mach-at91/board-ecbat91.c
arch/arm/mach-at91/board-eco920.c
arch/arm/mach-at91/board-flexibity.c
arch/arm/mach-at91/board-foxg20.c
arch/arm/mach-at91/board-gsia18s.c
arch/arm/mach-at91/board-kafa.c
arch/arm/mach-at91/board-kb9202.c
arch/arm/mach-at91/board-neocore926.c
arch/arm/mach-at91/board-pcontrol-g20.c
arch/arm/mach-at91/board-picotux200.c
arch/arm/mach-at91/board-qil-a9260.c
arch/arm/mach-at91/board-rm9200-dt.c
arch/arm/mach-at91/board-rm9200dk.c
arch/arm/mach-at91/board-rm9200ek.c
arch/arm/mach-at91/board-rsi-ews.c
arch/arm/mach-at91/board-sam9-l9260.c
arch/arm/mach-at91/board-sam9260ek.c
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-at91/board-sam9263ek.c
arch/arm/mach-at91/board-sam9g20ek.c
arch/arm/mach-at91/board-sam9m10g45ek.c
arch/arm/mach-at91/board-sam9rlek.c
arch/arm/mach-at91/board-snapper9260.c
arch/arm/mach-at91/board-stamp9g20.c
arch/arm/mach-at91/board-usb-a926x.c
arch/arm/mach-at91/board-yl-9200.c
arch/arm/mach-at91/generic.h
arch/arm/mach-bcm/board_bcm.c
arch/arm/mach-bcm2835/bcm2835.c
arch/arm/mach-clps711x/board-autcpu12.c
arch/arm/mach-clps711x/board-cdb89712.c
arch/arm/mach-clps711x/board-clep7312.c
arch/arm/mach-clps711x/board-edb7211.c
arch/arm/mach-clps711x/board-fortunet.c
arch/arm/mach-clps711x/board-p720t.c
arch/arm/mach-clps711x/common.c
arch/arm/mach-clps711x/common.h
arch/arm/mach-cns3xxx/cns3420vb.c
arch/arm/mach-cns3xxx/core.c
arch/arm/mach-cns3xxx/core.h
arch/arm/mach-davinci/board-da830-evm.c
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/board-dm355-evm.c
arch/arm/mach-davinci/board-dm355-leopard.c
arch/arm/mach-davinci/board-dm365-evm.c
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/board-dm646x-evm.c
arch/arm/mach-davinci/board-mityomapl138.c
arch/arm/mach-davinci/board-neuros-osd2.c
arch/arm/mach-davinci/board-omapl138-hawk.c
arch/arm/mach-davinci/board-sffsdr.c
arch/arm/mach-davinci/board-tnetv107x-evm.c
arch/arm/mach-davinci/clock.c
arch/arm/mach-davinci/clock.h
arch/arm/mach-davinci/da850.c
arch/arm/mach-davinci/da8xx-dt.c
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/include/mach/clock.h
arch/arm/mach-davinci/include/mach/common.h
arch/arm/mach-davinci/include/mach/da8xx.h
arch/arm/mach-davinci/include/mach/psc.h
arch/arm/mach-davinci/psc.c
arch/arm/mach-davinci/time.c
arch/arm/mach-dove/cm-a510.c
arch/arm/mach-dove/common.c
arch/arm/mach-dove/common.h
arch/arm/mach-dove/dove-db-setup.c
arch/arm/mach-ebsa110/core.c
arch/arm/mach-ep93xx/adssphere.c
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/edb93xx.c
arch/arm/mach-ep93xx/gesbc9312.c
arch/arm/mach-ep93xx/include/mach/platform.h
arch/arm/mach-ep93xx/micro9.c
arch/arm/mach-ep93xx/simone.c
arch/arm/mach-ep93xx/snappercl15.c
arch/arm/mach-ep93xx/ts72xx.c
arch/arm/mach-ep93xx/vision_ep9307.c
arch/arm/mach-exynos/common.c
arch/arm/mach-exynos/common.h
arch/arm/mach-exynos/include/mach/regs-irq.h
arch/arm/mach-exynos/mach-armlex4210.c
arch/arm/mach-exynos/mach-exynos4-dt.c
arch/arm/mach-exynos/mach-exynos5-dt.c
arch/arm/mach-exynos/mach-nuri.c
arch/arm/mach-exynos/mach-origen.c
arch/arm/mach-exynos/mach-smdk4x12.c
arch/arm/mach-exynos/mach-smdkv310.c
arch/arm/mach-exynos/mach-universal_c210.c
arch/arm/mach-exynos/mct.c
arch/arm/mach-exynos/platsmp.c
arch/arm/mach-footbridge/cats-hw.c
arch/arm/mach-footbridge/common.h
arch/arm/mach-footbridge/dc21285-timer.c
arch/arm/mach-footbridge/ebsa285.c
arch/arm/mach-footbridge/isa-timer.c
arch/arm/mach-footbridge/netwinder-hw.c
arch/arm/mach-footbridge/personal.c
arch/arm/mach-gemini/board-nas4220b.c
arch/arm/mach-gemini/board-rut1xx.c
arch/arm/mach-gemini/board-wbd111.c
arch/arm/mach-gemini/board-wbd222.c
arch/arm/mach-h720x/common.c
arch/arm/mach-h720x/common.h
arch/arm/mach-h720x/cpu-h7201.c
arch/arm/mach-h720x/cpu-h7202.c
arch/arm/mach-h720x/h7201-eval.c
arch/arm/mach-h720x/h7202-eval.c
arch/arm/mach-highbank/highbank.c
arch/arm/mach-highbank/platsmp.c
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/Makefile
arch/arm/mach-imx/Makefile.boot
arch/arm/mach-imx/clk-imx27.c
arch/arm/mach-imx/clk-imx31.c
arch/arm/mach-imx/clk-imx35.c
arch/arm/mach-imx/clk-imx6q.c
arch/arm/mach-imx/common.h
arch/arm/mach-imx/cpu-imx5.c
arch/arm/mach-imx/cpuidle-imx6q.c [new file with mode: 0644]
arch/arm/mach-imx/cpuidle.h
arch/arm/mach-imx/devices-imx50.h [deleted file]
arch/arm/mach-imx/devices/Kconfig
arch/arm/mach-imx/devices/platform-fec.c
arch/arm/mach-imx/devices/platform-imx-i2c.c
arch/arm/mach-imx/devices/platform-imx-uart.c
arch/arm/mach-imx/epit.c
arch/arm/mach-imx/gpc.c
arch/arm/mach-imx/hardware.h
arch/arm/mach-imx/imx25-dt.c
arch/arm/mach-imx/imx27-dt.c
arch/arm/mach-imx/imx31-dt.c
arch/arm/mach-imx/imx51-dt.c
arch/arm/mach-imx/iomux-mx50.h [deleted file]
arch/arm/mach-imx/lluart.c [deleted file]
arch/arm/mach-imx/mach-apf9328.c
arch/arm/mach-imx/mach-armadillo5x0.c
arch/arm/mach-imx/mach-bug.c
arch/arm/mach-imx/mach-cpuimx27.c
arch/arm/mach-imx/mach-cpuimx35.c
arch/arm/mach-imx/mach-cpuimx51sd.c
arch/arm/mach-imx/mach-eukrea_cpuimx25.c
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
arch/arm/mach-imx/mach-imx27ipcam.c
arch/arm/mach-imx/mach-imx27lite.c
arch/arm/mach-imx/mach-imx53.c
arch/arm/mach-imx/mach-imx6q.c
arch/arm/mach-imx/mach-kzm_arm11_01.c
arch/arm/mach-imx/mach-mx1ads.c
arch/arm/mach-imx/mach-mx21ads.c
arch/arm/mach-imx/mach-mx25_3ds.c
arch/arm/mach-imx/mach-mx27_3ds.c
arch/arm/mach-imx/mach-mx27ads.c
arch/arm/mach-imx/mach-mx31_3ds.c
arch/arm/mach-imx/mach-mx31ads.c
arch/arm/mach-imx/mach-mx31lilly.c
arch/arm/mach-imx/mach-mx31lite.c
arch/arm/mach-imx/mach-mx31moboard.c
arch/arm/mach-imx/mach-mx35_3ds.c
arch/arm/mach-imx/mach-mx50_rdp.c [deleted file]
arch/arm/mach-imx/mach-mx51_3ds.c [deleted file]
arch/arm/mach-imx/mach-mx51_babbage.c
arch/arm/mach-imx/mach-mxt_td60.c
arch/arm/mach-imx/mach-pca100.c
arch/arm/mach-imx/mach-pcm037.c
arch/arm/mach-imx/mach-pcm038.c
arch/arm/mach-imx/mach-pcm043.c
arch/arm/mach-imx/mach-qong.c
arch/arm/mach-imx/mach-scb9328.c
arch/arm/mach-imx/mach-vpr200.c
arch/arm/mach-imx/mm-imx5.c
arch/arm/mach-imx/mx50.h [deleted file]
arch/arm/mach-imx/mxc.h
arch/arm/mach-imx/platsmp.c
arch/arm/mach-imx/pm-imx5.c
arch/arm/mach-imx/time.c
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-iop13xx/iq81340mc.c
arch/arm/mach-iop13xx/iq81340sc.c
arch/arm/mach-iop32x/em7210.c
arch/arm/mach-iop32x/glantank.c
arch/arm/mach-iop32x/iq31244.c
arch/arm/mach-iop32x/iq80321.c
arch/arm/mach-iop32x/n2100.c
arch/arm/mach-iop33x/iq80331.c
arch/arm/mach-iop33x/iq80332.c
arch/arm/mach-ixp4xx/avila-setup.c
arch/arm/mach-ixp4xx/common.c
arch/arm/mach-ixp4xx/coyote-setup.c
arch/arm/mach-ixp4xx/dsmg600-setup.c
arch/arm/mach-ixp4xx/fsg-setup.c
arch/arm/mach-ixp4xx/gateway7001-setup.c
arch/arm/mach-ixp4xx/goramo_mlr.c
arch/arm/mach-ixp4xx/gtwx5715-setup.c
arch/arm/mach-ixp4xx/include/mach/platform.h
arch/arm/mach-ixp4xx/ixdp425-setup.c
arch/arm/mach-ixp4xx/nas100d-setup.c
arch/arm/mach-ixp4xx/nslu2-setup.c
arch/arm/mach-ixp4xx/omixp-setup.c
arch/arm/mach-ixp4xx/vulcan-setup.c
arch/arm/mach-ixp4xx/wg302v2-setup.c
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/common.h
arch/arm/mach-kirkwood/d2net_v2-setup.c
arch/arm/mach-kirkwood/db88f6281-bp-setup.c
arch/arm/mach-kirkwood/dockstar-setup.c
arch/arm/mach-kirkwood/guruplug-setup.c
arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
arch/arm/mach-kirkwood/netspace_v2-setup.c
arch/arm/mach-kirkwood/netxbig_v2-setup.c
arch/arm/mach-kirkwood/openrd-setup.c
arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
arch/arm/mach-kirkwood/rd88f6281-setup.c
arch/arm/mach-kirkwood/sheevaplug-setup.c
arch/arm/mach-kirkwood/t5325-setup.c
arch/arm/mach-kirkwood/ts219-setup.c
arch/arm/mach-kirkwood/ts41x-setup.c
arch/arm/mach-ks8695/board-acs5k.c
arch/arm/mach-ks8695/board-dsm320.c
arch/arm/mach-ks8695/board-micrel.c
arch/arm/mach-ks8695/board-og.c
arch/arm/mach-ks8695/board-sg.c
arch/arm/mach-ks8695/generic.h
arch/arm/mach-ks8695/time.c
arch/arm/mach-lpc32xx/common.h
arch/arm/mach-lpc32xx/phy3250.c
arch/arm/mach-lpc32xx/timer.c
arch/arm/mach-mmp/aspenite.c
arch/arm/mach-mmp/avengers_lite.c
arch/arm/mach-mmp/brownstone.c
arch/arm/mach-mmp/common.h
arch/arm/mach-mmp/flint.c
arch/arm/mach-mmp/gplugd.c
arch/arm/mach-mmp/include/mach/mmp2.h
arch/arm/mach-mmp/include/mach/pxa168.h
arch/arm/mach-mmp/include/mach/pxa910.h
arch/arm/mach-mmp/jasper.c
arch/arm/mach-mmp/mmp-dt.c
arch/arm/mach-mmp/mmp2-dt.c
arch/arm/mach-mmp/mmp2.c
arch/arm/mach-mmp/pxa168.c
arch/arm/mach-mmp/pxa910.c
arch/arm/mach-mmp/tavorevb.c
arch/arm/mach-mmp/teton_bga.c
arch/arm/mach-mmp/time.c
arch/arm/mach-mmp/ttc_dkb.c
arch/arm/mach-msm/board-dt-8660.c
arch/arm/mach-msm/board-dt-8960.c
arch/arm/mach-msm/board-halibut.c
arch/arm/mach-msm/board-mahimahi.c
arch/arm/mach-msm/board-msm7x30.c
arch/arm/mach-msm/board-qsd8x50.c
arch/arm/mach-msm/board-sapphire.c
arch/arm/mach-msm/board-trout.c
arch/arm/mach-msm/common.h
arch/arm/mach-msm/platsmp.c
arch/arm/mach-msm/timer.c
arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
arch/arm/mach-mv78xx0/common.c
arch/arm/mach-mv78xx0/common.h
arch/arm/mach-mv78xx0/db78x00-bp-setup.c
arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
arch/arm/mach-mvebu/armada-370-xp.c
arch/arm/mach-mxs/mach-mxs.c
arch/arm/mach-mxs/timer.c
arch/arm/mach-netx/generic.c
arch/arm/mach-netx/generic.h
arch/arm/mach-netx/nxdb500.c
arch/arm/mach-netx/nxdkn.c
arch/arm/mach-netx/nxeb500hmi.c
arch/arm/mach-netx/time.c
arch/arm/mach-nomadik/board-nhk8815.c
arch/arm/mach-nomadik/cpu-8815.c
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-fsample.c
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-htcherald.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap1/common.h
arch/arm/mach-omap1/time.c
arch/arm/mach-omap1/timer32k.c
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-3630sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-am3517crane.c
arch/arm/mach-omap2/board-am3517evm.c
arch/arm/mach-omap2/board-apollon.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-cm-t3517.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-n8x0.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3logic.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3stalker.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-rm680.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/board-ti8168evm.c
arch/arm/mach-omap2/board-zoom.c
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/omap-smp.c
arch/arm/mach-omap2/omap-wakeupgen.c
arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-orion5x/board-dt.c
arch/arm/mach-orion5x/common.c
arch/arm/mach-orion5x/common.h
arch/arm/mach-orion5x/d2net-setup.c
arch/arm/mach-orion5x/db88f5281-setup.c
arch/arm/mach-orion5x/dns323-setup.c
arch/arm/mach-orion5x/kurobox_pro-setup.c
arch/arm/mach-orion5x/ls-chl-setup.c
arch/arm/mach-orion5x/ls_hgl-setup.c
arch/arm/mach-orion5x/lsmini-setup.c
arch/arm/mach-orion5x/mss2-setup.c
arch/arm/mach-orion5x/mv2120-setup.c
arch/arm/mach-orion5x/net2big-setup.c
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
arch/arm/mach-orion5x/rd88f5182-setup.c
arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
arch/arm/mach-orion5x/terastation_pro2-setup.c
arch/arm/mach-orion5x/ts209-setup.c
arch/arm/mach-orion5x/ts409-setup.c
arch/arm/mach-orion5x/ts78xx-setup.c
arch/arm/mach-orion5x/wnr854t-setup.c
arch/arm/mach-orion5x/wrt350n-v2-setup.c
arch/arm/mach-picoxcell/common.c
arch/arm/mach-picoxcell/common.h
arch/arm/mach-prima2/Kconfig
arch/arm/mach-prima2/Makefile
arch/arm/mach-prima2/common.c
arch/arm/mach-prima2/common.h
arch/arm/mach-prima2/headsmp.S [new file with mode: 0644]
arch/arm/mach-prima2/hotplug.c [new file with mode: 0644]
arch/arm/mach-prima2/include/mach/irqs.h
arch/arm/mach-prima2/include/mach/uart.h
arch/arm/mach-prima2/include/mach/uncompress.h
arch/arm/mach-prima2/irq.c
arch/arm/mach-prima2/l2x0.c
arch/arm/mach-prima2/platsmp.c [new file with mode: 0644]
arch/arm/mach-prima2/rstc.c
arch/arm/mach-prima2/rtciobrg.c
arch/arm/mach-prima2/timer-marco.c [new file with mode: 0644]
arch/arm/mach-prima2/timer-prima2.c [new file with mode: 0644]
arch/arm/mach-prima2/timer.c [deleted file]
arch/arm/mach-pxa/balloon3.c
arch/arm/mach-pxa/capc7117.c
arch/arm/mach-pxa/cm-x2xx.c
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/colibri-pxa270.c
arch/arm/mach-pxa/colibri-pxa300.c
arch/arm/mach-pxa/colibri-pxa320.c
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/csb726.c
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/eseries.c
arch/arm/mach-pxa/ezx.c
arch/arm/mach-pxa/generic.h
arch/arm/mach-pxa/gumstix.c
arch/arm/mach-pxa/h5000.c
arch/arm/mach-pxa/himalaya.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/icontrol.c
arch/arm/mach-pxa/idp.c
arch/arm/mach-pxa/littleton.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/mioa701.c
arch/arm/mach-pxa/mp900.c
arch/arm/mach-pxa/palmld.c
arch/arm/mach-pxa/palmt5.c
arch/arm/mach-pxa/palmtc.c
arch/arm/mach-pxa/palmte2.c
arch/arm/mach-pxa/palmtreo.c
arch/arm/mach-pxa/palmtx.c
arch/arm/mach-pxa/palmz72.c
arch/arm/mach-pxa/pcm027.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/pxa-dt.c
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/saar.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/stargate2.c
arch/arm/mach-pxa/tavorevb.c
arch/arm/mach-pxa/time.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-pxa/trizeps4.c
arch/arm/mach-pxa/viper.c
arch/arm/mach-pxa/vpac270.c
arch/arm/mach-pxa/xcep.c
arch/arm/mach-pxa/z2.c
arch/arm/mach-pxa/zeus.c
arch/arm/mach-pxa/zylonite.c
arch/arm/mach-realview/core.c
arch/arm/mach-realview/platsmp.c
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-realview/realview_pb1176.c
arch/arm/mach-realview/realview_pb11mp.c
arch/arm/mach-realview/realview_pba8.c
arch/arm/mach-realview/realview_pbx.c
arch/arm/mach-rpc/riscpc.c
arch/arm/mach-rpc/time.c
arch/arm/mach-s3c24xx/mach-amlm5900.c
arch/arm/mach-s3c24xx/mach-anubis.c
arch/arm/mach-s3c24xx/mach-at2440evb.c
arch/arm/mach-s3c24xx/mach-bast.c
arch/arm/mach-s3c24xx/mach-gta02.c
arch/arm/mach-s3c24xx/mach-h1940.c
arch/arm/mach-s3c24xx/mach-jive.c
arch/arm/mach-s3c24xx/mach-mini2440.c
arch/arm/mach-s3c24xx/mach-n30.c
arch/arm/mach-s3c24xx/mach-nexcoder.c
arch/arm/mach-s3c24xx/mach-osiris.c
arch/arm/mach-s3c24xx/mach-otom.c
arch/arm/mach-s3c24xx/mach-qt2410.c
arch/arm/mach-s3c24xx/mach-rx1950.c
arch/arm/mach-s3c24xx/mach-rx3715.c
arch/arm/mach-s3c24xx/mach-smdk2410.c
arch/arm/mach-s3c24xx/mach-smdk2413.c
arch/arm/mach-s3c24xx/mach-smdk2416.c
arch/arm/mach-s3c24xx/mach-smdk2440.c
arch/arm/mach-s3c24xx/mach-smdk2443.c
arch/arm/mach-s3c24xx/mach-tct_hammer.c
arch/arm/mach-s3c24xx/mach-vr1000.c
arch/arm/mach-s3c24xx/mach-vstms.c
arch/arm/mach-s3c64xx/common.c
arch/arm/mach-s3c64xx/include/mach/regs-irq.h
arch/arm/mach-s3c64xx/include/mach/tick.h
arch/arm/mach-s3c64xx/mach-anw6410.c
arch/arm/mach-s3c64xx/mach-crag6410.c
arch/arm/mach-s3c64xx/mach-hmt.c
arch/arm/mach-s3c64xx/mach-mini6410.c
arch/arm/mach-s3c64xx/mach-ncp.c
arch/arm/mach-s3c64xx/mach-real6410.c
arch/arm/mach-s3c64xx/mach-smartq5.c
arch/arm/mach-s3c64xx/mach-smartq7.c
arch/arm/mach-s3c64xx/mach-smdk6400.c
arch/arm/mach-s3c64xx/mach-smdk6410.c
arch/arm/mach-s5p64x0/include/mach/regs-irq.h
arch/arm/mach-s5p64x0/include/mach/tick.h [deleted file]
arch/arm/mach-s5p64x0/mach-smdk6440.c
arch/arm/mach-s5p64x0/mach-smdk6450.c
arch/arm/mach-s5pc100/include/mach/regs-irq.h
arch/arm/mach-s5pc100/include/mach/tick.h
arch/arm/mach-s5pc100/mach-smdkc100.c
arch/arm/mach-s5pv210/include/mach/regs-irq.h
arch/arm/mach-s5pv210/include/mach/tick.h [deleted file]
arch/arm/mach-s5pv210/mach-aquila.c
arch/arm/mach-s5pv210/mach-goni.c
arch/arm/mach-s5pv210/mach-smdkc110.c
arch/arm/mach-s5pv210/mach-smdkv210.c
arch/arm/mach-s5pv210/mach-torbreck.c
arch/arm/mach-sa1100/assabet.c
arch/arm/mach-sa1100/badge4.c
arch/arm/mach-sa1100/cerf.c
arch/arm/mach-sa1100/collie.c
arch/arm/mach-sa1100/generic.h
arch/arm/mach-sa1100/h3100.c
arch/arm/mach-sa1100/h3600.c
arch/arm/mach-sa1100/hackkit.c
arch/arm/mach-sa1100/jornada720.c
arch/arm/mach-sa1100/lart.c
arch/arm/mach-sa1100/nanoengine.c
arch/arm/mach-sa1100/pleb.c
arch/arm/mach-sa1100/shannon.c
arch/arm/mach-sa1100/simpad.c
arch/arm/mach-sa1100/time.c
arch/arm/mach-shark/core.c
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-bonito.c
arch/arm/mach-shmobile/board-kota2.c
arch/arm/mach-shmobile/board-kzm9d.c
arch/arm/mach-shmobile/board-kzm9g.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/board-marzen.c
arch/arm/mach-shmobile/clock-r8a7740.c
arch/arm/mach-shmobile/clock-sh7372.c
arch/arm/mach-shmobile/clock-sh73a0.c
arch/arm/mach-shmobile/headsmp-sh73a0.S [new file with mode: 0644]
arch/arm/mach-shmobile/hotplug.c
arch/arm/mach-shmobile/include/mach/common.h
arch/arm/mach-shmobile/intc-r8a7779.c
arch/arm/mach-shmobile/intc-sh73a0.c
arch/arm/mach-shmobile/platsmp.c
arch/arm/mach-shmobile/pm-r8a7740.c
arch/arm/mach-shmobile/pm-sh73a0.c [new file with mode: 0644]
arch/arm/mach-shmobile/setup-emev2.c
arch/arm/mach-shmobile/setup-r8a7740.c
arch/arm/mach-shmobile/setup-r8a7779.c
arch/arm/mach-shmobile/setup-sh7372.c
arch/arm/mach-shmobile/setup-sh73a0.c
arch/arm/mach-shmobile/sleep-sh7372.S
arch/arm/mach-shmobile/smp-emev2.c
arch/arm/mach-shmobile/smp-r8a7779.c
arch/arm/mach-shmobile/smp-sh73a0.c
arch/arm/mach-shmobile/timer.c
arch/arm/mach-socfpga/platsmp.c
arch/arm/mach-socfpga/socfpga.c
arch/arm/mach-spear13xx/include/mach/generic.h
arch/arm/mach-spear13xx/platsmp.c
arch/arm/mach-spear13xx/spear1310.c
arch/arm/mach-spear13xx/spear1340.c
arch/arm/mach-spear13xx/spear13xx.c
arch/arm/mach-spear3xx/include/mach/generic.h
arch/arm/mach-spear3xx/spear300.c
arch/arm/mach-spear3xx/spear310.c
arch/arm/mach-spear3xx/spear320.c
arch/arm/mach-spear3xx/spear3xx.c
arch/arm/mach-spear6xx/spear6xx.c
arch/arm/mach-sunxi/sunxi.c
arch/arm/mach-tegra/board-dt-tegra20.c
arch/arm/mach-tegra/board-dt-tegra30.c
arch/arm/mach-tegra/board.h
arch/arm/mach-tegra/common.c
arch/arm/mach-tegra/irq.c
arch/arm/mach-tegra/platsmp.c
arch/arm/mach-tegra/timer.c
arch/arm/mach-u300/core.c
arch/arm/mach-u300/timer.c
arch/arm/mach-u300/timer.h
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/cpu-db8500.c
arch/arm/mach-ux500/cpu.c
arch/arm/mach-ux500/include/mach/setup.h
arch/arm/mach-ux500/platsmp.c
arch/arm/mach-ux500/timer.c
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/core.h
arch/arm/mach-versatile/versatile_ab.c
arch/arm/mach-versatile/versatile_dt.c
arch/arm/mach-versatile/versatile_pb.c
arch/arm/mach-vexpress/ct-ca9x4.c
arch/arm/mach-vexpress/platsmp.c
arch/arm/mach-vexpress/v2m.c
arch/arm/mach-vt8500/Kconfig
arch/arm/mach-vt8500/Makefile
arch/arm/mach-vt8500/common.h
arch/arm/mach-vt8500/include/mach/debug-macro.S [deleted file]
arch/arm/mach-vt8500/include/mach/timex.h [deleted file]
arch/arm/mach-vt8500/include/mach/uncompress.h [deleted file]
arch/arm/mach-vt8500/timer.c [deleted file]
arch/arm/mach-vt8500/vt8500.c
arch/arm/mach-w90x900/mach-nuc910evb.c
arch/arm/mach-w90x900/mach-nuc950evb.c
arch/arm/mach-w90x900/mach-nuc960evb.c
arch/arm/mach-w90x900/nuc9xx.h
arch/arm/mach-w90x900/time.c
arch/arm/mach-zynq/common.c
arch/arm/plat-iop/time.c
arch/arm/plat-orion/time.c
arch/arm/plat-samsung/include/plat/cpu.h
arch/arm/plat-samsung/include/plat/s5p-time.h
arch/arm/plat-samsung/s5p-irq-eint.c
arch/arm/plat-samsung/s5p-irq.c
arch/arm/plat-samsung/s5p-time.c
arch/arm/plat-samsung/time.c
arch/arm/plat-spear/time.c
arch/arm/plat-versatile/platsmp.c
arch/blackfin/kernel/time.c
arch/cris/arch-v10/kernel/time.c
arch/cris/kernel/time.c
arch/m32r/kernel/time.c
arch/m68k/amiga/config.c
arch/m68k/apollo/config.c
arch/m68k/atari/config.c
arch/m68k/atari/time.c
arch/m68k/bvme6000/config.c
arch/m68k/hp300/config.c
arch/m68k/hp300/time.c
arch/m68k/hp300/time.h
arch/m68k/include/asm/machdep.h
arch/m68k/kernel/setup_mm.c
arch/m68k/kernel/time.c
arch/m68k/mac/config.c
arch/m68k/mac/via.c
arch/m68k/mvme147/config.c
arch/m68k/mvme16x/config.c
arch/m68k/q40/config.c
arch/m68k/sun3/config.c
arch/m68k/sun3/intersil.c
arch/m68k/sun3x/config.c
arch/m68k/sun3x/time.c
arch/m68k/sun3x/time.h
arch/mips/bcm47xx/Kconfig
arch/mips/cavium-octeon/executive/cvmx-l2c.c
arch/mips/include/asm/break.h [deleted file]
arch/mips/include/asm/dsp.h
arch/mips/include/asm/inst.h
arch/mips/include/asm/mach-pnx833x/war.h
arch/mips/include/asm/pgtable-64.h
arch/mips/include/uapi/asm/Kbuild
arch/mips/include/uapi/asm/break.h [new file with mode: 0644]
arch/mips/kernel/ftrace.c
arch/mips/kernel/mcount.S
arch/mips/kernel/vpe.c
arch/mips/lantiq/irq.c
arch/mips/lib/delay.c
arch/mips/mm/ioremap.c
arch/mips/mm/mmap.c
arch/mips/netlogic/xlr/setup.c
arch/mips/pci/pci-ar71xx.c
arch/mips/pci/pci-ar724x.c
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/kgdb.c
arch/powerpc/kernel/time.c
arch/powerpc/oprofile/op_model_power4.c
arch/powerpc/platforms/pasemi/cpufreq.c
arch/s390/include/asm/pgtable.h
arch/x86/Kconfig
arch/x86/boot/Makefile
arch/x86/boot/compressed/eboot.c
arch/x86/boot/compressed/head_32.S
arch/x86/boot/compressed/head_64.S
arch/x86/boot/header.S
arch/x86/boot/setup.ld
arch/x86/boot/tools/build.c
arch/x86/include/asm/efi.h
arch/x86/include/asm/uv/uv.h
arch/x86/include/uapi/asm/bootparam.h
arch/x86/kernel/entry_64.S
arch/x86/kernel/head_32.S
arch/x86/kernel/msr.c
arch/x86/kernel/pci-dma.c
arch/x86/kernel/reboot.c
arch/x86/kernel/setup.c
arch/x86/platform/efi/efi.c
arch/x86/platform/efi/efi_64.c
arch/x86/platform/uv/tlb_uv.c
arch/x86/tools/relocs.c
drivers/acpi/osl.c
drivers/bluetooth/ath3k.c
drivers/bluetooth/btusb.c
drivers/clk/clk-bcm2835.c
drivers/clocksource/Kconfig
drivers/clocksource/Makefile
drivers/clocksource/bcm2835_timer.c
drivers/clocksource/clksrc-of.c [new file with mode: 0644]
drivers/clocksource/cs5535-clockevt.c
drivers/clocksource/dw_apb_timer_of.c
drivers/clocksource/nomadik-mtu.c
drivers/clocksource/sunxi_timer.c
drivers/clocksource/tcb_clksrc.c
drivers/clocksource/vt8500_timer.c [new file with mode: 0644]
drivers/edac/edac_mc.c
drivers/edac/edac_pci_sysfs.c
drivers/firmware/dmi_scan.c
drivers/firmware/efivars.c
drivers/firmware/iscsi_ibft_find.c
drivers/gpu/drm/exynos/Kconfig
drivers/gpu/drm/exynos/exynos_drm_connector.c
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
drivers/gpu/drm/exynos/exynos_drm_drv.h
drivers/gpu/drm/exynos/exynos_drm_g2d.c
drivers/gpu/drm/exynos/exynos_drm_hdmi.c
drivers/gpu/drm/exynos/exynos_drm_hdmi.h
drivers/gpu/drm/exynos/exynos_drm_ipp.c
drivers/gpu/drm/exynos/exynos_drm_rotator.c
drivers/gpu/drm/exynos/exynos_drm_vidi.c
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/exynos/exynos_mixer.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon_cs.c
drivers/gpu/drm/radeon/radeon_cursor.c
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/hid/hid-ids.h
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/usbhid/hid-quirks.c
drivers/iommu/amd_iommu_init.c
drivers/iommu/intel-iommu.c
drivers/irqchip/Kconfig
drivers/irqchip/Makefile
drivers/irqchip/irq-gic.c [new file with mode: 0644]
drivers/irqchip/irq-vic.c [new file with mode: 0644]
drivers/irqchip/irqchip.c [new file with mode: 0644]
drivers/irqchip/irqchip.h [new file with mode: 0644]
drivers/irqchip/spear-shirq.c
drivers/isdn/gigaset/capi.c
drivers/md/dm-raid.c
drivers/md/dm-thin.c
drivers/md/dm.c
drivers/mfd/Kconfig
drivers/mfd/ab8500-core.c
drivers/mfd/arizona-core.c
drivers/mfd/arizona-irq.c
drivers/mfd/da9052-i2c.c
drivers/mfd/db8500-prcmu.c
drivers/mfd/max77686.c
drivers/mfd/max77693.c
drivers/mfd/pcf50633-core.c
drivers/mfd/rtl8411.c
drivers/mfd/rts5209.c
drivers/mfd/rts5229.c
drivers/mfd/rtsx_pcr.c
drivers/mfd/tc3589x.c
drivers/mfd/twl4030-power.c
drivers/mfd/vexpress-config.c
drivers/mfd/wm5102-tables.c
drivers/mmc/host/rtsx_pci_sdmmc.c
drivers/net/can/c_can/c_can.c
drivers/net/can/pch_can.c
drivers/net/can/ti_hecc.c
drivers/net/ethernet/3com/3c574_cs.c
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/calxeda/xgmac.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/intel/ixgbe/Makefile
drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
drivers/net/ethernet/mellanox/mlx4/en_tx.c
drivers/net/ethernet/mellanox/mlx4/main.c
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
drivers/net/ethernet/realtek/r8169.c
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc_drv.c
drivers/net/loopback.c
drivers/net/macvlan.c
drivers/net/phy/icplus.c
drivers/net/phy/marvell.c
drivers/net/tun.c
drivers/net/usb/cdc_mbim.c
drivers/net/usb/cdc_ncm.c
drivers/net/usb/dm9601.c
drivers/net/usb/qmi_wwan.c
drivers/net/usb/usbnet.c
drivers/net/virtio_net.c
drivers/net/wireless/ath/ath9k/ar9003_calib.c
drivers/net/wireless/ath/ath9k/ar9003_phy.c
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/beacon.c
drivers/net/wireless/ath/ath9k/debug.c
drivers/net/wireless/ath/ath9k/debug.h
drivers/net/wireless/ath/ath9k/htc_hst.c
drivers/net/wireless/ath/ath9k/hw.h
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
drivers/net/wireless/iwlegacy/common.c
drivers/net/wireless/iwlwifi/dvm/tx.c
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/mwifiex/pcie.c
drivers/net/wireless/mwifiex/sta_ioctl.c
drivers/net/wireless/rtlwifi/Kconfig
drivers/pinctrl/Kconfig
drivers/pinctrl/mvebu/pinctrl-dove.c
drivers/pinctrl/mvebu/pinctrl-kirkwood.c
drivers/pinctrl/pinctrl-exynos5440.c
drivers/pinctrl/pinctrl-mxs.c
drivers/pinctrl/pinctrl-nomadik.c
drivers/pinctrl/pinctrl-single.c
drivers/platform/x86/ibm_rtl.c
drivers/platform/x86/samsung-laptop.c
drivers/regulator/dbx500-prcmu.c
drivers/regulator/tps80031-regulator.c
drivers/scsi/isci/init.c
fs/gfs2/lock_dlm.c
fs/nfs/namespace.c
fs/nfs/nfs4client.c
fs/nfs/nfs4state.c
fs/nfs/super.c
fs/xfs/xfs_aops.c
fs/xfs/xfs_bmap.c
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_dfrag.c
fs/xfs/xfs_iomap.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_trace.h
include/asm-generic/vmlinux.lds.h
include/linux/bcm2835_timer.h
include/linux/clocksource.h
include/linux/dw_apb_timer.h
include/linux/efi.h
include/linux/irqchip.h [new file with mode: 0644]
include/linux/irqchip/arm-gic.h [new file with mode: 0644]
include/linux/irqchip/arm-vic.h [new file with mode: 0644]
include/linux/mfd/abx500.h
include/linux/mfd/abx500/ab8500-bm.h
include/linux/mfd/da9052/da9052.h
include/linux/mfd/da9052/reg.h
include/linux/mfd/rtsx_common.h
include/linux/mfd/rtsx_pci.h
include/linux/security.h
include/linux/sunxi_timer.h
include/linux/time.h
include/linux/usb/usbnet.h
include/linux/vt8500_timer.h [new file with mode: 0644]
include/net/ip.h
include/net/netfilter/nf_conntrack_core.h
init/main.c
kernel/printk.c
kernel/smp.c
kernel/time/clockevents.c
kernel/time/timekeeping.c
net/batman-adv/distributed-arp-table.c
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c
net/bluetooth/hidp/core.c
net/bluetooth/l2cap_core.c
net/bluetooth/sco.c
net/core/request_sock.c
net/core/scm.c
net/core/skbuff.c
net/ipv4/ah4.c
net/ipv4/datagram.c
net/ipv4/esp4.c
net/ipv4/ip_gre.c
net/ipv4/ipcomp.c
net/ipv4/ping.c
net/ipv4/raw.c
net/ipv4/route.c
net/ipv4/tcp_ipv4.c
net/ipv4/udp.c
net/ipv6/ah6.c
net/ipv6/esp6.c
net/ipv6/icmp.c
net/ipv6/ip6_output.c
net/ipv6/ip6mr.c
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/mesh_hwmp.c
net/mac80211/offchannel.c
net/mac80211/scan.c
net/mac80211/tx.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/x_tables.c
net/netfilter/xt_CT.c
net/sctp/outqueue.c
net/sctp/sm_statefuns.c
net/sctp/sysctl.c
net/sunrpc/sched.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_replay.c
security/capability.c
security/security.c
security/selinux/hooks.c
security/selinux/include/classmap.h
security/selinux/include/objsec.h
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_realtek.c
sound/soc/codecs/arizona.c
sound/soc/codecs/wm2200.c
sound/soc/codecs/wm5102.c
sound/soc/codecs/wm5110.c
sound/soc/codecs/wm_adsp.c
sound/soc/fsl/Kconfig
sound/soc/fsl/Makefile
sound/soc/fsl/imx-pcm.c
sound/soc/soc-dapm.c
sound/usb/mixer.c

index 728c38c242d631b88117958360c6f8441a72be4b..56fb62b09fc59ad757fc81de6ad6e478b3b0184b 100644 (file)
@@ -141,3 +141,4 @@ Version History
 1.2.0  Handle creation of arrays that contain failed devices.
 1.3.0  Added support for RAID 10
 1.3.1  Allow device replacement/rebuild for RAID 10
+1.3.2   Fix/improve redundancy checking for RAID10
index 1881e1c6dda59aea8d1c0076a70481eaec3a59fd..c6ba6d3c747fda7947a0e9263fa6f4ed7a73c341 100644 (file)
@@ -1,3 +1,9 @@
-prima2 "cb" evaluation board
+CSR SiRFprimaII and SiRFmarco device tree bindings.
+========================================
+
 Required root node properties:
-    - compatible = "sirf,prima2-cb", "sirf,prima2";
+    - compatible:
+    - "sirf,prima2-cb" : prima2 "cb" evaluation board
+    - "sirf,marco-cb" : marco "cb" evaluation board
+    - "sirf,prima2" : prima2 device based board
+    - "sirf,marco" : marco device based board
index d657832c6819e167e1b757ab43e12839b70aa569..87dc1ddf47709ff4b46bf9f8fa5a078f482941d4 100644 (file)
@@ -12,3 +12,11 @@ compatible = "wm,wm8505";
 Boards with the Wondermedia WM8650 SoC shall have the following properties:
 Required root node property:
 compatible = "wm,wm8650";
+
+Boards with the Wondermedia WM8750 SoC shall have the following properties:
+Required root node property:
+compatible = "wm,wm8750";
+
+Boards with the Wondermedia WM8850 SoC shall have the following properties:
+Required root node property:
+compatible = "wm,wm8850";
diff --git a/Documentation/devicetree/bindings/clock/imx31-clock.txt b/Documentation/devicetree/bindings/clock/imx31-clock.txt
new file mode 100644 (file)
index 0000000..19df842
--- /dev/null
@@ -0,0 +1,91 @@
+* Clock bindings for Freescale i.MX31
+
+Required properties:
+- compatible: Should be "fsl,imx31-ccm"
+- reg: Address and length of the register set
+- interrupts: Should contain CCM interrupt
+- #clock-cells: Should be <1>
+
+The clock consumer should specify the desired clock by having the clock
+ID in its "clocks" phandle cell.  The following is a full list of i.MX31
+clocks and IDs.
+
+       Clock               ID
+       -----------------------
+       dummy                0
+       ckih                 1
+       ckil                 2
+       mpll                 3
+       spll                 4
+       upll                 5
+       mcu_main             6
+       hsp                  7
+       ahb                  8
+       nfc                  9
+       ipg                  10
+       per_div              11
+       per                  12
+       csi_sel              13
+       fir_sel              14
+       csi_div              15
+       usb_div_pre          16
+       usb_div_post         17
+       fir_div_pre          18
+       fir_div_post         19
+       sdhc1_gate           20
+       sdhc2_gate           21
+       gpt_gate             22
+       epit1_gate           23
+       epit2_gate           24
+       iim_gate             25
+       ata_gate             26
+       sdma_gate            27
+       cspi3_gate           28
+       rng_gate             29
+       uart1_gate           30
+       uart2_gate           31
+       ssi1_gate            32
+       i2c1_gate            33
+       i2c2_gate            34
+       i2c3_gate            35
+       hantro_gate          36
+       mstick1_gate         37
+       mstick2_gate         38
+       csi_gate             39
+       rtc_gate             40
+       wdog_gate            41
+       pwm_gate             42
+       sim_gate             43
+       ect_gate             44
+       usb_gate             45
+       kpp_gate             46
+       ipu_gate             47
+       uart3_gate           48
+       uart4_gate           49
+       uart5_gate           50
+       owire_gate           51
+       ssi2_gate            52
+       cspi1_gate           53
+       cspi2_gate           54
+       gacc_gate            55
+       emi_gate             56
+       rtic_gate            57
+       firi_gate            58
+
+Examples:
+
+clks: ccm@53f80000{
+       compatible = "fsl,imx31-ccm";
+       reg = <0x53f80000 0x4000>;
+       interrupts = <0 31 0x04 0 53 0x04>;
+       #clock-cells = <1>;
+};
+
+uart1: serial@43f90000 {
+       compatible = "fsl,imx31-uart", "fsl,imx21-uart";
+       reg = <0x43f90000 0x4000>;
+       interrupts = <45>;
+       clocks = <&clks 10>, <&clks 30>;
+       clock-names = "ipg", "per";
+       status = "disabled";
+};
old mode 100755 (executable)
new mode 100644 (file)
index 406d82d5d2bb1e08a8cb9e4c548ce937f448b376..3edb4c2887a1f816eaf0f53f7dbf800bf73bf42a 100644 (file)
@@ -57,6 +57,10 @@ Protocol 2.10:       (Kernel 2.6.31) Added a protocol for relaxed alignment
 Protocol 2.11: (Kernel 3.6) Added a field for offset of EFI handover
                protocol entry point.
 
+Protocol 2.12: (Kernel 3.9) Added the xloadflags field and extension fields
+               to struct boot_params for for loading bzImage and ramdisk
+               above 4G in 64bit.
+
 **** MEMORY LAYOUT
 
 The traditional memory map for the kernel loader, used for Image or
@@ -182,7 +186,7 @@ Offset      Proto   Name            Meaning
 0230/4 2.05+   kernel_alignment Physical addr alignment required for kernel
 0234/1 2.05+   relocatable_kernel Whether kernel is relocatable or not
 0235/1 2.10+   min_alignment   Minimum alignment, as a power of two
-0236/2 N/A     pad3            Unused
+0236/2 2.12+   xloadflags      Boot protocol option flags
 0238/4 2.06+   cmdline_size    Maximum size of the kernel command line
 023C/4 2.07+   hardware_subarch Hardware subarchitecture
 0240/8 2.07+   hardware_subarch_data Subarchitecture-specific data
@@ -582,6 +586,27 @@ Protocol:  2.10+
   misaligned kernel.  Therefore, a loader should typically try each
   power-of-two alignment from kernel_alignment down to this alignment.
 
+Field name:     xloadflags
+Type:           read
+Offset/size:    0x236/2
+Protocol:       2.12+
+
+  This field is a bitmask.
+
+  Bit 0 (read):        XLF_KERNEL_64
+       - If 1, this kernel has the legacy 64-bit entry point at 0x200.
+
+  Bit 1 (read): XLF_CAN_BE_LOADED_ABOVE_4G
+        - If 1, kernel/boot_params/cmdline/ramdisk can be above 4G.
+
+  Bit 2 (read):        XLF_EFI_HANDOVER_32
+       - If 1, the kernel supports the 32-bit EFI handoff entry point
+          given at handover_offset.
+
+  Bit 3 (read): XLF_EFI_HANDOVER_64
+       - If 1, the kernel supports the 64-bit EFI handoff entry point
+          given at handover_offset + 0x200.
+
 Field name:    cmdline_size
 Type:          read
 Offset/size:   0x238/4
index cf5437deda81a003864f9e8a5f4e533d276a189d..199f453cb4de10016030c2dd230fb9a3a3125cee 100644 (file)
@@ -19,6 +19,9 @@ Offset        Proto   Name            Meaning
 090/010        ALL     hd1_info        hd1 disk parameter, OBSOLETE!!
 0A0/010        ALL     sys_desc_table  System description table (struct sys_desc_table)
 0B0/010        ALL     olpc_ofw_header OLPC's OpenFirmware CIF and friends
+0C0/004        ALL     ext_ramdisk_image ramdisk_image high 32bits
+0C4/004        ALL     ext_ramdisk_size  ramdisk_size high 32bits
+0C8/004        ALL     ext_cmd_line_ptr  cmd_line_ptr high 32bits
 140/080        ALL     edid_info       Video mode setup (struct edid_info)
 1C0/020        ALL     efi_info        EFI 32 information (struct efi_info)
 1E0/004        ALL     alk_mem_k       Alternative mem check, in KB
@@ -27,6 +30,7 @@ Offset        Proto   Name            Meaning
 1E9/001        ALL     eddbuf_entries  Number of entries in eddbuf (below)
 1EA/001        ALL     edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer
                                (below)
+1EF/001        ALL     sentinel        Used to detect broken bootloaders
 290/040        ALL     edd_mbr_sig_buffer EDD MBR signatures
 2D0/A00        ALL     e820_map        E820 memory map table
                                (array of struct e820entry)
index 8ae709e34523c4eb25c7cde1e4e4a9afb7e9704d..43dbae19838b9281125a518a0a72c2df6a3ab9b6 100644 (file)
@@ -2966,7 +2966,7 @@ S:        Maintained
 F:     drivers/net/ethernet/i825xx/eexpress.*
 
 ETHERNET BRIDGE
-M:     Stephen Hemminger <shemminger@vyatta.com>
+M:     Stephen Hemminger <stephen@networkplumber.org>
 L:     bridge@lists.linux-foundation.org
 L:     netdev@vger.kernel.org
 W:     http://www.linuxfoundation.org/en/Net:Bridge
@@ -4216,6 +4216,7 @@ M:        Thomas Gleixner <tglx@linutronix.de>
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
 F:     kernel/irq/
+F:     drivers/irqchip/
 
 IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
 M:     Benjamin Herrenschmidt <benh@kernel.crashing.org>
@@ -4905,7 +4906,7 @@ S:        Maintained
 
 MARVELL GIGABIT ETHERNET DRIVERS (skge/sky2)
 M:     Mirko Lindner <mlindner@marvell.com>
-M:     Stephen Hemminger <shemminger@vyatta.com>
+M:     Stephen Hemminger <stephen@networkplumber.org>
 L:     netdev@vger.kernel.org
 S:     Maintained
 F:     drivers/net/ethernet/marvell/sk*
@@ -5180,7 +5181,7 @@ S:        Supported
 F:     drivers/infiniband/hw/nes/
 
 NETEM NETWORK EMULATOR
-M:     Stephen Hemminger <shemminger@vyatta.com>
+M:     Stephen Hemminger <stephen@networkplumber.org>
 L:     netem@lists.linux-foundation.org
 S:     Maintained
 F:     net/sched/sch_netem.c
@@ -7088,7 +7089,7 @@ F:        include/uapi/sound/
 F:     sound/
 
 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
-M:     Liam Girdwood <lrg@ti.com>
+M:     Liam Girdwood <lgirdwood@gmail.com>
 M:     Mark Brown <broonie@opensource.wolfsonmicro.com>
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
 L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
index 2d3c92c774fba36bfb7af7ff2fe8b3b9f6000654..54dfde5e9f9e10dbada7845c0d1d4f974b46d4ab 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 VERSION = 3
 PATCHLEVEL = 8
 SUBLEVEL = 0
-EXTRAVERSION = -rc5
-NAME = Terrified Chipmunk
+EXTRAVERSION = -rc6
+NAME = Unicycling Gorilla
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
index 67874b82a4edf318ae3718ae6137393140405586..a3ffd1a391a70b36cd12acbb9b96b0d86ffd17d6 100644 (file)
@@ -393,6 +393,7 @@ config ARCH_GEMINI
 config ARCH_SIRF
        bool "CSR SiRF"
        select ARCH_REQUIRE_GPIOLIB
+       select AUTO_ZRELADDR
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
@@ -949,22 +950,6 @@ config ARCH_OMAP
        help
          Support for TI's OMAP platform (OMAP1/2/3/4).
 
-config ARCH_VT8500_SINGLE
-       bool "VIA/WonderMedia 85xx"
-       select ARCH_HAS_CPUFREQ
-       select ARCH_REQUIRE_GPIOLIB
-       select CLKDEV_LOOKUP
-       select COMMON_CLK
-       select CPU_ARM926T
-       select GENERIC_CLOCKEVENTS
-       select GENERIC_GPIO
-       select HAVE_CLK
-       select MULTI_IRQ_HANDLER
-       select SPARSE_IRQ
-       select USE_OF
-       help
-         Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
-
 endchoice
 
 menu "Multiple platform selection"
index 661030d6bc6c3d10f3ca35f6b8125d21adac7389..0cc8e3652b0eb566adfe7f8a470b16b6b2c11c43 100644 (file)
@@ -219,12 +219,12 @@ choice
                  Say Y here if you want kernel low-level debugging support
                  on i.MX51.
 
-       config DEBUG_IMX50_IMX53_UART
-               bool "i.MX50 and i.MX53 Debug UART"
-               depends on SOC_IMX50 || SOC_IMX53
+       config DEBUG_IMX53_UART
+               bool "i.MX53 Debug UART"
+               depends on SOC_IMX53
                help
                  Say Y here if you want kernel low-level debugging support
-                 on i.MX50 or i.MX53.
+                 on i.MX53.
 
        config DEBUG_IMX6Q_UART
                bool "i.MX6Q Debug UART"
@@ -386,6 +386,20 @@ choice
                  Say Y here if you want kernel low-level debugging support
                  on Tegra based platforms.
 
+       config DEBUG_SIRFPRIMA2_UART1
+               bool "Kernel low-level debugging messages via SiRFprimaII UART1"
+               depends on ARCH_PRIMA2
+               help
+                 Say Y here if you want the debug print routines to direct
+                 their output to the uart1 port on SiRFprimaII devices.
+
+       config DEBUG_SIRFMARCO_UART1
+               bool "Kernel low-level debugging messages via SiRFmarco UART1"
+               depends on ARCH_MARCO
+               help
+                 Say Y here if you want the debug print routines to direct
+                 their output to the uart1 port on SiRFmarco devices.
+
        config DEBUG_VEXPRESS_UART0_DETECT
                bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
                depends on ARCH_VEXPRESS && CPU_CP15_MMU
@@ -412,6 +426,13 @@ choice
                  of the tiles using the RS1 memory map, including all new A-class
                  core tiles, FPGA-based SMMs and software models.
 
+       config DEBUG_VT8500_UART0
+               bool "Use UART0 on VIA/Wondermedia SoCs"
+               depends on ARCH_VT8500
+               help
+                 This option selects UART0 on VIA/Wondermedia System-on-a-chip
+                 devices, including VT8500, WM8505, WM8650 and WM8850.
+
        config DEBUG_LL_UART_NONE
                bool "No low-level debugging UART"
                depends on !ARCH_MULTIPLATFORM
@@ -497,7 +518,7 @@ config DEBUG_LL_INCLUDE
                                 DEBUG_IMX21_IMX27_UART || \
                                 DEBUG_IMX31_IMX35_UART || \
                                 DEBUG_IMX51_UART || \
-                                DEBUG_IMX50_IMX53_UART ||\
+                                DEBUG_IMX53_UART ||\
                                 DEBUG_IMX6Q_UART
        default "debug/highbank.S" if DEBUG_HIGHBANK_UART
        default "debug/mvebu.S" if DEBUG_MVEBU_UART
@@ -506,6 +527,7 @@ config DEBUG_LL_INCLUDE
        default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
        default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
                DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
+       default "debug/vt8500.S" if DEBUG_VT8500_UART0
        default "debug/tegra.S" if DEBUG_TEGRA_UART
        default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
        default "mach/debug-macro.S"
index 5ebb44fe826a9b0b36d051272910a26775e5a16f..3547d1495e4d094e4963a3e1efec08c93b0e05a9 100644 (file)
@@ -73,6 +73,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
        kirkwood-ts219-6281.dtb \
        kirkwood-ts219-6282.dtb \
        kirkwood-openblocks_a6.dtb
+dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
 dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
        msm8960-cdp.dtb
 dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
@@ -151,7 +152,8 @@ dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
        xenvm-4.2.dtb
 dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
        wm8505-ref.dtb \
-       wm8650-mid.dtb
+       wm8650-mid.dtb \
+       wm8850-w70v2.dtb
 dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
 
 targets += dtbs
index eb504a6c0f4a3641fd3ad3ea684286a5d2eaa61a..c8a8c08b48ddc8608f4686150b6e1280a5f33dd3 100644 (file)
        interrupt-parent = <&gic>;
 
        cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
                cpu@0 {
+                       device_type = "cpu";
                        compatible = "arm,cortex-a9";
+                       reg = <0>;
                };
                cpu@1 {
+                       device_type = "cpu";
                        compatible = "arm,cortex-a9";
+                       reg = <1>;
                };
        };
 
index eef7099f3e3c160853e18161b64b53fa5b19f23b..454c2d175402cc87240be1a2acfe9588c2383ded 100644 (file)
@@ -45,6 +45,8 @@
                                compatible = "fsl,imx31-uart", "fsl,imx21-uart";
                                reg = <0x43f90000 0x4000>;
                                interrupts = <45>;
+                               clocks = <&clks 10>, <&clks 30>;
+                               clock-names = "ipg", "per";
                                status = "disabled";
                        };
 
                                compatible = "fsl,imx31-uart", "fsl,imx21-uart";
                                reg = <0x43f94000 0x4000>;
                                interrupts = <32>;
+                               clocks = <&clks 10>, <&clks 31>;
+                               clock-names = "ipg", "per";
                                status = "disabled";
                        };
 
                        uart4: serial@43fb0000 {
                                compatible = "fsl,imx31-uart", "fsl,imx21-uart";
                                reg = <0x43fb0000 0x4000>;
+                               clocks = <&clks 10>, <&clks 49>;
+                               clock-names = "ipg", "per";
                                interrupts = <46>;
                                status = "disabled";
                        };
@@ -66,6 +72,8 @@
                                compatible = "fsl,imx31-uart", "fsl,imx21-uart";
                                reg = <0x43fb4000 0x4000>;
                                interrupts = <47>;
+                               clocks = <&clks 10>, <&clks 50>;
+                               clock-names = "ipg", "per";
                                status = "disabled";
                        };
                };
                                compatible = "fsl,imx31-uart", "fsl,imx21-uart";
                                reg = <0x5000c000 0x4000>;
                                interrupts = <18>;
+                               clocks = <&clks 10>, <&clks 48>;
+                               clock-names = "ipg", "per";
                                status = "disabled";
                        };
+
+                       clks: ccm@53f80000{
+                               compatible = "fsl,imx31-ccm";
+                               reg = <0x53f80000 0x4000>;
+                               interrupts = <0 31 0x04 0 53 0x04>;
+                               #clock-cells = <1>;
+                       };
                };
        };
 };
diff --git a/arch/arm/boot/dts/marco-evb.dts b/arch/arm/boot/dts/marco-evb.dts
new file mode 100644 (file)
index 0000000..5130aea
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * DTS file for CSR SiRFmarco Evaluation Board
+ *
+ * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/dts-v1/;
+
+/include/ "marco.dtsi"
+
+/ {
+       model = "CSR SiRFmarco Evaluation Board";
+       compatible = "sirf,marco-cb", "sirf,marco";
+
+       memory {
+               reg = <0x40000000 0x60000000>;
+       };
+
+       axi {
+               peri-iobg {
+                       uart1: uart@cc060000 {
+                               status = "okay";
+                       };
+                       uart2: uart@cc070000 {
+                               status = "okay";
+                       };
+                       i2c0: i2c@cc0e0000 {
+                             status = "okay";
+                             fpga-cpld@4d {
+                                     compatible = "sirf,fpga-cpld";
+                                     reg = <0x4d>;
+                             };
+                       };
+                       spi1: spi@cc170000 {
+                               status = "okay";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi1_pins_a>;
+                               spi@0 {
+                                       compatible = "spidev";
+                                       reg = <0>;
+                                       spi-max-frequency = <1000000>;
+                               };
+                       };
+                       pci-iobg {
+                               sd0: sdhci@cd000000 {
+                                       bus-width = <8>;
+                                       status = "okay";
+                               };
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/marco.dtsi b/arch/arm/boot/dts/marco.dtsi
new file mode 100644 (file)
index 0000000..1579c34
--- /dev/null
@@ -0,0 +1,756 @@
+/*
+ * DTS file for CSR SiRFmarco SoC
+ *
+ * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/include/ "skeleton.dtsi"
+/ {
+       compatible = "sirf,marco";
+       #address-cells = <1>;
+       #size-cells = <1>;
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <1>;
+               };
+       };
+
+       axi {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x40000000 0x40000000 0xa0000000>;
+
+               l2-cache-controller@c0030000 {
+                       compatible = "sirf,marco-pl310-cache", "arm,pl310-cache";
+                       reg = <0xc0030000 0x1000>;
+                       interrupts = <0 59 0>;
+                       arm,tag-latency = <1 1 1>;
+                       arm,data-latency = <1 1 1>;
+                       arm,filter-ranges = <0x40000000 0x80000000>;
+               };
+
+               gic: interrupt-controller@c0011000 {
+                       compatible = "arm,cortex-a9-gic";
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       reg = <0xc0011000 0x1000>,
+                             <0xc0010100 0x0100>;
+               };
+
+               rstc-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xc2000000 0xc2000000 0x1000000>;
+
+                       reset-controller@c2000000 {
+                               compatible = "sirf,marco-rstc";
+                               reg = <0xc2000000 0x10000>;
+                       };
+               };
+
+               sys-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xc3000000 0xc3000000 0x1000000>;
+
+                       clock-controller@c3000000 {
+                               compatible = "sirf,marco-clkc";
+                               reg = <0xc3000000 0x1000>;
+                               interrupts = <0 3 0>;
+                       };
+
+                       rsc-controller@c3010000 {
+                               compatible = "sirf,marco-rsc";
+                               reg = <0xc3010000 0x1000>;
+                       };
+               };
+
+               mem-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xc4000000 0xc4000000 0x1000000>;
+
+                       memory-controller@c4000000 {
+                               compatible = "sirf,marco-memc";
+                               reg = <0xc4000000 0x10000>;
+                               interrupts = <0 27 0>;
+                       };
+               };
+
+               disp-iobg0 {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xc5000000 0xc5000000 0x1000000>;
+
+                       display0@c5000000 {
+                               compatible = "sirf,marco-lcd";
+                               reg = <0xc5000000 0x10000>;
+                               interrupts = <0 30 0>;
+                       };
+
+                       vpp0@c5010000 {
+                               compatible = "sirf,marco-vpp";
+                               reg = <0xc5010000 0x10000>;
+                               interrupts = <0 31 0>;
+                       };
+               };
+
+               disp-iobg1 {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xc6000000 0xc6000000 0x1000000>;
+
+                       display1@c6000000 {
+                               compatible = "sirf,marco-lcd";
+                               reg = <0xc6000000 0x10000>;
+                               interrupts = <0 62 0>;
+                       };
+
+                       vpp1@c6010000 {
+                               compatible = "sirf,marco-vpp";
+                               reg = <0xc6010000 0x10000>;
+                               interrupts = <0 63 0>;
+                       };
+               };
+
+               graphics-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xc8000000 0xc8000000 0x1000000>;
+
+                       graphics@c8000000 {
+                               compatible = "powervr,sgx540";
+                               reg = <0xc8000000 0x1000000>;
+                               interrupts = <0 6 0>;
+                       };
+               };
+
+               multimedia-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xc9000000 0xc9000000 0x1000000>;
+
+                       multimedia@a0000000 {
+                               compatible = "sirf,marco-video-codec";
+                               reg = <0xc9000000 0x1000000>;
+                               interrupts = <0 5 0>;
+                       };
+               };
+
+               dsp-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xca000000 0xca000000 0x2000000>;
+
+                       dspif@ca000000 {
+                               compatible = "sirf,marco-dspif";
+                               reg = <0xca000000 0x10000>;
+                               interrupts = <0 9 0>;
+                       };
+
+                       gps@ca010000 {
+                               compatible = "sirf,marco-gps";
+                               reg = <0xca010000 0x10000>;
+                               interrupts = <0 7 0>;
+                       };
+
+                       dsp@cb000000 {
+                               compatible = "sirf,marco-dsp";
+                               reg = <0xcb000000 0x1000000>;
+                               interrupts = <0 8 0>;
+                       };
+               };
+
+               peri-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xcc000000 0xcc000000 0x2000000>;
+
+                       timer@cc020000 {
+                               compatible = "sirf,marco-tick";
+                               reg = <0xcc020000 0x1000>;
+                               interrupts = <0 0 0>,
+                                          <0 1 0>,
+                                          <0 2 0>,
+                                          <0 49 0>,
+                                          <0 50 0>,
+                                          <0 51 0>;
+                       };
+
+                       nand@cc030000 {
+                               compatible = "sirf,marco-nand";
+                               reg = <0xcc030000 0x10000>;
+                               interrupts = <0 41 0>;
+                       };
+
+                       audio@cc040000 {
+                               compatible = "sirf,marco-audio";
+                               reg = <0xcc040000 0x10000>;
+                               interrupts = <0 35 0>;
+                       };
+
+                       uart0: uart@cc050000 {
+                               cell-index = <0>;
+                               compatible = "sirf,marco-uart";
+                               reg = <0xcc050000 0x1000>;
+                               interrupts = <0 17 0>;
+                               fifosize = <128>;
+                               status = "disabled";
+                       };
+
+                       uart1: uart@cc060000 {
+                               cell-index = <1>;
+                               compatible = "sirf,marco-uart";
+                               reg = <0xcc060000 0x1000>;
+                               interrupts = <0 18 0>;
+                               fifosize = <32>;
+                               status = "disabled";
+                       };
+
+                       uart2: uart@cc070000 {
+                               cell-index = <2>;
+                               compatible = "sirf,marco-uart";
+                               reg = <0xcc070000 0x1000>;
+                               interrupts = <0 19 0>;
+                               fifosize = <128>;
+                               status = "disabled";
+                       };
+
+                       uart3: uart@cc190000 {
+                               cell-index = <3>;
+                               compatible = "sirf,marco-uart";
+                               reg = <0xcc190000 0x1000>;
+                               interrupts = <0 66 0>;
+                               fifosize = <128>;
+                               status = "disabled";
+                       };
+
+                       uart4: uart@cc1a0000 {
+                               cell-index = <4>;
+                               compatible = "sirf,marco-uart";
+                               reg = <0xcc1a0000 0x1000>;
+                               interrupts = <0 69 0>;
+                               fifosize = <128>;
+                               status = "disabled";
+                       };
+
+                       usp0: usp@cc080000 {
+                               cell-index = <0>;
+                               compatible = "sirf,marco-usp";
+                               reg = <0xcc080000 0x10000>;
+                               interrupts = <0 20 0>;
+                               status = "disabled";
+                       };
+
+                       usp1: usp@cc090000 {
+                               cell-index = <1>;
+                               compatible = "sirf,marco-usp";
+                               reg = <0xcc090000 0x10000>;
+                               interrupts = <0 21 0>;
+                               status = "disabled";
+                       };
+
+                       usp2: usp@cc0a0000 {
+                               cell-index = <2>;
+                               compatible = "sirf,marco-usp";
+                               reg = <0xcc0a0000 0x10000>;
+                               interrupts = <0 22 0>;
+                               status = "disabled";
+                       };
+
+                       dmac0: dma-controller@cc0b0000 {
+                               cell-index = <0>;
+                               compatible = "sirf,marco-dmac";
+                               reg = <0xcc0b0000 0x10000>;
+                               interrupts = <0 12 0>;
+                       };
+
+                       dmac1: dma-controller@cc160000 {
+                               cell-index = <1>;
+                               compatible = "sirf,marco-dmac";
+                               reg = <0xcc160000 0x10000>;
+                               interrupts = <0 13 0>;
+                       };
+
+                       vip@cc0c0000 {
+                               compatible = "sirf,marco-vip";
+                               reg = <0xcc0c0000 0x10000>;
+                       };
+
+                       spi0: spi@cc0d0000 {
+                               cell-index = <0>;
+                               compatible = "sirf,marco-spi";
+                               reg = <0xcc0d0000 0x10000>;
+                               interrupts = <0 15 0>;
+                               sirf,spi-num-chipselects = <1>;
+                               cs-gpios = <&gpio 0 0>;
+                               sirf,spi-dma-rx-channel = <25>;
+                               sirf,spi-dma-tx-channel = <20>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       spi1: spi@cc170000 {
+                               cell-index = <1>;
+                               compatible = "sirf,marco-spi";
+                               reg = <0xcc170000 0x10000>;
+                               interrupts = <0 16 0>;
+                               sirf,spi-num-chipselects = <1>;
+                               cs-gpios = <&gpio 0 0>;
+                               sirf,spi-dma-rx-channel = <12>;
+                               sirf,spi-dma-tx-channel = <13>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       i2c0: i2c@cc0e0000 {
+                               cell-index = <0>;
+                               compatible = "sirf,marco-i2c";
+                               reg = <0xcc0e0000 0x10000>;
+                               interrupts = <0 24 0>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       i2c1: i2c@cc0f0000 {
+                               cell-index = <1>;
+                               compatible = "sirf,marco-i2c";
+                               reg = <0xcc0f0000 0x10000>;
+                               interrupts = <0 25 0>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       tsc@cc110000 {
+                               compatible = "sirf,marco-tsc";
+                               reg = <0xcc110000 0x10000>;
+                               interrupts = <0 33 0>;
+                       };
+
+                       gpio: pinctrl@cc120000 {
+                               #gpio-cells = <2>;
+                               #interrupt-cells = <2>;
+                               compatible = "sirf,marco-pinctrl";
+                               reg = <0xcc120000 0x10000>;
+                               interrupts = <0 43 0>,
+                                          <0 44 0>,
+                                          <0 45 0>,
+                                          <0 46 0>,
+                                          <0 47 0>;
+                               gpio-controller;
+                               interrupt-controller;
+
+                               lcd_16pins_a: lcd0_0 {
+                                       lcd {
+                                               sirf,pins = "lcd_16bitsgrp";
+                                               sirf,function = "lcd_16bits";
+                                       };
+                               };
+                               lcd_18pins_a: lcd0_1 {
+                                       lcd {
+                                               sirf,pins = "lcd_18bitsgrp";
+                                               sirf,function = "lcd_18bits";
+                                       };
+                               };
+                               lcd_24pins_a: lcd0_2 {
+                                       lcd {
+                                               sirf,pins = "lcd_24bitsgrp";
+                                               sirf,function = "lcd_24bits";
+                                       };
+                               };
+                               lcdrom_pins_a: lcdrom0_0 {
+                                       lcd {
+                                               sirf,pins = "lcdromgrp";
+                                               sirf,function = "lcdrom";
+                                       };
+                               };
+                               uart0_pins_a: uart0_0 {
+                                       uart {
+                                               sirf,pins = "uart0grp";
+                                               sirf,function = "uart0";
+                                       };
+                               };
+                               uart1_pins_a: uart1_0 {
+                                       uart {
+                                               sirf,pins = "uart1grp";
+                                               sirf,function = "uart1";
+                                       };
+                               };
+                               uart2_pins_a: uart2_0 {
+                                       uart {
+                                               sirf,pins = "uart2grp";
+                                               sirf,function = "uart2";
+                                       };
+                               };
+                               uart2_noflow_pins_a: uart2_1 {
+                                       uart {
+                                               sirf,pins = "uart2_nostreamctrlgrp";
+                                               sirf,function = "uart2_nostreamctrl";
+                                       };
+                               };
+                               spi0_pins_a: spi0_0 {
+                                       spi {
+                                               sirf,pins = "spi0grp";
+                                               sirf,function = "spi0";
+                                       };
+                               };
+                               spi1_pins_a: spi1_0 {
+                                       spi {
+                                               sirf,pins = "spi1grp";
+                                               sirf,function = "spi1";
+                                       };
+                               };
+                               i2c0_pins_a: i2c0_0 {
+                                       i2c {
+                                               sirf,pins = "i2c0grp";
+                                               sirf,function = "i2c0";
+                                       };
+                               };
+                               i2c1_pins_a: i2c1_0 {
+                                       i2c {
+                                               sirf,pins = "i2c1grp";
+                                               sirf,function = "i2c1";
+                                       };
+                               };
+                               pwm0_pins_a: pwm0_0 {
+                                       pwm {
+                                               sirf,pins = "pwm0grp";
+                                               sirf,function = "pwm0";
+                                       };
+                               };
+                               pwm1_pins_a: pwm1_0 {
+                                       pwm {
+                                               sirf,pins = "pwm1grp";
+                                               sirf,function = "pwm1";
+                                       };
+                               };
+                               pwm2_pins_a: pwm2_0 {
+                                       pwm {
+                                               sirf,pins = "pwm2grp";
+                                               sirf,function = "pwm2";
+                                       };
+                               };
+                               pwm3_pins_a: pwm3_0 {
+                                       pwm {
+                                               sirf,pins = "pwm3grp";
+                                               sirf,function = "pwm3";
+                                       };
+                               };
+                               gps_pins_a: gps_0 {
+                                       gps {
+                                               sirf,pins = "gpsgrp";
+                                               sirf,function = "gps";
+                                       };
+                               };
+                               vip_pins_a: vip_0 {
+                                       vip {
+                                               sirf,pins = "vipgrp";
+                                               sirf,function = "vip";
+                                       };
+                               };
+                               sdmmc0_pins_a: sdmmc0_0 {
+                                       sdmmc0 {
+                                               sirf,pins = "sdmmc0grp";
+                                               sirf,function = "sdmmc0";
+                                       };
+                               };
+                               sdmmc1_pins_a: sdmmc1_0 {
+                                       sdmmc1 {
+                                               sirf,pins = "sdmmc1grp";
+                                               sirf,function = "sdmmc1";
+                                       };
+                               };
+                               sdmmc2_pins_a: sdmmc2_0 {
+                                       sdmmc2 {
+                                               sirf,pins = "sdmmc2grp";
+                                               sirf,function = "sdmmc2";
+                                       };
+                               };
+                               sdmmc3_pins_a: sdmmc3_0 {
+                                       sdmmc3 {
+                                               sirf,pins = "sdmmc3grp";
+                                               sirf,function = "sdmmc3";
+                                       };
+                               };
+                               sdmmc4_pins_a: sdmmc4_0 {
+                                       sdmmc4 {
+                                               sirf,pins = "sdmmc4grp";
+                                               sirf,function = "sdmmc4";
+                                       };
+                               };
+                               sdmmc5_pins_a: sdmmc5_0 {
+                                       sdmmc5 {
+                                               sirf,pins = "sdmmc5grp";
+                                               sirf,function = "sdmmc5";
+                                       };
+                               };
+                               i2s_pins_a: i2s_0 {
+                                       i2s {
+                                               sirf,pins = "i2sgrp";
+                                               sirf,function = "i2s";
+                                       };
+                               };
+                               ac97_pins_a: ac97_0 {
+                                       ac97 {
+                                               sirf,pins = "ac97grp";
+                                               sirf,function = "ac97";
+                                       };
+                               };
+                               nand_pins_a: nand_0 {
+                                       nand {
+                                               sirf,pins = "nandgrp";
+                                               sirf,function = "nand";
+                                       };
+                               };
+                               usp0_pins_a: usp0_0 {
+                                       usp0 {
+                                               sirf,pins = "usp0grp";
+                                               sirf,function = "usp0";
+                                       };
+                               };
+                               usp1_pins_a: usp1_0 {
+                                       usp1 {
+                                               sirf,pins = "usp1grp";
+                                               sirf,function = "usp1";
+                                       };
+                               };
+                               usp2_pins_a: usp2_0 {
+                                       usp2 {
+                                               sirf,pins = "usp2grp";
+                                               sirf,function = "usp2";
+                                       };
+                               };
+                               usb0_utmi_drvbus_pins_a: usb0_utmi_drvbus_0 {
+                                       usb0_utmi_drvbus {
+                                               sirf,pins = "usb0_utmi_drvbusgrp";
+                                               sirf,function = "usb0_utmi_drvbus";
+                                       };
+                               };
+                               usb1_utmi_drvbus_pins_a: usb1_utmi_drvbus_0 {
+                                       usb1_utmi_drvbus {
+                                               sirf,pins = "usb1_utmi_drvbusgrp";
+                                               sirf,function = "usb1_utmi_drvbus";
+                                       };
+                               };
+                               warm_rst_pins_a: warm_rst_0 {
+                                       warm_rst {
+                                               sirf,pins = "warm_rstgrp";
+                                               sirf,function = "warm_rst";
+                                       };
+                               };
+                               pulse_count_pins_a: pulse_count_0 {
+                                       pulse_count {
+                                               sirf,pins = "pulse_countgrp";
+                                               sirf,function = "pulse_count";
+                                       };
+                               };
+                               cko0_rst_pins_a: cko0_rst_0 {
+                                       cko0_rst {
+                                               sirf,pins = "cko0_rstgrp";
+                                               sirf,function = "cko0_rst";
+                                       };
+                               };
+                               cko1_rst_pins_a: cko1_rst_0 {
+                                       cko1_rst {
+                                               sirf,pins = "cko1_rstgrp";
+                                               sirf,function = "cko1_rst";
+                                       };
+                               };
+                       };
+
+                       pwm@cc130000 {
+                               compatible = "sirf,marco-pwm";
+                               reg = <0xcc130000 0x10000>;
+                       };
+
+                       efusesys@cc140000 {
+                               compatible = "sirf,marco-efuse";
+                               reg = <0xcc140000 0x10000>;
+                       };
+
+                       pulsec@cc150000 {
+                               compatible = "sirf,marco-pulsec";
+                               reg = <0xcc150000 0x10000>;
+                               interrupts = <0 48 0>;
+                       };
+
+                       pci-iobg {
+                               compatible = "sirf,marco-pciiobg", "simple-bus";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0xcd000000 0xcd000000 0x1000000>;
+
+                               sd0: sdhci@cd000000 {
+                                       cell-index = <0>;
+                                       compatible = "sirf,marco-sdhc";
+                                       reg = <0xcd000000 0x100000>;
+                                       interrupts = <0 38 0>;
+                                       status = "disabled";
+                               };
+
+                               sd1: sdhci@cd100000 {
+                                       cell-index = <1>;
+                                       compatible = "sirf,marco-sdhc";
+                                       reg = <0xcd100000 0x100000>;
+                                       interrupts = <0 38 0>;
+                                       status = "disabled";
+                               };
+
+                               sd2: sdhci@cd200000 {
+                                       cell-index = <2>;
+                                       compatible = "sirf,marco-sdhc";
+                                       reg = <0xcd200000 0x100000>;
+                                       interrupts = <0 23 0>;
+                                       status = "disabled";
+                               };
+
+                               sd3: sdhci@cd300000 {
+                                       cell-index = <3>;
+                                       compatible = "sirf,marco-sdhc";
+                                       reg = <0xcd300000 0x100000>;
+                                       interrupts = <0 23 0>;
+                                       status = "disabled";
+                               };
+
+                               sd4: sdhci@cd400000 {
+                                       cell-index = <4>;
+                                       compatible = "sirf,marco-sdhc";
+                                       reg = <0xcd400000 0x100000>;
+                                       interrupts = <0 39 0>;
+                                       status = "disabled";
+                               };
+
+                               sd5: sdhci@cd500000 {
+                                       cell-index = <5>;
+                                       compatible = "sirf,marco-sdhc";
+                                       reg = <0xcd500000 0x100000>;
+                                       interrupts = <0 39 0>;
+                                       status = "disabled";
+                               };
+
+                               pci-copy@cd900000 {
+                                       compatible = "sirf,marco-pcicp";
+                                       reg = <0xcd900000 0x100000>;
+                                       interrupts = <0 40 0>;
+                               };
+
+                               rom-interface@cda00000 {
+                                       compatible = "sirf,marco-romif";
+                                       reg = <0xcda00000 0x100000>;
+                               };
+                       };
+               };
+
+               rtc-iobg {
+                       compatible = "sirf,marco-rtciobg", "sirf-marco-rtciobg-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0xc1000000 0x10000>;
+
+                       gpsrtc@1000 {
+                               compatible = "sirf,marco-gpsrtc";
+                               reg = <0x1000 0x1000>;
+                               interrupts = <0 55 0>,
+                                          <0 56 0>,
+                                          <0 57 0>;
+                       };
+
+                       sysrtc@2000 {
+                               compatible = "sirf,marco-sysrtc";
+                               reg = <0x2000 0x1000>;
+                               interrupts = <0 52 0>,
+                                          <0 53 0>,
+                                          <0 54 0>;
+                       };
+
+                       pwrc@3000 {
+                               compatible = "sirf,marco-pwrc";
+                               reg = <0x3000 0x1000>;
+                               interrupts = <0 32 0>;
+                       };
+               };
+
+               uus-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xce000000 0xce000000 0x1000000>;
+
+                       usb0: usb@ce000000 {
+                               compatible = "chipidea,ci13611a-marco";
+                               reg = <0xce000000 0x10000>;
+                               interrupts = <0 10 0>;
+                       };
+
+                       usb1: usb@ce010000 {
+                               compatible = "chipidea,ci13611a-marco";
+                               reg = <0xce010000 0x10000>;
+                               interrupts = <0 11 0>;
+                       };
+
+                       security@ce020000 {
+                               compatible = "sirf,marco-security";
+                               reg = <0xce020000 0x10000>;
+                               interrupts = <0 42 0>;
+                       };
+               };
+
+               can-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xd0000000 0xd0000000 0x1000000>;
+
+                       can0: can@d0000000 {
+                               compatible = "sirf,marco-can";
+                               reg = <0xd0000000 0x10000>;
+                       };
+
+                       can1: can@d0010000 {
+                               compatible = "sirf,marco-can";
+                               reg = <0xd0010000 0x10000>;
+                       };
+               };
+
+               lvds-iobg {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0xd1000000 0xd1000000 0x1000000>;
+
+                       lvds@d1000000 {
+                               compatible = "sirf,marco-lvds";
+                               reg = <0xd1000000 0x10000>;
+                               interrupts = <0 64 0>;
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/sh73a0-reference.dtsi b/arch/arm/boot/dts/sh73a0-reference.dtsi
new file mode 100644 (file)
index 0000000..d4bb012
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Device Tree Source for the SH73A0 SoC
+ *
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/include/ "sh73a0.dtsi"
+
+/ {
+       compatible = "renesas,sh73a0";
+
+       mmcif: mmcif@0x10010000 {
+               compatible = "renesas,sh-mmcif";
+               reg = <0xe6bd0000 0x100>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 140 0x4
+                             0 141 0x4>;
+               reg-io-width = <4>;
+       };
+};
diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi
new file mode 100644 (file)
index 0000000..8a59465
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Device Tree Source for the SH73A0 SoC
+ *
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "renesas,sh73a0";
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <1>;
+               };
+       };
+
+       gic: interrupt-controller@f0001000 {
+               compatible = "arm,cortex-a9-gic";
+               #interrupt-cells = <3>;
+               #address-cells = <1>;
+               interrupt-controller;
+               reg = <0xf0001000 0x1000>,
+                     <0xf0000100 0x100>;
+       };
+
+       i2c0: i2c@0xe6820000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0xe6820000 0x425>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 167 0x4
+                             0 168 0x4
+                             0 169 0x4
+                             0 170 0x4>;
+       };
+
+       i2c1: i2c@0xe6822000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0xe6822000 0x425>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 51 0x4
+                             0 52 0x4
+                             0 53 0x4
+                             0 54 0x4>;
+       };
+
+       i2c2: i2c@0xe6824000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0xe6824000 0x425>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 171 0x4
+                             0 172 0x4
+                             0 173 0x4
+                             0 174 0x4>;
+       };
+
+       i2c3: i2c@0xe6826000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0xe6826000 0x425>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 183 0x4
+                             0 184 0x4
+                             0 185 0x4
+                             0 186 0x4>;
+       };
+
+       i2c4: i2c@0xe6828000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "renesas,rmobile-iic";
+               reg = <0xe6828000 0x425>;
+               interrupt-parent = <&gic>;
+               interrupts = <0 187 0x4
+                             0 188 0x4
+                             0 189 0x4
+                             0 190 0x4>;
+       };
+};
diff --git a/arch/arm/boot/dts/wm8850-w70v2.dts b/arch/arm/boot/dts/wm8850-w70v2.dts
new file mode 100644 (file)
index 0000000..fcc660c
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * wm8850-w70v2.dts
+ *  - Device tree file for Wondermedia WM8850 Tablet
+ *  - 'W70-V2' mainboard
+ *  - HongLianYing 'HLY070ML268-21A' 7" LCD panel
+ *
+ * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
+ *
+ * Licensed under GPLv2 or later
+ */
+
+/dts-v1/;
+/include/ "wm8850.dtsi"
+
+/ {
+       model = "Wondermedia WM8850-W70v2 Tablet";
+
+       /*
+        * Display node is based on Sascha Hauer's patch on dri-devel.
+        * Added a bpp property to calculate the size of the framebuffer
+        * until the binding is formalized.
+        */
+       display: display@0 {
+               modes {
+                       mode0: mode@0 {
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hfront-porch = <40>;
+                               hsync-len = <0>;
+                               vback-porch = <32>;
+                               vfront-porch = <11>;
+                               vsync-len = <1>;
+                               clock = <0>;    /* unused but required */
+                               bpp = <16>;     /* non-standard but required */
+                       };
+               };
+       };
+
+       backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm 0 50000 1>;        /* duty inverted */
+
+               brightness-levels = <0 40 60 80 100 130 190 255>;
+               default-brightness-level = <5>;
+       };
+};
diff --git a/arch/arm/boot/dts/wm8850.dtsi b/arch/arm/boot/dts/wm8850.dtsi
new file mode 100644 (file)
index 0000000..e8cbfdc
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+ * wm8850.dtsi - Device tree file for Wondermedia WM8850 SoC
+ *
+ * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
+ *
+ * Licensed under GPLv2 or later
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+       compatible = "wm,wm8850";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+               serial2 = &uart2;
+               serial3 = &uart3;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               ranges;
+               interrupt-parent = <&intc0>;
+
+               intc0: interrupt-controller@d8140000 {
+                       compatible = "via,vt8500-intc";
+                       interrupt-controller;
+                       reg = <0xd8140000 0x10000>;
+                       #interrupt-cells = <1>;
+               };
+
+               /* Secondary IC cascaded to intc0 */
+               intc1: interrupt-controller@d8150000 {
+                       compatible = "via,vt8500-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <1>;
+                       reg = <0xD8150000 0x10000>;
+                       interrupts = <56 57 58 59 60 61 62 63>;
+               };
+
+               gpio: gpio-controller@d8110000 {
+                       compatible = "wm,wm8650-gpio";
+                       gpio-controller;
+                       reg = <0xd8110000 0x10000>;
+                       #gpio-cells = <3>;
+               };
+
+               pmc@d8130000 {
+                       compatible = "via,vt8500-pmc";
+                       reg = <0xd8130000 0x1000>;
+
+                       clocks {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               ref25: ref25M {
+                                       #clock-cells = <0>;
+                                       compatible = "fixed-clock";
+                                       clock-frequency = <25000000>;
+                               };
+
+                               ref24: ref24M {
+                                       #clock-cells = <0>;
+                                       compatible = "fixed-clock";
+                                       clock-frequency = <24000000>;
+                               };
+
+                               plla: plla {
+                                       #clock-cells = <0>;
+                                       compatible = "wm,wm8750-pll-clock";
+                                       clocks = <&ref25>;
+                                       reg = <0x200>;
+                               };
+
+                               pllb: pllb {
+                                       #clock-cells = <0>;
+                                       compatible = "wm,wm8750-pll-clock";
+                                       clocks = <&ref25>;
+                                       reg = <0x204>;
+                               };
+
+                               clkuart0: uart0 {
+                                       #clock-cells = <0>;
+                                       compatible = "via,vt8500-device-clock";
+                                       clocks = <&ref24>;
+                                       enable-reg = <0x254>;
+                                       enable-bit = <24>;
+                               };
+
+                               clkuart1: uart1 {
+                                       #clock-cells = <0>;
+                                       compatible = "via,vt8500-device-clock";
+                                       clocks = <&ref24>;
+                                       enable-reg = <0x254>;
+                                       enable-bit = <25>;
+                               };
+
+                                clkuart2: uart2 {
+                                        #clock-cells = <0>;
+                                        compatible = "via,vt8500-device-clock";
+                                        clocks = <&ref24>;
+                                        enable-reg = <0x254>;
+                                        enable-bit = <26>;
+                                };
+
+                                clkuart3: uart3 {
+                                        #clock-cells = <0>;
+                                        compatible = "via,vt8500-device-clock";
+                                        clocks = <&ref24>;
+                                        enable-reg = <0x254>;
+                                        enable-bit = <27>;
+                                };
+
+                               clkpwm: pwm {
+                                       #clock-cells = <0>;
+                                       compatible = "via,vt8500-device-clock";
+                                       clocks = <&pllb>;
+                                       divisor-reg = <0x350>;
+                                       enable-reg = <0x250>;
+                                       enable-bit = <17>;
+                               };
+
+                               clksdhc: sdhc {
+                                       #clock-cells = <0>;
+                                       compatible = "via,vt8500-device-clock";
+                                       clocks = <&pllb>;
+                                       divisor-reg = <0x330>;
+                                       divisor-mask = <0x3f>;
+                                       enable-reg = <0x250>;
+                                       enable-bit = <0>;
+                               };
+                       };
+               };
+
+               fb@d8051700 {
+                       compatible = "wm,wm8505-fb";
+                       reg = <0xd8051700 0x200>;
+                       display = <&display>;
+                       default-mode = <&mode0>;
+               };
+
+               ge_rops@d8050400 {
+                       compatible = "wm,prizm-ge-rops";
+                       reg = <0xd8050400 0x100>;
+               };
+
+               pwm: pwm@d8220000 {
+                       #pwm-cells = <3>;
+                       compatible = "via,vt8500-pwm";
+                       reg = <0xd8220000 0x100>;
+                       clocks = <&clkpwm>;
+               };
+
+               timer@d8130100 {
+                       compatible = "via,vt8500-timer";
+                       reg = <0xd8130100 0x28>;
+                       interrupts = <36>;
+               };
+
+               ehci@d8007900 {
+                       compatible = "via,vt8500-ehci";
+                       reg = <0xd8007900 0x200>;
+                       interrupts = <26>;
+               };
+
+               uhci@d8007b00 {
+                       compatible = "platform-uhci";
+                       reg = <0xd8007b00 0x200>;
+                       interrupts = <26>;
+               };
+
+               uhci@d8008d00 {
+                       compatible = "platform-uhci";
+                       reg = <0xd8008d00 0x200>;
+                       interrupts = <26>;
+               };
+
+               uart0: uart@d8200000 {
+                       compatible = "via,vt8500-uart";
+                       reg = <0xd8200000 0x1040>;
+                       interrupts = <32>;
+                       clocks = <&clkuart0>;
+               };
+
+               uart1: uart@d82b0000 {
+                       compatible = "via,vt8500-uart";
+                       reg = <0xd82b0000 0x1040>;
+                       interrupts = <33>;
+                       clocks = <&clkuart1>;
+               };
+
+                uart2: uart@d8210000 {
+                        compatible = "via,vt8500-uart";
+                        reg = <0xd8210000 0x1040>;
+                        interrupts = <47>;
+                        clocks = <&clkuart2>;
+                };
+
+                uart3: uart@d82c0000 {
+                        compatible = "via,vt8500-uart";
+                        reg = <0xd82c0000 0x1040>;
+                        interrupts = <50>;
+                        clocks = <&clkuart3>;
+                };
+
+               rtc@d8100000 {
+                       compatible = "via,vt8500-rtc";
+                       reg = <0xd8100000 0x10000>;
+                       interrupts = <48>;
+               };
+
+               sdhc@d800a000 {
+                       compatible = "wm,wm8505-sdhc";
+                       reg = <0xd800a000 0x1000>;
+                       interrupts = <20 21>;
+                       clocks = <&clksdhc>;
+                       bus-width = <4>;
+                       sdon-inverted;
+               };
+       };
+};
index 45ceeb0e93e05faaa40195a30d82045f7b6aabe0..9353184d730dfda864c85ec180b906b9ed575681 100644 (file)
@@ -1,26 +1,3 @@
-config ARM_GIC
-       bool
-       select IRQ_DOMAIN
-       select MULTI_IRQ_HANDLER
-
-config GIC_NON_BANKED
-       bool
-
-config ARM_VIC
-       bool
-       select IRQ_DOMAIN
-       select MULTI_IRQ_HANDLER
-
-config ARM_VIC_NR
-       int
-       default 4 if ARCH_S5PV210
-       default 3 if ARCH_S5PC100
-       default 2
-       depends on ARM_VIC
-       help
-         The maximum number of VICs available in the system, for
-         power management.
-
 config ICST
        bool
 
index e8a4e58f1b827e26ec0874c2baa53ede8105f70e..dc8dd0de5c0f613fd45f1c4d72a4d01c9405af0d 100644 (file)
@@ -2,8 +2,6 @@
 # Makefile for the linux kernel.
 #
 
-obj-$(CONFIG_ARM_GIC)          += gic.o
-obj-$(CONFIG_ARM_VIC)          += vic.o
 obj-$(CONFIG_ICST)             += icst.o
 obj-$(CONFIG_SA1111)           += sa1111.o
 obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
deleted file mode 100644 (file)
index 36ae03a..0000000
+++ /dev/null
@@ -1,811 +0,0 @@
-/*
- *  linux/arch/arm/common/gic.c
- *
- *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Interrupt architecture for the GIC:
- *
- * o There is one Interrupt Distributor, which receives interrupts
- *   from system devices and sends them to the Interrupt Controllers.
- *
- * o There is one CPU Interface per CPU, which sends interrupts sent
- *   by the Distributor, and interrupts generated locally, to the
- *   associated CPU. The base address of the CPU interface is usually
- *   aliased so that the same address points to different chips depending
- *   on the CPU it is accessed from.
- *
- * Note that IRQs 0-31 are special - they are local to each CPU.
- * As such, the enable set/clear, pending set/clear and active bit
- * registers are banked per-cpu for these sources.
- */
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/err.h>
-#include <linux/module.h>
-#include <linux/list.h>
-#include <linux/smp.h>
-#include <linux/cpu_pm.h>
-#include <linux/cpumask.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/irqdomain.h>
-#include <linux/interrupt.h>
-#include <linux/percpu.h>
-#include <linux/slab.h>
-
-#include <asm/irq.h>
-#include <asm/exception.h>
-#include <asm/smp_plat.h>
-#include <asm/mach/irq.h>
-#include <asm/hardware/gic.h>
-
-union gic_base {
-       void __iomem *common_base;
-       void __percpu __iomem **percpu_base;
-};
-
-struct gic_chip_data {
-       union gic_base dist_base;
-       union gic_base cpu_base;
-#ifdef CONFIG_CPU_PM
-       u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)];
-       u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)];
-       u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
-       u32 __percpu *saved_ppi_enable;
-       u32 __percpu *saved_ppi_conf;
-#endif
-       struct irq_domain *domain;
-       unsigned int gic_irqs;
-#ifdef CONFIG_GIC_NON_BANKED
-       void __iomem *(*get_base)(union gic_base *);
-#endif
-};
-
-static DEFINE_RAW_SPINLOCK(irq_controller_lock);
-
-/*
- * The GIC mapping of CPU interfaces does not necessarily match
- * the logical CPU numbering.  Let's use a mapping as returned
- * by the GIC itself.
- */
-#define NR_GIC_CPU_IF 8
-static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
-
-/*
- * Supported arch specific GIC irq extension.
- * Default make them NULL.
- */
-struct irq_chip gic_arch_extn = {
-       .irq_eoi        = NULL,
-       .irq_mask       = NULL,
-       .irq_unmask     = NULL,
-       .irq_retrigger  = NULL,
-       .irq_set_type   = NULL,
-       .irq_set_wake   = NULL,
-};
-
-#ifndef MAX_GIC_NR
-#define MAX_GIC_NR     1
-#endif
-
-static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly;
-
-#ifdef CONFIG_GIC_NON_BANKED
-static void __iomem *gic_get_percpu_base(union gic_base *base)
-{
-       return *__this_cpu_ptr(base->percpu_base);
-}
-
-static void __iomem *gic_get_common_base(union gic_base *base)
-{
-       return base->common_base;
-}
-
-static inline void __iomem *gic_data_dist_base(struct gic_chip_data *data)
-{
-       return data->get_base(&data->dist_base);
-}
-
-static inline void __iomem *gic_data_cpu_base(struct gic_chip_data *data)
-{
-       return data->get_base(&data->cpu_base);
-}
-
-static inline void gic_set_base_accessor(struct gic_chip_data *data,
-                                        void __iomem *(*f)(union gic_base *))
-{
-       data->get_base = f;
-}
-#else
-#define gic_data_dist_base(d)  ((d)->dist_base.common_base)
-#define gic_data_cpu_base(d)   ((d)->cpu_base.common_base)
-#define gic_set_base_accessor(d,f)
-#endif
-
-static inline void __iomem *gic_dist_base(struct irq_data *d)
-{
-       struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
-       return gic_data_dist_base(gic_data);
-}
-
-static inline void __iomem *gic_cpu_base(struct irq_data *d)
-{
-       struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
-       return gic_data_cpu_base(gic_data);
-}
-
-static inline unsigned int gic_irq(struct irq_data *d)
-{
-       return d->hwirq;
-}
-
-/*
- * Routines to acknowledge, disable and enable interrupts
- */
-static void gic_mask_irq(struct irq_data *d)
-{
-       u32 mask = 1 << (gic_irq(d) % 32);
-
-       raw_spin_lock(&irq_controller_lock);
-       writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
-       if (gic_arch_extn.irq_mask)
-               gic_arch_extn.irq_mask(d);
-       raw_spin_unlock(&irq_controller_lock);
-}
-
-static void gic_unmask_irq(struct irq_data *d)
-{
-       u32 mask = 1 << (gic_irq(d) % 32);
-
-       raw_spin_lock(&irq_controller_lock);
-       if (gic_arch_extn.irq_unmask)
-               gic_arch_extn.irq_unmask(d);
-       writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4);
-       raw_spin_unlock(&irq_controller_lock);
-}
-
-static void gic_eoi_irq(struct irq_data *d)
-{
-       if (gic_arch_extn.irq_eoi) {
-               raw_spin_lock(&irq_controller_lock);
-               gic_arch_extn.irq_eoi(d);
-               raw_spin_unlock(&irq_controller_lock);
-       }
-
-       writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
-}
-
-static int gic_set_type(struct irq_data *d, unsigned int type)
-{
-       void __iomem *base = gic_dist_base(d);
-       unsigned int gicirq = gic_irq(d);
-       u32 enablemask = 1 << (gicirq % 32);
-       u32 enableoff = (gicirq / 32) * 4;
-       u32 confmask = 0x2 << ((gicirq % 16) * 2);
-       u32 confoff = (gicirq / 16) * 4;
-       bool enabled = false;
-       u32 val;
-
-       /* Interrupt configuration for SGIs can't be changed */
-       if (gicirq < 16)
-               return -EINVAL;
-
-       if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
-               return -EINVAL;
-
-       raw_spin_lock(&irq_controller_lock);
-
-       if (gic_arch_extn.irq_set_type)
-               gic_arch_extn.irq_set_type(d, type);
-
-       val = readl_relaxed(base + GIC_DIST_CONFIG + confoff);
-       if (type == IRQ_TYPE_LEVEL_HIGH)
-               val &= ~confmask;
-       else if (type == IRQ_TYPE_EDGE_RISING)
-               val |= confmask;
-
-       /*
-        * As recommended by the spec, disable the interrupt before changing
-        * the configuration
-        */
-       if (readl_relaxed(base + GIC_DIST_ENABLE_SET + enableoff) & enablemask) {
-               writel_relaxed(enablemask, base + GIC_DIST_ENABLE_CLEAR + enableoff);
-               enabled = true;
-       }
-
-       writel_relaxed(val, base + GIC_DIST_CONFIG + confoff);
-
-       if (enabled)
-               writel_relaxed(enablemask, base + GIC_DIST_ENABLE_SET + enableoff);
-
-       raw_spin_unlock(&irq_controller_lock);
-
-       return 0;
-}
-
-static int gic_retrigger(struct irq_data *d)
-{
-       if (gic_arch_extn.irq_retrigger)
-               return gic_arch_extn.irq_retrigger(d);
-
-       return -ENXIO;
-}
-
-#ifdef CONFIG_SMP
-static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
-                           bool force)
-{
-       void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
-       unsigned int shift = (gic_irq(d) % 4) * 8;
-       unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
-       u32 val, mask, bit;
-
-       if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
-               return -EINVAL;
-
-       mask = 0xff << shift;
-       bit = gic_cpu_map[cpu] << shift;
-
-       raw_spin_lock(&irq_controller_lock);
-       val = readl_relaxed(reg) & ~mask;
-       writel_relaxed(val | bit, reg);
-       raw_spin_unlock(&irq_controller_lock);
-
-       return IRQ_SET_MASK_OK;
-}
-#endif
-
-#ifdef CONFIG_PM
-static int gic_set_wake(struct irq_data *d, unsigned int on)
-{
-       int ret = -ENXIO;
-
-       if (gic_arch_extn.irq_set_wake)
-               ret = gic_arch_extn.irq_set_wake(d, on);
-
-       return ret;
-}
-
-#else
-#define gic_set_wake   NULL
-#endif
-
-asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
-{
-       u32 irqstat, irqnr;
-       struct gic_chip_data *gic = &gic_data[0];
-       void __iomem *cpu_base = gic_data_cpu_base(gic);
-
-       do {
-               irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
-               irqnr = irqstat & ~0x1c00;
-
-               if (likely(irqnr > 15 && irqnr < 1021)) {
-                       irqnr = irq_find_mapping(gic->domain, irqnr);
-                       handle_IRQ(irqnr, regs);
-                       continue;
-               }
-               if (irqnr < 16) {
-                       writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
-#ifdef CONFIG_SMP
-                       handle_IPI(irqnr, regs);
-#endif
-                       continue;
-               }
-               break;
-       } while (1);
-}
-
-static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
-{
-       struct gic_chip_data *chip_data = irq_get_handler_data(irq);
-       struct irq_chip *chip = irq_get_chip(irq);
-       unsigned int cascade_irq, gic_irq;
-       unsigned long status;
-
-       chained_irq_enter(chip, desc);
-
-       raw_spin_lock(&irq_controller_lock);
-       status = readl_relaxed(gic_data_cpu_base(chip_data) + GIC_CPU_INTACK);
-       raw_spin_unlock(&irq_controller_lock);
-
-       gic_irq = (status & 0x3ff);
-       if (gic_irq == 1023)
-               goto out;
-
-       cascade_irq = irq_find_mapping(chip_data->domain, gic_irq);
-       if (unlikely(gic_irq < 32 || gic_irq > 1020))
-               do_bad_IRQ(cascade_irq, desc);
-       else
-               generic_handle_irq(cascade_irq);
-
- out:
-       chained_irq_exit(chip, desc);
-}
-
-static struct irq_chip gic_chip = {
-       .name                   = "GIC",
-       .irq_mask               = gic_mask_irq,
-       .irq_unmask             = gic_unmask_irq,
-       .irq_eoi                = gic_eoi_irq,
-       .irq_set_type           = gic_set_type,
-       .irq_retrigger          = gic_retrigger,
-#ifdef CONFIG_SMP
-       .irq_set_affinity       = gic_set_affinity,
-#endif
-       .irq_set_wake           = gic_set_wake,
-};
-
-void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
-{
-       if (gic_nr >= MAX_GIC_NR)
-               BUG();
-       if (irq_set_handler_data(irq, &gic_data[gic_nr]) != 0)
-               BUG();
-       irq_set_chained_handler(irq, gic_handle_cascade_irq);
-}
-
-static void __init gic_dist_init(struct gic_chip_data *gic)
-{
-       unsigned int i;
-       u32 cpumask;
-       unsigned int gic_irqs = gic->gic_irqs;
-       void __iomem *base = gic_data_dist_base(gic);
-
-       writel_relaxed(0, base + GIC_DIST_CTRL);
-
-       /*
-        * Set all global interrupts to be level triggered, active low.
-        */
-       for (i = 32; i < gic_irqs; i += 16)
-               writel_relaxed(0, base + GIC_DIST_CONFIG + i * 4 / 16);
-
-       /*
-        * Set all global interrupts to this CPU only.
-        */
-       cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0);
-       for (i = 32; i < gic_irqs; i += 4)
-               writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
-
-       /*
-        * Set priority on all global interrupts.
-        */
-       for (i = 32; i < gic_irqs; i += 4)
-               writel_relaxed(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4);
-
-       /*
-        * Disable all interrupts.  Leave the PPI and SGIs alone
-        * as these enables are banked registers.
-        */
-       for (i = 32; i < gic_irqs; i += 32)
-               writel_relaxed(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
-
-       writel_relaxed(1, base + GIC_DIST_CTRL);
-}
-
-static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
-{
-       void __iomem *dist_base = gic_data_dist_base(gic);
-       void __iomem *base = gic_data_cpu_base(gic);
-       unsigned int cpu_mask, cpu = smp_processor_id();
-       int i;
-
-       /*
-        * Get what the GIC says our CPU mask is.
-        */
-       BUG_ON(cpu >= NR_GIC_CPU_IF);
-       cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0);
-       gic_cpu_map[cpu] = cpu_mask;
-
-       /*
-        * Clear our mask from the other map entries in case they're
-        * still undefined.
-        */
-       for (i = 0; i < NR_GIC_CPU_IF; i++)
-               if (i != cpu)
-                       gic_cpu_map[i] &= ~cpu_mask;
-
-       /*
-        * Deal with the banked PPI and SGI interrupts - disable all
-        * PPI interrupts, ensure all SGI interrupts are enabled.
-        */
-       writel_relaxed(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR);
-       writel_relaxed(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET);
-
-       /*
-        * Set priority on PPI and SGI interrupts
-        */
-       for (i = 0; i < 32; i += 4)
-               writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4);
-
-       writel_relaxed(0xf0, base + GIC_CPU_PRIMASK);
-       writel_relaxed(1, base + GIC_CPU_CTRL);
-}
-
-#ifdef CONFIG_CPU_PM
-/*
- * Saves the GIC distributor registers during suspend or idle.  Must be called
- * with interrupts disabled but before powering down the GIC.  After calling
- * this function, no interrupts will be delivered by the GIC, and another
- * platform-specific wakeup source must be enabled.
- */
-static void gic_dist_save(unsigned int gic_nr)
-{
-       unsigned int gic_irqs;
-       void __iomem *dist_base;
-       int i;
-
-       if (gic_nr >= MAX_GIC_NR)
-               BUG();
-
-       gic_irqs = gic_data[gic_nr].gic_irqs;
-       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
-
-       if (!dist_base)
-               return;
-
-       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
-               gic_data[gic_nr].saved_spi_conf[i] =
-                       readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
-
-       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
-               gic_data[gic_nr].saved_spi_target[i] =
-                       readl_relaxed(dist_base + GIC_DIST_TARGET + i * 4);
-
-       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
-               gic_data[gic_nr].saved_spi_enable[i] =
-                       readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
-}
-
-/*
- * Restores the GIC distributor registers during resume or when coming out of
- * idle.  Must be called before enabling interrupts.  If a level interrupt
- * that occured while the GIC was suspended is still present, it will be
- * handled normally, but any edge interrupts that occured will not be seen by
- * the GIC and need to be handled by the platform-specific wakeup source.
- */
-static void gic_dist_restore(unsigned int gic_nr)
-{
-       unsigned int gic_irqs;
-       unsigned int i;
-       void __iomem *dist_base;
-
-       if (gic_nr >= MAX_GIC_NR)
-               BUG();
-
-       gic_irqs = gic_data[gic_nr].gic_irqs;
-       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
-
-       if (!dist_base)
-               return;
-
-       writel_relaxed(0, dist_base + GIC_DIST_CTRL);
-
-       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
-               writel_relaxed(gic_data[gic_nr].saved_spi_conf[i],
-                       dist_base + GIC_DIST_CONFIG + i * 4);
-
-       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
-               writel_relaxed(0xa0a0a0a0,
-                       dist_base + GIC_DIST_PRI + i * 4);
-
-       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
-               writel_relaxed(gic_data[gic_nr].saved_spi_target[i],
-                       dist_base + GIC_DIST_TARGET + i * 4);
-
-       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
-               writel_relaxed(gic_data[gic_nr].saved_spi_enable[i],
-                       dist_base + GIC_DIST_ENABLE_SET + i * 4);
-
-       writel_relaxed(1, dist_base + GIC_DIST_CTRL);
-}
-
-static void gic_cpu_save(unsigned int gic_nr)
-{
-       int i;
-       u32 *ptr;
-       void __iomem *dist_base;
-       void __iomem *cpu_base;
-
-       if (gic_nr >= MAX_GIC_NR)
-               BUG();
-
-       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
-       cpu_base = gic_data_cpu_base(&gic_data[gic_nr]);
-
-       if (!dist_base || !cpu_base)
-               return;
-
-       ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
-       for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
-               ptr[i] = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
-
-       ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
-       for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
-               ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
-
-}
-
-static void gic_cpu_restore(unsigned int gic_nr)
-{
-       int i;
-       u32 *ptr;
-       void __iomem *dist_base;
-       void __iomem *cpu_base;
-
-       if (gic_nr >= MAX_GIC_NR)
-               BUG();
-
-       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
-       cpu_base = gic_data_cpu_base(&gic_data[gic_nr]);
-
-       if (!dist_base || !cpu_base)
-               return;
-
-       ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
-       for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
-               writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4);
-
-       ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
-       for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
-               writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4);
-
-       for (i = 0; i < DIV_ROUND_UP(32, 4); i++)
-               writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4);
-
-       writel_relaxed(0xf0, cpu_base + GIC_CPU_PRIMASK);
-       writel_relaxed(1, cpu_base + GIC_CPU_CTRL);
-}
-
-static int gic_notifier(struct notifier_block *self, unsigned long cmd,        void *v)
-{
-       int i;
-
-       for (i = 0; i < MAX_GIC_NR; i++) {
-#ifdef CONFIG_GIC_NON_BANKED
-               /* Skip over unused GICs */
-               if (!gic_data[i].get_base)
-                       continue;
-#endif
-               switch (cmd) {
-               case CPU_PM_ENTER:
-                       gic_cpu_save(i);
-                       break;
-               case CPU_PM_ENTER_FAILED:
-               case CPU_PM_EXIT:
-                       gic_cpu_restore(i);
-                       break;
-               case CPU_CLUSTER_PM_ENTER:
-                       gic_dist_save(i);
-                       break;
-               case CPU_CLUSTER_PM_ENTER_FAILED:
-               case CPU_CLUSTER_PM_EXIT:
-                       gic_dist_restore(i);
-                       break;
-               }
-       }
-
-       return NOTIFY_OK;
-}
-
-static struct notifier_block gic_notifier_block = {
-       .notifier_call = gic_notifier,
-};
-
-static void __init gic_pm_init(struct gic_chip_data *gic)
-{
-       gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4,
-               sizeof(u32));
-       BUG_ON(!gic->saved_ppi_enable);
-
-       gic->saved_ppi_conf = __alloc_percpu(DIV_ROUND_UP(32, 16) * 4,
-               sizeof(u32));
-       BUG_ON(!gic->saved_ppi_conf);
-
-       if (gic == &gic_data[0])
-               cpu_pm_register_notifier(&gic_notifier_block);
-}
-#else
-static void __init gic_pm_init(struct gic_chip_data *gic)
-{
-}
-#endif
-
-static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
-                               irq_hw_number_t hw)
-{
-       if (hw < 32) {
-               irq_set_percpu_devid(irq);
-               irq_set_chip_and_handler(irq, &gic_chip,
-                                        handle_percpu_devid_irq);
-               set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
-       } else {
-               irq_set_chip_and_handler(irq, &gic_chip,
-                                        handle_fasteoi_irq);
-               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-       }
-       irq_set_chip_data(irq, d->host_data);
-       return 0;
-}
-
-static int gic_irq_domain_xlate(struct irq_domain *d,
-                               struct device_node *controller,
-                               const u32 *intspec, unsigned int intsize,
-                               unsigned long *out_hwirq, unsigned int *out_type)
-{
-       if (d->of_node != controller)
-               return -EINVAL;
-       if (intsize < 3)
-               return -EINVAL;
-
-       /* Get the interrupt number and add 16 to skip over SGIs */
-       *out_hwirq = intspec[1] + 16;
-
-       /* For SPIs, we need to add 16 more to get the GIC irq ID number */
-       if (!intspec[0])
-               *out_hwirq += 16;
-
-       *out_type = intspec[2] & IRQ_TYPE_SENSE_MASK;
-       return 0;
-}
-
-const struct irq_domain_ops gic_irq_domain_ops = {
-       .map = gic_irq_domain_map,
-       .xlate = gic_irq_domain_xlate,
-};
-
-void __init gic_init_bases(unsigned int gic_nr, int irq_start,
-                          void __iomem *dist_base, void __iomem *cpu_base,
-                          u32 percpu_offset, struct device_node *node)
-{
-       irq_hw_number_t hwirq_base;
-       struct gic_chip_data *gic;
-       int gic_irqs, irq_base, i;
-
-       BUG_ON(gic_nr >= MAX_GIC_NR);
-
-       gic = &gic_data[gic_nr];
-#ifdef CONFIG_GIC_NON_BANKED
-       if (percpu_offset) { /* Frankein-GIC without banked registers... */
-               unsigned int cpu;
-
-               gic->dist_base.percpu_base = alloc_percpu(void __iomem *);
-               gic->cpu_base.percpu_base = alloc_percpu(void __iomem *);
-               if (WARN_ON(!gic->dist_base.percpu_base ||
-                           !gic->cpu_base.percpu_base)) {
-                       free_percpu(gic->dist_base.percpu_base);
-                       free_percpu(gic->cpu_base.percpu_base);
-                       return;
-               }
-
-               for_each_possible_cpu(cpu) {
-                       unsigned long offset = percpu_offset * cpu_logical_map(cpu);
-                       *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset;
-                       *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset;
-               }
-
-               gic_set_base_accessor(gic, gic_get_percpu_base);
-       } else
-#endif
-       {                       /* Normal, sane GIC... */
-               WARN(percpu_offset,
-                    "GIC_NON_BANKED not enabled, ignoring %08x offset!",
-                    percpu_offset);
-               gic->dist_base.common_base = dist_base;
-               gic->cpu_base.common_base = cpu_base;
-               gic_set_base_accessor(gic, gic_get_common_base);
-       }
-
-       /*
-        * Initialize the CPU interface map to all CPUs.
-        * It will be refined as each CPU probes its ID.
-        */
-       for (i = 0; i < NR_GIC_CPU_IF; i++)
-               gic_cpu_map[i] = 0xff;
-
-       /*
-        * For primary GICs, skip over SGIs.
-        * For secondary GICs, skip over PPIs, too.
-        */
-       if (gic_nr == 0 && (irq_start & 31) > 0) {
-               hwirq_base = 16;
-               if (irq_start != -1)
-                       irq_start = (irq_start & ~31) + 16;
-       } else {
-               hwirq_base = 32;
-       }
-
-       /*
-        * Find out how many interrupts are supported.
-        * The GIC only supports up to 1020 interrupt sources.
-        */
-       gic_irqs = readl_relaxed(gic_data_dist_base(gic) + GIC_DIST_CTR) & 0x1f;
-       gic_irqs = (gic_irqs + 1) * 32;
-       if (gic_irqs > 1020)
-               gic_irqs = 1020;
-       gic->gic_irqs = gic_irqs;
-
-       gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */
-       irq_base = irq_alloc_descs(irq_start, 16, gic_irqs, numa_node_id());
-       if (IS_ERR_VALUE(irq_base)) {
-               WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n",
-                    irq_start);
-               irq_base = irq_start;
-       }
-       gic->domain = irq_domain_add_legacy(node, gic_irqs, irq_base,
-                                   hwirq_base, &gic_irq_domain_ops, gic);
-       if (WARN_ON(!gic->domain))
-               return;
-
-       gic_chip.flags |= gic_arch_extn.flags;
-       gic_dist_init(gic);
-       gic_cpu_init(gic);
-       gic_pm_init(gic);
-}
-
-void __cpuinit gic_secondary_init(unsigned int gic_nr)
-{
-       BUG_ON(gic_nr >= MAX_GIC_NR);
-
-       gic_cpu_init(&gic_data[gic_nr]);
-}
-
-#ifdef CONFIG_SMP
-void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
-{
-       int cpu;
-       unsigned long map = 0;
-
-       /* Convert our logical CPU mask into a physical one. */
-       for_each_cpu(cpu, mask)
-               map |= gic_cpu_map[cpu];
-
-       /*
-        * Ensure that stores to Normal memory are visible to the
-        * other CPUs before issuing the IPI.
-        */
-       dsb();
-
-       /* this always happens on GIC0 */
-       writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
-}
-#endif
-
-#ifdef CONFIG_OF
-static int gic_cnt __initdata = 0;
-
-int __init gic_of_init(struct device_node *node, struct device_node *parent)
-{
-       void __iomem *cpu_base;
-       void __iomem *dist_base;
-       u32 percpu_offset;
-       int irq;
-
-       if (WARN_ON(!node))
-               return -ENODEV;
-
-       dist_base = of_iomap(node, 0);
-       WARN(!dist_base, "unable to map gic dist registers\n");
-
-       cpu_base = of_iomap(node, 1);
-       WARN(!cpu_base, "unable to map gic cpu registers\n");
-
-       if (of_property_read_u32(node, "cpu-offset", &percpu_offset))
-               percpu_offset = 0;
-
-       gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset, node);
-
-       if (parent) {
-               irq = irq_of_parse_and_map(node, 0);
-               gic_cascade_irq(gic_cnt, irq);
-       }
-       gic_cnt++;
-       return 0;
-}
-#endif
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
deleted file mode 100644 (file)
index 8f324b9..0000000
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- *  linux/arch/arm/common/vic.c
- *
- *  Copyright (C) 1999 - 2003 ARM Limited
- *  Copyright (C) 2000 Deep Blue Solutions Ltd
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/export.h>
-#include <linux/init.h>
-#include <linux/list.h>
-#include <linux/io.h>
-#include <linux/irqdomain.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/syscore_ops.h>
-#include <linux/device.h>
-#include <linux/amba/bus.h>
-
-#include <asm/exception.h>
-#include <asm/mach/irq.h>
-#include <asm/hardware/vic.h>
-
-/**
- * struct vic_device - VIC PM device
- * @irq: The IRQ number for the base of the VIC.
- * @base: The register base for the VIC.
- * @valid_sources: A bitmask of valid interrupts
- * @resume_sources: A bitmask of interrupts for resume.
- * @resume_irqs: The IRQs enabled for resume.
- * @int_select: Save for VIC_INT_SELECT.
- * @int_enable: Save for VIC_INT_ENABLE.
- * @soft_int: Save for VIC_INT_SOFT.
- * @protect: Save for VIC_PROTECT.
- * @domain: The IRQ domain for the VIC.
- */
-struct vic_device {
-       void __iomem    *base;
-       int             irq;
-       u32             valid_sources;
-       u32             resume_sources;
-       u32             resume_irqs;
-       u32             int_select;
-       u32             int_enable;
-       u32             soft_int;
-       u32             protect;
-       struct irq_domain *domain;
-};
-
-/* we cannot allocate memory when VICs are initially registered */
-static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
-
-static int vic_id;
-
-/**
- * vic_init2 - common initialisation code
- * @base: Base of the VIC.
- *
- * Common initialisation code for registration
- * and resume.
-*/
-static void vic_init2(void __iomem *base)
-{
-       int i;
-
-       for (i = 0; i < 16; i++) {
-               void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
-               writel(VIC_VECT_CNTL_ENABLE | i, reg);
-       }
-
-       writel(32, base + VIC_PL190_DEF_VECT_ADDR);
-}
-
-#ifdef CONFIG_PM
-static void resume_one_vic(struct vic_device *vic)
-{
-       void __iomem *base = vic->base;
-
-       printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base);
-
-       /* re-initialise static settings */
-       vic_init2(base);
-
-       writel(vic->int_select, base + VIC_INT_SELECT);
-       writel(vic->protect, base + VIC_PROTECT);
-
-       /* set the enabled ints and then clear the non-enabled */
-       writel(vic->int_enable, base + VIC_INT_ENABLE);
-       writel(~vic->int_enable, base + VIC_INT_ENABLE_CLEAR);
-
-       /* and the same for the soft-int register */
-
-       writel(vic->soft_int, base + VIC_INT_SOFT);
-       writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR);
-}
-
-static void vic_resume(void)
-{
-       int id;
-
-       for (id = vic_id - 1; id >= 0; id--)
-               resume_one_vic(vic_devices + id);
-}
-
-static void suspend_one_vic(struct vic_device *vic)
-{
-       void __iomem *base = vic->base;
-
-       printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base);
-
-       vic->int_select = readl(base + VIC_INT_SELECT);
-       vic->int_enable = readl(base + VIC_INT_ENABLE);
-       vic->soft_int = readl(base + VIC_INT_SOFT);
-       vic->protect = readl(base + VIC_PROTECT);
-
-       /* set the interrupts (if any) that are used for
-        * resuming the system */
-
-       writel(vic->resume_irqs, base + VIC_INT_ENABLE);
-       writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR);
-}
-
-static int vic_suspend(void)
-{
-       int id;
-
-       for (id = 0; id < vic_id; id++)
-               suspend_one_vic(vic_devices + id);
-
-       return 0;
-}
-
-struct syscore_ops vic_syscore_ops = {
-       .suspend        = vic_suspend,
-       .resume         = vic_resume,
-};
-
-/**
- * vic_pm_init - initicall to register VIC pm
- *
- * This is called via late_initcall() to register
- * the resources for the VICs due to the early
- * nature of the VIC's registration.
-*/
-static int __init vic_pm_init(void)
-{
-       if (vic_id > 0)
-               register_syscore_ops(&vic_syscore_ops);
-
-       return 0;
-}
-late_initcall(vic_pm_init);
-#endif /* CONFIG_PM */
-
-static struct irq_chip vic_chip;
-
-static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
-                            irq_hw_number_t hwirq)
-{
-       struct vic_device *v = d->host_data;
-
-       /* Skip invalid IRQs, only register handlers for the real ones */
-       if (!(v->valid_sources & (1 << hwirq)))
-               return -ENOTSUPP;
-       irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
-       irq_set_chip_data(irq, v->base);
-       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-       return 0;
-}
-
-static struct irq_domain_ops vic_irqdomain_ops = {
-       .map = vic_irqdomain_map,
-       .xlate = irq_domain_xlate_onetwocell,
-};
-
-/**
- * vic_register() - Register a VIC.
- * @base: The base address of the VIC.
- * @irq: The base IRQ for the VIC.
- * @valid_sources: bitmask of valid interrupts
- * @resume_sources: bitmask of interrupts allowed for resume sources.
- * @node: The device tree node associated with the VIC.
- *
- * Register the VIC with the system device tree so that it can be notified
- * of suspend and resume requests and ensure that the correct actions are
- * taken to re-instate the settings on resume.
- *
- * This also configures the IRQ domain for the VIC.
- */
-static void __init vic_register(void __iomem *base, unsigned int irq,
-                               u32 valid_sources, u32 resume_sources,
-                               struct device_node *node)
-{
-       struct vic_device *v;
-       int i;
-
-       if (vic_id >= ARRAY_SIZE(vic_devices)) {
-               printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
-               return;
-       }
-
-       v = &vic_devices[vic_id];
-       v->base = base;
-       v->valid_sources = valid_sources;
-       v->resume_sources = resume_sources;
-       v->irq = irq;
-       vic_id++;
-       v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,
-                                         &vic_irqdomain_ops, v);
-       /* create an IRQ mapping for each valid IRQ */
-       for (i = 0; i < fls(valid_sources); i++)
-               if (valid_sources & (1 << i))
-                       irq_create_mapping(v->domain, i);
-}
-
-static void vic_ack_irq(struct irq_data *d)
-{
-       void __iomem *base = irq_data_get_irq_chip_data(d);
-       unsigned int irq = d->hwirq;
-       writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
-       /* moreover, clear the soft-triggered, in case it was the reason */
-       writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
-}
-
-static void vic_mask_irq(struct irq_data *d)
-{
-       void __iomem *base = irq_data_get_irq_chip_data(d);
-       unsigned int irq = d->hwirq;
-       writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
-}
-
-static void vic_unmask_irq(struct irq_data *d)
-{
-       void __iomem *base = irq_data_get_irq_chip_data(d);
-       unsigned int irq = d->hwirq;
-       writel(1 << irq, base + VIC_INT_ENABLE);
-}
-
-#if defined(CONFIG_PM)
-static struct vic_device *vic_from_irq(unsigned int irq)
-{
-        struct vic_device *v = vic_devices;
-       unsigned int base_irq = irq & ~31;
-       int id;
-
-       for (id = 0; id < vic_id; id++, v++) {
-               if (v->irq == base_irq)
-                       return v;
-       }
-
-       return NULL;
-}
-
-static int vic_set_wake(struct irq_data *d, unsigned int on)
-{
-       struct vic_device *v = vic_from_irq(d->irq);
-       unsigned int off = d->hwirq;
-       u32 bit = 1 << off;
-
-       if (!v)
-               return -EINVAL;
-
-       if (!(bit & v->resume_sources))
-               return -EINVAL;
-
-       if (on)
-               v->resume_irqs |= bit;
-       else
-               v->resume_irqs &= ~bit;
-
-       return 0;
-}
-#else
-#define vic_set_wake NULL
-#endif /* CONFIG_PM */
-
-static struct irq_chip vic_chip = {
-       .name           = "VIC",
-       .irq_ack        = vic_ack_irq,
-       .irq_mask       = vic_mask_irq,
-       .irq_unmask     = vic_unmask_irq,
-       .irq_set_wake   = vic_set_wake,
-};
-
-static void __init vic_disable(void __iomem *base)
-{
-       writel(0, base + VIC_INT_SELECT);
-       writel(0, base + VIC_INT_ENABLE);
-       writel(~0, base + VIC_INT_ENABLE_CLEAR);
-       writel(0, base + VIC_ITCR);
-       writel(~0, base + VIC_INT_SOFT_CLEAR);
-}
-
-static void __init vic_clear_interrupts(void __iomem *base)
-{
-       unsigned int i;
-
-       writel(0, base + VIC_PL190_VECT_ADDR);
-       for (i = 0; i < 19; i++) {
-               unsigned int value;
-
-               value = readl(base + VIC_PL190_VECT_ADDR);
-               writel(value, base + VIC_PL190_VECT_ADDR);
-       }
-}
-
-/*
- * The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
- * The original cell has 32 interrupts, while the modified one has 64,
- * replocating two blocks 0x00..0x1f in 0x20..0x3f. In that case
- * the probe function is called twice, with base set to offset 000
- *  and 020 within the page. We call this "second block".
- */
-static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
-                              u32 vic_sources, struct device_node *node)
-{
-       unsigned int i;
-       int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;
-
-       /* Disable all interrupts initially. */
-       vic_disable(base);
-
-       /*
-        * Make sure we clear all existing interrupts. The vector registers
-        * in this cell are after the second block of general registers,
-        * so we can address them using standard offsets, but only from
-        * the second base address, which is 0x20 in the page
-        */
-       if (vic_2nd_block) {
-               vic_clear_interrupts(base);
-
-               /* ST has 16 vectors as well, but we don't enable them by now */
-               for (i = 0; i < 16; i++) {
-                       void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
-                       writel(0, reg);
-               }
-
-               writel(32, base + VIC_PL190_DEF_VECT_ADDR);
-       }
-
-       vic_register(base, irq_start, vic_sources, 0, node);
-}
-
-void __init __vic_init(void __iomem *base, int irq_start,
-                             u32 vic_sources, u32 resume_sources,
-                             struct device_node *node)
-{
-       unsigned int i;
-       u32 cellid = 0;
-       enum amba_vendor vendor;
-
-       /* Identify which VIC cell this one is, by reading the ID */
-       for (i = 0; i < 4; i++) {
-               void __iomem *addr;
-               addr = (void __iomem *)((u32)base & PAGE_MASK) + 0xfe0 + (i * 4);
-               cellid |= (readl(addr) & 0xff) << (8 * i);
-       }
-       vendor = (cellid >> 12) & 0xff;
-       printk(KERN_INFO "VIC @%p: id 0x%08x, vendor 0x%02x\n",
-              base, cellid, vendor);
-
-       switch(vendor) {
-       case AMBA_VENDOR_ST:
-               vic_init_st(base, irq_start, vic_sources, node);
-               return;
-       default:
-               printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
-               /* fall through */
-       case AMBA_VENDOR_ARM:
-               break;
-       }
-
-       /* Disable all interrupts initially. */
-       vic_disable(base);
-
-       /* Make sure we clear all existing interrupts */
-       vic_clear_interrupts(base);
-
-       vic_init2(base);
-
-       vic_register(base, irq_start, vic_sources, resume_sources, node);
-}
-
-/**
- * vic_init() - initialise a vectored interrupt controller
- * @base: iomem base address
- * @irq_start: starting interrupt number, must be muliple of 32
- * @vic_sources: bitmask of interrupt sources to allow
- * @resume_sources: bitmask of interrupt sources to allow for resume
- */
-void __init vic_init(void __iomem *base, unsigned int irq_start,
-                    u32 vic_sources, u32 resume_sources)
-{
-       __vic_init(base, irq_start, vic_sources, resume_sources, NULL);
-}
-
-#ifdef CONFIG_OF
-int __init vic_of_init(struct device_node *node, struct device_node *parent)
-{
-       void __iomem *regs;
-
-       if (WARN(parent, "non-root VICs are not supported"))
-               return -EINVAL;
-
-       regs = of_iomap(node, 0);
-       if (WARN_ON(!regs))
-               return -EIO;
-
-       /*
-        * Passing 0 as first IRQ makes the simple domain allocate descriptors
-        */
-       __vic_init(regs, 0, ~0, ~0, node);
-
-       return 0;
-}
-#endif /* CONFIG OF */
-
-/*
- * Handle each interrupt in a single VIC.  Returns non-zero if we've
- * handled at least one interrupt.  This reads the status register
- * before handling each interrupt, which is necessary given that
- * handle_IRQ may briefly re-enable interrupts for soft IRQ handling.
- */
-static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
-{
-       u32 stat, irq;
-       int handled = 0;
-
-       while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
-               irq = ffs(stat) - 1;
-               handle_IRQ(irq_find_mapping(vic->domain, irq), regs);
-               handled = 1;
-       }
-
-       return handled;
-}
-
-/*
- * Keep iterating over all registered VIC's until there are no pending
- * interrupts.
- */
-asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs)
-{
-       int i, handled;
-
-       do {
-               for (i = 0, handled = 0; i < vic_id; ++i)
-                       handled |= handle_one_vic(&vic_devices[i], regs);
-       } while (handled);
-}
index 69667133321fa613db076367c1f8bc2620261cd0..d946372c4300c2a1b74728e12d031207fa8d8120 100644 (file)
@@ -19,6 +19,7 @@ CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_ARCH_MXC=y
 CONFIG_ARCH_MULTI_V6=y
 CONFIG_ARCH_MULTI_V7=y
+CONFIG_MACH_IMX31_DT=y
 CONFIG_MACH_MX31LILLY=y
 CONFIG_MACH_MX31LITE=y
 CONFIG_MACH_PCM037=y
@@ -32,7 +33,6 @@ CONFIG_MACH_PCM043=y
 CONFIG_MACH_MX35_3DS=y
 CONFIG_MACH_VPR200=y
 CONFIG_MACH_IMX51_DT=y
-CONFIG_MACH_MX51_3DS=y
 CONFIG_MACH_EUKREA_CPUIMX51SD=y
 CONFIG_SOC_IMX53=y
 CONFIG_SOC_IMX6Q=y
index 6a936c7c078afe7f56d0ade48de1dd5ff925cc08..002a1ceadceb635f65b1e5523ecdb7f4e74710a6 100644 (file)
@@ -11,6 +11,9 @@ CONFIG_PARTITION_ADVANCED=y
 CONFIG_BSD_DISKLABEL=y
 CONFIG_SOLARIS_X86_PARTITION=y
 CONFIG_ARCH_SIRF=y
+# CONFIG_SWP_EMULATE is not set
+CONFIG_SMP=y
+CONFIG_SCHED_MC=y
 CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_KEXEC=y
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
deleted file mode 100644 (file)
index 4b1ce6c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  arch/arm/include/asm/hardware/gic.h
- *
- *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#ifndef __ASM_ARM_HARDWARE_GIC_H
-#define __ASM_ARM_HARDWARE_GIC_H
-
-#include <linux/compiler.h>
-
-#define GIC_CPU_CTRL                   0x00
-#define GIC_CPU_PRIMASK                        0x04
-#define GIC_CPU_BINPOINT               0x08
-#define GIC_CPU_INTACK                 0x0c
-#define GIC_CPU_EOI                    0x10
-#define GIC_CPU_RUNNINGPRI             0x14
-#define GIC_CPU_HIGHPRI                        0x18
-
-#define GIC_DIST_CTRL                  0x000
-#define GIC_DIST_CTR                   0x004
-#define GIC_DIST_ENABLE_SET            0x100
-#define GIC_DIST_ENABLE_CLEAR          0x180
-#define GIC_DIST_PENDING_SET           0x200
-#define GIC_DIST_PENDING_CLEAR         0x280
-#define GIC_DIST_ACTIVE_BIT            0x300
-#define GIC_DIST_PRI                   0x400
-#define GIC_DIST_TARGET                        0x800
-#define GIC_DIST_CONFIG                        0xc00
-#define GIC_DIST_SOFTINT               0xf00
-
-#ifndef __ASSEMBLY__
-#include <linux/irqdomain.h>
-struct device_node;
-
-extern struct irq_chip gic_arch_extn;
-
-void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
-                   u32 offset, struct device_node *);
-int gic_of_init(struct device_node *node, struct device_node *parent);
-void gic_secondary_init(unsigned int);
-void gic_handle_irq(struct pt_regs *regs);
-void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
-void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
-
-static inline void gic_init(unsigned int nr, int start,
-                           void __iomem *dist , void __iomem *cpu)
-{
-       gic_init_bases(nr, start, dist, cpu, 0, NULL);
-}
-
-#endif
-
-#endif
diff --git a/arch/arm/include/asm/hardware/vic.h b/arch/arm/include/asm/hardware/vic.h
deleted file mode 100644 (file)
index 2bebad3..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  arch/arm/include/asm/hardware/vic.h
- *
- *  Copyright (c) ARM Limited 2003.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef __ASM_ARM_HARDWARE_VIC_H
-#define __ASM_ARM_HARDWARE_VIC_H
-
-#define VIC_IRQ_STATUS                 0x00
-#define VIC_FIQ_STATUS                 0x04
-#define VIC_RAW_STATUS                 0x08
-#define VIC_INT_SELECT                 0x0c    /* 1 = FIQ, 0 = IRQ */
-#define VIC_INT_ENABLE                 0x10    /* 1 = enable, 0 = disable */
-#define VIC_INT_ENABLE_CLEAR           0x14
-#define VIC_INT_SOFT                   0x18
-#define VIC_INT_SOFT_CLEAR             0x1c
-#define VIC_PROTECT                    0x20
-#define VIC_PL190_VECT_ADDR            0x30    /* PL190 only */
-#define VIC_PL190_DEF_VECT_ADDR                0x34    /* PL190 only */
-
-#define VIC_VECT_ADDR0                 0x100   /* 0 to 15 (0..31 PL192) */
-#define VIC_VECT_CNTL0                 0x200   /* 0 to 15 (0..31 PL192) */
-#define VIC_ITCR                       0x300   /* VIC test control register */
-
-#define VIC_VECT_CNTL_ENABLE           (1 << 5)
-
-#define VIC_PL192_VECT_ADDR            0xF00
-
-#ifndef __ASSEMBLY__
-#include <linux/compiler.h>
-#include <linux/types.h>
-
-struct device_node;
-struct pt_regs;
-
-void __vic_init(void __iomem *base, int irq_start, u32 vic_sources,
-               u32 resume_sources, struct device_node *node);
-void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
-int vic_of_init(struct device_node *node, struct device_node *parent);
-void vic_handle_irq(struct pt_regs *regs);
-
-#endif /* __ASSEMBLY__ */
-#endif
index 917d4fcfd9b4a9512bc26ba9539e5994154e6728..308ad7d6f98b77098dd3c831b8831f9731f49211 100644 (file)
@@ -12,7 +12,6 @@
 
 struct tag;
 struct meminfo;
-struct sys_timer;
 struct pt_regs;
 struct smp_operations;
 #ifdef CONFIG_SMP
@@ -48,7 +47,7 @@ struct machine_desc {
        void                    (*map_io)(void);/* IO mapping function  */
        void                    (*init_early)(void);
        void                    (*init_irq)(void);
-       struct sys_timer        *timer;         /* system tick timer    */
+       void                    (*init_time)(void);
        void                    (*init_machine)(void);
        void                    (*init_late)(void);
 #ifdef CONFIG_MULTI_IRQ_HANDLER
index 15cb035309f754ca4c5b3e4c4fa718e6a27252ac..18c883023339a39ad246e6de7a066106365e3078 100644 (file)
@@ -22,6 +22,7 @@ extern int show_fiq_list(struct seq_file *, int);
 
 #ifdef CONFIG_MULTI_IRQ_HANDLER
 extern void (*handle_arch_irq)(struct pt_regs *);
+extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
 #endif
 
 /*
index 6ca945f534ab16ac9159fec794b9b2bcd5e3b87f..90c12e1e695c97682c229174a975bb6fdb97403e 100644 (file)
 #ifndef __ASM_ARM_MACH_TIME_H
 #define __ASM_ARM_MACH_TIME_H
 
-/*
- * This is our kernel timer structure.
- *
- * - init
- *   Initialise the kernels jiffy timer source, claim interrupt
- *   using setup_irq.  This is called early on during initialisation
- *   while interrupts are still disabled on the local CPU.
- * - suspend
- *   Suspend the kernel jiffy timer source, if necessary.  This
- *   is called with interrupts disabled, after all normal devices
- *   have been suspended.  If no action is required, set this to
- *   NULL.
- * - resume
- *   Resume the kernel jiffy timer source, if necessary.  This
- *   is called with interrupts disabled before any normal devices
- *   are resumed.  If no action is required, set this to NULL.
- * - offset
- *   Return the timer offset in microseconds since the last timer
- *   interrupt.  Note: this must take account of any unprocessed
- *   timer interrupt which may be pending.
- */
-struct sys_timer {
-       void                    (*init)(void);
-       void                    (*suspend)(void);
-       void                    (*resume)(void);
-#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
-       unsigned long           (*offset)(void);
-#endif
-};
-
 extern void timer_tick(void);
 
 struct timespec;
index 0c4e17d4d359a42cb372341045068f7dc44462c6..c6f294cf18f0cf2a6d821a8ae7ed921af9cbaa8e 100644 (file)
@@ -34,7 +34,7 @@
 #define UART_PADDR     0x43f90000
 #elif defined (CONFIG_DEBUG_IMX51_UART)
 #define UART_PADDR     0x73fbc000
-#elif defined (CONFIG_DEBUG_IMX50_IMX53_UART)
+#elif defined (CONFIG_DEBUG_IMX53_UART)
 #define UART_PADDR     0x53fbc000
 #elif defined (CONFIG_DEBUG_IMX6Q_UART)
 #define UART_PADDR     IMX6Q_DEBUG_UART_BASE
diff --git a/arch/arm/include/debug/vt8500.S b/arch/arm/include/debug/vt8500.S
new file mode 100644 (file)
index 0000000..0e0ca08
--- /dev/null
@@ -0,0 +1,37 @@
+/* 
+ * Debugging macro include header
+ *
+ *  Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
+ *    Moved from arch/arm/mach-vt8500/include/mach/debug-macro.S
+ *    Minor changes for readability.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define DEBUG_LL_PHYS_BASE             0xD8000000
+#define DEBUG_LL_VIRT_BASE             0xF8000000
+#define DEBUG_LL_UART_OFFSET           0x00200000
+
+#if defined(CONFIG_DEBUG_VT8500_UART0)
+       .macro  addruart, rp, rv, tmp
+       mov     \rp,      #DEBUG_LL_UART_OFFSET
+       orr     \rv, \rp, #DEBUG_LL_VIRT_BASE
+       orr     \rp, \rp, #DEBUG_LL_PHYS_BASE
+       .endm
+
+       .macro  senduart,rd,rx
+       strb    \rd, [\rx, #0]
+       .endm
+
+       .macro  busyuart,rd,rx
+1001:  ldr     \rd, [\rx, #0x1c]
+       ands    \rd, \rd, #0x2
+       bne     1001b
+       .endm
+
+       .macro  waituart,rd,rx
+       .endm
+
+#endif
index 896165096d6a936572bdcfd0d21cc23f01cb9ea2..8e4ef4c83a741bc0c5fd3a48735a9b6377a9ba71 100644 (file)
@@ -117,6 +117,16 @@ void __init init_IRQ(void)
        machine_desc->init_irq();
 }
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+void __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
+{
+       if (handle_arch_irq)
+               return;
+
+       handle_arch_irq = handle_irq;
+}
+#endif
+
 #ifdef CONFIG_SPARSE_IRQ
 int __init arch_probe_nr_irqs(void)
 {
index 84f4cbf652e58b3acfea846ad1cad9ddbee72d95..3fc96db2a4b662feb745b28bc9e0cd1c8a63f82c 100644 (file)
@@ -416,7 +416,8 @@ static void (*smp_cross_call)(const struct cpumask *, unsigned int);
 
 void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int))
 {
-       smp_cross_call = fn;
+       if (!smp_cross_call)
+               smp_cross_call = fn;
 }
 
 void arch_send_call_function_ipi_mask(const struct cpumask *mask)
index 49f335d301bae4c8f381143de37f4afb42975dce..dc9bb01466659e420f14508cd2fd58f86b308202 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <asm/smp_twd.h>
 #include <asm/localtimer.h>
-#include <asm/hardware/gic.h>
 
 /* set up by the platform code */
 static void __iomem *twd_base;
index 09be0c3c906965822d206b4268a97fbe275bc5f8..955d92d265e5d9496289ed7613bdd6ceffba04d7 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/timex.h>
 #include <linux/errno.h>
 #include <linux/profile.h>
-#include <linux/syscore_ops.h>
 #include <linux/timer.h>
 #include <linux/irq.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 
-/*
- * Our system timer.
- */
-static struct sys_timer *system_timer;
-
 #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) || \
     defined(CONFIG_NVRAM) || defined(CONFIG_NVRAM_MODULE)
 /* this needs a better home */
@@ -69,16 +63,6 @@ unsigned long profile_pc(struct pt_regs *regs)
 EXPORT_SYMBOL(profile_pc);
 #endif
 
-#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
-u32 arch_gettimeoffset(void)
-{
-       if (system_timer->offset != NULL)
-               return system_timer->offset() * 1000;
-
-       return 0;
-}
-#endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */
-
 #ifndef CONFIG_GENERIC_CLOCKEVENTS
 /*
  * Kernel system timer support.
@@ -129,43 +113,8 @@ int __init register_persistent_clock(clock_access_fn read_boot,
        return -EINVAL;
 }
 
-#if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS)
-static int timer_suspend(void)
-{
-       if (system_timer->suspend)
-               system_timer->suspend();
-
-       return 0;
-}
-
-static void timer_resume(void)
-{
-       if (system_timer->resume)
-               system_timer->resume();
-}
-#else
-#define timer_suspend NULL
-#define timer_resume NULL
-#endif
-
-static struct syscore_ops timer_syscore_ops = {
-       .suspend        = timer_suspend,
-       .resume         = timer_resume,
-};
-
-static int __init timer_init_syscore_ops(void)
-{
-       register_syscore_ops(&timer_syscore_ops);
-
-       return 0;
-}
-
-device_initcall(timer_init_syscore_ops);
-
 void __init time_init(void)
 {
-       system_timer = machine_desc->timer;
-       system_timer->init();
+       machine_desc->init_time();
        sched_clock_postinit();
 }
-
index cafe98836c8a7979703874a729ce22d6ae3eec86..2acdff4c1dfea8c72c7106dff630a4870d6e70a9 100644 (file)
@@ -174,7 +174,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
 static struct clock_event_device clkevt = {
        .name           = "at91_tick",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .rating         = 150,
        .set_next_event = clkevt32k_next_event,
        .set_mode       = clkevt32k_mode,
@@ -265,17 +264,10 @@ void __init at91rm9200_timer_init(void)
        at91_st_write(AT91_ST_RTMR, 1);
 
        /* Setup timer clockevent, with minimum of two ticks (important!!) */
-       clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
-       clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
-       clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
        clkevt.cpumask = cpumask_of(0);
-       clockevents_register_device(&clkevt);
+       clockevents_config_and_register(&clkevt, AT91_SLOW_CLOCK,
+                                       2, AT91_ST_ALMV);
 
        /* register clocksource */
        clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
 }
-
-struct sys_timer at91rm9200_timer = {
-       .init           = at91rm9200_timer_init,
-};
-
index 358412f1f5f80992c967c9af3333f5f0f9bed7e6..3a4bc2e1a65e73d3b2187f90f6b84a43e7ec6468 100644 (file)
@@ -104,12 +104,38 @@ pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
        }
 }
 
+static void at91sam926x_pit_suspend(struct clock_event_device *cedev)
+{
+       /* Disable timer */
+       pit_write(AT91_PIT_MR, 0);
+}
+
+static void at91sam926x_pit_reset(void)
+{
+       /* Disable timer and irqs */
+       pit_write(AT91_PIT_MR, 0);
+
+       /* Clear any pending interrupts, wait for PIT to stop counting */
+       while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0)
+               cpu_relax();
+
+       /* Start PIT but don't enable IRQ */
+       pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
+}
+
+static void at91sam926x_pit_resume(struct clock_event_device *cedev)
+{
+       at91sam926x_pit_reset();
+}
+
 static struct clock_event_device pit_clkevt = {
        .name           = "pit",
        .features       = CLOCK_EVT_FEAT_PERIODIC,
        .shift          = 32,
        .rating         = 100,
        .set_mode       = pit_clkevt_mode,
+       .suspend        = at91sam926x_pit_suspend,
+       .resume         = at91sam926x_pit_resume,
 };
 
 
@@ -150,19 +176,6 @@ static struct irqaction at91sam926x_pit_irq = {
        .irq            = NR_IRQS_LEGACY + AT91_ID_SYS,
 };
 
-static void at91sam926x_pit_reset(void)
-{
-       /* Disable timer and irqs */
-       pit_write(AT91_PIT_MR, 0);
-
-       /* Clear any pending interrupts, wait for PIT to stop counting */
-       while (PIT_CPIV(pit_read(AT91_PIT_PIVR)) != 0)
-               cpu_relax();
-
-       /* Start PIT but don't enable IRQ */
-       pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);
-}
-
 #ifdef CONFIG_OF
 static struct of_device_id pit_timer_ids[] = {
        { .compatible = "atmel,at91sam9260-pit" },
@@ -211,7 +224,7 @@ static int __init of_at91sam926x_pit_init(void)
 /*
  * Set up both clocksource and clockevent support.
  */
-static void __init at91sam926x_pit_init(void)
+void __init at91sam926x_pit_init(void)
 {
        unsigned long   pit_rate;
        unsigned        bits;
@@ -250,12 +263,6 @@ static void __init at91sam926x_pit_init(void)
        clockevents_register_device(&pit_clkevt);
 }
 
-static void at91sam926x_pit_suspend(void)
-{
-       /* Disable timer */
-       pit_write(AT91_PIT_MR, 0);
-}
-
 void __init at91sam926x_ioremap_pit(u32 addr)
 {
 #if defined(CONFIG_OF)
@@ -272,9 +279,3 @@ void __init at91sam926x_ioremap_pit(u32 addr)
        if (!pit_base_addr)
                panic("Impossible to ioremap PIT\n");
 }
-
-struct sys_timer at91sam926x_timer = {
-       .init           = at91sam926x_pit_init,
-       .suspend        = at91sam926x_pit_suspend,
-       .resume         = at91sam926x_pit_reset,
-};
index 0e57e440c061b586c496f6ac72b644313e7a5107..0c07a4459cb2e13d70d313c4722862beb444bedd 100644 (file)
 #define        AT91_TC_CLK1BASE        0x40
 #define        AT91_TC_CLK2BASE        0x80
 
-static unsigned long at91x40_gettimeoffset(void)
+static u32 at91x40_gettimeoffset(void)
 {
-       return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128));
+       return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 /
+               (AT91X40_MASTER_CLOCK / 128)) * 1000;
 }
 
 static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id)
@@ -64,6 +65,8 @@ void __init at91x40_timer_init(void)
 {
        unsigned int v;
 
+       arch_gettimeoffset = at91x40_gettimeoffset;
+
        at91_tc_write(AT91_TC_BCR, 0);
        v = at91_tc_read(AT91_TC_BMR);
        v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE;
@@ -79,9 +82,3 @@ void __init at91x40_timer_init(void)
 
        at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN));
 }
-
-struct sys_timer at91x40_timer = {
-       .init   = at91x40_timer_init,
-       .offset = at91x40_gettimeoffset,
-};
-
index b99b5752cc10a3e4f7e1b029b2f98f6066aeb656..35ab632bbf68a169f5e2b1671d7ba79506ccffae 100644 (file)
@@ -90,7 +90,7 @@ static void __init onearm_board_init(void)
 
 MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = onearm_init_early,
index 854b9797428754908ae0cd4d8af6b42f64320d59..f95e31cda4b33ac1de9101991ea8556167697619 100644 (file)
@@ -210,7 +210,7 @@ static void __init afeb9260_board_init(void)
 
 MACHINE_START(AFEB9260, "Custom afeb9260 board")
        /* Maintainer: Sergey Lapin <slapin@ossfans.org> */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = afeb9260_init_early,
index 28a18ce6d9143d5df3f20eb11e83e55a6a6bf60e..ade948b8266272d9ee1cadf85e713a4e5d1632c1 100644 (file)
@@ -187,7 +187,7 @@ static void __init cam60_board_init(void)
 
 MACHINE_START(CAM60, "KwikByte CAM60")
        /* Maintainer: KwikByte */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = cam60_init_early,
index c17bb533a94995f89f2eada76244f8040228000d..92983050a9bd2bc78e7ec12f5f69045d18777d7a 100644 (file)
@@ -157,7 +157,7 @@ static void __init carmeva_board_init(void)
 
 MACHINE_START(CARMEVA, "Carmeva")
        /* Maintainer: Conitec Datasystems */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = carmeva_init_early,
index 847432441ecc56d628d722a1be28b970766603b0..008527efdbcf6af4d05b56311e3a9678f486c819 100644 (file)
@@ -374,7 +374,7 @@ MACHINE_START(CPUAT9260, "Eukrea CPU9260")
 MACHINE_START(CPUAT9G20, "Eukrea CPU9G20")
 #endif
        /* Maintainer: Eric Benard - EUKREA Electromatique */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = cpu9krea_init_early,
index 2a7af7868747c1ad72722e93e42bef1b940be889..42f1353a4bafe5566a9c705640b6e210d18e43ac 100644 (file)
@@ -178,7 +178,7 @@ static void __init cpuat91_board_init(void)
 
 MACHINE_START(CPUAT91, "Eukrea")
        /* Maintainer: Eric Benard - EUKREA Electromatique */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = cpuat91_init_early,
index 48a531e05be3995cd6fce2a31535e8d1d473ed46..e5fde215225b2d245dbe419cab59cf8cfdd8210b 100644 (file)
@@ -251,7 +251,7 @@ static void __init csb337_board_init(void)
 
 MACHINE_START(CSB337, "Cogent CSB337")
        /* Maintainer: Bill Gatliff */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = csb337_init_early,
index ec0f3abd504b796fe752e7db210ef456eb4e99d7..fdf11061c577585d15297ff12595ba65888e9e10 100644 (file)
@@ -132,7 +132,7 @@ static void __init csb637_board_init(void)
 
 MACHINE_START(CSB637, "Cogent CSB637")
        /* Maintainer: Bill Gatliff */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = csb637_init_early,
index 881170ce61dd2dd47d2ce7f04d7e9a61d88a7638..8db30132abed165dc0c52737895789e532ee24a1 100644 (file)
@@ -49,7 +49,7 @@ static const char *at91_dt_board_compat[] __initdata = {
 
 DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
        /* Maintainer: Atmel */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = at91_dt_initialize,
index b489388a6f84e24483eacd63038aa448316968be..becf0a6a289e8a60d573ef01b684431ec6661946 100644 (file)
@@ -44,7 +44,7 @@ static void __init at91eb01_init_early(void)
 
 MACHINE_START(AT91EB01, "Atmel AT91 EB01")
        /* Maintainer: Greg Ungerer <gerg@snapgear.com> */
-       .timer          = &at91x40_timer,
+       .init_time      = at91x40_timer_init,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = at91eb01_init_early,
        .init_irq       = at91eb01_init_irq,
index 9f5e71c95f054b8977cb6e47a61bd9165661e871..f9be8161bbfafab9ace4dcfc5e74978c06f8a2c8 100644 (file)
@@ -116,7 +116,7 @@ static void __init eb9200_board_init(void)
 }
 
 MACHINE_START(ATEB9200, "Embest ATEB9200")
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = eb9200_init_early,
index ef69e0ebe949e77c98b6b573645c808a4d7c0c42..b2fcd71262ba2c8c7e4ed72e8913b66e35b09a16 100644 (file)
@@ -181,7 +181,7 @@ static void __init ecb_at91board_init(void)
 
 MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
        /* Maintainer: emQbit.com */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ecb_at91init_early,
index 50f3d3795c057205f8b9068954fd7b9bac88766d..77de410efc90a94a5f2ba20eb68f28d9b88699ce 100644 (file)
@@ -149,7 +149,7 @@ static void __init eco920_board_init(void)
 
 MACHINE_START(ECO920, "eco920")
        /* Maintainer: Sascha Hauer */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = eco920_init_early,
index 5d44eba0f20fd980329d18cee8b97f98643d9c24..737c08563628ef40ce68020b8f2f9d56ba8e918a 100644 (file)
@@ -159,7 +159,7 @@ static void __init flexibity_board_init(void)
 
 MACHINE_START(FLEXIBITY, "Flexibity Connect")
        /* Maintainer: Maxim Osipov */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = flexibity_init_early,
index 191d37c16babd2ffc231afd50038a82ac0b73153..2ea7059b840bfedc5a156d009c943ee4246340ac 100644 (file)
@@ -261,7 +261,7 @@ static void __init foxg20_board_init(void)
 
 MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20")
        /* Maintainer: Sergio Tanzilli */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = foxg20_init_early,
index 23a2fa17ab296842937877a2614042442ef94416..c1d61d247790b72fc009547d61bd49a6cc3797a5 100644 (file)
@@ -574,7 +574,7 @@ static void __init gsia18s_board_init(void)
 }
 
 MACHINE_START(GSIA18S, "GS_IA18_S")
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = gsia18s_init_early,
index 9a43d1e1a0377d4ef80fad9f445b46168dd81647..88e2f5d2d16dfca5e301c6ef826019a3786e8c6c 100644 (file)
@@ -103,7 +103,7 @@ static void __init kafa_board_init(void)
 
 MACHINE_START(KAFA, "Sperry-Sun KAFA")
        /* Maintainer: Sergei Sharonov */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = kafa_init_early,
index f168bec2369f94cbba90884716e8592c00a844e2..0c519d9ebffc578c7c740ce7b8d440699648a5a0 100644 (file)
@@ -149,7 +149,7 @@ static void __init kb9202_board_init(void)
 
 MACHINE_START(KB9200, "KB920x")
        /* Maintainer: KwikByte, Inc. */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = kb9202_init_early,
index bc7a1c4a1f6ac401faccd74953cf2d65291235cb..5b4760fe53de4967237d507a8d3417c75009bb87 100644 (file)
@@ -378,7 +378,7 @@ static void __init neocore926_board_init(void)
 
 MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926")
        /* Maintainer: ADENEO */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = neocore926_init_early,
index 0299554495ddb4b2a8cce40aead3827adc0d32d2..65c0d6b5ecba751bc19435083fd7c44162032ff9 100644 (file)
@@ -217,7 +217,7 @@ static void __init pcontrol_g20_board_init(void)
 
 MACHINE_START(PCONTROL_G20, "PControl G20")
        /* Maintainer: pgsellmann@portner-elektronik.at */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = pcontrol_g20_init_early,
index 4938f1cd5e13da8b35a6188d8bf854db71fe789a..ab2b2ec36c14a965bbb67aa31717c9adbe92882f 100644 (file)
@@ -119,7 +119,7 @@ static void __init picotux200_board_init(void)
 
 MACHINE_START(PICOTUX2XX, "picotux 200")
        /* Maintainer: Kleinhenz Elektronik GmbH */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = picotux200_init_early,
index 33b1628467ea4e7a8993c5eed0ecdba28b1101f5..aa3bc9b0f1504b04a84c055490bb9f4ef2b24d84 100644 (file)
@@ -257,7 +257,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(QIL_A9260, "CALAO QIL_A9260")
        /* Maintainer: calao-systems */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index 5f9ce3da3fde4f0a75cb3bd18059c31494283891..3fcb6623a33edcaa66d94de8c9832dab28392e9d 100644 (file)
@@ -47,7 +47,7 @@ static const char *at91rm9200_dt_board_compat[] __initdata = {
 };
 
 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = at91rm9200_dt_initialize,
index 9e5061bef0d0630a2ecd1028e2f7d9ae641c9e1b..690541b18cbce211b9e9db4ab22efeec590d46ca 100644 (file)
@@ -219,7 +219,7 @@ static void __init dk_board_init(void)
 
 MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
        /* Maintainer: SAN People/Atmel */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = dk_init_early,
index 58277dbc718f6cce06f624e3823de7858c814e93..8b17dadc1aba23766c954614fadf894c1dc8ec9d 100644 (file)
@@ -186,7 +186,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
        /* Maintainer: SAN People/Atmel */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index 2e8b8339a206473476c7553da218adf2be408374..f6d7f1958c7e5822661ac6517f48aa4de21a7247 100644 (file)
@@ -222,7 +222,7 @@ static void __init rsi_ews_board_init(void)
 
 MACHINE_START(RSI_EWS, "RSI EWS")
        /* Maintainer: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = rsi_ews_init_early,
index b75fbf6003a174fbe297a776b14e1645915f5b5c..43ee4dc43b50f8851a423721315a3a7f22b8091d 100644 (file)
@@ -218,7 +218,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
        /* Maintainer: Olimex */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index f0135cd1d8587b9690bd4e6ebba3977961da2368..0b153c87521d8e73feaf6b9bc53291431bc6b7a8 100644 (file)
@@ -343,7 +343,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
        /* Maintainer: Atmel */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index 13ebaa8e4100e6c292ae61320cf05eae01f119c0..b446645c772761d28dcf2c7af2a87756142f0285 100644 (file)
@@ -612,7 +612,7 @@ MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
 MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
 #endif
        /* Maintainer: Atmel */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index 89b9608742a725cfc6e5de798cdd3bb9b7811955..3284df05df14be82b8bf7acce98ef090ccf09b56 100644 (file)
@@ -443,7 +443,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
        /* Maintainer: Atmel */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index 1b7dd9f688d36b14f772725dbc7c6c079c4d64f9..f9cd1f2c71469f6ee3809981c643aaebdd439d7b 100644 (file)
@@ -409,7 +409,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK")
        /* Maintainer: Atmel */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
@@ -419,7 +419,7 @@ MACHINE_END
 
 MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod")
        /* Maintainer: Atmel */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index e4cc375e3a328669ae12facc3c9c3761eb3a84cc..2a94896a1375029b8eb34e030981480ad35acd10 100644 (file)
@@ -502,7 +502,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK")
        /* Maintainer: Atmel */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index 377a1097afa71dd29b03092294b1797501615873..aa265dcf212875651da778e9213177b7e41803de 100644 (file)
@@ -320,7 +320,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
        /* Maintainer: Atmel */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index 98771500ddb9737c2caed94d0d595b9d1db94f05..3aaa9784cf0ec1850a1f82e474ab7471c1011650 100644 (file)
@@ -177,7 +177,7 @@ static void __init snapper9260_board_init(void)
 }
 
 MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module")
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = snapper9260_init_early,
index 48a962b61fa39798ed325b3e8587491c20d56d14..a033b8df9fb2b147965c95a7393958c832180983 100644 (file)
@@ -272,7 +272,7 @@ static void __init stamp9g20evb_board_init(void)
 
 MACHINE_START(PORTUXG20, "taskit PortuxG20")
        /* Maintainer: taskit GmbH */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = stamp9g20_init_early,
@@ -282,7 +282,7 @@ MACHINE_END
 
 MACHINE_START(STAMP9G20, "taskit Stamp9G20")
        /* Maintainer: taskit GmbH */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = stamp9g20_init_early,
index c1060f96e5898a7ae97e5b75ee857031fbaae3e1..2487d944a1bcdbb0ca88c7ef2e240ea65fdce22f 100644 (file)
@@ -355,7 +355,7 @@ static void __init ek_board_init(void)
 
 MACHINE_START(USB_A9263, "CALAO USB_A9263")
        /* Maintainer: calao-systems */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
@@ -365,7 +365,7 @@ MACHINE_END
 
 MACHINE_START(USB_A9260, "CALAO USB_A9260")
        /* Maintainer: calao-systems */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
@@ -375,7 +375,7 @@ MACHINE_END
 
 MACHINE_START(USB_A9G20, "CALAO USB_A92G0")
        /* Maintainer: Jean-Christophe PLAGNIOL-VILLARD */
-       .timer          = &at91sam926x_timer,
+       .init_time      = at91sam926x_pit_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = ek_init_early,
index 8673aebcb85d71c17e8dade0222c3866bed0228e..be083771df2e813ba055aa05237bb56aa99d4d86 100644 (file)
@@ -587,7 +587,7 @@ static void __init yl9200_board_init(void)
 
 MACHINE_START(YL9200, "uCdragon YL-9200")
        /* Maintainer: S.Birtles */
-       .timer          = &at91rm9200_timer,
+       .init_time      = at91rm9200_timer_init,
        .map_io         = at91_map_io,
        .handle_irq     = at91_aic_handle_irq,
        .init_early     = yl9200_init_early,
index fc593d615e7d3dee678a1a2f67f6fc446c9aa853..78ab06548658d7eb0c705022053a86f0ccee539f 100644 (file)
@@ -36,12 +36,11 @@ extern int  __init at91_aic5_of_init(struct device_node *node,
 
 
  /* Timer */
-struct sys_timer;
 extern void at91rm9200_ioremap_st(u32 addr);
-extern struct sys_timer at91rm9200_timer;
+extern void at91rm9200_timer_init(void);
 extern void at91sam926x_ioremap_pit(u32 addr);
-extern struct sys_timer at91sam926x_timer;
-extern struct sys_timer at91x40_timer;
+extern void at91sam926x_pit_init(void);
+extern void at91x40_timer_init(void);
 
  /* Clocks */
 #ifdef CONFIG_AT91_PMC_UNIT
index 3a62f1b1cabcbf16cb4886b997bb7eb2e9a2ad21..f0f9abafad293f10390df92fed62f236ba97e6a3 100644 (file)
  * GNU General Public License for more details.
  */
 
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
+#include <linux/irqchip.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
-
 #include <asm/mach/time.h>
 
-static const struct of_device_id irq_match[] = {
-       {.compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       {}
-};
-
 static void timer_init(void)
 {
 }
 
-static struct sys_timer timer = {
-       .init = timer_init,
-};
-
-static void __init init_irq(void)
-{
-       of_irq_init(irq_match);
-}
 
 static void __init board_init(void)
 {
@@ -49,9 +34,8 @@ static void __init board_init(void)
 static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, };
 
 DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor")
-       .init_irq = init_irq,
-       .timer = &timer,
+       .init_irq = irqchip_init,
+       .init_time = timer_init,
        .init_machine = board_init,
        .dt_compat = bcm11351_dt_compat,
-       .handle_irq = gic_handle_irq,
 MACHINE_END
index f0d739f4b7a36a3d2e0f9e4781c86568af8a6c09..1a446a164c8c23efb99881a7c7459f5b1a78763a 100644 (file)
 #include <mach/bcm2835_soc.h>
 
 #define PM_RSTC                                0x1c
+#define PM_RSTS                                0x20
 #define PM_WDOG                                0x24
 
 #define PM_PASSWORD                    0x5a000000
 #define PM_RSTC_WRCFG_MASK             0x00000030
 #define PM_RSTC_WRCFG_FULL_RESET       0x00000020
+#define PM_RSTS_HADWRH_SET             0x00000040
 
 static void __iomem *wdt_regs;
 
@@ -67,6 +69,29 @@ static void bcm2835_restart(char mode, const char *cmd)
        mdelay(1);
 }
 
+/*
+ * We can't really power off, but if we do the normal reset scheme, and
+ * indicate to bootcode.bin not to reboot, then most of the chip will be
+ * powered off.
+ */
+static void bcm2835_power_off(void)
+{
+       u32 val;
+
+       /*
+        * We set the watchdog hard reset bit here to distinguish this reset
+        * from the normal (full) reset. bootcode.bin will not reboot after a
+        * hard reset.
+        */
+       val = readl_relaxed(wdt_regs + PM_RSTS);
+       val &= ~PM_RSTC_WRCFG_MASK;
+       val |= PM_PASSWORD | PM_RSTS_HADWRH_SET;
+       writel_relaxed(val, wdt_regs + PM_RSTS);
+
+       /* Continue with normal reset mechanism */
+       bcm2835_restart(0, "");
+}
+
 static struct map_desc io_map __initdata = {
        .virtual = BCM2835_PERIPH_VIRT,
        .pfn = __phys_to_pfn(BCM2835_PERIPH_PHYS),
@@ -84,6 +109,9 @@ static void __init bcm2835_init(void)
        int ret;
 
        bcm2835_setup_restart();
+       if (wdt_regs)
+               pm_power_off = bcm2835_power_off;
+
        bcm2835_init_clocks();
 
        ret = of_platform_populate(NULL, of_default_bus_match_table, NULL,
@@ -104,7 +132,7 @@ DT_MACHINE_START(BCM2835, "BCM2835")
        .init_irq = bcm2835_init_irq,
        .handle_irq = bcm2835_handle_irq,
        .init_machine = bcm2835_init,
-       .timer = &bcm2835_timer,
+       .init_time = bcm2835_timer_init,
        .restart = bcm2835_restart,
        .dt_compat = bcm2835_compat
 MACHINE_END
index 3fbf43f725895868a98750294e87eddca33fdd25..f38584709df7738ce629de8b3e063317909f6363 100644 (file)
@@ -170,7 +170,7 @@ MACHINE_START(AUTCPU12, "autronix autcpu12")
        .nr_irqs        = CLPS711X_NR_IRQS,
        .map_io         = clps711x_map_io,
        .init_irq       = clps711x_init_irq,
-       .timer          = &clps711x_timer,
+       .init_time      = clps711x_timer_init,
        .init_machine   = autcpu12_init,
        .init_late      = autcpu12_init_late,
        .handle_irq     = clps711x_handle_irq,
index 60900ddf97c93fa09bc53649298a38cf32743e04..baab7da33c9b62b1351d43ae9be6e953c8fb7446 100644 (file)
@@ -140,7 +140,7 @@ MACHINE_START(CDB89712, "Cirrus-CDB89712")
        .nr_irqs        = CLPS711X_NR_IRQS,
        .map_io         = clps711x_map_io,
        .init_irq       = clps711x_init_irq,
-       .timer          = &clps711x_timer,
+       .init_time      = clps711x_timer_init,
        .init_machine   = cdb89712_init,
        .handle_irq     = clps711x_handle_irq,
        .restart        = clps711x_restart,
index 0b32a487183bb308702b4677686f66ddb3080fdc..014aa3c19a033856aeb4ffa867cc0ed35512169b 100644 (file)
@@ -40,7 +40,7 @@ MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
        .fixup          = fixup_clep7312,
        .map_io         = clps711x_map_io,
        .init_irq       = clps711x_init_irq,
-       .timer          = &clps711x_timer,
+       .init_time      = clps711x_timer_init,
        .handle_irq     = clps711x_handle_irq,
        .restart        = clps711x_restart,
 MACHINE_END
index 71aa5cf2c0d37a641f9599b371a5dd993c0d0202..5f928e9ed2efdfd5e665eac6f8e0224dc1c3e3a1 100644 (file)
@@ -173,7 +173,7 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
        .reserve        = edb7211_reserve,
        .map_io         = edb7211_map_io,
        .init_irq       = clps711x_init_irq,
-       .timer          = &clps711x_timer,
+       .init_time      = clps711x_timer_init,
        .init_machine   = edb7211_init,
        .handle_irq     = clps711x_handle_irq,
        .restart        = clps711x_restart,
index 7d01255803660f84141503b39321aaf551a9b655..c5675efc8c6a0d98cc9834cc20059ec57709c326 100644 (file)
@@ -78,7 +78,7 @@ MACHINE_START(FORTUNET, "ARM-FortuNet")
        .fixup          = fortunet_fixup,
        .map_io         = clps711x_map_io,
        .init_irq       = clps711x_init_irq,
-       .timer          = &clps711x_timer,
+       .init_time      = clps711x_timer_init,
        .handle_irq     = clps711x_handle_irq,
        .restart        = clps711x_restart,
 MACHINE_END
index 1518fc83babd9af2b7efefd1c6ff8fe1170843a8..8d3ee67711356c6da73c701c0e52c47540f370a2 100644 (file)
@@ -224,7 +224,7 @@ MACHINE_START(P720T, "ARM-Prospector720T")
        .map_io         = p720t_map_io,
        .init_early     = p720t_init_early,
        .init_irq       = clps711x_init_irq,
-       .timer          = &clps711x_timer,
+       .init_time      = clps711x_timer_init,
        .init_machine   = p720t_init,
        .init_late      = p720t_init_late,
        .handle_irq     = clps711x_handle_irq,
index e046439573ee366a8fa1df23e4f615388cf96bc1..20ff50f3ccf04afb34361e4e84edbbbfed371601 100644 (file)
@@ -282,7 +282,7 @@ static void add_fixed_clk(struct clk *clk, const char *name, int rate)
        clk_register_clkdev(clk, name, NULL);
 }
 
-static void __init clps711x_timer_init(void)
+void __init clps711x_timer_init(void)
 {
        int osc, ext, pll, cpu, bus, timl, timh, uart, spi;
        u32 tmp;
@@ -345,10 +345,6 @@ static void __init clps711x_timer_init(void)
        setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
 }
 
-struct sys_timer clps711x_timer = {
-       .init           = clps711x_timer_init,
-};
-
 void clps711x_restart(char mode, const char *cmd)
 {
        soft_restart(0);
index b7c0c75c90c01a9a638769d4e434fbe5d27f4e4c..f84a7292c70e4a77dc64eeda432266c1a6b7ac4b 100644 (file)
@@ -8,10 +8,8 @@
 #define CLPS711X_NR_GPIO       (4 * 8 + 3)
 #define CLPS711X_GPIO(prt, bit)        ((prt) * 8 + (bit))
 
-struct sys_timer;
-
 extern void clps711x_map_io(void);
 extern void clps711x_init_irq(void);
+extern void clps711x_timer_init(void);
 extern void clps711x_handle_irq(struct pt_regs *regs);
 extern void clps711x_restart(char mode, const char *cmd);
-extern struct sys_timer clps711x_timer;
index ae305397003c767422c5237dd5d255e8f75ab9fd..a71867e1d8d6c58b591909facb33598bcfc57543 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/usb/ohci_pdriver.h>
 #include <asm/setup.h>
 #include <asm/mach-types.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
@@ -250,8 +249,7 @@ MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
        .atag_offset    = 0x100,
        .map_io         = cns3420_map_io,
        .init_irq       = cns3xxx_init_irq,
-       .timer          = &cns3xxx_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = cns3xxx_timer_init,
        .init_machine   = cns3420_init,
        .restart        = cns3xxx_restart,
 MACHINE_END
index 031805b1428dc1d6196d7201637ad05e865c9553..e698f26cc0cb5ed6bd3a62b7effb39b70d619376 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/clockchips.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <mach/cns3xxx.h>
 #include "core.h"
@@ -134,7 +134,6 @@ static int cns3xxx_timer_set_next_event(unsigned long evt,
 
 static struct clock_event_device cns3xxx_tmr1_clockevent = {
        .name           = "cns3xxx timer1",
-       .shift          = 8,
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .set_mode       = cns3xxx_timer_set_mode,
        .set_next_event = cns3xxx_timer_set_next_event,
@@ -145,15 +144,9 @@ static struct clock_event_device cns3xxx_tmr1_clockevent = {
 static void __init cns3xxx_clockevents_init(unsigned int timer_irq)
 {
        cns3xxx_tmr1_clockevent.irq = timer_irq;
-       cns3xxx_tmr1_clockevent.mult =
-               div_sc((cns3xxx_cpu_clock() >> 3) * 1000000, NSEC_PER_SEC,
-                      cns3xxx_tmr1_clockevent.shift);
-       cns3xxx_tmr1_clockevent.max_delta_ns =
-               clockevent_delta2ns(0xffffffff, &cns3xxx_tmr1_clockevent);
-       cns3xxx_tmr1_clockevent.min_delta_ns =
-               clockevent_delta2ns(0xf, &cns3xxx_tmr1_clockevent);
-
-       clockevents_register_device(&cns3xxx_tmr1_clockevent);
+       clockevents_config_and_register(&cns3xxx_tmr1_clockevent,
+                                       (cns3xxx_cpu_clock() >> 3) * 1000000,
+                                       0xf, 0xffffffff);
 }
 
 /*
@@ -235,17 +228,13 @@ static void __init __cns3xxx_timer_init(unsigned int timer_irq)
        cns3xxx_clockevents_init(timer_irq);
 }
 
-static void __init cns3xxx_timer_init(void)
+void __init cns3xxx_timer_init(void)
 {
        cns3xxx_tmr1 = IOMEM(CNS3XXX_TIMER1_2_3_BASE_VIRT);
 
        __cns3xxx_timer_init(IRQ_CNS3XXX_TIMER0);
 }
 
-struct sys_timer cns3xxx_timer = {
-       .init = cns3xxx_timer_init,
-};
-
 #ifdef CONFIG_CACHE_L2X0
 
 void __init cns3xxx_l2x0_init(void)
index 4894b8c17151330ff956ae490608728b629b4e12..b23b17b4da104fd5e27ca334218ef35b65c305a3 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __CNS3XXX_CORE_H
 #define __CNS3XXX_CORE_H
 
-extern struct sys_timer cns3xxx_timer;
+extern void cns3xxx_timer_init(void);
 
 #ifdef CONFIG_CACHE_L2X0
 void __init cns3xxx_l2x0_init(void);
index 95b5e102ceb1c34aaceb2031c59eea3e1e52e985..6da25eebf9110f3548fa8f803f0d81bf7e330b4e 100644 (file)
@@ -652,8 +652,13 @@ static __init void da830_evm_init(void)
        if (ret)
                pr_warning("da830_evm_init: rtc setup failed: %d\n", ret);
 
-       ret = da8xx_register_spi(0, da830evm_spi_info,
-                                ARRAY_SIZE(da830evm_spi_info));
+       ret = spi_register_board_info(da830evm_spi_info,
+                                     ARRAY_SIZE(da830evm_spi_info));
+       if (ret)
+               pr_warn("%s: spi info registration failed: %d\n", __func__,
+                       ret);
+
+       ret = da8xx_register_spi_bus(0, ARRAY_SIZE(da830evm_spi_info));
        if (ret)
                pr_warning("da830_evm_init: spi 0 registration failed: %d\n",
                           ret);
@@ -679,7 +684,7 @@ MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
        .atag_offset    = 0x100,
        .map_io         = da830_evm_map_io,
        .init_irq       = cp_intc_init,
-       .timer          = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine   = da830_evm_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index 0299915575a873b26b3a1499b1c5f91011d9eacf..3a76a47df39c17a9d2d6c0d5207928f39aeb03de 100644 (file)
@@ -1565,8 +1565,13 @@ static __init void da850_evm_init(void)
 
        da850_vpif_init();
 
-       ret = da8xx_register_spi(1, da850evm_spi_info,
-                                ARRAY_SIZE(da850evm_spi_info));
+       ret = spi_register_board_info(da850evm_spi_info,
+                                     ARRAY_SIZE(da850evm_spi_info));
+       if (ret)
+               pr_warn("%s: spi info registration failed: %d\n", __func__,
+                       ret);
+
+       ret = da8xx_register_spi_bus(1, ARRAY_SIZE(da850evm_spi_info));
        if (ret)
                pr_warning("da850_evm_init: spi 1 registration failed: %d\n",
                                ret);
@@ -1599,7 +1604,7 @@ MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
        .atag_offset    = 0x100,
        .map_io         = da850_evm_map_io,
        .init_irq       = cp_intc_init,
-       .timer          = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine   = da850_evm_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index cdf8d0746e799df1e31aab36d96ac8f3a116cbb2..147b8e1a4407f794052de4579ba6630f195f982b 100644 (file)
@@ -355,7 +355,7 @@ MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
        .atag_offset  = 0x100,
        .map_io       = dm355_evm_map_io,
        .init_irq     = davinci_irq_init,
-       .timer        = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine = dm355_evm_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index d41954507fc26794433d2fa248e14254b1b2f73c..dff4ddc5ef81312590cd3a2cdb1ad4b40e3741ab 100644 (file)
@@ -274,7 +274,7 @@ MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
        .atag_offset  = 0x100,
        .map_io       = dm355_leopard_map_io,
        .init_irq     = davinci_irq_init,
-       .timer        = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine = dm355_leopard_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index 5d49c75388ca9782f6a8192469d6c6a0b93c6cdc..c2d4958a0cb6a632a4d1b7b5f5bc8c56dafbc424 100644 (file)
@@ -616,7 +616,7 @@ MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
        .atag_offset    = 0x100,
        .map_io         = dm365_evm_map_io,
        .init_irq       = davinci_irq_init,
-       .timer          = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine   = dm365_evm_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index f5e018de7fa512403fbd62bcf0a82277b9727830..e4a16f98e6a2b637a327e0d1d7d9abaa02c58493 100644 (file)
@@ -825,7 +825,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
        .atag_offset  = 0x100,
        .map_io       = davinci_evm_map_io,
        .init_irq     = davinci_irq_init,
-       .timer        = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine = davinci_evm_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index 6e2f1631df5b0e1321c9d80d11beea76c8c29607..de7adff324dc4f1c9751160213ccc202070419f0 100644 (file)
@@ -818,7 +818,7 @@ MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
        .atag_offset  = 0x100,
        .map_io       = davinci_map_io,
        .init_irq     = davinci_irq_init,
-       .timer        = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine = evm_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
@@ -829,7 +829,7 @@ MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
        .atag_offset  = 0x100,
        .map_io       = davinci_map_io,
        .init_irq     = davinci_irq_init,
-       .timer        = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine = evm_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index 43e4a0d663fa8f15b002a50c0f7ac6a903b337b3..9549d53aa63f0489f741a6a7f43b83b9a2505a05 100644 (file)
@@ -529,8 +529,13 @@ static void __init mityomapl138_init(void)
 
        mityomapl138_setup_nand();
 
-       ret = da8xx_register_spi(1, mityomapl138_spi_flash_info,
-                              ARRAY_SIZE(mityomapl138_spi_flash_info));
+       ret = spi_register_board_info(mityomapl138_spi_flash_info,
+                                     ARRAY_SIZE(mityomapl138_spi_flash_info));
+       if (ret)
+               pr_warn("spi info registration failed: %d\n", ret);
+
+       ret = da8xx_register_spi_bus(1,
+                                    ARRAY_SIZE(mityomapl138_spi_flash_info));
        if (ret)
                pr_warning("spi 1 registration failed: %d\n", ret);
 
@@ -570,7 +575,7 @@ MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
        .atag_offset    = 0x100,
        .map_io         = mityomapl138_map_io,
        .init_irq       = cp_intc_init,
-       .timer          = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine   = mityomapl138_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index 3e3e3afebf886d179f2e9fef5cf00013af54f5ba..1c98107527fa5a0d83353f058660a1a48fc228c2 100644 (file)
@@ -237,7 +237,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
        .atag_offset    = 0x100,
        .map_io          = davinci_ntosd2_map_io,
        .init_irq       = davinci_irq_init,
-       .timer          = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine = davinci_ntosd2_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index dc1208e9e664649718f2e2f4935cd5e9cc5dc86e..deb3922612b95856ba6c7155de97497b4873bd9a 100644 (file)
@@ -341,7 +341,7 @@ MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
        .atag_offset    = 0x100,
        .map_io         = omapl138_hawk_map_io,
        .init_irq       = cp_intc_init,
-       .timer          = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine   = omapl138_hawk_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index 6957787fa7f397a5670872c6b6562af60838aa32..739be7e738fe8b830c591580575a41e85e241c9e 100644 (file)
@@ -155,7 +155,7 @@ MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
        .atag_offset  = 0x100,
        .map_io       = davinci_sffsdr_map_io,
        .init_irq     = davinci_irq_init,
-       .timer        = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine = davinci_sffsdr_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index be3099733b1fb2ab6eb857998cb4a2838a49ff70..4f416023d4e2d1d09f8ab1bf18d6e4663066ad8f 100644 (file)
@@ -280,7 +280,7 @@ MACHINE_START(TNETV107X, "TNETV107X EVM")
        .atag_offset    = 0x100,
        .map_io         = tnetv107x_init,
        .init_irq       = cp_intc_init,
-       .timer          = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine   = tnetv107x_evm_board_init,
        .init_late      = davinci_init_late,
        .dma_zone_size  = SZ_128M,
index 34668ead53c73b1c70ee0b09261ba74ff8a3627b..d458558ee84a436a0506835c3ca9bdfa722798de 100644 (file)
@@ -52,6 +52,40 @@ static void __clk_disable(struct clk *clk)
                __clk_disable(clk->parent);
 }
 
+int davinci_clk_reset(struct clk *clk, bool reset)
+{
+       unsigned long flags;
+
+       if (clk == NULL || IS_ERR(clk))
+               return -EINVAL;
+
+       spin_lock_irqsave(&clockfw_lock, flags);
+       if (clk->flags & CLK_PSC)
+               davinci_psc_reset(clk->gpsc, clk->lpsc, reset);
+       spin_unlock_irqrestore(&clockfw_lock, flags);
+
+       return 0;
+}
+EXPORT_SYMBOL(davinci_clk_reset);
+
+int davinci_clk_reset_assert(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk) || !clk->reset)
+               return -EINVAL;
+
+       return clk->reset(clk, true);
+}
+EXPORT_SYMBOL(davinci_clk_reset_assert);
+
+int davinci_clk_reset_deassert(struct clk *clk)
+{
+       if (clk == NULL || IS_ERR(clk) || !clk->reset)
+               return -EINVAL;
+
+       return clk->reset(clk, false);
+}
+EXPORT_SYMBOL(davinci_clk_reset_deassert);
+
 int clk_enable(struct clk *clk)
 {
        unsigned long flags;
@@ -535,7 +569,7 @@ int davinci_set_refclk_rate(unsigned long rate)
 }
 
 int __init davinci_clk_init(struct clk_lookup *clocks)
-  {
+{
        struct clk_lookup *c;
        struct clk *clk;
        size_t num_clocks = 0;
@@ -576,6 +610,9 @@ int __init davinci_clk_init(struct clk_lookup *clocks)
                if (clk->lpsc)
                        clk->flags |= CLK_PSC;
 
+               if (clk->flags & PSC_LRST)
+                       clk->reset = davinci_clk_reset;
+
                clk_register(clk);
                num_clocks++;
 
index 46f0f1bf1a4ce9b71fd9cc88af7dcc1a3a8e2fe9..8694b395fc92602a60355bb35bd414f0137b041c 100644 (file)
@@ -103,6 +103,7 @@ struct clk {
        unsigned long (*recalc) (struct clk *);
        int (*set_rate) (struct clk *clk, unsigned long rate);
        int (*round_rate) (struct clk *clk, unsigned long rate);
+       int (*reset) (struct clk *clk, bool reset);
 };
 
 /* Clock flags: SoC-specific flags start at BIT(16) */
@@ -112,6 +113,7 @@ struct clk {
 #define PRE_PLL                        BIT(4) /* source is before PLL mult/div */
 #define PSC_SWRSTDISABLE       BIT(5) /* Disable state is SwRstDisable */
 #define PSC_FORCE              BIT(6) /* Force module state transtition */
+#define PSC_LRST               BIT(8) /* Use local reset on enable/disable */
 
 #define CLK(dev, con, ck)      \
        {                       \
@@ -126,6 +128,7 @@ int davinci_set_pllrate(struct pll_data *pll, unsigned int prediv,
 int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate);
 int davinci_set_refclk_rate(unsigned long rate);
 int davinci_simple_set_rate(struct clk *clk, unsigned long rate);
+int davinci_clk_reset(struct clk *clk, bool reset);
 
 extern struct platform_device davinci_wdt_device;
 extern void davinci_watchdog_reset(struct platform_device *);
index 6b9154e9f9080f082442b85915d8092af06866b5..0c4a26ddebba03ec3f082ea96735551bf474d819 100644 (file)
@@ -76,6 +76,13 @@ static struct clk pll0_aux_clk = {
        .flags          = CLK_PLL | PRE_PLL,
 };
 
+static struct clk pll0_sysclk1 = {
+       .name           = "pll0_sysclk1",
+       .parent         = &pll0_clk,
+       .flags          = CLK_PLL,
+       .div_reg        = PLLDIV1,
+};
+
 static struct clk pll0_sysclk2 = {
        .name           = "pll0_sysclk2",
        .parent         = &pll0_clk,
@@ -368,10 +375,19 @@ static struct clk sata_clk = {
        .flags          = PSC_FORCE,
 };
 
+static struct clk dsp_clk = {
+       .name           = "dsp",
+       .parent         = &pll0_sysclk1,
+       .domain         = DAVINCI_GPSC_DSPDOMAIN,
+       .lpsc           = DA8XX_LPSC0_GEM,
+       .flags          = PSC_LRST | PSC_FORCE,
+};
+
 static struct clk_lookup da850_clks[] = {
        CLK(NULL,               "ref",          &ref_clk),
        CLK(NULL,               "pll0",         &pll0_clk),
        CLK(NULL,               "pll0_aux",     &pll0_aux_clk),
+       CLK(NULL,               "pll0_sysclk1", &pll0_sysclk1),
        CLK(NULL,               "pll0_sysclk2", &pll0_sysclk2),
        CLK(NULL,               "pll0_sysclk3", &pll0_sysclk3),
        CLK(NULL,               "pll0_sysclk4", &pll0_sysclk4),
@@ -413,6 +429,7 @@ static struct clk_lookup da850_clks[] = {
        CLK("spi_davinci.1",    NULL,           &spi1_clk),
        CLK("vpif",             NULL,           &vpif_clk),
        CLK("ahci",             NULL,           &sata_clk),
+       CLK("davinci-rproc.0",  NULL,           &dsp_clk),
        CLK(NULL,               NULL,           NULL),
 };
 
index 37c27af18fa0c575823bc6d62ab646ca035931f8..9a7c76efc8f8217a6332f4c5b9a9bf6bbd46671f 100644 (file)
@@ -56,7 +56,7 @@ static const char *da850_boards_compat[] __initdata = {
 DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x")
        .map_io         = da850_init,
        .init_irq       = da8xx_init_irq,
-       .timer          = &davinci_timer,
+       .init_time      = davinci_timer_init,
        .init_machine   = da850_init_machine,
        .dt_compat      = da850_boards_compat,
        .init_late      = davinci_init_late,
index 2d5502d84a223aaf9b0a05ccb80d284393c9a815..aa402bc160c80d3e329b008560bb0bc4974f57d7 100644 (file)
@@ -751,7 +751,7 @@ void __iomem * __init da8xx_get_mem_ctlr(void)
 
        da8xx_ddr2_ctlr_base = ioremap(DA8XX_DDR2_CTL_BASE, SZ_32K);
        if (!da8xx_ddr2_ctlr_base)
-               pr_warning("%s: Unable to map DDR2 controller", __func__);
+               pr_warn("%s: Unable to map DDR2 controller", __func__);
 
        return da8xx_ddr2_ctlr_base;
 }
@@ -832,7 +832,7 @@ static struct resource da8xx_spi1_resources[] = {
        },
 };
 
-struct davinci_spi_platform_data da8xx_spi_pdata[] = {
+static struct davinci_spi_platform_data da8xx_spi_pdata[] = {
        [0] = {
                .version        = SPI_VERSION_2,
                .intr_line      = 1,
@@ -866,20 +866,12 @@ static struct platform_device da8xx_spi_device[] = {
        },
 };
 
-int __init da8xx_register_spi(int instance, const struct spi_board_info *info,
-                             unsigned len)
+int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect)
 {
-       int ret;
-
        if (instance < 0 || instance > 1)
                return -EINVAL;
 
-       ret = spi_register_board_info(info, len);
-       if (ret)
-               pr_warning("%s: failed to register board info for spi %d :"
-                          " %d\n", __func__, instance, ret);
-
-       da8xx_spi_pdata[instance].num_chipselect = len;
+       da8xx_spi_pdata[instance].num_chipselect = num_chipselect;
 
        if (instance == 1 && cpu_is_davinci_da850()) {
                da8xx_spi1_resources[0].start = DA850_SPI1_BASE;
index a3b040219876646eeaf91de4bbe71e3590f6ef3b..3e8af6a0b64c6aac9f92202a0c732417167005db 100644 (file)
@@ -18,4 +18,7 @@ struct clk;
 extern int clk_register(struct clk *clk);
 extern void clk_unregister(struct clk *clk);
 
+int davinci_clk_reset_assert(struct clk *c);
+int davinci_clk_reset_deassert(struct clk *c);
+
 #endif
index 046c7238a3d6e504807a56f59a498a4507d861d8..b124b77c90c5c929d3b536ff57f9f0b4178afe93 100644 (file)
@@ -15,9 +15,7 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 
-struct sys_timer;
-
-extern struct sys_timer davinci_timer;
+extern void davinci_timer_init(void);
 
 extern void davinci_irq_init(void);
 extern void __iomem *davinci_intc_base;
index 700d311c6854f0abc3054d4a732fbf8fc522a418..1b14aea403104bf743c05ca1c54a37dd4e6534fb 100644 (file)
@@ -82,8 +82,7 @@ void __init da850_init(void);
 int da830_register_edma(struct edma_rsv_info *rsv);
 int da850_register_edma(struct edma_rsv_info *rsv[2]);
 int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
-int da8xx_register_spi(int instance,
-               const struct spi_board_info *info, unsigned len);
+int da8xx_register_spi_bus(int instance, unsigned num_chipselect);
 int da8xx_register_watchdog(void);
 int da8xx_register_usb20(unsigned mA, unsigned potpgt);
 int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
@@ -110,7 +109,6 @@ extern struct platform_device da8xx_serial_device;
 extern struct emac_platform_data da8xx_emac_pdata;
 extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
 extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
-extern struct davinci_spi_platform_data da8xx_spi_pdata[];
 
 extern struct platform_device da8xx_wdt_device;
 
index 40a0027838e81601427fbb2bc7ff04311e5300ad..0a22710493fd27f5cc2f8178741fdb0fcc1de666 100644 (file)
 
 #define MDSTAT_STATE_MASK      0x3f
 #define PDSTAT_STATE_MASK      0x1f
+#define MDCTL_LRST             BIT(8)
 #define MDCTL_FORCE            BIT(31)
 #define PDCTL_NEXT             BIT(0)
 #define PDCTL_EPCGOOD          BIT(8)
 #ifndef __ASSEMBLER__
 
 extern int davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id);
+extern void davinci_psc_reset(unsigned int ctlr, unsigned int id,
+               bool reset);
 extern void davinci_psc_config(unsigned int domain, unsigned int ctlr,
                unsigned int id, bool enable, u32 flags);
 
index d7e210f4b55c85d7e2a2fc4831fb3f0a77f72990..82fdc69d5728c7e897851d1a7ccb91a22e06cb32 100644 (file)
@@ -35,7 +35,7 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id)
        struct davinci_soc_info *soc_info = &davinci_soc_info;
 
        if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
-               pr_warning("PSC: Bad psc data: 0x%x[%d]\n",
+               pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
                                (int)soc_info->psc_bases, ctlr);
                return 0;
        }
@@ -48,6 +48,31 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id)
        return mdstat & BIT(12);
 }
 
+/* Control "reset" line associated with PSC domain */
+void davinci_psc_reset(unsigned int ctlr, unsigned int id, bool reset)
+{
+       u32 mdctl;
+       void __iomem *psc_base;
+       struct davinci_soc_info *soc_info = &davinci_soc_info;
+
+       if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
+               pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
+                               (int)soc_info->psc_bases, ctlr);
+               return;
+       }
+
+       psc_base = ioremap(soc_info->psc_bases[ctlr], SZ_4K);
+
+       mdctl = readl(psc_base + MDCTL + 4 * id);
+       if (reset)
+               mdctl &= ~MDCTL_LRST;
+       else
+               mdctl |= MDCTL_LRST;
+       writel(mdctl, psc_base + MDCTL + 4 * id);
+
+       iounmap(psc_base);
+}
+
 /* Enable or disable a PSC domain */
 void davinci_psc_config(unsigned int domain, unsigned int ctlr,
                unsigned int id, bool enable, u32 flags)
@@ -58,7 +83,7 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
        u32 next_state = PSC_STATE_ENABLE;
 
        if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) {
-               pr_warning("PSC: Bad psc data: 0x%x[%d]\n",
+               pr_warn("PSC: Bad psc data: 0x%x[%d]\n",
                                (int)soc_info->psc_bases, ctlr);
                return;
        }
index 9847938785caa5c5fdcfa134ad454ec8696bef53..bad361ec1666defa463d0c60205818bb3c875f81 100644 (file)
@@ -337,7 +337,7 @@ static struct clock_event_device clockevent_davinci = {
 };
 
 
-static void __init davinci_timer_init(void)
+void __init davinci_timer_init(void)
 {
        struct clk *timer_clk;
        struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -410,11 +410,6 @@ static void __init davinci_timer_init(void)
                timer32_config(&timers[i]);
 }
 
-struct sys_timer davinci_timer = {
-       .init   = davinci_timer_init,
-};
-
-
 /* reset board using watchdog timer */
 void davinci_watchdog_reset(struct platform_device *pdev)
 {
index 792b4e2e24f1e6d719f43376f9590a3fae813359..0dc39cf30fdd6bdb95395e6e25417a3930d46639 100644 (file)
@@ -92,6 +92,6 @@ MACHINE_START(CM_A510, "Compulab CM-A510 Board")
        .map_io         = dove_map_io,
        .init_early     = dove_init_early,
        .init_irq       = dove_init_irq,
-       .timer          = &dove_timer,
+       .init_time      = dove_timer_init,
        .restart        = dove_restart,
 MACHINE_END
index 89f4f993cd03fb4c0d4ed6eac000d1131aa351ac..0c7911b3e155bf8b9227b9b41408019c202ddaf7 100644 (file)
@@ -242,17 +242,13 @@ static int __init dove_find_tclk(void)
        return 166666667;
 }
 
-static void __init dove_timer_init(void)
+void __init dove_timer_init(void)
 {
        dove_tclk = dove_find_tclk();
        orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
                        IRQ_DOVE_BRIDGE, dove_tclk);
 }
 
-struct sys_timer dove_timer = {
-       .init = dove_timer_init,
-};
-
 /*****************************************************************************
  * Cryptographic Engines and Security Accelerator (CESA)
  ****************************************************************************/
@@ -454,7 +450,7 @@ DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
        .map_io         = dove_map_io,
        .init_early     = dove_init_early,
        .init_irq       = orion_dt_init_irq,
-       .timer          = &dove_timer,
+       .init_time      = dove_timer_init,
        .init_machine   = dove_dt_init,
        .restart        = dove_restart,
        .dt_compat      = dove_dt_board_compat,
index 1a233404b7355990fd1158da7e598e8f3125c541..ee59fba4c6d1b2950cfec98879528b034710b726 100644 (file)
@@ -14,7 +14,7 @@
 struct mv643xx_eth_platform_data;
 struct mv_sata_platform_data;
 
-extern struct sys_timer dove_timer;
+extern void dove_timer_init(void);
 
 /*
  * Basic Dove init functions used early by machine-setup.
index bc2867f113460ab810be4d70b6343134abc95c0d..76e26f949c27b20d8625ac625ad12a0fb11931e0 100644 (file)
@@ -98,6 +98,6 @@ MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
        .map_io         = dove_map_io,
        .init_early     = dove_init_early,
        .init_irq       = dove_init_irq,
-       .timer          = &dove_timer,
+       .init_time      = dove_timer_init,
        .restart        = dove_restart,
 MACHINE_END
index f0fe6b5350e2abe1ca646a84c7b5997eaa0612ba..b13cc74114db5543ab59dfcd77fb11f64c7c8fd7 100644 (file)
@@ -158,7 +158,7 @@ static void __init ebsa110_init_early(void)
  * interrupt, then the PIT counter will roll over (ie, be negative).
  * This actually works out to be convenient.
  */
-static unsigned long ebsa110_gettimeoffset(void)
+static u32 ebsa110_gettimeoffset(void)
 {
        unsigned long offset, count;
 
@@ -181,7 +181,7 @@ static unsigned long ebsa110_gettimeoffset(void)
         */
        offset = offset * (1000000 / HZ) / COUNT;
 
-       return offset;
+       return offset * 1000;
 }
 
 static irqreturn_t
@@ -213,8 +213,10 @@ static struct irqaction ebsa110_timer_irq = {
 /*
  * Set up timer interrupt.
  */
-static void __init ebsa110_timer_init(void)
+void __init ebsa110_timer_init(void)
 {
+       arch_gettimeoffset = ebsa110_gettimeoffset;
+
        /*
         * Timer 1, mode 2, LSB/MSB
         */
@@ -225,11 +227,6 @@ static void __init ebsa110_timer_init(void)
        setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq);
 }
 
-static struct sys_timer ebsa110_timer = {
-       .init           = ebsa110_timer_init,
-       .offset         = ebsa110_gettimeoffset,
-};
-
 static struct plat_serial8250_port serial_platform_data[] = {
        {
                .iobase         = 0x3f8,
@@ -328,6 +325,6 @@ MACHINE_START(EBSA110, "EBSA110")
        .map_io         = ebsa110_map_io,
        .init_early     = ebsa110_init_early,
        .init_irq       = ebsa110_init_irq,
-       .timer          = &ebsa110_timer,
+       .init_time      = ebsa110_timer_init,
        .restart        = ebsa110_restart,
 MACHINE_END
index 41383bf03d4bcc1161aa8fc617786b5d5ead783a..bda6c3a5c923c4d27715a5862f77e0cb20939251 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <mach/hardware.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -39,8 +38,7 @@ MACHINE_START(ADSSPHERE, "ADS Sphere board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = adssphere_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
index e85bf17f2d2aee7b512aefd097dc9ed7fe63fdaf..c49ed3dc1aea68eb009c5bebbbcb0328d16a4fdc 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/i2c-gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/export.h>
+#include <linux/irqchip/arm-vic.h>
 
 #include <mach/hardware.h>
 #include <linux/platform_data/video-ep93xx.h>
@@ -44,8 +45,6 @@
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 
-#include <asm/hardware/vic.h>
-
 #include "soc.h"
 
 /*************************************************************************
@@ -140,11 +139,29 @@ static struct irqaction ep93xx_timer_irq = {
        .handler        = ep93xx_timer_interrupt,
 };
 
-static void __init ep93xx_timer_init(void)
+static u32 ep93xx_gettimeoffset(void)
+{
+       int offset;
+
+       offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time;
+
+       /*
+        * Timer 4 is based on a 983.04 kHz reference clock,
+        * so dividing by 983040 gives the fraction of a second,
+        * so dividing by 0.983040 converts to uS.
+        * Refactor the calculation to avoid overflow.
+        * Finally, multiply by 1000 to give nS.
+        */
+       return (offset + (53 * offset / 3072)) * 1000;
+}
+
+void __init ep93xx_timer_init(void)
 {
        u32 tmode = EP93XX_TIMER123_CONTROL_MODE |
                    EP93XX_TIMER123_CONTROL_CLKSEL;
 
+       arch_gettimeoffset = ep93xx_gettimeoffset;
+
        /* Enable periodic HZ timer.  */
        __raw_writel(tmode, EP93XX_TIMER1_CONTROL);
        __raw_writel(TIMER1_RELOAD, EP93XX_TIMER1_LOAD);
@@ -158,21 +175,6 @@ static void __init ep93xx_timer_init(void)
        setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
 }
 
-static unsigned long ep93xx_gettimeoffset(void)
-{
-       int offset;
-
-       offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time;
-
-       /* Calculate (1000000 / 983040) * offset.  */
-       return offset + (53 * offset / 3072);
-}
-
-struct sys_timer ep93xx_timer = {
-       .init           = ep93xx_timer_init,
-       .offset         = ep93xx_gettimeoffset,
-};
-
 
 /*************************************************************************
  * EP93xx IRQ handling
index b8f53d57a2994c0972a07f80fdbf923f6b736ca1..27b14ae92c7e6e5e804e8e62deba96156ae746cc 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/platform_data/spi-ep93xx.h>
 #include <mach/gpio-ep93xx.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -276,8 +275,7 @@ MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = edb93xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -290,8 +288,7 @@ MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = edb93xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -304,8 +301,7 @@ MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = edb93xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -318,8 +314,7 @@ MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = edb93xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -332,8 +327,7 @@ MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = edb93xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -346,8 +340,7 @@ MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = edb93xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -360,8 +353,7 @@ MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = edb93xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -374,8 +366,7 @@ MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = edb93xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
index 7fd705b5efe4890895800c97bf1cd9f6703b6b7a..0cca5b1833093524d1c7468003bbae19c4f0c514 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <mach/hardware.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -39,8 +38,7 @@ MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = gesbc9312_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
index 33a5122c6dc8bac0954655a5d5795b12a0d0df85..a14e1b37beffb64033c83a4afcf0c46168dbeb8c 100644 (file)
@@ -53,7 +53,7 @@ int ep93xx_ide_acquire_gpio(struct platform_device *pdev);
 void ep93xx_ide_release_gpio(struct platform_device *pdev);
 
 void ep93xx_init_devices(void);
-extern struct sys_timer ep93xx_timer;
+extern void ep93xx_timer_init(void);
 
 void ep93xx_restart(char, const char *);
 void ep93xx_init_late(void);
index 3d7cdab725b20ec278635ac41c96c4724b65db54..373583c298255179d5b4f553d61dc9d38081e874 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <mach/hardware.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -82,8 +81,7 @@ MACHINE_START(MICRO9, "Contec Micro9-High")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = micro9_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -96,8 +94,7 @@ MACHINE_START(MICRO9M, "Contec Micro9-Mid")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = micro9_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -110,8 +107,7 @@ MACHINE_START(MICRO9L, "Contec Micro9-Lite")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = micro9_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
@@ -124,8 +120,7 @@ MACHINE_START(MICRO9S, "Contec Micro9-Slim")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = micro9_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
index 0eb3f17a6fa2ec3424c94740713305e8e433190b..36f22c1a31fe596a71c596aa21d4e589435f15ba 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/platform_data/video-ep93xx.h>
 #include <mach/gpio-ep93xx.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -83,8 +82,7 @@ MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = simone_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
index 50043eef1cf24001cc41323a9dd55355aeee3f68..aa86f86638ddcc6eab8cda6cdb986b9d6233c7c7 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/platform_data/video-ep93xx.h>
 #include <mach/gpio-ep93xx.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -176,8 +175,7 @@ MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
        .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = snappercl15_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
index 3c4c233391dc43b0d730c80d60e5bdd3319418db..61f4b5dc4d7dd9ad8d6802606b47d2117be314cc 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <mach/hardware.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
@@ -246,8 +245,7 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
        .atag_offset    = 0x100,
        .map_io         = ts72xx_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = ts72xx_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
index ba92e25e3016163abbc8b83ef11f4753e0ffc940..605956fd07a2bdc7e133f07b7e8000b333fd566b 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/platform_data/spi-ep93xx.h>
 #include <mach/gpio-ep93xx.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
@@ -364,8 +363,7 @@ MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
        .atag_offset    = 0x100,
        .map_io         = vision_map_io,
        .init_irq       = ep93xx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &ep93xx_timer,
+       .init_time      = ep93xx_timer_init,
        .init_machine   = vision_init_machine,
        .init_late      = ep93xx_init_late,
        .restart        = ep93xx_restart,
index 1a89824a5f781bfef84f7afc9167c41874198798..4ea80bc4ef9bb466a8978b0ff89c9ff6dbc6f20e 100644 (file)
 #include <linux/of_irq.h>
 #include <linux/export.h>
 #include <linux/irqdomain.h>
+#include <linux/irqchip.h>
 #include <linux/of_address.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/proc-fns.h>
 #include <asm/exception.h>
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
 #include <asm/cacheflush.h>
@@ -644,8 +645,6 @@ static int __init combiner_of_init(struct device_node *np,
 }
 
 static const struct of_device_id exynos_dt_irq_match[] = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
        { .compatible = "samsung,exynos4210-combiner",
                        .data = combiner_of_init, },
        {},
@@ -661,8 +660,10 @@ void __init exynos4_init_irq(void)
        if (!of_have_populated_dt())
                gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL);
 #ifdef CONFIG_OF
-       else
+       else {
+               irqchip_init();
                of_irq_init(exynos_dt_irq_match);
+       }
 #endif
 
        if (!of_have_populated_dt())
@@ -679,6 +680,7 @@ void __init exynos4_init_irq(void)
 void __init exynos5_init_irq(void)
 {
 #ifdef CONFIG_OF
+       irqchip_init();
        of_irq_init(exynos_dt_irq_match);
 #endif
        /*
index 04744f9c120fe2d4d5c5a251c5f4acb8d6eea61c..12f2f1117e998a2e52449db5a2af9fc2017ec084 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
 #define __ARCH_ARM_MACH_EXYNOS_COMMON_H
 
-extern struct sys_timer exynos4_timer;
+extern void exynos4_timer_init(void);
 
 struct map_desc;
 void exynos_init_io(struct map_desc *mach_desc, int size);
index 9c7b4bfd546f0982f173cd51afbe4bbda9f7c6b7..f2b50506b9f6776cdf28c5d995aa5325355080f7 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef __ASM_ARCH_REGS_IRQ_H
 #define __ASM_ARCH_REGS_IRQ_H __FILE__
 
-#include <asm/hardware/gic.h>
+#include <linux/irqchip/arm-gic.h>
 #include <mach/map.h>
 
 #endif /* __ASM_ARCH_REGS_IRQ_H */
index b938f9fc1dd1288d781241366daaa90d65582907..685f29173afa8295313ab2e6320a2d029fb90ff2 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/smsc911x.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <plat/cpu.h>
@@ -201,9 +200,8 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = armlex4210_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = armlex4210_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .restart        = exynos4_restart,
 MACHINE_END
index 92757ff817ae1de50c9405b70b339739265ef14e..112d10e53d203c6a4a32ae1644f67220a1680d7a 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/serial_core.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <mach/map.h>
 
 #include <plat/cpu.h>
@@ -107,10 +106,9 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = exynos4_dt_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = exynos4_dt_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .dt_compat      = exynos4_dt_compat,
        .restart        = exynos4_restart,
 MACHINE_END
index e99d3d8f2bcf436ab52a07f5c8d1d7ad519d8467..0deeecffa3aef2c5992c3998078f7b2ffc09ecf8 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/io.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <mach/map.h>
 #include <mach/regs-pmu.h>
 
@@ -179,10 +178,9 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
        .init_irq       = exynos5_init_irq,
        .smp            = smp_ops(exynos_smp_ops),
        .map_io         = exynos5_dt_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = exynos5_dt_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .dt_compat      = exynos5_dt_compat,
        .restart        = exynos5_restart,
        .reserve        = exynos5_reserve,
index 27d4ed8b116e7972ca7c2539ddf1ef8a3896afe2..b8b3fbf0bae73508ce00d989130f48824dc6077c 100644 (file)
@@ -39,7 +39,6 @@
 #include <media/v4l2-mediabus.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <plat/adc.h>
@@ -1379,10 +1378,9 @@ MACHINE_START(NURI, "NURI")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = nuri_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = nuri_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .reserve        = &nuri_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index 5e34b9c16196c4d7009d90e5bb55a596c918ee20..579d2d171daa6e4ea21f56611dda80f536d41133 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/platform_data/usb-exynos.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <video/platform_lcd.h>
@@ -814,10 +813,9 @@ MACHINE_START(ORIGEN, "ORIGEN")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = origen_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = origen_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .reserve        = &origen_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index ae6da40c2aa9e168e9bb338b91556985089e5e4f..fe6149624b849aa2dd624115711e1eb1e9fcbee6 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/platform_data/s3c-hsotg.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <video/samsung_fimd.h>
@@ -376,9 +375,8 @@ MACHINE_START(SMDK4212, "SMDK4212")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = smdk4x12_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = smdk4x12_machine_init,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .restart        = exynos4_restart,
        .reserve        = &smdk4x12_reserve,
 MACHINE_END
@@ -390,10 +388,9 @@ MACHINE_START(SMDK4412, "SMDK4412")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = smdk4x12_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = smdk4x12_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .restart        = exynos4_restart,
        .reserve        = &smdk4x12_reserve,
 MACHINE_END
index 35548e3c097d8e34916d027457ec6baa2d02b903..d71672922b191c7270a1dfa3fcdb28718e1bbf66 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/platform_data/usb-exynos.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <video/platform_lcd.h>
@@ -423,9 +422,8 @@ MACHINE_START(SMDKV310, "SMDKV310")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = smdkv310_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = smdkv310_machine_init,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
@@ -436,10 +434,9 @@ MACHINE_START(SMDKC210, "SMDKC210")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = smdkv310_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = smdkv310_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .reserve        = &smdkv310_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index 9e3340f1895069803f86ab383a23307b6ab97dac..c9d33a43103e81bc1623aea71b239cc7bb4e5da2 100644 (file)
@@ -29,7 +29,6 @@
 #include <drm/exynos_drm.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 
 #include <video/samsung_fimd.h>
@@ -1151,10 +1150,9 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
        .smp            = smp_ops(exynos_smp_ops),
        .init_irq       = exynos4_init_irq,
        .map_io         = universal_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = universal_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &s5p_timer,
+       .init_time      = s5p_timer_init,
        .reserve        = &universal_reserve,
        .restart        = exynos4_restart,
 MACHINE_END
index 57668eb68e751b6b1a3961d989072bd1fbcda323..c9d6650f9b5dec4cc4d5f9c7f3f4c2b87661a811 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/of.h>
 
 #include <asm/arch_timer.h>
-#include <asm/hardware/gic.h>
 #include <asm/localtimer.h>
 
 #include <plat/cpu.h>
@@ -255,13 +254,9 @@ static struct irqaction mct_comp_event_irq = {
 
 static void exynos4_clockevent_init(void)
 {
-       clockevents_calc_mult_shift(&mct_comp_device, clk_rate, 5);
-       mct_comp_device.max_delta_ns =
-               clockevent_delta2ns(0xffffffff, &mct_comp_device);
-       mct_comp_device.min_delta_ns =
-               clockevent_delta2ns(0xf, &mct_comp_device);
        mct_comp_device.cpumask = cpumask_of(0);
-       clockevents_register_device(&mct_comp_device);
+       clockevents_config_and_register(&mct_comp_device, clk_rate,
+                                       0xf, 0xffffffff);
 
        if (soc_is_exynos5250())
                setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq);
@@ -404,14 +399,8 @@ static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt)
        evt->set_mode = exynos4_tick_set_mode;
        evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
        evt->rating = 450;
-
-       clockevents_calc_mult_shift(evt, clk_rate / (TICK_BASE_CNT + 1), 5);
-       evt->max_delta_ns =
-               clockevent_delta2ns(0x7fffffff, evt);
-       evt->min_delta_ns =
-               clockevent_delta2ns(0xf, evt);
-
-       clockevents_register_device(evt);
+       clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
+                                       0xf, 0x7fffffff);
 
        exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
 
@@ -478,7 +467,7 @@ static void __init exynos4_timer_resources(void)
 #endif /* CONFIG_LOCAL_TIMERS */
 }
 
-static void __init exynos_timer_init(void)
+void __init exynos4_timer_init(void)
 {
        if (soc_is_exynos5440()) {
                arch_timer_of_register();
@@ -494,7 +483,3 @@ static void __init exynos_timer_init(void)
        exynos4_clocksource_init();
        exynos4_clockevent_init();
 }
-
-struct sys_timer exynos4_timer = {
-       .init           = exynos_timer_init,
-};
index c5c840e947b88030156c95c99933891a43416974..60f7c5be057d3c2440f7613b4ccdecd897753249 100644 (file)
@@ -20,9 +20,9 @@
 #include <linux/jiffies.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/cacheflush.h>
-#include <asm/hardware/gic.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_scu.h>
 
@@ -149,7 +149,7 @@ static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct
 
                __raw_writel(virt_to_phys(exynos4_secondary_startup),
                                                        cpu_boot_reg(phys_cpu));
-               gic_raise_softirq(cpumask_of(cpu), 0);
+               arch_send_wakeup_ipi_mask(cpumask_of(cpu));
 
                if (pen_release == -1)
                        break;
@@ -190,8 +190,6 @@ static void __init exynos_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
index 25b453601accc98e403f061b66762df8be65389f..6987a09ec219d3bfd77c97c46a327b7602cd0c68 100644 (file)
@@ -90,6 +90,6 @@ MACHINE_START(CATS, "Chalice-CATS")
        .fixup          = fixup_cats,
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
-       .timer          = &isa_timer,
+       .init_time      = isa_timer_init,
        .restart        = footbridge_restart,
 MACHINE_END
index c9767b892cb2135676e9dd1a82f3af2610c77965..a846e50a07b897859db3c3e7ebfe33dd5b11ef84 100644 (file)
@@ -1,6 +1,6 @@
 
-extern struct sys_timer footbridge_timer;
-extern struct sys_timer isa_timer;
+extern void footbridge_timer_init(void);
+extern void isa_timer_init(void);
 
 extern void isa_rtc_init(void);
 
index 3b54196447c71341b31112ac378abae4ebd8f53f..9ee78f7b4990751386cf7f29337ec075297349dd 100644 (file)
@@ -93,7 +93,7 @@ static struct irqaction footbridge_timer_irq = {
 /*
  * Set up timer interrupt.
  */
-static void __init footbridge_timer_init(void)
+void __init footbridge_timer_init(void)
 {
        struct clock_event_device *ce = &ckevt_dc21285;
 
@@ -101,14 +101,6 @@ static void __init footbridge_timer_init(void)
 
        setup_irq(ce->irq, &footbridge_timer_irq);
 
-       clockevents_calc_mult_shift(ce, mem_fclk_21285, 5);
-       ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce);
-       ce->min_delta_ns = clockevent_delta2ns(0x000004, ce);
        ce->cpumask = cpumask_of(smp_processor_id());
-
-       clockevents_register_device(ce);
+       clockevents_config_and_register(ce, mem_fclk_21285, 0x4, 0xffffff);
 }
-
-struct sys_timer footbridge_timer = {
-       .init           = footbridge_timer_init,
-};
index b09551ef89ca39163c7fa4823af36be57ca4f92c..b08243500e2e9bc8f7196d6e6c5484b3ba7dadb4 100644 (file)
@@ -101,7 +101,7 @@ MACHINE_START(EBSA285, "EBSA285")
        .video_end      = 0x000bffff,
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
-       .timer          = &footbridge_timer,
+       .init_time      = footbridge_timer_init,
        .restart        = footbridge_restart,
 MACHINE_END
 
index c40bb415f4b59bc1992a08a6a2b8547c8a835399..d9301dd563547b4a838275ff57e349b14b224e13 100644 (file)
@@ -31,14 +31,10 @@ static struct irqaction pit_timer_irq = {
        .dev_id         = &i8253_clockevent,
 };
 
-static void __init isa_timer_init(void)
+void __init isa_timer_init(void)
 {
        clocksource_i8253_init();
 
        setup_irq(i8253_clockevent.irq, &pit_timer_irq);
        clockevent_i8253_init(false);
 }
-
-struct sys_timer isa_timer = {
-       .init           = isa_timer_init,
-};
index d2d14339c6c4b9cda4382a9c946ca847a0ce69b1..90ea23fdce4c919ef6560fc3a87b1beaebde78f0 100644 (file)
@@ -766,6 +766,6 @@ MACHINE_START(NETWINDER, "Rebel-NetWinder")
        .fixup          = fixup_netwinder,
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
-       .timer          = &isa_timer,
+       .init_time      = isa_timer_init,
        .restart        = netwinder_restart,
 MACHINE_END
index e1e9990fa95724388877fa5b1f317b45251c9246..7bdeabdcd4d8876f602a1548baa2cf29b3a3cdee 100644 (file)
@@ -18,7 +18,7 @@ MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
        .atag_offset    = 0x100,
        .map_io         = footbridge_map_io,
        .init_irq       = footbridge_init_irq,
-       .timer          = &footbridge_timer,
+       .init_time      = footbridge_timer_init,
        .restart        = footbridge_restart,
 MACHINE_END
 
index 5927d3c253aaf3c5fe3d6be2bfa5f69452ea1119..08bd650c42f3e9cca2c66eb04c3dce163ebbe715 100644 (file)
 
 #include "common.h"
 
-static struct sys_timer ib4220b_timer = {
-       .init   = gemini_timer_init,
-};
-
 static struct gpio_led ib4220b_leds[] = {
        {
                .name                   = "nas4220b:orange:hdd",
@@ -105,6 +101,6 @@ MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
        .atag_offset    = 0x100,
        .map_io         = gemini_map_io,
        .init_irq       = gemini_init_irq,
-       .timer          = &ib4220b_timer,
+       .init_time      = gemini_timer_init,
        .init_machine   = ib4220b_init,
 MACHINE_END
index cd7437a1cea08122eae0533d6a0975cbb1332edf..fa0a36337f4d83dc0d78520e2a1e35775d4b29d2 100644 (file)
@@ -71,10 +71,6 @@ static struct platform_device rut1xx_leds = {
        },
 };
 
-static struct sys_timer rut1xx_timer = {
-       .init   = gemini_timer_init,
-};
-
 static void __init rut1xx_init(void)
 {
        gemini_gpio_init();
@@ -89,6 +85,6 @@ MACHINE_START(RUT100, "Teltonika RUT100")
        .atag_offset    = 0x100,
        .map_io         = gemini_map_io,
        .init_irq       = gemini_init_irq,
-       .timer          = &rut1xx_timer,
+       .init_time      = gemini_timer_init,
        .init_machine   = rut1xx_init,
 MACHINE_END
index a367880368f1c6c45982596fcab4f1f97c6c0e6b..3321cd6cc1f3c60d1c358b316c3562b41b605b70 100644 (file)
@@ -80,10 +80,6 @@ static struct platform_device wbd111_leds_device = {
        },
 };
 
-static struct sys_timer wbd111_timer = {
-       .init   = gemini_timer_init,
-};
-
 static struct mtd_partition wbd111_partitions[] = {
        {
                .name           = "RedBoot",
@@ -132,6 +128,6 @@ MACHINE_START(WBD111, "Wiliboard WBD-111")
        .atag_offset    = 0x100,
        .map_io         = gemini_map_io,
        .init_irq       = gemini_init_irq,
-       .timer          = &wbd111_timer,
+       .init_time      = gemini_timer_init,
        .init_machine   = wbd111_init,
 MACHINE_END
index f382811c1319a39ef3c6f12f9eda9c4b07539357..fe33c825fdaf57412e11b498721349958a3be8f4 100644 (file)
@@ -80,10 +80,6 @@ static struct platform_device wbd222_leds_device = {
        },
 };
 
-static struct sys_timer wbd222_timer = {
-       .init   = gemini_timer_init,
-};
-
 static struct mtd_partition wbd222_partitions[] = {
        {
                .name           = "RedBoot",
@@ -132,6 +128,6 @@ MACHINE_START(WBD222, "Wiliboard WBD-222")
        .atag_offset    = 0x100,
        .map_io         = gemini_map_io,
        .init_irq       = gemini_init_irq,
-       .timer          = &wbd222_timer,
+       .init_time      = gemini_timer_init,
        .init_machine   = wbd222_init,
 MACHINE_END
index aa1331e86bcf4fb52f255b45164c5783f01cc634..17ef91fa3d56d819c64a943a08ae55f5bf60613e 100644 (file)
@@ -42,12 +42,12 @@ void __init arch_dma_init(dma_t *dma)
 }
 
 /*
- * Return usecs since last timer reload
+ * Return nsecs since last timer reload
  * (timercount * (usecs perjiffie)) / (ticks per jiffie)
  */
-unsigned long h720x_gettimeoffset(void)
+u32 h720x_gettimeoffset(void)
 {
-       return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH;
+       return ((CPU_REG(TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH) * 1000;
 }
 
 /*
index 2489537d33ddb5722e1772283e670da0cb0ff9ab..7e738410ca93d22be10bbc16c0476dfe3697fb72 100644 (file)
  *
  */
 
-extern unsigned long h720x_gettimeoffset(void);
+extern u32 h720x_gettimeoffset(void);
 extern void __init h720x_init_irq(void);
 extern void __init h720x_map_io(void);
 extern void h720x_restart(char, const char *);
 
 #ifdef CONFIG_ARCH_H7202
-extern struct sys_timer h7202_timer;
+extern void h7202_timer_init(void);
 extern void __init init_hw_h7202(void);
 extern void __init h7202_init_irq(void);
 extern void __init h7202_init_time(void);
 #endif
 
 #ifdef CONFIG_ARCH_H7201
-extern struct sys_timer h7201_timer;
+extern void h7201_timer_init(void);
 #endif
index 24df2a349a986a5afd4ec18a3dc4dabe0f23f37a..13c74121538762572963ea797300eea3b41013f1 100644 (file)
@@ -44,8 +44,10 @@ static struct irqaction h7201_timer_irq = {
 /*
  * Setup TIMER0 as system timer
  */
-void __init h7201_init_time(void)
+void __init h7201_timer_init(void)
 {
+       arch_gettimeoffset = h720x_gettimeoffset;
+
        CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
        CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
        CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
@@ -53,8 +55,3 @@ void __init h7201_init_time(void)
 
        setup_irq(IRQ_TIMER0, &h7201_timer_irq);
 }
-
-struct sys_timer h7201_timer = {
-       .init           = h7201_init_time,
-       .offset         = h720x_gettimeoffset,
-};
index c37d570b852dcb24410d382cc7322affea8dddef..e2ae7e898f9d10985ac0474f5531fd0883534955 100644 (file)
@@ -178,8 +178,10 @@ static struct irqaction h7202_timer_irq = {
 /*
  * Setup TIMER0 as system timer
  */
-void __init h7202_init_time(void)
+void __init h7202_timer_init(void)
 {
+       arch_gettimeoffset = h720x_gettimeoffset;
+
        CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
        CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
        CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
@@ -188,11 +190,6 @@ void __init h7202_init_time(void)
        setup_irq(IRQ_TIMER0, &h7202_timer_irq);
 }
 
-struct sys_timer h7202_timer = {
-       .init           = h7202_init_time,
-       .offset         = h720x_gettimeoffset,
-};
-
 void __init h7202_init_irq (void)
 {
        int     irq;
index 5fdb20c855e234cb824e1473f9be4a2ce35cff2e..4fdeb686c0a99827bb55f0528c340bd6a5ca56ec 100644 (file)
@@ -32,7 +32,7 @@ MACHINE_START(H7201, "Hynix GMS30C7201")
        .atag_offset    = 0x1000,
        .map_io         = h720x_map_io,
        .init_irq       = h720x_init_irq,
-       .timer          = &h7201_timer,
+       .init_time      = h7201_timer_init,
        .dma_zone_size  = SZ_256M,
        .restart        = h720x_restart,
 MACHINE_END
index 169673036c593220df36a0e7ac4b895516654522..f68e967a20628edac3d5caaed0a298c69bc5e28a 100644 (file)
@@ -74,7 +74,7 @@ MACHINE_START(H7202, "Hynix HMS30C7202")
        .atag_offset    = 0x100,
        .map_io         = h720x_map_io,
        .init_irq       = h7202_init_irq,
-       .timer          = &h7202_timer,
+       .init_time      = h7202_timer_init,
        .init_machine   = init_eval_h7202,
        .dma_zone_size  = SZ_256M,
        .restart        = h720x_restart,
index 981dc1e1da518b1ddf5f6340085837ad07d7e444..fd630bccbd315fec1582ae91ac95d46dfce05008 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/io.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_irq.h>
@@ -32,7 +33,6 @@
 #include <asm/smp_twd.h>
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/timer-sp.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -66,12 +66,6 @@ void highbank_set_cpu_jump(int cpu, void *jump_addr)
                          HB_JUMP_TABLE_PHYS(cpu) + 15);
 }
 
-const static struct of_device_id irq_match[] = {
-       { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       {}
-};
-
 #ifdef CONFIG_CACHE_L2X0
 static void highbank_l2x0_disable(void)
 {
@@ -82,7 +76,7 @@ static void highbank_l2x0_disable(void)
 
 static void __init highbank_init_irq(void)
 {
-       of_irq_init(irq_match);
+       irqchip_init();
 
        if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9"))
                highbank_scu_map_io();
@@ -129,10 +123,6 @@ static void __init highbank_timer_init(void)
        arch_timer_sched_clock_init();
 }
 
-static struct sys_timer highbank_timer = {
-       .init = highbank_timer_init,
-};
-
 static void highbank_power_off(void)
 {
        highbank_set_pwr_shutdown();
@@ -209,8 +199,7 @@ DT_MACHINE_START(HIGHBANK, "Highbank")
        .smp            = smp_ops(highbank_smp_ops),
        .map_io         = debug_ll_io_init,
        .init_irq       = highbank_init_irq,
-       .timer          = &highbank_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = highbank_timer_init,
        .init_machine   = highbank_init,
        .dt_compat      = highbank_match,
        .restart        = highbank_restart,
index 4ecc864ac8b95dbe63283c4c0637c9436558d8a7..8797a7001720a3148a617a68ca8e1e46501072a1 100644 (file)
@@ -17,9 +17,9 @@
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/smp_scu.h>
-#include <asm/hardware/gic.h>
 
 #include "core.h"
 
@@ -33,7 +33,7 @@ static void __cpuinit highbank_secondary_init(unsigned int cpu)
 static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
        highbank_set_cpu_jump(cpu, secondary_startup);
-       gic_raise_softirq(cpumask_of(cpu), 0);
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
        return 0;
 }
 
@@ -56,8 +56,6 @@ static void __init highbank_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
index 0a2349dc70184021e268db86ef9c3cb0e966f8a3..7b11d3329e81dee99447f87277b7b6309d795354 100644 (file)
@@ -95,9 +95,6 @@ config MACH_MX27
 config ARCH_MX5
        bool
 
-config ARCH_MX50
-       bool
-
 config ARCH_MX51
        bool
 
@@ -164,11 +161,6 @@ config SOC_IMX5
        select CPU_V7
        select MXC_TZIC
 
-config SOC_IMX50
-       bool
-       select ARCH_MX50
-       select SOC_IMX5
-
 config SOC_IMX51
        bool
        select ARCH_MX5
@@ -738,25 +730,10 @@ endif
 
 if ARCH_MULTI_V7
 
-comment "i.MX5 platforms:"
-
-config MACH_MX50_RDP
-       bool "Support MX50 reference design platform"
-       depends on BROKEN
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select SOC_IMX50
-       help
-         Include support for MX50 reference design platform (RDP) board. This
-         includes specific configurations for the board and its peripherals.
-
 comment "i.MX51 machines:"
 
 config MACH_IMX51_DT
        bool "Support i.MX51 platforms from device tree"
-       select MACH_MX51_BABBAGE
        select SOC_IMX51
        help
          Include support for Freescale i.MX51 based platforms
@@ -777,19 +754,6 @@ config MACH_MX51_BABBAGE
          u-boot. This includes specific configurations for the board and its
          peripherals.
 
-config MACH_MX51_3DS
-       bool "Support MX51PDK (3DS)"
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_KEYPAD
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select MXC_DEBUG_BOARD
-       select SOC_IMX51
-       help
-         Include support for MX51PDK (3DS) platform. This includes specific
-         configurations for the board and its peripherals.
-
 config MACH_EUKREA_CPUIMX51SD
        bool "Support Eukrea CPUIMX51SD module"
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
index 0634b3152c24ca6918ba6584c8da914fd5d7dacf..c4ce0906d76a557f36632789526abf9d03efb8b7 100644 (file)
@@ -28,7 +28,11 @@ obj-$(CONFIG_MXC_ULPI) += ulpi.o
 obj-$(CONFIG_MXC_USE_EPIT) += epit.o
 obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
 obj-$(CONFIG_CPU_FREQ_IMX)    += cpufreq.o
-obj-$(CONFIG_CPU_IDLE) += cpuidle.o
+
+ifeq ($(CONFIG_CPU_IDLE),y)
+obj-y += cpuidle.o
+obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o
+endif
 
 ifdef CONFIG_SND_IMX_SOC
 obj-y += ssi-fiq.o
@@ -88,7 +92,6 @@ obj-$(CONFIG_MACH_EUKREA_CPUIMX35SD) += mach-cpuimx35.o
 obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd35-baseboard.o
 obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
 
-obj-$(CONFIG_DEBUG_LL) += lluart.o
 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
 obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o
 obj-$(CONFIG_HAVE_IMX_SRC) += src.o
@@ -103,10 +106,8 @@ endif
 
 # i.MX5 based machines
 obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
-obj-$(CONFIG_MACH_MX51_3DS) += mach-mx51_3ds.o
 obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o
 obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd51-baseboard.o
-obj-$(CONFIG_MACH_MX50_RDP) += mach-mx50_rdp.o
 
 obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
 obj-$(CONFIG_SOC_IMX53) += mach-imx53.o
index b27815de8473326788c96d08e2e57de1a54ec608..41ba1bb0437bf095914c59227dd0665d2616f71c 100644 (file)
@@ -22,10 +22,6 @@ zreladdr-$(CONFIG_SOC_IMX35) += 0x80008000
 params_phys-$(CONFIG_SOC_IMX35)        := 0x80000100
 initrd_phys-$(CONFIG_SOC_IMX35)        := 0x80800000
 
-zreladdr-$(CONFIG_SOC_IMX50)   += 0x70008000
-params_phys-$(CONFIG_SOC_IMX50)        := 0x70000100
-initrd_phys-$(CONFIG_SOC_IMX50)        := 0x70800000
-
 zreladdr-$(CONFIG_SOC_IMX51)   += 0x90008000
 params_phys-$(CONFIG_SOC_IMX51)        := 0x90000100
 initrd_phys-$(CONFIG_SOC_IMX51)        := 0x90800000
index 1ffe3b534e51562aca68b587c383bb3df00b38a8..d24b0d68e83fec3beee96dc6b80c2088160f1a62 100644 (file)
@@ -62,7 +62,7 @@ static const char *clko_sel_clks[] = {
        "32k", "usb_div", "dptc",
 };
 
-static const char *ssi_sel_clks[] = { "spll", "mpll", };
+static const char *ssi_sel_clks[] = { "spll_gate", "mpll", };
 
 enum mx27_clks {
        dummy, ckih, ckil, mpll, spll, mpll_main2, ahb, ipg, nfc_div, per1_div,
@@ -82,7 +82,7 @@ enum mx27_clks {
        csi_ahb_gate, brom_ahb_gate, ata_ahb_gate, wdog_ipg_gate, usb_ipg_gate,
        uart6_ipg_gate, uart5_ipg_gate, uart4_ipg_gate, uart3_ipg_gate,
        uart2_ipg_gate, uart1_ipg_gate, ckih_div1p5, fpm, mpll_osc_sel,
-       mpll_sel, clk_max
+       mpll_sel, spll_gate, clk_max
 };
 
 static struct clk *clk[clk_max];
@@ -104,6 +104,7 @@ int __init mx27_clocks_init(unsigned long fref)
                        ARRAY_SIZE(mpll_sel_clks));
        clk[mpll] = imx_clk_pllv1("mpll", "mpll_sel", CCM_MPCTL0);
        clk[spll] = imx_clk_pllv1("spll", "ckih", CCM_SPCTL0);
+       clk[spll_gate] = imx_clk_gate("spll_gate", "spll", CCM_CSCR, 1);
        clk[mpll_main2] = imx_clk_fixed_factor("mpll_main2", "mpll", 2, 3);
 
        if (mx27_revision() >= IMX_CHIP_REVISION_2_0) {
@@ -121,7 +122,7 @@ int __init mx27_clocks_init(unsigned long fref)
        clk[per4_div] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6);
        clk[vpu_sel] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks));
        clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6);
-       clk[usb_div] = imx_clk_divider("usb_div", "spll", CCM_CSCR, 28, 3);
+       clk[usb_div] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 28, 3);
        clk[cpu_sel] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
        clk[clko_sel] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
        if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
index 16ccbd41dea9da4b830787b11e099dff7a19a141..b5b65f3efaf1c30651686f9d79ee004318815b66 100644 (file)
@@ -34,8 +34,8 @@ static const char *csi_sel[] = { "upll", "spll", };
 static const char *fir_sel[] = { "mcu_main", "upll", "spll" };
 
 enum mx31_clks {
-       ckih, ckil, mpll, spll, upll, mcu_main, hsp, ahb, nfc, ipg, per_div,
-       per, csi, fir, csi_div, usb_div_pre, usb_div_post, fir_div_pre,
+       dummy, ckih, ckil, mpll, spll, upll, mcu_main, hsp, ahb, nfc, ipg,
+       per_div, per, csi, fir, csi_div, usb_div_pre, usb_div_post, fir_div_pre,
        fir_div_post, sdhc1_gate, sdhc2_gate, gpt_gate, epit1_gate, epit2_gate,
        iim_gate, ata_gate, sdma_gate, cspi3_gate, rng_gate, uart1_gate,
        uart2_gate, ssi1_gate, i2c1_gate, i2c2_gate, i2c3_gate, hantro_gate,
@@ -46,12 +46,15 @@ enum mx31_clks {
 };
 
 static struct clk *clk[clk_max];
+static struct clk_onecell_data clk_data;
 
 int __init mx31_clocks_init(unsigned long fref)
 {
        void __iomem *base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR);
        int i;
+       struct device_node *np;
 
+       clk[dummy] = imx_clk_fixed("dummy", 0);
        clk[ckih] = imx_clk_fixed("ckih", fref);
        clk[ckil] = imx_clk_fixed("ckil", 32768);
        clk[mpll] = imx_clk_pllv1("mpll", "ckih", base + MXC_CCM_MPCTL);
@@ -116,6 +119,14 @@ int __init mx31_clocks_init(unsigned long fref)
                        pr_err("imx31 clk %d: register failed with %ld\n",
                                i, PTR_ERR(clk[i]));
 
+       np = of_find_compatible_node(NULL, NULL, "fsl,imx31-ccm");
+
+       if (np) {
+               clk_data.clks = clk;
+               clk_data.clk_num = ARRAY_SIZE(clk);
+               of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+       }
+
        clk_register_clkdev(clk[gpt_gate], "per", "imx-gpt.0");
        clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0");
        clk_register_clkdev(clk[cspi1_gate], NULL, "imx31-cspi.0");
index f0727e80815dc7adcb7ed2f1fbfcb43723fbd91a..74e3a34d78b80a25be2edeb9afcc2f027f610368 100644 (file)
@@ -67,13 +67,13 @@ enum mx35_clks {
 
 static struct clk *clk[clk_max];
 
-int __init mx35_clocks_init()
+int __init mx35_clocks_init(void)
 {
        void __iomem *base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR);
        u32 pdr0, consumer_sel, hsp_sel;
        struct arm_ahb_div *aad;
        unsigned char *hsp_div;
-       int i;
+       u32 i;
 
        pdr0 = __raw_readl(base + MXC_CCM_PDR0);
        consumer_sel = (pdr0 >> 16) & 0xf;
index c0c4e723b7f5dee0a34526fd280cab2e8b3966b1..540138c4606c41e0bf70c175f2ceea188c63936a 100644 (file)
 #define BM_CLPCR_MASK_SCU_IDLE         (0x1 << 26)
 #define BM_CLPCR_MASK_L2CC_IDLE                (0x1 << 27)
 
+#define CGPR                           0x64
+#define BM_CGPR_CHICKEN_BIT            (0x1 << 17)
+
 static void __iomem *ccm_base;
 
-void __init imx6q_clock_map_io(void) { }
+void imx6q_set_chicken_bit(void)
+{
+       u32 val = readl_relaxed(ccm_base + CGPR);
+
+       val |= BM_CGPR_CHICKEN_BIT;
+       writel_relaxed(val, ccm_base + CGPR);
+}
 
 int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
 {
@@ -68,6 +77,7 @@ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
                break;
        case WAIT_UNCLOCKED:
                val |= 0x1 << BP_CLPCR_LPM;
+               val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
                break;
        case STOP_POWER_ON:
                val |= 0x2 << BP_CLPCR_LPM;
index fa36fb84ab193f2fb8480bf3cc70d68232824844..5a800bfcec5b9e67bbf20b6b7001a70867c28482 100644 (file)
@@ -21,7 +21,6 @@ extern void mx25_map_io(void);
 extern void mx27_map_io(void);
 extern void mx31_map_io(void);
 extern void mx35_map_io(void);
-extern void mx50_map_io(void);
 extern void mx51_map_io(void);
 extern void mx53_map_io(void);
 extern void imx1_init_early(void);
@@ -30,7 +29,6 @@ extern void imx25_init_early(void);
 extern void imx27_init_early(void);
 extern void imx31_init_early(void);
 extern void imx35_init_early(void);
-extern void imx50_init_early(void);
 extern void imx51_init_early(void);
 extern void imx53_init_early(void);
 extern void mxc_init_irq(void __iomem *);
@@ -41,7 +39,6 @@ extern void mx25_init_irq(void);
 extern void mx27_init_irq(void);
 extern void mx31_init_irq(void);
 extern void mx35_init_irq(void);
-extern void mx50_init_irq(void);
 extern void mx51_init_irq(void);
 extern void mx53_init_irq(void);
 extern void imx1_soc_init(void);
@@ -50,7 +47,6 @@ extern void imx25_soc_init(void);
 extern void imx27_soc_init(void);
 extern void imx31_soc_init(void);
 extern void imx35_soc_init(void);
-extern void imx50_soc_init(void);
 extern void imx51_soc_init(void);
 extern void imx51_init_late(void);
 extern void imx53_init_late(void);
@@ -109,27 +105,22 @@ void tzic_handle_irq(struct pt_regs *);
 #define imx27_handle_irq avic_handle_irq
 #define imx31_handle_irq avic_handle_irq
 #define imx35_handle_irq avic_handle_irq
-#define imx50_handle_irq tzic_handle_irq
 #define imx51_handle_irq tzic_handle_irq
 #define imx53_handle_irq tzic_handle_irq
-#define imx6q_handle_irq gic_handle_irq
 
 extern void imx_enable_cpu(int cpu, bool enable);
 extern void imx_set_cpu_jump(int cpu, void *jump_addr);
-#ifdef CONFIG_DEBUG_LL
-extern void imx_lluart_map_io(void);
-#else
-static inline void imx_lluart_map_io(void) {}
-#endif
 extern void v7_cpu_resume(void);
 extern u32 *pl310_get_save_ptr(void);
 #ifdef CONFIG_SMP
 extern void v7_secondary_startup(void);
 extern void imx_scu_map_io(void);
 extern void imx_smp_prepare(void);
+extern void imx_scu_standby_enable(void);
 #else
 static inline void imx_scu_map_io(void) {}
 static inline void imx_smp_prepare(void) {}
+static inline void imx_scu_standby_enable(void) {}
 #endif
 extern void imx_enable_cpu(int cpu, bool enable);
 extern void imx_set_cpu_jump(int cpu, void *jump_addr);
@@ -139,7 +130,7 @@ extern void imx_gpc_init(void);
 extern void imx_gpc_pre_suspend(void);
 extern void imx_gpc_post_resume(void);
 extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
-extern void imx6q_clock_map_io(void);
+extern void imx6q_set_chicken_bit(void);
 
 extern void imx_cpu_die(unsigned int cpu);
 extern int imx_cpu_kill(unsigned int cpu);
index d88760014ff96ab46277d3ef97e4f592105b5dbb..d7ce72252a4e6b34d5416e387c3bf1b02f7c6c2b 100644 (file)
@@ -22,7 +22,6 @@
 static int mx5_cpu_rev = -1;
 
 #define IIM_SREV 0x24
-#define MX50_HW_ADADIG_DIGPROG 0xB0
 
 static int get_mx51_srev(void)
 {
@@ -108,41 +107,3 @@ int mx53_revision(void)
        return mx5_cpu_rev;
 }
 EXPORT_SYMBOL(mx53_revision);
-
-static int get_mx50_srev(void)
-{
-       void __iomem *anatop = ioremap(MX50_ANATOP_BASE_ADDR, SZ_8K);
-       u32 rev;
-
-       if (!anatop) {
-               mx5_cpu_rev = -EINVAL;
-               return 0;
-       }
-
-       rev = readl(anatop + MX50_HW_ADADIG_DIGPROG);
-       rev &= 0xff;
-
-       iounmap(anatop);
-       if (rev == 0x0)
-               return IMX_CHIP_REVISION_1_0;
-       else if (rev == 0x1)
-               return IMX_CHIP_REVISION_1_1;
-       return 0;
-}
-
-/*
- * Returns:
- *     the silicon revision of the cpu
- *     -EINVAL - not a mx50
- */
-int mx50_revision(void)
-{
-       if (!cpu_is_mx50())
-               return -EINVAL;
-
-       if (mx5_cpu_rev == -1)
-               mx5_cpu_rev = get_mx50_srev();
-
-       return mx5_cpu_rev;
-}
-EXPORT_SYMBOL(mx50_revision);
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c
new file mode 100644 (file)
index 0000000..d533e26
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/clockchips.h>
+#include <linux/cpuidle.h>
+#include <linux/module.h>
+#include <asm/cpuidle.h>
+#include <asm/proc-fns.h>
+
+#include "common.h"
+#include "cpuidle.h"
+
+static atomic_t master = ATOMIC_INIT(0);
+static DEFINE_SPINLOCK(master_lock);
+
+static int imx6q_enter_wait(struct cpuidle_device *dev,
+                           struct cpuidle_driver *drv, int index)
+{
+       int cpu = dev->cpu;
+
+       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
+
+       if (atomic_inc_return(&master) == num_online_cpus()) {
+               /*
+                * With this lock, we prevent other cpu to exit and enter
+                * this function again and become the master.
+                */
+               if (!spin_trylock(&master_lock))
+                       goto idle;
+               imx6q_set_lpm(WAIT_UNCLOCKED);
+               cpu_do_idle();
+               imx6q_set_lpm(WAIT_CLOCKED);
+               spin_unlock(&master_lock);
+               goto done;
+       }
+
+idle:
+       cpu_do_idle();
+done:
+       atomic_dec(&master);
+       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
+
+       return index;
+}
+
+/*
+ * For each cpu, setup the broadcast timer because local timer
+ * stops for the states other than WFI.
+ */
+static void imx6q_setup_broadcast_timer(void *arg)
+{
+       int cpu = smp_processor_id();
+
+       clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu);
+}
+
+static struct cpuidle_driver imx6q_cpuidle_driver = {
+       .name = "imx6q_cpuidle",
+       .owner = THIS_MODULE,
+       .en_core_tk_irqen = 1,
+       .states = {
+               /* WFI */
+               ARM_CPUIDLE_WFI_STATE,
+               /* WAIT */
+               {
+                       .exit_latency = 50,
+                       .target_residency = 75,
+                       .flags = CPUIDLE_FLAG_TIME_VALID,
+                       .enter = imx6q_enter_wait,
+                       .name = "WAIT",
+                       .desc = "Clock off",
+               },
+       },
+       .state_count = 2,
+       .safe_state_index = 0,
+};
+
+int __init imx6q_cpuidle_init(void)
+{
+       /* Need to enable SCU standby for entering WAIT modes */
+       imx_scu_standby_enable();
+
+       /* Set chicken bit to get a reliable WAIT mode support */
+       imx6q_set_chicken_bit();
+
+       /* Configure the broadcast timer on each cpu */
+       on_each_cpu(imx6q_setup_broadcast_timer, NULL, 1);
+
+       return imx_cpuidle_init(&imx6q_cpuidle_driver);
+}
index bc932d1af37279ae3c4f3faa4dc0138745a0bda1..e092d1359d94e2f73bcf40432eb7924b59e1c1a9 100644 (file)
 
 #ifdef CONFIG_CPU_IDLE
 extern int imx_cpuidle_init(struct cpuidle_driver *drv);
+extern int imx6q_cpuidle_init(void);
 #else
 static inline int imx_cpuidle_init(struct cpuidle_driver *drv)
 {
        return -ENODEV;
 }
+static inline int imx6q_cpuidle_init(void)
+{
+       return -ENODEV;
+}
 #endif
diff --git a/arch/arm/mach-imx/devices-imx50.h b/arch/arm/mach-imx/devices-imx50.h
deleted file mode 100644 (file)
index 2c29039..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "devices/devices-common.h"
-
-extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[];
-#define imx50_add_imx_uart(id, pdata)  \
-       imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata)
-
-extern const struct imx_fec_data imx50_fec_data;
-#define imx50_add_fec(pdata)   \
-       imx_add_fec(&imx50_fec_data, pdata)
-
-extern const struct imx_imx_i2c_data imx50_imx_i2c_data[];
-#define imx50_add_imx_i2c(id, pdata)   \
-       imx_add_imx_i2c(&imx50_imx_i2c_data[id], pdata)
index 9a8f1ca7bcb1870245c143b75ea874815b2a3d50..9b9ba1f4ffe134f52f92e45a4cfd96fd2cd74a0f 100644 (file)
@@ -1,6 +1,6 @@
 config IMX_HAVE_PLATFORM_FEC
        bool
-       default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX50 || SOC_IMX51 || SOC_IMX53
+       default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 || SOC_IMX53
 
 config IMX_HAVE_PLATFORM_FLEXCAN
        bool
index 2cb188ad9a0a614422892a7ef64396bacdead050..63eba08f87b1a0941b9b003f330197dc2e331330 100644 (file)
@@ -35,12 +35,6 @@ const struct imx_fec_data imx35_fec_data __initconst =
        imx_fec_data_entry_single(MX35, "imx27-fec");
 #endif
 
-#ifdef CONFIG_SOC_IMX50
-/* i.mx50 has the i.mx25 type fec */
-const struct imx_fec_data imx50_fec_data __initconst =
-       imx_fec_data_entry_single(MX50, "imx25-fec");
-#endif
-
 #ifdef CONFIG_SOC_IMX51
 /* i.mx51 has the i.mx27 type fec */
 const struct imx_fec_data imx51_fec_data __initconst =
index 8e30e5703cd204fadda337789bd292a9d14929d5..57d342e85c2fa5621f334c26d667beacb286f9a6 100644 (file)
@@ -70,16 +70,6 @@ const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
 };
 #endif /* ifdef CONFIG_SOC_IMX35 */
 
-#ifdef CONFIG_SOC_IMX50
-const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
-#define imx50_imx_i2c_data_entry(_id, _hwid)                           \
-       imx_imx_i2c_data_entry(MX50, "imx21-i2c", _id, _hwid, SZ_4K)
-       imx50_imx_i2c_data_entry(0, 1),
-       imx50_imx_i2c_data_entry(1, 2),
-       imx50_imx_i2c_data_entry(2, 3),
-};
-#endif /* ifdef CONFIG_SOC_IMX51 */
-
 #ifdef CONFIG_SOC_IMX51
 const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
 #define imx51_imx_i2c_data_entry(_id, _hwid)                           \
index 67bf866a2cb6642008a78b968943ebf3bd4750f5..faac4aa6ca6d0dc3d109b40160ac4d310cac5750 100644 (file)
@@ -94,18 +94,6 @@ const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst = {
 };
 #endif /* ifdef CONFIG_SOC_IMX35 */
 
-#ifdef CONFIG_SOC_IMX50
-const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst = {
-#define imx50_imx_uart_data_entry(_id, _hwid)                          \
-       imx_imx_uart_1irq_data_entry(MX50, _id, _hwid, SZ_4K)
-       imx50_imx_uart_data_entry(0, 1),
-       imx50_imx_uart_data_entry(1, 2),
-       imx50_imx_uart_data_entry(2, 3),
-       imx50_imx_uart_data_entry(3, 4),
-       imx50_imx_uart_data_entry(4, 5),
-};
-#endif /* ifdef CONFIG_SOC_IMX50 */
-
 #ifdef CONFIG_SOC_IMX51
 const struct imx_imx_uart_1irq_data imx51_imx_uart_data[] __initconst = {
 #define imx51_imx_uart_data_entry(_id, _hwid)                          \
index 04a5961beeac70c5567e0aa7f921a077f61df37b..e02de188ae83ba7a5e51b4184f1cc85c05c86d34 100644 (file)
@@ -178,7 +178,6 @@ static struct irqaction epit_timer_irq = {
 static struct clock_event_device clockevent_epit = {
        .name           = "epit",
        .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .set_mode       = epit_set_mode,
        .set_next_event = epit_set_next_event,
        .rating         = 200,
@@ -186,18 +185,10 @@ static struct clock_event_device clockevent_epit = {
 
 static int __init epit_clockevent_init(struct clk *timer_clk)
 {
-       unsigned int c = clk_get_rate(timer_clk);
-
-       clockevent_epit.mult = div_sc(c, NSEC_PER_SEC,
-                                       clockevent_epit.shift);
-       clockevent_epit.max_delta_ns =
-                       clockevent_delta2ns(0xfffffffe, &clockevent_epit);
-       clockevent_epit.min_delta_ns =
-                       clockevent_delta2ns(0x800, &clockevent_epit);
-
        clockevent_epit.cpumask = cpumask_of(0);
-
-       clockevents_register_device(&clockevent_epit);
+       clockevents_config_and_register(&clockevent_epit,
+                                       clk_get_rate(timer_clk),
+                                       0x800, 0xfffffffe);
 
        return 0;
 }
index e1537f9e45b858571bdfa794be8f86507e06cadd..a96ccc7f50123ad5470be6af6d4e2f6edb0e4920 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
-#include <asm/hardware/gic.h>
+#include <linux/irqchip/arm-gic.h>
 
 #define GPC_IMR1               0x008
 #define GPC_PGC_CPU_PDN                0x2a0
@@ -101,11 +101,16 @@ static void imx_gpc_irq_mask(struct irq_data *d)
 void __init imx_gpc_init(void)
 {
        struct device_node *np;
+       int i;
 
        np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc");
        gpc_base = of_iomap(np, 0);
        WARN_ON(!gpc_base);
 
+       /* Initially mask all interrupts */
+       for (i = 0; i < IMR_NUM; i++)
+               writel_relaxed(~0, gpc_base + GPC_IMR1 + i * 4);
+
        /* Register GPC as the secondary interrupt controller behind GIC */
        gic_arch_extn.irq_mask = imx_gpc_irq_mask;
        gic_arch_extn.irq_unmask = imx_gpc_irq_unmask;
index 3ce7fa3bd43fbcefa6561c6a555e5e9b3254a7d1..911e9b31b03f76f19ef9ad60c7380654f785d313 100644 (file)
  *     AVIC    0x68000000+0x100000     ->      0xf5800000+0x100000
  *     X_MEMC  0xb8000000+0x010000     ->      0xf5c00000+0x010000
  *     SPBA0   0x50000000+0x100000     ->      0xf5400000+0x100000
- * mx50:
- *     TZIC    0x0fffc000+0x004000     ->      0xf4bfc000+0x004000
- *     AIPS1   0x53f00000+0x100000     ->      0xf5700000+0x100000
- *     SPBA0   0x50000000+0x100000     ->      0xf5400000+0x100000
- *     AIPS2   0x63f00000+0x100000     ->      0xf5300000+0x100000
  * mx51:
  *     TZIC    0x0fffc000+0x004000     ->      0xf4bfc000+0x004000
  *     IRAM    0x1ffe0000+0x020000     ->      0xf4fe0000+0x020000
 #include "mxc.h"
 
 #include "mx6q.h"
-#include "mx50.h"
 #include "mx51.h"
 #include "mx53.h"
 #include "mx3x.h"
index e17dfbc42192e3e1cceb664583a7fb2f42d57e71..03b65e5ea541613a062ea5719b32ab045b9e723f 100644 (file)
@@ -22,15 +22,6 @@ static void __init imx25_dt_init(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static void __init imx25_timer_init(void)
-{
-       mx25_clocks_init_dt();
-}
-
-static struct sys_timer imx25_timer = {
-       .init = imx25_timer_init,
-};
-
 static const char * const imx25_dt_board_compat[] __initconst = {
        "fsl,imx25",
        NULL
@@ -41,7 +32,7 @@ DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)")
        .init_early     = imx25_init_early,
        .init_irq       = mx25_init_irq,
        .handle_irq     = imx25_handle_irq,
-       .timer          = &imx25_timer,
+       .init_time      = imx25_timer_init,
        .init_machine   = imx25_dt_init,
        .dt_compat      = imx25_dt_board_compat,
        .restart        = mxc_restart,
index ebfae96543c47d2ef50c1e4653d9ec6f0dd3fee4..c915a490a11c7e23eeb229054b7ed034af03f5a4 100644 (file)
@@ -39,26 +39,22 @@ static void __init imx27_dt_init(void)
                             imx27_auxdata_lookup, NULL);
 }
 
-static void __init imx27_timer_init(void)
-{
-       mx27_clocks_init_dt();
-}
-
-static struct sys_timer imx27_timer = {
-       .init = imx27_timer_init,
-};
-
 static const char * const imx27_dt_board_compat[] __initconst = {
        "fsl,imx27",
        NULL
 };
 
+static void __init imx27_timer_init(void)
+{
+       mx27_clocks_init_dt();
+}
+
 DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)")
        .map_io         = mx27_map_io,
        .init_early     = imx27_init_early,
        .init_irq       = mx27_init_irq,
        .handle_irq     = imx27_handle_irq,
-       .timer          = &imx27_timer,
+       .init_time      = imx27_timer_init,
        .init_machine   = imx27_dt_init,
        .dt_compat      = imx27_dt_board_compat,
        .restart        = mxc_restart,
index af476de2570e8727c1c4e9fe0ac0a77397da7985..00737eb4e00d7439da839c0d5bd834f53e43584e 100644 (file)
 #include "common.h"
 #include "mx31.h"
 
-static const struct of_dev_auxdata imx31_auxdata_lookup[] __initconst = {
-       OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART1_BASE_ADDR,
-                       "imx21-uart.0", NULL),
-       OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART2_BASE_ADDR,
-                       "imx21-uart.1", NULL),
-       OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART3_BASE_ADDR,
-                       "imx21-uart.2", NULL),
-       OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART4_BASE_ADDR,
-                       "imx21-uart.3", NULL),
-       OF_DEV_AUXDATA("fsl,imx31-uart", MX31_UART5_BASE_ADDR,
-                       "imx21-uart.4", NULL),
-       { /* sentinel */ }
-};
-
 static void __init imx31_dt_init(void)
 {
-       of_platform_populate(NULL, of_default_bus_match_table,
-                            imx31_auxdata_lookup, NULL);
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static void __init imx31_timer_init(void)
-{
-       mx31_clocks_init_dt();
-}
-
-static struct sys_timer imx31_timer = {
-       .init = imx31_timer_init,
-};
-
 static const char *imx31_dt_board_compat[] __initdata = {
        "fsl,imx31",
        NULL
@@ -57,7 +33,7 @@ DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)")
        .init_early     = imx31_init_early,
        .init_irq       = mx31_init_irq,
        .handle_irq     = imx31_handle_irq,
-       .timer          = &imx31_timer,
+       .init_time      = mx31_clocks_init_dt,
        .init_machine   = imx31_dt_init,
        .dt_compat      = imx31_dt_board_compat,
        .restart        = mxc_restart,
index 5ffa40c673f8715c83eadaf964a51a5a5115b208..e2926a8863f852d02f6689367c9c7b782b064555 100644 (file)
@@ -24,26 +24,22 @@ static void __init imx51_dt_init(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static void __init imx51_timer_init(void)
-{
-       mx51_clocks_init_dt();
-}
-
-static struct sys_timer imx51_timer = {
-       .init = imx51_timer_init,
-};
-
 static const char *imx51_dt_board_compat[] __initdata = {
        "fsl,imx51",
        NULL
 };
 
+static void __init imx51_timer_init(void)
+{
+       mx51_clocks_init_dt();
+}
+
 DT_MACHINE_START(IMX51_DT, "Freescale i.MX51 (Device Tree Support)")
        .map_io         = mx51_map_io,
        .init_early     = imx51_init_early,
        .init_irq       = mx51_init_irq,
        .handle_irq     = imx51_handle_irq,
-       .timer          = &imx51_timer,
+       .init_time      = imx51_timer_init,
        .init_machine   = imx51_dt_init,
        .init_late      = imx51_init_late,
        .dt_compat      = imx51_dt_board_compat,
diff --git a/arch/arm/mach-imx/iomux-mx50.h b/arch/arm/mach-imx/iomux-mx50.h
deleted file mode 100644 (file)
index 00f56e0..0000000
+++ /dev/null
@@ -1,977 +0,0 @@
-/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef __MACH_IOMUX_MX50_H__
-#define __MACH_IOMUX_MX50_H__
-
-#include "iomux-v3.h"
-
-#define MX50_ELCDIF_PAD_CTRL   (PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
-
-#define MX50_SD_PAD_CTRL       (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
-                                       PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_HIGH)
-
-#define MX50_UART_PAD_CTRL     (PAD_CTL_DSE_HIGH | PAD_CTL_PKE)
-
-#define MX50_I2C_PAD_CTRL      (PAD_CTL_ODE | PAD_CTL_DSE_HIGH | \
-                                       PAD_CTL_PUS_100K_UP | PAD_CTL_HYS)
-
-#define MX50_USB_PAD_CTRL      (PAD_CTL_PKE | PAD_CTL_PUE | \
-                                       PAD_CTL_DSE_HIGH | PAD_CTL_PUS_47K_UP)
-
-#define MX50_FEC_PAD_CTRL      (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
-                                       PAD_CTL_PUS_22K_UP | PAD_CTL_ODE | \
-                                       PAD_CTL_DSE_HIGH)
-
-#define MX50_OWIRE_PAD_CTRL    (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
-                                       PAD_CTL_PUS_100K_UP | PAD_CTL_ODE | \
-                                       PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST)
-
-#define MX50_KEYPAD_CTRL        (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
-                                       PAD_CTL_PUS_100K_UP | PAD_CTL_DSE_HIGH)
-
-#define MX50_CSPI_SS_PAD       (PAD_CTL_PKE | PAD_CTL_PUE | \
-                                       PAD_CTL_PUS_22K_UP | PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_KEY_COL0__KEY_COL0    IOMUX_PAD(0x2CC, 0x20, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_COL0__GPIO_4_0    IOMUX_PAD(0x2CC, 0x20, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_COL0__NANDF_CLE   IOMUX_PAD(0x2CC, 0x20, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_KEY_ROW0__KEY_ROW0    IOMUX_PAD(0x2D0, 0x24, 0, 0x0, 0, MX50_KEYPAD_CTRL)
-#define MX50_PAD_KEY_ROW0__GPIO_4_1    IOMUX_PAD(0x2D0, 0x24, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_ROW0__NANDF_ALE   IOMUX_PAD(0x2D0, 0x24, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_KEY_COL1__KEY_COL1    IOMUX_PAD(0x2D4, 0x28, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_COL1__GPIO_4_2    IOMUX_PAD(0x2D4, 0x28, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_COL1__NANDF_CE0   IOMUX_PAD(0x2D4, 0x28, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_KEY_ROW1__KEY_ROW1    IOMUX_PAD(0x2D8, 0x2C, 0, 0x0, 0, MX50_KEYPAD_CTRL)
-#define MX50_PAD_KEY_ROW1__GPIO_4_3    IOMUX_PAD(0x2D8, 0x2C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_ROW1__NANDF_CE1   IOMUX_PAD(0x2D8, 0x2C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_KEY_COL2__KEY_COL2    IOMUX_PAD(0x2DC, 0x30, 0, 0x0, 0, MX50_KEYPAD_CTRL)
-#define MX50_PAD_KEY_COL2__GPIO_4_4    IOMUX_PAD(0x2DC, 0x30, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_COL2__NANDF_CE2   IOMUX_PAD(0x2DC, 0x30, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_KEY_ROW2__KEY_ROW2    IOMUX_PAD(0x2E0, 0x34, 0, 0x0, 0, MX50_KEYPAD_CTRL)
-#define MX50_PAD_KEY_ROW2__GPIO_4_5    IOMUX_PAD(0x2E0, 0x34, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_ROW2__NANDF_CE3   IOMUX_PAD(0x2E0, 0x34, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_KEY_COL3__KEY_COL3    IOMUX_PAD(0x2E4, 0x38, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_COL3__GPIO_4_6    IOMUX_PAD(0x2E4, 0x38, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_COL3__NANDF_READY IOMUX_PAD(0x2E4, 0x38, 2, 0x7b4, 0, PAD_CTL_PKE | \
-                                                       PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
-#define MX50_PAD_KEY_COL3__SDMA_EXT0   IOMUX_PAD(0x2E4, 0x38, 6, 0x7b8, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_KEY_ROW3__KEY_ROW3    IOMUX_PAD(0x2E8, 0x3C, 0, 0x0, 0, MX50_KEYPAD_CTRL)
-#define MX50_PAD_KEY_ROW3__GPIO_4_7    IOMUX_PAD(0x2E8, 0x3C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_KEY_ROW3__NANDF_DQS   IOMUX_PAD(0x2E8, 0x3C, 2, 0x7b0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_KEY_ROW3__SDMA_EXT1   IOMUX_PAD(0x2E8, 0x3C, 6, 0x7bc, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_I2C1_SCL__I2C1_SCL    IOMUX_PAD(0x2EC, 0x40, IOMUX_CONFIG_SION, 0x0, 0, \
-                                                       MX50_I2C_PAD_CTRL)
-#define MX50_PAD_I2C1_SCL__GPIO_6_18   IOMUX_PAD(0x2EC, 0x40, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C1_SCL__UART2_TXD   IOMUX_PAD(0x2EC, 0x40, 2, 0x0, 0, MX50_UART_PAD_CTRL)
-
-#define MX50_PAD_I2C1_SDA__I2C1_SDA    IOMUX_PAD(0x2F0, 0x44, IOMUX_CONFIG_SION, 0x0, 0, \
-                                                       MX50_I2C_PAD_CTRL)
-#define MX50_PAD_I2C1_SDA__GPIO_6_19   IOMUX_PAD(0x2F0, 0x44, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C1_SDA__UART2_RXD   IOMUX_PAD(0x2F0, 0x44, 2, 0x7cc, 1, MX50_UART_PAD_CTRL)
-
-#define MX50_PAD_I2C2_SCL__I2C2_SCL    IOMUX_PAD(0x2F4, 0x48, IOMUX_CONFIG_SION, 0x0, 0, \
-                                                       MX50_I2C_PAD_CTRL)
-#define MX50_PAD_I2C2_SCL__GPIO_6_20   IOMUX_PAD(0x2F4, 0x48, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C2_SCL__UART2_CTS   IOMUX_PAD(0x2F4, 0x48, 2, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_I2C2_SCL__DCDC_OK     IOMUX_PAD(0x2F4, 0x48, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_I2C2_SDA__I2C2_SDA    IOMUX_PAD(0x2F8, 0x4C, IOMUX_CONFIG_SION, 0x0, 0, \
-                                                       MX50_I2C_PAD_CTRL)
-#define MX50_PAD_I2C2_SDA__GPIO_6_21   IOMUX_PAD(0x2F8, 0x4C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C2_SDA__UART2_RTS   IOMUX_PAD(0x2F8, 0x4C, 2, 0x7c8, 1, MX50_UART_PAD_CTRL)
-#define MX50_PAD_I2C2_SDA__PWRSTABLE   IOMUX_PAD(0x2F8, 0x4C, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_I2C3_SCL__I2C3_SCL    IOMUX_PAD(0x2FC, 0x50, IOMUX_CONFIG_SION, 0x0, 0, \
-                                                       MX50_I2C_PAD_CTRL)
-#define MX50_PAD_I2C3_SCL__GPIO_6_22   IOMUX_PAD(0x2FC, 0x50, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C3_SCL__FEC_MDC     IOMUX_PAD(0x2FC, 0x50, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_I2C3_SCL__PMIC_RDY    IOMUX_PAD(0x2FC, 0x50, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C3_SCL__GPT_CAPIN1  IOMUX_PAD(0x2FC, 0x50, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C3_SCL__USBOTG_OC   IOMUX_PAD(0x2FC, 0x50, 7, 0x7E8, 0, MX50_USB_PAD_CTRL)
-
-#define MX50_PAD_I2C3_SDA__I2C3_SDA    IOMUX_PAD(0x300, 0x54, IOMUX_CONFIG_SION, 0x0, 0, \
-                                                               MX50_I2C_PAD_CTRL)
-#define MX50_PAD_I2C3_SDA__GPIO_6_23   IOMUX_PAD(0x300, 0x54, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C3_SDA__FEC_MDIO    IOMUX_PAD(0x300, 0x54, 2, 0x774, 0, MX50_FEC_PAD_CTRL)
-#define MX50_PAD_I2C3_SDA__PWRFAIL_INT IOMUX_PAD(0x300, 0x54, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C3_SDA__ALARM_DEB   IOMUX_PAD(0x300, 0x54, 4, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C3_SDA__GPT_CAPIN1  IOMUX_PAD(0x300, 0x54, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_I2C3_SDA__USBOTG_PWR  IOMUX_PAD(0x300, 0x54, 7, 0x0, 0, \
-                                                       PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_PWM1__PWM1_PWMO       IOMUX_PAD(0x304, 0x58, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_PWM1__GPIO_6_24       IOMUX_PAD(0x304, 0x58, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_PWM1__USBOTG_OC       IOMUX_PAD(0x304, 0x58, 2, 0x7E8, 1, MX50_USB_PAD_CTRL)
-#define MX50_PAD_PWM1__GPT_CMPOUT1     IOMUX_PAD(0x304, 0x58, 5, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PWM2__PWM2_PWMO       IOMUX_PAD(0x308, 0x5C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_PWM2__GPIO_6_25       IOMUX_PAD(0x308, 0x5C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_PWM2__USBOTG_PWR      IOMUX_PAD(0x308, 0x5C, 2, 0x0, 0, \
-                                                       PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
-#define MX50_PAD_PWM2__DCDC_PWM                IOMUX_PAD(0x308, 0x5C, 4, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_PWM2__GPT_CMPOUT2     IOMUX_PAD(0x308, 0x5C, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_PWM2__ANY_PU_RST      IOMUX_PAD(0x308, 0x5C, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_OWIRE__OWIRE          IOMUX_PAD(0x30C, 0x60, 0, 0x0, 0, MX50_OWIRE_PAD_CTRL)
-#define MX50_PAD_OWIRE__GPIO_6_26      IOMUX_PAD(0x30C, 0x60, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_OWIRE__USBH1_OC       IOMUX_PAD(0x30C, 0x60, 2, 0x0, 0, MX50_USB_PAD_CTRL)
-#define MX50_PAD_OWIRE__SSI_EXT1_CLK   IOMUX_PAD(0x30C, 0x60, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_OWIRE__EPDC_PWRIRQ    IOMUX_PAD(0x30C, 0x60, 4, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_OWIRE__GPT_CMPOUT3    IOMUX_PAD(0x30C, 0x60, 5, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPITO__EPITO          IOMUX_PAD(0x310, 0x64, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPITO__GPIO_6_27      IOMUX_PAD(0x310, 0x64, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPITO__USBH1_PWR      IOMUX_PAD(0x310, 0x64, 2, 0x0, 0, \
-                                                       PAD_CTL_PKE | PAD_CTL_DSE_HIGH)
-#define MX50_PAD_EPITO__SSI_EXT2_CLK   IOMUX_PAD(0x310, 0x64, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPITO__TOG_EN         IOMUX_PAD(0x310, 0x64, 4, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPITO__GPT_CLKIN      IOMUX_PAD(0x310, 0x64, 5, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_WDOG__WDOG            IOMUX_PAD(0x314, 0x68, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_WDOG__GPIO_6_28       IOMUX_PAD(0x314, 0x68, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_WDOG__WDOG_RST                IOMUX_PAD(0x314, 0x68, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_WDOG__XTAL32K         IOMUX_PAD(0x314, 0x68, 6, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SSI_TXFS__SSI_TXFS    IOMUX_PAD(0x318, 0x6C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_TXFS__GPIO_6_0    IOMUX_PAD(0x318, 0x6C, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SSI_TXC__SSI_TXC      IOMUX_PAD(0x31C, 0x70, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_TXC__GPIO_6_1     IOMUX_PAD(0x31C, 0x70, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SSI_TXD__SSI_TXD      IOMUX_PAD(0x320, 0x74, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_TXD__GPIO_6_2     IOMUX_PAD(0x320, 0x74, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_TXD__CSPI_RDY     IOMUX_PAD(0x320, 0x74, 4, 0x6e8, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SSI_RXD__SSI_RXD      IOMUX_PAD(0x324, 0x78, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXD__GPIO_6_3     IOMUX_PAD(0x324, 0x78, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXD__CSPI_SS3     IOMUX_PAD(0x324, 0x78, 4, 0x6f4, 0, MX50_CSPI_SS_PAD)
-
-#define MX50_PAD_SSI_RXFS__AUD3_RXFS   IOMUX_PAD(0x328, 0x7C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXFS__GPIO_6_4    IOMUX_PAD(0x328, 0x7C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXFS__UART5_TXD   IOMUX_PAD(0x328, 0x7C, 2, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_SSI_RXFS__WEIM_D6     IOMUX_PAD(0x328, 0x7C, 3, 0x804, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXFS__CSPI_SS2    IOMUX_PAD(0x328, 0x7C, 4, 0x6f0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_SSI_RXFS__FEC_COL     IOMUX_PAD(0x328, 0x7C, 5, 0x770, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SSI_RXFS__FEC_MDC     IOMUX_PAD(0x328, 0x7C, 6, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_SSI_RXC__AUD3_RXC     IOMUX_PAD(0x32C, 0x80, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXC__GPIO_6_5     IOMUX_PAD(0x32C, 0x80, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXC__UART5_RXD    IOMUX_PAD(0x32C, 0x80, 2, 0x7e4, 1, MX50_UART_PAD_CTRL)
-#define MX50_PAD_SSI_RXC__WEIM_D7      IOMUX_PAD(0x32C, 0x80, 3, 0x808, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXC__CSPI_SS1     IOMUX_PAD(0x32C, 0x80, 4, 0x6ec, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_SSI_RXC__FEC_RX_CLK   IOMUX_PAD(0x32C, 0x80, 5, 0x780, 0, NO_PAD_CTRL)
-#define MX50_PAD_SSI_RXC__FEC_MDIO     IOMUX_PAD(0x32C, 0x80, 6, 0x774, 1, MX50_FEC_PAD_CTRL)
-
-#define MX50_PAD_UART1_TXD__UART1_TXD  IOMUX_PAD(0x330, 0x84, 0, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART1_TXD__GPIO_6_6   IOMUX_PAD(0x330, 0x84, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_UART1_RXD__UART1_RXD  IOMUX_PAD(0x334, 0x88, 0, 0x7c4, 1, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART1_RXD__GPIO_6_7   IOMUX_PAD(0x334, 0x88, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_UART1_CTS__UART1_CTS  IOMUX_PAD(0x338, 0x8C, 0, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART1_CTS__GPIO_6_8   IOMUX_PAD(0x338, 0x8C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART1_CTS__UART5_TXD  IOMUX_PAD(0x338, 0x8C, 2, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART1_CTS__SD4_D4     IOMUX_PAD(0x338, 0x8C, 4, 0x760, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART1_CTS__SD4_CMD    IOMUX_PAD(0x338, 0x8C, 5, 0x74c, 0, MX50_SD_PAD_CTRL)
-
-#define MX50_PAD_UART1_RTS__UART1_RTS  IOMUX_PAD(0x33C, 0x90, 0, 0x7c0, 1, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART1_RTS__GPIO_6_9   IOMUX_PAD(0x33C, 0x90, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART1_RTS__UART5_RXD  IOMUX_PAD(0x33C, 0x90, 2, 0x7e4, 3, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART1_RTS__SD4_D5     IOMUX_PAD(0x33C, 0x90, 4, 0x764, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART1_RTS__SD4_CLK    IOMUX_PAD(0x33C, 0x90, 5, 0x748, 0, MX50_SD_PAD_CTRL)
-
-#define MX50_PAD_UART2_TXD__UART2_TXD  IOMUX_PAD(0x340, 0x94, 0, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART2_TXD__GPIO_6_10  IOMUX_PAD(0x340, 0x94, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART2_TXD__SD4_D6     IOMUX_PAD(0x340, 0x94, 4, 0x768, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART2_TXD__SD4_D4     IOMUX_PAD(0x340, 0x94, 5, 0x760, 1, MX50_SD_PAD_CTRL)
-
-#define MX50_PAD_UART2_RXD__UART2_RXD  IOMUX_PAD(0x344, 0x98, 0, 0x7cc, 3, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART2_RXD__GPIO_6_11  IOMUX_PAD(0x344, 0x98, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART2_RXD__SD4_D7     IOMUX_PAD(0x344, 0x98, 4, 0x76c, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART2_RXD__SD4_D5     IOMUX_PAD(0x344, 0x98, 5, 0x764, 1, MX50_SD_PAD_CTRL)
-
-#define MX50_PAD_UART2_CTS__UART2_CTS  IOMUX_PAD(0x348, 0x9C, 0, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART2_CTS__GPIO_6_12  IOMUX_PAD(0x348, 0x9C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART2_CTS__SD4_CMD    IOMUX_PAD(0x348, 0x9C, 4, 0x74c, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART2_CTS__SD4_D6     IOMUX_PAD(0x348, 0x9C, 5, 0x768, 1, MX50_SD_PAD_CTRL)
-
-#define MX50_PAD_UART2_RTS__UART2_RTS  IOMUX_PAD(0x34C, 0xA0, 0, 0x7c8, 3, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART2_RTS__GPIO_6_13  IOMUX_PAD(0x34C, 0xA0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART2_RTS__SD4_CLK    IOMUX_PAD(0x34C, 0xA0, 4, 0x748, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART2_RTS__SD4_D7     IOMUX_PAD(0x34C, 0xA0, 5, 0x76c, 1, MX50_SD_PAD_CTRL)
-
-#define MX50_PAD_UART3_TXD__UART3_TXD  IOMUX_PAD(0x350, 0xA4, 0, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART3_TXD__GPIO_6_14  IOMUX_PAD(0x350, 0xA4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART3_TXD__SD1_D4     IOMUX_PAD(0x350, 0xA4, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART3_TXD__SD4_D0     IOMUX_PAD(0x350, 0xA4, 4, 0x750, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART3_TXD__SD2_WP     IOMUX_PAD(0x350, 0xA4, 5, 0x744, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART3_TXD__WEIM_D12   IOMUX_PAD(0x350, 0xA4, 6, 0x81c, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_UART3_RXD__UART3_RXD  IOMUX_PAD(0x354, 0xA8, 0, 0x7d4, 1, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART3_RXD__GPIO_6_15  IOMUX_PAD(0x354, 0xA8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART3_RXD__SD1_D5     IOMUX_PAD(0x354, 0xA8, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART3_RXD__SD4_D1     IOMUX_PAD(0x354, 0xA8, 4, 0x754, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART3_RXD__SD2_CD     IOMUX_PAD(0x354, 0xA8, 5, 0x740, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART3_RXD__WEIM_D13   IOMUX_PAD(0x354, 0xA8, 6, 0x820, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_UART4_TXD__UART4_TXD  IOMUX_PAD(0x358, 0xAC, 0, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART4_TXD__GPIO_6_16  IOMUX_PAD(0x358, 0xAC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART4_TXD__UART3_CTS  IOMUX_PAD(0x358, 0xAC, 2, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART4_TXD__SD1_D6     IOMUX_PAD(0x358, 0xAC, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART4_TXD__SD4_D2     IOMUX_PAD(0x358, 0xAC, 4, 0x758, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART4_TXD__SD2_LCTL   IOMUX_PAD(0x358, 0xAC, 5, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART4_TXD__WEIM_D14   IOMUX_PAD(0x358, 0xAC, 6, 0x824, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_UART4_RXD__UART4_RXD  IOMUX_PAD(0x35C, 0xB0, 0, 0x7dc, 1, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART4_RXD__GPIO_6_17  IOMUX_PAD(0x35C, 0xB0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_UART4_RXD__UART3_RTS  IOMUX_PAD(0x35C, 0xB0, 2, 0x7d0, 1, MX50_UART_PAD_CTRL)
-#define MX50_PAD_UART4_RXD__SD1_D7     IOMUX_PAD(0x35C, 0xB0, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART4_RXD__SD4_D3     IOMUX_PAD(0x35C, 0xB0, 4, 0x75c, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART4_RXD__SD1_LCTL   IOMUX_PAD(0x35C, 0xB0, 5, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_UART4_RXD__WEIM_D15   IOMUX_PAD(0x35C, 0xB0, 6, 0x828, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_CSPI_SCLK__CSPI_SCLK  IOMUX_PAD(0x360, 0xB4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_CSPI_SCLK__GPIO_4_8   IOMUX_PAD(0x360, 0xB4, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_CSPI_MOSI__CSPI_MOSI  IOMUX_PAD(0x364, 0xB8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_CSPI_MOSI__GPIO_4_9   IOMUX_PAD(0x364, 0xB8, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_CSPI_MISO__CSPI_MISO  IOMUX_PAD(0x368, 0xBC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_CSPI_MISO__GPIO_4_10  IOMUX_PAD(0x368, 0xBC, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_CSPI_SS0__CSPI_SS0    IOMUX_PAD(0x36C, 0xC0, 0, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_CSPI_SS0__GPIO_4_11   IOMUX_PAD(0x36C, 0xC0, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_ECSPI1_SCLK__ECSPI1_SCLK      IOMUX_PAD(0x370, 0xC4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_SCLK__GPIO_4_12                IOMUX_PAD(0x370, 0xC4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_SCLK__CSPI_RDY         IOMUX_PAD(0x370, 0xC4, 2, 0x6e8, 1, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_SCLK__ECSPI2_RDY       IOMUX_PAD(0x370, 0xC4, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_SCLK__UART3_RTS                IOMUX_PAD(0x370, 0xC4, 4, 0x7d0, 2, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI1_SCLK__EPDC_SDCE6       IOMUX_PAD(0x370, 0xC4, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_SCLK__WEIM_D8          IOMUX_PAD(0x370, 0xC4, 7, 0x80c, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_ECSPI1_MOSI__ECSPI1_MOSI      IOMUX_PAD(0x374, 0xC8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_MOSI__GPIO_4_13                IOMUX_PAD(0x374, 0xC8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_MOSI__CSPI_SS1         IOMUX_PAD(0x374, 0xC8, 2, 0x6ec, 1, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_MOSI__ECSPI2_SS1       IOMUX_PAD(0x374, 0xC8, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_MOSI__UART3_CTS                IOMUX_PAD(0x374, 0xC8, 4, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI1_MOSI__EPDC_SDCE7       IOMUX_PAD(0x374, 0xC8, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_MOSI__WEIM_D9          IOMUX_PAD(0x374, 0xC8, 7, 0x810, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_ECSPI1_MISO__ECSPI1_MISO      IOMUX_PAD(0x378, 0xCC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_MISO__GPIO_4_14                IOMUX_PAD(0x378, 0xCC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_MISO__CSPI_SS2         IOMUX_PAD(0x378, 0xCC, 2, 0x6f0, 1, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_MISO__ECSPI2_SS2       IOMUX_PAD(0x378, 0xCC, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_MISO__UART4_RTS                IOMUX_PAD(0x378, 0xCC, 4, 0x7d8, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI1_MISO__EPDC_SDCE8       IOMUX_PAD(0x378, 0xCC, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_MISO__WEIM_D10         IOMUX_PAD(0x378, 0xCC, 7, 0x814, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_ECSPI1_SS0__ECSPI1_SS0                IOMUX_PAD(0x37C, 0xD0, 0, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_SS0__GPIO_4_15         IOMUX_PAD(0x37C, 0xD0, 1, 0x0, 0, PAD_CTL_PUS_100K_UP)
-#define MX50_PAD_ECSPI1_SS0__CSPI_SS3          IOMUX_PAD(0x37C, 0xD0, 2, 0x6f4, 1, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_SS0__ECSPI2_SS3                IOMUX_PAD(0x37C, 0xD0, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI1_SS0__UART4_CTS         IOMUX_PAD(0x37C, 0xD0, 4, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI1_SS0__EPDC_SDCE9                IOMUX_PAD(0x37C, 0xD0, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI1_SS0__WEIM_D11          IOMUX_PAD(0x37C, 0xD0, 7, 0x818, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_ECSPI2_SCLK__ECSPI2_SCLK      IOMUX_PAD(0x380, 0xD4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SCLK__GPIO_4_16                IOMUX_PAD(0x380, 0xD4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SCLK__ELCDIF_WR                IOMUX_PAD(0x380, 0xD4, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SCLK__ECSPI1_RDY       IOMUX_PAD(0x380, 0xD4, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SCLK__UART5_RTS                IOMUX_PAD(0x380, 0xD4, 4, 0x7e0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SCLK__ELCDIF_DOTCLK    IOMUX_PAD(0x380, 0xD4, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SCLK__NANDF_CEN4       IOMUX_PAD(0x380, 0xD4, 6, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SCLK__WEIM_D8          IOMUX_PAD(0x380, 0xD4, 7, 0x80c, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_ECSPI2_MOSI__ECSPI2_MOSI      IOMUX_PAD(0x384, 0xD8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MOSI__GPIO_4_17                IOMUX_PAD(0x384, 0xD8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MOSI__ELCDIF_RD                IOMUX_PAD(0x384, 0xD8, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MOSI__ECSPI1_SS1       IOMUX_PAD(0x384, 0xD8, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI2_MOSI__UART5_CTS                IOMUX_PAD(0x384, 0xD8, 4, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MOSI__ELCDIF_EN                IOMUX_PAD(0x384, 0xD8, 5, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MOSI__NANDF_CEN5       IOMUX_PAD(0x384, 0xD8, 6, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MOSI__WEIM_D9          IOMUX_PAD(0x384, 0xD8, 7, 0x810, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_ECSPI2_MISO__ECSPI2_MISO      IOMUX_PAD(0x388, 0xDC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MISO__GPIO_4_18                IOMUX_PAD(0x388, 0xDC, 1, 0x0, 0, PAD_CTL_PUS_100K_UP)
-#define MX50_PAD_ECSPI2_MISO__ELCDIF_RS                IOMUX_PAD(0x388, 0xDC, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MISO__ECSPI1_SS2       IOMUX_PAD(0x388, 0xDC, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI2_MISO__UART5_TXD                IOMUX_PAD(0x388, 0xDC, 4, 0x0, 0, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MISO__ELCDIF_VSYNC     IOMUX_PAD(0x388, 0xDC, 5, 0x73c, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MISO__NANDF_CEN6       IOMUX_PAD(0x388, 0xDC, 6, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_MISO__WEIM_D10         IOMUX_PAD(0x388, 0xDC, 7, 0x814, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_ECSPI2_SS0__ECSPI2_SS0                IOMUX_PAD(0x38C, 0xE0, 0, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI2_SS0__GPIO_4_19         IOMUX_PAD(0x38C, 0xE0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SS0__ELCDIF_CS         IOMUX_PAD(0x38C, 0xE0, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SS0__ECSPI1_SS3                IOMUX_PAD(0x38C, 0xE0, 3, 0x0, 0, MX50_CSPI_SS_PAD)
-#define MX50_PAD_ECSPI2_SS0__UART5_RXD         IOMUX_PAD(0x38C, 0xE0, 4, 0x7e4, 5, MX50_UART_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SS0__ELCDIF_HSYNC      IOMUX_PAD(0x38C, 0xE0, 5, 0x6f8, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SS0__NANDF_CEN7                IOMUX_PAD(0x38C, 0xE0, 6, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_ECSPI2_SS0__WEIM_D11          IOMUX_PAD(0x38C, 0xE0, 7, 0x818, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_SD1_CLK__SD1_CLK      IOMUX_PAD(0x390, 0xE4, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD1_CLK__GPIO_5_0     IOMUX_PAD(0x390, 0xE4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD1_CLK__CLKO         IOMUX_PAD(0x390, 0xE4, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD1_CMD__SD1_CMD      IOMUX_PAD(0x394, 0xE8, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD1_CMD__GPIO_5_1     IOMUX_PAD(0x394, 0xE8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD1_CMD__CLKO2                IOMUX_PAD(0x394, 0xE8, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD1_D0__SD1_D0                IOMUX_PAD(0x398, 0xEC, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD1_D0__GPIO_5_2      IOMUX_PAD(0x398, 0xEC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD1_D0__PLL1_BYP      IOMUX_PAD(0x398, 0xEC, 7, 0x6dc, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD1_D1__SD1_D1                IOMUX_PAD(0x39C, 0xF0, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD1_D1__GPIO_5_3      IOMUX_PAD(0x39C, 0xF0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD1_D1__PLL2_BYP      IOMUX_PAD(0x39C, 0xF0, 7, 0x6e0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD1_D2__SD1_D2                IOMUX_PAD(0x3A0, 0xF4, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD1_D2__GPIO_5_4      IOMUX_PAD(0x3A0, 0xF4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD1_D2__PLL3_BYP      IOMUX_PAD(0x3A0, 0xF4, 7, 0x6e4, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD1_D3__SD1_D3                IOMUX_PAD(0x3A4, 0xF8, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD1_D3__GPIO_5_5      IOMUX_PAD(0x3A4, 0xF8, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_CLK__SD2_CLK      IOMUX_PAD(0x3A8, 0xFC, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_CLK__GPIO_5_6     IOMUX_PAD(0x3A8, 0xFC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_CLK__MSHC_SCLK    IOMUX_PAD(0x3A8, 0xFC, 2, 0x0, 0, MX50_SD_PAD_CTRL)
-
-#define MX50_PAD_SD2_CMD__SD2_CMD      IOMUX_PAD(0x3AC, 0x100, IOMUX_CONFIG_SION, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_CMD__GPIO_5_7     IOMUX_PAD(0x3AC, 0x100, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_CMD__MSHC_BS      IOMUX_PAD(0x3AC, 0x100, 2, 0x0, 0, MX50_SD_PAD_CTRL)
-
-#define MX50_PAD_SD2_D0__SD2_D0                IOMUX_PAD(0x3B0, 0x104, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D0__GPIO_5_8      IOMUX_PAD(0x3B0, 0x104, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D0__MSHC_D0       IOMUX_PAD(0x3B0, 0x104, 2, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D0__KEY_COL4      IOMUX_PAD(0x3B0, 0x104, 3, 0x790, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_D1__SD2_D1                IOMUX_PAD(0x3B4, 0x108, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D1__GPIO_5_9      IOMUX_PAD(0x3B4, 0x108, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D1__MSHC_D1       IOMUX_PAD(0x3B4, 0x108, 2, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D1__KEY_ROW4      IOMUX_PAD(0x3B4, 0x108, 3, 0x7a0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_D2__SD2_D2                IOMUX_PAD(0x3B8, 0x10C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D2__GPIO_5_10     IOMUX_PAD(0x3B8, 0x10C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D2__MSHC_D2       IOMUX_PAD(0x3B8, 0x10C, 2, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D2__KEY_COL5      IOMUX_PAD(0x3B8, 0x10C, 3, 0x794, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_D3__SD2_D3                IOMUX_PAD(0x3BC, 0x110, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D3__GPIO_5_11     IOMUX_PAD(0x3BC, 0x110, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D3__MSHC_D3       IOMUX_PAD(0x3BC, 0x110, 2, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D3__KEY_ROW5      IOMUX_PAD(0x3BC, 0x110, 3, 0x7a4, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_D4__SD2_D4                IOMUX_PAD(0x3C0, 0x114, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D4__GPIO_5_12     IOMUX_PAD(0x3C0, 0x114, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D4__AUD4_RXFS     IOMUX_PAD(0x3C0, 0x114, 2, 0x6d0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D4__KEY_COL6      IOMUX_PAD(0x3C0, 0x114, 3, 0x798, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D4__WEIM_D0       IOMUX_PAD(0x3C0, 0x114, 4, 0x7ec, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D4__CCM_OUT0      IOMUX_PAD(0x3C0, 0x114, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_D5__SD2_D5                IOMUX_PAD(0x3C4, 0x118, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D5__GPIO_5_13     IOMUX_PAD(0x3C4, 0x118, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D5__AUD4_RXC      IOMUX_PAD(0x3C4, 0x118, 2, 0x6cc, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D5__KEY_ROW6      IOMUX_PAD(0x3C4, 0x118, 3, 0x7a8, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D5__WEIM_D1       IOMUX_PAD(0x3C4, 0x118, 4, 0x7f0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D5__CCM_OUT1      IOMUX_PAD(0x3C4, 0x118, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_D6__SD2_D6                IOMUX_PAD(0x3C8, 0x11C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D6__GPIO_5_14     IOMUX_PAD(0x3C8, 0x11C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D6__AUD4_RXD      IOMUX_PAD(0x3C8, 0x11C, 2, 0x6c4, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D6__KEY_COL7      IOMUX_PAD(0x3C8, 0x11C, 3, 0x79c, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D6__WEIM_D2       IOMUX_PAD(0x3C8, 0x11C, 4, 0x7f4, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D6__CCM_OUT2      IOMUX_PAD(0x3C8, 0x11C, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_D7__SD2_D7                IOMUX_PAD(0x3CC, 0x120, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_D7__GPIO_5_15     IOMUX_PAD(0x3CC, 0x120, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D7__AUD4_TXFS     IOMUX_PAD(0x3CC, 0x120, 2, 0x6d8, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D7__KEY_ROW7      IOMUX_PAD(0x3CC, 0x120, 3, 0x7ac, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D7__WEIM_D3       IOMUX_PAD(0x3CC, 0x120, 4, 0x7f8, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_D7__CCM_STOP      IOMUX_PAD(0x3CC, 0x120, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_WP__SD2_WP                IOMUX_PAD(0x3D0, 0x124, 0, 0x744, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_WP__GPIO_5_16     IOMUX_PAD(0x3D0, 0x124, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_WP__AUD4_TXD      IOMUX_PAD(0x3D0, 0x124, 2, 0x6c8, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_WP__WEIM_D4       IOMUX_PAD(0x3D0, 0x124, 4, 0x7fc, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_WP__CCM_WAIT      IOMUX_PAD(0x3D0, 0x124, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD2_CD__SD2_CD                IOMUX_PAD(0x3D4, 0x128, 0, 0x740, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD2_CD__GPIO_5_17     IOMUX_PAD(0x3D4, 0x128, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_CD__AUD4_TXC      IOMUX_PAD(0x3D4, 0x128, 2, 0x6d4, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_CD__WEIM_D5       IOMUX_PAD(0x3D4, 0x128, 4, 0x800, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD2_CD__CCM_REF_EN    IOMUX_PAD(0x3D4, 0x128, 7, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_ON_REQ__PMIC_ON_REQ      IOMUX_PAD(0x3D8, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_STBY_REQ__PMIC_STBY_REQ  IOMUX_PAD(0x3DC, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_PORT_B__PMIC_PORT_B      IOMUX_PAD(0x3E0, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_BOOT_MODE1__PMIC_BOOT_MODE1      IOMUX_PAD(0x3E4, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_RESET_IN_B__PMIC_RESET_IN_B      IOMUX_PAD(0x3E8, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_BOOT_MODE0__PMIC_BOOT_MODE0      IOMUX_PAD(0x3EC, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_TEST_MODE__PMIC_TEST_MODE        IOMUX_PAD(0x3F0, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_JTAG_TMS__PMIC_JTAG_TMS  IOMUX_PAD(0x3F4, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_JTAG_MOD__PMIC_JTAG_MOD  IOMUX_PAD(0x3F8, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_JTAG_TRSTB__PMIC_JTAG_TRSTB      IOMUX_PAD(0x3FC, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_JTAG_TDI__PMIC_JTAG_TDI  IOMUX_PAD(0x400, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_JTAG_TCK__PMIC_JTAG_TCK  IOMUX_PAD(0x404, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_PMIC_JTAG_TDO__PMIC_JTAG_TDO  IOMUX_PAD(0x408, 0, 0, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D0__DISP_D0      IOMUX_PAD(0x40C, 0x12C, 0, 0x6fc, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D0__GPIO_2_0     IOMUX_PAD(0x40C, 0x12C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D0__FEC_TXCLK    IOMUX_PAD(0x40C, 0x12C, 2, 0x78c, 0, PAD_CTL_HYS | PAD_CTL_PKE)
-
-#define MX50_PAD_DISP_D1__DISP_D1      IOMUX_PAD(0x410, 0x130, 0, 0x700, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D1__GPIO_2_1     IOMUX_PAD(0x410, 0x130, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D1__FEC_RX_ER    IOMUX_PAD(0x410, 0x130, 2, 0x788, 0, PAD_CTL_HYS | PAD_CTL_PKE)
-#define MX50_PAD_DISP_D1__WEIM_A17     IOMUX_PAD(0x410, 0x130, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D2__DISP_D2      IOMUX_PAD(0x414, 0x134, 0, 0x704, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D2__GPIO_2_2     IOMUX_PAD(0x414, 0x134, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D2__FEC_RX_DV    IOMUX_PAD(0x414, 0x134, 2, 0x784, 0, PAD_CTL_HYS | PAD_CTL_PKE)
-#define MX50_PAD_DISP_D2__WEIM_A18     IOMUX_PAD(0x414, 0x134, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D3__DISP_D3      IOMUX_PAD(0x418, 0x138, 0, 0x708, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D3__GPIO_2_3     IOMUX_PAD(0x418, 0x138, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D3__FEC_RXD1     IOMUX_PAD(0x418, 0x138, 2, 0x77C, 0, PAD_CTL_HYS | PAD_CTL_PKE)
-#define MX50_PAD_DISP_D3__WEIM_A19     IOMUX_PAD(0x418, 0x138, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D3__FEC_COL      IOMUX_PAD(0x418, 0x138, 4, 0x770, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D4__DISP_D4      IOMUX_PAD(0x41C, 0x13C, 0, 0x70c, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D4__GPIO_2_4     IOMUX_PAD(0x41C, 0x13C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D4__FEC_RXD0     IOMUX_PAD(0x41C, 0x13C, 2, 0x778, 0, PAD_CTL_HYS | PAD_CTL_PKE)
-#define MX50_PAD_DISP_D4__WEIM_A20     IOMUX_PAD(0x41C, 0x13C, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D5__DISP_D5      IOMUX_PAD(0x420, 0x140, 0, 0x710, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D5__GPIO_2_5     IOMUX_PAD(0x420, 0x140, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D5__FEC_TX_EN    IOMUX_PAD(0x420, 0x140, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_DISP_D5__WEIM_A21     IOMUX_PAD(0x420, 0x140, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D6__DISP_D6      IOMUX_PAD(0x424, 0x144, 0, 0x714, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D6__GPIO_2_6     IOMUX_PAD(0x424, 0x144, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D6__FEC_TXD1     IOMUX_PAD(0x424, 0x144, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_DISP_D6__WEIM_A22     IOMUX_PAD(0x424, 0x144, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D6__FEC_RX_CLK   IOMUX_PAD(0x424, 0x144, 4, 0x780, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D7__DISP_D7      IOMUX_PAD(0x428, 0x148, 0, 0x718, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D7__GPIO_2_7     IOMUX_PAD(0x428, 0x148, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D7__FEC_TXD0     IOMUX_PAD(0x428, 0x148, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_DISP_D7__WEIM_A23     IOMUX_PAD(0x428, 0x148, 3, 0x0, 0, NO_PAD_CTRL)
-
-
-#define MX50_PAD_DISP_WR__ELCDIF_WR    IOMUX_PAD(0x42C, 0x14C, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_WR__GPIO_2_16    IOMUX_PAD(0x42C, 0x14C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_WR__ELCDIF_PIXCLK        IOMUX_PAD(0x42C, 0x14C, 2, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_WR__WEIM_A24     IOMUX_PAD(0x42C, 0x14C, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_RD__ELCDIF_RD    IOMUX_PAD(0x430, 0x150, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_RD__GPIO_2_19    IOMUX_PAD(0x430, 0x150, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_RD__ELCDIF_EN    IOMUX_PAD(0x430, 0x150, 2, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_RD__WEIM_A25     IOMUX_PAD(0x430, 0x150, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_RS__ELCDIF_RS    IOMUX_PAD(0x434, 0x154, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_RS__GPIO_2_17    IOMUX_PAD(0x434, 0x154, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_RS__ELCDIF_VSYNC IOMUX_PAD(0x434, 0x154, 2, 0x73c, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_RS__WEIM_A26     IOMUX_PAD(0x434, 0x154, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_CS__ELCDIF_CS    IOMUX_PAD(0x438, 0x158, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_CS__GPIO_2_21    IOMUX_PAD(0x438, 0x158, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_CS__ELCDIF_HSYNC IOMUX_PAD(0x438, 0x158, 2, 0x6f8, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_CS__WEIM_A27     IOMUX_PAD(0x438, 0x158, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_CS__WEIM_CS3     IOMUX_PAD(0x438, 0x158, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_BUSY__ELCDIF_HSYNC       IOMUX_PAD(0x43C, 0x15C, 0, 0x6f8, 2, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_BUSY__GPIO_2_18          IOMUX_PAD(0x43C, 0x15C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_BUSY__WEIM_CS3           IOMUX_PAD(0x43C, 0x15C, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_RESET__ELCDIF_RST        IOMUX_PAD(0x440, 0x160, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_RESET__GPIO_2_20 IOMUX_PAD(0x440, 0x160, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_RESET__WEIM_CS3  IOMUX_PAD(0x440, 0x160, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_CMD__SD3_CMD      IOMUX_PAD(0x444, 0x164, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_CMD__GPIO_5_18    IOMUX_PAD(0x444, 0x164, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_CMD__NANDF_WRN    IOMUX_PAD(0x444, 0x164, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_CMD__SSP_CMD      IOMUX_PAD(0x444, 0x164, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_CLK__SD3_CLK      IOMUX_PAD(0x448, 0x168, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_CLK__GPIO_5_19    IOMUX_PAD(0x448, 0x168, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_CLK__NANDF_RDN    IOMUX_PAD(0x448, 0x168, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_CLK__SSP_CLK      IOMUX_PAD(0x448, 0x168, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_D0__SD3_D0                IOMUX_PAD(0x44C, 0x16C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_D0__GPIO_5_20     IOMUX_PAD(0x44C, 0x16C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_D0__NANDF_D4      IOMUX_PAD(0x44C, 0x16C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_D0__SSP_D0                IOMUX_PAD(0x44C, 0x16C, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD3_D0__PLL1_BYP      IOMUX_PAD(0x44C, 0x16C, 7, 0x6dc, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_D1__SD3_D1                IOMUX_PAD(0x450, 0x170, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_D1__GPIO_5_21     IOMUX_PAD(0x450, 0x170, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_D1__NANDF_D5      IOMUX_PAD(0x450, 0x170, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_D1__PLL2_BYP      IOMUX_PAD(0x450, 0x170, 7, 0x6e0, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_D2__SD3_D2                IOMUX_PAD(0x454, 0x174, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_D2__GPIO_5_22     IOMUX_PAD(0x454, 0x174, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_D2__NANDF_D6      IOMUX_PAD(0x454, 0x174, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_D2__SSP_D2                IOMUX_PAD(0x454, 0x174, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD3_D2__PLL3_BYP      IOMUX_PAD(0x454, 0x174, 7, 0x6e4, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_D3__SD3_D3                IOMUX_PAD(0x458, 0x178, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_D3__GPIO_5_23     IOMUX_PAD(0x458, 0x178, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_D3__NANDF_D7      IOMUX_PAD(0x458, 0x178, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_D3__SSP_D3                IOMUX_PAD(0x458, 0x178, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_D4__SD3_D4                IOMUX_PAD(0x45C, 0x17C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_D4__GPIO_5_24     IOMUX_PAD(0x45C, 0x17C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_D4__NANDF_D0      IOMUX_PAD(0x45C, 0x17C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_D4__SSP_D4                IOMUX_PAD(0x45C, 0x17C, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_D5__SD3_D5                IOMUX_PAD(0x460, 0x180, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_D5__GPIO_5_25     IOMUX_PAD(0x460, 0x180, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_D5__NANDF_D1      IOMUX_PAD(0x460, 0x180, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_D5__SSP_D5                IOMUX_PAD(0x460, 0x180, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_D6__SD3_D6                IOMUX_PAD(0x464, 0x184, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_D6__GPIO_5_26     IOMUX_PAD(0x464, 0x184, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_D6__NANDF_D2      IOMUX_PAD(0x464, 0x184, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_D6__SSP_D6                IOMUX_PAD(0x464, 0x184, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_D7__SD3_D7                IOMUX_PAD(0x468, 0x188, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_D7__GPIO_5_27     IOMUX_PAD(0x468, 0x188, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_D7__NANDF_D3      IOMUX_PAD(0x468, 0x188, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_D7__SSP_D7                IOMUX_PAD(0x468, 0x188, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_SD3_WP__SD3_WP                IOMUX_PAD(0x46C, 0x18C, 0, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_WP__GPIO_5_28     IOMUX_PAD(0x46C, 0x18C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_SD3_WP__NANDF_RESETN  IOMUX_PAD(0x46C, 0x18C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_SD3_WP__SSP_CD                IOMUX_PAD(0x46C, 0x18C, 3, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_SD3_WP__SD4_LCTL      IOMUX_PAD(0x46C, 0x18C, 4, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_SD3_WP__WEIM_CS3      IOMUX_PAD(0x46C, 0x18C, 5, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D8__DISP_D8      IOMUX_PAD(0x470, 0x190, 0, 0x71c, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D8__GPIO_2_8     IOMUX_PAD(0x470, 0x190, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D8__NANDF_CLE    IOMUX_PAD(0x470, 0x190, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D8__SD1_LCTL     IOMUX_PAD(0x470, 0x190, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D8__SD4_CMD      IOMUX_PAD(0x470, 0x190, 4, 0x74c, 2, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D8__KEY_COL4     IOMUX_PAD(0x470, 0x190, 5, 0x790, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D8__FEC_TX_CLK   IOMUX_PAD(0x470, 0x190, 6, 0x78c, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D9__DISP_D9      IOMUX_PAD(0x474, 0x194, 0, 0x720, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D9__GPIO_2_9     IOMUX_PAD(0x474, 0x194, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D9__NANDF_ALE    IOMUX_PAD(0x474, 0x194, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D9__SD2_LCTL     IOMUX_PAD(0x474, 0x194, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D9__SD4_CLK      IOMUX_PAD(0x474, 0x194, 4, 0x748, 2, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D9__KEY_ROW4     IOMUX_PAD(0x474, 0x194, 5, 0x7a0, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D9__FEC_RX_ER    IOMUX_PAD(0x474, 0x194, 6, 0x788, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D10__DISP_D10    IOMUX_PAD(0x478, 0x198, 0, 0x724, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D10__GPIO_2_10   IOMUX_PAD(0x478, 0x198, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D10__NANDF_CEN0  IOMUX_PAD(0x478, 0x198, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D10__SD3_LCTL    IOMUX_PAD(0x478, 0x198, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D10__SD4_D0      IOMUX_PAD(0x478, 0x198, 4, 0x750, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D10__KEY_COL5    IOMUX_PAD(0x478, 0x198, 5, 0x794, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D10__FEC_RX_DV   IOMUX_PAD(0x478, 0x198, 6, 0x784, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D11__DISP_D11    IOMUX_PAD(0x47C, 0x19C, 0, 0x728, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D11__GPIO_2_11   IOMUX_PAD(0x47C, 0x19C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D11__NANDF_CEN1  IOMUX_PAD(0x47C, 0x19C, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D11__SD4_D1      IOMUX_PAD(0x47C, 0x19C, 4, 0x754, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D11__KEY_ROW5    IOMUX_PAD(0x47C, 0x19C, 5, 0x7a4, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D11__FEC_RDAT1   IOMUX_PAD(0x47C, 0x19C, 6, 0x77c, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D12__DISP_D12    IOMUX_PAD(0x480, 0x1A0, 0, 0x72c, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D12__GPIO_2_12   IOMUX_PAD(0x480, 0x1A0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D12__NANDF_CEN2  IOMUX_PAD(0x480, 0x1A0, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D12__SD1_CD      IOMUX_PAD(0x480, 0x1A0, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D12__SD4_D2      IOMUX_PAD(0x480, 0x1A0, 4, 0x758, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D12__KEY_COL6    IOMUX_PAD(0x480, 0x1A0, 5, 0x798, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D12__FEC_RDAT0   IOMUX_PAD(0x480, 0x1A0, 6, 0x778, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D13__DISP_D13    IOMUX_PAD(0x484, 0x1A4, 0, 0x730, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D13__GPIO_2_13   IOMUX_PAD(0x484, 0x1A4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D13__NANDF_CEN3  IOMUX_PAD(0x484, 0x1A4, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D13__SD3_CD      IOMUX_PAD(0x484, 0x1A4, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D13__SD4_D3      IOMUX_PAD(0x484, 0x1A4, 4, 0x75c, 1, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D13__KEY_ROW6    IOMUX_PAD(0x484, 0x1A4, 5, 0x7a8, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D13__FEC_TX_EN   IOMUX_PAD(0x484, 0x1A4, 6, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D14__DISP_D14    IOMUX_PAD(0x488, 0x1A8, 0, 0x734, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D14__GPIO_2_14   IOMUX_PAD(0x488, 0x1A8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D14__NANDF_RDY0  IOMUX_PAD(0x488, 0x1A8, 2, 0x7b4, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D14__SD1_WP      IOMUX_PAD(0x488, 0x1A8, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D14__SD4_WP      IOMUX_PAD(0x488, 0x1A8, 4, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D14__KEY_COL7    IOMUX_PAD(0x488, 0x1A8, 5, 0x79c, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D14__FEC_TDAT1   IOMUX_PAD(0x488, 0x1A8, 6, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_DISP_D15__DISP_D15    IOMUX_PAD(0x48C, 0x1AC, 0, 0x738, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_DISP_D15__GPIO_2_15   IOMUX_PAD(0x48C, 0x1AC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D15__NANDF_DQS   IOMUX_PAD(0x48C, 0x1AC, 2, 0x7b0, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D15__SD3_RST     IOMUX_PAD(0x48C, 0x1AC, 3, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D15__SD4_CD      IOMUX_PAD(0x48C, 0x1AC, 4, 0x0, 0, MX50_SD_PAD_CTRL)
-#define MX50_PAD_DISP_D15__KEY_ROW7    IOMUX_PAD(0x48C, 0x1AC, 5, 0x7ac, 1, NO_PAD_CTRL)
-#define MX50_PAD_DISP_D15__FEC_TDAT0   IOMUX_PAD(0x48C, 0x1AC, 6, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D0__EPDC_D0      IOMUX_PAD(0x54C, 0x1B0, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D0__GPIO_3_0     IOMUX_PAD(0x54C, 0x1B0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D0__WEIM_D0      IOMUX_PAD(0x54C, 0x1B0, 2, 0x7ec, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D0__ELCDIF_RS    IOMUX_PAD(0x54C, 0x1B0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_D0__ELCDIF_PIXCLK        IOMUX_PAD(0x54C, 0x1B0, 4, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D1__EPDC_D1      IOMUX_PAD(0x550, 0x1B4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D1__GPIO_3_1     IOMUX_PAD(0x550, 0x1B4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D1__WEIM_D1      IOMUX_PAD(0x550, 0x1B4, 2, 0x7f0, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D1__ELCDIF_CS    IOMUX_PAD(0x550, 0x1B4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_D1__ELCDIF_EN    IOMUX_PAD(0x550, 0x1B4, 4, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D2__EPDC_D2      IOMUX_PAD(0x554, 0x1B8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D2__GPIO_3_2     IOMUX_PAD(0x554, 0x1B8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D2__WEIM_D2      IOMUX_PAD(0x554, 0x1B8, 2, 0x7f4, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D2__ELCDIF_WR    IOMUX_PAD(0x554, 0x1B8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_D2__ELCDIF_VSYNC IOMUX_PAD(0x554, 0x1B8, 4, 0x73c, 2, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D3__EPDC_D3      IOMUX_PAD(0x558, 0x1BC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D3__GPIO_3_3     IOMUX_PAD(0x558, 0x1BC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D3__WEIM_D3      IOMUX_PAD(0x558, 0x1BC, 2, 0x7f8, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D3__ELCDIF_RD    IOMUX_PAD(0x558, 0x1BC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_D3__ELCDIF_HSYNC IOMUX_PAD(0x558, 0x1BC, 4, 0x6f8, 3, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D4__EPDC_D4      IOMUX_PAD(0x55C, 0x1C0, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D4__GPIO_3_4     IOMUX_PAD(0x55C, 0x1C0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D4__WEIM_D4      IOMUX_PAD(0x55C, 0x1C0, 2, 0x7fc, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D5__EPDC_D5      IOMUX_PAD(0x560, 0x1C4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D5__GPIO_3_5     IOMUX_PAD(0x560, 0x1C4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D5__WEIM_D5      IOMUX_PAD(0x560, 0x1C4, 2, 0x800, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D6__EPDC_D6      IOMUX_PAD(0x564, 0x1C8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D6__GPIO_3_6     IOMUX_PAD(0x564, 0x1C8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D6__WEIM_D6      IOMUX_PAD(0x564, 0x1C8, 2, 0x804, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D7__EPDC_D7      IOMUX_PAD(0x568, 0x1CC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D7__GPIO_3_7     IOMUX_PAD(0x568, 0x1CC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D7__WEIM_D7      IOMUX_PAD(0x568, 0x1CC, 2, 0x808, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D8__EPDC_D8      IOMUX_PAD(0x56C, 0x1D0, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D8__GPIO_3_8     IOMUX_PAD(0x56C, 0x1D0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D8__WEIM_D8      IOMUX_PAD(0x56C, 0x1D0, 2, 0x80c, 2, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D8__ELCDIF_D24   IOMUX_PAD(0x56C, 0x1D0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D9__EPDC_D9      IOMUX_PAD(0x570, 0x1D4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D9__GPIO_3_9     IOMUX_PAD(0x570, 0x1D4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D9__WEIM_D9      IOMUX_PAD(0x570, 0x1D4, 2, 0x810, 2, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D9__ELCDIF_D25   IOMUX_PAD(0x570, 0x1D4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D10__EPDC_D10    IOMUX_PAD(0x574, 0x1D8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D10__GPIO_3_10   IOMUX_PAD(0x574, 0x1D8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D10__WEIM_D10    IOMUX_PAD(0x574, 0x1D8, 2, 0x814, 2, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D10__ELCDIF_D26  IOMUX_PAD(0x574, 0x1D8, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D11__EPDC_D11    IOMUX_PAD(0x578, 0x1DC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D11__GPIO_3_11   IOMUX_PAD(0x578, 0x1DC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D11__WEIM_D11    IOMUX_PAD(0x578, 0x1DC, 2, 0x818, 2, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D11__ELCDIF_D27  IOMUX_PAD(0x578, 0x1DC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D12__EPDC_D12    IOMUX_PAD(0x57C, 0x1E0, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D12__GPIO_3_12   IOMUX_PAD(0x57C, 0x1E0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D12__WEIM_D12    IOMUX_PAD(0x57C, 0x1E0, 2, 0x81c, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D12__ELCDIF_D28  IOMUX_PAD(0x57C, 0x1E0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D13__EPDC_D13    IOMUX_PAD(0x580, 0x1E4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D13__GPIO_3_13   IOMUX_PAD(0x580, 0x1E4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D13__WEIM_D13    IOMUX_PAD(0x580, 0x1E4, 2, 0x820, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D13__ELCDIF_D29  IOMUX_PAD(0x580, 0x1E4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D14__EPDC_D14    IOMUX_PAD(0x584, 0x1E8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D14__GPIO_3_14   IOMUX_PAD(0x584, 0x1E8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D14__WEIM_D14    IOMUX_PAD(0x584, 0x1E8, 2, 0x824, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D14__ELCDIF_D30  IOMUX_PAD(0x584, 0x1E8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_D14__AUD6_TXD    IOMUX_PAD(0x584, 0x1E8, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_D15__EPDC_D15    IOMUX_PAD(0x588, 0x1EC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D15__GPIO_3_15   IOMUX_PAD(0x588, 0x1EC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D15__WEIM_D15    IOMUX_PAD(0x588, 0x1EC, 2, 0x828, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_D15__ELCDIF_D31  IOMUX_PAD(0x588, 0x1EC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_D15__AUD6_TXC    IOMUX_PAD(0x588, 0x1EC, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_GDCLK__EPDC_GDCLK        IOMUX_PAD(0x58C, 0x1F0, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDCLK__GPIO_3_16 IOMUX_PAD(0x58C, 0x1F0, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDCLK__WEIM_D16  IOMUX_PAD(0x58C, 0x1F0, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDCLK__ELCDIF_D16        IOMUX_PAD(0x58C, 0x1F0, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_GDCLK__AUD6_TXFS IOMUX_PAD(0x58C, 0x1F0, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_GDSP__EPDC_GDSP  IOMUX_PAD(0x590, 0x1F4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDSP__GPIO_3_17  IOMUX_PAD(0x590, 0x1F4, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDSP__WEIM_D17   IOMUX_PAD(0x590, 0x1F4, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDSP__ELCDIF_D17 IOMUX_PAD(0x590, 0x1F4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_GDSP__AUD6_RXD   IOMUX_PAD(0x590, 0x1F4, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_GDOE__EPDC_GDOE  IOMUX_PAD(0x594, 0x1F8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDOE__GPIO_3_18  IOMUX_PAD(0x594, 0x1F8, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDOE__WEIM_D18   IOMUX_PAD(0x594, 0x1F8, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDOE__ELCDIF_D18 IOMUX_PAD(0x594, 0x1F8, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_GDOE__AUD6_RXC   IOMUX_PAD(0x594, 0x1F8, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_GDRL__EPDC_GDRL  IOMUX_PAD(0x598, 0x1FC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDRL__GPIO_3_19  IOMUX_PAD(0x598, 0x1FC, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDRL__WEIM_D19   IOMUX_PAD(0x598, 0x1FC, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_GDRL__ELCDIF_D19 IOMUX_PAD(0x598, 0x1FC, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_GDRL__AUD6_RXFS  IOMUX_PAD(0x598, 0x1FC, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDCLK__EPDC_SDCLK        IOMUX_PAD(0x59C, 0x200, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCLK__GPIO_3_20 IOMUX_PAD(0x59C, 0x200, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCLK__WEIM_D20  IOMUX_PAD(0x59C, 0x200, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCLK__ELCDIF_D20        IOMUX_PAD(0x59C, 0x200, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCLK__AUD5_TXD  IOMUX_PAD(0x59C, 0x200, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDOEZ__EPDC_SDOEZ        IOMUX_PAD(0x5A0, 0x204, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOEZ__GPIO_3_21 IOMUX_PAD(0x5A0, 0x204, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOEZ__WEIM_D21  IOMUX_PAD(0x5A0, 0x204, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOEZ__ELCDIF_D21        IOMUX_PAD(0x5A0, 0x204, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOEZ__AUD5_TXC  IOMUX_PAD(0x5A0, 0x204, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDOED__EPDC_SDOED        IOMUX_PAD(0x5A4, 0x208, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOED__GPIO_3_22 IOMUX_PAD(0x5A4, 0x208, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOED__WEIM_D22  IOMUX_PAD(0x5A4, 0x208, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOED__ELCDIF_D22        IOMUX_PAD(0x5A4, 0x208, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOED__AUD5_TXFS IOMUX_PAD(0x5A4, 0x208, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDOE__EPDC_SDOE  IOMUX_PAD(0x5A8, 0x20C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOE__GPIO_3_23  IOMUX_PAD(0x5A8, 0x20C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOE__WEIM_D23   IOMUX_PAD(0x5A8, 0x20C, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOE__ELCDIF_D23 IOMUX_PAD(0x5A8, 0x20C, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_SDOE__AUD5_RXD   IOMUX_PAD(0x5A8, 0x20C, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDLE__EPDC_SDLE  IOMUX_PAD(0x5AC, 0x210, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDLE__GPIO_3_24  IOMUX_PAD(0x5AC, 0x210, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDLE__WEIM_D24   IOMUX_PAD(0x5AC, 0x210, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDLE__ELCDIF_D8  IOMUX_PAD(0x5AC, 0x210, 3, 0x71c, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_SDLE__AUD5_RXC   IOMUX_PAD(0x5AC, 0x210, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDCLKN__EPDC_SDCLKN      IOMUX_PAD(0x5B0, 0x214, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCLKN__GPIO_3_25                IOMUX_PAD(0x5B0, 0x214, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCLKN__WEIM_D25         IOMUX_PAD(0x5B0, 0x214, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCLKN__ELCDIF_D9                IOMUX_PAD(0x5B0, 0x214, 3, 0x720, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCLKN__AUD5_RXFS                IOMUX_PAD(0x5B0, 0x214, 4, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDSHR__EPDC_SDSHR        IOMUX_PAD(0x5B4, 0x218, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDSHR__GPIO_3_26 IOMUX_PAD(0x5B4, 0x218, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDSHR__WEIM_D26  IOMUX_PAD(0x5B4, 0x218, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDSHR__ELCDIF_D10        IOMUX_PAD(0x5B4, 0x218, 3, 0x724, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_SDSHR__AUD4_TXD  IOMUX_PAD(0x5B4, 0x218, 4, 0x6c8, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_PWRCOM__EPDC_PWRCOM      IOMUX_PAD(0x5B8, 0x21C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCOM__GPIO_3_27                IOMUX_PAD(0x5B8, 0x21C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCOM__WEIM_D27         IOMUX_PAD(0x5B8, 0x21C, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCOM__ELCDIF_D11       IOMUX_PAD(0x5B8, 0x21C, 3, 0x728, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCOM__AUD4_TXC         IOMUX_PAD(0x5B8, 0x21C, 4, 0x6d4, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_PWRSTAT__EPDC_PWRSTAT    IOMUX_PAD(0x5BC, 0x220, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRSTAT__GPIO_3_28       IOMUX_PAD(0x5BC, 0x220, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRSTAT__WEIM_D28                IOMUX_PAD(0x5BC, 0x220, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRSTAT__ELCDIF_D12      IOMUX_PAD(0x5BC, 0x220, 3, 0x72c, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRSTAT__AUD4_TXFS       IOMUX_PAD(0x5BC, 0x220, 4, 0x6d8, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_PWRCTRL0__EPDC_PWRCTRL0  IOMUX_PAD(0x5C0, 0x224, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL0__GPIO_3_29      IOMUX_PAD(0x5C0, 0x224, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL0__WEIM_D29       IOMUX_PAD(0x5C0, 0x224, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL0__ELCDIF_D13     IOMUX_PAD(0x5C0, 0x224, 3, 0x730, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL0__AUD4_RXD       IOMUX_PAD(0x5C0, 0x224, 4, 0x6c4, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_PWRCTRL1__EPDC_PWRCTRL1  IOMUX_PAD(0x5C4, 0x228, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL1__GPIO_3_30      IOMUX_PAD(0x5C4, 0x228, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL1__WEIM_D30       IOMUX_PAD(0x5C4, 0x228, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL1__ELCDIF_D14     IOMUX_PAD(0x5C4, 0x228, 3, 0x734, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL1__AUD4_RXC       IOMUX_PAD(0x5C4, 0x228, 4, 0x6cc, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_PWRCTRL2__EPDC_PWRCTRL2  IOMUX_PAD(0x5C8, 0x22C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL2__GPIO_3_31      IOMUX_PAD(0x5C8, 0x22C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL2__WEIM_D31       IOMUX_PAD(0x5C8, 0x22C, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL2__ELCDIF_D15     IOMUX_PAD(0x5C8, 0x22C, 3, 0x738, 1, MX50_ELCDIF_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL2__AUD4_RXFS      IOMUX_PAD(0x5C8, 0x22C, 4, 0x6d0, 1, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL2__SDMA_EXT0      IOMUX_PAD(0x5C8, 0x22C, 6, 0x7b8, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_PWRCTRL3__PWRCTRL3       IOMUX_PAD(0x5CC, 0x230, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL3__GPIO_4_20      IOMUX_PAD(0x5CC, 0x230, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL3__WEIM_EB2       IOMUX_PAD(0x5CC, 0x230, 2, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_PWRCTRL3__SDMA_EXT1      IOMUX_PAD(0x5CC, 0x230, 6, 0x7bc, 1, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_VCOM0__EPDC_VCOM0        IOMUX_PAD(0x5D0, 0x234, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_VCOM0__GPIO_4_21 IOMUX_PAD(0x5D0, 0x234, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_VCOM0__WEIM_EB3  IOMUX_PAD(0x5D0, 0x234, 2, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_VCOM1__EPDC_VCOM1        IOMUX_PAD(0x5D4, 0x238, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_VCOM1__GPIO_4_22 IOMUX_PAD(0x5D4, 0x238, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_VCOM1__WEIM_CS3  IOMUX_PAD(0x5D4, 0x238, 2, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EPDC_BDR0__EPDC_BDR0  IOMUX_PAD(0x5D8, 0x23C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_BDR0__GPIO_4_23  IOMUX_PAD(0x5D8, 0x23C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_BDR0__ELCDIF_D7  IOMUX_PAD(0x5D8, 0x23C, 3, 0x718, 1, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_BDR1__EPDC_BDR1  IOMUX_PAD(0x5DC, 0x240, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_BDR1__GPIO_4_24  IOMUX_PAD(0x5DC, 0x240, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_BDR1__ELCDIF_D6  IOMUX_PAD(0x5DC, 0x240, 3, 0x714, 1, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDCE0__EPDC_SDCE0        IOMUX_PAD(0x5E0, 0x244, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE0__GPIO_4_25 IOMUX_PAD(0x5E0, 0x244, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE0__ELCDIF_D5 IOMUX_PAD(0x5E0, 0x244, 3, 0x710, 1, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDCE1__EPDC_SDCE1        IOMUX_PAD(0x5E4, 0x248, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE1__GPIO_4_26 IOMUX_PAD(0x5E4, 0x248, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE1__ELCDIF_D4 IOMUX_PAD(0x5E4, 0x248, 2, 0x70c, 1, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDCE2__EPDC_SDCE2                IOMUX_PAD(0x5E8, 0x24C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE2__GPIO_4_27         IOMUX_PAD(0x5E8, 0x24C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE2__ELCDIF_DAT3       IOMUX_PAD(0x5E8, 0x24C, 3, 0x708, 1, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDCE3__EPDC_SDCE3        IOMUX_PAD(0x5EC, 0x250, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE3__GPIO_4_28 IOMUX_PAD(0x5EC, 0x250, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE3__ELCDIF_D2 IOMUX_PAD(0x5EC, 0x250, 3, 0x704, 1, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDCE4__EPDC_SDCE4        IOMUX_PAD(0x5F0, 0x254, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE4__GPIO_4_29 IOMUX_PAD(0x5F0, 0x254, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE4__ELCDIF_D1 IOMUX_PAD(0x5F0, 0x254, 3, 0x700, 1, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EPDC_SDCE5__EPDC_SDCE5        IOMUX_PAD(0x5F4, 0x258, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE5__GPIO_4_30 IOMUX_PAD(0x5F4, 0x258, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EPDC_SDCE5__ELCDIF_D0 IOMUX_PAD(0x5F4, 0x258, 3, 0x6fc, 1, MX50_ELCDIF_PAD_CTRL)
-
-#define MX50_PAD_EIM_DA0__WEIM_A0      IOMUX_PAD(0x5F8, 0x25C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA0__GPIO_1_0     IOMUX_PAD(0x5F8, 0x25C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA0__KEY_COL4     IOMUX_PAD(0x5f8, 0x25C, 3, 0x790, 2, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_DA1__WEIM_A1      IOMUX_PAD(0x5FC, 0x260, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA1__GPIO_1_1     IOMUX_PAD(0x5FC, 0x260, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA1__KEY_ROW4     IOMUX_PAD(0x5fc, 0x260, 3, 0x7a0, 2, MX50_KEYPAD_CTRL)
-
-#define MX50_PAD_EIM_DA2__WEIM_A2      IOMUX_PAD(0x600, 0x264, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA2__GPIO_1_2     IOMUX_PAD(0x600, 0x264, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA2__KEY_COL5     IOMUX_PAD(0x600, 0x264, 3, 0x794, 2, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_DA3__WEIM_A3      IOMUX_PAD(0x604, 0x268, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA3__GPIO_1_3     IOMUX_PAD(0x604, 0x268, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA3__KEY_ROW5     IOMUX_PAD(0x604, 0x268, 3, 0x7a4, 2, MX50_KEYPAD_CTRL)
-
-#define MX50_PAD_EIM_DA4__WEIM_A4      IOMUX_PAD(0x608, 0x26C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA4__GPIO_1_4     IOMUX_PAD(0x608, 0x26C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA4__KEY_COL6     IOMUX_PAD(0x608, 0x26C, 3, 0x798, 2, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_DA5__WEIM_A5      IOMUX_PAD(0x60C, 0x270, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA5__GPIO_1_5     IOMUX_PAD(0x60C, 0x270, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA5__KEY_ROW6     IOMUX_PAD(0x60C, 0x270, 3, 0x7a8, 2, MX50_KEYPAD_CTRL)
-
-#define MX50_PAD_EIM_DA6__WEIM_A6      IOMUX_PAD(0x610, 0x274, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA6__GPIO_1_6     IOMUX_PAD(0x610, 0x274, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA6__KEY_COL7     IOMUX_PAD(0x610, 0x274, 3, 0x79c, 2, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_DA7__WEIM_A7      IOMUX_PAD(0x614, 0x278, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA7__GPIO_1_7     IOMUX_PAD(0x614, 0x278, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA7__KEY_ROW7     IOMUX_PAD(0x614, 0x278, 3, 0x7ac, 2, MX50_KEYPAD_CTRL)
-
-#define MX50_PAD_EIM_DA8__WEIM_A8      IOMUX_PAD(0x618, 0x27C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA8__GPIO_1_8     IOMUX_PAD(0x618, 0x27C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_EIM_DA8__NANDF_CLE    IOMUX_PAD(0x618, 0x27C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_EIM_DA9__WEIM_A9      IOMUX_PAD(0x61C, 0x280, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA9__GPIO_1_9     IOMUX_PAD(0x61C, 0x280, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_EIM_DA9__NANDF_ALE    IOMUX_PAD(0x61C, 0x280, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_EIM_DA10__WEIM_A10    IOMUX_PAD(0x620, 0x284, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA10__GPIO_1_10   IOMUX_PAD(0x620, 0x284, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_EIM_DA10__NANDF_CE0   IOMUX_PAD(0x620, 0x284, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_EIM_DA11__WEIM_A11    IOMUX_PAD(0x624, 0x288, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA11__GPIO_1_11   IOMUX_PAD(0x624, 0x288, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_EIM_DA11__NANDF_CE1   IOMUX_PAD(0x624, 0x288, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-
-#define MX50_PAD_EIM_DA12__WEIM_A12    IOMUX_PAD(0x628, 0x28C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA12__GPIO_1_12   IOMUX_PAD(0x628, 0x28C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_EIM_DA12__NANDF_CE2   IOMUX_PAD(0x628, 0x28C, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_EIM_DA12__EPDC_SDCE6  IOMUX_PAD(0x628, 0x28C, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_DA13__WEIM_A13    IOMUX_PAD(0x62C, 0x290, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA13__GPIO_1_13   IOMUX_PAD(0x62C, 0x290, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_EIM_DA13__NANDF_CE3   IOMUX_PAD(0x62C, 0x290, 2, 0x0, 0, PAD_CTL_DSE_HIGH)
-#define MX50_PIN_EIM_DA13__EPDC_SDCE7  IOMUX_PAD(0x62C, 0x290, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_DA14__WEIM_A14    IOMUX_PAD(0x630, 0x294, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA14__GPIO_1_14   IOMUX_PAD(0x630, 0x294, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA14__NANDF_READY IOMUX_PAD(0x630, 0x294, 2, 0x7B4, 2, PAD_CTL_PKE | \
-                                                       PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
-#define MX50_PAD_EIM_DA14__EPDC_SDCE8  IOMUX_PAD(0x630, 0x294, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_DA15__WEIM_A15    IOMUX_PAD(0x634, 0x298, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_DA15__GPIO_1_15   IOMUX_PAD(0x634, 0x298, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PIN_EIM_DA15__NANDF_DQS   IOMUX_PAD(0x634, 0x298, 2, 0x7B0, 2, PAD_CTL_DSE_HIGH)
-#define MX50_PAD_EIM_DA15__EPDC_SDCE9  IOMUX_PAD(0x634, 0x298, 3, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_CS2__WEIM_CS2     IOMUX_PAD(0x638, 0x29C, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_CS2__GPIO_1_16    IOMUX_PAD(0x638, 0x29C, 1, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_CS2__WEIM_A27     IOMUX_PAD(0x638, 0x29C, 2, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_CS1__WEIM_CS1     IOMUX_PAD(0x63C, 0x2A0, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_CS1__GPIO_1_17    IOMUX_PAD(0x63C, 0x2A0, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_CS0__WEIM_CS0     IOMUX_PAD(0x640, 0x2A4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_CS0__GPIO_1_18    IOMUX_PAD(0x640, 0x2A4, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_EB0__WEIM_EB0     IOMUX_PAD(0x644, 0x2A8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_EB0__GPIO_1_19    IOMUX_PAD(0x644, 0x2A8, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_EB1__WEIM_EB1     IOMUX_PAD(0x648, 0x2AC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_EB1__GPIO_1_20    IOMUX_PAD(0x648, 0x2AC, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_WAIT__WEIM_WAIT   IOMUX_PAD(0x64C, 0x2B0, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_WAIT__GPIO_1_21   IOMUX_PAD(0x64C, 0x2B0, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_BCLK__WEIM_BCLK   IOMUX_PAD(0x650, 0x2B4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_BCLK__GPIO_1_22   IOMUX_PAD(0x650, 0x2B4, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_RDY__WEIM_RDY     IOMUX_PAD(0x654, 0x2B8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_RDY__GPIO_1_23    IOMUX_PAD(0x654, 0x2B8, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_OE__WEIM_OE       IOMUX_PAD(0x658, 0x2BC, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_OE__GPIO_1_24     IOMUX_PAD(0x658, 0x2BC, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_RW__WEIM_RW       IOMUX_PAD(0x65C, 0x2C0, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_RW__GPIO_1_25     IOMUX_PAD(0x65C, 0x2C0, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_LBA__WEIM_LBA     IOMUX_PAD(0x660, 0x2C4, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_LBA__GPIO_1_26    IOMUX_PAD(0x660, 0x2C4, 1, 0x0, 0, NO_PAD_CTRL)
-
-#define MX50_PAD_EIM_CRE__WEIM_CRE     IOMUX_PAD(0x664, 0x2C8, 0, 0x0, 0, NO_PAD_CTRL)
-#define MX50_PAD_EIM_CRE__GPIO_1_27    IOMUX_PAD(0x664, 0x2C8, 1, 0x0, 0, NO_PAD_CTRL)
-
-#endif /* __MACH_IOMUX_MX50_H__ */
diff --git a/arch/arm/mach-imx/lluart.c b/arch/arm/mach-imx/lluart.c
deleted file mode 100644 (file)
index 2fdc9bf..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2011 Freescale Semiconductor, Inc.
- * Copyright 2011 Linaro Ltd.
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/init.h>
-#include <asm/page.h>
-#include <asm/sizes.h>
-#include <asm/mach/map.h>
-
-#include "hardware.h"
-
-#define IMX6Q_UART1_BASE_ADDR  0x02020000
-#define IMX6Q_UART2_BASE_ADDR  0x021e8000
-#define IMX6Q_UART3_BASE_ADDR  0x021ec000
-#define IMX6Q_UART4_BASE_ADDR  0x021f0000
-#define IMX6Q_UART5_BASE_ADDR  0x021f4000
-
-/*
- * IMX6Q_UART_BASE_ADDR is put in the middle to force the expansion
- * of IMX6Q_UART##n##_BASE_ADDR.
- */
-#define IMX6Q_UART_BASE_ADDR(n)        IMX6Q_UART##n##_BASE_ADDR
-#define IMX6Q_UART_BASE(n)     IMX6Q_UART_BASE_ADDR(n)
-#define IMX6Q_DEBUG_UART_BASE  IMX6Q_UART_BASE(CONFIG_DEBUG_IMX6Q_UART_PORT)
-
-static struct map_desc imx_lluart_desc = {
-#ifdef CONFIG_DEBUG_IMX6Q_UART
-       .virtual        = IMX_IO_P2V(IMX6Q_DEBUG_UART_BASE),
-       .pfn            = __phys_to_pfn(IMX6Q_DEBUG_UART_BASE),
-       .length         = 0x4000,
-       .type           = MT_DEVICE,
-#endif
-};
-
-void __init imx_lluart_map_io(void)
-{
-       if (imx_lluart_desc.virtual)
-               iotable_init(&imx_lluart_desc, 1);
-}
index 5c9bd2c66e6d595c51677259cd2ecf411bee7946..067580b2969bc405a8f346a00545a41a2cd2c998 100644 (file)
@@ -137,17 +137,13 @@ static void __init apf9328_timer_init(void)
        mx1_clocks_init(32768);
 }
 
-static struct sys_timer apf9328_timer = {
-       .init   = apf9328_timer_init,
-};
-
 MACHINE_START(APF9328, "Armadeus APF9328")
        /* Maintainer: Gwenhael Goavec-Merou, ARMadeus Systems */
        .map_io       = mx1_map_io,
        .init_early   = imx1_init_early,
        .init_irq     = mx1_init_irq,
        .handle_irq   = imx1_handle_irq,
-       .timer        = &apf9328_timer,
+       .init_time      = apf9328_timer_init,
        .init_machine = apf9328_init,
        .restart        = mxc_restart,
 MACHINE_END
index 59bd6b06a6b5f1d549b87d4fb8a71e6ded3fe074..368a6e3f5926b2d62c12e17fc6ecf8216e4be06c 100644 (file)
@@ -557,10 +557,6 @@ static void __init armadillo5x0_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer armadillo5x0_timer = {
-       .init   = armadillo5x0_timer_init,
-};
-
 MACHINE_START(ARMADILLO5X0, "Armadillo-500")
        /* Maintainer: Alberto Panizzo  */
        .atag_offset = 0x100,
@@ -568,7 +564,7 @@ MACHINE_START(ARMADILLO5X0, "Armadillo-500")
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &armadillo5x0_timer,
+       .init_time      = armadillo5x0_timer_init,
        .init_machine = armadillo5x0_init,
        .restart        = mxc_restart,
 MACHINE_END
index 3a39d5aec07a7cffbec8adf8a940ee20ccb9e7d4..2d00476f7d2c3d79061bc9f5c39bb9a561f9d5c3 100644 (file)
@@ -53,16 +53,12 @@ static void __init bug_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer bug_timer = {
-       .init = bug_timer_init,
-};
-
 MACHINE_START(BUG, "BugLabs BUGBase")
        .map_io = mx31_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &bug_timer,
+       .init_time      = bug_timer_init,
        .init_machine = bug_board_init,
        .restart        = mxc_restart,
 MACHINE_END
index 12a370646b450e5b313ad73b70d79d4b3fcf1c0b..146559311bd28688dee200d08a74a48e2d8fb47e 100644 (file)
@@ -309,17 +309,13 @@ static void __init eukrea_cpuimx27_timer_init(void)
        mx27_clocks_init(26000000);
 }
 
-static struct sys_timer eukrea_cpuimx27_timer = {
-       .init = eukrea_cpuimx27_timer_init,
-};
-
 MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27")
        .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
-       .timer = &eukrea_cpuimx27_timer,
+       .init_time      = eukrea_cpuimx27_timer_init,
        .init_machine = eukrea_cpuimx27_init,
        .restart        = mxc_restart,
 MACHINE_END
index 5a31bf8c8f4c528b1275d99b727be937917b8491..771362d1fbee712247242c3d7c5d9956b7f58e70 100644 (file)
@@ -193,10 +193,6 @@ static void __init eukrea_cpuimx35_timer_init(void)
        mx35_clocks_init();
 }
 
-static struct sys_timer eukrea_cpuimx35_timer = {
-       .init   = eukrea_cpuimx35_timer_init,
-};
-
 MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
        /* Maintainer: Eukrea Electromatique */
        .atag_offset = 0x100,
@@ -204,7 +200,7 @@ MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
        .init_early = imx35_init_early,
        .init_irq = mx35_init_irq,
        .handle_irq = imx35_handle_irq,
-       .timer = &eukrea_cpuimx35_timer,
+       .init_time      = eukrea_cpuimx35_timer_init,
        .init_machine = eukrea_cpuimx35_init,
        .restart        = mxc_restart,
 MACHINE_END
index b727de029c8f3dfc4a99fd1e68333086c06c9737..9b7393234f6f2fd4014afb3f09812600e915f91e 100644 (file)
@@ -355,10 +355,6 @@ static void __init eukrea_cpuimx51sd_timer_init(void)
        mx51_clocks_init(32768, 24000000, 22579200, 0);
 }
 
-static struct sys_timer mxc_timer = {
-       .init   = eukrea_cpuimx51sd_timer_init,
-};
-
 MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
        /* Maintainer: Eric Bénard <eric@eukrea.com> */
        .atag_offset = 0x100,
@@ -366,7 +362,7 @@ MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
        .handle_irq = imx51_handle_irq,
-       .timer = &mxc_timer,
+       .init_time      = eukrea_cpuimx51sd_timer_init,
        .init_machine = eukrea_cpuimx51sd_init,
        .init_late      = imx51_init_late,
        .restart        = mxc_restart,
index 75027a5ad8b75c2dbc8afd98a413dd855a59cca4..4bf45442424910b4f5806c1fc0cc6cb9c01fd48f 100644 (file)
@@ -159,10 +159,6 @@ static void __init eukrea_cpuimx25_timer_init(void)
        mx25_clocks_init();
 }
 
-static struct sys_timer eukrea_cpuimx25_timer = {
-       .init   = eukrea_cpuimx25_timer_init,
-};
-
 MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
        /* Maintainer: Eukrea Electromatique */
        .atag_offset = 0x100,
@@ -170,7 +166,7 @@ MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
        .init_early = imx25_init_early,
        .init_irq = mx25_init_irq,
        .handle_irq = imx25_handle_irq,
-       .timer = &eukrea_cpuimx25_timer,
+       .init_time = eukrea_cpuimx25_timer_init,
        .init_machine = eukrea_cpuimx25_init,
        .restart        = mxc_restart,
 MACHINE_END
index 318bd8df7fcc2f160d16f0aa027e89f6fddf2da4..29ac8ee651d210c86b6245c7a7235f385a56ab0e 100644 (file)
@@ -598,10 +598,6 @@ static void __init visstrim_m10_timer_init(void)
        mx27_clocks_init((unsigned long)25000000);
 }
 
-static struct sys_timer visstrim_m10_timer = {
-       .init   = visstrim_m10_timer_init,
-};
-
 MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
        .atag_offset = 0x100,
        .reserve = visstrim_reserve,
@@ -609,7 +605,7 @@ MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
-       .timer = &visstrim_m10_timer,
+       .init_time      = visstrim_m10_timer_init,
        .init_machine = visstrim_m10_board_init,
        .restart        = mxc_restart,
 MACHINE_END
index 53a8601129385d85c9314169ffa913e37ef69ba8..1a851aea683231824e1df335a85adfa93ecd1cfe 100644 (file)
@@ -65,10 +65,6 @@ static void __init mx27ipcam_timer_init(void)
        mx27_clocks_init(25000000);
 }
 
-static struct sys_timer mx27ipcam_timer = {
-       .init   = mx27ipcam_timer_init,
-};
-
 MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
        /* maintainer: Freescale Semiconductor, Inc. */
        .atag_offset = 0x100,
@@ -76,7 +72,7 @@ MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
-       .timer = &mx27ipcam_timer,
+       .init_time      = mx27ipcam_timer_init,
        .init_machine = mx27ipcam_init,
        .restart        = mxc_restart,
 MACHINE_END
index fc8dce93137888bbd22d508833cad4ea78888b87..3da2e3e44ce91b4fdfdd4e92641b4993fa41eced 100644 (file)
@@ -72,17 +72,13 @@ static void __init mx27lite_timer_init(void)
        mx27_clocks_init(26000000);
 }
 
-static struct sys_timer mx27lite_timer = {
-       .init   = mx27lite_timer_init,
-};
-
 MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
        .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
-       .timer = &mx27lite_timer,
+       .init_time      = mx27lite_timer_init,
        .init_machine = mx27lite_init,
        .restart        = mxc_restart,
 MACHINE_END
index 860284dea0e79f3248f30fe27839f919566a7098..f579c616feed3b2008965fa9ef8b63dc84e6ab01 100644 (file)
@@ -44,26 +44,22 @@ static void __init imx53_dt_init(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static void __init imx53_timer_init(void)
-{
-       mx53_clocks_init_dt();
-}
-
-static struct sys_timer imx53_timer = {
-       .init = imx53_timer_init,
-};
-
 static const char *imx53_dt_board_compat[] __initdata = {
        "fsl,imx53",
        NULL
 };
 
+static void __init imx53_timer_init(void)
+{
+       mx53_clocks_init_dt();
+}
+
 DT_MACHINE_START(IMX53_DT, "Freescale i.MX53 (Device Tree Support)")
        .map_io         = mx53_map_io,
        .init_early     = imx53_init_early,
        .init_irq       = mx53_init_irq,
        .handle_irq     = imx53_handle_irq,
-       .timer          = &imx53_timer,
+       .init_time      = imx53_timer_init,
        .init_machine   = imx53_dt_init,
        .init_late      = imx53_init_late,
        .dt_compat      = imx53_dt_board_compat,
index 4eb1b3ac794ceb38ee928a3a67654a0192cd8492..1786b2d1257eb0f77b92564f93f07f17b8fbdf65 100644 (file)
 
 #include <linux/clk.h>
 #include <linux/clkdev.h>
-#include <linux/cpuidle.h>
 #include <linux/delay.h>
 #include <linux/export.h>
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/regmap.h>
 #include <linux/micrel_phy.h>
 #include <linux/mfd/syscon.h>
-#include <asm/cpuidle.h>
 #include <asm/smp_twd.h>
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <asm/system_misc.h>
 
@@ -201,37 +200,28 @@ static void __init imx6q_init_machine(void)
        imx6q_1588_init();
 }
 
-static struct cpuidle_driver imx6q_cpuidle_driver = {
-       .name                   = "imx6q_cpuidle",
-       .owner                  = THIS_MODULE,
-       .en_core_tk_irqen       = 1,
-       .states[0]              = ARM_CPUIDLE_WFI_STATE,
-       .state_count            = 1,
-};
-
 static void __init imx6q_init_late(void)
 {
-       imx_cpuidle_init(&imx6q_cpuidle_driver);
+       /*
+        * WAIT mode is broken on TO 1.0 and 1.1, so there is no point
+        * to run cpuidle on them.
+        */
+       if (imx6q_revision() > IMX_CHIP_REVISION_1_1)
+               imx6q_cpuidle_init();
 }
 
 static void __init imx6q_map_io(void)
 {
-       imx_lluart_map_io();
+       debug_ll_io_init();
        imx_scu_map_io();
-       imx6q_clock_map_io();
 }
 
-static const struct of_device_id imx6q_irq_match[] __initconst = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       { /* sentinel */ }
-};
-
 static void __init imx6q_init_irq(void)
 {
        l2x0_of_init(0, ~0UL);
        imx_src_init();
        imx_gpc_init();
-       of_irq_init(imx6q_irq_match);
+       irqchip_init();
 }
 
 static void __init imx6q_timer_init(void)
@@ -241,10 +231,6 @@ static void __init imx6q_timer_init(void)
        imx_print_silicon_rev("i.MX6Q", imx6q_revision());
 }
 
-static struct sys_timer imx6q_timer = {
-       .init = imx6q_timer_init,
-};
-
 static const char *imx6q_dt_compat[] __initdata = {
        "fsl,imx6q",
        NULL,
@@ -254,8 +240,7 @@ DT_MACHINE_START(IMX6Q, "Freescale i.MX6 Quad (Device Tree)")
        .smp            = smp_ops(imx_smp_ops),
        .map_io         = imx6q_map_io,
        .init_irq       = imx6q_init_irq,
-       .handle_irq     = imx6q_handle_irq,
-       .timer          = &imx6q_timer,
+       .init_time      = imx6q_timer_init,
        .init_machine   = imx6q_init_machine,
        .init_late      = imx6q_init_late,
        .dt_compat      = imx6q_dt_compat,
index 2e536ea53444f8007cecd23308fb15155b2bb0b4..c7bc41d6b468d82d4e145f289818fbd202a63bd3 100644 (file)
@@ -284,17 +284,13 @@ static void __init kzm_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer kzm_timer = {
-       .init = kzm_timer_init,
-};
-
 MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01")
        .atag_offset = 0x100,
        .map_io = kzm_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &kzm_timer,
+       .init_time      = kzm_timer_init,
        .init_machine = kzm_board_init,
        .restart        = mxc_restart,
 MACHINE_END
index 06b483783e68d7abcff369b306dbda29c8a80574..9f883e4d6fc9c1b05e596d701d9521722b8bfec2 100644 (file)
@@ -132,10 +132,6 @@ static void __init mx1ads_timer_init(void)
        mx1_clocks_init(32000);
 }
 
-static struct sys_timer mx1ads_timer = {
-       .init   = mx1ads_timer_init,
-};
-
 MACHINE_START(MX1ADS, "Freescale MX1ADS")
        /* Maintainer: Sascha Hauer, Pengutronix */
        .atag_offset = 0x100,
@@ -143,7 +139,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS")
        .init_early = imx1_init_early,
        .init_irq = mx1_init_irq,
        .handle_irq = imx1_handle_irq,
-       .timer = &mx1ads_timer,
+       .init_time      = mx1ads_timer_init,
        .init_machine = mx1ads_init,
        .restart        = mxc_restart,
 MACHINE_END
@@ -154,7 +150,7 @@ MACHINE_START(MXLADS, "Freescale MXLADS")
        .init_early = imx1_init_early,
        .init_irq = mx1_init_irq,
        .handle_irq = imx1_handle_irq,
-       .timer = &mx1ads_timer,
+       .init_time      = mx1ads_timer_init,
        .init_machine = mx1ads_init,
        .restart        = mxc_restart,
 MACHINE_END
index 6adb3136bb08be1380b7d79e767e3153c3432536..a06aa4dc37fc4f99ca4e24d31e069aa40daf9242 100644 (file)
@@ -318,10 +318,6 @@ static void __init mx21ads_timer_init(void)
        mx21_clocks_init(32768, 26000000);
 }
 
-static struct sys_timer mx21ads_timer = {
-       .init   = mx21ads_timer_init,
-};
-
 MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
        /* maintainer: Freescale Semiconductor, Inc. */
        .atag_offset = 0x100,
@@ -329,7 +325,7 @@ MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
        .init_early = imx21_init_early,
        .init_irq = mx21_init_irq,
        .handle_irq = imx21_handle_irq,
-       .timer = &mx21ads_timer,
+       .init_time      = mx21ads_timer_init,
        .init_machine = mx21ads_board_init,
        .restart        = mxc_restart,
 MACHINE_END
index b1b03aa55bb8eec8352a7ccc69a2b5066c0bb546..8bcda688a006807f16427383314ac827560396e9 100644 (file)
@@ -257,10 +257,6 @@ static void __init mx25pdk_timer_init(void)
        mx25_clocks_init();
 }
 
-static struct sys_timer mx25pdk_timer = {
-       .init   = mx25pdk_timer_init,
-};
-
 MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
        /* Maintainer: Freescale Semiconductor, Inc. */
        .atag_offset = 0x100,
@@ -268,7 +264,7 @@ MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
        .init_early = imx25_init_early,
        .init_irq = mx25_init_irq,
        .handle_irq = imx25_handle_irq,
-       .timer = &mx25pdk_timer,
+       .init_time      = mx25pdk_timer_init,
        .init_machine = mx25pdk_init,
        .restart        = mxc_restart,
 MACHINE_END
index d0e547fa925fe40556d86b04d54ad3ef1c353be0..25b3e4c9bc0a72367bf92725e28989beb70ff420 100644 (file)
@@ -538,10 +538,6 @@ static void __init mx27pdk_timer_init(void)
        mx27_clocks_init(26000000);
 }
 
-static struct sys_timer mx27pdk_timer = {
-       .init   = mx27pdk_timer_init,
-};
-
 MACHINE_START(MX27_3DS, "Freescale MX27PDK")
        /* maintainer: Freescale Semiconductor, Inc. */
        .atag_offset = 0x100,
@@ -549,7 +545,7 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
-       .timer = &mx27pdk_timer,
+       .init_time      = mx27pdk_timer_init,
        .init_machine = mx27pdk_init,
        .restart        = mxc_restart,
 MACHINE_END
index 3d036f57f0e6c7558b890ec3fb26c337ffaac5fe..9821b824dcafc43d3380a5e4e5527f825b0ebdcd 100644 (file)
@@ -323,10 +323,6 @@ static void __init mx27ads_timer_init(void)
        mx27_clocks_init(fref);
 }
 
-static struct sys_timer mx27ads_timer = {
-       .init   = mx27ads_timer_init,
-};
-
 static struct map_desc mx27ads_io_desc[] __initdata = {
        {
                .virtual = PBC_BASE_ADDRESS,
@@ -349,7 +345,7 @@ MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
-       .timer = &mx27ads_timer,
+       .init_time      = mx27ads_timer_init,
        .init_machine = mx27ads_board_init,
        .restart        = mxc_restart,
 MACHINE_END
index bc301befdd06a2d9356bcb258710fd475113ac19..1ed916175d41bf4f5ccfc10e5fc981b151234874 100644 (file)
@@ -762,10 +762,6 @@ static void __init mx31_3ds_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer mx31_3ds_timer = {
-       .init   = mx31_3ds_timer_init,
-};
-
 static void __init mx31_3ds_reserve(void)
 {
        /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
@@ -780,7 +776,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &mx31_3ds_timer,
+       .init_time      = mx31_3ds_timer_init,
        .init_machine = mx31_3ds_init,
        .reserve = mx31_3ds_reserve,
        .restart        = mxc_restart,
index 8b56f8883f3278d58bc5668ff49dd2377bbe9e02..daf8889125ccb8f5ecbb82e7125dcdf5d382b584 100644 (file)
@@ -576,10 +576,6 @@ static void __init mx31ads_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer mx31ads_timer = {
-       .init   = mx31ads_timer_init,
-};
-
 MACHINE_START(MX31ADS, "Freescale MX31ADS")
        /* Maintainer: Freescale Semiconductor, Inc. */
        .atag_offset = 0x100,
@@ -587,7 +583,7 @@ MACHINE_START(MX31ADS, "Freescale MX31ADS")
        .init_early = imx31_init_early,
        .init_irq = mx31ads_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &mx31ads_timer,
+       .init_time      = mx31ads_timer_init,
        .init_machine = mx31ads_init,
        .restart        = mxc_restart,
 MACHINE_END
index 08b9965c8b36658d75b5e93b5c05616864628088..832b1e2f964ec4372635555b0c27baa612a56d9b 100644 (file)
@@ -303,17 +303,13 @@ static void __init mx31lilly_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer mx31lilly_timer = {
-       .init   = mx31lilly_timer_init,
-};
-
 MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
        .atag_offset = 0x100,
        .map_io = mx31_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &mx31lilly_timer,
+       .init_time      = mx31lilly_timer_init,
        .init_machine = mx31lilly_board_init,
        .restart        = mxc_restart,
 MACHINE_END
index bdcd92e59518f054d15ca78c5b8c35032deedc98..bea07299b61ac46d2639d6bab314e5317f02a5fc 100644 (file)
@@ -285,10 +285,6 @@ static void __init mx31lite_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer mx31lite_timer = {
-       .init   = mx31lite_timer_init,
-};
-
 MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
        /* Maintainer: Freescale Semiconductor, Inc. */
        .atag_offset = 0x100,
@@ -296,7 +292,7 @@ MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &mx31lite_timer,
+       .init_time      = mx31lite_timer_init,
        .init_machine = mx31lite_init,
        .restart        = mxc_restart,
 MACHINE_END
index 2517cfa9f26bbb4519045f2653236dad709c9cb0..dae4cd7be0400eda33f01d62574951d5d90989c4 100644 (file)
@@ -596,10 +596,6 @@ static void __init mx31moboard_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer mx31moboard_timer = {
-       .init   = mx31moboard_timer_init,
-};
-
 static void __init mx31moboard_reserve(void)
 {
        /* reserve 4 MiB for mx3-camera */
@@ -615,7 +611,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &mx31moboard_timer,
+       .init_time      = mx31moboard_timer_init,
        .init_machine = mx31moboard_init,
        .restart        = mxc_restart,
 MACHINE_END
index 5277da45d60c75a5ce7d7041745d7b9420485517..a42f4f07051fda65843da8ae579aa4326ccfaa5e 100644 (file)
@@ -602,10 +602,6 @@ static void __init mx35pdk_timer_init(void)
        mx35_clocks_init();
 }
 
-static struct sys_timer mx35pdk_timer = {
-       .init   = mx35pdk_timer_init,
-};
-
 static void __init mx35_3ds_reserve(void)
 {
        /* reserve MX35_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
@@ -620,7 +616,7 @@ MACHINE_START(MX35_3DS, "Freescale MX35PDK")
        .init_early = imx35_init_early,
        .init_irq = mx35_init_irq,
        .handle_irq = imx35_handle_irq,
-       .timer = &mx35pdk_timer,
+       .init_time      = mx35pdk_timer_init,
        .init_machine = mx35_3ds_init,
        .reserve = mx35_3ds_reserve,
        .restart        = mxc_restart,
diff --git a/arch/arm/mach-imx/mach-mx50_rdp.c b/arch/arm/mach-imx/mach-mx50_rdp.c
deleted file mode 100644 (file)
index 0c1f88a..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-
-#include <asm/irq.h>
-#include <asm/setup.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/time.h>
-
-#include "common.h"
-#include "devices-imx50.h"
-#include "hardware.h"
-#include "iomux-mx50.h"
-
-#define FEC_EN         IMX_GPIO_NR(6, 23)
-#define FEC_RESET_B    IMX_GPIO_NR(4, 12)
-
-static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
-       /* SD1 */
-       MX50_PAD_ECSPI2_SS0__GPIO_4_19,
-       MX50_PAD_EIM_CRE__GPIO_1_27,
-       MX50_PAD_SD1_CMD__SD1_CMD,
-
-       MX50_PAD_SD1_CLK__SD1_CLK,
-       MX50_PAD_SD1_D0__SD1_D0,
-       MX50_PAD_SD1_D1__SD1_D1,
-       MX50_PAD_SD1_D2__SD1_D2,
-       MX50_PAD_SD1_D3__SD1_D3,
-
-       /* SD2 */
-       MX50_PAD_SD2_CD__GPIO_5_17,
-       MX50_PAD_SD2_WP__GPIO_5_16,
-       MX50_PAD_SD2_CMD__SD2_CMD,
-       MX50_PAD_SD2_CLK__SD2_CLK,
-       MX50_PAD_SD2_D0__SD2_D0,
-       MX50_PAD_SD2_D1__SD2_D1,
-       MX50_PAD_SD2_D2__SD2_D2,
-       MX50_PAD_SD2_D3__SD2_D3,
-       MX50_PAD_SD2_D4__SD2_D4,
-       MX50_PAD_SD2_D5__SD2_D5,
-       MX50_PAD_SD2_D6__SD2_D6,
-       MX50_PAD_SD2_D7__SD2_D7,
-
-       /* SD3 */
-       MX50_PAD_SD3_CMD__SD3_CMD,
-       MX50_PAD_SD3_CLK__SD3_CLK,
-       MX50_PAD_SD3_D0__SD3_D0,
-       MX50_PAD_SD3_D1__SD3_D1,
-       MX50_PAD_SD3_D2__SD3_D2,
-       MX50_PAD_SD3_D3__SD3_D3,
-       MX50_PAD_SD3_D4__SD3_D4,
-       MX50_PAD_SD3_D5__SD3_D5,
-       MX50_PAD_SD3_D6__SD3_D6,
-       MX50_PAD_SD3_D7__SD3_D7,
-
-       /* PWR_INT */
-       MX50_PAD_ECSPI2_MISO__GPIO_4_18,
-
-       /* UART pad setting */
-       MX50_PAD_UART1_TXD__UART1_TXD,
-       MX50_PAD_UART1_RXD__UART1_RXD,
-       MX50_PAD_UART1_RTS__UART1_RTS,
-       MX50_PAD_UART2_TXD__UART2_TXD,
-       MX50_PAD_UART2_RXD__UART2_RXD,
-       MX50_PAD_UART2_CTS__UART2_CTS,
-       MX50_PAD_UART2_RTS__UART2_RTS,
-
-       MX50_PAD_I2C1_SCL__I2C1_SCL,
-       MX50_PAD_I2C1_SDA__I2C1_SDA,
-       MX50_PAD_I2C2_SCL__I2C2_SCL,
-       MX50_PAD_I2C2_SDA__I2C2_SDA,
-
-       MX50_PAD_EPITO__USBH1_PWR,
-       /* Need to comment below line if
-        * one needs to debug owire.
-        */
-       MX50_PAD_OWIRE__USBH1_OC,
-       /* using gpio to control otg pwr */
-       MX50_PAD_PWM2__GPIO_6_25,
-       MX50_PAD_I2C3_SCL__USBOTG_OC,
-
-       MX50_PAD_SSI_RXC__FEC_MDIO,
-       MX50_PAD_SSI_RXFS__FEC_MDC,
-       MX50_PAD_DISP_D0__FEC_TXCLK,
-       MX50_PAD_DISP_D1__FEC_RX_ER,
-       MX50_PAD_DISP_D2__FEC_RX_DV,
-       MX50_PAD_DISP_D3__FEC_RXD1,
-       MX50_PAD_DISP_D4__FEC_RXD0,
-       MX50_PAD_DISP_D5__FEC_TX_EN,
-       MX50_PAD_DISP_D6__FEC_TXD1,
-       MX50_PAD_DISP_D7__FEC_TXD0,
-       MX50_PAD_I2C3_SDA__GPIO_6_23,
-       MX50_PAD_ECSPI1_SCLK__GPIO_4_12,
-
-       MX50_PAD_CSPI_SS0__CSPI_SS0,
-       MX50_PAD_ECSPI1_MOSI__CSPI_SS1,
-       MX50_PAD_CSPI_MOSI__CSPI_MOSI,
-       MX50_PAD_CSPI_MISO__CSPI_MISO,
-
-       /* SGTL500_OSC_EN */
-       MX50_PAD_UART1_CTS__GPIO_6_8,
-
-       /* SGTL_AMP_SHDN */
-       MX50_PAD_UART3_RXD__GPIO_6_15,
-
-       /* Keypad */
-       MX50_PAD_KEY_COL0__KEY_COL0,
-       MX50_PAD_KEY_ROW0__KEY_ROW0,
-       MX50_PAD_KEY_COL1__KEY_COL1,
-       MX50_PAD_KEY_ROW1__KEY_ROW1,
-       MX50_PAD_KEY_COL2__KEY_COL2,
-       MX50_PAD_KEY_ROW2__KEY_ROW2,
-       MX50_PAD_KEY_COL3__KEY_COL3,
-       MX50_PAD_KEY_ROW3__KEY_ROW3,
-       MX50_PAD_EIM_DA0__KEY_COL4,
-       MX50_PAD_EIM_DA1__KEY_ROW4,
-       MX50_PAD_EIM_DA2__KEY_COL5,
-       MX50_PAD_EIM_DA3__KEY_ROW5,
-       MX50_PAD_EIM_DA4__KEY_COL6,
-       MX50_PAD_EIM_DA5__KEY_ROW6,
-       MX50_PAD_EIM_DA6__KEY_COL7,
-       MX50_PAD_EIM_DA7__KEY_ROW7,
-       /*EIM pads */
-       MX50_PAD_EIM_DA8__GPIO_1_8,
-       MX50_PAD_EIM_DA9__GPIO_1_9,
-       MX50_PAD_EIM_DA10__GPIO_1_10,
-       MX50_PAD_EIM_DA11__GPIO_1_11,
-       MX50_PAD_EIM_DA12__GPIO_1_12,
-       MX50_PAD_EIM_DA13__GPIO_1_13,
-       MX50_PAD_EIM_DA14__GPIO_1_14,
-       MX50_PAD_EIM_DA15__GPIO_1_15,
-       MX50_PAD_EIM_CS2__GPIO_1_16,
-       MX50_PAD_EIM_CS1__GPIO_1_17,
-       MX50_PAD_EIM_CS0__GPIO_1_18,
-       MX50_PAD_EIM_EB0__GPIO_1_19,
-       MX50_PAD_EIM_EB1__GPIO_1_20,
-       MX50_PAD_EIM_WAIT__GPIO_1_21,
-       MX50_PAD_EIM_BCLK__GPIO_1_22,
-       MX50_PAD_EIM_RDY__GPIO_1_23,
-       MX50_PAD_EIM_OE__GPIO_1_24,
-};
-
-/* Serial ports */
-static const struct imxuart_platform_data uart_pdata __initconst = {
-       .flags = IMXUART_HAVE_RTSCTS,
-};
-
-static const struct fec_platform_data fec_data __initconst = {
-       .phy = PHY_INTERFACE_MODE_RMII,
-};
-
-static inline void mx50_rdp_fec_reset(void)
-{
-       gpio_request(FEC_EN, "fec-en");
-       gpio_direction_output(FEC_EN, 0);
-       gpio_request(FEC_RESET_B, "fec-reset_b");
-       gpio_direction_output(FEC_RESET_B, 0);
-       msleep(1);
-       gpio_set_value(FEC_RESET_B, 1);
-}
-
-static const struct imxi2c_platform_data i2c_data __initconst = {
-       .bitrate = 100000,
-};
-
-/*
- * Board specific initialization.
- */
-static void __init mx50_rdp_board_init(void)
-{
-       imx50_soc_init();
-
-       mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads,
-                                       ARRAY_SIZE(mx50_rdp_pads));
-
-       imx50_add_imx_uart(0, &uart_pdata);
-       imx50_add_imx_uart(1, &uart_pdata);
-       mx50_rdp_fec_reset();
-       imx50_add_fec(&fec_data);
-       imx50_add_imx_i2c(0, &i2c_data);
-       imx50_add_imx_i2c(1, &i2c_data);
-       imx50_add_imx_i2c(2, &i2c_data);
-}
-
-static void __init mx50_rdp_timer_init(void)
-{
-       mx50_clocks_init(32768, 24000000, 22579200);
-}
-
-static struct sys_timer mx50_rdp_timer = {
-       .init   = mx50_rdp_timer_init,
-};
-
-MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform")
-       .map_io = mx50_map_io,
-       .init_early = imx50_init_early,
-       .init_irq = mx50_init_irq,
-       .handle_irq = imx50_handle_irq,
-       .timer = &mx50_rdp_timer,
-       .init_machine = mx50_rdp_board_init,
-       .restart        = mxc_restart,
-MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
deleted file mode 100644 (file)
index abc25bd..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
- * Copyright (C) 2010 Jason Wang <jason77.wang@gmail.com>
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/spi/spi.h>
-#include <linux/gpio.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/time.h>
-
-#include "3ds_debugboard.h"
-#include "common.h"
-#include "devices-imx51.h"
-#include "hardware.h"
-#include "iomux-mx51.h"
-
-#define MX51_3DS_ECSPI2_CS     (GPIO_PORTC + 28)
-
-static iomux_v3_cfg_t mx51_3ds_pads[] = {
-       /* UART1 */
-       MX51_PAD_UART1_RXD__UART1_RXD,
-       MX51_PAD_UART1_TXD__UART1_TXD,
-       MX51_PAD_UART1_RTS__UART1_RTS,
-       MX51_PAD_UART1_CTS__UART1_CTS,
-
-       /* UART2 */
-       MX51_PAD_UART2_RXD__UART2_RXD,
-       MX51_PAD_UART2_TXD__UART2_TXD,
-       MX51_PAD_EIM_D25__UART2_CTS,
-       MX51_PAD_EIM_D26__UART2_RTS,
-
-       /* UART3 */
-       MX51_PAD_UART3_RXD__UART3_RXD,
-       MX51_PAD_UART3_TXD__UART3_TXD,
-       MX51_PAD_EIM_D24__UART3_CTS,
-       MX51_PAD_EIM_D27__UART3_RTS,
-
-       /* CPLD PARENT IRQ PIN */
-       MX51_PAD_GPIO1_6__GPIO1_6,
-
-       /* KPP */
-       MX51_PAD_KEY_ROW0__KEY_ROW0,
-       MX51_PAD_KEY_ROW1__KEY_ROW1,
-       MX51_PAD_KEY_ROW2__KEY_ROW2,
-       MX51_PAD_KEY_ROW3__KEY_ROW3,
-       MX51_PAD_KEY_COL0__KEY_COL0,
-       MX51_PAD_KEY_COL1__KEY_COL1,
-       MX51_PAD_KEY_COL2__KEY_COL2,
-       MX51_PAD_KEY_COL3__KEY_COL3,
-       MX51_PAD_KEY_COL4__KEY_COL4,
-       MX51_PAD_KEY_COL5__KEY_COL5,
-
-       /* eCSPI2 */
-       MX51_PAD_NANDF_RB2__ECSPI2_SCLK,
-       MX51_PAD_NANDF_RB3__ECSPI2_MISO,
-       MX51_PAD_NANDF_D15__ECSPI2_MOSI,
-       MX51_PAD_NANDF_D12__GPIO3_28,
-};
-
-/* Serial ports */
-static const struct imxuart_platform_data uart_pdata __initconst = {
-       .flags = IMXUART_HAVE_RTSCTS,
-};
-
-static int mx51_3ds_board_keymap[] = {
-       KEY(0, 0, KEY_1),
-       KEY(0, 1, KEY_2),
-       KEY(0, 2, KEY_3),
-       KEY(0, 3, KEY_F1),
-       KEY(0, 4, KEY_UP),
-       KEY(0, 5, KEY_F2),
-
-       KEY(1, 0, KEY_4),
-       KEY(1, 1, KEY_5),
-       KEY(1, 2, KEY_6),
-       KEY(1, 3, KEY_LEFT),
-       KEY(1, 4, KEY_SELECT),
-       KEY(1, 5, KEY_RIGHT),
-
-       KEY(2, 0, KEY_7),
-       KEY(2, 1, KEY_8),
-       KEY(2, 2, KEY_9),
-       KEY(2, 3, KEY_F3),
-       KEY(2, 4, KEY_DOWN),
-       KEY(2, 5, KEY_F4),
-
-       KEY(3, 0, KEY_0),
-       KEY(3, 1, KEY_OK),
-       KEY(3, 2, KEY_ESC),
-       KEY(3, 3, KEY_ENTER),
-       KEY(3, 4, KEY_MENU),
-       KEY(3, 5, KEY_BACK)
-};
-
-static const struct matrix_keymap_data mx51_3ds_map_data __initconst = {
-       .keymap         = mx51_3ds_board_keymap,
-       .keymap_size    = ARRAY_SIZE(mx51_3ds_board_keymap),
-};
-
-static int mx51_3ds_spi2_cs[] = {
-       MXC_SPI_CS(0),
-       MX51_3DS_ECSPI2_CS,
-};
-
-static const struct spi_imx_master mx51_3ds_ecspi2_pdata __initconst = {
-       .chipselect     = mx51_3ds_spi2_cs,
-       .num_chipselect = ARRAY_SIZE(mx51_3ds_spi2_cs),
-};
-
-static struct spi_board_info mx51_3ds_spi_nor_device[] = {
-       {
-        .modalias = "m25p80",
-        .max_speed_hz = 25000000,      /* max spi clock (SCK) speed in HZ */
-        .bus_num = 1,
-        .chip_select = 1,
-        .mode = SPI_MODE_0,
-        .platform_data = NULL,},
-};
-
-/*
- * Board specific initialization.
- */
-static void __init mx51_3ds_init(void)
-{
-       imx51_soc_init();
-
-       mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads,
-                                       ARRAY_SIZE(mx51_3ds_pads));
-
-       imx51_add_imx_uart(0, &uart_pdata);
-       imx51_add_imx_uart(1, &uart_pdata);
-       imx51_add_imx_uart(2, &uart_pdata);
-
-       imx51_add_ecspi(1, &mx51_3ds_ecspi2_pdata);
-       spi_register_board_info(mx51_3ds_spi_nor_device,
-                               ARRAY_SIZE(mx51_3ds_spi_nor_device));
-
-       if (mxc_expio_init(MX51_CS5_BASE_ADDR, IMX_GPIO_NR(1, 6)))
-               printk(KERN_WARNING "Init of the debugboard failed, all "
-                                   "devices on the board are unusable.\n");
-
-       imx51_add_sdhci_esdhc_imx(0, NULL);
-       imx51_add_imx_keypad(&mx51_3ds_map_data);
-       imx51_add_imx2_wdt(0);
-}
-
-static void __init mx51_3ds_timer_init(void)
-{
-       mx51_clocks_init(32768, 24000000, 22579200, 0);
-}
-
-static struct sys_timer mx51_3ds_timer = {
-       .init = mx51_3ds_timer_init,
-};
-
-MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
-       /* Maintainer: Freescale Semiconductor, Inc. */
-       .atag_offset = 0x100,
-       .map_io = mx51_map_io,
-       .init_early = imx51_init_early,
-       .init_irq = mx51_init_irq,
-       .handle_irq = imx51_handle_irq,
-       .timer = &mx51_3ds_timer,
-       .init_machine = mx51_3ds_init,
-       .init_late      = imx51_init_late,
-       .restart        = mxc_restart,
-MACHINE_END
index d9a84ca2199ac2391463787b66e6661542e6e064..6c4d7feb452099fca871b5b11d344dddf2408d4f 100644 (file)
@@ -418,10 +418,6 @@ static void __init mx51_babbage_timer_init(void)
        mx51_clocks_init(32768, 24000000, 22579200, 0);
 }
 
-static struct sys_timer mx51_babbage_timer = {
-       .init = mx51_babbage_timer_init,
-};
-
 MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
        /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */
        .atag_offset = 0x100,
@@ -429,7 +425,7 @@ MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
        .handle_irq = imx51_handle_irq,
-       .timer = &mx51_babbage_timer,
+       .init_time      = mx51_babbage_timer_init,
        .init_machine = mx51_babbage_init,
        .init_late      = imx51_init_late,
        .restart        = mxc_restart,
index f4a8c7e108e19d05410388b7000c72b57a1ad97a..a27faaba98ec093cd030ea14c0ac80aaa00de75d 100644 (file)
@@ -261,10 +261,6 @@ static void __init mxt_td60_timer_init(void)
        mx27_clocks_init(26000000);
 }
 
-static struct sys_timer mxt_td60_timer = {
-       .init   = mxt_td60_timer_init,
-};
-
 MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
        /* maintainer: Maxtrack Industrial */
        .atag_offset = 0x100,
@@ -272,7 +268,7 @@ MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
-       .timer = &mxt_td60_timer,
+       .init_time      = mxt_td60_timer_init,
        .init_machine = mxt_td60_board_init,
        .restart        = mxc_restart,
 MACHINE_END
index eee369fa94a29ad5893e728e2240faaabcc1ae75..b8b15bb1ffdfb2d8e0e0f2e52c71a21d4b4c81de 100644 (file)
@@ -416,10 +416,6 @@ static void __init pca100_timer_init(void)
        mx27_clocks_init(26000000);
 }
 
-static struct sys_timer pca100_timer = {
-       .init = pca100_timer_init,
-};
-
 MACHINE_START(PCA100, "phyCARD-i.MX27")
        .atag_offset = 0x100,
        .map_io = mx27_map_io,
@@ -427,6 +423,6 @@ MACHINE_START(PCA100, "phyCARD-i.MX27")
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
        .init_machine = pca100_init,
-       .timer = &pca100_timer,
+       .init_time      = pca100_timer_init,
        .restart        = mxc_restart,
 MACHINE_END
index 547fef133f658f46d6627277a18cd9a3225c2907..bc0261e99d398f1632986cccf9785a58519c809c 100644 (file)
@@ -685,10 +685,6 @@ static void __init pcm037_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer pcm037_timer = {
-       .init   = pcm037_timer_init,
-};
-
 static void __init pcm037_reserve(void)
 {
        /* reserve 4 MiB for mx3-camera */
@@ -709,7 +705,7 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &pcm037_timer,
+       .init_time      = pcm037_timer_init,
        .init_machine = pcm037_init,
        .init_late = pcm037_init_late,
        .restart        = mxc_restart,
index 4aa0d0798605d5cf2fc20ee64b26d2c1e0f7ed6d..e805ac273e9c6cc952e400a4f542f9727881650c 100644 (file)
@@ -346,17 +346,13 @@ static void __init pcm038_timer_init(void)
        mx27_clocks_init(26000000);
 }
 
-static struct sys_timer pcm038_timer = {
-       .init = pcm038_timer_init,
-};
-
 MACHINE_START(PCM038, "phyCORE-i.MX27")
        .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
        .handle_irq = imx27_handle_irq,
-       .timer = &pcm038_timer,
+       .init_time      = pcm038_timer_init,
        .init_machine = pcm038_init,
        .restart        = mxc_restart,
 MACHINE_END
index 92445440221eba9f2aace35fc1c3e6cd205a2e4b..8ed533f0f8ca7dd207e36f7030402a48718616ae 100644 (file)
@@ -394,10 +394,6 @@ static void __init pcm043_timer_init(void)
        mx35_clocks_init();
 }
 
-static struct sys_timer pcm043_timer = {
-       .init   = pcm043_timer_init,
-};
-
 MACHINE_START(PCM043, "Phytec Phycore pcm043")
        /* Maintainer: Pengutronix */
        .atag_offset = 0x100,
@@ -405,7 +401,7 @@ MACHINE_START(PCM043, "Phytec Phycore pcm043")
        .init_early = imx35_init_early,
        .init_irq = mx35_init_irq,
        .handle_irq = imx35_handle_irq,
-       .timer = &pcm043_timer,
+       .init_time = pcm043_timer_init,
        .init_machine = pcm043_init,
        .restart        = mxc_restart,
 MACHINE_END
index 96d9a91f8a3bb15efda2f4cb2be9a80b16db2a69..22af27ed457ec4d64f3ed70c82915896a4503bd7 100644 (file)
@@ -260,10 +260,6 @@ static void __init qong_timer_init(void)
        mx31_clocks_init(26000000);
 }
 
-static struct sys_timer qong_timer = {
-       .init   = qong_timer_init,
-};
-
 MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
        /* Maintainer: DENX Software Engineering GmbH */
        .atag_offset = 0x100,
@@ -271,7 +267,7 @@ MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
        .handle_irq = imx31_handle_irq,
-       .timer = &qong_timer,
+       .init_time      = qong_timer_init,
        .init_machine = qong_init,
        .restart        = mxc_restart,
 MACHINE_END
index fc970409dbaf1cd782d6f7e86350469508a7ffca..b0fa10dd79fe1baa3d6b8551dbb4903b9aa43d29 100644 (file)
@@ -131,10 +131,6 @@ static void __init scb9328_timer_init(void)
        mx1_clocks_init(32000);
 }
 
-static struct sys_timer scb9328_timer = {
-       .init   = scb9328_timer_init,
-};
-
 MACHINE_START(SCB9328, "Synertronixx scb9328")
        /* Sascha Hauer */
        .atag_offset = 100,
@@ -142,7 +138,7 @@ MACHINE_START(SCB9328, "Synertronixx scb9328")
        .init_early = imx1_init_early,
        .init_irq = mx1_init_irq,
        .handle_irq = imx1_handle_irq,
-       .timer = &scb9328_timer,
+       .init_time      = scb9328_timer_init,
        .init_machine = scb9328_init,
        .restart        = mxc_restart,
 MACHINE_END
index 3aecf91e428988bb364c3b0e46558aa6337ede8a..0910761e8280894918927554598c1f4d1d1f4b79 100644 (file)
@@ -305,17 +305,13 @@ static void __init vpr200_timer_init(void)
        mx35_clocks_init();
 }
 
-static struct sys_timer vpr200_timer = {
-       .init   = vpr200_timer_init,
-};
-
 MACHINE_START(VPR200, "VPR200")
        /* Maintainer: Creative Product Design */
        .map_io = mx35_map_io,
        .init_early = imx35_init_early,
        .init_irq = mx35_init_irq,
        .handle_irq = imx35_handle_irq,
-       .timer = &vpr200_timer,
+       .init_time = vpr200_timer_init,
        .init_machine = vpr200_board_init,
        .restart        = mxc_restart,
 MACHINE_END
index 79d71cf23a1da4a2375ec78d9bbe348274fd7abe..cf34994cfe28e978681d2f878dcde1d3a031b2e2 100644 (file)
 #include "hardware.h"
 #include "iomux-v3.h"
 
-/*
- * Define the MX50 memory map.
- */
-static struct map_desc mx50_io_desc[] __initdata = {
-       imx_map_entry(MX50, TZIC, MT_DEVICE),
-       imx_map_entry(MX50, SPBA0, MT_DEVICE),
-       imx_map_entry(MX50, AIPS1, MT_DEVICE),
-       imx_map_entry(MX50, AIPS2, MT_DEVICE),
-};
-
 /*
  * Define the MX51 memory map.
  */
@@ -59,11 +49,6 @@ static struct map_desc mx53_io_desc[] __initdata = {
  * system startup to create static physical to virtual memory mappings
  * for the IO modules.
  */
-void __init mx50_map_io(void)
-{
-       iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
-}
-
 void __init mx51_map_io(void)
 {
        iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc));
@@ -74,13 +59,6 @@ void __init mx53_map_io(void)
        iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc));
 }
 
-void __init imx50_init_early(void)
-{
-       mxc_set_cpu_type(MXC_CPU_MX50);
-       mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR));
-       mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
-}
-
 /*
  * The MIPI HSC unit has been removed from the i.MX51 Reference Manual by
  * the Freescale marketing division. However this did not remove the
@@ -115,11 +93,6 @@ void __init imx53_init_early(void)
        mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
 }
 
-void __init mx50_init_irq(void)
-{
-       tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
-}
-
 void __init mx51_init_irq(void)
 {
        tzic_init_irq(MX51_IO_ADDRESS(MX51_TZIC_BASE_ADDR));
@@ -148,31 +121,10 @@ static struct sdma_platform_data imx51_sdma_pdata __initdata = {
        .script_addrs = &imx51_sdma_script,
 };
 
-static const struct resource imx50_audmux_res[] __initconst = {
-       DEFINE_RES_MEM(MX50_AUDMUX_BASE_ADDR, SZ_16K),
-};
-
 static const struct resource imx51_audmux_res[] __initconst = {
        DEFINE_RES_MEM(MX51_AUDMUX_BASE_ADDR, SZ_16K),
 };
 
-void __init imx50_soc_init(void)
-{
-       mxc_device_init();
-
-       /* i.mx50 has the i.mx35 type gpio */
-       mxc_register_gpio("imx35-gpio", 0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
-       mxc_register_gpio("imx35-gpio", 1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
-       mxc_register_gpio("imx35-gpio", 2, MX50_GPIO3_BASE_ADDR, SZ_16K, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH);
-       mxc_register_gpio("imx35-gpio", 3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
-       mxc_register_gpio("imx35-gpio", 4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
-       mxc_register_gpio("imx35-gpio", 5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
-
-       /* i.mx50 has the i.mx31 type audmux */
-       platform_device_register_simple("imx31-audmux", 0, imx50_audmux_res,
-                                       ARRAY_SIZE(imx50_audmux_res));
-}
-
 void __init imx51_soc_init(void)
 {
        mxc_device_init();
diff --git a/arch/arm/mach-imx/mx50.h b/arch/arm/mach-imx/mx50.h
deleted file mode 100644 (file)
index 09ac19c..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-#ifndef __MACH_MX50_H__
-#define __MACH_MX50_H__
-
-/*
- * IROM
- */
-#define MX50_IROM_BASE_ADDR            0x0
-#define MX50_IROM_SIZE                 SZ_64K
-
-/* TZIC */
-#define MX50_TZIC_BASE_ADDR            0x0fffc000
-#define MX50_TZIC_SIZE                 SZ_16K
-
-/*
- * IRAM
- */
-#define MX50_IRAM_BASE_ADDR    0xf8000000      /* internal ram */
-#define MX50_IRAM_PARTITIONS   16
-#define MX50_IRAM_SIZE         (MX50_IRAM_PARTITIONS * SZ_8K)  /* 128KB */
-
-/*
- * Databahn
- */
-#define MX50_DATABAHN_BASE_ADDR                        0x14000000
-
-/*
- * Graphics Memory of GPU
- */
-#define MX50_GPU2D_BASE_ADDR           0x20000000
-
-#define MX50_DEBUG_BASE_ADDR           0x40000000
-#define MX50_DEBUG_SIZE                        SZ_1M
-#define MX50_ETB_BASE_ADDR             (MX50_DEBUG_BASE_ADDR + 0x00001000)
-#define MX50_ETM_BASE_ADDR             (MX50_DEBUG_BASE_ADDR + 0x00002000)
-#define MX50_TPIU_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x00003000)
-#define MX50_CTI0_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x00004000)
-#define MX50_CTI1_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x00005000)
-#define MX50_CTI2_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x00006000)
-#define MX50_CTI3_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x00007000)
-#define MX50_CORTEX_DBG_BASE_ADDR      (MX50_DEBUG_BASE_ADDR + 0x00008000)
-
-#define MX50_APBHDMA_BASE_ADDR         (MX50_DEBUG_BASE_ADDR + 0x01000000)
-#define MX50_OCOTP_CTRL_BASE_ADDR      (MX50_DEBUG_BASE_ADDR + 0x01002000)
-#define MX50_DIGCTL_BASE_ADDR          (MX50_DEBUG_BASE_ADDR + 0x01004000)
-#define MX50_GPMI_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x01006000)
-#define MX50_BCH_BASE_ADDR             (MX50_DEBUG_BASE_ADDR + 0x01008000)
-#define MX50_ELCDIF_BASE_ADDR          (MX50_DEBUG_BASE_ADDR + 0x0100a000)
-#define MX50_EPXP_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x0100c000)
-#define MX50_DCP_BASE_ADDR             (MX50_DEBUG_BASE_ADDR + 0x0100e000)
-#define MX50_EPDC_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x01010000)
-#define MX50_QOSC_BASE_ADDR            (MX50_DEBUG_BASE_ADDR + 0x01012000)
-#define MX50_PERFMON_BASE_ADDR         (MX50_DEBUG_BASE_ADDR + 0x01014000)
-#define MX50_SSP_BASE_ADDR             (MX50_DEBUG_BASE_ADDR + 0x01016000)
-#define MX50_ANATOP_BASE_ADDR          (MX50_DEBUG_BASE_ADDR + 0x01018000)
-#define MX50_NIC_BASE_ADDR             (MX50_DEBUG_BASE_ADDR + 0x08000000)
-
-/*
- * SPBA global module enabled #0
- */
-#define MX50_SPBA0_BASE_ADDR           0x50000000
-#define MX50_SPBA0_SIZE                        SZ_1M
-
-#define MX50_MMC_SDHC1_BASE_ADDR       (MX50_SPBA0_BASE_ADDR + 0x00004000)
-#define MX50_MMC_SDHC2_BASE_ADDR       (MX50_SPBA0_BASE_ADDR + 0x00008000)
-#define MX50_UART3_BASE_ADDR           (MX50_SPBA0_BASE_ADDR + 0x0000c000)
-#define MX50_CSPI1_BASE_ADDR           (MX50_SPBA0_BASE_ADDR + 0x00010000)
-#define MX50_SSI2_BASE_ADDR            (MX50_SPBA0_BASE_ADDR + 0x00014000)
-#define MX50_MMC_SDHC3_BASE_ADDR       (MX50_SPBA0_BASE_ADDR + 0x00020000)
-#define MX50_MMC_SDHC4_BASE_ADDR       (MX50_SPBA0_BASE_ADDR + 0x00024000)
-
-/*
- * AIPS 1
- */
-#define MX50_AIPS1_BASE_ADDR   0x53f00000
-#define MX50_AIPS1_SIZE                SZ_1M
-
-#define MX50_OTG_BASE_ADDR     (MX50_AIPS1_BASE_ADDR + 0x00080000)
-#define MX50_GPIO1_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x00084000)
-#define MX50_GPIO2_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x00088000)
-#define MX50_GPIO3_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x0008c000)
-#define MX50_GPIO4_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x00090000)
-#define MX50_KPP_BASE_ADDR     (MX50_AIPS1_BASE_ADDR + 0x00094000)
-#define MX50_WDOG_BASE_ADDR    (MX50_AIPS1_BASE_ADDR + 0x00098000)
-#define MX50_GPT1_BASE_ADDR    (MX50_AIPS1_BASE_ADDR + 0x000a0000)
-#define MX50_SRTC_BASE_ADDR    (MX50_AIPS1_BASE_ADDR + 0x000a4000)
-#define MX50_IOMUXC_BASE_ADDR  (MX50_AIPS1_BASE_ADDR + 0x000a8000)
-#define MX50_EPIT1_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x000ac000)
-#define MX50_PWM1_BASE_ADDR    (MX50_AIPS1_BASE_ADDR + 0x000b4000)
-#define MX50_PWM2_BASE_ADDR    (MX50_AIPS1_BASE_ADDR + 0x000b8000)
-#define MX50_UART1_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x000bc000)
-#define MX50_UART2_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x000c0000)
-#define MX50_SRC_BASE_ADDR     (MX50_AIPS1_BASE_ADDR + 0x000d0000)
-#define MX50_CCM_BASE_ADDR     (MX50_AIPS1_BASE_ADDR + 0x000d4000)
-#define MX50_GPC_BASE_ADDR     (MX50_AIPS1_BASE_ADDR + 0x000d8000)
-#define MX50_GPIO5_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x000dc000)
-#define MX50_GPIO6_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x000e0000)
-#define MX50_I2C3_BASE_ADDR    (MX50_AIPS1_BASE_ADDR + 0x000ec000)
-#define MX50_UART4_BASE_ADDR   (MX50_AIPS1_BASE_ADDR + 0x000f0000)
-
-#define MX50_MSHC_BASE_ADDR    (MX50_AIPS1_BASE_ADDR + 0x000f4000)
-#define MX50_RNGB_BASE_ADDR    (MX50_AIPS1_BASE_ADDR + 0x000f8000)
-
-/*
- * AIPS 2
- */
-#define MX50_AIPS2_BASE_ADDR   0x63f00000
-#define MX50_AIPS2_SIZE                SZ_1M
-
-#define MX50_PLL1_BASE_ADDR    (MX50_AIPS2_BASE_ADDR + 0x00080000)
-#define MX50_PLL2_BASE_ADDR    (MX50_AIPS2_BASE_ADDR + 0x00084000)
-#define MX50_PLL3_BASE_ADDR    (MX50_AIPS2_BASE_ADDR + 0x00088000)
-#define MX50_UART5_BASE_ADDR   (MX50_AIPS2_BASE_ADDR + 0x00090000)
-#define MX50_AHBMAX_BASE_ADDR  (MX50_AIPS2_BASE_ADDR + 0x00094000)
-#define MX50_ARM_BASE_ADDR     (MX50_AIPS2_BASE_ADDR + 0x000a0000)
-#define MX50_OWIRE_BASE_ADDR   (MX50_AIPS2_BASE_ADDR + 0x000a4000)
-#define MX50_CSPI2_BASE_ADDR   (MX50_AIPS2_BASE_ADDR + 0x000ac000)
-#define MX50_SDMA_BASE_ADDR    (MX50_AIPS2_BASE_ADDR + 0x000b0000)
-#define MX50_ROMCP_BASE_ADDR   (MX50_AIPS2_BASE_ADDR + 0x000b8000)
-#define MX50_CSPI3_BASE_ADDR   (MX50_AIPS2_BASE_ADDR + 0x000c0000)
-#define MX50_I2C2_BASE_ADDR    (MX50_AIPS2_BASE_ADDR + 0x000c4000)
-#define MX50_I2C1_BASE_ADDR    (MX50_AIPS2_BASE_ADDR + 0x000c8000)
-#define MX50_SSI1_BASE_ADDR    (MX50_AIPS2_BASE_ADDR + 0x000cc000)
-#define MX50_AUDMUX_BASE_ADDR  (MX50_AIPS2_BASE_ADDR + 0x000d0000)
-#define MX50_WEIM_BASE_ADDR    (MX50_AIPS2_BASE_ADDR + 0x000d8000)
-#define MX50_FEC_BASE_ADDR     (MX50_AIPS2_BASE_ADDR + 0x000ec000)
-
-/*
- * Memory regions and CS
- */
-#define MX50_CSD0_BASE_ADDR            0x70000000
-#define MX50_CSD1_BASE_ADDR            0xb0000000
-#define MX50_CS0_BASE_ADDR             0xf0000000
-
-#define MX50_IO_P2V(x)                 IMX_IO_P2V(x)
-#define MX50_IO_ADDRESS(x)             IOMEM(MX50_IO_P2V(x))
-
-/*
- * defines for SPBA modules
- */
-#define MX50_SPBA_SDHC1                0x04
-#define MX50_SPBA_SDHC2                0x08
-#define MX50_SPBA_UART3                0x0c
-#define MX50_SPBA_CSPI1                0x10
-#define MX50_SPBA_SSI2         0x14
-#define MX50_SPBA_SDHC3                0x20
-#define MX50_SPBA_SDHC4                0x24
-#define MX50_SPBA_SPDIF                0x28
-#define MX50_SPBA_ATA          0x30
-#define MX50_SPBA_SLIM         0x34
-#define MX50_SPBA_HSI2C                0x38
-#define MX50_SPBA_CTRL         0x3c
-
-/*
- * DMA request assignments
- */
-#define MX50_DMA_REQ_GPC               1
-#define MX50_DMA_REQ_ATA_UART4_RX      2
-#define MX50_DMA_REQ_ATA_UART4_TX      3
-#define MX50_DMA_REQ_CSPI1_RX          6
-#define MX50_DMA_REQ_CSPI1_TX          7
-#define MX50_DMA_REQ_CSPI2_RX          8
-#define MX50_DMA_REQ_CSPI2_TX          9
-#define MX50_DMA_REQ_I2C3_SDHC3                10
-#define MX50_DMA_REQ_SDHC4             11
-#define MX50_DMA_REQ_UART2_FIRI_RX     12
-#define MX50_DMA_REQ_UART2_FIRI_TX     13
-#define MX50_DMA_REQ_EXT0              14
-#define MX50_DMA_REQ_EXT1              15
-#define MX50_DMA_REQ_UART5_RX          16
-#define MX50_DMA_REQ_UART5_TX          17
-#define MX50_DMA_REQ_UART1_RX          18
-#define MX50_DMA_REQ_UART1_TX          19
-#define MX50_DMA_REQ_I2C1_SDHC1                20
-#define MX50_DMA_REQ_I2C2_SDHC2                21
-#define MX50_DMA_REQ_SSI2_RX2          22
-#define MX50_DMA_REQ_SSI2_TX2          23
-#define MX50_DMA_REQ_SSI2_RX1          24
-#define MX50_DMA_REQ_SSI2_TX1          25
-#define MX50_DMA_REQ_SSI1_RX2          26
-#define MX50_DMA_REQ_SSI1_TX2          27
-#define MX50_DMA_REQ_SSI1_RX1          28
-#define MX50_DMA_REQ_SSI1_TX1          29
-#define MX50_DMA_REQ_CSPI_RX           38
-#define MX50_DMA_REQ_CSPI_TX           39
-#define MX50_DMA_REQ_UART3_RX          42
-#define MX50_DMA_REQ_UART3_TX          43
-
-/*
- * Interrupt numbers
- */
-#include <asm/irq.h>
-#define MX50_INT_MMC_SDHC1     (NR_IRQS_LEGACY + 1)
-#define MX50_INT_MMC_SDHC2     (NR_IRQS_LEGACY + 2)
-#define MX50_INT_MMC_SDHC3     (NR_IRQS_LEGACY + 3)
-#define MX50_INT_MMC_SDHC4     (NR_IRQS_LEGACY + 4)
-#define MX50_INT_DAP           (NR_IRQS_LEGACY + 5)
-#define MX50_INT_SDMA          (NR_IRQS_LEGACY + 6)
-#define MX50_INT_IOMUX         (NR_IRQS_LEGACY + 7)
-#define MX50_INT_UART4         (NR_IRQS_LEGACY + 13)
-#define MX50_INT_USB_H1                (NR_IRQS_LEGACY + 14)
-#define MX50_INT_USB_OTG       (NR_IRQS_LEGACY + 18)
-#define MX50_INT_DATABAHN      (NR_IRQS_LEGACY + 19)
-#define MX50_INT_ELCDIF                (NR_IRQS_LEGACY + 20)
-#define MX50_INT_EPXP          (NR_IRQS_LEGACY + 21)
-#define MX50_INT_SRTC_NTZ      (NR_IRQS_LEGACY + 24)
-#define MX50_INT_SRTC_TZ       (NR_IRQS_LEGACY + 25)
-#define MX50_INT_EPDC          (NR_IRQS_LEGACY + 27)
-#define MX50_INT_NIC           (NR_IRQS_LEGACY + 28)
-#define MX50_INT_SSI1          (NR_IRQS_LEGACY + 29)
-#define MX50_INT_SSI2          (NR_IRQS_LEGACY + 30)
-#define MX50_INT_UART1         (NR_IRQS_LEGACY + 31)
-#define MX50_INT_UART2         (NR_IRQS_LEGACY + 32)
-#define MX50_INT_UART3         (NR_IRQS_LEGACY + 33)
-#define MX50_INT_RESV34                (NR_IRQS_LEGACY + 34)
-#define MX50_INT_RESV35                (NR_IRQS_LEGACY + 35)
-#define MX50_INT_CSPI1         (NR_IRQS_LEGACY + 36)
-#define MX50_INT_CSPI2         (NR_IRQS_LEGACY + 37)
-#define MX50_INT_CSPI          (NR_IRQS_LEGACY + 38)
-#define MX50_INT_GPT           (NR_IRQS_LEGACY + 39)
-#define MX50_INT_EPIT1         (NR_IRQS_LEGACY + 40)
-#define MX50_INT_GPIO1_INT7    (NR_IRQS_LEGACY + 42)
-#define MX50_INT_GPIO1_INT6    (NR_IRQS_LEGACY + 43)
-#define MX50_INT_GPIO1_INT5    (NR_IRQS_LEGACY + 44)
-#define MX50_INT_GPIO1_INT4    (NR_IRQS_LEGACY + 45)
-#define MX50_INT_GPIO1_INT3    (NR_IRQS_LEGACY + 46)
-#define MX50_INT_GPIO1_INT2    (NR_IRQS_LEGACY + 47)
-#define MX50_INT_GPIO1_INT1    (NR_IRQS_LEGACY + 48)
-#define MX50_INT_GPIO1_INT0    (NR_IRQS_LEGACY + 49)
-#define MX50_INT_GPIO1_LOW     (NR_IRQS_LEGACY + 50)
-#define MX50_INT_GPIO1_HIGH    (NR_IRQS_LEGACY + 51)
-#define MX50_INT_GPIO2_LOW     (NR_IRQS_LEGACY + 52)
-#define MX50_INT_GPIO2_HIGH    (NR_IRQS_LEGACY + 53)
-#define MX50_INT_GPIO3_LOW     (NR_IRQS_LEGACY + 54)
-#define MX50_INT_GPIO3_HIGH    (NR_IRQS_LEGACY + 55)
-#define MX50_INT_GPIO4_LOW     (NR_IRQS_LEGACY + 56)
-#define MX50_INT_GPIO4_HIGH    (NR_IRQS_LEGACY + 57)
-#define MX50_INT_WDOG1         (NR_IRQS_LEGACY + 58)
-#define MX50_INT_KPP           (NR_IRQS_LEGACY + 60)
-#define MX50_INT_PWM1          (NR_IRQS_LEGACY + 61)
-#define MX50_INT_I2C1          (NR_IRQS_LEGACY + 62)
-#define MX50_INT_I2C2          (NR_IRQS_LEGACY + 63)
-#define MX50_INT_I2C3          (NR_IRQS_LEGACY + 64)
-#define MX50_INT_RESV65                (NR_IRQS_LEGACY + 65)
-#define MX50_INT_DCDC          (NR_IRQS_LEGACY + 66)
-#define MX50_INT_THERMAL_ALARM (NR_IRQS_LEGACY + 67)
-#define MX50_INT_ANA3          (NR_IRQS_LEGACY + 68)
-#define MX50_INT_ANA4          (NR_IRQS_LEGACY + 69)
-#define MX50_INT_CCM1          (NR_IRQS_LEGACY + 71)
-#define MX50_INT_CCM2          (NR_IRQS_LEGACY + 72)
-#define MX50_INT_GPC1          (NR_IRQS_LEGACY + 73)
-#define MX50_INT_GPC2          (NR_IRQS_LEGACY + 74)
-#define MX50_INT_SRC           (NR_IRQS_LEGACY + 75)
-#define MX50_INT_NM            (NR_IRQS_LEGACY + 76)
-#define MX50_INT_PMU           (NR_IRQS_LEGACY + 77)
-#define MX50_INT_CTI_IRQ       (NR_IRQS_LEGACY + 78)
-#define MX50_INT_CTI1_TG0      (NR_IRQS_LEGACY + 79)
-#define MX50_INT_CTI1_TG1      (NR_IRQS_LEGACY + 80)
-#define MX50_INT_GPU2_IRQ      (NR_IRQS_LEGACY + 84)
-#define MX50_INT_GPU2_BUSY     (NR_IRQS_LEGACY + 85)
-#define MX50_INT_UART5         (NR_IRQS_LEGACY + 86)
-#define MX50_INT_FEC           (NR_IRQS_LEGACY + 87)
-#define MX50_INT_OWIRE         (NR_IRQS_LEGACY + 88)
-#define MX50_INT_CTI1_TG2      (NR_IRQS_LEGACY + 89)
-#define MX50_INT_SJC           (NR_IRQS_LEGACY + 90)
-#define MX50_INT_DCP_CHAN1_3   (NR_IRQS_LEGACY + 91)
-#define MX50_INT_DCP_CHAN0     (NR_IRQS_LEGACY + 92)
-#define MX50_INT_PWM2          (NR_IRQS_LEGACY + 94)
-#define MX50_INT_RNGB          (NR_IRQS_LEGACY + 97)
-#define MX50_INT_CTI1_TG3      (NR_IRQS_LEGACY + 98)
-#define MX50_INT_RAWNAND_BCH   (NR_IRQS_LEGACY + 100)
-#define MX50_INT_RAWNAND_GPMI  (NR_IRQS_LEGACY + 102)
-#define MX50_INT_GPIO5_LOW     (NR_IRQS_LEGACY + 103)
-#define MX50_INT_GPIO5_HIGH    (NR_IRQS_LEGACY + 104)
-#define MX50_INT_GPIO6_LOW     (NR_IRQS_LEGACY + 105)
-#define MX50_INT_GPIO6_HIGH    (NR_IRQS_LEGACY + 106)
-#define MX50_INT_MSHC          (NR_IRQS_LEGACY + 109)
-#define MX50_INT_APBHDMA_CHAN0 (NR_IRQS_LEGACY + 110)
-#define MX50_INT_APBHDMA_CHAN1 (NR_IRQS_LEGACY + 111)
-#define MX50_INT_APBHDMA_CHAN2 (NR_IRQS_LEGACY + 112)
-#define MX50_INT_APBHDMA_CHAN3 (NR_IRQS_LEGACY + 113)
-#define MX50_INT_APBHDMA_CHAN4 (NR_IRQS_LEGACY + 114)
-#define MX50_INT_APBHDMA_CHAN5 (NR_IRQS_LEGACY + 115)
-#define MX50_INT_APBHDMA_CHAN6 (NR_IRQS_LEGACY + 116)
-#define MX50_INT_APBHDMA_CHAN7 (NR_IRQS_LEGACY + 117)
-
-#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
-extern int mx50_revision(void);
-#endif
-
-#endif /* ifndef __MACH_MX50_H__ */
index d78298366a91ac6448f9c5ace816083d025a9631..7dce17a9fe6c154e58fd6e119694523b116df6f6 100644 (file)
@@ -32,7 +32,6 @@
 #define MXC_CPU_MX27           27
 #define MXC_CPU_MX31           31
 #define MXC_CPU_MX35           35
-#define MXC_CPU_MX50           50
 #define MXC_CPU_MX51           51
 #define MXC_CPU_MX53           53
 
@@ -126,18 +125,6 @@ extern unsigned int __mxc_cpu_type;
 # define cpu_is_mx35()         (0)
 #endif
 
-#ifdef CONFIG_SOC_IMX50
-# ifdef mxc_cpu_type
-#  undef mxc_cpu_type
-#  define mxc_cpu_type __mxc_cpu_type
-# else
-#  define mxc_cpu_type MXC_CPU_MX50
-# endif
-# define cpu_is_mx50()         (mxc_cpu_type == MXC_CPU_MX50)
-#else
-# define cpu_is_mx50()         (0)
-#endif
-
 #ifdef CONFIG_SOC_IMX51
 # ifdef mxc_cpu_type
 #  undef mxc_cpu_type
index 66fae885c8429f3b9147d4a3c33cd6e739a0ae05..7c0b03f67b056d32ecd73d774f71d158638b5e9a 100644 (file)
 
 #include <linux/init.h>
 #include <linux/smp.h>
+#include <linux/irqchip/arm-gic.h>
 #include <asm/page.h>
 #include <asm/smp_scu.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach/map.h>
 
 #include "common.h"
 #include "hardware.h"
 
+#define SCU_STANDBY_ENABLE     (1 << 5)
+
 static void __iomem *scu_base;
 
 static struct map_desc scu_io_desc __initdata = {
@@ -42,6 +44,14 @@ void __init imx_scu_map_io(void)
        scu_base = IMX_IO_ADDRESS(base);
 }
 
+void imx_scu_standby_enable(void)
+{
+       u32 val = readl_relaxed(scu_base);
+
+       val |= SCU_STANDBY_ENABLE;
+       writel_relaxed(val, scu_base);
+}
+
 static void __cpuinit imx_secondary_init(unsigned int cpu)
 {
        /*
@@ -71,8 +81,6 @@ static void __init imx_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 void imx_smp_prepare(void)
index 2e063c2deb9e2078edbccdfb0a52fd8dca9c7284..f67fd7ee812773f8e49aecfd2d24f725bf806de3 100644 (file)
@@ -34,7 +34,7 @@
 
 /*
  * set cpu low power mode before WFI instruction. This function is called
- * mx5 because it can be used for mx50, mx51, and mx53.
+ * mx5 because it can be used for mx51, and mx53.
  */
 static void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode)
 {
@@ -85,10 +85,7 @@ static void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode)
        __raw_writel(plat_lpc, MXC_CORTEXA8_PLAT_LPC);
        __raw_writel(ccm_clpcr, MXC_CCM_CLPCR);
        __raw_writel(arm_srpgcr, MXC_SRPG_ARM_SRPGCR);
-
-       /* Enable NEON SRPG for all but MX50TO1.0. */
-       if (mx50_revision() != IMX_CHIP_REVISION_1_0)
-               __raw_writel(arm_srpgcr, MXC_SRPG_NEON_SRPGCR);
+       __raw_writel(arm_srpgcr, MXC_SRPG_NEON_SRPGCR);
 
        if (stop_mode) {
                empgc0 |= MXC_SRPGCR_PCR;
index f017302f6d09c94d5d97d4d63f47311d8ace4e7a..fea91313678b25efb17e7342afb45013c2fa156f 100644 (file)
@@ -152,7 +152,8 @@ static int v2_set_next_event(unsigned long evt,
 
        __raw_writel(tcmp, timer_base + V2_TCMP);
 
-       return (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ?
+       return evt < 0x7fffffff &&
+               (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ?
                                -ETIME : 0;
 }
 
@@ -256,7 +257,6 @@ static struct irqaction mxc_timer_irq = {
 static struct clock_event_device clockevent_mxc = {
        .name           = "mxc_timer1",
        .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .set_mode       = mxc_set_mode,
        .set_next_event = mx1_2_set_next_event,
        .rating         = 200,
@@ -264,21 +264,13 @@ static struct clock_event_device clockevent_mxc = {
 
 static int __init mxc_clockevent_init(struct clk *timer_clk)
 {
-       unsigned int c = clk_get_rate(timer_clk);
-
        if (timer_is_v2())
                clockevent_mxc.set_next_event = v2_set_next_event;
 
-       clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
-                                       clockevent_mxc.shift);
-       clockevent_mxc.max_delta_ns =
-                       clockevent_delta2ns(0xfffffffe, &clockevent_mxc);
-       clockevent_mxc.min_delta_ns =
-                       clockevent_delta2ns(0xff, &clockevent_mxc);
-
        clockevent_mxc.cpumask = cpumask_of(0);
-
-       clockevents_register_device(&clockevent_mxc);
+       clockevents_config_and_register(&clockevent_mxc,
+                                       clk_get_rate(timer_clk),
+                                       0xff, 0xfffffffe);
 
        return 0;
 }
index 11e2a4145807876b79883fe4c0a45a76ba42a693..78f1b3814f774edcd96de440ec655fda40682798 100644 (file)
@@ -425,7 +425,7 @@ void __init ap_init_early(void)
 
 #ifdef CONFIG_OF
 
-static void __init ap_init_timer_of(void)
+static void __init ap_of_timer_init(void)
 {
        struct device_node *node;
        const char *path;
@@ -464,10 +464,6 @@ static void __init ap_init_timer_of(void)
        integrator_clockevent_init(rate, base, irq);
 }
 
-static struct sys_timer ap_of_timer = {
-       .init           = ap_init_timer_of,
-};
-
 static const struct of_device_id fpga_irq_of_match[] __initconst = {
        { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
        { /* Sentinel */ }
@@ -586,7 +582,7 @@ DT_MACHINE_START(INTEGRATOR_AP_DT, "ARM Integrator/AP (Device Tree)")
        .init_early     = ap_init_early,
        .init_irq       = ap_init_irq_of,
        .handle_irq     = fpga_handle_irq,
-       .timer          = &ap_of_timer,
+       .init_time      = ap_of_timer_init,
        .init_machine   = ap_init_of,
        .restart        = integrator_restart,
        .dt_compat      = ap_dt_board_compat,
@@ -638,7 +634,7 @@ static struct platform_device cfi_flash_device = {
        .resource       = &cfi_flash_resource,
 };
 
-static void __init ap_init_timer(void)
+static void __init ap_timer_init(void)
 {
        struct clk *clk;
        unsigned long rate;
@@ -657,10 +653,6 @@ static void __init ap_init_timer(void)
                                IRQ_TIMERINT1);
 }
 
-static struct sys_timer ap_timer = {
-       .init           = ap_init_timer,
-};
-
 #define INTEGRATOR_SC_VALID_INT        0x003fffff
 
 static void __init ap_init_irq(void)
@@ -716,7 +708,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator")
        .init_early     = ap_init_early,
        .init_irq       = ap_init_irq,
        .handle_irq     = fpga_handle_irq,
-       .timer          = &ap_timer,
+       .init_time      = ap_timer_init,
        .init_machine   = ap_init,
        .restart        = integrator_restart,
 MACHINE_END
index 7322838c0447dabe3c29d7b5b703af5d49771f31..4cef9a0ebbb940398f64335531f987e08e6fa80b 100644 (file)
@@ -251,7 +251,7 @@ static void __init intcp_init_early(void)
 
 #ifdef CONFIG_OF
 
-static void __init intcp_timer_init_of(void)
+static void __init cp_of_timer_init(void)
 {
        struct device_node *node;
        const char *path;
@@ -283,10 +283,6 @@ static void __init intcp_timer_init_of(void)
        sp804_clockevents_init(base, irq, node->name);
 }
 
-static struct sys_timer cp_of_timer = {
-       .init           = intcp_timer_init_of,
-};
-
 static const struct of_device_id fpga_irq_of_match[] __initconst = {
        { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
        { /* Sentinel */ }
@@ -390,7 +386,7 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)")
        .init_early     = intcp_init_early,
        .init_irq       = intcp_init_irq_of,
        .handle_irq     = fpga_handle_irq,
-       .timer          = &cp_of_timer,
+       .init_time      = cp_of_timer_init,
        .init_machine   = intcp_init_of,
        .restart        = integrator_restart,
        .dt_compat      = intcp_dt_board_compat,
@@ -512,7 +508,7 @@ static void __init intcp_init_irq(void)
 #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE)
 #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE)
 
-static void __init intcp_timer_init(void)
+static void __init cp_timer_init(void)
 {
        writel(0, TIMER0_VA_BASE + TIMER_CTRL);
        writel(0, TIMER1_VA_BASE + TIMER_CTRL);
@@ -522,10 +518,6 @@ static void __init intcp_timer_init(void)
        sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1");
 }
 
-static struct sys_timer cp_timer = {
-       .init           = intcp_timer_init,
-};
-
 #define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }
 #define INTEGRATOR_CP_AACI_IRQS        { IRQ_CP_AACIINT }
 
@@ -565,7 +557,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
        .init_early     = intcp_init_early,
        .init_irq       = intcp_init_irq,
        .handle_irq     = fpga_handle_irq,
-       .timer          = &cp_timer,
+       .init_time      = cp_timer_init,
        .init_machine   = intcp_init,
        .restart        = integrator_restart,
 MACHINE_END
index e3f3e7daa79edc2257580bcabb2a1c4e8b5a6cb7..02a8228ac2d3d4d3b6217fb8652120f16d1e018c 100644 (file)
@@ -84,17 +84,13 @@ static void __init iq81340mc_timer_init(void)
        iop_init_time(bus_freq);
 }
 
-static struct sys_timer iq81340mc_timer = {
-       .init       = iq81340mc_timer_init,
-};
-
 MACHINE_START(IQ81340MC, "Intel IQ81340MC")
        /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
        .atag_offset    = 0x100,
        .init_early     = iop13xx_init_early,
        .map_io         = iop13xx_map_io,
        .init_irq       = iop13xx_init_irq,
-       .timer          = &iq81340mc_timer,
+       .init_time      = iq81340mc_timer_init,
        .init_machine   = iq81340mc_init,
        .restart        = iop13xx_restart,
 MACHINE_END
index e947441116340fe6f80ddb44a4ed696b17a8cb9a..1b80f10722b3fdb01f5e8aea44eac8b60113cb4e 100644 (file)
@@ -86,17 +86,13 @@ static void __init iq81340sc_timer_init(void)
        iop_init_time(bus_freq);
 }
 
-static struct sys_timer iq81340sc_timer = {
-       .init       = iq81340sc_timer_init,
-};
-
 MACHINE_START(IQ81340SC, "Intel IQ81340SC")
        /* Maintainer: Dan Williams <dan.j.williams@intel.com> */
        .atag_offset    = 0x100,
        .init_early     = iop13xx_init_early,
        .map_io         = iop13xx_map_io,
        .init_irq       = iop13xx_init_irq,
-       .timer          = &iq81340sc_timer,
+       .init_time      = iq81340sc_timer_init,
        .init_machine   = iq81340sc_init,
        .restart        = iop13xx_restart,
 MACHINE_END
index 9f369f09c29d7858fba73db3f3747a864e066136..31fbb6c61b25c304adc2f0ee940ac1df38ac33f1 100644 (file)
@@ -40,10 +40,6 @@ static void __init em7210_timer_init(void)
        iop_init_time(200000000);
 }
 
-static struct sys_timer em7210_timer = {
-       .init           = em7210_timer_init,
-};
-
 /*
  * EM7210 RTC
  */
@@ -205,7 +201,7 @@ MACHINE_START(EM7210, "Lanner EM7210")
        .atag_offset    = 0x100,
        .map_io         = em7210_map_io,
        .init_irq       = iop32x_init_irq,
-       .timer          = &em7210_timer,
+       .init_time      = em7210_timer_init,
        .init_machine   = em7210_init_machine,
        .restart        = iop3xx_restart,
 MACHINE_END
index 02e20c3912ba18e70c95f8e06c0f49d4e663dd2a..ac304705fe68956ebae0f85bf2d5c53b2cbf9e37 100644 (file)
@@ -44,10 +44,6 @@ static void __init glantank_timer_init(void)
        iop_init_time(200000000);
 }
 
-static struct sys_timer glantank_timer = {
-       .init           = glantank_timer_init,
-};
-
 
 /*
  * GLAN Tank I/O.
@@ -209,7 +205,7 @@ MACHINE_START(GLANTANK, "GLAN Tank")
        .atag_offset    = 0x100,
        .map_io         = glantank_map_io,
        .init_irq       = iop32x_init_irq,
-       .timer          = &glantank_timer,
+       .init_time      = glantank_timer_init,
        .init_machine   = glantank_init_machine,
        .restart        = iop3xx_restart,
 MACHINE_END
index ddd1c7ecfe57f239aecdc7f39ae9e7d4bc6c3871..f2cd2966212da1381d677d47abb147f4b5c88879 100644 (file)
@@ -75,10 +75,6 @@ static void __init iq31244_timer_init(void)
        }
 }
 
-static struct sys_timer iq31244_timer = {
-       .init           = iq31244_timer_init,
-};
-
 
 /*
  * IQ31244 I/O.
@@ -314,7 +310,7 @@ MACHINE_START(IQ31244, "Intel IQ31244")
        .atag_offset    = 0x100,
        .map_io         = iq31244_map_io,
        .init_irq       = iop32x_init_irq,
-       .timer          = &iq31244_timer,
+       .init_time      = iq31244_timer_init,
        .init_machine   = iq31244_init_machine,
        .restart        = iop3xx_restart,
 MACHINE_END
@@ -329,7 +325,7 @@ MACHINE_START(EP80219, "Intel EP80219")
        .atag_offset    = 0x100,
        .map_io         = iq31244_map_io,
        .init_irq       = iop32x_init_irq,
-       .timer          = &iq31244_timer,
+       .init_time      = iq31244_timer_init,
        .init_machine   = iq31244_init_machine,
        .restart        = iop3xx_restart,
 MACHINE_END
index bf155e6a3b4505d4e3ba76ce9d37732115deb11b..015435de90dd6f179b808e693b209f4da1c9f021 100644 (file)
@@ -43,10 +43,6 @@ static void __init iq80321_timer_init(void)
        iop_init_time(200000000);
 }
 
-static struct sys_timer iq80321_timer = {
-       .init           = iq80321_timer_init,
-};
-
 
 /*
  * IQ80321 I/O.
@@ -188,7 +184,7 @@ MACHINE_START(IQ80321, "Intel IQ80321")
        .atag_offset    = 0x100,
        .map_io         = iq80321_map_io,
        .init_irq       = iop32x_init_irq,
-       .timer          = &iq80321_timer,
+       .init_time      = iq80321_timer_init,
        .init_machine   = iq80321_init_machine,
        .restart        = iop3xx_restart,
 MACHINE_END
index 5a7ae91e8849a5061ee9958c0bd3adaaf2de0501..ea0984a7449e78d5c4780d349ea53759c9f75ab2 100644 (file)
@@ -50,10 +50,6 @@ static void __init n2100_timer_init(void)
        iop_init_time(198000000);
 }
 
-static struct sys_timer n2100_timer = {
-       .init           = n2100_timer_init,
-};
-
 
 /*
  * N2100 I/O.
@@ -337,7 +333,7 @@ MACHINE_START(N2100, "Thecus N2100")
        .atag_offset    = 0x100,
        .map_io         = n2100_map_io,
        .init_irq       = iop32x_init_irq,
-       .timer          = &n2100_timer,
+       .init_time      = n2100_timer_init,
        .init_machine   = n2100_init_machine,
        .restart        = n2100_restart,
 MACHINE_END
index e74a7debe793e687420408b3c0948a44d46bdcfe..c43304a10fa72cdeac813890a68ac6e3a476ff30 100644 (file)
@@ -45,10 +45,6 @@ static void __init iq80331_timer_init(void)
                iop_init_time(266000000);
 }
 
-static struct sys_timer iq80331_timer = {
-       .init           = iq80331_timer_init,
-};
-
 
 /*
  * IQ80331 PCI.
@@ -143,7 +139,7 @@ MACHINE_START(IQ80331, "Intel IQ80331")
        .atag_offset    = 0x100,
        .map_io         = iop3xx_map_io,
        .init_irq       = iop33x_init_irq,
-       .timer          = &iq80331_timer,
+       .init_time      = iq80331_timer_init,
        .init_machine   = iq80331_init_machine,
        .restart        = iop3xx_restart,
 MACHINE_END
index e2f5beece6e813f6f3d32a5b13b603d3bb3d739d..8192987e78e5b7107254ffb29a6dd8856fcc8bad 100644 (file)
@@ -45,10 +45,6 @@ static void __init iq80332_timer_init(void)
                iop_init_time(266000000);
 }
 
-static struct sys_timer iq80332_timer = {
-       .init           = iq80332_timer_init,
-};
-
 
 /*
  * IQ80332 PCI.
@@ -143,7 +139,7 @@ MACHINE_START(IQ80332, "Intel IQ80332")
        .atag_offset    = 0x100,
        .map_io         = iop3xx_map_io,
        .init_irq       = iop33x_init_irq,
-       .timer          = &iq80332_timer,
+       .init_time      = iq80332_timer_init,
        .init_machine   = iq80332_init_machine,
        .restart        = iop3xx_restart,
 MACHINE_END
index 90e42e9982cb1031d9bdc53a0c9b032a3bc6e5ec..6beec150c060a6a7453ce2a080e5947b54b93dee 100644 (file)
@@ -167,7 +167,7 @@ MACHINE_START(AVILA, "Gateworks Avila Network Platform")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = avila_init,
 #if defined(CONFIG_PCI)
@@ -187,7 +187,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = avila_init,
 #if defined(CONFIG_PCI)
index 8c0c0e2d0727317078a93f2241763818acf1ac15..1dbeb7c99d58ed1fcc8cee23e019183ca9442400 100644 (file)
@@ -307,10 +307,6 @@ void __init ixp4xx_timer_init(void)
        ixp4xx_clockevent_init();
 }
 
-struct sys_timer ixp4xx_timer = {
-       .init           = ixp4xx_timer_init,
-};
-
 static struct pxa2xx_udc_mach_info ixp4xx_udc_info;
 
 void __init ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info)
@@ -523,22 +519,15 @@ static struct clock_event_device clockevent_ixp4xx = {
        .name           = "ixp4xx timer1",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .rating         = 200,
-       .shift          = 24,
        .set_mode       = ixp4xx_set_mode,
        .set_next_event = ixp4xx_set_next_event,
 };
 
 static void __init ixp4xx_clockevent_init(void)
 {
-       clockevent_ixp4xx.mult = div_sc(IXP4XX_TIMER_FREQ, NSEC_PER_SEC,
-                                       clockevent_ixp4xx.shift);
-       clockevent_ixp4xx.max_delta_ns =
-               clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx);
-       clockevent_ixp4xx.min_delta_ns =
-               clockevent_delta2ns(0xf, &clockevent_ixp4xx);
        clockevent_ixp4xx.cpumask = cpumask_of(0);
-
-       clockevents_register_device(&clockevent_ixp4xx);
+       clockevents_config_and_register(&clockevent_ixp4xx, IXP4XX_TIMER_FREQ,
+                                       0xf, 0xfffffffe);
 }
 
 void ixp4xx_restart(char mode, const char *cmd)
index 1b83110028d6d95f1c99e7a4e42e03ee0b987985..820cae8608fc2080259c9d8aefe04adb924e6157 100644 (file)
@@ -112,7 +112,7 @@ MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = coyote_init,
 #if defined(CONFIG_PCI)
@@ -132,7 +132,7 @@ MACHINE_START(IXDPG425, "Intel IXDPG425")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = coyote_init,
        .restart        = ixp4xx_restart,
index 97a0af8f1955da9b83f5be0fca9014ffc6315aa8..5d413f8c57002e1f623c37f9eedfaabcab2fecb2 100644 (file)
@@ -226,10 +226,6 @@ static void __init dsmg600_timer_init(void)
     ixp4xx_timer_init();
 }
 
-static struct sys_timer dsmg600_timer = {
-    .init   = dsmg600_timer_init,
-};
-
 static void __init dsmg600_init(void)
 {
        ixp4xx_sys_init();
@@ -282,7 +278,7 @@ MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &dsmg600_timer,
+       .init_time      = dsmg600_timer_init,
        .init_machine   = dsmg600_init,
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
index 9175a25a7511723d5a4de4f2d1d4a21b21f74a86..429966b756ed3eddcfd646e7838c163052ff0714 100644 (file)
@@ -272,7 +272,7 @@ MACHINE_START(FSG, "Freecom FSG-3")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = fsg_init,
 #if defined(CONFIG_PCI)
index 033c7175895393f82524be3d04d77327858804e8..3d24b3fcee875f0c34857861c936e4c087458280 100644 (file)
@@ -99,7 +99,7 @@ MACHINE_START(GATEWAY7001, "Gateway 7001 AP")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = gateway7001_init,
 #if defined(CONFIG_PCI)
index 53b8348dfcc279c19fed814ac4f1d19afdafe5b6..e54ff491c105fd0949238a9127abff04069216f6 100644 (file)
@@ -498,7 +498,7 @@ MACHINE_START(GORAMO_MLR, "MultiLink")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = gmlr_init,
 #if defined(CONFIG_PCI)
index 18ebc6be7969cf5f42ea17e4a531bc6ac2c5d43b..16a12994fb5378c8bc77a0b4b73d3e7da453bcee 100644 (file)
@@ -167,7 +167,7 @@ MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = gtwx5715_init,
 #if defined(CONFIG_PCI)
index 5bce94aacca96566a38728f3ffd8c0ecbb55cb7e..db5afb69c123df2c49d551dbd4d6ad7fedb717ea 100644 (file)
@@ -89,8 +89,6 @@ struct ixp4xx_pata_data {
        void __iomem    *cs1;
 };
 
-struct sys_timer;
-
 #define IXP4XX_ETH_NPEA                0x00
 #define IXP4XX_ETH_NPEB                0x10
 #define IXP4XX_ETH_NPEC                0x20
@@ -125,7 +123,6 @@ extern void ixp4xx_init_early(void);
 extern void ixp4xx_init_irq(void);
 extern void ixp4xx_sys_init(void);
 extern void ixp4xx_timer_init(void);
-extern struct sys_timer ixp4xx_timer;
 extern void ixp4xx_restart(char, const char *);
 extern void ixp4xx_pci_preinit(void);
 struct pci_sys_data;
index 108a9d3f382da148ff3b6cf281440ab4a302d1c4..22d688b7d51302a711ac75f67e5fc909a9abcd1f 100644 (file)
@@ -252,7 +252,7 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = ixdp425_init,
 #if defined(CONFIG_PCI)
@@ -268,7 +268,7 @@ MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = ixdp425_init,
 #if defined(CONFIG_PCI)
@@ -283,7 +283,7 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = ixdp425_init,
 #if defined(CONFIG_PCI)
@@ -298,7 +298,7 @@ MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = ixdp425_init,
 #if defined(CONFIG_PCI)
index 33cb0955b6bffa840b2ae727e7ea76753803aa4b..ed667ce9f576a8548978b0faa7b5e5d5776687e4 100644 (file)
@@ -317,7 +317,7 @@ MACHINE_START(NAS100D, "Iomega NAS 100d")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .init_machine   = nas100d_init,
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
index e2903faaebb35f4ffc4ddfcb0c08f53046e05033..7e55236c26eab3dea60ddfa2ef9eaacad17bd597 100644 (file)
@@ -232,10 +232,6 @@ static void __init nslu2_timer_init(void)
     ixp4xx_timer_init();
 }
 
-static struct sys_timer nslu2_timer = {
-    .init   = nslu2_timer_init,
-};
-
 static void __init nslu2_init(void)
 {
        uint8_t __iomem *f;
@@ -303,7 +299,7 @@ MACHINE_START(NSLU2, "Linksys NSLU2")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &nslu2_timer,
+       .init_time      = nslu2_timer_init,
        .init_machine   = nslu2_init,
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
index 158ddb79821da36168bb9c00a1e711bf5c17286a..46a89f5e82693f930c318abb0ce61f976b324b9b 100644 (file)
@@ -245,7 +245,7 @@ MACHINE_START(DEVIXP, "Omicron DEVIXP")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .init_machine   = omixp_init,
        .restart        = ixp4xx_restart,
 MACHINE_END
@@ -257,7 +257,7 @@ MACHINE_START(MICCPT, "Omicron MICCPT")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .init_machine   = omixp_init,
 #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
@@ -272,7 +272,7 @@ MACHINE_START(MIC256, "Omicron MIC256")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .init_machine   = omixp_init,
        .restart        = ixp4xx_restart,
 MACHINE_END
index 2798f435aaf4fbf3f24eb56fca8851e3decfc985..d42730a1d4abf5b85ccb193c6e9c297a140485c0 100644 (file)
@@ -239,7 +239,7 @@ MACHINE_START(ARCOM_VULCAN, "Arcom/Eurotech Vulcan")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = vulcan_init,
 #if defined(CONFIG_PCI)
index a785175b115bf146f1e96ef13d41f0408897e514..8f9ea2f3a9a5c8971bf42497fc85679082db37ff 100644 (file)
@@ -100,7 +100,7 @@ MACHINE_START(WG302V2, "Netgear WG302 v2 / WAG302 v2")
        .map_io         = ixp4xx_map_io,
        .init_early     = ixp4xx_init_early,
        .init_irq       = ixp4xx_init_irq,
-       .timer          = &ixp4xx_timer,
+       .init_time      = ixp4xx_timer_init,
        .atag_offset    = 0x100,
        .init_machine   = wg302v2_init,
 #if defined(CONFIG_PCI)
index f964cdc44b1a5d6b2d4037f20b2fb7af8c009c85..95cc04d14b659ac6836e0279058a28ef14a3f33d 100644 (file)
@@ -185,7 +185,7 @@ DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = orion_dt_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .init_machine   = kirkwood_dt_init,
        .restart        = kirkwood_restart,
        .dt_compat      = kirkwood_dt_board_compat,
index 5ed1f2e8c5f88e76aaf88352d4656dc2ee5ae25d..49792a0cd2d3d17f399ea96ee8f5369f49c3bb99 100644 (file)
@@ -552,7 +552,7 @@ static int __init kirkwood_find_tclk(void)
        return 166666667;
 }
 
-static void __init kirkwood_timer_init(void)
+void __init kirkwood_timer_init(void)
 {
        kirkwood_tclk = kirkwood_find_tclk();
 
@@ -560,10 +560,6 @@ static void __init kirkwood_timer_init(void)
                        IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
 }
 
-struct sys_timer kirkwood_timer = {
-       .init = kirkwood_timer_init,
-};
-
 /*****************************************************************************
  * Audio
  ****************************************************************************/
index 320aa61ff505b71f5852a4b919bce2fc1ad4d442..e956d0277dd186a7145e6c8badc108ba1f504f44 100644 (file)
@@ -157,7 +157,7 @@ void kirkwood_xor1_init(void);
 void kirkwood_crypto_init(void);
 
 extern int kirkwood_tclk;
-extern struct sys_timer kirkwood_timer;
+extern void kirkwood_timer_init(void);
 
 #define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
 
index 2c1a453df2012801661c6c0c2e9f02f198d029e7..453418063c1e14babc0feeeb91b291d6ad39d42b 100644 (file)
@@ -226,6 +226,6 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index c49b177c15236a1e8c3bc0bf2fa7d719b5132145..5a369fe74754636590aa8b3ba7fea5a8324bd1fb 100644 (file)
@@ -103,6 +103,6 @@ MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index 791a98fafa29a1c2ed4508015c783f50119e0342..77f98f2b0416d9edfccfc7579f78b5b6faab2ef4 100644 (file)
@@ -107,6 +107,6 @@ MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index 7cb55f9822432e797675452b366494435912f4ce..1c6e736cbbf8b64e580f511c4a3f0e6f3a239d0a 100644 (file)
@@ -126,6 +126,6 @@ MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index 6d8364a97810f83e897e1515be37c4ade616d45e..ba384b992befa18916735fb295a55fa05d3e0dc0 100644 (file)
@@ -167,6 +167,6 @@ MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index 728e86d33f0cc0c4946490fbe4c1cda9d69b17ea..3b706611da8e981daf8bf5aa0ff43ab9b5569dd3 100644 (file)
@@ -263,7 +263,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
@@ -275,7 +275,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
@@ -287,7 +287,7 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
index a3b091470b8a407375bc2451fa8629f7deb2c6b9..913d032cdb19ff5cf1a6d473647f8ed541af4cc8 100644 (file)
@@ -404,7 +404,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
@@ -416,7 +416,7 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
index 7e81e9b586bfda4df7dca4059fe07bb8adaa7e46..8ddd69fdc9374ebe20c8ab7b1842593164410c05 100644 (file)
@@ -221,7 +221,7 @@ MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
@@ -234,7 +234,7 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
@@ -247,7 +247,7 @@ MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
index 19072c84008fd2fa5b97f27c73cd11fc6600a0be..e4fd3129d36f90b992a15a7db5df869455b2353c 100644 (file)
@@ -84,6 +84,6 @@ MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index 9717101a7437401deaee84dbba7eaa25887c2ae3..c7d93b48926bbae7d7013190e00ae401e552549b 100644 (file)
@@ -120,6 +120,6 @@ MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index 8a175948b28d7f24882c8bbc379feb2f6126c03f..55b68fa39f45aa63cab6f4829e11fb6de57b308c 100644 (file)
@@ -143,7 +143,7 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
@@ -155,7 +155,7 @@ MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
 #endif
index f2daf711e72e382e8c41ce5d686a240b8098909c..8736f8c97518cad3de97e7b4440afbb1c85cb8a2 100644 (file)
@@ -211,6 +211,6 @@ MACHINE_START(T5325, "HP t5325 Thin Client")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index 73e2b6ca95642e31222ff9e9628c75c952a1eceb..283abff902287357a27da54427a390432317bca2 100644 (file)
@@ -137,6 +137,6 @@ MACHINE_START(TS219, "QNAP TS-119/TS-219")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index e4c61279ea868a8d8b5eb82350c32446acbf2fe4..81d585806b2fc15552e546d9c3eab874707e2283 100644 (file)
@@ -181,6 +181,6 @@ MACHINE_START(TS41X, "QNAP TS-41x")
        .map_io         = kirkwood_map_io,
        .init_early     = kirkwood_init_early,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &kirkwood_timer,
+       .init_time      = kirkwood_timer_init,
        .restart        = kirkwood_restart,
 MACHINE_END
index b0c306ccbc6e38369167a7aef437914bd85affd7..456d6386edf8b5f34e80f3b25de4605e18269ad2 100644 (file)
@@ -227,6 +227,6 @@ MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = acs5k_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
index e0d36cef2c56faea7e215ce680aeda29140742eb..d37c218c35847c6938f288233b457bf6d7effce8 100644 (file)
@@ -125,6 +125,6 @@ MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = dsm320_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
index a8270725b76d271773cffce4886886671f2964a3..3acbdfd3139197d491eec2307855e89986dd526c 100644 (file)
@@ -57,6 +57,6 @@ MACHINE_START(KS8695, "KS8695 Centaur Development Board")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = micrel_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
index 1623ba461e472acbcc6c43d429bedda059946057..002bc619bb686538eb06e0a6b9bc32abd3320c8d 100644 (file)
@@ -145,7 +145,7 @@ MACHINE_START(CM4002, "OpenGear/CM4002")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = og_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
 #endif
@@ -157,7 +157,7 @@ MACHINE_START(CM4008, "OpenGear/CM4008")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = og_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
 #endif
@@ -169,7 +169,7 @@ MACHINE_START(CM41XX, "OpenGear/CM41xx")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = og_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
 #endif
@@ -181,7 +181,7 @@ MACHINE_START(IM4004, "OpenGear/IM4004")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = og_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
 #endif
@@ -193,7 +193,7 @@ MACHINE_START(IM42XX, "OpenGear/IM42xx")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = og_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
 #endif
index f35b98b5bf3735c608f76369899a6f8ab14499fe..fdf2352d2cf8c207622119341da80f08ea14afef 100644 (file)
@@ -91,7 +91,7 @@ MACHINE_START(LITE300, "SecureComputing/SG300")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = sg_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
 #endif
@@ -103,7 +103,7 @@ MACHINE_START(SG310, "McAfee/SG310")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = sg_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
 #endif
@@ -115,7 +115,7 @@ MACHINE_START(SE4200, "SecureComputing/SE4200")
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = sg_init,
-       .timer          = &ks8695_timer,
+       .init_time      = ks8695_timer_init,
        .restart        = ks8695_restart,
 MACHINE_END
 #endif
index f8bdb11a9c33c342d73d0bece21382b6ec544556..6e97ce462d734cb5ab65342b592dcc5a2b7e042f 100644 (file)
@@ -13,4 +13,4 @@
 extern __init void ks8695_map_io(void);
 extern __init void ks8695_init_irq(void);
 extern void ks8695_restart(char, const char *);
-extern struct sys_timer ks8695_timer;
+extern void ks8695_timer_init(void);
index 46c84bc7792cbcd396a6e3e0f6f8d3c98df4f8cd..c272a3863d5f4884dc492bb578d2bed3afcab588 100644 (file)
@@ -146,7 +146,7 @@ static void ks8695_timer_setup(void)
                                        0xFFFFFFFFU);
 }
 
-static void __init ks8695_timer_init (void)
+void __init ks8695_timer_init(void)
 {
        ks8695_timer_setup();
 
@@ -154,10 +154,6 @@ static void __init ks8695_timer_init (void)
        setup_irq(KS8695_IRQ_TIMER1, &ks8695_timer_irq);
 }
 
-struct sys_timer ks8695_timer = {
-       .init           = ks8695_timer_init,
-};
-
 void ks8695_restart(char mode, const char *cmd)
 {
        unsigned int reg;
index afeac3b1fae69900c8a757d1fff38dec5a6dcaf7..e0b26062a2728409b83fd923db57bb7a64801034 100644 (file)
@@ -25,7 +25,7 @@
 /*
  * Other arch specific structures and functions
  */
-extern struct sys_timer lpc32xx_timer;
+extern void lpc32xx_timer_init(void);
 extern void __init lpc32xx_init_irq(void);
 extern void __init lpc32xx_map_io(void);
 extern void __init lpc32xx_serial_init(void);
index e8ff4c3f0566354d70e0c827a571b235be169431..c1cd5a943ab11bfc45eefac18ba777b3f043d714 100644 (file)
@@ -263,7 +263,7 @@ DT_MACHINE_START(LPC32XX_DT, "LPC32XX SoC (Flattened Device Tree)")
        .atag_offset    = 0x100,
        .map_io         = lpc32xx_map_io,
        .init_irq       = lpc32xx_init_irq,
-       .timer          = &lpc32xx_timer,
+       .init_time      = lpc32xx_timer_init,
        .init_machine   = lpc3250_machine_init,
        .dt_compat      = lpc32xx_dt_compat,
        .restart        = lpc23xx_restart,
index c40667c33161700450f9a93874efe5a30fc0d5a5..20eab63d10bae08359c18fbafff25c65d3075915 100644 (file)
@@ -70,7 +70,6 @@ static void lpc32xx_clkevt_mode(enum clock_event_mode mode,
 static struct clock_event_device lpc32xx_clkevt = {
        .name           = "lpc32xx_clkevt",
        .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .rating         = 300,
        .set_next_event = lpc32xx_clkevt_next_event,
        .set_mode       = lpc32xx_clkevt_mode,
@@ -100,7 +99,7 @@ static struct irqaction lpc32xx_timer_irq = {
  * clocks need to be enabled here manually and then tagged as used in
  * the clock driver initialization
  */
-static void __init lpc32xx_timer_init(void)
+void __init lpc32xx_timer_init(void)
 {
        u32 clkrate, pllreg;
 
@@ -141,14 +140,8 @@ static void __init lpc32xx_timer_init(void)
        setup_irq(IRQ_LPC32XX_TIMER0, &lpc32xx_timer_irq);
 
        /* Setup the clockevent structure. */
-       lpc32xx_clkevt.mult = div_sc(clkrate, NSEC_PER_SEC,
-               lpc32xx_clkevt.shift);
-       lpc32xx_clkevt.max_delta_ns = clockevent_delta2ns(-1,
-               &lpc32xx_clkevt);
-       lpc32xx_clkevt.min_delta_ns = clockevent_delta2ns(1,
-               &lpc32xx_clkevt) + 1;
        lpc32xx_clkevt.cpumask = cpumask_of(0);
-       clockevents_register_device(&lpc32xx_clkevt);
+       clockevents_config_and_register(&lpc32xx_clkevt, clkrate, 1, -1);
 
        /* Use timer1 as clock source. */
        __raw_writel(LPC32XX_TIMER_CNTR_TCR_RESET,
@@ -161,8 +154,3 @@ static void __init lpc32xx_timer_init(void)
        clocksource_mmio_init(LPC32XX_TIMER_TC(LPC32XX_TIMER1_BASE),
                "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up);
 }
-
-struct sys_timer lpc32xx_timer = {
-       .init           = &lpc32xx_timer_init,
-};
-
index e5dba9c5dc548c2f35f63eada103be437c69a5b4..9f64d5632e07af34ab02e2f67ed07937c98ac77b 100644 (file)
@@ -262,7 +262,7 @@ MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = MMP_NR_IRQS,
        .init_irq       = pxa168_init_irq,
-       .timer          = &pxa168_timer,
+       .init_time      = pxa168_timer_init,
        .init_machine   = common_init,
        .restart        = pxa168_restart,
 MACHINE_END
@@ -271,7 +271,7 @@ MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = MMP_NR_IRQS,
        .init_irq       = pxa168_init_irq,
-       .timer          = &pxa168_timer,
+       .init_time      = pxa168_timer_init,
        .init_machine   = common_init,
        .restart        = pxa168_restart,
 MACHINE_END
index 603542ae6fbd61e6696cad9eef7424f82fb90cca..1f94957b56ae430eecd43b612bd373f39d02f0f5 100644 (file)
@@ -45,7 +45,7 @@ MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = MMP_NR_IRQS,
        .init_irq       = pxa168_init_irq,
-       .timer          = &pxa168_timer,
+       .init_time      = pxa168_timer_init,
        .init_machine   = avengers_lite_init,
        .restart        = pxa168_restart,
 MACHINE_END
index 5cb769cd26d9a470a62fca737dc6dffe0afa80ee..2358011c7d8ec7e96f24352d9331673fb455e8a4 100644 (file)
@@ -218,7 +218,7 @@ MACHINE_START(BROWNSTONE, "Brownstone Development Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = BROWNSTONE_NR_IRQS,
        .init_irq       = mmp2_init_irq,
-       .timer          = &mmp2_timer,
+       .init_time      = mmp2_timer_init,
        .init_machine   = brownstone_init,
        .restart        = mmp_restart,
 MACHINE_END
index bd453274fca289325ec86217d3c1e3df85e4335f..0bdc50b134cee9523a4ea5b8e59d268ab89236fb 100644 (file)
@@ -1,7 +1,5 @@
 #define ARRAY_AND_SIZE(x)      (x), ARRAY_SIZE(x)
 
-struct sys_timer;
-
 extern void timer_init(int irq);
 
 extern void __init icu_init_irq(void);
index 8059cc0905c6063e5dc079f9b03545d28d90bb5d..754c352dd02b0c184c1b1adf134b79a3760b774d 100644 (file)
@@ -121,7 +121,7 @@ MACHINE_START(FLINT, "Flint Development Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = FLINT_NR_IRQS,
        .init_irq       = mmp2_init_irq,
-       .timer          = &mmp2_timer,
+       .init_time      = mmp2_timer_init,
        .init_machine   = flint_init,
        .restart        = mmp_restart,
 MACHINE_END
index 5c3d61ee729a79486a7d2f19f564a774ce64c335..d1e2d595e79cafd44b737d49904b07b65042d3fa 100644 (file)
@@ -194,7 +194,7 @@ MACHINE_START(GPLUGD, "PXA168-based GuruPlug Display (gplugD) Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = MMP_NR_IRQS,
        .init_irq       = pxa168_init_irq,
-       .timer          = &pxa168_timer,
+       .init_time      = pxa168_timer_init,
        .init_machine   = gplugd_init,
        .restart        = pxa168_restart,
 MACHINE_END
index c4ca4d17194ad586bd85710d6be781486abee512..0764f4ecec821e4050d180031896c2e2f0292b80 100644 (file)
@@ -3,9 +3,7 @@
 
 #include <linux/platform_data/pxa_sdhci.h>
 
-struct sys_timer;
-
-extern struct sys_timer mmp2_timer;
+extern void mmp2_timer_init(void);
 extern void __init mmp2_init_icu(void);
 extern void __init mmp2_init_irq(void);
 extern void mmp2_clear_pmic_int(void);
index 37632d964d50551fb1d7d692e39ec92be817d571..7ed1df21ea1cac363e3e09a3ae51df26cbf835cc 100644 (file)
@@ -1,9 +1,7 @@
 #ifndef __ASM_MACH_PXA168_H
 #define __ASM_MACH_PXA168_H
 
-struct sys_timer;
-
-extern struct sys_timer pxa168_timer;
+extern void pxa168_timer_init(void);
 extern void __init pxa168_init_irq(void);
 extern void pxa168_restart(char, const char *);
 extern void pxa168_clear_keypad_wakeup(void);
index 3b58a3b2d7df287c15918190b18f5b8649f79f77..eff31ab6dc3b7e65dd135ead376b0d1e915a746a 100644 (file)
@@ -1,9 +1,7 @@
 #ifndef __ASM_MACH_PXA910_H
 #define __ASM_MACH_PXA910_H
 
-struct sys_timer;
-
-extern struct sys_timer pxa910_timer;
+extern void pxa910_timer_init(void);
 extern void __init pxa910_init_irq(void);
 
 #include <linux/i2c.h>
index ff73249884d031bb165b89d905411ffb65cd067c..66634fd0ecb092991c8be85e155dd1f066800ad0 100644 (file)
@@ -174,7 +174,7 @@ MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = JASPER_NR_IRQS,
        .init_irq       = mmp2_init_irq,
-       .timer          = &mmp2_timer,
+       .init_time      = mmp2_timer_init,
        .init_machine   = jasper_init,
        .restart        = mmp_restart,
 MACHINE_END
index 033cc31b3c7256834f7a00040b452d299c6601d8..d063efa0a4f1477c004d570aef6dbb173c0c24fb 100644 (file)
 extern void __init mmp_dt_irq_init(void);
 extern void __init mmp_dt_init_timer(void);
 
-static struct sys_timer mmp_dt_timer = {
-       .init   = mmp_dt_init_timer,
-};
-
 static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = {
        OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL),
        OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4018000, "pxa2xx-uart.1", NULL),
@@ -69,7 +65,7 @@ static const char *mmp_dt_board_compat[] __initdata = {
 DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)")
        .map_io         = mmp_map_io,
        .init_irq       = mmp_dt_irq_init,
-       .timer          = &mmp_dt_timer,
+       .init_time      = mmp_dt_init_timer,
        .init_machine   = pxa168_dt_init,
        .dt_compat      = mmp_dt_board_compat,
 MACHINE_END
@@ -77,7 +73,7 @@ MACHINE_END
 DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)")
        .map_io         = mmp_map_io,
        .init_irq       = mmp_dt_irq_init,
-       .timer          = &mmp_dt_timer,
+       .init_time      = mmp_dt_init_timer,
        .init_machine   = pxa910_dt_init,
        .dt_compat      = mmp_dt_board_compat,
 MACHINE_END
index 535a5ed5977bd6348160e1fc322dbb758c9f37f1..fad431aa6e09940346143fb3768fc7a1e0121568 100644 (file)
 extern void __init mmp_dt_irq_init(void);
 extern void __init mmp_dt_init_timer(void);
 
-static struct sys_timer mmp_dt_timer = {
-       .init   = mmp_dt_init_timer,
-};
-
 static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = {
        OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4030000, "pxa2xx-uart.0", NULL),
        OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4017000, "pxa2xx-uart.1", NULL),
@@ -54,7 +50,7 @@ static const char *mmp2_dt_board_compat[] __initdata = {
 DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)")
        .map_io         = mmp_map_io,
        .init_irq       = mmp_dt_irq_init,
-       .timer          = &mmp_dt_timer,
+       .init_time      = mmp_dt_init_timer,
        .init_machine   = mmp2_dt_init,
        .dt_compat      = mmp2_dt_board_compat,
 MACHINE_END
index 3a3768c7a19181992c1e9bac41ec3059c82eb2d2..d94d114eef7b3e9c92361f7be7e008d9649dd9b1 100644 (file)
@@ -114,7 +114,7 @@ postcore_initcall(mmp2_init);
 
 #define APBC_TIMERS    APBC_REG(0x024)
 
-static void __init mmp2_timer_init(void)
+void __init mmp2_timer_init(void)
 {
        unsigned long clk_rst;
 
@@ -130,10 +130,6 @@ static void __init mmp2_timer_init(void)
        timer_init(IRQ_MMP2_TIMER1);
 }
 
-struct sys_timer mmp2_timer = {
-       .init   = mmp2_timer_init,
-};
-
 /* on-chip devices */
 MMP2_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4030000, 0x30, 4, 5);
 MMP2_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4017000, 0x30, 20, 21);
index b7f074f154982cb3d9eaf25590c876786d658e48..9bc7b86a86a7e8d1f02ff118540bb25f913d7dbf 100644 (file)
@@ -67,7 +67,7 @@ postcore_initcall(pxa168_init);
 #define TIMER_CLK_RST  (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3))
 #define APBC_TIMERS    APBC_REG(0x34)
 
-static void __init pxa168_timer_init(void)
+void __init pxa168_timer_init(void)
 {
        /* this is early, we have to initialize the CCU registers by
         * ourselves instead of using clk_* API. Clock rate is defined
@@ -81,10 +81,6 @@ static void __init pxa168_timer_init(void)
        timer_init(IRQ_PXA168_TIMER1);
 }
 
-struct sys_timer pxa168_timer = {
-       .init   = pxa168_timer_init,
-};
-
 void pxa168_clear_keypad_wakeup(void)
 {
        uint32_t val;
index 8b1e16fbb7a561769cf3a11bdc414f9ce5e41207..c6a89f1eca4e1918028e862550babd8efa8a61dd 100644 (file)
@@ -101,7 +101,7 @@ postcore_initcall(pxa910_init);
 #define TIMER_CLK_RST  (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3))
 #define APBC_TIMERS    APBC_REG(0x34)
 
-static void __init pxa910_timer_init(void)
+void __init pxa910_timer_init(void)
 {
        /* reset and configure */
        __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS);
@@ -110,10 +110,6 @@ static void __init pxa910_timer_init(void)
        timer_init(IRQ_PXA910_AP1_TIMER1);
 }
 
-struct sys_timer pxa910_timer = {
-       .init   = pxa910_timer_init,
-};
-
 /* on-chip devices */
 
 /* NOTE: there are totally 3 UARTs on PXA910:
index b28f9084dfff2e62bd57f6c0518c6320091d03ce..4c127d23955da3419ebb9cf7fc57d23944870a0a 100644 (file)
@@ -103,7 +103,7 @@ MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)")
        .map_io         = mmp_map_io,
        .nr_irqs        = MMP_NR_IRQS,
        .init_irq       = pxa910_init_irq,
-       .timer          = &pxa910_timer,
+       .init_time      = pxa910_timer_init,
        .init_machine   = tavorevb_init,
        .restart        = mmp_restart,
 MACHINE_END
index dd30ea74785c2071ecf44cac17e6f23fb73f8874..8609967975ed9039e56b643ddd07ee52e0e3b12a 100644 (file)
@@ -86,7 +86,7 @@ MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = MMP_NR_IRQS,
        .init_irq       = pxa168_init_irq,
-       .timer          = &pxa168_timer,
+       .init_time      = pxa168_timer_init,
        .init_machine   = teton_bga_init,
        .restart        = pxa168_restart,
 MACHINE_END
index 936447c70977a767449d2cef6404a43272dc0dcf..86a18b3d252ea9e286277bd9b03beca8925538ce 100644 (file)
@@ -141,7 +141,6 @@ static void timer_set_mode(enum clock_event_mode mode,
 static struct clock_event_device ckevt = {
        .name           = "clockevent",
        .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .rating         = 200,
        .set_next_event = timer_set_next_event,
        .set_mode       = timer_set_mode,
@@ -198,15 +197,13 @@ void __init timer_init(int irq)
 
        setup_sched_clock(mmp_read_sched_clock, 32, CLOCK_TICK_RATE);
 
-       ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift);
-       ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt);
-       ckevt.min_delta_ns = clockevent_delta2ns(MIN_DELTA, &ckevt);
        ckevt.cpumask = cpumask_of(0);
 
        setup_irq(irq, &timer_irq);
 
        clocksource_register_hz(&cksrc, CLOCK_TICK_RATE);
-       clockevents_register_device(&ckevt);
+       clockevents_config_and_register(&ckevt, CLOCK_TICK_RATE,
+                                       MIN_DELTA, MAX_DELTA);
 }
 
 #ifdef CONFIG_OF
index ce55fd8821c40f3bdff6bd757ef9bc47af5b32c5..6e474900b13e8e5eb9160600c86cfe47d1b022d5 100644 (file)
@@ -218,7 +218,7 @@ MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
        .map_io         = mmp_map_io,
        .nr_irqs        = TTCDKB_NR_IRQS,
        .init_irq       = pxa910_init_irq,
-       .timer          = &pxa910_timer,
+       .init_time      = pxa910_timer_init,
        .init_machine   = ttc_dkb_init,
        .restart        = mmp_restart,
 MACHINE_END
index b5b4de2cdf9e0a4ae9526087c04ae2c9ec01f2ff..7dcfc5300bbd2e6a8345d73899f7b74d4568825e 100644 (file)
  */
 
 #include <linux/init.h>
+#include <linux/irqchip.h>
 #include <linux/of.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 
 #include <mach/board.h>
 #include "common.h"
 
-static const struct of_device_id msm_dt_gic_match[] __initconst = {
-       { .compatible = "qcom,msm-8660-qgic", .data = gic_of_init },
-       {}
-};
-
-static void __init msm8x60_init_irq(void)
-{
-       of_irq_init(msm_dt_gic_match);
-}
-
 static void __init msm8x60_init_late(void)
 {
        smd_debugfs_init();
@@ -55,10 +44,9 @@ static const char *msm8x60_fluid_match[] __initdata = {
 DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
        .smp = smp_ops(msm_smp_ops),
        .map_io = msm_map_msm8x60_io,
-       .init_irq = msm8x60_init_irq,
-       .handle_irq = gic_handle_irq,
+       .init_irq = irqchip_init,
        .init_machine = msm8x60_dt_init,
        .init_late = msm8x60_init_late,
-       .timer = &msm_dt_timer,
+       .init_time      = msm_dt_timer_init,
        .dt_compat = msm8x60_fluid_match,
 MACHINE_END
index 4490edb71c17d245164dba85ba6a69746003ff00..73019363ffa4db099ea801a85fe7a9d8a4b0b3ff 100644 (file)
  */
 
 #include <linux/init.h>
-#include <linux/of_irq.h>
+#include <linux/irqchip.h>
 #include <linux/of_platform.h>
 
-#include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
 
 #include "common.h"
 
-static const struct of_device_id msm_dt_gic_match[] __initconst = {
-       { .compatible = "qcom,msm-qgic2", .data = gic_of_init },
-       { }
-};
-
-static void __init msm_dt_init_irq(void)
-{
-       of_irq_init(msm_dt_gic_match);
-}
-
 static void __init msm_dt_init(void)
 {
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
@@ -42,9 +31,8 @@ static const char * const msm8960_dt_match[] __initconst = {
 DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)")
        .smp = smp_ops(msm_smp_ops),
        .map_io = msm_map_msm8960_io,
-       .init_irq = msm_dt_init_irq,
-       .timer = &msm_dt_timer,
+       .init_irq = irqchip_init,
+       .init_time      = msm_dt_timer_init,
        .init_machine = msm_dt_init,
        .dt_compat = msm8960_dt_match,
-       .handle_irq = gic_handle_irq,
 MACHINE_END
index 6ce542e2e21ca485cc803b38f12154a8bc7d835a..84d720af34ab17f4c8101aee9ad61fbd0389f3e3 100644 (file)
@@ -106,5 +106,5 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
        .init_irq       = halibut_init_irq,
        .init_machine   = halibut_init,
        .init_late      = halibut_init_late,
-       .timer          = &msm7x01_timer,
+       .init_time      = msm7x01_timer_init,
 MACHINE_END
index df00bc03ce7434e32119c14283c780880dfa2efa..30c3496db59372fd89c89d3430564db967bb4aee 100644 (file)
@@ -75,7 +75,7 @@ static void __init mahimahi_init_late(void)
        smd_debugfs_init();
 }
 
-extern struct sys_timer msm_timer;
+void msm_timer_init(void);
 
 MACHINE_START(MAHIMAHI, "mahimahi")
        .atag_offset    = 0x100,
@@ -84,5 +84,5 @@ MACHINE_START(MAHIMAHI, "mahimahi")
        .init_irq       = msm_init_irq,
        .init_machine   = mahimahi_init,
        .init_late      = mahimahi_init_late,
-       .timer          = &msm_timer,
+       .init_time      = msm_timer_init,
 MACHINE_END
index effa6f4336c74bfc0a45050f88d4f2e5c876f814..7bc3f82e3ec9cc9830bdff253157717b51885496 100644 (file)
@@ -131,7 +131,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
        .init_late = msm7x30_init_late,
-       .timer = &msm7x30_timer,
+       .init_time      = msm7x30_timer_init,
 MACHINE_END
 
 MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
@@ -142,7 +142,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
        .init_late = msm7x30_init_late,
-       .timer = &msm7x30_timer,
+       .init_time      = msm7x30_timer_init,
 MACHINE_END
 
 MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
@@ -153,5 +153,5 @@ MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
        .init_late = msm7x30_init_late,
-       .timer = &msm7x30_timer,
+       .init_time      = msm7x30_timer_init,
 MACHINE_END
index 2448fcf09eb145dbbf19327cd7b12d56a42cad55..686e7949a73a32bba6ed77449857a9cfb6d5c7b2 100644 (file)
@@ -200,7 +200,7 @@ MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
        .init_irq = qsd8x50_init_irq,
        .init_machine = qsd8x50_init,
        .init_late = qsd8x50_init_late,
-       .timer = &qsd8x50_timer,
+       .init_time      = qsd8x50_timer_init,
 MACHINE_END
 
 MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
@@ -209,5 +209,5 @@ MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
        .init_irq = qsd8x50_init_irq,
        .init_machine = qsd8x50_init,
        .init_late = qsd8x50_init_late,
-       .timer = &qsd8x50_timer,
+       .init_time      = qsd8x50_timer_init,
 MACHINE_END
index b7b0fc7e3278fcc7aa3c1078b2fa3a572bd44387..70730111b37c033c999358ecb144b496fb6f19e8 100644 (file)
@@ -53,7 +53,7 @@ static struct platform_device *devices[] __initdata = {
        &msm_device_uart3,
 };
 
-extern struct sys_timer msm_timer;
+void msm_timer_init(void);
 
 static void __init sapphire_init_irq(void)
 {
@@ -113,5 +113,5 @@ MACHINE_START(SAPPHIRE, "sapphire")
        .init_irq       = sapphire_init_irq,
        .init_machine   = sapphire_init,
        .init_late      = sapphire_init_late,
-       .timer          = &msm_timer,
+       .init_time      = msm_timer_init,
 MACHINE_END
index 4ba0800e243e0fd43c494e318d0073c67ee6f42a..919bfa32871a23acb8f4feb9787d38f020878df6 100644 (file)
@@ -110,5 +110,5 @@ MACHINE_START(TROUT, "HTC Dream")
        .init_irq       = trout_init_irq,
        .init_machine   = trout_init,
        .init_late      = trout_init_late,
-       .timer          = &msm7x01_timer,
+       .init_time      = msm7x01_timer_init,
 MACHINE_END
index 633a7159d5ffd09a76d774dce2974f6b2efce848..ce8215a269e50a10d8fb81090edc34cee16dd492 100644 (file)
 #ifndef __MACH_COMMON_H
 #define __MACH_COMMON_H
 
-extern struct sys_timer msm7x01_timer;
-extern struct sys_timer msm7x30_timer;
-extern struct sys_timer msm_dt_timer;
-extern struct sys_timer qsd8x50_timer;
+extern void msm7x01_timer_init(void);
+extern void msm7x30_timer_init(void);
+extern void msm_dt_timer_init(void);
+extern void qsd8x50_timer_init(void);
 
 extern void msm_map_common_io(void);
 extern void msm_map_msm7x30_io(void);
index 7ed69b69c87c841cf8f7da5da0d903034c47a078..42932865416a622053736e895f667928edac5246 100644 (file)
@@ -15,8 +15,8 @@
 #include <linux/jiffies.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 
-#include <asm/hardware/gic.h>
 #include <asm/cacheflush.h>
 #include <asm/cputype.h>
 #include <asm/mach-types.h>
@@ -115,7 +115,7 @@ static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *id
         * the boot monitor to read the system wide flags register,
         * and branch to the address found there.
         */
-       gic_raise_softirq(cpumask_of(cpu), 0);
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
 
        timeout = jiffies + (1 * HZ);
        while (time_before(jiffies, timeout)) {
@@ -153,8 +153,6 @@ static void __init msm_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-        set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init msm_smp_prepare_cpus(unsigned int max_cpus)
index 476549a8a709c65a6ed6378b7997ad6955efec7a..2969027f02fa57045ec7bb3d65d7a98927cfde3c 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/of_irq.h>
 
 #include <asm/mach/time.h>
-#include <asm/hardware/gic.h>
 #include <asm/localtimer.h>
 #include <asm/sched_clock.h>
 
@@ -144,13 +143,9 @@ static int __cpuinit msm_local_timer_setup(struct clock_event_device *evt)
        evt->rating = msm_clockevent.rating;
        evt->set_mode = msm_timer_set_mode;
        evt->set_next_event = msm_timer_set_next_event;
-       evt->shift = msm_clockevent.shift;
-       evt->mult = div_sc(GPT_HZ, NSEC_PER_SEC, evt->shift);
-       evt->max_delta_ns = clockevent_delta2ns(0xf0000000, evt);
-       evt->min_delta_ns = clockevent_delta2ns(4, evt);
 
        *__this_cpu_ptr(msm_evt.percpu_evt) = evt;
-       clockevents_register_device(evt);
+       clockevents_config_and_register(evt, GPT_HZ, 4, 0xf0000000);
        enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING);
        return 0;
 }
@@ -229,7 +224,7 @@ static const struct of_device_id msm_gpt_match[] __initconst = {
        { },
 };
 
-static void __init msm_dt_timer_init(void)
+void __init msm_dt_timer_init(void)
 {
        struct device_node *np;
        u32 freq;
@@ -296,10 +291,6 @@ static void __init msm_dt_timer_init(void)
 
        msm_timer_init(freq, 32, irq, !!percpu_offset);
 }
-
-struct sys_timer msm_dt_timer = {
-       .init = msm_dt_timer_init
-};
 #endif
 
 static int __init msm_timer_map(phys_addr_t event, phys_addr_t source)
@@ -317,7 +308,7 @@ static int __init msm_timer_map(phys_addr_t event, phys_addr_t source)
        return 0;
 }
 
-static void __init msm7x01_timer_init(void)
+void __init msm7x01_timer_init(void)
 {
        struct clocksource *cs = &msm_clocksource;
 
@@ -330,28 +321,16 @@ static void __init msm7x01_timer_init(void)
                        false);
 }
 
-struct sys_timer msm7x01_timer = {
-       .init = msm7x01_timer_init
-};
-
-static void __init msm7x30_timer_init(void)
+void __init msm7x30_timer_init(void)
 {
        if (msm_timer_map(0xc0100004, 0xc0100024))
                return;
        msm_timer_init(24576000 / 4, 32, 1, false);
 }
 
-struct sys_timer msm7x30_timer = {
-       .init = msm7x30_timer_init
-};
-
-static void __init qsd8x50_timer_init(void)
+void __init qsd8x50_timer_init(void)
 {
        if (msm_timer_map(0xAC100000, 0xAC100010))
                return;
        msm_timer_init(19200000 / 4, 32, 7, false);
 }
-
-struct sys_timer qsd8x50_timer = {
-       .init = qsd8x50_timer_init
-};
index ee74ec97c141b8fd45e05936832cea12689e65e8..1f2ef98b37c6f4909a530c89784b473b821a62db 100644 (file)
@@ -150,6 +150,6 @@ MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
        .map_io         = mv78xx0_map_io,
        .init_early     = mv78xx0_init_early,
        .init_irq       = mv78xx0_init_irq,
-       .timer          = &mv78xx0_timer,
+       .init_time      = mv78xx0_timer_init,
        .restart        = mv78xx0_restart,
 MACHINE_END
index d0cb4857b4b3fdac50b9fcfcee1422416ffe2ddf..0efa14498ebccf99f6733674db3de7d83f37b334 100644 (file)
@@ -336,16 +336,12 @@ void __init mv78xx0_init_early(void)
        orion_time_set_base(TIMER_VIRT_BASE);
 }
 
-static void __init_refok mv78xx0_timer_init(void)
+void __init_refok mv78xx0_timer_init(void)
 {
        orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
                        IRQ_MV78XX0_TIMER_1, get_tclk());
 }
 
-struct sys_timer mv78xx0_timer = {
-       .init = mv78xx0_timer_init,
-};
-
 
 /*****************************************************************************
  * General
index 507c767d49e03349eee0a8f384632c8ab16b893b..5e9485bad0ac30449f9c7105dd223eda1334cc5d 100644 (file)
@@ -47,7 +47,7 @@ void mv78xx0_uart3_init(void);
 void mv78xx0_i2c_init(void);
 void mv78xx0_restart(char, const char *);
 
-extern struct sys_timer mv78xx0_timer;
+extern void mv78xx0_timer_init(void);
 
 
 #endif
index 4d6d48bf51ef4e4b71a324db873a30e60b5d2009..4e0f22b30bc8aefdfee061592985898171608b5e 100644 (file)
@@ -98,6 +98,6 @@ MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
        .map_io         = mv78xx0_map_io,
        .init_early     = mv78xx0_init_early,
        .init_irq       = mv78xx0_init_irq,
-       .timer          = &mv78xx0_timer,
+       .init_time      = mv78xx0_timer_init,
        .restart        = mv78xx0_restart,
 MACHINE_END
index 9a882706e1387fbe998fec18c09bd9210892af1c..d2d06f3957f33b8fe151241e339ca4be81101d98 100644 (file)
@@ -83,6 +83,6 @@ MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
        .map_io         = mv78xx0_map_io,
        .init_early     = mv78xx0_init_early,
        .init_irq       = mv78xx0_init_irq,
-       .timer          = &mv78xx0_timer,
+       .init_time      = mv78xx0_timer_init,
        .restart        = mv78xx0_restart,
 MACHINE_END
index 7434b5e361979a9f4170e6224fc4873a5636afd8..a5ea616d6d12b896fc49b2f13730ba5a65fd6e02 100644 (file)
@@ -56,10 +56,6 @@ void __init armada_370_xp_init_early(void)
        init_dma_coherent_pool_size(SZ_1M);
 }
 
-struct sys_timer armada_370_xp_timer = {
-       .init           = armada_370_xp_timer_and_clk_init,
-};
-
 static void __init armada_370_xp_dt_init(void)
 {
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
@@ -78,7 +74,7 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
        .init_early     = armada_370_xp_init_early,
        .init_irq       = armada_370_xp_init_irq,
        .handle_irq     = armada_370_xp_handle_irq,
-       .timer          = &armada_370_xp_timer,
+       .init_time      = armada_370_xp_timer_and_clk_init,
        .restart        = mvebu_restart,
        .dt_compat      = armada_370_xp_dt_compat,
 MACHINE_END
index c66129b5dd18574fbfc1bd4716f80536c625c341..5fad7cefe8aac3ac11e84d8d82ff3a7a910beba9 100644 (file)
@@ -163,19 +163,11 @@ static void __init imx23_timer_init(void)
        mx23_clocks_init();
 }
 
-static struct sys_timer imx23_timer = {
-       .init = imx23_timer_init,
-};
-
 static void __init imx28_timer_init(void)
 {
        mx28_clocks_init();
 }
 
-static struct sys_timer imx28_timer = {
-       .init = imx28_timer_init,
-};
-
 enum mac_oui {
        OUI_FSL,
        OUI_DENX,
@@ -446,7 +438,7 @@ DT_MACHINE_START(IMX23, "Freescale i.MX23 (Device Tree)")
        .map_io         = mx23_map_io,
        .init_irq       = icoll_init_irq,
        .handle_irq     = icoll_handle_irq,
-       .timer          = &imx23_timer,
+       .init_time      = imx23_timer_init,
        .init_machine   = mxs_machine_init,
        .dt_compat      = imx23_dt_compat,
        .restart        = mxs_restart,
@@ -456,7 +448,7 @@ DT_MACHINE_START(IMX28, "Freescale i.MX28 (Device Tree)")
        .map_io         = mx28_map_io,
        .init_irq       = icoll_init_irq,
        .handle_irq     = icoll_handle_irq,
-       .timer          = &imx28_timer,
+       .init_time      = imx28_timer_init,
        .init_machine   = mxs_machine_init,
        .dt_compat      = imx28_dt_compat,
        .restart        = mxs_restart,
index 856f4c7960618dad52fac637bf17ad21792b6acd..27451b1ba3f1cc9470e38899627b8b390f8bc138 100644 (file)
@@ -195,7 +195,6 @@ static void mxs_set_mode(enum clock_event_mode mode,
 static struct clock_event_device mxs_clockevent_device = {
        .name           = "mxs_timrot",
        .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .set_mode       = mxs_set_mode,
        .set_next_event = timrotv2_set_next_event,
        .rating         = 200,
@@ -203,25 +202,12 @@ static struct clock_event_device mxs_clockevent_device = {
 
 static int __init mxs_clockevent_init(struct clk *timer_clk)
 {
-       unsigned int c = clk_get_rate(timer_clk);
-
-       mxs_clockevent_device.mult =
-               div_sc(c, NSEC_PER_SEC, mxs_clockevent_device.shift);
-       mxs_clockevent_device.cpumask = cpumask_of(0);
-       if (timrot_is_v1()) {
+       if (timrot_is_v1())
                mxs_clockevent_device.set_next_event = timrotv1_set_next_event;
-               mxs_clockevent_device.max_delta_ns =
-                       clockevent_delta2ns(0xfffe, &mxs_clockevent_device);
-               mxs_clockevent_device.min_delta_ns =
-                       clockevent_delta2ns(0xf, &mxs_clockevent_device);
-       } else {
-               mxs_clockevent_device.max_delta_ns =
-                       clockevent_delta2ns(0xfffffffe, &mxs_clockevent_device);
-               mxs_clockevent_device.min_delta_ns =
-                       clockevent_delta2ns(0xf, &mxs_clockevent_device);
-       }
-
-       clockevents_register_device(&mxs_clockevent_device);
+       mxs_clockevent_device.cpumask = cpumask_of(0);
+       clockevents_config_and_register(&mxs_clockevent_device,
+                                       clk_get_rate(timer_clk), 0xf,
+                                       timrot_is_v1() ? 0xfffe : 0xfffffffe);
 
        return 0;
 }
index aa627465d914dcab43469311c48fdb61be800fdc..27c2cb7ab8130bc606b82d25c5c457bb8a3959e8 100644 (file)
@@ -23,9 +23,9 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-vic.h>
 #include <mach/hardware.h>
 #include <asm/mach/map.h>
-#include <asm/hardware/vic.h>
 #include <mach/netx-regs.h>
 #include <asm/mach/irq.h>
 
index 9b915119b8d6e7bb939baf0094d09689e2b2c048..768b26bbb42b14a9746a2ba394515742ff657cd3 100644 (file)
@@ -21,5 +21,4 @@ extern void __init netx_map_io(void);
 extern void __init netx_init_irq(void);
 extern void netx_restart(char, const char *);
 
-struct sys_timer;
-extern struct sys_timer netx_timer;
+extern void netx_timer_init(void);
index 8b781ff7c9e984e0df90b236eb0ea80bb4e1ae6c..9b558eb3070fd6d554a88c7f8d3bd580a8df3f27 100644 (file)
@@ -28,7 +28,6 @@
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/vic.h>
 #include <mach/netx-regs.h>
 #include <linux/platform_data/eth-netx.h>
 
@@ -204,8 +203,7 @@ MACHINE_START(NXDB500, "Hilscher nxdb500")
        .atag_offset    = 0x100,
        .map_io         = netx_map_io,
        .init_irq       = netx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &netx_timer,
+       .init_time      = netx_timer_init,
        .init_machine   = nxdb500_init,
        .restart        = netx_restart,
 MACHINE_END
index b26dbce334f2f295cc2fe72a77868e4409c34d7f..a5e86cd365e7d202b832294c1f646c811402b423 100644 (file)
@@ -28,7 +28,6 @@
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/vic.h>
 #include <mach/netx-regs.h>
 #include <linux/platform_data/eth-netx.h>
 
@@ -97,8 +96,7 @@ MACHINE_START(NXDKN, "Hilscher nxdkn")
        .atag_offset    = 0x100,
        .map_io         = netx_map_io,
        .init_irq       = netx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &netx_timer,
+       .init_time      = netx_timer_init,
        .init_machine   = nxdkn_init,
        .restart        = netx_restart,
 MACHINE_END
index 257382efafa0f8f8cefb1f12ed91e8338dd0f4c0..ad17885d0159e69909dbbd74b8f248cc6056bda5 100644 (file)
@@ -28,7 +28,6 @@
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/vic.h>
 #include <mach/netx-regs.h>
 #include <linux/platform_data/eth-netx.h>
 
@@ -181,8 +180,7 @@ MACHINE_START(NXEB500HMI, "Hilscher nxeb500hmi")
        .atag_offset    = 0x100,
        .map_io         = netx_map_io,
        .init_irq       = netx_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &netx_timer,
+       .init_time      = netx_timer_init,
        .init_machine   = nxeb500hmi_init,
        .restart        = netx_restart,
 MACHINE_END
index e24c141ba489c7f82b1d576bafea0864f1ad1e05..6df42e643031aa1cb74bbec4ea0f5b13bd99d8d0 100644 (file)
@@ -76,7 +76,6 @@ static int netx_set_next_event(unsigned long evt,
 
 static struct clock_event_device netx_clockevent = {
        .name = "netx-timer" __stringify(TIMER_CLOCKEVENT),
-       .shift = 32,
        .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .set_next_event = netx_set_next_event,
        .set_mode = netx_set_mode,
@@ -107,7 +106,7 @@ static struct irqaction netx_timer_irq = {
 /*
  * Set up timer interrupt
  */
-static void __init netx_timer_init(void)
+void __init netx_timer_init(void)
 {
        /* disable timer initially */
        writel(0, NETX_GPIO_COUNTER_CTRL(0));
@@ -140,18 +139,9 @@ static void __init netx_timer_init(void)
        clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE),
                "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up);
 
-       netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
-                       netx_clockevent.shift);
-       netx_clockevent.max_delta_ns =
-               clockevent_delta2ns(0xfffffffe, &netx_clockevent);
        /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine.
         * Adding some safety ... */
-       netx_clockevent.min_delta_ns =
-               clockevent_delta2ns(0xa00, &netx_clockevent);
        netx_clockevent.cpumask = cpumask_of(0);
-       clockevents_register_device(&netx_clockevent);
+       clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE,
+                                       0xa00, 0xfffffffe);
 }
-
-struct sys_timer netx_timer = {
-       .init           = netx_timer_init,
-};
index 9f19069248da2341e643f1c6161fc8576c5803c3..aaed48d9437449d1333e59e793ba3a59a9ce0d10 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/pinctrl/machine.h>
 #include <linux/platform_data/pinctrl-nomadik.h>
 #include <linux/platform_data/clocksource-nomadik-mtu.h>
-#include <asm/hardware/vic.h>
 #include <asm/sizes.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -267,10 +266,6 @@ static void __init nomadik_timer_init(void)
        nmdk_timer_init(io_p2v(NOMADIK_MTU0_BASE), IRQ_MTU0);
 }
 
-static struct sys_timer nomadik_timer = {
-       .init   = nomadik_timer_init,
-};
-
 static struct i2c_board_info __initdata nhk8815_i2c0_devices[] = {
        {
                I2C_BOARD_INFO("stw4811", 0x2d),
@@ -352,8 +347,7 @@ MACHINE_START(NOMADIK, "NHK8815")
        .atag_offset    = 0x100,
        .map_io         = cpu8815_map_io,
        .init_irq       = cpu8815_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &nomadik_timer,
+       .init_time      = nomadik_timer_init,
        .init_machine   = nhk8815_platform_init,
        .restart        = cpu8815_restart,
 MACHINE_END
index 1273931303fb81599201ae0f70c1c71f503b9eda..351404673f6cad5476d664d05f98ffd18d15696b 100644 (file)
 #include <linux/slab.h>
 #include <linux/irq.h>
 #include <linux/dma-mapping.h>
+#include <linux/irqchip/arm-vic.h>
 #include <linux/platform_data/clk-nomadik.h>
 #include <linux/platform_data/pinctrl-nomadik.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
 #include <asm/mach/map.h>
-#include <asm/hardware/vic.h>
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
index 2e98a3ac7c5e1f5fdc56046507bda4b61aa1b3ae..2aab761ee68db7ae8fee7fd5eaf84e82f9c80572 100644 (file)
@@ -628,6 +628,6 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
        .init_irq       = omap1_init_irq,
        .init_machine   = ams_delta_init,
        .init_late      = ams_delta_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 560a7dcf0a56b00bf05fee81ac89ef55f3f26fbb..702d58039cc1a90820232615224d2015bf7a6329 100644 (file)
@@ -364,6 +364,6 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_fsample_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 608e7d2a27789b63c6aee7a90259083f7679b124..e1d9171774bca91eec6f2a4802c7153208822743 100644 (file)
@@ -84,6 +84,6 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_generic_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 2274bd677efc4a688cf25025f3484a813a0bb68c..0dac3d239e326345afcc01779d5565dead760085 100644 (file)
@@ -461,6 +461,6 @@ MACHINE_START(OMAP_H2, "TI-H2")
        .init_irq       = omap1_init_irq,
        .init_machine   = h2_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 1051935f0aac01280f3dfa55646b77ffed5911af..816ecd13f81e241c3fca64b4554b3a235b548d69 100644 (file)
@@ -454,6 +454,6 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
        .init_irq       = omap1_init_irq,
        .init_machine   = h3_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 356f816c84a6603c0fab318581f31074f42de95c..35a2379b986f676618a49991dcd621cbe3e6e51b 100644 (file)
@@ -603,6 +603,6 @@ MACHINE_START(HERALD, "HTC Herald")
        .init_irq       = omap1_init_irq,
        .init_machine   = htcherald_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index f8033fab0f82f4c674bf92446a8af244df9b6d57..bd5f02e9c3545b1414dc9c3fef1694a46b693cb7 100644 (file)
@@ -458,6 +458,6 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
        .init_irq       = omap1_init_irq,
        .init_machine   = innovator_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 24d2f2df11a067646216f9359afbca2502ccef04..4695ca71770684bb2694a507fd1358040c98d420 100644 (file)
@@ -242,6 +242,6 @@ MACHINE_START(NOKIA770, "Nokia 770")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_nokia770_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 872ea47cd28a810c61fa31c95a1c9ef61ad364bb..a7ce69286688434e0e195e3c8a2e24728ff6dc60 100644 (file)
@@ -609,6 +609,6 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
        .init_irq       = omap1_init_irq,
        .init_machine   = osk_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index c33dceb466078630108f56f29ac0e621a745b7e1..845a1a7aef95e3f18e91886244022620c3f1bfa2 100644 (file)
@@ -268,6 +268,6 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmte_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 2948b0ee4be872bf9f438b372f5afec322e1027e..65a4a3e357f2001d1e8281a67ac836ae109984ca 100644 (file)
@@ -314,6 +314,6 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmtt_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 7a05895c0be398520a1aec8d8beacb6830ada28c..01c970071fd80951b4ce25aeb512e10f77d3ba56 100644 (file)
@@ -330,6 +330,6 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_palmz71_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 27f8d12ec222034d23d3b7f8438614356e4ad7f1..8b2f7127f716ae583fb1ba05adc2976fb0905dd9 100644 (file)
@@ -326,6 +326,6 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_perseus2_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index 20ed52ae171400fa1d6a3d1eb963f159c172a03a..9732a98f3e062eabc17900a15b9702e7e9a0daf1 100644 (file)
@@ -407,6 +407,6 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1")
        .init_irq       = omap1_init_irq,
        .init_machine   = omap_sx1_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = omap1_restart,
 MACHINE_END
index abf705f49b19777e21884f3795432e1cb709f84e..6c116e1a4b014d9b1b4c973e276a7f2b016c4a70 100644 (file)
@@ -289,6 +289,6 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
        .init_irq       = omap1_init_irq,
        .init_machine   = voiceblue_init,
        .init_late      = omap1_init_late,
-       .timer          = &omap1_timer,
+       .init_time      = omap1_timer_init,
        .restart        = voiceblue_restart,
 MACHINE_END
index b53e0854422f13a37435eb16c24c75cad7bf03bc..fb18831e88aa5009fd8d1b546bba39d9397697d3 100644 (file)
@@ -75,7 +75,7 @@ extern void __init omap_check_revision(void);
 extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
                               unsigned int ctrl);
 
-extern struct sys_timer omap1_timer;
+extern void omap1_timer_init(void);
 #ifdef CONFIG_OMAP_32K_TIMER
 extern int omap_32k_timer_init(void);
 #else
index 4d4816fd6fc9b8d6a9931162ca66c948500c23ea..726ec23d29c71abc2224ee8b9957483833cf6639 100644 (file)
@@ -145,7 +145,6 @@ static void omap_mpu_set_mode(enum clock_event_mode mode,
 static struct clock_event_device clockevent_mpu_timer1 = {
        .name           = "mpu_timer1",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .set_next_event = omap_mpu_set_next_event,
        .set_mode       = omap_mpu_set_mode,
 };
@@ -170,15 +169,9 @@ static __init void omap_init_mpu_timer(unsigned long rate)
        setup_irq(INT_TIMER1, &omap_mpu_timer1_irq);
        omap_mpu_timer_start(0, (rate / HZ) - 1, 1);
 
-       clockevent_mpu_timer1.mult = div_sc(rate, NSEC_PER_SEC,
-                                           clockevent_mpu_timer1.shift);
-       clockevent_mpu_timer1.max_delta_ns =
-               clockevent_delta2ns(-1, &clockevent_mpu_timer1);
-       clockevent_mpu_timer1.min_delta_ns =
-               clockevent_delta2ns(1, &clockevent_mpu_timer1);
-
        clockevent_mpu_timer1.cpumask = cpumask_of(0);
-       clockevents_register_device(&clockevent_mpu_timer1);
+       clockevents_config_and_register(&clockevent_mpu_timer1, rate,
+                                       1, -1);
 }
 
 
@@ -236,12 +229,8 @@ static inline void omap_mpu_timer_init(void)
  * Timer initialization
  * ---------------------------------------------------------------------------
  */
-static void __init omap1_timer_init(void)
+void __init omap1_timer_init(void)
 {
        if (omap_32k_timer_init() != 0)
                omap_mpu_timer_init();
 }
-
-struct sys_timer omap1_timer = {
-       .init           = omap1_timer_init,
-};
index 41152fadd4c08aa4b5b71a710ae4b4afdb5131e1..0b74246ba62c6bb3379e142a89ebfb49c932fa8b 100644 (file)
@@ -140,7 +140,6 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
 static struct clock_event_device clockevent_32k_timer = {
        .name           = "32k-timer",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .set_next_event = omap_32k_timer_set_next_event,
        .set_mode       = omap_32k_timer_set_mode,
 };
@@ -165,16 +164,9 @@ static __init void omap_init_32k_timer(void)
 {
        setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
 
-       clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC,
-                                          NSEC_PER_SEC,
-                                          clockevent_32k_timer.shift);
-       clockevent_32k_timer.max_delta_ns =
-               clockevent_delta2ns(0xfffffffe, &clockevent_32k_timer);
-       clockevent_32k_timer.min_delta_ns =
-               clockevent_delta2ns(1, &clockevent_32k_timer);
-
        clockevent_32k_timer.cpumask = cpumask_of(0);
-       clockevents_register_device(&clockevent_32k_timer);
+       clockevents_config_and_register(&clockevent_32k_timer,
+                                       OMAP_32K_TICKS_PER_SEC, 1, 0xfffffffe);
 }
 
 /*
index 4815ea6f8f5dfc11f34af1c8e848bd0ed8d866c0..5f413968d568a167e461443d9d58fb1bd8b4b9e1 100644 (file)
@@ -284,6 +284,6 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_2430sdp_init,
        .init_late      = omap2430_init_late,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .restart        = omap2xxx_restart,
 MACHINE_END
index bb73afc9ac17cbc83e915145b7887b0e8203ff90..8e2513f6a282cc0cb18bbd68a49ac48e82eb2bcf 100644 (file)
@@ -597,6 +597,6 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_3430sdp_init,
        .init_late      = omap3430_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 050aaa7712544fc9db648dbd48ad2e8e237e484b..33846274bb8a282b592126d411a9d06adf35ad92 100644 (file)
@@ -211,6 +211,6 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_sdp_init,
        .init_late      = omap3630_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 1cc6696594fd5493258b2df98874f6eb307a3bbf..f8eeef40efe8e1cdae47e5d748bb58d396d4381a 100644 (file)
 #include <linux/regulator/fixed.h>
 #include <linux/leds.h>
 #include <linux/leds_pwm.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/omap4-keypad.h>
 #include <linux/usb/musb.h>
 
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -722,9 +722,8 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
        .map_io         = omap4_map_io,
        .init_early     = omap4430_init_early,
        .init_irq       = gic_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = omap_4430sdp_init,
        .init_late      = omap4430_init_late,
-       .timer          = &omap4_timer,
+       .init_time      = omap4_local_timer_init,
        .restart        = omap44xx_restart,
 MACHINE_END
index 51b96a1206d198dcdeef25ac5f76c0c06e9cb080..07f0be24a5d18eceacac4573aca9a8d1748b2dfb 100644 (file)
@@ -92,6 +92,6 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = am3517_crane_init,
        .init_late      = am35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index f81a303b87ff1afbba44e9ddcfdea4dcb2363ffb..6f5b2a05f4b2fdf5b33320982f7e71573c5d5e0c 100644 (file)
@@ -393,6 +393,6 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = am3517_evm_init,
        .init_late      = am35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 5d0a61f5416551b83ea0844af6eb66cbc0955727..3a6ca74709ab93a99c40a194a5c69d19f2e0da9f 100644 (file)
@@ -337,6 +337,6 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_apollon_init,
        .init_late      = omap2420_init_late,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .restart        = omap2xxx_restart,
 MACHINE_END
index b3102c2f4a3cbbede79af9aeb10beecf808a60a5..68647c3891901022a6afa378b104bf7b2759d524 100644 (file)
@@ -751,7 +751,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = cm_t35_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
 
@@ -764,6 +764,6 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = cm_t3730_init,
        .init_late     = omap3630_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index ebbc2adb499e9300d6213f8f4968aa6306c4a87e..6a9529ab95cd1c2fbb21917a75ba96e15d37be65 100644 (file)
@@ -297,6 +297,6 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = cm_t3517_init,
        .init_late      = am35xx_init_late,
-       .timer          = &omap3_gp_timer,
+       .init_time      = omap3_gp_gptimer_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 12865af25d3a865b351e8dff3b8cb5fc20649ca5..0b1d8f75808812fdd9b6c60cfb8606173e997348 100644 (file)
@@ -643,6 +643,6 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = devkit8000_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_secure_timer,
+       .init_time      = omap3_secure_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 53cb380b7877a3fb6e354d97db1586523e2f78a3..2590463e4b57d5729cc7e22ab9198c4c60464426 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/of_platform.h>
 #include <linux/irqdomain.h>
 
-#include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
 
 #include "common.h"
@@ -65,7 +64,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
        .init_irq       = omap_intc_of_init,
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_generic_init,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .dt_compat      = omap242x_boards_compat,
        .restart        = omap2xxx_restart,
 MACHINE_END
@@ -84,7 +83,7 @@ DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
        .init_irq       = omap_intc_of_init,
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_generic_init,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .dt_compat      = omap243x_boards_compat,
        .restart        = omap2xxx_restart,
 MACHINE_END
@@ -103,7 +102,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
        .init_irq       = omap_intc_of_init,
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_generic_init,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .dt_compat      = omap3_boards_compat,
        .restart        = omap3xxx_restart,
 MACHINE_END
@@ -120,7 +119,7 @@ DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
        .init_irq       = omap_intc_of_init,
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_generic_init,
-       .timer          = &omap3_secure_timer,
+       .init_time      = omap3_secure_sync32k_timer_init,
        .dt_compat      = omap3_gp_boards_compat,
        .restart        = omap3xxx_restart,
 MACHINE_END
@@ -139,7 +138,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
        .init_irq       = omap_intc_of_init,
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_generic_init,
-       .timer          = &omap3_am33xx_timer,
+       .init_time      = omap3_am33xx_gptimer_timer_init,
        .dt_compat      = am33xx_boards_compat,
 MACHINE_END
 #endif
@@ -156,10 +155,9 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
        .map_io         = omap4_map_io,
        .init_early     = omap4430_init_early,
        .init_irq       = omap_gic_of_init,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = omap_generic_init,
        .init_late      = omap4430_init_late,
-       .timer          = &omap4_timer,
+       .init_time      = omap4_local_timer_init,
        .dt_compat      = omap4_boards_compat,
        .restart        = omap44xx_restart,
 MACHINE_END
@@ -177,9 +175,8 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
        .map_io         = omap5_map_io,
        .init_early     = omap5_init_early,
        .init_irq       = omap_gic_of_init,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = omap_generic_init,
-       .timer          = &omap5_timer,
+       .init_time      = omap5_realtime_timer_init,
        .dt_compat      = omap5_boards_compat,
        .restart        = omap44xx_restart,
 MACHINE_END
index 3be1311f9e33fe4bfec977191616cc0e2431974c..812c829fa46f60a3af0aeec99bcb45555500bb05 100644 (file)
@@ -342,6 +342,6 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_h4_init,
        .init_late      = omap2420_init_late,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .restart        = omap2xxx_restart,
 MACHINE_END
index 0f24cb84ba5a524ff0256462d84be6cc2d6d9b0e..5b447649f5a0017d6e04cd4181c22fe4258d42db 100644 (file)
@@ -655,7 +655,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = igep_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
 
@@ -668,6 +668,6 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = igep_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 0869f4f3d3e11264fce04e29b02c5e046f61193f..ff440c0d04dd999a533216bc2657f054706cd40d 100644 (file)
@@ -435,6 +435,6 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_ldp_init,
        .init_late      = omap3430_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 0abb30fe399cfd5923785c37e7a995c29d90eb58..f6eeb87e4e955e425903475b733328656ffcaeda 100644 (file)
@@ -731,7 +731,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = n8x0_init_machine,
        .init_late      = omap2420_init_late,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .restart        = omap2xxx_restart,
 MACHINE_END
 
@@ -744,7 +744,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = n8x0_init_machine,
        .init_late      = omap2420_init_late,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .restart        = omap2xxx_restart,
 MACHINE_END
 
@@ -757,6 +757,6 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = n8x0_init_machine,
        .init_late      = omap2420_init_late,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .restart        = omap2xxx_restart,
 MACHINE_END
index 22c483d5dfa829891fd8ec9ece81f35c94cf152b..b81b4585f46ff7904035698c1bb19ee45ea7761a 100644 (file)
@@ -544,6 +544,6 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_beagle_init,
        .init_late      = omap3_init_late,
-       .timer          = &omap3_secure_timer,
+       .init_time      = omap3_secure_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 3985f35aee06a6cffbc05d2930b56c456231ee97..f2f636b19762706e3e631adb4f56d7ed07a015fe 100644 (file)
@@ -757,6 +757,6 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_evm_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 2a065ba6eb58b9c3da2c265d5616e19904263716..0fba43a9b07dc72025a4c75df730c3828520cfb3 100644 (file)
@@ -231,7 +231,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3logic_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
 
@@ -244,6 +244,6 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3logic_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index a53a6683c1b8b103f88cb3e5e1019a04a6b751a4..12e181689340970acf8f0dfe4d13a627f5f2e74d 100644 (file)
@@ -618,6 +618,6 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3pandora_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 53a6cbcf9747bdd88acbbf9fdd155db05a5dc817..13ee40545604cd7c1f9f171f88de7012f21377ef 100644 (file)
@@ -427,6 +427,6 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
        .handle_irq             = omap3_intc_handle_irq,
        .init_machine           = omap3_stalker_init,
        .init_late              = omap35xx_init_late,
-       .timer                  = &omap3_secure_timer,
+       .init_time              = omap3_secure_sync32k_timer_init,
        .restart                = omap3xxx_restart,
 MACHINE_END
index 263cb9cfbf3783e1c95d540bd807d652276725f3..36c455c85ed926a30c8ad0a6db057e31ce3f527b 100644 (file)
@@ -386,6 +386,6 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_touchbook_init,
        .init_late      = omap3430_init_late,
-       .timer          = &omap3_secure_timer,
+       .init_time      = omap3_secure_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 769c1feee1c469049290f9101745cc28ef01742f..b62317906b39f539baf394afe2b27308619353c9 100644 (file)
@@ -31,9 +31,9 @@
 #include <linux/ti_wilink_st.h>
 #include <linux/usb/musb.h>
 #include <linux/wl12xx.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/omap-abe-twl6040.h>
 
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -459,9 +459,8 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
        .map_io         = omap4_map_io,
        .init_early     = omap4430_init_early,
        .init_irq       = gic_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = omap4_panda_init,
        .init_late      = omap4430_init_late,
-       .timer          = &omap4_timer,
+       .init_time      = omap4_local_timer_init,
        .restart        = omap44xx_restart,
 MACHINE_END
index c8fde3e5644138088721040a465b55de4094313c..233a37d541c3118749dc5a2609548712160080e6 100644 (file)
@@ -551,6 +551,6 @@ MACHINE_START(OVERO, "Gumstix Overo")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = overo_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 0c777b75e484dcc3cc291a4dd5cab058178f8941..386a2ddc1173d3d2688d5178f9459a767a1c738b 100644 (file)
@@ -147,7 +147,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = rm680_init,
        .init_late      = omap3630_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
 
@@ -160,6 +160,6 @@ MACHINE_START(NOKIA_RM696, "Nokia RM-696 board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = rm680_init,
        .init_late      = omap3630_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index d0374ea2dfb0ef21288c0a47a27dc1e9fc17ce2e..f7c4616cbb60a7e90f45e1fdc8a686e3cd47857f 100644 (file)
@@ -123,6 +123,6 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = rx51_init,
        .init_late      = omap3430_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 1a3e056d63a76afbb9f5b621c9d3f41d08428fc7..6273c286e1d8fc877bfc6d20d7cdfa50530119c8 100644 (file)
@@ -43,7 +43,7 @@ MACHINE_START(TI8168EVM, "ti8168evm")
        .map_io         = ti81xx_map_io,
        .init_early     = ti81xx_init_early,
        .init_irq       = ti81xx_init_irq,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .init_machine   = ti81xx_evm_init,
        .init_late      = ti81xx_init_late,
        .restart        = omap44xx_restart,
@@ -55,7 +55,7 @@ MACHINE_START(TI8148EVM, "ti8148evm")
        .map_io         = ti81xx_map_io,
        .init_early     = ti81xx_init_early,
        .init_irq       = ti81xx_init_irq,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .init_machine   = ti81xx_evm_init,
        .init_late      = ti81xx_init_late,
        .restart        = omap44xx_restart,
index d7fa31e672387043aedeaaa872e499d1219daa27..d257cf1e0abec2191d9b54898e2a96d976301702 100644 (file)
@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_zoom_init,
        .init_late      = omap3430_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
 
@@ -150,6 +150,6 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_zoom_init,
        .init_late      = omap3630_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
 MACHINE_END
index 948bcaa82eb67e1030c3d6958c33c69f365203b1..b4350274361bb3fca31721301ada1e03dcffb036 100644 (file)
@@ -79,13 +79,13 @@ static inline int omap_mux_late_init(void)
 
 extern void omap2_init_common_infrastructure(void);
 
-extern struct sys_timer omap2_timer;
-extern struct sys_timer omap3_timer;
-extern struct sys_timer omap3_secure_timer;
-extern struct sys_timer omap3_gp_timer;
-extern struct sys_timer omap3_am33xx_timer;
-extern struct sys_timer omap4_timer;
-extern struct sys_timer omap5_timer;
+extern void omap2_sync32k_timer_init(void);
+extern void omap3_sync32k_timer_init(void);
+extern void omap3_secure_sync32k_timer_init(void);
+extern void omap3_gp_gptimer_timer_init(void);
+extern void omap3_am33xx_gptimer_timer_init(void);
+extern void omap4_local_timer_init(void);
+extern void omap5_realtime_timer_init(void);
 
 void omap2420_init_early(void);
 void omap2430_init_early(void);
index cd42d921940dcdb1dd91de67bb56b0350e2b442a..361677983af0ea07d84667cd36da407317d684b8 100644 (file)
@@ -19,9 +19,9 @@
 #include <linux/device.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/cacheflush.h>
-#include <asm/hardware/gic.h>
 #include <asm/smp_scu.h>
 
 #include "omap-secure.h"
@@ -157,7 +157,7 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
                booted = true;
        }
 
-       gic_raise_softirq(cpumask_of(cpu), 0);
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
 
        /*
         * Now the secondary core is starting up let it run its
@@ -231,8 +231,6 @@ static void __init omap4_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
index 5d3b4f4f81aed8ad94ddd158ca9682907faf342b..8c5b5e3e3541441d6cf87076b3caddee054fea3a 100644 (file)
@@ -24,8 +24,7 @@
 #include <linux/cpu.h>
 #include <linux/notifier.h>
 #include <linux/cpu_pm.h>
-
-#include <asm/hardware/gic.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include "omap-wakeupgen.h"
 #include "omap-secure.h"
index 6897ae21bb82e29e88a5bb8c5b25c959398fcbd4..5470948836060d4dfa8cf72f11d4b5c5af4d42e6 100644 (file)
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/platform_device.h>
 #include <linux/memblock.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/export.h>
+#include <linux/irqchip/arm-gic.h>
 
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/map.h>
 #include <asm/memblock.h>
@@ -255,16 +256,10 @@ static int __init omap4_sar_ram_init(void)
 }
 early_initcall(omap4_sar_ram_init);
 
-static struct of_device_id irq_match[] __initdata = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
-       { }
-};
-
 void __init omap_gic_of_init(void)
 {
        omap_wakeupgen_init();
-       of_irq_init(irq_match);
+       irqchip_init();
 }
 
 #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
index b8ad6e632bb84d9ed3ede854cefeeebe6b4cc00c..d86074745c5071bf45f50df5f90ecc41a9d7f948 100644 (file)
@@ -131,7 +131,6 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
 static struct clock_event_device clockevent_gpt = {
        .name           = "gp_timer",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .rating         = 300,
        .set_next_event = omap2_gp_timer_set_next_event,
        .set_mode       = omap2_gp_timer_set_mode,
@@ -336,17 +335,11 @@ static void __init omap2_gp_clockevent_init(int gptimer_id,
 
        __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW);
 
-       clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC,
-                                    clockevent_gpt.shift);
-       clockevent_gpt.max_delta_ns =
-               clockevent_delta2ns(0xffffffff, &clockevent_gpt);
-       clockevent_gpt.min_delta_ns =
-               clockevent_delta2ns(3, &clockevent_gpt);
-               /* Timer internal resynch latency. */
-
        clockevent_gpt.cpumask = cpu_possible_mask;
        clockevent_gpt.irq = omap_dm_timer_get_irq(&clkev);
-       clockevents_register_device(&clockevent_gpt);
+       clockevents_config_and_register(&clockevent_gpt, clkev.rate,
+                                       3, /* Timer internal resynch latency */
+                                       0xffffffff);
 
        pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n",
                gptimer_id, clkev.rate);
@@ -552,7 +545,7 @@ static inline void __init realtime_counter_init(void)
 
 #define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop,  \
                               clksrc_nr, clksrc_src)                   \
-static void __init omap##name##_gptimer_timer_init(void)               \
+void __init omap##name##_gptimer_timer_init(void)                      \
 {                                                                      \
        omap_dmtimer_init();                                            \
        omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
@@ -561,7 +554,7 @@ static void __init omap##name##_gptimer_timer_init(void)            \
 
 #define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
                                clksrc_nr, clksrc_src)                  \
-static void __init omap##name##_sync32k_timer_init(void)               \
+void __init omap##name##_sync32k_timer_init(void)              \
 {                                                                      \
        omap_dmtimer_init();                                            \
        omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
@@ -572,33 +565,23 @@ static void __init omap##name##_sync32k_timer_init(void)          \
                omap2_sync32k_clocksource_init();                       \
 }
 
-#define OMAP_SYS_TIMER(name, clksrc)                                   \
-struct sys_timer omap##name##_timer = {                                        \
-       .init   = omap##name##_##clksrc##_timer_init,                   \
-};
-
 #ifdef CONFIG_ARCH_OMAP2
 OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP2_MPU_SOURCE);
-OMAP_SYS_TIMER(2, sync32k);
 #endif /* CONFIG_ARCH_OMAP2 */
 
 #ifdef CONFIG_ARCH_OMAP3
 OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP3_MPU_SOURCE);
-OMAP_SYS_TIMER(3, sync32k);
 OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure",
                        2, OMAP3_MPU_SOURCE);
-OMAP_SYS_TIMER(3_secure, sync32k);
 OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon",
                       2, OMAP3_MPU_SOURCE);
-OMAP_SYS_TIMER(3_gp, gptimer);
 #endif /* CONFIG_ARCH_OMAP3 */
 
 #ifdef CONFIG_SOC_AM33XX
 OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon",
                       2, OMAP4_MPU_SOURCE);
-OMAP_SYS_TIMER(3_am33xx, gptimer);
 #endif /* CONFIG_SOC_AM33XX */
 
 #ifdef CONFIG_ARCH_OMAP4
@@ -606,7 +589,7 @@ OMAP_SYS_32K_TIMER_INIT(4, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP4_MPU_SOURCE);
 #ifdef CONFIG_LOCAL_TIMERS
 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29);
-static void __init omap4_local_timer_init(void)
+void __init omap4_local_timer_init(void)
 {
        omap4_sync32k_timer_init();
        /* Local timers are not supprted on OMAP4430 ES1.0 */
@@ -624,18 +607,17 @@ static void __init omap4_local_timer_init(void)
        }
 }
 #else /* CONFIG_LOCAL_TIMERS */
-static void __init omap4_local_timer_init(void)
+void __init omap4_local_timer_init(void)
 {
        omap4_sync32k_timer_init();
 }
 #endif /* CONFIG_LOCAL_TIMERS */
-OMAP_SYS_TIMER(4, local);
 #endif /* CONFIG_ARCH_OMAP4 */
 
 #ifdef CONFIG_SOC_OMAP5
 OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP4_MPU_SOURCE);
-static void __init omap5_realtime_timer_init(void)
+void __init omap5_realtime_timer_init(void)
 {
        int err;
 
@@ -646,7 +628,6 @@ static void __init omap5_realtime_timer_init(void)
        if (err)
                pr_err("%s: arch_timer_register failed %d\n", __func__, err);
 }
-OMAP_SYS_TIMER(5, realtime);
 #endif /* CONFIG_SOC_OMAP5 */
 
 /**
index 32e5c211a89b8790ff3255e381b54d8615a691ba..35a8014529ca7b45b68a769a59e8a8d11d3e0782 100644 (file)
@@ -72,7 +72,7 @@ DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion_dt_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .init_machine   = orion5x_dt_init,
        .restart        = orion5x_restart,
        .dt_compat      = orion5x_dt_compat,
index 550f92320afb1505ab15a3c59853fe7edb40461e..d068f1431c402965004105c3ddb1018ec3b6d8ec 100644 (file)
@@ -217,7 +217,7 @@ int __init orion5x_find_tclk(void)
        return 166666667;
 }
 
-static void __init orion5x_timer_init(void)
+void __init orion5x_timer_init(void)
 {
        orion5x_tclk = orion5x_find_tclk();
 
@@ -225,10 +225,6 @@ static void __init orion5x_timer_init(void)
                        IRQ_ORION5X_BRIDGE, orion5x_tclk);
 }
 
-struct sys_timer orion5x_timer = {
-       .init = orion5x_timer_init,
-};
-
 
 /*****************************************************************************
  * General
index 7db5cdd9c4b791812c0a717ef921d7678602ae20..e60345760283a9263a10be96c3fa4fd54a7c9c91 100644 (file)
@@ -15,7 +15,7 @@ void orion5x_init(void);
 void orion5x_id(u32 *dev, u32 *rev, char **dev_name);
 void clk_init(void);
 extern int orion5x_tclk;
-extern struct sys_timer orion5x_timer;
+extern void orion5x_timer_init(void);
 
 /*
  * Enumerations and functions for Orion windows mapping. Used by Orion core
index e3629c063df247defde62b2779b42f6b11dc2cf2..57d0af74874d0877a77dc0d4a44c4bebe56b7605 100644 (file)
@@ -342,7 +342,7 @@ MACHINE_START(D2NET, "LaCie d2 Network")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
@@ -355,7 +355,7 @@ MACHINE_START(BIGDISK, "LaCie Big Disk Network")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 41fe2b1ff47c626da31d5a1ddad41740f9a56a94..76665640087b879f54ef5bbc150a95e3b7de923f 100644 (file)
@@ -362,6 +362,6 @@ MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .restart        = orion5x_restart,
 MACHINE_END
index e533588880ff5636fdaf2982988b33d0342a1c97..6eb1732757fd241132cbfea85e83f79272621c84 100644 (file)
@@ -714,7 +714,7 @@ MACHINE_START(DNS323, "D-Link DNS-323")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index f1ae10ae5bd4ee0833557675196b739d3fedf43d..b984035262180af2c072c7f8cca492c3baed97a0 100644 (file)
@@ -383,7 +383,7 @@ MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
@@ -397,7 +397,7 @@ MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 0c9e413b5805293756777bc1f0b8a3c04b2ec4c7..044da5b6a6ae6057efff262eed3e870716691b26 100644 (file)
@@ -322,7 +322,7 @@ MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index c1b5d8a580374d9e92443982eb83bfe34bf1788a..d49f93423f52feaeb2061542982ce0db477d7fa3 100644 (file)
@@ -269,7 +269,7 @@ MACHINE_START(LINKSTATION_LS_HGL, "Buffalo Linkstation LS-HGL")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 949eaa8f12e3cd1a165ee5f696fdb5a545a31c0a..8e3965c6c0fe15fa96b615d55cc4c6e16aded6c3 100644 (file)
@@ -271,7 +271,7 @@ MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 1c16d045333ea0f5b7551907b36a2eaaed976a5d..0ec94a1f2b16e2fe9a9ac34bd7964867c42a8e20 100644 (file)
@@ -265,7 +265,7 @@ MACHINE_START(MSS2, "Maxtor Shared Storage II")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index c87fde4deecad440b12482e9789eeea11ea08915..18143f2a909398eb709066c7bba1a2d32261b575 100644 (file)
@@ -233,7 +233,7 @@ MACHINE_START(MV2120, "HP Media Vault mv2120")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 3506f16c0bf27d91f130ef3b245af81f90271e34..282e503b003eb12c6ffd62b62ae4dd35cc09982c 100644 (file)
@@ -425,7 +425,7 @@ MACHINE_START(NET2BIG, "LaCie 2Big Network")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 9b1c95310291e74896e9de9793006aa2ee181dcb..d6e72f672afbf221a9066100a64b3d96107d9e5f 100644 (file)
@@ -171,7 +171,7 @@ MACHINE_START(RD88F5181L_FXO, "Marvell Orion-VoIP FXO Reference Design")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 51ba2b81a10b7fe096f8467cdb83ec56d3682634..c8b7913310e53b7f97ced2566fd0d4001512513f 100644 (file)
@@ -183,7 +183,7 @@ MACHINE_START(RD88F5181L_GE, "Marvell Orion-VoIP GE Reference Design")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 0a56b9444f1bc6b3a33f0a316bf112250f5141d5..f9e156725d7cf52e742972d90ba58776c57c7708 100644 (file)
@@ -281,6 +281,6 @@ MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .restart        = orion5x_restart,
 MACHINE_END
index ed50910b08a42747aeeca5ca4b6b24acd7510e0b..78a1e6ab1b9da8000f046dd2dce5cd7275f3b004 100644 (file)
@@ -123,7 +123,7 @@ MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 90e571dc4deb4d366ae8314d09baaf8119e5e69b..acc0877ec1c9848be42c2fceaf40a956532bb07c 100644 (file)
@@ -361,7 +361,7 @@ MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index b184f680e0db8e6016f091e15efc21c92a5ab5af..9c17f0c2b488616404472282be1d955dba515711 100644 (file)
@@ -326,7 +326,7 @@ MACHINE_START(TS209, "QNAP TS-109/TS-209")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index a5c2e64c4ece06ef1cc6458e54d7df031fdbc1bc..8cc5ab6c503e31f17f5f4b0bf9b9e8207d90657c 100644 (file)
@@ -315,7 +315,7 @@ MACHINE_START(TS409, "QNAP TS-409")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index b0727dcd1ef997b5b576a50b70efb28a98a02ab5..e960855d32ac30b75e6a328181be3cbe8fed9535 100644 (file)
@@ -619,6 +619,6 @@ MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
        .map_io         = ts78xx_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .restart        = orion5x_restart,
 MACHINE_END
index 754c12b6abf09c7e0077b01c3493788b911dc43a..66552ca7e05da68de13934ddaae342cd75622404 100644 (file)
@@ -176,7 +176,7 @@ MACHINE_START(WNR854T, "Netgear WNR854T")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index 45c21251eb1efa7c5b8ccc456d74ff7411ad5f85..2c5408e2e689431fdd40de391db45890f9821caa 100644 (file)
@@ -264,7 +264,7 @@ MACHINE_START(WRT350N_V2, "Linksys WRT350N v2")
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
        .init_irq       = orion5x_init_irq,
-       .timer          = &orion5x_timer,
+       .init_time      = orion5x_timer_init,
        .fixup          = tag_fixup_mem32,
        .restart        = orion5x_restart,
 MACHINE_END
index f6c0849af5e9e374cd1639e3da0fcec952756391..70b441ad1d18b2d4d17b20344133c004820e752d 100644 (file)
@@ -9,6 +9,7 @@
  */
 #include <linux/delay.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/irqdomain.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -17,7 +18,6 @@
 #include <linux/dw_apb_timer.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach/map.h>
 
 #include "common.h"
@@ -70,16 +70,6 @@ static const char *picoxcell_dt_match[] = {
        NULL
 };
 
-static const struct of_device_id vic_of_match[] __initconst = {
-       { .compatible = "arm,pl192-vic", .data = vic_of_init, },
-       { /* Sentinel */ }
-};
-
-static void __init picoxcell_init_irq(void)
-{
-       of_irq_init(vic_of_match);
-}
-
 static void picoxcell_wdt_restart(char mode, const char *cmd)
 {
        /*
@@ -97,9 +87,8 @@ static void picoxcell_wdt_restart(char mode, const char *cmd)
 DT_MACHINE_START(PICOXCELL, "Picochip picoXcell")
        .map_io         = picoxcell_map_io,
        .nr_irqs        = NR_IRQS_LEGACY,
-       .init_irq       = picoxcell_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &dw_apb_timer,
+       .init_irq       = irqchip_init,
+       .init_time      = dw_apb_timer_init,
        .init_machine   = picoxcell_init_machine,
        .dt_compat      = picoxcell_dt_match,
        .restart        = picoxcell_wdt_restart,
index a65cb02f84c8d4824b319718942f3b71d7d2fae4..481b42a4ef155fdeab6a841cbcd8485594035950 100644 (file)
@@ -12,6 +12,6 @@
 
 #include <asm/mach/time.h>
 
-extern struct sys_timer dw_apb_timer;
+extern void dw_apb_timer_init(void);
 
 #endif /* __PICOXCELL_COMMON_H__ */
index 558ccfb8d45803b3c3f68cadea2cfdc7e5e69440..4f7379fe01e24c5f00c06e2ed92002db531250f4 100644 (file)
@@ -11,6 +11,16 @@ config ARCH_PRIMA2
        help
           Support for CSR SiRFSoC ARM Cortex A9 Platform
 
+config ARCH_MARCO
+       bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
+       default y
+       select ARM_GIC
+       select CPU_V7
+       select HAVE_SMP
+       select SMP_ON_UP
+       help
+          Support for CSR SiRFSoC ARM Cortex A9 Platform
+
 endmenu
 
 config SIRF_IRQ
index fc9ce22e2b5a58f44c6de493f123f01f3808867a..bfe360cbd1774e27ba80d849273cf5be571f9248 100644 (file)
@@ -1,4 +1,3 @@
-obj-y := timer.o
 obj-y += rstc.o
 obj-y += common.o
 obj-y += rtciobrg.o
@@ -6,3 +5,7 @@ obj-$(CONFIG_DEBUG_LL) += lluart.o
 obj-$(CONFIG_CACHE_L2X0) += l2x0.o
 obj-$(CONFIG_SUSPEND) += pm.o sleep.o
 obj-$(CONFIG_SIRF_IRQ) += irq.o
+obj-$(CONFIG_SMP) += platsmp.o headsmp.o
+obj-$(CONFIG_HOTPLUG_CPU)  += hotplug.o
+obj-$(CONFIG_ARCH_PRIMA2) += timer-prima2.o
+obj-$(CONFIG_ARCH_MARCO) += timer-marco.o
index f25a5419463966d3b046812d9a7155b9b686f696..2d57aa479a7bea697176537028f9fbb7f10101f7 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/irqchip.h>
 #include <asm/sizes.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -30,6 +31,12 @@ void __init sirfsoc_init_late(void)
        sirfsoc_pm_init();
 }
 
+static __init void sirfsoc_map_io(void)
+{
+       sirfsoc_map_lluart();
+       sirfsoc_map_scu();
+}
+
 #ifdef CONFIG_ARCH_PRIMA2
 static const char *prima2_dt_match[] __initdata = {
        "sirf,prima2",
@@ -38,9 +45,12 @@ static const char *prima2_dt_match[] __initdata = {
 
 DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
        /* Maintainer: Barry Song <baohua.song@csr.com> */
-       .map_io         = sirfsoc_map_lluart,
+       .map_io         = sirfsoc_map_io,
        .init_irq       = sirfsoc_of_irq_init,
-       .timer          = &sirfsoc_timer,
+       .init_time      = sirfsoc_prima2_timer_init,
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       .handle_irq     = sirfsoc_handle_irq,
+#endif
        .dma_zone_size  = SZ_256M,
        .init_machine   = sirfsoc_mach_init,
        .init_late      = sirfsoc_init_late,
@@ -48,3 +58,22 @@ DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
        .restart        = sirfsoc_restart,
 MACHINE_END
 #endif
+
+#ifdef CONFIG_ARCH_MARCO
+static const char *marco_dt_match[] __initdata = {
+       "sirf,marco",
+       NULL
+};
+
+DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)")
+       /* Maintainer: Barry Song <baohua.song@csr.com> */
+       .smp            = smp_ops(sirfsoc_smp_ops),
+       .map_io         = sirfsoc_map_io,
+       .init_irq       = irqchip_init,
+       .init_time      = sirfsoc_marco_timer_init,
+       .init_machine   = sirfsoc_mach_init,
+       .init_late      = sirfsoc_init_late,
+       .dt_compat      = marco_dt_match,
+       .restart        = sirfsoc_restart,
+MACHINE_END
+#endif
index 60d826fc2185143c5d0edfdef5fd08755ead758f..b7c26b62e4a760c309904960ab24619d2f271acc 100644 (file)
 
 #include <linux/init.h>
 #include <asm/mach/time.h>
+#include <asm/exception.h>
 
-extern struct sys_timer sirfsoc_timer;
+extern void sirfsoc_prima2_timer_init(void);
+extern void sirfsoc_marco_timer_init(void);
+
+extern struct smp_operations   sirfsoc_smp_ops;
+extern void sirfsoc_secondary_startup(void);
+extern void sirfsoc_cpu_die(unsigned int cpu);
 
 extern void __init sirfsoc_of_irq_init(void);
 extern void __init sirfsoc_of_clk_init(void);
 extern void sirfsoc_restart(char, const char *);
+extern asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs);
 
 #ifndef CONFIG_DEBUG_LL
 static inline void sirfsoc_map_lluart(void)  {}
@@ -24,6 +31,12 @@ static inline void sirfsoc_map_lluart(void)  {}
 extern void __init sirfsoc_map_lluart(void);
 #endif
 
+#ifndef CONFIG_SMP
+static inline void sirfsoc_map_scu(void) {}
+#else
+extern void sirfsoc_map_scu(void);
+#endif
+
 #ifdef CONFIG_SUSPEND
 extern int sirfsoc_pm_init(void);
 #else
diff --git a/arch/arm/mach-prima2/headsmp.S b/arch/arm/mach-prima2/headsmp.S
new file mode 100644 (file)
index 0000000..6ec19d5
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Entry of the second core for CSR Marco dual-core SMP SoCs
+ *
+ * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/linkage.h>
+#include <linux/init.h>
+
+       __INIT
+/*
+ * Cold boot and hardware reset show different behaviour,
+ * system will be always panic if we warm-reset the board
+ * Here we invalidate L1 of CPU1 to make sure there isn't
+ * uninitialized data written into memory later
+ */
+ENTRY(v7_invalidate_l1)
+       mov     r0, #0
+       mcr     p15, 0, r0, c7, c5, 0   @ invalidate I cache
+       mcr     p15, 2, r0, c0, c0, 0
+       mrc     p15, 1, r0, c0, c0, 0
+
+       ldr     r1, =0x7fff
+       and     r2, r1, r0, lsr #13
+
+       ldr     r1, =0x3ff
+
+       and     r3, r1, r0, lsr #3      @ NumWays - 1
+       add     r2, r2, #1              @ NumSets
+
+       and     r0, r0, #0x7
+       add     r0, r0, #4      @ SetShift
+
+       clz     r1, r3          @ WayShift
+       add     r4, r3, #1      @ NumWays
+1:     sub     r2, r2, #1      @ NumSets--
+       mov     r3, r4          @ Temp = NumWays
+2:     subs    r3, r3, #1      @ Temp--
+       mov     r5, r3, lsl r1
+       mov     r6, r2, lsl r0
+       orr     r5, r5, r6      @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
+       mcr     p15, 0, r5, c7, c6, 2
+       bgt     2b
+       cmp     r2, #0
+       bgt     1b
+       dsb
+       isb
+       mov     pc, lr
+ENDPROC(v7_invalidate_l1)
+
+/*
+ * SIRFSOC specific entry point for secondary CPUs.  This provides
+ * a "holding pen" into which all secondary cores are held until we're
+ * ready for them to initialise.
+ */
+ENTRY(sirfsoc_secondary_startup)
+       bl v7_invalidate_l1
+        mrc     p15, 0, r0, c0, c0, 5
+        and     r0, r0, #15
+        adr     r4, 1f
+        ldmia   r4, {r5, r6}
+        sub     r4, r4, r5
+        add     r6, r6, r4
+pen:    ldr     r7, [r6]
+        cmp     r7, r0
+        bne     pen
+
+        /*
+         * we've been released from the holding pen: secondary_stack
+         * should now contain the SVC stack for this core
+         */
+        b       secondary_startup
+ENDPROC(sirfsoc_secondary_startup)
+
+        .align
+1:      .long   .
+        .long   pen_release
diff --git a/arch/arm/mach-prima2/hotplug.c b/arch/arm/mach-prima2/hotplug.c
new file mode 100644 (file)
index 0000000..97c1ee5
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * CPU hotplug support for CSR Marco dual-core SMP SoCs
+ *
+ * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/smp.h>
+
+#include <asm/cacheflush.h>
+#include <asm/smp_plat.h>
+
+static inline void platform_do_lowpower(unsigned int cpu)
+{
+       flush_cache_all();
+
+       /* we put the platform to just WFI */
+       for (;;) {
+               __asm__ __volatile__("dsb\n\t" "wfi\n\t"
+                       : : : "memory");
+               if (pen_release == cpu_logical_map(cpu)) {
+                       /*
+                        * OK, proper wakeup, we're done
+                        */
+                       break;
+               }
+       }
+}
+
+/*
+ * platform-specific code to shutdown a CPU
+ *
+ * Called with IRQs disabled
+ */
+void sirfsoc_cpu_die(unsigned int cpu)
+{
+       platform_do_lowpower(cpu);
+}
index f6014a07541f92d3a7a2d89d7d76a99847c9b7f6..b778a0f248ed1f0b39dd1ef272bbf28532ba54f8 100644 (file)
@@ -10,8 +10,8 @@
 #define __ASM_ARCH_IRQS_H
 
 #define SIRFSOC_INTENAL_IRQ_START  0
-#define SIRFSOC_INTENAL_IRQ_END    59
+#define SIRFSOC_INTENAL_IRQ_END    127
 #define SIRFSOC_GPIO_IRQ_START     (SIRFSOC_INTENAL_IRQ_END + 1)
-#define NR_IRQS        220
+#define NR_IRQS        288
 
 #endif
index c98b4d5ac24a4d566a3dfb54ab79f83cef9d56cb..c10510d01a440775844fe707fb98e15378d21cce 100644 (file)
 #define __MACH_PRIMA2_SIRFSOC_UART_H
 
 /* UART-1: used as serial debug port */
+#if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1)
 #define SIRFSOC_UART1_PA_BASE          0xb0060000
+#elif defined(CONFIG_DEBUG_SIRFMARCO_UART1)
+#define SIRFSOC_UART1_PA_BASE          0xcc060000
+#else
+#define SIRFSOC_UART1_PA_BASE          0
+#endif
 #define SIRFSOC_UART1_VA_BASE          SIRFSOC_VA(0x060000)
 #define SIRFSOC_UART1_SIZE             SZ_4K
 
index 0c898fcf909c90b1b6ef4b124ced34e076f6fe7d..15f3edcfbb47a66d325a72a68d5bb655ecfed4c4 100644 (file)
@@ -25,6 +25,9 @@ static __inline__ void putc(char c)
         * during kernel decompression, all mappings are flat:
         *  virt_addr == phys_addr
         */
+       if (!SIRFSOC_UART1_PA_BASE)
+               return;
+
        while (__raw_readl((void __iomem *)SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS)
                & SIRFSOC_UART1_TXFIFO_FULL)
                barrier();
index 7dee9176e77a57ee6bac685cc06a274cca4e6f4f..6c0f3e9c43fbc949c94b0bbd533a18e9276dfd84 100644 (file)
@@ -9,17 +9,19 @@
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/irq.h>
-#include <mach/hardware.h>
-#include <asm/mach/irq.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/irqdomain.h>
 #include <linux/syscore_ops.h>
+#include <asm/mach/irq.h>
+#include <asm/exception.h>
+#include <mach/hardware.h>
 
 #define SIRFSOC_INT_RISC_MASK0          0x0018
 #define SIRFSOC_INT_RISC_MASK1          0x001C
 #define SIRFSOC_INT_RISC_LEVEL0         0x0020
 #define SIRFSOC_INT_RISC_LEVEL1         0x0024
+#define SIRFSOC_INIT_IRQ_ID            0x0038
 
 void __iomem *sirfsoc_intc_base;
 
@@ -52,6 +54,16 @@ static __init void sirfsoc_irq_init(void)
        writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_MASK1);
 }
 
+asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs)
+{
+       u32 irqstat, irqnr;
+
+       irqstat = readl_relaxed(sirfsoc_intc_base + SIRFSOC_INIT_IRQ_ID);
+       irqnr = irqstat & 0xff;
+
+       handle_IRQ(irqnr, regs);
+}
+
 static struct of_device_id intc_ids[]  = {
        { .compatible = "sirf,prima2-intc" },
        {},
index c99837797d76b6fb3d254c8aaa97cd860cd77e4e..cbcbe9cb094c480a928d22ad23642eec3ecc0178 100644 (file)
 #include <linux/of.h>
 #include <asm/hardware/cache-l2x0.h>
 
-static struct of_device_id prima2_l2x0_ids[]  = {
-       { .compatible = "sirf,prima2-pl310-cache" },
+struct l2x0_aux
+{
+       u32 val;
+       u32 mask;
+};
+
+static struct l2x0_aux prima2_l2x0_aux __initconst = {
+       .val = 2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT,
+       .mask = 0,
+};
+
+static struct l2x0_aux marco_l2x0_aux __initconst = {
+       .val = (2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) |
+               (1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT),
+       .mask = L2X0_AUX_CTRL_MASK,
+};
+
+static struct of_device_id sirf_l2x0_ids[] __initconst = {
+       { .compatible = "sirf,prima2-pl310-cache", .data = &prima2_l2x0_aux, },
+       { .compatible = "sirf,marco-pl310-cache", .data = &marco_l2x0_aux, },
        {},
 };
 
 static int __init sirfsoc_l2x0_init(void)
 {
        struct device_node *np;
+       const struct l2x0_aux *aux;
 
-       np = of_find_matching_node(NULL, prima2_l2x0_ids);
+       np = of_find_matching_node(NULL, sirf_l2x0_ids);
        if (np) {
-               pr_info("Initializing prima2 L2 cache\n");
-               return l2x0_of_init(0x40000, 0);
+               aux = of_match_node(sirf_l2x0_ids, np)->data;
+               return l2x0_of_init(aux->val, aux->mask);
        }
 
        return 0;
diff --git a/arch/arm/mach-prima2/platsmp.c b/arch/arm/mach-prima2/platsmp.c
new file mode 100644 (file)
index 0000000..4b78831
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * plat smp support for CSR Marco dual-core SMP SoCs
+ *
+ * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/delay.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/irqchip/arm-gic.h>
+#include <asm/page.h>
+#include <asm/mach/map.h>
+#include <asm/smp_plat.h>
+#include <asm/smp_scu.h>
+#include <asm/cacheflush.h>
+#include <asm/cputype.h>
+#include <mach/map.h>
+
+#include "common.h"
+
+static void __iomem *scu_base;
+static void __iomem *rsc_base;
+
+static DEFINE_SPINLOCK(boot_lock);
+
+static struct map_desc scu_io_desc __initdata = {
+       .length         = SZ_4K,
+       .type           = MT_DEVICE,
+};
+
+void __init sirfsoc_map_scu(void)
+{
+       unsigned long base;
+
+       /* Get SCU base */
+       asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base));
+
+       scu_io_desc.virtual = SIRFSOC_VA(base);
+       scu_io_desc.pfn = __phys_to_pfn(base);
+       iotable_init(&scu_io_desc, 1);
+
+       scu_base = (void __iomem *)SIRFSOC_VA(base);
+}
+
+static void __cpuinit sirfsoc_secondary_init(unsigned int cpu)
+{
+       /*
+        * if any interrupts are already enabled for the primary
+        * core (e.g. timer irq), then they will not have been enabled
+        * for us: do so
+        */
+       gic_secondary_init(0);
+
+       /*
+        * let the primary processor know we're out of the
+        * pen, then head off into the C entry point
+        */
+       pen_release = -1;
+       smp_wmb();
+
+       /*
+        * Synchronise with the boot thread.
+        */
+       spin_lock(&boot_lock);
+       spin_unlock(&boot_lock);
+}
+
+static struct of_device_id rsc_ids[]  = {
+       { .compatible = "sirf,marco-rsc" },
+       {},
+};
+
+static int __cpuinit sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+       unsigned long timeout;
+       struct device_node *np;
+
+       np = of_find_matching_node(NULL, rsc_ids);
+       if (!np)
+               return -ENODEV;
+
+       rsc_base = of_iomap(np, 0);
+       if (!rsc_base)
+               return -ENOMEM;
+
+       /*
+        * write the address of secondary startup into the sram register
+        * at offset 0x2C, then write the magic number 0x3CAF5D62 to the
+        * RSC register at offset 0x28, which is what boot rom code is
+        * waiting for. This would wake up the secondary core from WFE
+        */
+#define SIRFSOC_CPU1_JUMPADDR_OFFSET 0x2C
+       __raw_writel(virt_to_phys(sirfsoc_secondary_startup),
+               rsc_base + SIRFSOC_CPU1_JUMPADDR_OFFSET);
+
+#define SIRFSOC_CPU1_WAKEMAGIC_OFFSET 0x28
+       __raw_writel(0x3CAF5D62,
+               rsc_base + SIRFSOC_CPU1_WAKEMAGIC_OFFSET);
+
+       /* make sure write buffer is drained */
+       mb();
+
+       spin_lock(&boot_lock);
+
+       /*
+        * The secondary processor is waiting to be released from
+        * the holding pen - release it, then wait for it to flag
+        * that it has been released by resetting pen_release.
+        *
+        * Note that "pen_release" is the hardware CPU ID, whereas
+        * "cpu" is Linux's internal ID.
+        */
+       pen_release = cpu_logical_map(cpu);
+       __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
+       outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
+
+       /*
+        * Send the secondary CPU SEV, thereby causing the boot monitor to read
+        * the JUMPADDR and WAKEMAGIC, and branch to the address found there.
+        */
+       dsb_sev();
+
+       timeout = jiffies + (1 * HZ);
+       while (time_before(jiffies, timeout)) {
+               smp_rmb();
+               if (pen_release == -1)
+                       break;
+
+               udelay(10);
+       }
+
+       /*
+        * now the secondary core is starting up let it run its
+        * calibrations, then wait for it to finish
+        */
+       spin_unlock(&boot_lock);
+
+       return pen_release != -1 ? -ENOSYS : 0;
+}
+
+static void __init sirfsoc_smp_prepare_cpus(unsigned int max_cpus)
+{
+       scu_enable(scu_base);
+}
+
+struct smp_operations sirfsoc_smp_ops __initdata = {
+        .smp_prepare_cpus       = sirfsoc_smp_prepare_cpus,
+        .smp_secondary_init     = sirfsoc_secondary_init,
+        .smp_boot_secondary     = sirfsoc_boot_secondary,
+#ifdef CONFIG_HOTPLUG_CPU
+       .cpu_die                = sirfsoc_cpu_die,
+#endif
+};
index 762adb73ab7c9ece0de51b87f09cd6c5208f5576..435019ca0a4893f231b9f79c6cba8eb61e0f17e9 100644 (file)
@@ -19,6 +19,7 @@ static DEFINE_MUTEX(rstc_lock);
 
 static struct of_device_id rstc_ids[]  = {
        { .compatible = "sirf,prima2-rstc" },
+       { .compatible = "sirf,marco-rstc" },
        {},
 };
 
@@ -42,27 +43,37 @@ early_initcall(sirfsoc_of_rstc_init);
 
 int sirfsoc_reset_device(struct device *dev)
 {
-       const unsigned int *prop = of_get_property(dev->of_node, "reset-bit", NULL);
-       unsigned int reset_bit;
+       u32 reset_bit;
 
-       if (!prop)
-               return -ENODEV;
-
-       reset_bit = be32_to_cpup(prop);
+       if (of_property_read_u32(dev->of_node, "reset-bit", &reset_bit))
+               return -EINVAL;
 
        mutex_lock(&rstc_lock);
 
-       /*
-        * Writing 1 to this bit resets corresponding block. Writing 0 to this
-        * bit de-asserts reset signal of the corresponding block.
-        * datasheet doesn't require explicit delay between the set and clear
-        * of reset bit. it could be shorter if tests pass.
-        */
-       writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) | reset_bit,
-               sirfsoc_rstc_base + (reset_bit / 32) * 4);
-       msleep(10);
-       writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) & ~reset_bit,
-               sirfsoc_rstc_base + (reset_bit / 32) * 4);
+       if (of_device_is_compatible(dev->of_node, "sirf,prima2-rstc")) {
+               /*
+                * Writing 1 to this bit resets corresponding block. Writing 0 to this
+                * bit de-asserts reset signal of the corresponding block.
+                * datasheet doesn't require explicit delay between the set and clear
+                * of reset bit. it could be shorter if tests pass.
+                */
+               writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) | reset_bit,
+                       sirfsoc_rstc_base + (reset_bit / 32) * 4);
+               msleep(10);
+               writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) & ~reset_bit,
+                       sirfsoc_rstc_base + (reset_bit / 32) * 4);
+       } else {
+               /*
+                * For MARCO and POLO
+                * Writing 1 to SET register resets corresponding block. Writing 1 to CLEAR
+                * register de-asserts reset signal of the corresponding block.
+                * datasheet doesn't require explicit delay between the set and clear
+                * of reset bit. it could be shorter if tests pass.
+                */
+               writel(reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8);
+               msleep(10);
+               writel(reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8 + 4);
+       }
 
        mutex_unlock(&rstc_lock);
 
index 5573536021302b91f0d52048f14a94b3abfe3513..9f2da2eec4dc52bec9629b714d961010abe2529c 100644 (file)
@@ -104,6 +104,7 @@ EXPORT_SYMBOL_GPL(sirfsoc_rtc_iobrg_writel);
 
 static const struct of_device_id rtciobrg_ids[] = {
        { .compatible = "sirf,prima2-rtciobg" },
+       { .compatible = "sirf,marco-rtciobg" },
        {}
 };
 
diff --git a/arch/arm/mach-prima2/timer-marco.c b/arch/arm/mach-prima2/timer-marco.c
new file mode 100644 (file)
index 0000000..f4eea2e
--- /dev/null
@@ -0,0 +1,316 @@
+/*
+ * System timer for CSR SiRFprimaII
+ *
+ * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/kernel.h>
+#include <linux/interrupt.h>
+#include <linux/clockchips.h>
+#include <linux/clocksource.h>
+#include <linux/bitops.h>
+#include <linux/irq.h>
+#include <linux/clk.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/of_address.h>
+#include <asm/sched_clock.h>
+#include <asm/localtimer.h>
+#include <asm/mach/time.h>
+
+#include "common.h"
+
+#define SIRFSOC_TIMER_32COUNTER_0_CTRL                 0x0000
+#define SIRFSOC_TIMER_32COUNTER_1_CTRL                 0x0004
+#define SIRFSOC_TIMER_MATCH_0                          0x0018
+#define SIRFSOC_TIMER_MATCH_1                          0x001c
+#define SIRFSOC_TIMER_COUNTER_0                                0x0048
+#define SIRFSOC_TIMER_COUNTER_1                                0x004c
+#define SIRFSOC_TIMER_INTR_STATUS                      0x0060
+#define SIRFSOC_TIMER_WATCHDOG_EN                      0x0064
+#define SIRFSOC_TIMER_64COUNTER_CTRL                   0x0068
+#define SIRFSOC_TIMER_64COUNTER_LO                     0x006c
+#define SIRFSOC_TIMER_64COUNTER_HI                     0x0070
+#define SIRFSOC_TIMER_64COUNTER_LOAD_LO                        0x0074
+#define SIRFSOC_TIMER_64COUNTER_LOAD_HI                        0x0078
+#define SIRFSOC_TIMER_64COUNTER_RLATCHED_LO            0x007c
+#define SIRFSOC_TIMER_64COUNTER_RLATCHED_HI            0x0080
+
+#define SIRFSOC_TIMER_REG_CNT 6
+
+static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = {
+       SIRFSOC_TIMER_WATCHDOG_EN,
+       SIRFSOC_TIMER_32COUNTER_0_CTRL,
+       SIRFSOC_TIMER_32COUNTER_1_CTRL,
+       SIRFSOC_TIMER_64COUNTER_CTRL,
+       SIRFSOC_TIMER_64COUNTER_RLATCHED_LO,
+       SIRFSOC_TIMER_64COUNTER_RLATCHED_HI,
+};
+
+static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT];
+
+static void __iomem *sirfsoc_timer_base;
+static void __init sirfsoc_of_timer_map(void);
+
+/* disable count and interrupt */
+static inline void sirfsoc_timer_count_disable(int idx)
+{
+       writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) & ~0x7,
+               sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx);
+}
+
+/* enable count and interrupt */
+static inline void sirfsoc_timer_count_enable(int idx)
+{
+       writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx) | 0x7,
+               sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL + 4 * idx);
+}
+
+/* timer interrupt handler */
+static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id)
+{
+       struct clock_event_device *ce = dev_id;
+       int cpu = smp_processor_id();
+
+       /* clear timer interrupt */
+       writel_relaxed(BIT(cpu), sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS);
+
+       if (ce->mode == CLOCK_EVT_MODE_ONESHOT)
+               sirfsoc_timer_count_disable(cpu);
+
+       ce->event_handler(ce);
+
+       return IRQ_HANDLED;
+}
+
+/* read 64-bit timer counter */
+static cycle_t sirfsoc_timer_read(struct clocksource *cs)
+{
+       u64 cycles;
+
+       writel_relaxed((readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) |
+                       BIT(0)) & ~BIT(1), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
+
+       cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_HI);
+       cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_RLATCHED_LO);
+
+       return cycles;
+}
+
+static int sirfsoc_timer_set_next_event(unsigned long delta,
+       struct clock_event_device *ce)
+{
+       int cpu = smp_processor_id();
+
+       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0 +
+               4 * cpu);
+       writel_relaxed(delta, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0 +
+               4 * cpu);
+
+       /* enable the tick */
+       sirfsoc_timer_count_enable(cpu);
+
+       return 0;
+}
+
+static void sirfsoc_timer_set_mode(enum clock_event_mode mode,
+       struct clock_event_device *ce)
+{
+       switch (mode) {
+       case CLOCK_EVT_MODE_ONESHOT:
+               /* enable in set_next_event */
+               break;
+       default:
+               break;
+       }
+
+       sirfsoc_timer_count_disable(smp_processor_id());
+}
+
+static void sirfsoc_clocksource_suspend(struct clocksource *cs)
+{
+       int i;
+
+       for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++)
+               sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
+}
+
+static void sirfsoc_clocksource_resume(struct clocksource *cs)
+{
+       int i;
+
+       for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++)
+               writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
+
+       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2],
+               sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO);
+       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1],
+               sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI);
+
+       writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) |
+               BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
+}
+
+static struct clock_event_device sirfsoc_clockevent = {
+       .name = "sirfsoc_clockevent",
+       .rating = 200,
+       .features = CLOCK_EVT_FEAT_ONESHOT,
+       .set_mode = sirfsoc_timer_set_mode,
+       .set_next_event = sirfsoc_timer_set_next_event,
+};
+
+static struct clocksource sirfsoc_clocksource = {
+       .name = "sirfsoc_clocksource",
+       .rating = 200,
+       .mask = CLOCKSOURCE_MASK(64),
+       .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+       .read = sirfsoc_timer_read,
+       .suspend = sirfsoc_clocksource_suspend,
+       .resume = sirfsoc_clocksource_resume,
+};
+
+static struct irqaction sirfsoc_timer_irq = {
+       .name = "sirfsoc_timer0",
+       .flags = IRQF_TIMER | IRQF_NOBALANCING,
+       .handler = sirfsoc_timer_interrupt,
+       .dev_id = &sirfsoc_clockevent,
+};
+
+#ifdef CONFIG_LOCAL_TIMERS
+
+static struct irqaction sirfsoc_timer1_irq = {
+       .name = "sirfsoc_timer1",
+       .flags = IRQF_TIMER | IRQF_NOBALANCING,
+       .handler = sirfsoc_timer_interrupt,
+};
+
+static int __cpuinit sirfsoc_local_timer_setup(struct clock_event_device *ce)
+{
+       /* Use existing clock_event for cpu 0 */
+       if (!smp_processor_id())
+               return 0;
+
+       ce->irq = sirfsoc_timer1_irq.irq;
+       ce->name = "local_timer";
+       ce->features = sirfsoc_clockevent.features;
+       ce->rating = sirfsoc_clockevent.rating;
+       ce->set_mode = sirfsoc_timer_set_mode;
+       ce->set_next_event = sirfsoc_timer_set_next_event;
+       ce->shift = sirfsoc_clockevent.shift;
+       ce->mult = sirfsoc_clockevent.mult;
+       ce->max_delta_ns = sirfsoc_clockevent.max_delta_ns;
+       ce->min_delta_ns = sirfsoc_clockevent.min_delta_ns;
+
+       sirfsoc_timer1_irq.dev_id = ce;
+       BUG_ON(setup_irq(ce->irq, &sirfsoc_timer1_irq));
+       irq_set_affinity(sirfsoc_timer1_irq.irq, cpumask_of(1));
+
+       clockevents_register_device(ce);
+       return 0;
+}
+
+static void sirfsoc_local_timer_stop(struct clock_event_device *ce)
+{
+       sirfsoc_timer_count_disable(1);
+
+       remove_irq(sirfsoc_timer1_irq.irq, &sirfsoc_timer1_irq);
+}
+
+static struct local_timer_ops sirfsoc_local_timer_ops __cpuinitdata = {
+       .setup  = sirfsoc_local_timer_setup,
+       .stop   = sirfsoc_local_timer_stop,
+};
+#endif /* CONFIG_LOCAL_TIMERS */
+
+static void __init sirfsoc_clockevent_init(void)
+{
+       clockevents_calc_mult_shift(&sirfsoc_clockevent, CLOCK_TICK_RATE, 60);
+
+       sirfsoc_clockevent.max_delta_ns =
+               clockevent_delta2ns(-2, &sirfsoc_clockevent);
+       sirfsoc_clockevent.min_delta_ns =
+               clockevent_delta2ns(2, &sirfsoc_clockevent);
+
+       sirfsoc_clockevent.cpumask = cpumask_of(0);
+       clockevents_register_device(&sirfsoc_clockevent);
+#ifdef CONFIG_LOCAL_TIMERS
+       local_timer_register(&sirfsoc_local_timer_ops);
+#endif
+}
+
+/* initialize the kernel jiffy timer source */
+void __init sirfsoc_marco_timer_init(void)
+{
+       unsigned long rate;
+       u32 timer_div;
+       struct clk *clk;
+
+       /* initialize clocking early, we want to set the OS timer */
+       sirfsoc_of_clk_init();
+
+       /* timer's input clock is io clock */
+       clk = clk_get_sys("io", NULL);
+
+       BUG_ON(IS_ERR(clk));
+       rate = clk_get_rate(clk);
+
+       BUG_ON(rate < CLOCK_TICK_RATE);
+       BUG_ON(rate % CLOCK_TICK_RATE);
+
+       sirfsoc_of_timer_map();
+
+       /* Initialize the timer dividers */
+       timer_div = rate / CLOCK_TICK_RATE - 1;
+       writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
+       writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_0_CTRL);
+       writel_relaxed(timer_div << 16, sirfsoc_timer_base + SIRFSOC_TIMER_32COUNTER_1_CTRL);
+
+       /* Initialize timer counters to 0 */
+       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_LO);
+       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_LOAD_HI);
+       writel_relaxed(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL) |
+               BIT(1) | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_64COUNTER_CTRL);
+       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_0);
+       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_1);
+
+       /* Clear all interrupts */
+       writel_relaxed(0xFFFF, sirfsoc_timer_base + SIRFSOC_TIMER_INTR_STATUS);
+
+       BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
+
+       BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq));
+
+       sirfsoc_clockevent_init();
+}
+
+static struct of_device_id timer_ids[] = {
+       { .compatible = "sirf,marco-tick" },
+       {},
+};
+
+static void __init sirfsoc_of_timer_map(void)
+{
+       struct device_node *np;
+
+       np = of_find_matching_node(NULL, timer_ids);
+       if (!np)
+               return;
+       sirfsoc_timer_base = of_iomap(np, 0);
+       if (!sirfsoc_timer_base)
+               panic("unable to map timer cpu registers\n");
+
+       sirfsoc_timer_irq.irq = irq_of_parse_and_map(np, 0);
+       if (!sirfsoc_timer_irq.irq)
+               panic("No irq passed for timer0 via DT\n");
+
+#ifdef CONFIG_LOCAL_TIMERS
+       sirfsoc_timer1_irq.irq = irq_of_parse_and_map(np, 1);
+       if (!sirfsoc_timer1_irq.irq)
+               panic("No irq passed for timer1 via DT\n");
+#endif
+
+       of_node_put(np);
+}
diff --git a/arch/arm/mach-prima2/timer-prima2.c b/arch/arm/mach-prima2/timer-prima2.c
new file mode 100644 (file)
index 0000000..6da584f
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ * System timer for CSR SiRFprimaII
+ *
+ * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/kernel.h>
+#include <linux/interrupt.h>
+#include <linux/clockchips.h>
+#include <linux/clocksource.h>
+#include <linux/bitops.h>
+#include <linux/irq.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <mach/map.h>
+#include <asm/sched_clock.h>
+#include <asm/mach/time.h>
+
+#include "common.h"
+
+#define SIRFSOC_TIMER_COUNTER_LO       0x0000
+#define SIRFSOC_TIMER_COUNTER_HI       0x0004
+#define SIRFSOC_TIMER_MATCH_0          0x0008
+#define SIRFSOC_TIMER_MATCH_1          0x000C
+#define SIRFSOC_TIMER_MATCH_2          0x0010
+#define SIRFSOC_TIMER_MATCH_3          0x0014
+#define SIRFSOC_TIMER_MATCH_4          0x0018
+#define SIRFSOC_TIMER_MATCH_5          0x001C
+#define SIRFSOC_TIMER_STATUS           0x0020
+#define SIRFSOC_TIMER_INT_EN           0x0024
+#define SIRFSOC_TIMER_WATCHDOG_EN      0x0028
+#define SIRFSOC_TIMER_DIV              0x002C
+#define SIRFSOC_TIMER_LATCH            0x0030
+#define SIRFSOC_TIMER_LATCHED_LO       0x0034
+#define SIRFSOC_TIMER_LATCHED_HI       0x0038
+
+#define SIRFSOC_TIMER_WDT_INDEX                5
+
+#define SIRFSOC_TIMER_LATCH_BIT         BIT(0)
+
+#define SIRFSOC_TIMER_REG_CNT 11
+
+static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = {
+       SIRFSOC_TIMER_MATCH_0, SIRFSOC_TIMER_MATCH_1, SIRFSOC_TIMER_MATCH_2,
+       SIRFSOC_TIMER_MATCH_3, SIRFSOC_TIMER_MATCH_4, SIRFSOC_TIMER_MATCH_5,
+       SIRFSOC_TIMER_INT_EN, SIRFSOC_TIMER_WATCHDOG_EN, SIRFSOC_TIMER_DIV,
+       SIRFSOC_TIMER_LATCHED_LO, SIRFSOC_TIMER_LATCHED_HI,
+};
+
+static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT];
+
+static void __iomem *sirfsoc_timer_base;
+static void __init sirfsoc_of_timer_map(void);
+
+/* timer0 interrupt handler */
+static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id)
+{
+       struct clock_event_device *ce = dev_id;
+
+       WARN_ON(!(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_STATUS) & BIT(0)));
+
+       /* clear timer0 interrupt */
+       writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
+
+       ce->event_handler(ce);
+
+       return IRQ_HANDLED;
+}
+
+/* read 64-bit timer counter */
+static cycle_t sirfsoc_timer_read(struct clocksource *cs)
+{
+       u64 cycles;
+
+       /* latch the 64-bit timer counter */
+       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
+       cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_HI);
+       cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
+
+       return cycles;
+}
+
+static int sirfsoc_timer_set_next_event(unsigned long delta,
+       struct clock_event_device *ce)
+{
+       unsigned long now, next;
+
+       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
+       now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
+       next = now + delta;
+       writel_relaxed(next, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0);
+       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
+       now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
+
+       return next - now > delta ? -ETIME : 0;
+}
+
+static void sirfsoc_timer_set_mode(enum clock_event_mode mode,
+       struct clock_event_device *ce)
+{
+       u32 val = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
+       switch (mode) {
+       case CLOCK_EVT_MODE_PERIODIC:
+               WARN_ON(1);
+               break;
+       case CLOCK_EVT_MODE_ONESHOT:
+               writel_relaxed(val | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
+               break;
+       case CLOCK_EVT_MODE_SHUTDOWN:
+               writel_relaxed(val & ~BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
+               break;
+       case CLOCK_EVT_MODE_UNUSED:
+       case CLOCK_EVT_MODE_RESUME:
+               break;
+       }
+}
+
+static void sirfsoc_clocksource_suspend(struct clocksource *cs)
+{
+       int i;
+
+       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
+
+       for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++)
+               sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
+}
+
+static void sirfsoc_clocksource_resume(struct clocksource *cs)
+{
+       int i;
+
+       for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++)
+               writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
+
+       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO);
+       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
+}
+
+static struct clock_event_device sirfsoc_clockevent = {
+       .name = "sirfsoc_clockevent",
+       .rating = 200,
+       .features = CLOCK_EVT_FEAT_ONESHOT,
+       .set_mode = sirfsoc_timer_set_mode,
+       .set_next_event = sirfsoc_timer_set_next_event,
+};
+
+static struct clocksource sirfsoc_clocksource = {
+       .name = "sirfsoc_clocksource",
+       .rating = 200,
+       .mask = CLOCKSOURCE_MASK(64),
+       .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+       .read = sirfsoc_timer_read,
+       .suspend = sirfsoc_clocksource_suspend,
+       .resume = sirfsoc_clocksource_resume,
+};
+
+static struct irqaction sirfsoc_timer_irq = {
+       .name = "sirfsoc_timer0",
+       .flags = IRQF_TIMER,
+       .irq = 0,
+       .handler = sirfsoc_timer_interrupt,
+       .dev_id = &sirfsoc_clockevent,
+};
+
+/* Overwrite weak default sched_clock with more precise one */
+static u32 notrace sirfsoc_read_sched_clock(void)
+{
+       return (u32)(sirfsoc_timer_read(NULL) & 0xffffffff);
+}
+
+static void __init sirfsoc_clockevent_init(void)
+{
+       sirfsoc_clockevent.cpumask = cpumask_of(0);
+       clockevents_config_and_register(&sirfsoc_clockevent, CLOCK_TICK_RATE,
+                                       2, -2);
+}
+
+/* initialize the kernel jiffy timer source */
+void __init sirfsoc_prima2_timer_init(void)
+{
+       unsigned long rate;
+       struct clk *clk;
+
+       /* initialize clocking early, we want to set the OS timer */
+       sirfsoc_of_clk_init();
+
+       /* timer's input clock is io clock */
+       clk = clk_get_sys("io", NULL);
+
+       BUG_ON(IS_ERR(clk));
+
+       rate = clk_get_rate(clk);
+
+       BUG_ON(rate < CLOCK_TICK_RATE);
+       BUG_ON(rate % CLOCK_TICK_RATE);
+
+       sirfsoc_of_timer_map();
+
+       writel_relaxed(rate / CLOCK_TICK_RATE / 2 - 1, sirfsoc_timer_base + SIRFSOC_TIMER_DIV);
+       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO);
+       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
+       writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
+
+       BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
+
+       setup_sched_clock(sirfsoc_read_sched_clock, 32, CLOCK_TICK_RATE);
+
+       BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq));
+
+       sirfsoc_clockevent_init();
+}
+
+static struct of_device_id timer_ids[] = {
+       { .compatible = "sirf,prima2-tick" },
+       {},
+};
+
+static void __init sirfsoc_of_timer_map(void)
+{
+       struct device_node *np;
+       const unsigned int *intspec;
+
+       np = of_find_matching_node(NULL, timer_ids);
+       if (!np)
+               return;
+       sirfsoc_timer_base = of_iomap(np, 0);
+       if (!sirfsoc_timer_base)
+               panic("unable to map timer cpu registers\n");
+
+       /* Get the interrupts property */
+       intspec = of_get_property(np, "interrupts", NULL);
+       BUG_ON(!intspec);
+       sirfsoc_timer_irq.irq = be32_to_cpup(intspec);
+
+       of_node_put(np);
+}
diff --git a/arch/arm/mach-prima2/timer.c b/arch/arm/mach-prima2/timer.c
deleted file mode 100644 (file)
index d95bf25..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * System timer for CSR SiRFprimaII
- *
- * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
- *
- * Licensed under GPLv2 or later.
- */
-
-#include <linux/kernel.h>
-#include <linux/interrupt.h>
-#include <linux/clockchips.h>
-#include <linux/clocksource.h>
-#include <linux/bitops.h>
-#include <linux/irq.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <linux/slab.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <mach/map.h>
-#include <asm/sched_clock.h>
-#include <asm/mach/time.h>
-
-#include "common.h"
-
-#define SIRFSOC_TIMER_COUNTER_LO       0x0000
-#define SIRFSOC_TIMER_COUNTER_HI       0x0004
-#define SIRFSOC_TIMER_MATCH_0          0x0008
-#define SIRFSOC_TIMER_MATCH_1          0x000C
-#define SIRFSOC_TIMER_MATCH_2          0x0010
-#define SIRFSOC_TIMER_MATCH_3          0x0014
-#define SIRFSOC_TIMER_MATCH_4          0x0018
-#define SIRFSOC_TIMER_MATCH_5          0x001C
-#define SIRFSOC_TIMER_STATUS           0x0020
-#define SIRFSOC_TIMER_INT_EN           0x0024
-#define SIRFSOC_TIMER_WATCHDOG_EN      0x0028
-#define SIRFSOC_TIMER_DIV              0x002C
-#define SIRFSOC_TIMER_LATCH            0x0030
-#define SIRFSOC_TIMER_LATCHED_LO       0x0034
-#define SIRFSOC_TIMER_LATCHED_HI       0x0038
-
-#define SIRFSOC_TIMER_WDT_INDEX                5
-
-#define SIRFSOC_TIMER_LATCH_BIT         BIT(0)
-
-#define SIRFSOC_TIMER_REG_CNT 11
-
-static const u32 sirfsoc_timer_reg_list[SIRFSOC_TIMER_REG_CNT] = {
-       SIRFSOC_TIMER_MATCH_0, SIRFSOC_TIMER_MATCH_1, SIRFSOC_TIMER_MATCH_2,
-       SIRFSOC_TIMER_MATCH_3, SIRFSOC_TIMER_MATCH_4, SIRFSOC_TIMER_MATCH_5,
-       SIRFSOC_TIMER_INT_EN, SIRFSOC_TIMER_WATCHDOG_EN, SIRFSOC_TIMER_DIV,
-       SIRFSOC_TIMER_LATCHED_LO, SIRFSOC_TIMER_LATCHED_HI,
-};
-
-static u32 sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT];
-
-static void __iomem *sirfsoc_timer_base;
-static void __init sirfsoc_of_timer_map(void);
-
-/* timer0 interrupt handler */
-static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id)
-{
-       struct clock_event_device *ce = dev_id;
-
-       WARN_ON(!(readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_STATUS) & BIT(0)));
-
-       /* clear timer0 interrupt */
-       writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
-
-       ce->event_handler(ce);
-
-       return IRQ_HANDLED;
-}
-
-/* read 64-bit timer counter */
-static cycle_t sirfsoc_timer_read(struct clocksource *cs)
-{
-       u64 cycles;
-
-       /* latch the 64-bit timer counter */
-       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
-       cycles = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_HI);
-       cycles = (cycles << 32) | readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
-
-       return cycles;
-}
-
-static int sirfsoc_timer_set_next_event(unsigned long delta,
-       struct clock_event_device *ce)
-{
-       unsigned long now, next;
-
-       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
-       now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
-       next = now + delta;
-       writel_relaxed(next, sirfsoc_timer_base + SIRFSOC_TIMER_MATCH_0);
-       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
-       now = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_LATCHED_LO);
-
-       return next - now > delta ? -ETIME : 0;
-}
-
-static void sirfsoc_timer_set_mode(enum clock_event_mode mode,
-       struct clock_event_device *ce)
-{
-       u32 val = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
-       switch (mode) {
-       case CLOCK_EVT_MODE_PERIODIC:
-               WARN_ON(1);
-               break;
-       case CLOCK_EVT_MODE_ONESHOT:
-               writel_relaxed(val | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
-               break;
-       case CLOCK_EVT_MODE_SHUTDOWN:
-               writel_relaxed(val & ~BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
-               break;
-       case CLOCK_EVT_MODE_UNUSED:
-       case CLOCK_EVT_MODE_RESUME:
-               break;
-       }
-}
-
-static void sirfsoc_clocksource_suspend(struct clocksource *cs)
-{
-       int i;
-
-       writel_relaxed(SIRFSOC_TIMER_LATCH_BIT, sirfsoc_timer_base + SIRFSOC_TIMER_LATCH);
-
-       for (i = 0; i < SIRFSOC_TIMER_REG_CNT; i++)
-               sirfsoc_timer_reg_val[i] = readl_relaxed(sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
-}
-
-static void sirfsoc_clocksource_resume(struct clocksource *cs)
-{
-       int i;
-
-       for (i = 0; i < SIRFSOC_TIMER_REG_CNT - 2; i++)
-               writel_relaxed(sirfsoc_timer_reg_val[i], sirfsoc_timer_base + sirfsoc_timer_reg_list[i]);
-
-       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 2], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO);
-       writel_relaxed(sirfsoc_timer_reg_val[SIRFSOC_TIMER_REG_CNT - 1], sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
-}
-
-static struct clock_event_device sirfsoc_clockevent = {
-       .name = "sirfsoc_clockevent",
-       .rating = 200,
-       .features = CLOCK_EVT_FEAT_ONESHOT,
-       .set_mode = sirfsoc_timer_set_mode,
-       .set_next_event = sirfsoc_timer_set_next_event,
-};
-
-static struct clocksource sirfsoc_clocksource = {
-       .name = "sirfsoc_clocksource",
-       .rating = 200,
-       .mask = CLOCKSOURCE_MASK(64),
-       .flags = CLOCK_SOURCE_IS_CONTINUOUS,
-       .read = sirfsoc_timer_read,
-       .suspend = sirfsoc_clocksource_suspend,
-       .resume = sirfsoc_clocksource_resume,
-};
-
-static struct irqaction sirfsoc_timer_irq = {
-       .name = "sirfsoc_timer0",
-       .flags = IRQF_TIMER,
-       .irq = 0,
-       .handler = sirfsoc_timer_interrupt,
-       .dev_id = &sirfsoc_clockevent,
-};
-
-/* Overwrite weak default sched_clock with more precise one */
-static u32 notrace sirfsoc_read_sched_clock(void)
-{
-       return (u32)(sirfsoc_timer_read(NULL) & 0xffffffff);
-}
-
-static void __init sirfsoc_clockevent_init(void)
-{
-       clockevents_calc_mult_shift(&sirfsoc_clockevent, CLOCK_TICK_RATE, 60);
-
-       sirfsoc_clockevent.max_delta_ns =
-               clockevent_delta2ns(-2, &sirfsoc_clockevent);
-       sirfsoc_clockevent.min_delta_ns =
-               clockevent_delta2ns(2, &sirfsoc_clockevent);
-
-       sirfsoc_clockevent.cpumask = cpumask_of(0);
-       clockevents_register_device(&sirfsoc_clockevent);
-}
-
-/* initialize the kernel jiffy timer source */
-static void __init sirfsoc_timer_init(void)
-{
-       unsigned long rate;
-       struct clk *clk;
-
-       /* initialize clocking early, we want to set the OS timer */
-       sirfsoc_of_clk_init();
-
-       /* timer's input clock is io clock */
-       clk = clk_get_sys("io", NULL);
-
-       BUG_ON(IS_ERR(clk));
-
-       rate = clk_get_rate(clk);
-
-       BUG_ON(rate < CLOCK_TICK_RATE);
-       BUG_ON(rate % CLOCK_TICK_RATE);
-
-       sirfsoc_of_timer_map();
-
-       writel_relaxed(rate / CLOCK_TICK_RATE / 2 - 1, sirfsoc_timer_base + SIRFSOC_TIMER_DIV);
-       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_LO);
-       writel_relaxed(0, sirfsoc_timer_base + SIRFSOC_TIMER_COUNTER_HI);
-       writel_relaxed(BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_STATUS);
-
-       BUG_ON(clocksource_register_hz(&sirfsoc_clocksource, CLOCK_TICK_RATE));
-
-       setup_sched_clock(sirfsoc_read_sched_clock, 32, CLOCK_TICK_RATE);
-
-       BUG_ON(setup_irq(sirfsoc_timer_irq.irq, &sirfsoc_timer_irq));
-
-       sirfsoc_clockevent_init();
-}
-
-static struct of_device_id timer_ids[] = {
-       { .compatible = "sirf,prima2-tick" },
-       {},
-};
-
-static void __init sirfsoc_of_timer_map(void)
-{
-       struct device_node *np;
-       const unsigned int *intspec;
-
-       np = of_find_matching_node(NULL, timer_ids);
-       if (!np)
-               panic("unable to find compatible timer node in dtb\n");
-       sirfsoc_timer_base = of_iomap(np, 0);
-       if (!sirfsoc_timer_base)
-               panic("unable to map timer cpu registers\n");
-
-       /* Get the interrupts property */
-       intspec = of_get_property(np, "interrupts", NULL);
-       BUG_ON(!intspec);
-       sirfsoc_timer_irq.irq = be32_to_cpup(intspec);
-
-       of_node_put(np);
-}
-
-struct sys_timer sirfsoc_timer = {
-       .init = sirfsoc_timer_init,
-};
index 20822934251400437fe58738d1565aa795f44504..2f71b3fbd319d1bdd70749ef52963c284c498ed0 100644 (file)
@@ -822,7 +822,7 @@ MACHINE_START(BALLOON3, "Balloon3")
        .nr_irqs        = BALLOON3_NR_IRQS,
        .init_irq       = balloon3_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = balloon3_init,
        .atag_offset    = 0x100,
        .restart        = pxa_restart,
index 9a8760b729132a5055880858d1aab1b0cdc90eda..c092730749b9d13228bad861535b2fa98804ac84 100644 (file)
@@ -153,7 +153,7 @@ MACHINE_START(CAPC7117,
        .nr_irqs = PXA_NR_IRQS,
        .init_irq = pxa3xx_init_irq,
        .handle_irq = pxa3xx_handle_irq,
-       .timer = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine = capc7117_init,
        .restart        = pxa_restart,
 MACHINE_END
index a103c8ffea9f179eeb9083c2b91721ae255e8252..bb99f59a36d880f8879824af44b67c924078b283 100644 (file)
@@ -520,7 +520,7 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX")
        .init_irq       = cmx2xx_init_irq,
        /* NOTE: pxa25x_handle_irq() works on PXA27x w/o camera support */
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = cmx2xx_init,
 #ifdef CONFIG_PCI
        .dma_zone_size  = SZ_64M,
index cc2b23afcaaf6562c6e39586e4f0438184fdecd6..8091aac89edf030639760b6e36d0eff48bb60c4c 100644 (file)
@@ -854,7 +854,7 @@ MACHINE_START(CM_X300, "CM-X300 module")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = cm_x300_init,
        .fixup          = cm_x300_fixup,
        .restart        = pxa_restart,
index b2f227d361250e738c1f0b5a1d685b1ae9e44271..5f9d9303b346d6c381132a9f8b5664200ed6c6ed 100644 (file)
@@ -313,7 +313,7 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 
@@ -324,7 +324,7 @@ MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 
index a9c9c163dd953ab3f9728bf02af698961c283da4..f1a1ac1fbd85663b05fb0ffb3f4bd224277d88e4 100644 (file)
@@ -189,7 +189,7 @@ MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 
index 25515cd7e68f30b4a28ea86259872d776d04c815..f6cc8b0ab82f5dc0e6f223b860f2c9c45a0dcd8c 100644 (file)
@@ -259,7 +259,7 @@ MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 
index 7c83f52c549cbd232b6bc84f4a98255cc7cad8b0..a5b8fead7d61393a8ba9b55c91d074329b7f6010 100644 (file)
@@ -733,7 +733,7 @@ MACHINE_START(CORGI, "SHARP Corgi")
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = corgi_restart,
 MACHINE_END
 #endif
@@ -746,7 +746,7 @@ MACHINE_START(SHEPHERD, "SHARP Shepherd")
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = corgi_restart,
 MACHINE_END
 #endif
@@ -759,7 +759,7 @@ MACHINE_START(HUSKY, "SHARP Husky")
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = corgi_restart,
 MACHINE_END
 #endif
index 7039f44b364790b5b38241c0dfab2249509fb5f8..fadfff8feaef46b442b3b3cda0c5dd9be5303420 100644 (file)
@@ -278,6 +278,6 @@ MACHINE_START(CSB726, "Cogent CSB726")
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
        .init_machine   = csb726_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
index 1b6411439ec882ca57173e7e02452d9c1661d73c..446563a7d1ada5c7654bfc6761f58eacb37caca0 100644 (file)
@@ -1298,7 +1298,7 @@ MACHINE_START(EM_X270, "Compulab EM-X270")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = em_x270_init,
        .restart        = pxa_restart,
 MACHINE_END
@@ -1309,7 +1309,7 @@ MACHINE_START(EXEDA, "Compulab eXeda")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = em_x270_init,
        .restart        = pxa_restart,
 MACHINE_END
index be2ee9bf5c6ec11258969e28f72a355e6074eadd..8280ebcaab9f756edc62d6665080859283fd8653 100644 (file)
@@ -195,7 +195,7 @@ MACHINE_START(E330, "Toshiba e330")
        .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e330_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
@@ -246,7 +246,7 @@ MACHINE_START(E350, "Toshiba e350")
        .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e350_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
@@ -370,7 +370,7 @@ MACHINE_START(E400, "Toshiba e400")
        .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e400_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
@@ -566,7 +566,7 @@ MACHINE_START(E740, "Toshiba e740")
        .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e740_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
@@ -765,7 +765,7 @@ MACHINE_START(E750, "Toshiba e750")
        .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e750_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
@@ -977,7 +977,7 @@ MACHINE_START(E800, "Toshiba e800")
        .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e800_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
index dc58fa0edb6674b4f0f58ba7b28af06739296fcc..dca10709be8f41db70bcd173b02e94a4d91f5d42 100644 (file)
@@ -802,7 +802,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780")
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = a780_init,
        .restart        = pxa_restart,
 MACHINE_END
@@ -869,7 +869,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680")
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = e680_init,
        .restart        = pxa_restart,
 MACHINE_END
@@ -936,7 +936,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200")
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = a1200_init,
        .restart        = pxa_restart,
 MACHINE_END
@@ -1128,7 +1128,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910")
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = a910_init,
        .restart        = pxa_restart,
 MACHINE_END
@@ -1195,7 +1195,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6")
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = e6_init,
        .restart        = pxa_restart,
 MACHINE_END
@@ -1236,7 +1236,7 @@ MACHINE_START(EZX_E2, "Motorola EZX E2")
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = e2_init,
        .restart        = pxa_restart,
 MACHINE_END
index 42d5cca66257bd1be97cb0c0b37c8569476d0795..fd7ea39b78c03c4dd5e4124ce33294c0ef6d4bea 100644 (file)
@@ -10,9 +10,8 @@
  */
 
 struct irq_data;
-struct sys_timer;
 
-extern struct sys_timer pxa_timer;
+extern void pxa_timer_init(void);
 
 extern void __init pxa_map_io(void);
 
index 60755a6bb1c67434ad42169316ab5c2cacb3ad1f..00b92dad7b8163b4f0d11203a127ebfb97b97021 100644 (file)
@@ -238,7 +238,7 @@ MACHINE_START(GUMSTIX, "Gumstix")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = gumstix_init,
        .restart        = pxa_restart,
 MACHINE_END
index e7dec589f0141704587051c16e3cdbb65388de5b..875ec3351499567c81aa581f00f4ebc6fd899943 100644 (file)
@@ -208,7 +208,7 @@ MACHINE_START(H5400, "HP iPAQ H5000")
        .nr_irqs = PXA_NR_IRQS,
        .init_irq = pxa25x_init_irq,
        .handle_irq = pxa25x_handle_irq,
-       .timer = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine = h5000_init,
        .restart        = pxa_restart,
 MACHINE_END
index 2962de898da9eefb0c1e35649e18468642b2abe4..7a8d749a07b8519e1ca9480a53031f53aa6eecc1 100644 (file)
@@ -164,6 +164,6 @@ MACHINE_START(HIMALAYA, "HTC Himalaya")
        .init_irq = pxa25x_init_irq,
        .handle_irq = pxa25x_handle_irq,
        .init_machine = himalaya_init,
-       .timer = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
index e2c6391863fedd9b008d594c516eea1f55936e64..133109ec7332b23d1c412509f66a31f52aaaa412 100644 (file)
@@ -900,6 +900,6 @@ MACHINE_START(H4700, "HP iPAQ HX4700")
        .init_irq     = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .init_machine = hx4700_init,
-       .timer        = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
index 1d02eabc9c654bb18751a9b802c2f3cdbc8c83a5..fe31bfcbb8dfb6b8c3112c7fe7ce65442a178b26 100644 (file)
@@ -196,7 +196,7 @@ MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = icontrol_init,
        .restart        = pxa_restart,
 MACHINE_END
index 64507cdd2e8f223a0597ce7bc9f5bbc0f1cc735a..343c4e3a7c5d1aceb136a196dcae946a7c8f5a69 100644 (file)
@@ -279,7 +279,7 @@ MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = idp_init,
        .restart        = pxa_restart,
 MACHINE_END
index 402874f9021fce45718de8d8efb4bd20a40af1e1..e848c4607bafa48c8b62ad37052f7937e4e03b08 100644 (file)
@@ -443,7 +443,7 @@ MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleto
        .nr_irqs        = LITTLETON_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = littleton_init,
        .restart        = pxa_restart,
 MACHINE_END
index 1a63eaa89867b4403212fbe7d928a85afff7e0b1..1255ee00f3d1d7c1f80f9cd0b2a28936c47353ad 100644 (file)
@@ -503,7 +503,7 @@ MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
        .nr_irqs        = LPD270_NR_IRQS,
        .init_irq       = lpd270_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = lpd270_init,
        .restart        = pxa_restart,
 MACHINE_END
index 553056d9a3c562fd48b60ff6f6f74c32ec50422f..d8a1be619f21c7578bbde5fa37d00907fa80e353 100644 (file)
@@ -650,7 +650,7 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
        .nr_irqs        = LUBBOCK_NR_IRQS,
        .init_irq       = lubbock_init_irq,
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = lubbock_init,
        .restart        = pxa_restart,
 MACHINE_END
index f7922404d941f6b81c17a4ce5b3bb1cceb7084db..f44532fc648b1982ded0d249a18005b84647767d 100644 (file)
@@ -774,6 +774,6 @@ MACHINE_START(MAGICIAN, "HTC Magician")
        .init_irq = pxa27x_init_irq,
        .handle_irq = pxa27x_handle_irq,
        .init_machine = magician_init,
-       .timer = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
index f27a61ee7ac719767d0b8455be1afecf7e1462de..7a12c1ba90ff76b02fde8c4474d6d2b42d76b70a 100644 (file)
@@ -714,7 +714,7 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
        .nr_irqs        = MAINSTONE_NR_IRQS,
        .init_irq       = mainstone_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = mainstone_init,
        .restart        = pxa_restart,
 MACHINE_END
index 2831308dba68782bdc9eb98255bf72db44d5feb4..f8979b943cbfa628d03aa56e9bdb90a7208162fa 100644 (file)
@@ -762,6 +762,6 @@ MACHINE_START(MIOA701, "MIO A701")
        .init_irq       = &pxa27x_init_irq,
        .handle_irq     = &pxa27x_handle_irq,
        .init_machine   = mioa701_machine_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = mioa701_restart,
 MACHINE_END
index 152efbf093f6b1f08eb2f18a2e2707688bb2a475..854f1f562d6b34590aac4d587a212cf4cf06829f 100644 (file)
@@ -93,7 +93,7 @@ static void __init mp900c_init(void)
 /* Maintainer - Michael Petchkovsky <mkpetch@internode.on.net> */
 MACHINE_START(NEC_MP900, "MobilePro900/C")
        .atag_offset    = 0x220100,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .map_io         = pxa25x_map_io,
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
index 8bcc96e3b0db1fed267ded1a3bf6237a8b2a5bfd..909b713e578985444264e71d6bdd9f9e1e26a445 100644 (file)
@@ -347,7 +347,7 @@ MACHINE_START(PALMLD, "Palm LifeDrive")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = palmld_init,
        .restart        = pxa_restart,
 MACHINE_END
index 5ca7b904a30e0192ab3575149b37132b6ca49ddc..5033fd07968f5cf92d39da046727ca37a9ca1352 100644 (file)
@@ -208,7 +208,7 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = palmt5_init,
        .restart        = pxa_restart,
 MACHINE_END
index ca924cfedfc0071e02134723faa3abc925e677be..100b176f7e882aaa2ba5047fefc19eb44d514394 100644 (file)
@@ -542,7 +542,7 @@ MACHINE_START(PALMTC, "Palm Tungsten|C")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = palmtc_init,
        .restart        = pxa_restart,
 MACHINE_END
index 32e0d79983551858947b9e5eb7c8897dd86c154f..0742721ced2da7eebf983026f288265e039e139f 100644 (file)
@@ -363,7 +363,7 @@ MACHINE_START(PALMTE2, "Palm Tungsten|E2")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = palmte2_init,
        .restart        = pxa_restart,
 MACHINE_END
index 3f3c48f2f7ceabd5f256169b5cc56d62524c40f4..d17bda278782cb0156e1b222a7104b6763473c63 100644 (file)
@@ -451,7 +451,7 @@ MACHINE_START(TREO680, "Palm Treo 680")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = treo680_init,
        .restart        = pxa_restart,
 MACHINE_END
@@ -465,7 +465,7 @@ MACHINE_START(CENTRO, "Palm Centro 685")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq       = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = centro_init,
        .restart        = pxa_restart,
 MACHINE_END
index 8b4366628a127f44caf66e1fa81cbacc82a3224c..627c93a7364c186164ee4bdf9b872a038b1d12ba 100644 (file)
@@ -366,7 +366,7 @@ MACHINE_START(PALMTX, "Palm T|X")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = palmtx_init,
        .restart        = pxa_restart,
 MACHINE_END
index 8cdd4f58e2537e499ef4481429be281c7f6a288d..18b7fcd98592669114ce121229783d5193a4bc58 100644 (file)
@@ -404,7 +404,7 @@ MACHINE_START(PALMZ72, "Palm Zire72")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = palmz72_init,
        .restart        = pxa_restart,
 MACHINE_END
index fe9054435b6f214c63b700fe61967d0ec2d32987..69918c7e3f1fa6eaf8963e2c71d597d6e01021af 100644 (file)
@@ -263,7 +263,7 @@ MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
        .nr_irqs        = PCM027_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = pcm027_init,
        .restart        = pxa_restart,
 MACHINE_END
index 2910bb935c754472e5907955c9df946e848fe817..50ccd5f1d560b6f93675c792631d73b77a4a9851 100644 (file)
@@ -469,7 +469,7 @@ MACHINE_START(POODLE, "SHARP Poodle")
        .nr_irqs        = POODLE_NR_IRQS,       /* 4 for LoCoMo */
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = poodle_init,
        .restart        = pxa_restart,
 MACHINE_END
index c9192cea0033aae7f3724616f321876228876e06..3835979a0dd396ab8ecea56147d2386bf5c64561 100644 (file)
@@ -55,7 +55,7 @@ DT_MACHINE_START(PXA_DT, "Marvell PXA3xx (Device Tree Support)")
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_dt_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
        .init_machine   = pxa3xx_dt_init,
        .dt_compat      = pxa3xx_dt_board_compat,
index 25b08bfa997b92d7492a71ef0302f166b4b242e4..af41888acbd674db746f194475b4ad077150b070 100644 (file)
@@ -1095,7 +1095,7 @@ MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
@@ -1108,7 +1108,7 @@ MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
@@ -1121,7 +1121,7 @@ MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 #endif
index 08d87a5d26392772e0b1b92039fb2bbf6008ce46..710c493eac89ea452fdfb65de6eb09a910f2259a 100644 (file)
@@ -601,7 +601,7 @@ MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq       = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = saar_init,
        .restart        = pxa_restart,
 MACHINE_END
index 2073f0e6db0d22e87659a435ea4510469a610b65..f90aa27ad599a8bce347c298ed0b2a7827a201b2 100644 (file)
@@ -986,7 +986,7 @@ MACHINE_START(SPITZ, "SHARP Spitz")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = spitz_restart,
 MACHINE_END
 #endif
@@ -1000,7 +1000,7 @@ MACHINE_START(BORZOI, "SHARP Borzoi")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = spitz_restart,
 MACHINE_END
 #endif
@@ -1014,7 +1014,7 @@ MACHINE_START(AKITA, "SHARP Akita")
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = spitz_restart,
 MACHINE_END
 #endif
index 456560b5aad48b2a738127fb163d0e01d6c805ce..88fde43c948c740a1bccd8f2520d4d3a8dc63f98 100644 (file)
@@ -1006,7 +1006,7 @@ MACHINE_START(INTELMOTE2, "IMOTE 2")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = imote2_init,
        .atag_offset    = 0x100,
        .restart        = pxa_restart,
@@ -1019,7 +1019,7 @@ MACHINE_START(STARGATE2, "Stargate 2")
        .nr_irqs = STARGATE_NR_IRQS,
        .init_irq = pxa27x_init_irq,
        .handle_irq = pxa27x_handle_irq,
-       .timer = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine = stargate2_init,
        .atag_offset = 0x100,
        .restart        = pxa_restart,
index 1a25f8a7b0ceb453358a7b43729f1bb215e63947..f55979c09a5fb506984168a39dc1ce6f53aa506d 100644 (file)
@@ -494,7 +494,7 @@ MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq       = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = tavorevb_init,
        .restart        = pxa_restart,
 MACHINE_END
index 4bc47d63698bc9590bba680177f823d052d0f099..8f1ee92aea306eb2c46ad8a552990945d34c65ef 100644 (file)
@@ -89,48 +89,10 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
        }
 }
 
-static struct clock_event_device ckevt_pxa_osmr0 = {
-       .name           = "osmr0",
-       .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .rating         = 200,
-       .set_next_event = pxa_osmr0_set_next_event,
-       .set_mode       = pxa_osmr0_set_mode,
-};
-
-static struct irqaction pxa_ost0_irq = {
-       .name           = "ost0",
-       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = pxa_ost0_interrupt,
-       .dev_id         = &ckevt_pxa_osmr0,
-};
-
-static void __init pxa_timer_init(void)
-{
-       unsigned long clock_tick_rate = get_clock_tick_rate();
-
-       writel_relaxed(0, OIER);
-       writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
-
-       setup_sched_clock(pxa_read_sched_clock, 32, clock_tick_rate);
-
-       clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4);
-       ckevt_pxa_osmr0.max_delta_ns =
-               clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0);
-       ckevt_pxa_osmr0.min_delta_ns =
-               clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1;
-       ckevt_pxa_osmr0.cpumask = cpumask_of(0);
-
-       setup_irq(IRQ_OST0, &pxa_ost0_irq);
-
-       clocksource_mmio_init(OSCR, "oscr0", clock_tick_rate, 200, 32,
-               clocksource_mmio_readl_up);
-       clockevents_register_device(&ckevt_pxa_osmr0);
-}
-
 #ifdef CONFIG_PM
 static unsigned long osmr[4], oier, oscr;
 
-static void pxa_timer_suspend(void)
+static void pxa_timer_suspend(struct clock_event_device *cedev)
 {
        osmr[0] = readl_relaxed(OSMR0);
        osmr[1] = readl_relaxed(OSMR1);
@@ -140,7 +102,7 @@ static void pxa_timer_suspend(void)
        oscr = readl_relaxed(OSCR);
 }
 
-static void pxa_timer_resume(void)
+static void pxa_timer_resume(struct clock_event_device *cedev)
 {
        /*
         * Ensure that we have at least MIN_OSCR_DELTA between match
@@ -163,8 +125,38 @@ static void pxa_timer_resume(void)
 #define pxa_timer_resume NULL
 #endif
 
-struct sys_timer pxa_timer = {
-       .init           = pxa_timer_init,
+static struct clock_event_device ckevt_pxa_osmr0 = {
+       .name           = "osmr0",
+       .features       = CLOCK_EVT_FEAT_ONESHOT,
+       .rating         = 200,
+       .set_next_event = pxa_osmr0_set_next_event,
+       .set_mode       = pxa_osmr0_set_mode,
        .suspend        = pxa_timer_suspend,
        .resume         = pxa_timer_resume,
 };
+
+static struct irqaction pxa_ost0_irq = {
+       .name           = "ost0",
+       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+       .handler        = pxa_ost0_interrupt,
+       .dev_id         = &ckevt_pxa_osmr0,
+};
+
+void __init pxa_timer_init(void)
+{
+       unsigned long clock_tick_rate = get_clock_tick_rate();
+
+       writel_relaxed(0, OIER);
+       writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
+
+       setup_sched_clock(pxa_read_sched_clock, 32, clock_tick_rate);
+
+       ckevt_pxa_osmr0.cpumask = cpumask_of(0);
+
+       setup_irq(IRQ_OST0, &pxa_ost0_irq);
+
+       clocksource_mmio_init(OSCR, "oscr0", clock_tick_rate, 200, 32,
+               clocksource_mmio_readl_up);
+       clockevents_config_and_register(&ckevt_pxa_osmr0, clock_tick_rate,
+               MIN_OSCR_DELTA * 2, 0x7fffffff);
+}
index 233629edf7ee249dda05670f19553ab26ed0184b..9e7998d3635f327b2aa034188e89020c10430262 100644 (file)
@@ -982,6 +982,6 @@ MACHINE_START(TOSA, "SHARP Tosa")
        .init_irq       = pxa25x_init_irq,
        .handle_irq       = pxa25x_handle_irq,
        .init_machine   = tosa_init,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = tosa_restart,
 MACHINE_END
index fbbcbed4d1d4bf9871b6af12dcc6027b89e93672..c58043462acddc932ce7b1728488aa1eb290f361 100644 (file)
@@ -561,7 +561,7 @@ MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 
@@ -573,6 +573,6 @@ MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
index c773e4dded64d3be4803b1ac03d850e6ee07cde6..9c363c081d3facb3be9ebe8693b32c2db9702bbc 100644 (file)
@@ -997,7 +997,7 @@ MACHINE_START(VIPER, "Arcom/Eurotech VIPER SBC")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = viper_init_irq,
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = viper_init,
        .restart        = pxa_restart,
 MACHINE_END
index 491b6c9a2a9b40a4649d3f885d69e9043722554a..aa89488f961ecfe9a1ae2cd27083b0284102987c 100644 (file)
@@ -719,7 +719,7 @@ MACHINE_START(VPAC270, "Voipac PXA270")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = vpac270_init,
        .restart        = pxa_restart,
 MACHINE_END
index 4275713ccd1045e4410c9efb0ac10323e0ed9f79..13b1d4586d7dedc7cee9d2754550a6d6eff28baf 100644 (file)
@@ -185,7 +185,7 @@ MACHINE_START(XCEP, "Iskratel XCEP")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .handle_irq     = pxa25x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .restart        = pxa_restart,
 MACHINE_END
 
index 97529face7aa14c7ba802f230365ef57d99649dd..989903a7e467c2451a2594970c87492046f723d4 100644 (file)
@@ -722,7 +722,7 @@ MACHINE_START(ZIPIT2, "Zipit Z2")
        .nr_irqs        = PXA_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = z2_init,
        .restart        = pxa_restart,
 MACHINE_END
index abd3aa1450830582770a99610bc9a83e5e906725..f5d4364345661ee0fc620653a72305beb539fc44 100644 (file)
@@ -910,7 +910,7 @@ MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
        .nr_irqs        = ZEUS_NR_IRQS,
        .init_irq       = zeus_init_irq,
        .handle_irq     = pxa27x_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = zeus_init,
        .restart        = pxa_restart,
 MACHINE_END
index 226279fac9d426cbf0d87f4500d0e8de4531ea21..1f00d650ac27088f836473237aaee1113b446cca 100644 (file)
@@ -428,7 +428,7 @@ MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
        .nr_irqs        = ZYLONITE_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
-       .timer          = &pxa_timer,
+       .init_time      = pxa_timer_init,
        .init_machine   = zylonite_init,
        .restart        = pxa_restart,
 MACHINE_END
index 68246748058880512fd34888bae0445fa4c2f202..1d5ee5c9a1dcd36624ab2c29d0a7111e7a3e1bdc 100644 (file)
@@ -42,7 +42,6 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 
-#include <asm/hardware/gic.h>
 
 #include <mach/platform.h>
 #include <mach/irqs.h>
index 300f7064465dce7cee01fb6a0dc70d76658fd8a6..98e3052b793322134509ccea9978e31f94ab62b7 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/smp_scu.h>
 
@@ -59,8 +58,6 @@ static void __init realview_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
index 28511d43637a28401e5f690b778496e27c2978f7..5b1c8bfe6fa938e9c5413c4c556bad17db4cfe31 100644 (file)
 #include <linux/amba/mmci.h>
 #include <linux/amba/pl022.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/clk-realview.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 #include <asm/pgtable.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/smp_twd.h>
 
@@ -418,10 +418,6 @@ static void __init realview_eb_timer_init(void)
        realview_eb_twd_init();
 }
 
-static struct sys_timer realview_eb_timer = {
-       .init           = realview_eb_timer_init,
-};
-
 static void realview_eb_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
@@ -472,8 +468,7 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
        .map_io         = realview_eb_map_io,
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
-       .timer          = &realview_eb_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = realview_eb_timer_init,
        .init_machine   = realview_eb_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
index 07d6672ddae70e77776d12d042db72f20e03569c..d5e83a1f6982bc2251c28be72f1c1836a8891e7e 100644 (file)
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/partitions.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/clk-realview.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 #include <asm/pgtable.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 
 #include <asm/mach/arch.h>
@@ -329,10 +329,6 @@ static void __init realview_pb1176_timer_init(void)
        realview_timer_init(IRQ_DC1176_TIMER0);
 }
 
-static struct sys_timer realview_pb1176_timer = {
-       .init           = realview_pb1176_timer_init,
-};
-
 static void realview_pb1176_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
@@ -384,8 +380,7 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
        .map_io         = realview_pb1176_map_io,
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
-       .timer          = &realview_pb1176_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = realview_pb1176_timer_init,
        .init_machine   = realview_pb1176_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
index 7ed53d75350fd294968a013b992df70f020fcd89..c3cfe213b5e66c2bf55294c389b98e0408423995 100644 (file)
 #include <linux/amba/mmci.h>
 #include <linux/amba/pl022.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/clk-realview.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 #include <asm/pgtable.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/smp_twd.h>
 
@@ -316,10 +316,6 @@ static void __init realview_pb11mp_timer_init(void)
        realview_pb11mp_twd_init();
 }
 
-static struct sys_timer realview_pb11mp_timer = {
-       .init           = realview_pb11mp_timer_init,
-};
-
 static void realview_pb11mp_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
@@ -367,8 +363,7 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
        .map_io         = realview_pb11mp_map_io,
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
-       .timer          = &realview_pb11mp_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = realview_pb11mp_timer_init,
        .init_machine   = realview_pb11mp_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
index 9992431b8a15121e6a5b56c5727d234f4ab6be5d..dde652a596202a80a35d11300c1343d4dbdf26e9 100644 (file)
 #include <linux/amba/mmci.h>
 #include <linux/amba/pl022.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/clk-realview.h>
 
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 #include <asm/pgtable.h>
-#include <asm/hardware/gic.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -264,10 +264,6 @@ static void __init realview_pba8_timer_init(void)
        realview_timer_init(IRQ_PBA8_TIMER0_1);
 }
 
-static struct sys_timer realview_pba8_timer = {
-       .init           = realview_pba8_timer_init,
-};
-
 static void realview_pba8_restart(char mode, const char *cmd)
 {
        void __iomem *reset_ctrl = __io_address(REALVIEW_SYS_RESETCTL);
@@ -308,8 +304,7 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
        .map_io         = realview_pba8_map_io,
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
-       .timer          = &realview_pba8_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = realview_pba8_timer_init,
        .init_machine   = realview_pba8_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
index 4f486f05108a5a55f7915c43255687eb7d566fd8..54f0185b01e336ab9518a2b6e4cd130c879ccdef 100644 (file)
 #include <linux/amba/mmci.h>
 #include <linux/amba/pl022.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/clk-realview.h>
 
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 #include <asm/smp_twd.h>
 #include <asm/pgtable.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 
 #include <asm/mach/arch.h>
@@ -324,10 +324,6 @@ static void __init realview_pbx_timer_init(void)
        realview_pbx_twd_init();
 }
 
-static struct sys_timer realview_pbx_timer = {
-       .init           = realview_pbx_timer_init,
-};
-
 static void realview_pbx_fixup(struct tag *tags, char **from,
                               struct meminfo *meminfo)
 {
@@ -404,8 +400,7 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
        .map_io         = realview_pbx_map_io,
        .init_early     = realview_init_early,
        .init_irq       = gic_init_irq,
-       .timer          = &realview_pbx_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = realview_pbx_timer_init,
        .init_machine   = realview_pbx_init,
 #ifdef CONFIG_ZONE_DMA
        .dma_zone_size  = SZ_256M,
index f3fa259ce01f1546ce40be1ea382a05af6e42fb2..a302cf5e0fc7f5b13c74c61970d67c55e56a6fc9 100644 (file)
@@ -211,7 +211,7 @@ static void rpc_restart(char mode, const char *cmd)
        soft_restart(0);
 }
 
-extern struct sys_timer ioc_timer;
+void ioc_timer_init(void);
 
 MACHINE_START(RISCPC, "Acorn-RiscPC")
        /* Maintainer: Russell King */
@@ -220,6 +220,6 @@ MACHINE_START(RISCPC, "Acorn-RiscPC")
        .reserve_lp1    = 1,
        .map_io         = rpc_map_io,
        .init_irq       = rpc_init_irq,
-       .timer          = &ioc_timer,
+       .init_time      = ioc_timer_init,
        .restart        = rpc_restart,
 MACHINE_END
index 581fca934bb3e73adb055bcb2d7caff9aef978f9..9a6def14df01ce71e6ad8a34c1a2d7f1cdeadb38 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <asm/mach/time.h>
 
-unsigned long ioc_timer_gettimeoffset(void)
+static u32 ioc_timer_gettimeoffset(void)
 {
        unsigned int count1, count2, status;
        long offset;
@@ -56,7 +56,7 @@ unsigned long ioc_timer_gettimeoffset(void)
        }
 
        offset = (LATCH - offset) * (tick_nsec / 1000);
-       return (offset + LATCH/2) / LATCH;
+       return ((offset + LATCH/2) / LATCH) * 1000;
 }
 
 void __init ioctime_init(void)
@@ -82,14 +82,9 @@ static struct irqaction ioc_timer_irq = {
 /*
  * Set up timer interrupt.
  */
-static void __init ioc_timer_init(void)
+void __init ioc_timer_init(void)
 {
+       arch_gettimeoffset = ioc_timer_gettimeoffset;
        ioctime_init();
        setup_irq(IRQ_TIMER0, &ioc_timer_irq);
 }
-
-struct sys_timer ioc_timer = {
-       .init           = ioc_timer_init,
-       .offset         = ioc_timer_gettimeoffset,
-};
-
index f4ad99c1e4761368660a5e19b6d2adff9c1617d8..0e0279e79150e781ae82f3c4c048921445abf5aa 100644 (file)
@@ -237,6 +237,6 @@ MACHINE_START(AML_M5900, "AML_M5900")
        .map_io         = amlm5900_map_io,
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = amlm5900_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2410_restart,
 MACHINE_END
index 1ee8c46387433bfe8d693517513655346836db23..85eefab881af47dfed75b0f534a8b0ddbf7c250a 100644 (file)
@@ -448,6 +448,6 @@ MACHINE_START(ANUBIS, "Simtec-Anubis")
        .map_io         = anubis_map_io,
        .init_machine   = anubis_init,
        .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index 00381fe5de32bfae95dfeaaeaff7f93345a20660..b31c4aa724f2b792bec1c9e8c8ed381d7237ab95 100644 (file)
@@ -210,6 +210,6 @@ MACHINE_START(AT2440EVB, "AT2440EVB")
        .map_io         = at2440evb_map_io,
        .init_machine   = at2440evb_init,
        .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index 6a30ce7e4aa79d5c6335844ff1044f0a4531ea5a..526964c19dd8576a1d2c93eb03b0f52100a7d9eb 100644 (file)
@@ -612,6 +612,6 @@ MACHINE_START(BAST, "Simtec-BAST")
        .map_io         = bast_map_io,
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = bast_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2410_restart,
 MACHINE_END
index 973b87ca87f4a065fd212090ab67eb68fbfe5b73..fb5d3b3b53db4a782ab50fadc9f431d8c5dd10ee 100644 (file)
@@ -595,6 +595,6 @@ MACHINE_START(NEO1973_GTA02, "GTA02")
        .map_io         = gta02_map_io,
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = gta02_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index b23dd1b106e8a6d132578097aba863d48750a18c..2eb09e27c13c7388f57cb749e8975986193ddb55 100644 (file)
@@ -746,6 +746,6 @@ MACHINE_START(H1940, "IPAQ-H1940")
        .reserve        = h1940_reserve,
        .init_irq       = h1940_init_irq,
        .init_machine   = h1940_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2410_restart,
 MACHINE_END
index c9954e26b492a1820d1ff0045706da4ad3622550..d7a17255523873dd3f801875185a5c44eb4281cf 100644 (file)
@@ -661,6 +661,6 @@ MACHINE_START(JIVE, "JIVE")
        .init_irq       = s3c24xx_init_irq,
        .map_io         = jive_map_io,
        .init_machine   = jive_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2412_restart,
 MACHINE_END
index a31d5b83e5f77f9218f19b959ea5ccb0f6d0be39..2db09ade9b50aef758f34f43d00e92be6e2f9263 100644 (file)
@@ -688,6 +688,6 @@ MACHINE_START(MINI2440, "MINI2440")
        .map_io         = mini2440_map_io,
        .init_machine   = mini2440_init,
        .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index c53a9bfe1417416725e543f483f34aaa3836257b..d9d04b2402959eee8a6fd5c32c0718f15435161b 100644 (file)
@@ -589,7 +589,7 @@ MACHINE_START(N30, "Acer-N30")
                                Ben Dooks <ben-linux@fluff.org>
        */
        .atag_offset    = 0x100,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .init_machine   = n30_init,
        .init_irq       = s3c24xx_init_irq,
        .map_io         = n30_map_io,
@@ -600,7 +600,7 @@ MACHINE_START(N35, "Acer-N35")
        /* Maintainer: Christer Weinigel <christer@weinigel.se>
        */
        .atag_offset    = 0x100,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .init_machine   = n30_init,
        .init_irq       = s3c24xx_init_irq,
        .map_io         = n30_map_io,
index a2b92b0898e2e057caf1f0b257938ba0068a8934..a454e246186063694508f59f957e87f5f5142f00 100644 (file)
@@ -153,6 +153,6 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
        .map_io         = nexcoder_map_io,
        .init_machine   = nexcoder_init,
        .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index bb36d832bd3d022f4bcfc7efd4d173586919ee58..ba0f5b5ec19e281b576a0646c3a9a56cdbdcff77 100644 (file)
@@ -428,6 +428,6 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
        .map_io         = osiris_map_io,
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = osiris_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index bca39f0232b38cd1d28d29ba49143b2a1508ba56..e0fdae93aa7b37adb4e6b80531f19218366069c1 100644 (file)
@@ -118,6 +118,6 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
        .map_io         = otom11_map_io,
        .init_machine   = otom11_init,
        .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2410_restart,
 MACHINE_END
index 7b6ba13d7285964806c57430bbcd4d5e54ed7907..56175f0941b101def5aae288abf011698441b69e 100644 (file)
@@ -343,6 +343,6 @@ MACHINE_START(QT2410, "QT2410")
        .map_io         = qt2410_map_io,
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = qt2410_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2410_restart,
 MACHINE_END
index 0606f2faaa5c5261eaa916fe374aa21f7bb5da4f..e14ec7105a6d471f30fe3ec7925fb23c9bad5f4b 100644 (file)
@@ -814,6 +814,6 @@ MACHINE_START(RX1950, "HP iPAQ RX1950")
        .reserve        = rx1950_reserve,
        .init_irq = s3c24xx_init_irq,
        .init_machine = rx1950_init_machine,
-       .timer = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index dacbb9a2122ad6c84ab9a8150c9dc8904ea5a1d0..d00caa8de92243a94a2becd88786c59adb9f578f 100644 (file)
@@ -212,6 +212,6 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
        .reserve        = rx3715_reserve,
        .init_irq       = rx3715_init_irq,
        .init_machine   = rx3715_init_machine,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index 82796b97cb04b6a5af4da18557a6fa7a421a94b7..e184bfa9613aea23dc19a83d08eb88c0175667d6 100644 (file)
@@ -117,6 +117,6 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc
        .map_io         = smdk2410_map_io,
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = smdk2410_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2410_restart,
 MACHINE_END
index ce99fd8bbbc59831ce9f1825212674392408e040..69f356e83790b06da394b91f55ad913d72bdd35a 100644 (file)
@@ -133,7 +133,7 @@ MACHINE_START(S3C2413, "S3C2413")
        .init_irq       = s3c24xx_init_irq,
        .map_io         = smdk2413_map_io,
        .init_machine   = smdk2413_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2412_restart,
 MACHINE_END
 
@@ -145,7 +145,7 @@ MACHINE_START(SMDK2412, "SMDK2412")
        .init_irq       = s3c24xx_init_irq,
        .map_io         = smdk2413_map_io,
        .init_machine   = smdk2413_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2412_restart,
 MACHINE_END
 
@@ -157,6 +157,6 @@ MACHINE_START(SMDK2413, "SMDK2413")
        .init_irq       = s3c24xx_init_irq,
        .map_io         = smdk2413_map_io,
        .init_machine   = smdk2413_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2412_restart,
 MACHINE_END
index f30d7fccbfeedd4e2a22e00703b3933231b03157..fe160c7f4b0a523238c6d31d07763512bd3edf90 100644 (file)
@@ -254,6 +254,6 @@ MACHINE_START(SMDK2416, "SMDK2416")
        .init_irq       = s3c24xx_init_irq,
        .map_io         = smdk2416_map_io,
        .init_machine   = smdk2416_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2416_restart,
 MACHINE_END
index b7ff882c6ce66b85d8704b929a667305fb1c3efb..a8fdafedc4c16922777d60a8f4b38a5ba576ffa7 100644 (file)
@@ -182,6 +182,6 @@ MACHINE_START(S3C2440, "SMDK2440")
        .init_irq       = s3c24xx_init_irq,
        .map_io         = smdk2440_map_io,
        .init_machine   = smdk2440_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index 2568656f046f4d86f3c772a75b59b15f794ba329..7830d7004306d5351043a81b6d5d14fb3cf384ae 100644 (file)
@@ -144,6 +144,6 @@ MACHINE_START(SMDK2443, "SMDK2443")
        .init_irq       = s3c24xx_init_irq,
        .map_io         = smdk2443_map_io,
        .init_machine   = smdk2443_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2443_restart,
 MACHINE_END
index 495bf5cf52e93699c93fba288b99f5c2afaf0ed7..24b3d79e7b2c65174dd5aa84cd5d6c6af2abfd6b 100644 (file)
@@ -149,6 +149,6 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
        .map_io         = tct_hammer_map_io,
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = tct_hammer_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2410_restart,
 MACHINE_END
index 14d5b12e388ccbfe5c8cf9ee168cf6ecffa74a27..dda21a01e3ccb829312638cf60e8265563ee0ab0 100644 (file)
@@ -357,6 +357,6 @@ MACHINE_START(VR1000, "Thorcom-VR1000")
        .map_io         = vr1000_map_io,
        .init_machine   = vr1000_init,
        .init_irq       = s3c24xx_init_irq,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2410_restart,
 MACHINE_END
index f1d44ae118331557755735a6def86462abbd270e..7fe7d4f6041906ea3254b50fd32da5567b43861d 100644 (file)
@@ -161,6 +161,6 @@ MACHINE_START(VSTMS, "VSTMS")
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = vstms_init,
        .map_io         = vstms_map_io,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c2412_restart,
 MACHINE_END
index aef303b8997e5948cf834540e790fc4a3221ae27..0b9c0ba448347b7f513b1bfbd5ed7672141d4fe8 100644 (file)
 #include <linux/dma-mapping.h>
 #include <linux/irq.h>
 #include <linux/gpio.h>
+#include <linux/irqchip/arm-vic.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
-#include <asm/hardware/vic.h>
 #include <asm/system_misc.h>
 
 #include <mach/map.h>
index bcce68a0bb75fb3f7c574cce6bba23d8f6482baa..6a1127891c877b2334c4e46a423acb683e269c1a 100644 (file)
@@ -15,6 +15,5 @@
 #ifndef __ASM_ARCH_REGS_IRQ_H
 #define __ASM_ARCH_REGS_IRQ_H __FILE__
 
-#include <asm/hardware/vic.h>
 
 #endif /* __ASM_ARCH_6400_REGS_IRQ_H */
index ebe18a9469b8808eb0a3bf5f6c8b674af08b70ed..db9c1b1d56a4db535e0ca66a77f44b1fc74ec9d3 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef __ASM_ARCH_TICK_H
 #define __ASM_ARCH_TICK_H __FILE__
 
+#include <linux/irqchip/arm-vic.h>
+
 /* note, the timer interrutps turn up in 2 places, the vic and then
  * the timer block. We take the VIC as the base at the moment.
  */
index 99e82ac81b694ce69e27c7e5c8b3a53fc8cef473..afeae0b5bb28802c19a578545741857d5c13586b 100644 (file)
@@ -31,7 +31,6 @@
 #include <video/platform_lcd.h>
 #include <video/samsung_fimd.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -230,10 +229,9 @@ MACHINE_START(ANW6410, "A&W6410")
        .atag_offset    = 0x100,
 
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = anw6410_map_io,
        .init_machine   = anw6410_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index bf6311a28f3db1c7a014d92ac75361ca20534f8c..5b6adc7f1d3916cecdd78961152f31287078fd17 100644 (file)
@@ -42,7 +42,6 @@
 
 #include <sound/wm1250-ev1.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
@@ -867,10 +866,9 @@ MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
        /* Maintainer: Mark Brown <broonie@opensource.wolfsonmicro.com> */
        .atag_offset    = 0x100,
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = crag6410_map_io,
        .init_machine   = crag6410_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index 2b144893ddc4ca337e98356608d82ca102ba508d..7212eb9cfeb9f255f5581b485a2f34eb4afd0261 100644 (file)
@@ -30,7 +30,6 @@
 #include <mach/hardware.h>
 #include <mach/map.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
@@ -273,10 +272,9 @@ MACHINE_START(HMT, "Airgoo-HMT")
        /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */
        .atag_offset    = 0x100,
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = hmt_map_io,
        .init_machine   = hmt_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index 07c349cca33329fad68fbb253cfa5915e8783237..e173e6e982288d007f27d079f1fbec7f1e17c0a8 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/serial_core.h>
 #include <linux/types.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -352,10 +351,9 @@ MACHINE_START(MINI6410, "MINI6410")
        /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */
        .atag_offset    = 0x100,
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = mini6410_map_io,
        .init_machine   = mini6410_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index e5f9a79b535d81bc7678ebc5315f99e4ac655ccb..8d3cedd995ffd43a88c1398cff7ce5ddaa33bbb9 100644 (file)
@@ -26,7 +26,6 @@
 #include <video/platform_lcd.h>
 #include <video/samsung_fimd.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -101,10 +100,9 @@ MACHINE_START(NCP, "NCP")
        /* Maintainer: Samsung Electronics */
        .atag_offset    = 0x100,
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = ncp_map_io,
        .init_machine   = ncp_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index 7476f7c722ab18d86d7625caa0b5c6e7d41c3b1f..4d0d47a66930547e03b3bef6fc78a8ca577f70af 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/serial_core.h>
 #include <linux/types.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -331,10 +330,9 @@ MACHINE_START(REAL6410, "REAL6410")
        .atag_offset    = 0x100,
 
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = real6410_map_io,
        .init_machine   = real6410_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index 96d6da2b6b5fc399d54f5d68449a423a913330b3..ca2afcfce57391f29721325229246895002823ed 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -153,10 +152,9 @@ MACHINE_START(SMARTQ5, "SmartQ 5")
        /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
        .atag_offset    = 0x100,
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smartq_map_io,
        .init_machine   = smartq5_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index 7d1167bdc921b2ef5ec7d838ca5131ab6a079c07..37bb0c632a5efe1043b2473d053be656b0d38d73 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/leds.h>
 #include <linux/platform_device.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -169,10 +168,9 @@ MACHINE_START(SMARTQ7, "SmartQ 7")
        /* Maintainer: Maurus Cuelenaere <mcuelenaere AT gmail DOT com> */
        .atag_offset    = 0x100,
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smartq_map_io,
        .init_machine   = smartq7_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index a928fae5694e90b5eb230189706cc9f2ac1c60e0..a392869c834262360ec0ce5a51abffca27977bc4 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <asm/mach-types.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -90,10 +89,9 @@ MACHINE_START(SMDK6400, "SMDK6400")
        .atag_offset    = 0x100,
 
        .init_irq       = s3c6400_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smdk6400_map_io,
        .init_machine   = smdk6400_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index 574a9eef588dc4b6fd764449d3893811e27e7c3f..1663d10ba02a5324cbfe05d7ae87af16d4303519 100644 (file)
@@ -45,7 +45,6 @@
 #include <video/platform_lcd.h>
 #include <video/samsung_fimd.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -700,10 +699,9 @@ MACHINE_START(SMDK6410, "SMDK6410")
        .atag_offset    = 0x100,
 
        .init_irq       = s3c6410_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smdk6410_map_io,
        .init_machine   = smdk6410_machine_init,
        .init_late      = s3c64xx_init_late,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c64xx_restart,
 MACHINE_END
index 4aaebdace55f9fe5b3cb86cd3bbf2e441f08391d..d60397d1ff40649cb0d31617c7795fbc09b489e6 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef __ASM_ARCH_REGS_IRQ_H
 #define __ASM_ARCH_REGS_IRQ_H __FILE__
 
-#include <asm/hardware/vic.h>
 #include <mach/map.h>
 
 #endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/tick.h b/arch/arm/mach-s5p64x0/include/mach/tick.h
deleted file mode 100644 (file)
index 00aa7f1..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* linux/arch/arm/mach-s5p64x0/include/mach/tick.h
- *
- * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com
- *
- * Copyright 2008 Openmoko, Inc.
- * Copyright 2008 Simtec Electronics
- *     http://armlinux.simtec.co.uk/
- *     Ben Dooks <ben@simtec.co.uk>
- *
- * S5P64X0 - Timer tick support definitions
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARCH_TICK_H
-#define __ASM_ARCH_TICK_H __FILE__
-
-static inline u32 s3c24xx_ostimer_pending(void)
-{
-       u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
-       return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
-}
-
-#define TICK_MAX       (0xffffffff)
-
-#endif /* __ASM_ARCH_TICK_H */
index 1af823558c60509d571ee0024b9fca2492496ba4..a40d5eb381241041049432496dcb185ef84a485f 100644 (file)
@@ -29,7 +29,6 @@
 #include <video/platform_lcd.h>
 #include <video/samsung_fimd.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/irq.h>
@@ -272,9 +271,8 @@ MACHINE_START(SMDK6440, "SMDK6440")
        .atag_offset    = 0x100,
 
        .init_irq       = s5p6440_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smdk6440_map_io,
        .init_machine   = smdk6440_machine_init,
-       .timer          = &s5p_timer,
+       .init_time      = s5p_timer_init,
        .restart        = s5p64x0_restart,
 MACHINE_END
index 62526ccf6b70243be2e6e4c2f5834b7a87f0aedb..703e576a26e0d7ac082a218fdb9163b1e1d4e2fb 100644 (file)
@@ -29,7 +29,6 @@
 #include <video/platform_lcd.h>
 #include <video/samsung_fimd.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/irq.h>
@@ -291,9 +290,8 @@ MACHINE_START(SMDK6450, "SMDK6450")
        .atag_offset    = 0x100,
 
        .init_irq       = s5p6450_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smdk6450_map_io,
        .init_machine   = smdk6450_machine_init,
-       .timer          = &s5p_timer,
+       .init_time      = s5p_timer_init,
        .restart        = s5p64x0_restart,
 MACHINE_END
index 4d9036d0f28854177a2fa37be1e8ce627af6b634..761627897f30555b6d969080a68b1992109832cc 100644 (file)
@@ -14,6 +14,5 @@
 #define __ASM_ARCH_REGS_IRQ_H __FILE__
 
 #include <mach/map.h>
-#include <asm/hardware/vic.h>
 
 #endif /* __ASM_ARCH_REGS_IRQ_H */
index 20f68730ed180d50cefcfe19426f58dbc468a779..0af8e41230edca2ce525a4048d15d21358c0a09e 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef __ASM_ARCH_TICK_H
 #define __ASM_ARCH_TICK_H __FILE__
 
+#include <linux/irqchip/arm-vic.h>
+
 /* note, the timer interrutps turn up in 2 places, the vic and then
  * the timer block. We take the VIC as the base at the moment.
  */
index 9abe95e806abfe3bd9a85bc6eee3cd964d9d92af..185a19583898dc3221d0fa69122a96a21a9d0a6b 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/input.h>
 #include <linux/pwm_backlight.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -254,9 +253,8 @@ MACHINE_START(SMDKC100, "SMDKC100")
        /* Maintainer: Byungho Min <bhmin@samsung.com> */
        .atag_offset    = 0x100,
        .init_irq       = s5pc100_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smdkc100_map_io,
        .init_machine   = smdkc100_machine_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s5pc100_restart,
 MACHINE_END
index 5c3b104a7c8632b120cf541c0cf3533968cc6968..d8bc1e6c7aaa8d53982d3bd87ecb4a5a51f6ca2f 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef __ASM_ARCH_REGS_IRQ_H
 #define __ASM_ARCH_REGS_IRQ_H __FILE__
 
-#include <asm/hardware/vic.h>
 #include <mach/map.h>
 
 #endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/tick.h b/arch/arm/mach-s5pv210/include/mach/tick.h
deleted file mode 100644 (file)
index 7993b36..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* linux/arch/arm/mach-s5pv210/include/mach/tick.h
- *
- * Copyright (c) 2009 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com/
- *
- * Based on arch/arm/mach-s3c6400/include/mach/tick.h
- *
- * S5PV210 - Timer tick support definitions
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARCH_TICK_H
-#define __ASM_ARCH_TICK_H __FILE__
-
-static inline u32 s3c24xx_ostimer_pending(void)
-{
-       u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
-       return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
-}
-
-#define TICK_MAX       (0xffffffff)
-
-#endif /* __ASM_ARCH_TICK_H */
index ee9fa5c2ef2caea3fb43185c1bf1dcee25c4af98..11900a8e88a3369daba6dd5a5e64f94a9adb7319 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/input.h>
 #include <linux/gpio.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
@@ -685,9 +684,8 @@ MACHINE_START(AQUILA, "Aquila")
           Kyungmin Park <kyungmin.park@samsung.com> */
        .atag_offset    = 0x100,
        .init_irq       = s5pv210_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = aquila_map_io,
        .init_machine   = aquila_machine_init,
-       .timer          = &s5p_timer,
+       .init_time      = s5p_timer_init,
        .restart        = s5pv210_restart,
 MACHINE_END
index c72b31078c9948a9e8ac0d45814d1049ca4b4f20..5704815917466bda61ffcda940aefd213bf78829 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/interrupt.h>
 #include <linux/platform_data/s3c-hsotg.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
@@ -972,10 +971,9 @@ MACHINE_START(GONI, "GONI")
        /* Maintainers: Kyungmin Park <kyungmin.park@samsung.com> */
        .atag_offset    = 0x100,
        .init_irq       = s5pv210_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = goni_map_io,
        .init_machine   = goni_machine_init,
-       .timer          = &s5p_timer,
+       .init_time      = s5p_timer_init,
        .reserve        = &goni_reserve,
        .restart        = s5pv210_restart,
 MACHINE_END
index f1f3bd37ecda7d53db021a9f69d1cc3432b3159f..28bd0248a3e2ec57be4499bfa517d0fd5271e0b4 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/i2c.h>
 #include <linux/device.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
@@ -152,10 +151,9 @@ MACHINE_START(SMDKC110, "SMDKC110")
        /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
        .atag_offset    = 0x100,
        .init_irq       = s5pv210_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smdkc110_map_io,
        .init_machine   = smdkc110_machine_init,
-       .timer          = &s5p_timer,
+       .init_time      = s5p_timer_init,
        .restart        = s5pv210_restart,
        .reserve        = &smdkc110_reserve,
 MACHINE_END
index 6bc8404bf6784cfee3751eed9e6fdd0f24b18152..3c73f36869bbab37d49134882f3f1cb8f9758f08 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/pwm_backlight.h>
 #include <linux/platform_data/s3c-hsotg.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
@@ -328,10 +327,9 @@ MACHINE_START(SMDKV210, "SMDKV210")
        /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
        .atag_offset    = 0x100,
        .init_irq       = s5pv210_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = smdkv210_map_io,
        .init_machine   = smdkv210_machine_init,
-       .timer          = &s5p_timer,
+       .init_time      = s5p_timer_init,
        .restart        = s5pv210_restart,
        .reserve        = &smdkv210_reserve,
 MACHINE_END
index 18785cb5e1ef2fdb0f979cdc69d39e16e068a478..2d4c5531819c06d7038149f0e872fa1b3a16a79d 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/serial_core.h>
 
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/setup.h>
@@ -129,9 +128,8 @@ MACHINE_START(TORBRECK, "TORBRECK")
        /* Maintainer: Hyunchul Ko <ghcstop@gmail.com> */
        .atag_offset    = 0x100,
        .init_irq       = s5pv210_init_irq,
-       .handle_irq     = vic_handle_irq,
        .map_io         = torbreck_map_io,
        .init_machine   = torbreck_machine_init,
-       .timer          = &s5p_timer,
+       .init_time      = s5p_timer_init,
        .restart        = s5pv210_restart,
 MACHINE_END
index 9a23739f702625a1b949cfa4feeca8c1447e03b7..b38d2525d5dbdd21f985126d0874e72540fd3f4f 100644 (file)
@@ -621,7 +621,7 @@ MACHINE_START(ASSABET, "Intel-Assabet")
        .map_io         = assabet_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = assabet_init,
        .init_late      = sa11x0_init_late,
 #ifdef CONFIG_SA1111
index b2dadf3ea3df10ca3afdc46bdf70e2862d9a3498..63361b6d04e9ac84a1184d7c7aad8c8155aa728d 100644 (file)
@@ -336,7 +336,7 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
        .init_late      = sa11x0_init_late,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
 #ifdef CONFIG_SA1111
        .dma_zone_size  = SZ_1M,
 #endif
index 304bca4a07c049cb14b82075dfa8a684e8b97608..2d25ececb415a2e5da0452ceca7a54ff28348c11 100644 (file)
@@ -174,7 +174,7 @@ MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
        .map_io         = cerf_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = cerf_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = cerf_init,
        .init_late      = sa11x0_init_late,
        .restart        = sa11x0_restart,
index 45f424f5fca6a1528f3ea64f623facfd35ae999a..612a45689770752bc9e1319d2eeb430ae36a449c 100644 (file)
@@ -399,7 +399,7 @@ MACHINE_START(COLLIE, "Sharp-Collie")
        .map_io         = collie_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = collie_init,
        .init_late      = sa11x0_init_late,
        .restart        = sa11x0_restart,
index a5b7c13da3e31bc7d331068f72c32420f95759b5..2abc6a1f6e86defe17714497f9e4b945c9bc18d0 100644 (file)
@@ -4,9 +4,7 @@
  * Author: Nicolas Pitre
  */
 
-struct sys_timer;
-
-extern struct sys_timer sa1100_timer;
+extern void sa1100_timer_init(void);
 extern void __init sa1100_map_io(void);
 extern void __init sa1100_init_irq(void);
 extern void __init sa1100_init_gpio(void);
index e1571eab08aeb3b5f5d48d5c62b2b7cea206c0cf..b8f2b151539bd96358824f000fe597f0d0cb894c 100644 (file)
@@ -108,7 +108,7 @@ MACHINE_START(H3100, "Compaq iPAQ H3100")
        .map_io         = h3100_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = h3100_mach_init,
        .init_late      = sa11x0_init_late,
        .restart        = sa11x0_restart,
index ba7a2901ab88232da9bea4df8abc38266cc4544d..b8dc5bd2262388d8dd56c20756ce5acd03e35b83 100644 (file)
@@ -158,7 +158,7 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
        .map_io         = h3600_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = h3600_mach_init,
        .init_late      = sa11x0_init_late,
        .restart        = sa11x0_restart,
index d005939c41fc85ad9e922bb109a5df38200a518f..643d5f2d9af925fc5b95010a72a77eec0037534b 100644 (file)
@@ -229,7 +229,7 @@ MACHINE_START(HACKKIT, "HackKit Cpu Board")
        .map_io         = hackkit_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = hackkit_init,
        .init_late      = sa11x0_init_late,
        .restart        = sa11x0_restart,
index 35cfc428b4d48b1ac710e9ede26209595167a37e..c0b1f5bafae4e06496186197f422ba8874f26420 100644 (file)
@@ -346,7 +346,7 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
        .map_io         = jornada720_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = jornada720_mach_init,
        .init_late      = sa11x0_init_late,
 #ifdef CONFIG_SA1111
index f69f78fc3ddd2b15ee681c6f5670a383f9a322f8..a89917653884642f1219fb7f4c820fcbe56e19ee 100644 (file)
@@ -174,6 +174,6 @@ MACHINE_START(LART, "LART")
        .init_irq       = sa1100_init_irq,
        .init_machine   = lart_init,
        .init_late      = sa11x0_init_late,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .restart        = sa11x0_restart,
 MACHINE_END
index 102e08f7b10962ba08c9f549b1eba478ccc744ff..f1cb3784d525d131e3d2568b1ae2f6c0d645553a 100644 (file)
@@ -110,7 +110,7 @@ MACHINE_START(NANOENGINE, "BSE nanoEngine")
        .map_io         = nanoengine_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = nanoengine_init,
        .init_late      = sa11x0_init_late,
        .restart        = sa11x0_restart,
index c51bb63f90fb9953bb9c8663a1e4c502c3fb0210..091261878effde2e56d1b4f81a157f7d696de765 100644 (file)
@@ -133,7 +133,7 @@ MACHINE_START(PLEB, "PLEB")
        .map_io         = pleb_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = pleb_init,
        .init_late      = sa11x0_init_late,
        .restart        = sa11x0_restart,
index 6460d25fbb88cd2fc47dc7c35d0f4f45e81c610b..c8866bce738644217d74affbd8eb191aa50d5bcf 100644 (file)
@@ -102,7 +102,7 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
        .map_io         = shannon_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = shannon_init,
        .init_late      = sa11x0_init_late,
        .restart        = sa11x0_restart,
index 6d65f65fcb230c9e06e46946affe300909cdec93..bcbc94540e4574c605b99a82f4e642db9afda26b 100644 (file)
@@ -396,6 +396,6 @@ MACHINE_START(SIMPAD, "Simpad")
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
        .init_late      = sa11x0_init_late,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .restart        = sa11x0_restart,
 MACHINE_END
index 80702c9ecc77fe8a6115a1bbe8b0ea08daf97918..a59a13a665a65e992e45d81a09ecffb8387bac86 100644 (file)
@@ -69,46 +69,10 @@ sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c)
        }
 }
 
-static struct clock_event_device ckevt_sa1100_osmr0 = {
-       .name           = "osmr0",
-       .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .rating         = 200,
-       .set_next_event = sa1100_osmr0_set_next_event,
-       .set_mode       = sa1100_osmr0_set_mode,
-};
-
-static struct irqaction sa1100_timer_irq = {
-       .name           = "ost0",
-       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = sa1100_ost0_interrupt,
-       .dev_id         = &ckevt_sa1100_osmr0,
-};
-
-static void __init sa1100_timer_init(void)
-{
-       writel_relaxed(0, OIER);
-       writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
-
-       setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
-
-       clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4);
-       ckevt_sa1100_osmr0.max_delta_ns =
-               clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
-       ckevt_sa1100_osmr0.min_delta_ns =
-               clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
-       ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
-
-       setup_irq(IRQ_OST0, &sa1100_timer_irq);
-
-       clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
-               clocksource_mmio_readl_up);
-       clockevents_register_device(&ckevt_sa1100_osmr0);
-}
-
 #ifdef CONFIG_PM
 unsigned long osmr[4], oier;
 
-static void sa1100_timer_suspend(void)
+static void sa1100_timer_suspend(struct clock_event_device *cedev)
 {
        osmr[0] = readl_relaxed(OSMR0);
        osmr[1] = readl_relaxed(OSMR1);
@@ -117,7 +81,7 @@ static void sa1100_timer_suspend(void)
        oier = readl_relaxed(OIER);
 }
 
-static void sa1100_timer_resume(void)
+static void sa1100_timer_resume(struct clock_event_device *cedev)
 {
        writel_relaxed(0x0f, OSSR);
        writel_relaxed(osmr[0], OSMR0);
@@ -136,8 +100,36 @@ static void sa1100_timer_resume(void)
 #define sa1100_timer_resume NULL
 #endif
 
-struct sys_timer sa1100_timer = {
-       .init           = sa1100_timer_init,
+static struct clock_event_device ckevt_sa1100_osmr0 = {
+       .name           = "osmr0",
+       .features       = CLOCK_EVT_FEAT_ONESHOT,
+       .rating         = 200,
+       .set_next_event = sa1100_osmr0_set_next_event,
+       .set_mode       = sa1100_osmr0_set_mode,
        .suspend        = sa1100_timer_suspend,
        .resume         = sa1100_timer_resume,
 };
+
+static struct irqaction sa1100_timer_irq = {
+       .name           = "ost0",
+       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+       .handler        = sa1100_ost0_interrupt,
+       .dev_id         = &ckevt_sa1100_osmr0,
+};
+
+void __init sa1100_timer_init(void)
+{
+       writel_relaxed(0, OIER);
+       writel_relaxed(OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3, OSSR);
+
+       setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
+
+       ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
+
+       setup_irq(IRQ_OST0, &sa1100_timer_irq);
+
+       clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
+               clocksource_mmio_readl_up);
+       clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400,
+                                       MIN_OSCR_DELTA * 2, 0x7fffffff);
+}
index 9ad2e9737fb5cabd3a1afc2785d31e8dc61dcfdf..b63dec8481958c563b9e4a689b4bc488c7b7e175 100644 (file)
@@ -128,10 +128,6 @@ static void __init shark_timer_init(void)
        setup_irq(IRQ_TIMER, &shark_timer_irq);
 }
 
-static struct sys_timer shark_timer = {
-       .init           = shark_timer_init,
-};
-
 static void shark_init_early(void)
 {
        disable_hlt();
@@ -142,7 +138,7 @@ MACHINE_START(SHARK, "Shark")
        .atag_offset    = 0x3000,
        .init_early     = shark_init_early,
        .init_irq       = shark_init_irq,
-       .timer          = &shark_timer,
+       .init_time      = shark_timer_init,
        .dma_zone_size  = SZ_4M,
        .restart        = shark_restart,
 MACHINE_END
index 0b7147928aa3ef0d0638afde9296edf5fe043a43..700e6623aa86169a315871be1d9e6a432a31f42f 100644 (file)
@@ -15,7 +15,7 @@ obj-$(CONFIG_ARCH_EMEV2)      += setup-emev2.o clock-emev2.o
 # SMP objects
 smp-y                          := platsmp.o headsmp.o
 smp-$(CONFIG_HOTPLUG_CPU)      += hotplug.o
-smp-$(CONFIG_ARCH_SH73A0)      += smp-sh73a0.o
+smp-$(CONFIG_ARCH_SH73A0)      += smp-sh73a0.o headsmp-sh73a0.o
 smp-$(CONFIG_ARCH_R8A7779)     += smp-r8a7779.o
 smp-$(CONFIG_ARCH_EMEV2)       += smp-emev2.o
 
@@ -37,6 +37,7 @@ obj-$(CONFIG_ARCH_SHMOBILE)   += pm-rmobile.o
 obj-$(CONFIG_ARCH_SH7372)      += pm-sh7372.o sleep-sh7372.o
 obj-$(CONFIG_ARCH_R8A7740)     += pm-r8a7740.o
 obj-$(CONFIG_ARCH_R8A7779)     += pm-r8a7779.o
+obj-$(CONFIG_ARCH_SH73A0)      += pm-sh73a0.o
 
 # Board objects
 obj-$(CONFIG_MACH_AP4EVB)      += board-ap4evb.o
index 032d10817e795663c017cc85edf9660f840217e8..705bc63c7984fcdd0c96de9c64e3cc9d210a3817 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <linux/sh_clk.h>
+#include <linux/irqchip/arm-gic.h>
 #include <video/sh_mobile_lcdc.h>
 #include <video/sh_mipi_dsi.h>
 #include <sound/sh_fsi.h>
@@ -49,7 +50,6 @@
 #include <mach/common.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/traps.h>
 
@@ -668,8 +668,7 @@ MACHINE_START(AG5EVM, "ag5evm")
        .init_early     = sh73a0_add_early_devices,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_irq       = sh73a0_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = ag5evm_init,
        .init_late      = shmobile_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = sh73a0_earlytimer_init,
 MACHINE_END
index 99ef190d0909d5ee5bf633efd0b660061244e71b..c1d4ab630214088d34497a8f50c80f80a157758b 100644 (file)
@@ -1350,5 +1350,5 @@ MACHINE_START(AP4EVB, "ap4evb")
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = ap4evb_init,
        .init_late      = sh7372_pm_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = sh7372_earlytimer_init,
 MACHINE_END
index 5353adf6b828a55446933e070968c9b4bec20a94..65731370da81808c162abea79cfb1632b0363165 100644 (file)
@@ -1181,6 +1181,8 @@ static void __init eva_init(void)
        rmobile_add_device_to_domain("A4LC", &hdmi_lcdc_device);
        if (usb)
                rmobile_add_device_to_domain("A3SP", usb);
+
+       r8a7740_pm_init();
 }
 
 static void __init eva_earlytimer_init(void)
@@ -1192,9 +1194,6 @@ static void __init eva_earlytimer_init(void)
 static void __init eva_add_early_devices(void)
 {
        r8a7740_add_early_devices();
-
-       /* override timer setup with board-specific code */
-       shmobile_timer.init = eva_earlytimer_init;
 }
 
 #define RESCNT2 IOMEM(0xe6188020)
@@ -1216,7 +1215,7 @@ DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = eva_init,
        .init_late      = shmobile_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = eva_earlytimer_init,
        .dt_compat      = eva_boards_compat_dt,
        .restart        = eva_restart,
 MACHINE_END
index cb8c994e14301b1424589ce25962de750b0a3f8d..331b7ce4edd8bbe2a8657636e1988503e4dae65e 100644 (file)
@@ -499,9 +499,6 @@ static void __init bonito_earlytimer_init(void)
 static void __init bonito_add_early_devices(void)
 {
        r8a7740_add_early_devices();
-
-       /* override timer setup with board-specific code */
-       shmobile_timer.init = bonito_earlytimer_init;
 }
 
 MACHINE_START(BONITO, "bonito")
@@ -511,5 +508,5 @@ MACHINE_START(BONITO, "bonito")
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = bonito_init,
        .init_late      = shmobile_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = bonito_earlytimer_init,
 MACHINE_END
index bf88f9a8b7ac78ce381add800731e6d5ee7aef37..d759a9c2b9e83fc3a6c9d2b1f86602239472f8cc 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/input/sh_keysc.h>
 #include <linux/gpio_keys.h>
 #include <linux/leds.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/leds-renesas-tpu.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mmcif.h>
@@ -47,7 +48,6 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/traps.h>
 
@@ -550,8 +550,7 @@ MACHINE_START(KOTA2, "kota2")
        .init_early     = sh73a0_add_early_devices,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_irq       = sh73a0_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = kota2_init,
        .init_late      = shmobile_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = sh73a0_earlytimer_init,
 MACHINE_END
index b52bc0d1273f5a77a3362df5d72e60bb879c9cba..c254782aa7276c59297273ab6c7d40ede2a15097 100644 (file)
@@ -28,7 +28,6 @@
 #include <mach/emev2.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 
 /* Dummy supplies, where voltage doesn't matter */
 static struct regulator_consumer_supply dummy_supplies[] = {
@@ -89,9 +88,8 @@ DT_MACHINE_START(KZM9D_DT, "kzm9d")
        .init_early     = emev2_add_early_devices,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_irq       = emev2_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = kzm9d_add_standard_devices,
        .init_late      = shmobile_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = shmobile_timer_init,
        .dt_compat      = kzm9d_boards_compat_dt,
 MACHINE_END
index c02448d6847f40aba1d2906e9957e376aecd0df4..363c6edfa3cda53c7ef9df6e8cd18e1868802e48 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/i2c.h>
 #include <linux/i2c/pcf857x.h>
 #include <linux/input.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mmcif.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
@@ -42,7 +43,6 @@
 #include <mach/sh73a0.h>
 #include <mach/common.h>
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <video/sh_mobile_lcdc.h>
@@ -772,6 +772,8 @@ static void __init kzm_init(void)
 
        sh73a0_add_standard_devices();
        platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
+
+       sh73a0_pm_init();
 }
 
 static void kzm9g_restart(char mode, const char *cmd)
@@ -792,10 +794,9 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g")
        .init_early     = sh73a0_add_early_devices,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_irq       = sh73a0_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = kzm_init,
        .init_late      = shmobile_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = sh73a0_earlytimer_init,
        .restart        = kzm9g_restart,
        .dt_compat      = kzm9g_boards_compat_dt,
 MACHINE_END
index 2fed62f660459ccae4b08f8548543309587eb0fc..fe4917f2c1a2887740929bbf1135bf2a5cd79eed 100644 (file)
@@ -1593,6 +1593,6 @@ DT_MACHINE_START(MACKEREL_DT, "mackerel")
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = mackerel_init,
        .init_late      = sh7372_pm_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = sh7372_earlytimer_init,
        .dt_compat  = mackerel_boards_compat_dt,
 MACHINE_END
index 449f9289567db20a919dcff45d68bfafe193fb68..cdcb799e802f0e2e5bcdaeaf42e50107a18b0197 100644 (file)
@@ -44,7 +44,6 @@
 #include <mach/irqs.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 #include <asm/traps.h>
 
 /* Fixed 3.3V regulator to be used by SDHI0 */
@@ -382,8 +381,7 @@ MACHINE_START(MARZEN, "marzen")
        .init_early     = r8a7779_add_early_devices,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_irq       = r8a7779_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = marzen_init,
        .init_late      = marzen_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = r8a7779_earlytimer_init,
 MACHINE_END
index eac49d59782f3a66df3de2994f2d95e8a66b2c10..19ce885a3b4372af27579b3eeb68446c9b8cfcb7 100644 (file)
@@ -581,10 +581,14 @@ static struct clk_lookup lookups[] = {
 
        /* MSTP32 clocks */
        CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0",    &mstp_clks[MSTP100]),
-       CLKDEV_DEV_ID("sh_tmu.1",               &mstp_clks[MSTP111]),
+       CLKDEV_DEV_ID("sh_tmu.3",               &mstp_clks[MSTP111]),
+       CLKDEV_DEV_ID("sh_tmu.4",               &mstp_clks[MSTP111]),
+       CLKDEV_DEV_ID("sh_tmu.5",               &mstp_clks[MSTP111]),
        CLKDEV_DEV_ID("i2c-sh_mobile.0",        &mstp_clks[MSTP116]),
        CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1",    &mstp_clks[MSTP117]),
        CLKDEV_DEV_ID("sh_tmu.0",               &mstp_clks[MSTP125]),
+       CLKDEV_DEV_ID("sh_tmu.1",               &mstp_clks[MSTP125]),
+       CLKDEV_DEV_ID("sh_tmu.2",               &mstp_clks[MSTP125]),
        CLKDEV_DEV_ID("sh_mobile_ceu.0",        &mstp_clks[MSTP127]),
        CLKDEV_DEV_ID("sh_mobile_ceu.1",        &mstp_clks[MSTP128]),
 
index 3ca6757b129ad7da9be7b8654e61402b8647f012..45d21fe317f4706f9f0f1c75645522917f415fe5 100644 (file)
@@ -544,6 +544,7 @@ static struct clk_lookup lookups[] = {
 
        /* MSTP32 clocks */
        CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */
+       CLKDEV_DEV_ID("fff30000.i2c", &mstp_clks[MSTP001]), /* IIC2 */
        CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */
        CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */
        CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */
@@ -556,6 +557,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX0 */
        CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), /* LCDC1 */
        CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */
+       CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]), /* IIC0 */
        CLKDEV_DEV_ID("sh_mobile_meram.0", &mstp_clks[MSTP113]), /* MERAM */
        CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */
        CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */
@@ -577,18 +579,25 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
        CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */
        CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */
+       CLKDEV_DEV_ID("e6c20000.i2c", &mstp_clks[MSTP323]), /* IIC1 */
        CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */
        CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */
        CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP322]), /* USB0 */
        CLKDEV_DEV_ID("sh_flctl.0", &mstp_clks[MSTP315]), /* FLCTL */
        CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
+       CLKDEV_DEV_ID("e6850000.sdhi", &mstp_clks[MSTP314]), /* SDHI0 */
        CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
+       CLKDEV_DEV_ID("e6860000.sdhi", &mstp_clks[MSTP313]), /* SDHI1 */
        CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */
+       CLKDEV_DEV_ID("e6bd0000.mmcif", &mstp_clks[MSTP312]), /* MMC */
        CLKDEV_DEV_ID("sh-mipi-dsi.1", &mstp_clks[MSTP423]), /* DSITX1 */
        CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), /* SDHI2 */
+       CLKDEV_DEV_ID("e6870000.sdhi", &mstp_clks[MSTP415]), /* SDHI2 */
        CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */
        CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */
+       CLKDEV_DEV_ID("e6d20000.i2c", &mstp_clks[MSTP411]), /* IIC3 */
        CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */
+       CLKDEV_DEV_ID("e6d30000.i2c", &mstp_clks[MSTP410]), /* IIC4 */
        CLKDEV_DEV_ID("sh-dma-engine.4", &mstp_clks[MSTP407]), /* USB-DMAC1 */
        CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */
        CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */
index 516ff7f3e4344bb92020b800cada9ddfe03a9a3f..afa5423a0f93871351669830a07dddbaf808b616 100644 (file)
@@ -264,17 +264,17 @@ enum { DIV4_I, DIV4_ZG, DIV4_M3, DIV4_B, DIV4_M1, DIV4_M2,
        SH_CLK_DIV4(&pll1_clk, _reg, _bit, _mask, _flags)
 
 static struct clk div4_clks[DIV4_NR] = {
-       [DIV4_I] = DIV4(FRQCRA, 20, 0xfff, CLK_ENABLE_ON_INIT),
-       [DIV4_ZG] = DIV4(FRQCRA, 16, 0xbff, CLK_ENABLE_ON_INIT),
-       [DIV4_M3] = DIV4(FRQCRA, 12, 0xfff, CLK_ENABLE_ON_INIT),
-       [DIV4_B] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT),
-       [DIV4_M1] = DIV4(FRQCRA, 4, 0xfff, 0),
-       [DIV4_M2] = DIV4(FRQCRA, 0, 0xfff, 0),
-       [DIV4_Z] = DIV4(FRQCRB, 24, 0xbff, 0),
-       [DIV4_ZTR] = DIV4(FRQCRB, 20, 0xfff, 0),
-       [DIV4_ZT] = DIV4(FRQCRB, 16, 0xfff, 0),
-       [DIV4_ZX] = DIV4(FRQCRB, 12, 0xfff, 0),
-       [DIV4_HP] = DIV4(FRQCRB, 4, 0xfff, 0),
+       [DIV4_I] = DIV4(FRQCRA, 20, 0xdff, CLK_ENABLE_ON_INIT),
+       [DIV4_ZG] = DIV4(FRQCRA, 16, 0xd7f, CLK_ENABLE_ON_INIT),
+       [DIV4_M3] = DIV4(FRQCRA, 12, 0x1dff, CLK_ENABLE_ON_INIT),
+       [DIV4_B] = DIV4(FRQCRA, 8, 0xdff, CLK_ENABLE_ON_INIT),
+       [DIV4_M1] = DIV4(FRQCRA, 4, 0x1dff, 0),
+       [DIV4_M2] = DIV4(FRQCRA, 0, 0x1dff, 0),
+       [DIV4_Z] = DIV4(FRQCRB, 24, 0x97f, 0),
+       [DIV4_ZTR] = DIV4(FRQCRB, 20, 0xdff, 0),
+       [DIV4_ZT] = DIV4(FRQCRB, 16, 0xdff, 0),
+       [DIV4_ZX] = DIV4(FRQCRB, 12, 0xdff, 0),
+       [DIV4_HP] = DIV4(FRQCRB, 4, 0xdff, 0),
 };
 
 enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_ZB1,
@@ -525,6 +525,13 @@ static struct clk mstp_clks[MSTP_NR] = {
        [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
 };
 
+/* The lookups structure below includes duplicate entries for some clocks
+ * with alternate names.
+ * - The traditional name used when a device is initialised with platform data
+ * - The name used when a device is initialised using device tree
+ * The longer-term aim is to remove these duplicates, and indeed the
+ * lookups table entirely, by describing clocks using device tree.
+ */
 static struct clk_lookup lookups[] = {
        /* main clocks */
        CLKDEV_CON_ID("r_clk", &r_clk),
@@ -545,6 +552,7 @@ static struct clk_lookup lookups[] = {
 
        /* MSTP32 clocks */
        CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
+       CLKDEV_DEV_ID("e6824000.i2c", &mstp_clks[MSTP001]), /* I2C2 */
        CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP129]), /* CEU1 */
        CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */
        CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */
@@ -553,6 +561,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */
        CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */
        CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
+       CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */
        CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
        CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
        CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */
@@ -569,17 +578,21 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */
        CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
        CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
+       CLKDEV_DEV_ID("e6822000.i2c", &mstp_clks[MSTP323]), /* I2C1 */
        CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP322]), /* USB */
        CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
        CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
        CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
+       CLKDEV_DEV_ID("e6bd0000.mmcif", &mstp_clks[MSTP312]), /* MMCIF0 */
        CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), /* SDHI2 */
        CLKDEV_DEV_ID("leds-renesas-tpu.12", &mstp_clks[MSTP303]), /* TPU1 */
        CLKDEV_DEV_ID("leds-renesas-tpu.21", &mstp_clks[MSTP302]), /* TPU2 */
        CLKDEV_DEV_ID("leds-renesas-tpu.30", &mstp_clks[MSTP301]), /* TPU3 */
        CLKDEV_DEV_ID("leds-renesas-tpu.41", &mstp_clks[MSTP300]), /* TPU4 */
        CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
+       CLKDEV_DEV_ID("e6826000.i2c", &mstp_clks[MSTP411]), /* I2C3 */
        CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
+       CLKDEV_DEV_ID("e6828000.i2c", &mstp_clks[MSTP410]), /* I2C4 */
        CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
 };
 
diff --git a/arch/arm/mach-shmobile/headsmp-sh73a0.S b/arch/arm/mach-shmobile/headsmp-sh73a0.S
new file mode 100644 (file)
index 0000000..bec4c0d
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * SMP support for SoC sh73a0
+ *
+ * Copyright (C) 2012 Bastian Hecht
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <linux/linkage.h>
+#include <linux/init.h>
+#include <asm/memory.h>
+
+       __CPUINIT
+/*
+ * Reset vector for secondary CPUs.
+ *
+ * First we turn on L1 cache coherency for our CPU. Then we jump to
+ * shmobile_invalidate_start that invalidates the cache and hands over control
+ * to the common ARM startup code.
+ * This function will be mapped to address 0 by the SBAR register.
+ * A normal branch is out of range here so we need a long jump. We jump to
+ * the physical address as the MMU is still turned off.
+ */
+       .align  12
+ENTRY(sh73a0_secondary_vector)
+       mrc     p15, 0, r0, c0, c0, 5   @ read MIPDR
+       and     r0, r0, #3              @ mask out cpu ID
+       lsl     r0, r0, #3              @ we will shift by cpu_id * 8 bits
+       mov     r1, #0xf0000000         @ SCU base address
+       ldr     r2, [r1, #8]            @ SCU Power Status Register
+       mov     r3, #3
+       bic     r2, r2, r3, lsl r0      @ Clear bits of our CPU (Run Mode)
+       str     r2, [r1, #8]            @ write back
+
+       ldr     pc, 1f
+1:     .long shmobile_invalidate_start - PAGE_OFFSET + PLAT_PHYS_OFFSET
+ENDPROC(sh73a0_secondary_vector)
index b09a0bdbf8135c127d354aa1d313de485c7f1348..a1524e3367b005ea0ed783ea74cc43a93c922017 100644 (file)
@@ -56,6 +56,12 @@ int shmobile_cpu_disable(unsigned int cpu)
        return cpu == 0 ? -EPERM : 0;
 }
 
+int shmobile_cpu_disable_any(unsigned int cpu)
+{
+       cpumask_clear_cpu(cpu, &dead_cpus);
+       return 0;
+}
+
 int shmobile_cpu_is_dead(unsigned int cpu)
 {
        return cpumask_test_cpu(cpu, &dead_cpus);
index dfeca79e9e964338cafe99ab46df97f7ce2a471b..e48606d8a2be31214168c0616ae6bc9d81ddc458 100644 (file)
@@ -2,7 +2,7 @@
 #define __ARCH_MACH_COMMON_H
 
 extern void shmobile_earlytimer_init(void);
-extern struct sys_timer shmobile_timer;
+extern void shmobile_timer_init(void);
 extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz,
                         unsigned int mult, unsigned int div);
 struct twd_local_timer;
@@ -20,8 +20,11 @@ extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
 
 extern void sh7372_init_irq(void);
 extern void sh7372_map_io(void);
+extern void sh7372_earlytimer_init(void);
 extern void sh7372_add_early_devices(void);
 extern void sh7372_add_standard_devices(void);
+extern void sh7372_add_early_devices_dt(void);
+extern void sh7372_add_standard_devices_dt(void);
 extern void sh7372_clock_init(void);
 extern void sh7372_pinmux_init(void);
 extern void sh7372_pm_init(void);
@@ -31,11 +34,17 @@ extern struct clk sh7372_extal1_clk;
 extern struct clk sh7372_extal2_clk;
 
 extern void sh73a0_init_irq(void);
+extern void sh73a0_init_irq_dt(void);
 extern void sh73a0_map_io(void);
+extern void sh73a0_earlytimer_init(void);
 extern void sh73a0_add_early_devices(void);
+extern void sh73a0_add_early_devices_dt(void);
 extern void sh73a0_add_standard_devices(void);
+extern void sh73a0_add_standard_devices_dt(void);
 extern void sh73a0_clock_init(void);
 extern void sh73a0_pinmux_init(void);
+extern void sh73a0_pm_init(void);
+extern void sh73a0_secondary_vector(void);
 extern struct clk sh73a0_extal1_clk;
 extern struct clk sh73a0_extal2_clk;
 extern struct clk sh73a0_extcki_clk;
@@ -47,9 +56,11 @@ extern void r8a7740_add_early_devices(void);
 extern void r8a7740_add_standard_devices(void);
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
+extern void r8a7740_pm_init(void);
 
 extern void r8a7779_init_irq(void);
 extern void r8a7779_map_io(void);
+extern void r8a7779_earlytimer_init(void);
 extern void r8a7779_add_early_devices(void);
 extern void r8a7779_add_standard_devices(void);
 extern void r8a7779_clock_init(void);
@@ -73,6 +84,7 @@ static inline int shmobile_cpuidle_init(void) { return 0; }
 
 extern void shmobile_cpu_die(unsigned int cpu);
 extern int shmobile_cpu_disable(unsigned int cpu);
+extern int shmobile_cpu_disable_any(unsigned int cpu);
 
 #ifdef CONFIG_HOTPLUG_CPU
 extern int shmobile_cpu_is_dead(unsigned int cpu);
index ef66f1a8aa2e02f37766adb3e0f537d3caff1a5b..8807c27f71f968c15721af91f099b3ee4771cad7 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 #include <mach/common.h>
 #include <mach/intc.h>
 #include <mach/r8a7779.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
index f0c5e5190601d4a58b20338915799e84f4ee08e3..91faba666d462916ec37822450b127674e8446db 100644 (file)
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/sh_intc.h>
+#include <linux/irqchip.h>
+#include <linux/irqchip/arm-gic.h>
 #include <mach/intc.h>
 #include <mach/irqs.h>
 #include <mach/sh73a0.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -315,11 +316,6 @@ static int intca_gic_set_type(struct irq_data *data, unsigned int type)
        return irq_cbp(irq_set_type, to_intca_reloc_irq(data), type);
 }
 
-static int intca_gic_set_wake(struct irq_data *data, unsigned int on)
-{
-       return irq_cbp(irq_set_wake, to_intca_reloc_irq(data), on);
-}
-
 #ifdef CONFIG_SMP
 static int intca_gic_set_affinity(struct irq_data *data,
                                  const struct cpumask *cpumask,
@@ -339,7 +335,7 @@ struct irq_chip intca_gic_irq_chip = {
        .irq_disable            = intca_gic_disable,
        .irq_shutdown           = intca_gic_disable,
        .irq_set_type           = intca_gic_set_type,
-       .irq_set_wake           = intca_gic_set_wake,
+       .irq_set_wake           = sh73a0_set_wake,
 #ifdef CONFIG_SMP
        .irq_set_affinity       = intca_gic_set_affinity,
 #endif
@@ -464,3 +460,11 @@ void __init sh73a0_init_irq(void)
        sh73a0_pint1_cascade.handler = sh73a0_pint1_demux;
        setup_irq(gic_spi(34), &sh73a0_pint1_cascade);
 }
+
+#ifdef CONFIG_OF
+void __init sh73a0_init_irq_dt(void)
+{
+       irqchip_init();
+       gic_arch_extn.irq_set_wake = sh73a0_set_wake;
+}
+#endif
index ed8d2351915edb68aa17548007a408d701475e64..1f958d7b0bac77d7eff13ac83eb7d02309fe9092 100644 (file)
@@ -12,7 +12,6 @@
  */
 #include <linux/init.h>
 #include <linux/smp.h>
-#include <asm/hardware/gic.h>
 
 void __init shmobile_smp_init_cpus(unsigned int ncores)
 {
@@ -26,6 +25,4 @@ void __init shmobile_smp_init_cpus(unsigned int ncores)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
index 21e5316d2d881aea42b507334b9fcedd139c760d..40b87aa1d44859e1295451a944254254b77823c7 100644 (file)
@@ -9,7 +9,9 @@
  * for more details.
  */
 #include <linux/console.h>
+#include <linux/suspend.h>
 #include <mach/pm-rmobile.h>
+#include <mach/common.h>
 
 #ifdef CONFIG_PM
 static int r8a7740_pd_a4s_suspend(void)
@@ -58,3 +60,23 @@ void __init r8a7740_init_pm_domains(void)
 }
 
 #endif /* CONFIG_PM */
+
+#ifdef CONFIG_SUSPEND
+static int r8a7740_enter_suspend(suspend_state_t suspend_state)
+{
+       cpu_do_idle();
+       return 0;
+}
+
+static void r8a7740_suspend_init(void)
+{
+       shmobile_suspend_ops.enter = r8a7740_enter_suspend;
+}
+#else
+static void r8a7740_suspend_init(void) {}
+#endif
+
+void __init r8a7740_pm_init(void)
+{
+       r8a7740_suspend_init();
+}
diff --git a/arch/arm/mach-shmobile/pm-sh73a0.c b/arch/arm/mach-shmobile/pm-sh73a0.c
new file mode 100644 (file)
index 0000000..99086e9
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * sh73a0 Power management support
+ *
+ *  Copyright (C) 2012 Bastian Hecht <hechtb+renesas@gmail.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/suspend.h>
+#include <mach/common.h>
+
+#ifdef CONFIG_SUSPEND
+static int sh73a0_enter_suspend(suspend_state_t suspend_state)
+{
+       cpu_do_idle();
+       return 0;
+}
+
+static void sh73a0_suspend_init(void)
+{
+       shmobile_suspend_ops.enter = sh73a0_enter_suspend;
+}
+#else
+static void sh73a0_suspend_init(void) {}
+#endif
+
+void __init sh73a0_pm_init(void)
+{
+       sh73a0_suspend_init();
+}
index a47beeb182838f399fc9e3fb6d2963f5eecdd6fb..47662a581c0a59d172529f06970b4e2ecb271e3d 100644 (file)
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
 #include <linux/platform_device.h>
 #include <linux/platform_data/gpio-em.h>
 #include <linux/of_platform.h>
 #include <linux/delay.h>
 #include <linux/input.h>
 #include <linux/io.h>
-#include <linux/of_irq.h>
+#include <linux/irqchip/arm-gic.h>
 #include <mach/hardware.h>
 #include <mach/common.h>
 #include <mach/emev2.h>
@@ -35,7 +36,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
-#include <asm/hardware/gic.h>
 
 static struct map_desc emev2_io_desc[] __initdata = {
 #ifdef CONFIG_SMP
@@ -445,29 +445,18 @@ void __init emev2_add_standard_devices_dt(void)
                             emev2_auxdata_lookup, NULL);
 }
 
-static const struct of_device_id emev2_dt_irq_match[] = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       {},
-};
-
 static const char *emev2_boards_compat_dt[] __initdata = {
        "renesas,emev2",
        NULL,
 };
 
-void __init emev2_init_irq_dt(void)
-{
-       of_irq_init(emev2_dt_irq_match);
-}
-
 DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
        .smp            = smp_ops(emev2_smp_ops),
        .init_early     = emev2_init_delay,
        .nr_irqs        = NR_IRQS_LEGACY,
-       .init_irq       = emev2_init_irq_dt,
-       .handle_irq     = gic_handle_irq,
+       .init_irq       = irqchip_init,
        .init_machine   = emev2_add_standard_devices_dt,
-       .timer          = &shmobile_timer,
+       .init_time      = shmobile_timer_init,
        .dt_compat      = emev2_boards_compat_dt,
 MACHINE_END
 
index 095222469d03ea3b4359ba0053b1a41b406bb076..847567d554879bc31096641011900e55dbad6429 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/serial_sci.h>
 #include <linux/sh_dma.h>
 #include <linux/sh_timer.h>
-#include <linux/dma-mapping.h>
 #include <mach/dma-register.h>
 #include <mach/r8a7740.h>
 #include <mach/pm-rmobile.h>
@@ -262,6 +261,97 @@ static struct platform_device cmt10_device = {
        .num_resources  = ARRAY_SIZE(cmt10_resources),
 };
 
+/* TMU */
+static struct sh_timer_config tmu00_platform_data = {
+       .name = "TMU00",
+       .channel_offset = 0x4,
+       .timer_bit = 0,
+       .clockevent_rating = 200,
+};
+
+static struct resource tmu00_resources[] = {
+       [0] = {
+               .name   = "TMU00",
+               .start  = 0xfff80008,
+               .end    = 0xfff80014 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = intcs_evt2irq(0xe80),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device tmu00_device = {
+       .name           = "sh_tmu",
+       .id             = 0,
+       .dev = {
+               .platform_data  = &tmu00_platform_data,
+       },
+       .resource       = tmu00_resources,
+       .num_resources  = ARRAY_SIZE(tmu00_resources),
+};
+
+static struct sh_timer_config tmu01_platform_data = {
+       .name = "TMU01",
+       .channel_offset = 0x10,
+       .timer_bit = 1,
+       .clocksource_rating = 200,
+};
+
+static struct resource tmu01_resources[] = {
+       [0] = {
+               .name   = "TMU01",
+               .start  = 0xfff80014,
+               .end    = 0xfff80020 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = intcs_evt2irq(0xea0),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device tmu01_device = {
+       .name           = "sh_tmu",
+       .id             = 1,
+       .dev = {
+               .platform_data  = &tmu01_platform_data,
+       },
+       .resource       = tmu01_resources,
+       .num_resources  = ARRAY_SIZE(tmu01_resources),
+};
+
+static struct sh_timer_config tmu02_platform_data = {
+       .name = "TMU02",
+       .channel_offset = 0x1C,
+       .timer_bit = 2,
+       .clocksource_rating = 200,
+};
+
+static struct resource tmu02_resources[] = {
+       [0] = {
+               .name   = "TMU02",
+               .start  = 0xfff80020,
+               .end    = 0xfff8002C - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = intcs_evt2irq(0xec0),
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device tmu02_device = {
+       .name           = "sh_tmu",
+       .id             = 2,
+       .dev = {
+               .platform_data  = &tmu02_platform_data,
+       },
+       .resource       = tmu02_resources,
+       .num_resources  = ARRAY_SIZE(tmu02_resources),
+};
+
 static struct platform_device *r8a7740_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
@@ -273,6 +363,9 @@ static struct platform_device *r8a7740_early_devices[] __initdata = {
        &scif7_device,
        &scifb_device,
        &cmt10_device,
+       &tmu00_device,
+       &tmu01_device,
+       &tmu02_device,
 };
 
 /* DMA */
@@ -705,12 +798,6 @@ void __init r8a7740_add_standard_devices(void)
        rmobile_add_device_to_domain("A3SP",    &i2c1_device);
 }
 
-static void __init r8a7740_earlytimer_init(void)
-{
-       r8a7740_clock_init(0);
-       shmobile_earlytimer_init();
-}
-
 void __init r8a7740_add_early_devices(void)
 {
        early_platform_add_devices(r8a7740_early_devices,
@@ -718,9 +805,6 @@ void __init r8a7740_add_early_devices(void)
 
        /* setup early console here as well */
        shmobile_setup_console();
-
-       /* override timer setup with soc-specific code */
-       shmobile_timer.init = r8a7740_earlytimer_init;
 }
 
 #ifdef CONFIG_USE_OF
@@ -763,7 +847,7 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
        .init_irq       = r8a7740_init_irq,
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = r8a7740_add_standard_devices_dt,
-       .timer          = &shmobile_timer,
+       .init_time      = shmobile_timer_init,
        .dt_compat      = r8a7740_boards_compat_dt,
 MACHINE_END
 
index 7a1ad4f38539df32e176802e8c7f83086c82b69c..7e87ab3eb8d361842ff599b852886a565c145624 100644 (file)
@@ -66,8 +66,7 @@ static struct plat_sci_port scif0_platform_data = {
        .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
        .scbrr_algo_id  = SCBRR_ALGO_2,
        .type           = PORT_SCIF,
-       .irqs           = { gic_spi(88), gic_spi(88),
-                           gic_spi(88), gic_spi(88) },
+       .irqs           = SCIx_IRQ_MUXED(gic_spi(88)),
 };
 
 static struct platform_device scif0_device = {
@@ -84,8 +83,7 @@ static struct plat_sci_port scif1_platform_data = {
        .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
        .scbrr_algo_id  = SCBRR_ALGO_2,
        .type           = PORT_SCIF,
-       .irqs           = { gic_spi(89), gic_spi(89),
-                           gic_spi(89), gic_spi(89) },
+       .irqs           = SCIx_IRQ_MUXED(gic_spi(89)),
 };
 
 static struct platform_device scif1_device = {
@@ -102,8 +100,7 @@ static struct plat_sci_port scif2_platform_data = {
        .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
        .scbrr_algo_id  = SCBRR_ALGO_2,
        .type           = PORT_SCIF,
-       .irqs           = { gic_spi(90), gic_spi(90),
-                           gic_spi(90), gic_spi(90) },
+       .irqs           = SCIx_IRQ_MUXED(gic_spi(90)),
 };
 
 static struct platform_device scif2_device = {
@@ -120,8 +117,7 @@ static struct plat_sci_port scif3_platform_data = {
        .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
        .scbrr_algo_id  = SCBRR_ALGO_2,
        .type           = PORT_SCIF,
-       .irqs           = { gic_spi(91), gic_spi(91),
-                           gic_spi(91), gic_spi(91) },
+       .irqs           = SCIx_IRQ_MUXED(gic_spi(91)),
 };
 
 static struct platform_device scif3_device = {
@@ -138,8 +134,7 @@ static struct plat_sci_port scif4_platform_data = {
        .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
        .scbrr_algo_id  = SCBRR_ALGO_2,
        .type           = PORT_SCIF,
-       .irqs           = { gic_spi(92), gic_spi(92),
-                           gic_spi(92), gic_spi(92) },
+       .irqs           = SCIx_IRQ_MUXED(gic_spi(92)),
 };
 
 static struct platform_device scif4_device = {
@@ -156,8 +151,7 @@ static struct plat_sci_port scif5_platform_data = {
        .scscr          = SCSCR_RE | SCSCR_TE | SCSCR_CKE1,
        .scbrr_algo_id  = SCBRR_ALGO_2,
        .type           = PORT_SCIF,
-       .irqs           = { gic_spi(93), gic_spi(93),
-                           gic_spi(93), gic_spi(93) },
+       .irqs           = SCIx_IRQ_MUXED(gic_spi(93)),
 };
 
 static struct platform_device scif5_device = {
@@ -339,7 +333,7 @@ void __init r8a7779_add_standard_devices(void)
 /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
 void __init __weak r8a7779_register_twd(void) { }
 
-static void __init r8a7779_earlytimer_init(void)
+void __init r8a7779_earlytimer_init(void)
 {
        r8a7779_clock_init();
        shmobile_earlytimer_init();
@@ -366,7 +360,4 @@ void __init r8a7779_add_early_devices(void)
         * As a final step pass earlyprint=sh-sci.2,115200 on the kernel
         * command line in case of the marzen board.
         */
-
-       /* override timer setup with soc-specific code */
-       shmobile_timer.init = r8a7779_earlytimer_init;
 }
index c917882424a7cc252cb62183d4636c230bfee3b1..191ae72e21baf70e9f24d965a956a14336d62233 100644 (file)
@@ -1054,7 +1054,7 @@ void __init sh7372_add_standard_devices(void)
                                       ARRAY_SIZE(domain_devices));
 }
 
-static void __init sh7372_earlytimer_init(void)
+void __init sh7372_earlytimer_init(void)
 {
        sh7372_clock_init();
        shmobile_earlytimer_init();
@@ -1067,9 +1067,6 @@ void __init sh7372_add_early_devices(void)
 
        /* setup early console here as well */
        shmobile_setup_console();
-
-       /* override timer setup with soc-specific code */
-       shmobile_timer.init = sh7372_earlytimer_init;
 }
 
 #ifdef CONFIG_USE_OF
@@ -1113,7 +1110,7 @@ DT_MACHINE_START(SH7372_DT, "Generic SH7372 (Flattened Device Tree)")
        .init_irq       = sh7372_init_irq,
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = sh7372_add_standard_devices_dt,
-       .timer          = &shmobile_timer,
+       .init_time      = shmobile_timer_init,
        .dt_compat      = sh7372_boards_compat_dt,
 MACHINE_END
 
index db99a4ade80cd46650dfad30a7d068c7a291bb8c..f7ecb0bc1beca876e5f725c819546061c2432743 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/platform_device.h>
+#include <linux/of_platform.h>
 #include <linux/delay.h>
 #include <linux/input.h>
 #include <linux/io.h>
@@ -754,7 +755,7 @@ static struct platform_device pmu_device = {
        .resource       = pmu_resources,
 };
 
-static struct platform_device *sh73a0_early_devices[] __initdata = {
+static struct platform_device *sh73a0_early_devices_dt[] __initdata = {
        &scif0_device,
        &scif1_device,
        &scif2_device,
@@ -765,6 +766,9 @@ static struct platform_device *sh73a0_early_devices[] __initdata = {
        &scif7_device,
        &scif8_device,
        &cmt10_device,
+};
+
+static struct platform_device *sh73a0_early_devices[] __initdata = {
        &tmu00_device,
        &tmu01_device,
 };
@@ -787,6 +791,8 @@ void __init sh73a0_add_standard_devices(void)
        /* Clear software reset bit on SY-DMAC module */
        __raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2);
 
+       platform_add_devices(sh73a0_early_devices_dt,
+                           ARRAY_SIZE(sh73a0_early_devices_dt));
        platform_add_devices(sh73a0_early_devices,
                            ARRAY_SIZE(sh73a0_early_devices));
        platform_add_devices(sh73a0_late_devices,
@@ -796,7 +802,7 @@ void __init sh73a0_add_standard_devices(void)
 /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
 void __init __weak sh73a0_register_twd(void) { }
 
-static void __init sh73a0_earlytimer_init(void)
+void __init sh73a0_earlytimer_init(void)
 {
        sh73a0_clock_init();
        shmobile_earlytimer_init();
@@ -805,12 +811,63 @@ static void __init sh73a0_earlytimer_init(void)
 
 void __init sh73a0_add_early_devices(void)
 {
+       early_platform_add_devices(sh73a0_early_devices_dt,
+                                  ARRAY_SIZE(sh73a0_early_devices_dt));
        early_platform_add_devices(sh73a0_early_devices,
                                   ARRAY_SIZE(sh73a0_early_devices));
 
        /* setup early console here as well */
        shmobile_setup_console();
+}
+
+#ifdef CONFIG_USE_OF
+
+/* Please note that the clock initialisation shcheme used in
+ * sh73a0_add_early_devices_dt() and sh73a0_add_standard_devices_dt()
+ * does not work with SMP as there is a yet to be resolved lock-up in
+ * workqueue initialisation.
+ *
+ * CONFIG_SMP should be disabled when using this code.
+ */
+
+void __init sh73a0_add_early_devices_dt(void)
+{
+       shmobile_setup_delay(1196, 44, 46); /* Cortex-A9 @ 1196MHz */
+
+       early_platform_add_devices(sh73a0_early_devices_dt,
+                                  ARRAY_SIZE(sh73a0_early_devices_dt));
+
+       /* setup early console here as well */
+       shmobile_setup_console();
+}
 
-       /* override timer setup with soc-specific code */
-       shmobile_timer.init = sh73a0_earlytimer_init;
+static const struct of_dev_auxdata sh73a0_auxdata_lookup[] __initconst = {
+       {},
+};
+
+void __init sh73a0_add_standard_devices_dt(void)
+{
+       /* clocks are setup late during boot in the case of DT */
+       sh73a0_clock_init();
+
+       platform_add_devices(sh73a0_early_devices_dt,
+                            ARRAY_SIZE(sh73a0_early_devices_dt));
+       of_platform_populate(NULL, of_default_bus_match_table,
+                            sh73a0_auxdata_lookup, NULL);
 }
+
+static const char *sh73a0_boards_compat_dt[] __initdata = {
+       "renesas,sh73a0",
+       NULL,
+};
+
+DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
+       .map_io         = sh73a0_map_io,
+       .init_early     = sh73a0_add_early_devices_dt,
+       .nr_irqs        = NR_IRQS_LEGACY,
+       .init_irq       = sh73a0_init_irq_dt,
+       .init_machine   = sh73a0_add_standard_devices_dt,
+       .init_time      = shmobile_timer_init,
+       .dt_compat      = sh73a0_boards_compat_dt,
+MACHINE_END
+#endif /* CONFIG_USE_OF */
index 1d564674451d5c887adfffe45546cc1943388f57..a9df53b69ab8ead409fe78352f3c707f6a2ade1f 100644 (file)
@@ -59,16 +59,18 @@ sh7372_do_idle_sysc:
        mcr     p15, 0, r0, c1, c0, 0
        isb
 
+       /*
+        * Clean and invalidate data cache again.
+        */
+       ldr     r1, kernel_flush
+       blx     r1
+
        /* disable L2 cache in the aux control register */
        mrc     p15, 0, r10, c1, c0, 1
        bic     r10, r10, #2
        mcr     p15, 0, r10, c1, c0, 1
+       isb
 
-       /*
-        * Invalidate data cache again.
-        */
-       ldr     r1, kernel_flush
-       blx     r1
        /*
         * The kernel doesn't interwork: v7_flush_dcache_all in particluar will
         * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled.
index f6745628628003f6f23e5e16c3ea175177f256a6..953eb1f9388d672bd763d0287ea32f214438e840 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/io.h>
 #include <linux/delay.h>
+#include <linux/irqchip/arm-gic.h>
 #include <mach/common.h>
 #include <mach/emev2.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_scu.h>
-#include <asm/hardware/gic.h>
 #include <asm/cacheflush.h>
 
 #define EMEV2_SCU_BASE 0x1e000000
@@ -100,7 +100,7 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *
        /* Tell ROM loader about our vector (in headsmp.S) */
        emev2_set_boot_vector(__pa(shmobile_secondary_vector));
 
-       gic_raise_softirq(cpumask_of(cpu), 0);
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
        return 0;
 }
 
index 2ce6af9a6a3763954c79b757450adc20007cfd40..3a4acf23edcf5c920ba1c4e9a665d676d704ab47 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/io.h>
 #include <linux/delay.h>
+#include <linux/irqchip/arm-gic.h>
 #include <mach/common.h>
 #include <mach/r8a7779.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_scu.h>
 #include <asm/smp_twd.h>
-#include <asm/hardware/gic.h>
 
 #define AVECR IOMEM(0xfe700040)
 
index 624f00f70abf79e266504073ce99e8a170f43e77..acb46a94ccdfb8ec967ed5e52e5a9593f531c414 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/io.h>
 #include <linux/delay.h>
+#include <linux/irqchip/arm-gic.h>
 #include <mach/common.h>
+#include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
 #include <mach/sh73a0.h>
 #include <asm/smp_scu.h>
 #include <asm/smp_twd.h>
-#include <asm/hardware/gic.h>
 
 #define WUPCR          IOMEM(0xe6151010)
 #define SRESCR         IOMEM(0xe6151018)
 #define SBAR           IOMEM(0xe6180020)
 #define APARMBAREA     IOMEM(0xe6f10020)
 
+#define PSTR_SHUTDOWN_MODE     3
+
 static void __iomem *scu_base_addr(void)
 {
        return (void __iomem *)0xf0000000;
 }
 
-static DEFINE_SPINLOCK(scu_lock);
-static unsigned long tmp;
-
 #ifdef CONFIG_HAVE_ARM_TWD
 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);
 void __init sh73a0_register_twd(void)
@@ -52,20 +52,6 @@ void __init sh73a0_register_twd(void)
 }
 #endif
 
-static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
-{
-       void __iomem *scu_base = scu_base_addr();
-
-       spin_lock(&scu_lock);
-       tmp = __raw_readl(scu_base + 8);
-       tmp &= ~clr;
-       tmp |= set;
-       spin_unlock(&scu_lock);
-
-       /* disable cache coherency after releasing the lock */
-       __raw_writel(tmp, scu_base + 8);
-}
-
 static unsigned int __init sh73a0_get_core_count(void)
 {
        void __iomem *scu_base = scu_base_addr();
@@ -82,9 +68,6 @@ static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct
 {
        cpu = cpu_logical_map(cpu);
 
-       /* enable cache coherency */
-       modify_scu_cpu_psr(0, 3 << (cpu * 8));
-
        if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3)
                __raw_writel(1 << cpu, WUPCR);  /* wake up */
        else
@@ -95,16 +78,14 @@ static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct
 
 static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus)
 {
-       int cpu = cpu_logical_map(0);
-
        scu_enable(scu_base_addr());
 
-       /* Map the reset vector (in headsmp.S) */
+       /* Map the reset vector (in headsmp-sh73a0.S) */
        __raw_writel(0, APARMBAREA);      /* 4k */
-       __raw_writel(__pa(shmobile_secondary_vector), SBAR);
+       __raw_writel(__pa(sh73a0_secondary_vector), SBAR);
 
-       /* enable cache coherency on CPU0 */
-       modify_scu_cpu_psr(0, 3 << (cpu * 8));
+       /* enable cache coherency on booting CPU */
+       scu_power_mode(scu_base_addr(), SCU_PM_NORMAL);
 }
 
 static void __init sh73a0_smp_init_cpus(void)
@@ -114,16 +95,20 @@ static void __init sh73a0_smp_init_cpus(void)
        shmobile_smp_init_cpus(ncores);
 }
 
-static int __maybe_unused sh73a0_cpu_kill(unsigned int cpu)
+#ifdef CONFIG_HOTPLUG_CPU
+static int sh73a0_cpu_kill(unsigned int cpu)
 {
+
        int k;
+       u32 pstr;
 
-       /* this function is running on another CPU than the offline target,
-        * here we need wait for shutdown code in platform_cpu_die() to
-        * finish before asking SoC-specific code to power off the CPU core.
+       /*
+        * wait until the power status register confirms the shutdown of the
+        * offline target
         */
        for (k = 0; k < 1000; k++) {
-               if (shmobile_cpu_is_dead(cpu))
+               pstr = (__raw_readl(PSTR) >> (4 * cpu)) & 3;
+               if (pstr == PSTR_SHUTDOWN_MODE)
                        return 1;
 
                mdelay(1);
@@ -132,6 +117,23 @@ static int __maybe_unused sh73a0_cpu_kill(unsigned int cpu)
        return 0;
 }
 
+static void sh73a0_cpu_die(unsigned int cpu)
+{
+       /*
+        * The ARM MPcore does not issue a cache coherency request for the L1
+        * cache when powering off single CPUs. We must take care of this and
+        * further caches.
+        */
+       dsb();
+       flush_cache_all();
+
+       /* Set power off mode. This takes the CPU out of the MP cluster */
+       scu_power_mode(scu_base_addr(), SCU_PM_POWEROFF);
+
+       /* Enter shutdown mode */
+       cpu_do_idle();
+}
+#endif /* CONFIG_HOTPLUG_CPU */
 
 struct smp_operations sh73a0_smp_ops __initdata = {
        .smp_init_cpus          = sh73a0_smp_init_cpus,
@@ -140,7 +142,7 @@ struct smp_operations sh73a0_smp_ops __initdata = {
        .smp_boot_secondary     = sh73a0_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
        .cpu_kill               = sh73a0_cpu_kill,
-       .cpu_die                = shmobile_cpu_die,
-       .cpu_disable            = shmobile_cpu_disable,
+       .cpu_die                = sh73a0_cpu_die,
+       .cpu_disable            = shmobile_cpu_disable_any,
 #endif
 };
index a68919727e24dddcd2431db2864d4f7dd6da15cb..fdbe54a1155567c8ddb08329b60f76c03020c6ab 100644 (file)
@@ -60,10 +60,6 @@ void __init shmobile_earlytimer_init(void)
        late_time_init = shmobile_late_time_init;
 }
 
-static void __init shmobile_timer_init(void)
+void __init shmobile_timer_init(void)
 {
 }
-
-struct sys_timer shmobile_timer = {
-       .init           = shmobile_timer_init,
-};
index 68dd1b69512acc5f02770ae1a0a0493ba11862bd..4e9e69d9e7de7a69934b17c1e120642f350c3eaa 100644 (file)
@@ -22,9 +22,9 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/cacheflush.h>
-#include <asm/hardware/gic.h>
 #include <asm/smp_scu.h>
 #include <asm/smp_plat.h>
 
@@ -83,8 +83,6 @@ static void __init socfpga_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
index 6732924a5fee2900fb8b9bc97c39921cd966b136..27d68468a027b85aaebccc6fc6b9833baa8b4960 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include <linux/dw_apb_timer.h>
+#include <linux/irqchip.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -62,11 +62,6 @@ static void __init socfpga_map_io(void)
        early_printk("Early printk initialized\n");
 }
 
-const static struct of_device_id irq_match[] = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       {}
-};
-
 void __init socfpga_sysmgr_init(void)
 {
        struct device_node *np;
@@ -78,9 +73,9 @@ void __init socfpga_sysmgr_init(void)
        rst_manager_base_addr = of_iomap(np, 0);
 }
 
-static void __init gic_init_irq(void)
+static void __init socfpga_init_irq(void)
 {
-       of_irq_init(irq_match);
+       irqchip_init();
        socfpga_sysmgr_init();
 }
 
@@ -105,9 +100,8 @@ static const char *altera_dt_match[] = {
 DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
        .smp            = smp_ops(socfpga_smp_ops),
        .map_io         = socfpga_map_io,
-       .init_irq       = gic_init_irq,
-       .handle_irq     = gic_handle_irq,
-       .timer          = &dw_apb_timer,
+       .init_irq       = socfpga_init_irq,
+       .init_time      = dw_apb_timer_init,
        .init_machine   = socfpga_cyclone5_init,
        .restart        = socfpga_cyclone5_restart,
        .dt_compat      = altera_dt_match,
index c33f4d9361bd6baa9eec4a1bff3d0b930bfa0a55..633e678e01a3231c2480ee0756e8d95150f08345 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/mach/time.h>
 
 /* Add spear13xx structure declarations here */
-extern struct sys_timer spear13xx_timer;
+extern void spear13xx_timer_init(void);
 extern struct pl022_ssp_controller pl022_plat_data;
 extern struct dw_dma_platform_data dmac_plat_data;
 extern struct dw_dma_slave cf_dma_priv;
@@ -28,7 +28,6 @@ extern struct dw_dma_slave nand_write_dma_priv;
 /* Add spear13xx family function declarations here */
 void __init spear_setup_of_timer(void);
 void __init spear13xx_map_io(void);
-void __init spear13xx_dt_init_irq(void);
 void __init spear13xx_l2x0_init(void);
 bool dw_dma_filter(struct dma_chan *chan, void *slave);
 void spear_restart(char, const char *);
index 2eaa3fa7b4328f9d560e4b2430e462c4f63f8b4a..af4ade61cd952dd13490fdec1c03e1e0b307c2bf 100644 (file)
@@ -15,8 +15,8 @@
 #include <linux/jiffies.h>
 #include <linux/io.h>
 #include <linux/smp.h>
+#include <linux/irqchip/arm-gic.h>
 #include <asm/cacheflush.h>
-#include <asm/hardware/gic.h>
 #include <asm/smp_scu.h>
 #include <mach/spear.h>
 #include <mach/generic.h>
@@ -104,8 +104,6 @@ static void __init spear13xx_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus)
index 02f4724bb0d487d4d6440e302ccd4cb0d0993301..56214d1076ef6ff092e3ca9d427c217f539fd8cc 100644 (file)
@@ -14,9 +14,9 @@
 #define pr_fmt(fmt) "SPEAr1310: " fmt
 
 #include <linux/amba/pl022.h>
+#include <linux/irqchip.h>
 #include <linux/of_platform.h>
 #include <linux/pata_arasan_cf_data.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <mach/generic.h>
@@ -90,9 +90,8 @@ static void __init spear1310_map_io(void)
 DT_MACHINE_START(SPEAR1310_DT, "ST SPEAr1310 SoC with Flattened Device Tree")
        .smp            =       smp_ops(spear13xx_smp_ops),
        .map_io         =       spear1310_map_io,
-       .init_irq       =       spear13xx_dt_init_irq,
-       .handle_irq     =       gic_handle_irq,
-       .timer          =       &spear13xx_timer,
+       .init_irq       =       irqchip_init,
+       .init_time      =       spear13xx_timer_init,
        .init_machine   =       spear1310_dt_init,
        .restart        =       spear_restart,
        .dt_compat      =       spear1310_dt_board_compat,
index 081014fb314a9e4b979a249c3271fdcd828bf9db..9a28beb2a11393634aa3a41016acc36d95c54618 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/delay.h>
 #include <linux/dw_dmac.h>
 #include <linux/of_platform.h>
-#include <asm/hardware/gic.h>
+#include <linux/irqchip.h>
 #include <asm/mach/arch.h>
 #include <mach/dma.h>
 #include <mach/generic.h>
@@ -184,9 +184,8 @@ static const char * const spear1340_dt_board_compat[] = {
 DT_MACHINE_START(SPEAR1340_DT, "ST SPEAr1340 SoC with Flattened Device Tree")
        .smp            =       smp_ops(spear13xx_smp_ops),
        .map_io         =       spear13xx_map_io,
-       .init_irq       =       spear13xx_dt_init_irq,
-       .handle_irq     =       gic_handle_irq,
-       .timer          =       &spear13xx_timer,
+       .init_irq       =       irqchip_init,
+       .init_time      =       spear13xx_timer_init,
        .init_machine   =       spear1340_dt_init,
        .restart        =       spear_restart,
        .dt_compat      =       spear1340_dt_board_compat,
index c4af775a8451a6067f5c4c8ecb30ef1da2d902f8..c7d2b4a8d8cc8dade91873b7a137656395b40051 100644 (file)
@@ -17,9 +17,8 @@
 #include <linux/clk.h>
 #include <linux/dw_dmac.h>
 #include <linux/err.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach/map.h>
 #include <asm/smp_twd.h>
 #include <mach/dma.h>
@@ -153,7 +152,7 @@ static void __init spear13xx_clk_init(void)
                pr_err("%s: Unknown machine\n", __func__);
 }
 
-static void __init spear13xx_timer_init(void)
+void __init spear13xx_timer_init(void)
 {
        char pclk_name[] = "osc_24m_clk";
        struct clk *gpt_clk, *pclk;
@@ -182,17 +181,3 @@ static void __init spear13xx_timer_init(void)
        spear_setup_of_timer();
        twd_local_timer_of_register();
 }
-
-struct sys_timer spear13xx_timer = {
-       .init = spear13xx_timer_init,
-};
-
-static const struct of_device_id gic_of_match[] __initconst = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init },
-       { /* Sentinel */ }
-};
-
-void __init spear13xx_dt_init_irq(void)
-{
-       of_irq_init(gic_of_match);
-}
index ce19113ca791ae1478cc0b846bdc7bf511cf7533..df310799e4166d5f78178202beb101575274136d 100644 (file)
@@ -22,7 +22,7 @@
 #include <asm/mach/map.h>
 
 /* Add spear3xx family device structure declarations here */
-extern struct sys_timer spear3xx_timer;
+extern void spear3xx_timer_init(void);
 extern struct pl022_ssp_controller pl022_plat_data;
 extern struct pl08x_platform_data pl080_plat_data;
 
@@ -30,7 +30,6 @@ extern struct pl08x_platform_data pl080_plat_data;
 void __init spear_setup_of_timer(void);
 void __init spear3xx_clk_init(void);
 void __init spear3xx_map_io(void);
-void __init spear3xx_dt_init_irq(void);
 
 void spear_restart(char, const char *);
 
index a69cbfdb07ee42c17451bf9cfa52952b5ca1382b..bbc9b7e9c62c39bca8753f225a5ecb450783a6a6 100644 (file)
@@ -14,8 +14,8 @@
 #define pr_fmt(fmt) "SPEAr300: " fmt
 
 #include <linux/amba/pl08x.h>
+#include <linux/irqchip.h>
 #include <linux/of_platform.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <mach/generic.h>
 #include <mach/spear.h>
@@ -212,9 +212,8 @@ static void __init spear300_map_io(void)
 
 DT_MACHINE_START(SPEAR300_DT, "ST SPEAr300 SoC with Flattened Device Tree")
        .map_io         =       spear300_map_io,
-       .init_irq       =       spear3xx_dt_init_irq,
-       .handle_irq     =       vic_handle_irq,
-       .timer          =       &spear3xx_timer,
+       .init_irq       =       irqchip_init,
+       .init_time      =       spear3xx_timer_init,
        .init_machine   =       spear300_dt_init,
        .restart        =       spear_restart,
        .dt_compat      =       spear300_dt_board_compat,
index b963ebb10b564edaaa37ba5028887fb557dcd920..c13a434a81959309b59f0ce3919f2704aa371063 100644 (file)
@@ -15,8 +15,8 @@
 
 #include <linux/amba/pl08x.h>
 #include <linux/amba/serial.h>
+#include <linux/irqchip.h>
 #include <linux/of_platform.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <mach/generic.h>
 #include <mach/spear.h>
@@ -254,9 +254,8 @@ static void __init spear310_map_io(void)
 
 DT_MACHINE_START(SPEAR310_DT, "ST SPEAr310 SoC with Flattened Device Tree")
        .map_io         =       spear310_map_io,
-       .init_irq       =       spear3xx_dt_init_irq,
-       .handle_irq     =       vic_handle_irq,
-       .timer          =       &spear3xx_timer,
+       .init_irq       =       irqchip_init,
+       .init_time      =       spear3xx_timer_init,
        .init_machine   =       spear310_dt_init,
        .restart        =       spear_restart,
        .dt_compat      =       spear310_dt_board_compat,
index 66e3a0c33e757c84d25ec218a2815f456cda3c47..e1c77079a3e52f8805bd0c9ad5a3c9b61ccd2624 100644 (file)
@@ -16,8 +16,8 @@
 #include <linux/amba/pl022.h>
 #include <linux/amba/pl08x.h>
 #include <linux/amba/serial.h>
+#include <linux/irqchip.h>
 #include <linux/of_platform.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <mach/generic.h>
 #include <mach/spear.h>
@@ -268,9 +268,8 @@ static void __init spear320_map_io(void)
 
 DT_MACHINE_START(SPEAR320_DT, "ST SPEAr320 SoC with Flattened Device Tree")
        .map_io         =       spear320_map_io,
-       .init_irq       =       spear3xx_dt_init_irq,
-       .handle_irq     =       vic_handle_irq,
-       .timer          =       &spear3xx_timer,
+       .init_irq       =       irqchip_init,
+       .init_time      =       spear3xx_timer_init,
        .init_machine   =       spear320_dt_init,
        .restart        =       spear_restart,
        .dt_compat      =       spear320_dt_board_compat,
index 38fe95db31a70a69c241699edf2b5022be8d698a..b2ba516ca2d4ee4a46e8eb9a4a328bebb09aa3dd 100644 (file)
 
 #include <linux/amba/pl022.h>
 #include <linux/amba/pl08x.h>
-#include <linux/irqchip/spear-shirq.h>
-#include <linux/of_irq.h>
 #include <linux/io.h>
 #include <asm/hardware/pl080.h>
-#include <asm/hardware/vic.h>
 #include <plat/pl080.h>
 #include <mach/generic.h>
 #include <mach/spear.h>
@@ -87,7 +84,7 @@ void __init spear3xx_map_io(void)
        iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
 }
 
-static void __init spear3xx_timer_init(void)
+void __init spear3xx_timer_init(void)
 {
        char pclk_name[] = "pll3_clk";
        struct clk *gpt_clk, *pclk;
@@ -115,20 +112,3 @@ static void __init spear3xx_timer_init(void)
 
        spear_setup_of_timer();
 }
-
-struct sys_timer spear3xx_timer = {
-       .init = spear3xx_timer_init,
-};
-
-static const struct of_device_id vic_of_match[] __initconst = {
-       { .compatible = "arm,pl190-vic", .data = vic_of_init, },
-       { .compatible = "st,spear300-shirq", .data = spear300_shirq_of_init, },
-       { .compatible = "st,spear310-shirq", .data = spear310_shirq_of_init, },
-       { .compatible = "st,spear320-shirq", .data = spear320_shirq_of_init, },
-       { /* Sentinel */ }
-};
-
-void __init spear3xx_dt_init_irq(void)
-{
-       of_irq_init(vic_of_match);
-}
index 5a5a52db252bf79d6d776c4a2cbdbbf330ba9e43..b8bd33ca88bdba6a7d880bfd8ef56d8cf3507dc3 100644 (file)
 #include <linux/amba/pl08x.h>
 #include <linux/clk.h>
 #include <linux/err.h>
+#include <linux/irqchip.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <asm/hardware/pl080.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <asm/mach/map.h>
@@ -374,7 +373,7 @@ void __init spear6xx_map_io(void)
        iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc));
 }
 
-static void __init spear6xx_timer_init(void)
+void __init spear6xx_timer_init(void)
 {
        char pclk_name[] = "pll3_clk";
        struct clk *gpt_clk, *pclk;
@@ -403,10 +402,6 @@ static void __init spear6xx_timer_init(void)
        spear_setup_of_timer();
 }
 
-struct sys_timer spear6xx_timer = {
-       .init = spear6xx_timer_init,
-};
-
 /* Add auxdata to pass platform data */
 struct of_dev_auxdata spear6xx_auxdata_lookup[] __initdata = {
        OF_DEV_AUXDATA("arm,pl080", SPEAR6XX_ICM3_DMA_BASE, NULL,
@@ -425,21 +420,10 @@ static const char *spear600_dt_board_compat[] = {
        NULL
 };
 
-static const struct of_device_id vic_of_match[] __initconst = {
-       { .compatible = "arm,pl190-vic", .data = vic_of_init, },
-       { /* Sentinel */ }
-};
-
-static void __init spear6xx_dt_init_irq(void)
-{
-       of_irq_init(vic_of_match);
-}
-
 DT_MACHINE_START(SPEAR600_DT, "ST SPEAr600 (Flattened Device Tree)")
        .map_io         =       spear6xx_map_io,
-       .init_irq       =       spear6xx_dt_init_irq,
-       .handle_irq     =       vic_handle_irq,
-       .timer          =       &spear6xx_timer,
+       .init_irq       =       irqchip_init,
+       .init_time      =       spear6xx_timer_init,
        .init_machine   =       spear600_dt_init,
        .restart        =       spear_restart,
        .dt_compat      =       spear600_dt_board_compat,
index 1dc8a92e5a5fd4d4d5ba76b67cdeab0f58d81b23..fb8fbcecb17f3038a989dc4dae3154d10bc5b233 100644 (file)
@@ -21,8 +21,6 @@
 
 #include <linux/irqchip/sunxi.h>
 
-#include <asm/hardware/vic.h>
-
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
@@ -91,6 +89,6 @@ DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
        .init_irq       = sunxi_init_irq,
        .handle_irq     = sunxi_handle_irq,
        .restart        = sunxi_restart,
-       .timer          = &sunxi_timer,
+       .init_time      = &sunxi_timer_init,
        .dt_compat      = sunxi_board_dt_compat,
 MACHINE_END
index 734d9cc87f2e4ef0daf7b66be2ce5995585bd585..5ed81bab2d4bb4eb6aaf561200c400cc8d1cc506 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_fdt.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pda_power.h>
 #include <linux/platform_data/tegra_usb.h>
@@ -34,7 +33,6 @@
 #include <linux/i2c-tegra.h>
 #include <linux/usb/tegra_usb_phy.h>
 
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
@@ -202,8 +200,7 @@ DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
        .smp            = smp_ops(tegra_smp_ops),
        .init_early     = tegra20_init_early,
        .init_irq       = tegra_dt_init_irq,
-       .handle_irq     = gic_handle_irq,
-       .timer          = &tegra_sys_timer,
+       .init_time      = tegra_init_timer,
        .init_machine   = tegra_dt_init,
        .init_late      = tegra_dt_init_late,
        .restart        = tegra_assert_system_reset,
index 6497d1236b081c63fe0bd9e3a7b14137b89e6701..12dc2ddeca640914c694d92a0735813de37c6591 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/of_platform.h>
 
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 
 #include "board.h"
 #include "clock.h"
@@ -112,8 +111,7 @@ DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
        .map_io         = tegra_map_common_io,
        .init_early     = tegra30_init_early,
        .init_irq       = tegra_dt_init_irq,
-       .handle_irq     = gic_handle_irq,
-       .timer          = &tegra_sys_timer,
+       .init_time      = tegra_init_timer,
        .init_machine   = tegra30_dt_init,
        .init_late      = tegra_init_late,
        .restart        = tegra_assert_system_reset,
index 91fbe733a21eae9be6a5e24df8740ab3d3474efd..744cdd246f6a26ccb00b52f7c16811548f3f585a 100644 (file)
@@ -55,5 +55,5 @@ static inline int harmony_pcie_init(void) { return 0; }
 
 void __init tegra_paz00_wifikill_init(void);
 
-extern struct sys_timer tegra_sys_timer;
+extern void tegra_init_timer(void);
 #endif
index d54cfc54b9fe2cc959ced2b12be5a0b7258b39ad..3599959517b3059b63277163d5f6ab8e7c67b854 100644 (file)
 #include <linux/io.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
-#include <linux/of_irq.h>
+#include <linux/irqchip.h>
 
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/gic.h>
 
 #include <mach/powergate.h>
 
@@ -57,15 +56,10 @@ u32 tegra_uart_config[4] = {
 };
 
 #ifdef CONFIG_OF
-static const struct of_device_id tegra_dt_irq_match[] __initconst = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init },
-       { }
-};
-
 void __init tegra_dt_init_irq(void)
 {
        tegra_init_irq();
-       of_irq_init(tegra_dt_irq_match);
+       irqchip_init();
 }
 #endif
 
index b7886f183511dbdebb352f8f31e58de402fcc759..2ff2128cb9d80f64c0933f7384a6f3c9884868bd 100644 (file)
@@ -22,8 +22,7 @@
 #include <linux/irq.h>
 #include <linux/io.h>
 #include <linux/of.h>
-
-#include <asm/hardware/gic.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include "board.h"
 #include "iomap.h"
index 1b926df99c4b2a5c8929f28b180a36aaba9ee5a0..18d7290cf93b63dbe592591bfb6b4ed87be76ff0 100644 (file)
@@ -18,9 +18,9 @@
 #include <linux/jiffies.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/cacheflush.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach-types.h>
 #include <asm/smp_scu.h>
 
@@ -159,8 +159,6 @@ static void __init tegra_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
index e4863f3e9ee7a05367d6f8fa7c34b03fe72a7f0d..eba0969ded196978185065ba3872f76d25ad7dbd 100644 (file)
@@ -168,7 +168,7 @@ static const struct of_device_id rtc_match[] __initconst = {
        {}
 };
 
-static void __init tegra_init_timer(void)
+void __init tegra_init_timer(void)
 {
        struct device_node *np;
        struct clk *clk;
@@ -259,24 +259,16 @@ static void __init tegra_init_timer(void)
                BUG();
        }
 
-       clockevents_calc_mult_shift(&tegra_clockevent, 1000000, 5);
-       tegra_clockevent.max_delta_ns =
-               clockevent_delta2ns(0x1fffffff, &tegra_clockevent);
-       tegra_clockevent.min_delta_ns =
-               clockevent_delta2ns(0x1, &tegra_clockevent);
        tegra_clockevent.cpumask = cpu_all_mask;
        tegra_clockevent.irq = tegra_timer_irq.irq;
-       clockevents_register_device(&tegra_clockevent);
+       clockevents_config_and_register(&tegra_clockevent, 1000000,
+                                       0x1, 0x1fffffff);
 #ifdef CONFIG_HAVE_ARM_TWD
        twd_local_timer_of_register();
 #endif
        register_persistent_clock(NULL, tegra_read_persistent_clock);
 }
 
-struct sys_timer tegra_sys_timer = {
-       .init = tegra_init_timer,
-};
-
 #ifdef CONFIG_PM
 static u32 usec_config;
 
index 4ce77cdc31ccc944765640fe269bd656ca8f619b..12060ae4e8f186f49467066fd6d8dc7de3092c49 100644 (file)
 #include <linux/dma-mapping.h>
 #include <linux/platform_data/clk-u300.h>
 #include <linux/platform_data/pinctrl-coh901.h>
+#include <linux/irqchip/arm-vic.h>
 
 #include <asm/types.h>
 #include <asm/setup.h>
 #include <asm/memory.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach/map.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -1779,8 +1779,7 @@ MACHINE_START(U300, "Ericsson AB U335 S335/B335 Prototype Board")
        .map_io         = u300_map_io,
        .nr_irqs        = 0,
        .init_irq       = u300_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &u300_timer,
+       .init_time      = u300_timer_init,
        .init_machine   = u300_init_machine,
        .restart        = u300_restart,
 MACHINE_END
index 1da10e20e996556f9b527f3bd19d40e831a6a857..d9e73209c9b8d7aa0d26b9957ed7401f9b53b61d 100644 (file)
@@ -349,7 +349,7 @@ static u32 notrace u300_read_sched_clock(void)
 /*
  * This sets up the system timers, clock source and clock event.
  */
-static void __init u300_timer_init(void)
+void __init u300_timer_init(void)
 {
        struct clk *clk;
        unsigned long rate;
@@ -413,11 +413,3 @@ static void __init u300_timer_init(void)
         * used by hrtimers!
         */
 }
-
-/*
- * Very simple system timer that only register the clock event and
- * clock source.
- */
-struct sys_timer u300_timer = {
-       .init           = u300_timer_init,
-};
index b5e9791762e063c90aa1880441337f908210ff65..d34287bc34f54364366b8dfdf03362719bff607a 100644 (file)
@@ -1 +1 @@
-extern struct sys_timer u300_timer;
+extern void u300_timer_init(void);
index d453522edb0d66b0488e46247fa4446876e69f6f..0e928d28175914daddaf63f496b29e8139be1d9f 100644 (file)
@@ -40,7 +40,6 @@
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 
 #include <mach/hardware.h>
 #include <mach/setup.h>
@@ -751,8 +750,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = mop500_init_machine,
        .init_late      = ux500_init_late,
 MACHINE_END
@@ -761,8 +759,7 @@ MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
        .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = mop500_init_machine,
        .init_late      = ux500_init_late,
 MACHINE_END
@@ -772,8 +769,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
        .smp            = smp_ops(ux500_smp_ops),
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = hrefv60_init_machine,
        .init_late      = ux500_init_late,
 MACHINE_END
@@ -784,8 +780,7 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = snowball_init_machine,
        .init_late      = NULL,
 MACHINE_END
index 5b286e06474ce481ff019f302bf1a66aec635687..218a6b1ada7e82e3859d00e25ee047f31ec2a0a8 100644 (file)
@@ -27,7 +27,6 @@
 #include <asm/pmu.h>
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/gic.h>
 
 #include <mach/hardware.h>
 #include <mach/setup.h>
@@ -341,8 +340,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)")
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = u8500_init_machine,
        .init_late      = NULL,
        .dt_compat      = stericsson_dt_platform_compat,
index 721e7b4275f3bc6496ff4ccb29fc419b572719f7..5dd90d31ffc3f4b07ccbb7c4c36743422592aa7b 100644 (file)
 #include <linux/of.h>
 #include <linux/of_irq.h>
 #include <linux/irq.h>
+#include <linux/irqchip.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/platform_data/clk-ux500.h>
 
-#include <asm/hardware/gic.h>
 #include <asm/mach/map.h>
 
 #include <mach/hardware.h>
@@ -42,11 +43,6 @@ void __iomem *_PRCMU_BASE;
  * This feels fragile because it depends on the gpio device getting probed
  * _before_ any device uses the gpio interrupts.
 */
-static const struct of_device_id ux500_dt_irq_match[] = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       {},
-};
-
 void __init ux500_init_irq(void)
 {
        void __iomem *dist_base;
@@ -62,7 +58,7 @@ void __init ux500_init_irq(void)
 
 #ifdef CONFIG_OF
        if (of_have_populated_dt())
-               of_irq_init(ux500_dt_irq_match);
+               irqchip_init();
        else
 #endif
                gic_init(0, 29, dist_base, cpu_base);
index 6be4c4d2ab8858b0b714dc95c4a8fad519a770f3..bddce2b493722f84c5821103a38eea4a85d8833d 100644 (file)
@@ -28,8 +28,7 @@ extern struct device *ux500_soc_device_init(const char *soc_id);
 struct amba_device;
 extern void __init amba_add_devices(struct amba_device *devs[], int num);
 
-struct sys_timer;
-extern struct sys_timer ux500_timer;
+extern void ux500_timer_init(void);
 
 #define __IO_DEV_DESC(x, sz)   {               \
        .virtual        = IO_ADDRESS(x),        \
index 3db7782f3afb3ed68e85eece8fec575524a08dbe..b8adac93421f378746fefbf17e98f87de80247c2 100644 (file)
@@ -16,9 +16,9 @@
 #include <linux/device.h>
 #include <linux/smp.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/cacheflush.h>
-#include <asm/hardware/gic.h>
 #include <asm/smp_plat.h>
 #include <asm/smp_scu.h>
 #include <mach/hardware.h>
@@ -91,7 +91,7 @@ static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *
         */
        write_pen_release(cpu_logical_map(cpu));
 
-       smp_send_reschedule(cpu);
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
 
        timeout = jiffies + (1 * HZ);
        while (time_before(jiffies, timeout)) {
@@ -155,8 +155,6 @@ static void __init ux500_smp_init_cpus(void)
 
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
index 875309acb02272cf76c405a72a319cf29dc16b6f..aa2a78acb59e9e6c35428ef0936e4a4e78b0b27e 100644 (file)
@@ -46,7 +46,7 @@ const static struct of_device_id prcmu_timer_of_match[] __initconst = {
        { },
 };
 
-static void __init ux500_timer_init(void)
+void __init ux500_timer_init(void)
 {
        void __iomem *mtu_timer_base;
        void __iomem *prcmu_timer_base;
@@ -99,14 +99,3 @@ dt_fail:
        clksrc_dbx500_prcmu_init(prcmu_timer_base);
        ux500_twd_init();
 }
-
-static void ux500_timer_reset(void)
-{
-       nmdk_clkevt_reset();
-       nmdk_clksrc_reset();
-}
-
-struct sys_timer ux500_timer = {
-       .init           = ux500_timer_init,
-       .resume         = ux500_timer_reset,
-};
index 5d5929450366a894aa2abea0ecee82113c75ac67..a42b89083eb25c8ce6d8e551dc4082e977085cc7 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/amba/mmci.h>
 #include <linux/amba/pl022.h>
 #include <linux/io.h>
+#include <linux/irqchip/arm-vic.h>
 #include <linux/irqchip/versatile-fpga.h>
 #include <linux/gfp.h>
 #include <linux/clkdev.h>
@@ -40,7 +41,6 @@
 #include <asm/irq.h>
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/icst.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 
 #include <asm/mach/arch.h>
@@ -770,7 +770,7 @@ void __init versatile_init(void)
 /*
  * Set up timer interrupt, and return the current time in seconds.
  */
-static void __init versatile_timer_init(void)
+void __init versatile_timer_init(void)
 {
        u32 val;
 
@@ -797,8 +797,3 @@ static void __init versatile_timer_init(void)
        sp804_clocksource_init(TIMER3_VA_BASE, "timer3");
        sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0");
 }
-
-struct sys_timer versatile_timer = {
-       .init           = versatile_timer_init,
-};
-
index 683e60776a85b7a29d5022bec2c87c4c0be7f933..5c1b87d1da6b5806807cad0cdf99e00cc982a2c0 100644 (file)
@@ -29,7 +29,7 @@ extern void __init versatile_init(void);
 extern void __init versatile_init_early(void);
 extern void __init versatile_init_irq(void);
 extern void __init versatile_map_io(void);
-extern struct sys_timer versatile_timer;
+extern void versatile_timer_init(void);
 extern void versatile_restart(char, const char *);
 extern unsigned int mmc_status(struct device *dev);
 #ifdef CONFIG_OF
index 98f65493177ae8c0b883a91d4e3c9a2a8258242a..1caef1093793de3d0580d26ff93cd711dfcb2717 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 
 #include <asm/mach/arch.h>
@@ -39,8 +38,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
        .map_io         = versatile_map_io,
        .init_early     = versatile_init_early,
        .init_irq       = versatile_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &versatile_timer,
+       .init_time      = versatile_timer_init,
        .init_machine   = versatile_init,
        .restart        = versatile_restart,
 MACHINE_END
index ae5ad3c8f3dd0184f0a4259986a9ee8131558703..2558f2e957c37cb63f32d1efd8c2d487e3add7b7 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/init.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
-#include <asm/hardware/vic.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
@@ -46,8 +45,7 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)")
        .map_io         = versatile_map_io,
        .init_early     = versatile_init_early,
        .init_irq       = versatile_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &versatile_timer,
+       .init_time      = versatile_timer_init,
        .init_machine   = versatile_dt_init,
        .dt_compat      = versatile_dt_match,
        .restart        = versatile_restart,
index 19738331bd3d1f4951c2f173dfac6659f800ea80..611d140c8695a35b9768221bd125ac76a7e393cc 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
-#include <asm/hardware/vic.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
@@ -107,8 +106,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
        .map_io         = versatile_map_io,
        .init_early     = versatile_init_early,
        .init_irq       = versatile_init_irq,
-       .handle_irq     = vic_handle_irq,
-       .timer          = &versatile_timer,
+       .init_time      = versatile_timer_init,
        .init_machine   = versatile_pb_init,
        .restart        = versatile_restart,
 MACHINE_END
index 60838ddb8564376efba0f6b5c1c1160154e0c343..6f34497a42451ea23ea5cea4633e4d47ffcd44ae 100644 (file)
 #include <linux/amba/clcd.h>
 #include <linux/clkdev.h>
 #include <linux/vexpress.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/gic.h>
 #include <asm/smp_scu.h>
 #include <asm/smp_twd.h>
 
@@ -182,8 +182,6 @@ static void __init ct_ca9x4_init_cpu_map(void)
 
        for (i = 0; i < ncores; ++i)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init ct_ca9x4_smp_enable(unsigned int max_cpus)
index c5d70de9bb4e20165fb9e6181e26f8cfafe3a0cb..dc1ace55d5578bdcb96930fa7dabde0bb692ddd9 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/vexpress.h>
 
 #include <asm/smp_scu.h>
-#include <asm/hardware/gic.h>
 #include <asm/mach/map.h>
 
 #include <mach/motherboard.h>
@@ -128,8 +127,6 @@ static void __init vexpress_dt_smp_init_cpus(void)
 
        for (i = 0; i < ncores; ++i)
                set_cpu_possible(i, true);
-
-       set_smp_cross_call(gic_raise_softirq);
 }
 
 static void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus)
index 011661a6c5cb6dd769c46e3efc50f409ee9e587c..915683cb67d60a6eed062fa49cbc7781a11f761b 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/io.h>
 #include <linux/smp.h>
 #include <linux/init.h>
+#include <linux/irqchip.h>
 #include <linux/of_address.h>
 #include <linux/of_fdt.h>
 #include <linux/of_irq.h>
@@ -30,7 +31,6 @@
 #include <asm/mach/time.h>
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/cache-l2x0.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/timer-sp.h>
 
 #include <mach/ct-ca9x4.h>
@@ -291,10 +291,6 @@ static void __init v2m_timer_init(void)
        v2m_sp804_init(ioremap(V2M_TIMER01, SZ_4K), IRQ_V2M_TIMER0);
 }
 
-static struct sys_timer v2m_timer = {
-       .init   = v2m_timer_init,
-};
-
 static void __init v2m_init_early(void)
 {
        if (ct_desc->init_early)
@@ -376,8 +372,7 @@ MACHINE_START(VEXPRESS, "ARM-Versatile Express")
        .map_io         = v2m_map_io,
        .init_early     = v2m_init_early,
        .init_irq       = v2m_init_irq,
-       .timer          = &v2m_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = v2m_timer_init,
        .init_machine   = v2m_init,
        .restart        = vexpress_restart,
 MACHINE_END
@@ -434,16 +429,6 @@ void __init v2m_dt_init_early(void)
        }
 }
 
-static  struct of_device_id vexpress_irq_match[] __initdata = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       {}
-};
-
-static void __init v2m_dt_init_irq(void)
-{
-       of_irq_init(vexpress_irq_match);
-}
-
 static void __init v2m_dt_timer_init(void)
 {
        struct device_node *node = NULL;
@@ -468,10 +453,6 @@ static void __init v2m_dt_timer_init(void)
                                24000000);
 }
 
-static struct sys_timer v2m_dt_timer = {
-       .init = v2m_dt_timer_init,
-};
-
 static const struct of_device_id v2m_dt_bus_match[] __initconst = {
        { .compatible = "simple-bus", },
        { .compatible = "arm,amba-bus", },
@@ -497,9 +478,8 @@ DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express")
        .smp            = smp_ops(vexpress_smp_ops),
        .map_io         = v2m_dt_map_io,
        .init_early     = v2m_dt_init_early,
-       .init_irq       = v2m_dt_init_irq,
-       .timer          = &v2m_dt_timer,
+       .init_irq       = irqchip_init,
+       .init_time      = v2m_dt_timer_init,
        .init_machine   = v2m_dt_init,
-       .handle_irq     = gic_handle_irq,
        .restart        = vexpress_restart,
 MACHINE_END
index 2ed0b7d95db61b39251ff67cfd45b5731892a5e7..c0b1c604ccf812090e6532f256f1eec0501667c4 100644 (file)
@@ -1,12 +1,34 @@
 config ARCH_VT8500
-       bool "VIA/WonderMedia 85xx" if ARCH_MULTI_V5
-       default ARCH_VT8500_SINGLE
+       bool
        select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
-       select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
        select HAVE_CLK
+       select VT8500_TIMER
        help
          Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
+
+config ARCH_WM8505
+       bool "VIA/Wondermedia 85xx and WM8650"
+       depends on ARCH_MULTI_V5
+       select ARCH_VT8500
+       select CPU_ARM926T
+       help
+
+config ARCH_WM8750
+       bool "WonderMedia WM8750"
+       depends on ARCH_MULTI_V6
+       select ARCH_VT8500
+       select CPU_V6
+       help
+         Support for WonderMedia WM8750 System-on-Chip.
+
+config ARCH_WM8850
+       bool "WonderMedia WM8850"
+       depends on ARCH_MULTI_V7
+       select ARCH_VT8500
+       select CPU_V7
+       help
+         Support for WonderMedia WM8850 System-on-Chip.
index e035251cda489c1b5ed8901449f539fcf514d151..92ceb2436b60151c4c729ab0d6554c21bdf494f9 100644 (file)
@@ -1 +1 @@
-obj-$(CONFIG_ARCH_VT8500) += irq.o timer.o vt8500.o
+obj-$(CONFIG_ARCH_VT8500) += irq.o vt8500.o
index 6f2b843115db96e50ecef39b189228d5983ec0a2..77611a6968d6c7d519214ef998e6df316f9c574e 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <linux/of.h>
 
-void __init vt8500_timer_init(void);
 int __init vt8500_irq_init(struct device_node *node,
                                struct device_node *parent);
 
diff --git a/arch/arm/mach-vt8500/include/mach/debug-macro.S b/arch/arm/mach-vt8500/include/mach/debug-macro.S
deleted file mode 100644 (file)
index ca292f2..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * arch/arm/mach-vt8500/include/mach/debug-macro.S
- *
- *  Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
- *
- * Debugging macro include header
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
-*/
-
-       .macro  addruart, rp, rv, tmp
-       mov     \rp,      #0x00200000
-       orr     \rv, \rp, #0xf8000000
-       orr     \rp, \rp, #0xd8000000
-       .endm
-
-       .macro  senduart,rd,rx
-       strb    \rd, [\rx, #0]
-       .endm
-
-       .macro  busyuart,rd,rx
-1001:  ldr     \rd, [\rx, #0x1c]
-       ands    \rd, \rd, #0x2
-       bne     1001b
-       .endm
-
-       .macro  waituart,rd,rx
-       .endm
diff --git a/arch/arm/mach-vt8500/include/mach/timex.h b/arch/arm/mach-vt8500/include/mach/timex.h
deleted file mode 100644 (file)
index 8487e4c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  arch/arm/mach-vt8500/include/mach/timex.h
- *
- *  Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef MACH_TIMEX_H
-#define MACH_TIMEX_H
-
-#define CLOCK_TICK_RATE                (3000000)
-
-#endif /* MACH_TIMEX_H */
diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h
deleted file mode 100644 (file)
index e6e81fd..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* arch/arm/mach-vt8500/include/mach/uncompress.h
- *
- * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
- *
- * Based on arch/arm/mach-dove/include/mach/uncompress.h
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
-
-#define UART0_PHYS     0xd8200000
-#define UART0_ADDR(x)  *(volatile unsigned char *)(UART0_PHYS + x)
-
-static void putc(const char c)
-{
-       while (UART0_ADDR(0x1c) & 0x2)
-               /* Tx busy, wait and poll */;
-
-       UART0_ADDR(0) = c;
-}
-
-static void flush(void)
-{
-}
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-vt8500/timer.c b/arch/arm/mach-vt8500/timer.c
deleted file mode 100644 (file)
index 3dd21a4..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- *  arch/arm/mach-vt8500/timer.c
- *
- *  Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
- *  Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/*
- * This file is copied and modified from the original timer.c provided by
- * Alexey Charkov. Minor changes have been made for Device Tree Support.
- */
-
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/clocksource.h>
-#include <linux/clockchips.h>
-#include <linux/delay.h>
-#include <asm/mach/time.h>
-
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-
-#define VT8500_TIMER_OFFSET    0x0100
-#define VT8500_TIMER_HZ                3000000
-#define TIMER_MATCH_VAL                0x0000
-#define TIMER_COUNT_VAL                0x0010
-#define TIMER_STATUS_VAL       0x0014
-#define TIMER_IER_VAL          0x001c          /* interrupt enable */
-#define TIMER_CTRL_VAL         0x0020
-#define TIMER_AS_VAL           0x0024          /* access status */
-#define TIMER_COUNT_R_ACTIVE   (1 << 5)        /* not ready for read */
-#define TIMER_COUNT_W_ACTIVE   (1 << 4)        /* not ready for write */
-#define TIMER_MATCH_W_ACTIVE   (1 << 0)        /* not ready for write */
-
-#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
-
-static void __iomem *regbase;
-
-static cycle_t vt8500_timer_read(struct clocksource *cs)
-{
-       int loops = msecs_to_loops(10);
-       writel(3, regbase + TIMER_CTRL_VAL);
-       while ((readl((regbase + TIMER_AS_VAL)) & TIMER_COUNT_R_ACTIVE)
-                                               && --loops)
-               cpu_relax();
-       return readl(regbase + TIMER_COUNT_VAL);
-}
-
-static struct clocksource clocksource = {
-       .name           = "vt8500_timer",
-       .rating         = 200,
-       .read           = vt8500_timer_read,
-       .mask           = CLOCKSOURCE_MASK(32),
-       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
-static int vt8500_timer_set_next_event(unsigned long cycles,
-                                   struct clock_event_device *evt)
-{
-       int loops = msecs_to_loops(10);
-       cycle_t alarm = clocksource.read(&clocksource) + cycles;
-       while ((readl(regbase + TIMER_AS_VAL) & TIMER_MATCH_W_ACTIVE)
-                                               && --loops)
-               cpu_relax();
-       writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);
-
-       if ((signed)(alarm - clocksource.read(&clocksource)) <= 16)
-               return -ETIME;
-
-       writel(1, regbase + TIMER_IER_VAL);
-
-       return 0;
-}
-
-static void vt8500_timer_set_mode(enum clock_event_mode mode,
-                             struct clock_event_device *evt)
-{
-       switch (mode) {
-       case CLOCK_EVT_MODE_RESUME:
-       case CLOCK_EVT_MODE_PERIODIC:
-               break;
-       case CLOCK_EVT_MODE_ONESHOT:
-       case CLOCK_EVT_MODE_UNUSED:
-       case CLOCK_EVT_MODE_SHUTDOWN:
-               writel(readl(regbase + TIMER_CTRL_VAL) | 1,
-                       regbase + TIMER_CTRL_VAL);
-               writel(0, regbase + TIMER_IER_VAL);
-               break;
-       }
-}
-
-static struct clock_event_device clockevent = {
-       .name           = "vt8500_timer",
-       .features       = CLOCK_EVT_FEAT_ONESHOT,
-       .rating         = 200,
-       .set_next_event = vt8500_timer_set_next_event,
-       .set_mode       = vt8500_timer_set_mode,
-};
-
-static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id)
-{
-       struct clock_event_device *evt = dev_id;
-       writel(0xf, regbase + TIMER_STATUS_VAL);
-       evt->event_handler(evt);
-
-       return IRQ_HANDLED;
-}
-
-static struct irqaction irq = {
-       .name    = "vt8500_timer",
-       .flags   = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler = vt8500_timer_interrupt,
-       .dev_id  = &clockevent,
-};
-
-static struct of_device_id vt8500_timer_ids[] = {
-       { .compatible = "via,vt8500-timer" },
-       { }
-};
-
-void __init vt8500_timer_init(void)
-{
-       struct device_node *np;
-       int timer_irq;
-
-       np = of_find_matching_node(NULL, vt8500_timer_ids);
-       if (!np) {
-               pr_err("%s: Timer description missing from Device Tree\n",
-                                                               __func__);
-               return;
-       }
-       regbase = of_iomap(np, 0);
-       if (!regbase) {
-               pr_err("%s: Missing iobase description in Device Tree\n",
-                                                               __func__);
-               of_node_put(np);
-               return;
-       }
-       timer_irq = irq_of_parse_and_map(np, 0);
-       if (!timer_irq) {
-               pr_err("%s: Missing irq description in Device Tree\n",
-                                                               __func__);
-               of_node_put(np);
-               return;
-       }
-
-       writel(1, regbase + TIMER_CTRL_VAL);
-       writel(0xf, regbase + TIMER_STATUS_VAL);
-       writel(~0, regbase + TIMER_MATCH_VAL);
-
-       if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ))
-               pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n",
-                                       __func__, clocksource.name);
-
-       clockevents_calc_mult_shift(&clockevent, VT8500_TIMER_HZ, 4);
-
-       /* copy-pasted from mach-msm; no idea */
-       clockevent.max_delta_ns =
-               clockevent_delta2ns(0xf0000000, &clockevent);
-       clockevent.min_delta_ns = clockevent_delta2ns(4, &clockevent);
-       clockevent.cpumask = cpumask_of(0);
-
-       if (setup_irq(timer_irq, &irq))
-               pr_err("%s: setup_irq failed for %s\n", __func__,
-                                                       clockevent.name);
-       clockevents_register_device(&clockevent);
-}
-
index 3c66d48ea082dbdcc24c8162711e6f52eca64a47..6141868b9a3ce694f7fed44680cba6c7ca60bdb8 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <linux/io.h>
 #include <linux/pm.h>
+#include <linux/vt8500_timer.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -175,21 +176,19 @@ static void __init vt8500_init_irq(void)
        of_irq_init(vt8500_irq_match);
 };
 
-static struct sys_timer vt8500_timer = {
-       .init = vt8500_timer_init,
-};
-
 static const char * const vt8500_dt_compat[] = {
        "via,vt8500",
        "wm,wm8650",
        "wm,wm8505",
+       "wm,wm8750",
+       "wm,wm8850",
 };
 
 DT_MACHINE_START(WMT_DT, "VIA/Wondermedia SoC (Device Tree Support)")
        .dt_compat      = vt8500_dt_compat,
        .map_io         = vt8500_map_io,
        .init_irq       = vt8500_init_irq,
-       .timer          = &vt8500_timer,
+       .init_time      = vt8500_timer_init,
        .init_machine   = vt8500_init,
        .restart        = vt8500_restart,
        .handle_irq     = vt8500_handle_irq,
index b4243e4f1565b4614db0a1ba64f21a92bdb0bb22..92f1c978f35e42b9bc73c6260674236414677cd7 100644 (file)
@@ -37,6 +37,6 @@ MACHINE_START(W90P910EVB, "W90P910EVB")
        .map_io         = nuc910evb_map_io,
        .init_irq       = nuc900_init_irq,
        .init_machine   = nuc910evb_init,
-       .timer          = &nuc900_timer,
+       .init_time      = nuc900_timer_init,
        .restart        = nuc9xx_restart,
 MACHINE_END
index 500fe5932ce98af8113872becbc6799a734f5f62..26f7189056e355909d79f6a401b298eff84a5657 100644 (file)
@@ -40,6 +40,6 @@ MACHINE_START(W90P950EVB, "W90P950EVB")
        .map_io         = nuc950evb_map_io,
        .init_irq       = nuc900_init_irq,
        .init_machine   = nuc950evb_init,
-       .timer          = &nuc900_timer,
+       .init_time      = nuc900_timer_init,
        .restart        = nuc9xx_restart,
 MACHINE_END
index cbb3adc3db1074471d96a112d8c7940fa51e2080..9b4e73fe10e526feca8cfe967c469f979509b314 100644 (file)
@@ -37,6 +37,6 @@ MACHINE_START(W90N960EVB, "W90N960EVB")
        .map_io         = nuc960evb_map_io,
        .init_irq       = nuc900_init_irq,
        .init_machine   = nuc960evb_init,
-       .timer          = &nuc900_timer,
+       .init_time      = nuc900_timer_init,
        .restart        = nuc9xx_restart,
 MACHINE_END
index 91acb404779326789f1ca0944422bc044715f667..88ef4b26708938aa89334266952b64ba057c7b11 100644 (file)
  *
  */
 struct map_desc;
-struct sys_timer;
 
 /* core initialisation functions */
 
 extern void nuc900_init_irq(void);
-extern struct sys_timer nuc900_timer;
+extern void nuc900_timer_init(void);
 extern void nuc9xx_restart(char, const char *);
index fa27c498ac0910fc3d6b7e936f1fb3ce09b81008..30fbca8445759aed5cef7350f91b4c8881e1da05 100644 (file)
@@ -91,7 +91,6 @@ static int nuc900_clockevent_setnextevent(unsigned long evt,
 
 static struct clock_event_device nuc900_clockevent_device = {
        .name           = "nuc900-timer0",
-       .shift          = 32,
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .set_mode       = nuc900_clockevent_setmode,
        .set_next_event = nuc900_clockevent_setnextevent,
@@ -133,15 +132,10 @@ static void __init nuc900_clockevents_init(void)
        __raw_writel(RESETINT, REG_TISR);
        setup_irq(IRQ_TIMER0, &nuc900_timer0_irq);
 
-       nuc900_clockevent_device.mult = div_sc(rate, NSEC_PER_SEC,
-                                       nuc900_clockevent_device.shift);
-       nuc900_clockevent_device.max_delta_ns = clockevent_delta2ns(0xffffffff,
-                                       &nuc900_clockevent_device);
-       nuc900_clockevent_device.min_delta_ns = clockevent_delta2ns(0xf,
-                                       &nuc900_clockevent_device);
        nuc900_clockevent_device.cpumask = cpumask_of(0);
 
-       clockevents_register_device(&nuc900_clockevent_device);
+       clockevents_config_and_register(&nuc900_clockevent_device, rate,
+                                       0xf, 0xffffffff);
 }
 
 static void __init nuc900_clocksource_init(void)
@@ -167,12 +161,8 @@ static void __init nuc900_clocksource_init(void)
                TDR_SHIFT, clocksource_mmio_readl_down);
 }
 
-static void __init nuc900_timer_init(void)
+void __init nuc900_timer_init(void)
 {
        nuc900_clocksource_init();
        nuc900_clockevents_init();
 }
-
-struct sys_timer nuc900_timer = {
-       .init           = nuc900_timer_init,
-};
index e16d4bed0f7aaf1e1d4f7f3423cf2c0a35fd41dd..6472a69cbfe110b5ab2cfeecc9574aff465be686 100644 (file)
@@ -31,7 +31,6 @@
 #include <asm/mach-types.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/hardware/gic.h>
 #include <asm/hardware/cache-l2x0.h>
 
 #include "common.h"
@@ -55,19 +54,6 @@ static void __init xilinx_init_machine(void)
        of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL);
 }
 
-static struct of_device_id irq_match[] __initdata = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       { }
-};
-
-/**
- * xilinx_irq_init() - Interrupt controller initialization for the GIC.
- */
-static void __init xilinx_irq_init(void)
-{
-       of_irq_init(irq_match);
-}
-
 #define SCU_PERIPH_PHYS                0xF8F00000
 #define SCU_PERIPH_SIZE                SZ_8K
 #define SCU_PERIPH_VIRT                (VMALLOC_END - SCU_PERIPH_SIZE)
@@ -93,13 +79,6 @@ static void __init xilinx_zynq_timer_init(void)
        xttcpss_timer_init();
 }
 
-/*
- * Instantiate and initialize the system timer structure
- */
-static struct sys_timer xttcpss_sys_timer = {
-       .init           = xilinx_zynq_timer_init,
-};
-
 /**
  * xilinx_map_io() - Create memory mappings needed for early I/O.
  */
@@ -117,9 +96,8 @@ static const char *xilinx_dt_match[] = {
 
 MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
        .map_io         = xilinx_map_io,
-       .init_irq       = xilinx_irq_init,
-       .handle_irq     = gic_handle_irq,
+       .init_irq       = irqchip_init,
        .init_machine   = xilinx_init_machine,
-       .timer          = &xttcpss_sys_timer,
+       .init_time      = xilinx_zynq_timer_init,
        .dt_compat      = xilinx_dt_match,
 MACHINE_END
index cbfbbe461788bb52c133119304d9aaa9ad31bb07..837a2d52e9db342f0c958ddf2128bb6f2bce0718 100644 (file)
@@ -156,14 +156,9 @@ void __init iop_init_time(unsigned long tick_rate)
        write_tmr0(timer_ctl & ~IOP_TMR_EN);
        write_tisr(1);
        setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
-       clockevents_calc_mult_shift(&iop_clockevent,
-                                   tick_rate, IOP_MIN_RANGE);
-       iop_clockevent.max_delta_ns =
-               clockevent_delta2ns(0xfffffffe, &iop_clockevent);
-       iop_clockevent.min_delta_ns =
-               clockevent_delta2ns(0xf, &iop_clockevent);
        iop_clockevent.cpumask = cpumask_of(0);
-       clockevents_register_device(&iop_clockevent);
+       clockevents_config_and_register(&iop_clockevent, tick_rate,
+                                       0xf, 0xfffffffe);
 
        /*
         * Set up free-running clocksource timer 1.
index 0f4fa863dd552403fa8107efe5df56def7108a26..5d5ac0f05422a45f49c09fb4c3f35e01b947d859 100644 (file)
@@ -156,7 +156,6 @@ orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
 static struct clock_event_device orion_clkevt = {
        .name           = "orion_tick",
        .features       = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
-       .shift          = 32,
        .rating         = 300,
        .set_next_event = orion_clkevt_next_event,
        .set_mode       = orion_clkevt_mode,
@@ -221,9 +220,6 @@ orion_time_init(void __iomem *_bridge_base, u32 _bridge_timer1_clr_mask,
         * Setup clockevent timer (interrupt-driven).
         */
        setup_irq(irq, &orion_timer_irq);
-       orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift);
-       orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe, &orion_clkevt);
-       orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt);
        orion_clkevt.cpumask = cpumask_of(0);
-       clockevents_register_device(&orion_clkevt);
+       clockevents_config_and_register(&orion_clkevt, tclk, 1, 0xfffffffe);
 }
index b69e11dc679da60d8c800c0658a30c84b47437e8..37703ef6dfc76ff28b70543b55311f7abc52269b 100644 (file)
@@ -194,8 +194,7 @@ extern void s3c24xx_init_uartdevs(char *name,
 
 /* timer for 2410/2440 */
 
-struct sys_timer;
-extern struct sys_timer s3c24xx_timer;
+extern void s3c24xx_timer_init(void);
 
 extern struct syscore_ops s3c2410_pm_syscore_ops;
 extern struct syscore_ops s3c2412_pm_syscore_ops;
index 3a70aebc9205d34d781d56f3c4a19fcfc6fdfdf0..9c96f3586ce06ad58416a938e772bc409c10f1df 100644 (file)
@@ -36,5 +36,5 @@ struct s5p_timer_source {
 
 extern void __init s5p_set_timer_source(enum s5p_timer_mode event,
                                        enum s5p_timer_mode source);
-extern struct sys_timer s5p_timer;
+extern void s5p_timer_init(void);
 #endif /* __ASM_PLAT_S5P_TIME_H */
index 33bd3f3d20f5b9b00b95cc17777309fd4aa585e1..faa651602780b6570b1af0d079d08a9b409e651e 100644 (file)
@@ -15,8 +15,7 @@
 #include <linux/io.h>
 #include <linux/device.h>
 #include <linux/gpio.h>
-
-#include <asm/hardware/vic.h>
+#include <linux/irqchip/arm-vic.h>
 
 #include <plat/regs-irqtype.h>
 
index dfb47d638f036e621f05666cee9007c3daf0a9eb..103e371f5e35b2a4277144cf0f45a769a1408cfa 100644 (file)
@@ -13,8 +13,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/io.h>
-
-#include <asm/hardware/vic.h>
+#include <linux/irqchip/arm-vic.h>
 
 #include <mach/map.h>
 #include <plat/regs-timer.h>
index 028b6e877eb9d4afbbe64f90bc82e43d28e1eb38..e92510cf82ee6318b533624bd765e5fd082b9eb6 100644 (file)
@@ -274,15 +274,8 @@ static void __init s5p_clockevent_init(void)
        clock_rate = clk_get_rate(tin_event);
        clock_count_per_tick = clock_rate / HZ;
 
-       clockevents_calc_mult_shift(&time_event_device,
-                                   clock_rate, S5PTIMER_MIN_RANGE);
-       time_event_device.max_delta_ns =
-               clockevent_delta2ns(-1, &time_event_device);
-       time_event_device.min_delta_ns =
-               clockevent_delta2ns(1, &time_event_device);
-
        time_event_device.cpumask = cpumask_of(0);
-       clockevents_register_device(&time_event_device);
+       clockevents_config_and_register(&time_event_device, clock_rate, 1, -1);
 
        irq_number = timer_source.event_id + IRQ_TIMER0;
        setup_irq(irq_number, &s5p_clock_event_irq);
@@ -393,13 +386,9 @@ static void __init s5p_timer_resources(void)
        clk_enable(tin_source);
 }
 
-static void __init s5p_timer_init(void)
+void __init s5p_timer_init(void)
 {
        s5p_timer_resources();
        s5p_clockevent_init();
        s5p_clocksource_init();
 }
-
-struct sys_timer s5p_timer = {
-       .init           = s5p_timer_init,
-};
index 60552e22f22e11ccd74fb63b02779f1481e22abb..73defd00c3e46cdf5d227c8c8f8bfd1810e00027 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
+#include <linux/syscore_ops.h>
 
 #include <asm/mach-types.h>
 
@@ -95,7 +96,7 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks)
  * IRQs are disabled before entering here from do_gettimeofday()
  */
 
-static unsigned long s3c2410_gettimeoffset (void)
+static u32 s3c2410_gettimeoffset(void)
 {
        unsigned long tdone;
        unsigned long tval;
@@ -120,7 +121,7 @@ static unsigned long s3c2410_gettimeoffset (void)
                        tdone += timer_startval;
        }
 
-       return timer_ticks_to_usec(tdone);
+       return timer_ticks_to_usec(tdone) * 1000;
 }
 
 
@@ -271,15 +272,16 @@ static void __init s3c2410_timer_resources(void)
        clk_enable(tin);
 }
 
-static void __init s3c2410_timer_init(void)
+static struct syscore_ops s3c24xx_syscore_ops = {
+       .resume         = s3c2410_timer_setup,
+};
+
+void __init s3c24xx_timer_init(void)
 {
+       arch_gettimeoffset = s3c2410_gettimeoffset;
+
        s3c2410_timer_resources();
        s3c2410_timer_setup();
        setup_irq(IRQ_TIMER4, &s3c2410_timer_irq);
+       register_syscore_ops(&s3c24xx_syscore_ops);
 }
-
-struct sys_timer s3c24xx_timer = {
-       .init           = s3c2410_timer_init,
-       .offset         = s3c2410_gettimeoffset,
-       .resume         = s3c2410_timer_setup
-};
index 03321af5de9f853c57c8772d4d182d6a95a6594f..bd5c53cd6962ae9305b78810bae9c9b895eae4fb 100644 (file)
@@ -186,15 +186,9 @@ static void __init spear_clockevent_init(int irq)
        tick_rate = clk_get_rate(gpt_clk);
        tick_rate >>= CTRL_PRESCALER16;
 
-       clockevents_calc_mult_shift(&clkevt, tick_rate, SPEAR_MIN_RANGE);
-
-       clkevt.max_delta_ns = clockevent_delta2ns(0xfff0,
-                       &clkevt);
-       clkevt.min_delta_ns = clockevent_delta2ns(3, &clkevt);
-
        clkevt.cpumask = cpumask_of(0);
 
-       clockevents_register_device(&clkevt);
+       clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0);
 
        setup_irq(irq, &spear_timer_irq);
 }
index 04ca4937d8caba5fb9c3fb0078c34e8f3a2a1a0b..f2ac15561778c3aa3218aea7f02715118b634155 100644 (file)
 #include <linux/device.h>
 #include <linux/jiffies.h>
 #include <linux/smp.h>
+#include <linux/irqchip/arm-gic.h>
 
 #include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
-#include <asm/hardware/gic.h>
 
 /*
  * Write pen_release in a way that is guaranteed to be visible to all
@@ -79,7 +79,7 @@ int __cpuinit versatile_boot_secondary(unsigned int cpu, struct task_struct *idl
         * the boot monitor to read the system wide flags register,
         * and branch to the address found there.
         */
-       gic_raise_softirq(cpumask_of(cpu), 0);
+       arch_send_wakeup_ipi_mask(cpumask_of(cpu));
 
        timeout = jiffies + (1 * HZ);
        while (time_before(jiffies, timeout)) {
index 2310b249675f6567d66cf433094794d2895c661e..3126b920a4a5da705162800e34ff901183479909 100644 (file)
@@ -85,7 +85,7 @@ time_sched_init(irqreturn_t(*timer_routine) (int, void *))
 /*
  * Should return useconds since last timer tick
  */
-u32 arch_gettimeoffset(void)
+static u32 blackfin_gettimeoffset(void)
 {
        unsigned long offset;
        unsigned long clocks_per_jiffy;
@@ -141,6 +141,10 @@ void read_persistent_clock(struct timespec *ts)
 
 void __init time_init(void)
 {
+#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
+       arch_gettimeoffset = blackfin_gettimeoffset;
+#endif
+
 #ifdef CONFIG_RTC_DRV_BFIN
        /* [#2663] hack to filter junk RTC values that would cause
         * userspace to have to deal with time values greater than
index bcffcb6a9415dc7cc991330e949465891a99c1d9..fce7c541d70de8331b47ccab308a6798b9491bb5 100644 (file)
@@ -55,9 +55,9 @@ unsigned long get_ns_in_jiffie(void)
        return ns;
 }
 
-unsigned long do_slow_gettimeoffset(void)
+static u32 cris_v10_gettimeoffset(void)
 {
-       unsigned long count;
+       u32 count;
 
        /* The timer interrupt comes from Etrax timer 0. In order to get
         * better precision, we check the current value. It might have
@@ -65,8 +65,8 @@ unsigned long do_slow_gettimeoffset(void)
         */
        count = *R_TIMER0_DATA;
 
-       /* Convert timer value to usec */
-       return (TIMER0_DIV - count) * ((NSEC_PER_SEC/1000)/HZ)/TIMER0_DIV;
+       /* Convert timer value to nsec */
+       return (TIMER0_DIV - count) * (NSEC_PER_SEC/HZ)/TIMER0_DIV;
 }
 
 /* Excerpt from the Etrax100 HSDD about the built-in watchdog:
@@ -191,6 +191,8 @@ static struct irqaction irq2  = {
 void __init
 time_init(void)
 {      
+       arch_gettimeoffset = cris_v10_gettimeoffset;
+
        /* probe for the RTC and read it if it exists 
         * Before the RTC can be probed the loops_per_usec variable needs 
         * to be initialized to make usleep work. A better value for 
index 277ffc459e4b821e8360e1042df6bff469f12057..fe6acdabbc8d755b1d8de64a2ab7a917317896f8 100644 (file)
 extern unsigned long loops_per_jiffy; /* init/main.c */
 unsigned long loops_per_usec;
 
-
-#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
-extern unsigned long do_slow_gettimeoffset(void);
-static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;
-
-u32 arch_gettimeoffset(void)
-{
-       return do_gettimeoffset() * 1000;
-}
-#endif
-
 int set_rtc_mmss(unsigned long nowtime)
 {
        D(printk(KERN_DEBUG "set_rtc_mmss(%lu)\n", nowtime));
index 84dd04048db9dc182e8b7ebab31eb44894c3726d..1a15f81ea1bd9d6e5390f4fdb40560785c9830bd 100644 (file)
@@ -57,7 +57,7 @@ extern void smp_local_timer_interrupt(void);
 
 static unsigned long latch;
 
-u32 arch_gettimeoffset(void)
+static u32 m32r_gettimeoffset(void)
 {
        unsigned long  elapsed_time = 0;  /* [us] */
 
@@ -165,6 +165,8 @@ void read_persistent_clock(struct timespec *ts)
 
 void __init time_init(void)
 {
+       arch_gettimeoffset = m32r_gettimeoffset;
+
 #if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \
        || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \
        || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104)
index ee01b7a38e58882143a0baab95b986a58f222bae..b819390e29cdb7e901e926a9190b30ebadb8916c 100644 (file)
@@ -95,7 +95,7 @@ static void amiga_sched_init(irq_handler_t handler);
 static void amiga_get_model(char *model);
 static void amiga_get_hardware_list(struct seq_file *m);
 /* amiga specific timer functions */
-static unsigned long amiga_gettimeoffset(void);
+static u32 amiga_gettimeoffset(void);
 extern void amiga_mksound(unsigned int count, unsigned int ticks);
 static void amiga_reset(void);
 extern void amiga_init_sound(void);
@@ -377,7 +377,7 @@ void __init config_amiga(void)
        mach_init_IRQ        = amiga_init_IRQ;
        mach_get_model       = amiga_get_model;
        mach_get_hardware_list = amiga_get_hardware_list;
-       mach_gettimeoffset   = amiga_gettimeoffset;
+       arch_gettimeoffset   = amiga_gettimeoffset;
 
        /*
         * default MAX_DMA=0xffffffff on all machines. If we don't do so, the SCSI
@@ -482,10 +482,10 @@ static void __init amiga_sched_init(irq_handler_t timer_routine)
 #define TICK_SIZE 10000
 
 /* This is always executed with interrupts disabled.  */
-static unsigned long amiga_gettimeoffset(void)
+static u32 amiga_gettimeoffset(void)
 {
        unsigned short hi, lo, hi2;
-       unsigned long ticks, offset = 0;
+       u32 ticks, offset = 0;
 
        /* read CIA B timer A current value */
        hi  = ciab.tahi;
@@ -507,7 +507,7 @@ static unsigned long amiga_gettimeoffset(void)
        ticks = jiffy_ticks - ticks;
        ticks = (10000 * ticks) / jiffy_ticks;
 
-       return ticks + offset;
+       return (ticks + offset) * 1000;
 }
 
 static void amiga_reset(void)  __noreturn;
index f5565d6eeb8e9bbe24b9ef1df22dea0310f9c4ee..3ea56b90e7188df2c758bce798fc46c2d96df461 100644 (file)
@@ -26,7 +26,7 @@ u_long apollo_model;
 
 extern void dn_sched_init(irq_handler_t handler);
 extern void dn_init_IRQ(void);
-extern unsigned long dn_gettimeoffset(void);
+extern u32 dn_gettimeoffset(void);
 extern int dn_dummy_hwclk(int, struct rtc_time *);
 extern int dn_dummy_set_clock_mmss(unsigned long);
 extern void dn_dummy_reset(void);
@@ -151,7 +151,7 @@ void __init config_apollo(void)
 
        mach_sched_init=dn_sched_init; /* */
        mach_init_IRQ=dn_init_IRQ;
-       mach_gettimeoffset   = dn_gettimeoffset;
+       arch_gettimeoffset   = dn_gettimeoffset;
        mach_max_dma_address = 0xffffffff;
        mach_hwclk           = dn_dummy_hwclk; /* */
        mach_set_clock_mmss  = dn_dummy_set_clock_mmss; /* */
@@ -203,10 +203,9 @@ void dn_sched_init(irq_handler_t timer_routine)
                pr_err("Couldn't register timer interrupt\n");
 }
 
-unsigned long dn_gettimeoffset(void) {
-
+u32 dn_gettimeoffset(void)
+{
        return 0xdeadbeef;
-
 }
 
 int dn_dummy_hwclk(int op, struct rtc_time *t) {
index d8eb32747ac52b777fda6694c27c9ca69ba6542d..037c11c993315a5dc730c9dc19f10be89072b4ab 100644 (file)
@@ -74,7 +74,7 @@ static void atari_heartbeat(int on);
 
 /* atari specific timer functions (in time.c) */
 extern void atari_sched_init(irq_handler_t);
-extern unsigned long atari_gettimeoffset (void);
+extern u32 atari_gettimeoffset(void);
 extern int atari_mste_hwclk (int, struct rtc_time *);
 extern int atari_tt_hwclk (int, struct rtc_time *);
 extern int atari_mste_set_clock_mmss (unsigned long);
@@ -204,7 +204,7 @@ void __init config_atari(void)
        mach_init_IRQ        = atari_init_IRQ;
        mach_get_model   = atari_get_model;
        mach_get_hardware_list = atari_get_hardware_list;
-       mach_gettimeoffset   = atari_gettimeoffset;
+       arch_gettimeoffset   = atari_gettimeoffset;
        mach_reset           = atari_reset;
        mach_max_dma_address = 0xffffff;
 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
index c0cc68a2c82984d619eb7ac4c91b8eb704837e0d..da8f981c36d647eac10c557af8f2f699b73fdb52 100644 (file)
@@ -42,9 +42,9 @@ atari_sched_init(irq_handler_t timer_routine)
 #define TICK_SIZE 10000
 
 /* This is always executed with interrupts disabled.  */
-unsigned long atari_gettimeoffset (void)
+u32 atari_gettimeoffset(void)
 {
-  unsigned long ticks, offset = 0;
+  u32 ticks, offset = 0;
 
   /* read MFP timer C current value */
   ticks = st_mfp.tim_dt_c;
@@ -57,7 +57,7 @@ unsigned long atari_gettimeoffset (void)
   ticks = INT_TICKS - ticks;
   ticks = ticks * 10000L / INT_TICKS;
 
-  return ticks + offset;
+  return (ticks + offset) * 1000;
 }
 
 
index 0bf850a20ea28394742e364a018bd69895684d83..8943aa4c18e63cd3b0719b3a8d9f50e6bec40671 100644 (file)
@@ -38,7 +38,7 @@
 
 static void bvme6000_get_model(char *model);
 extern void bvme6000_sched_init(irq_handler_t handler);
-extern unsigned long bvme6000_gettimeoffset (void);
+extern u32 bvme6000_gettimeoffset(void);
 extern int bvme6000_hwclk (int, struct rtc_time *);
 extern int bvme6000_set_clock_mmss (unsigned long);
 extern void bvme6000_reset (void);
@@ -110,7 +110,7 @@ void __init config_bvme6000(void)
     mach_max_dma_address = 0xffffffff;
     mach_sched_init      = bvme6000_sched_init;
     mach_init_IRQ        = bvme6000_init_IRQ;
-    mach_gettimeoffset   = bvme6000_gettimeoffset;
+    arch_gettimeoffset   = bvme6000_gettimeoffset;
     mach_hwclk           = bvme6000_hwclk;
     mach_set_clock_mmss         = bvme6000_set_clock_mmss;
     mach_reset          = bvme6000_reset;
@@ -216,13 +216,13 @@ void bvme6000_sched_init (irq_handler_t timer_routine)
  * results...
  */
 
-unsigned long bvme6000_gettimeoffset (void)
+u32 bvme6000_gettimeoffset(void)
 {
     volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
     volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE;
     unsigned char msr = rtc->msr & 0xc0;
     unsigned char t1int, t1op;
-    unsigned long v = 800000, ov;
+    u32 v = 800000, ov;
 
     rtc->msr = 0;      /* Ensure timer registers accessible */
 
@@ -246,7 +246,7 @@ unsigned long bvme6000_gettimeoffset (void)
        v += 10000;                     /* Int pending, + 10ms */
     rtc->msr = msr;
 
-    return v;
+    return v * 1000;
 }
 
 /*
index bf16af1edacfe8fb9c91a5f19673042cf0664dd6..b7609f791522a45f12170799cdae4f89bc8ab80f 100644 (file)
@@ -251,7 +251,7 @@ void __init config_hp300(void)
        mach_sched_init      = hp300_sched_init;
        mach_init_IRQ        = hp300_init_IRQ;
        mach_get_model       = hp300_get_model;
-       mach_gettimeoffset   = hp300_gettimeoffset;
+       arch_gettimeoffset   = hp300_gettimeoffset;
        mach_hwclk           = hp300_hwclk;
        mach_get_ss          = hp300_get_ss;
        mach_reset           = hp300_reset;
index 29a71be9fa5b11d2675861ecee0bfb1822c87c05..749543b425a4b2c6b547485af5fe55c02583f933 100644 (file)
@@ -46,7 +46,7 @@ static irqreturn_t hp300_tick(int irq, void *dev_id)
        return vector(irq, NULL);
 }
 
-unsigned long hp300_gettimeoffset(void)
+u32 hp300_gettimeoffset(void)
 {
   /* Read current timer 1 value */
   unsigned char lsb, msb1, msb2;
@@ -59,7 +59,7 @@ unsigned long hp300_gettimeoffset(void)
     /* A carry happened while we were reading.  Read it again */
     lsb = in_8(CLOCKBASE + 7);
   ticks = INTVAL - ((msb2 << 8) | lsb);
-  return (USECS_PER_JIFFY * ticks) / INTVAL;
+  return ((USECS_PER_JIFFY * ticks) / INTVAL) * 1000;
 }
 
 void __init hp300_sched_init(irq_handler_t vector)
index 7b98242960de76b58da5cd7fb1e72d0985091c0b..f5583ec4033d46c076d91e8e017fbb996ad0fcab 100644 (file)
@@ -1,2 +1,2 @@
 extern void hp300_sched_init(irq_handler_t vector);
-extern unsigned long hp300_gettimeoffset(void);
+extern u32 hp300_gettimeoffset(void);
index 825c1c813196a7b08de0936a8101ee2b7d5820be..953ca21da8eec1e09d1c8a8d9077e0bfce543d57 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <linux/seq_file.h>
 #include <linux/interrupt.h>
+#include <linux/time.h>
 
 struct pt_regs;
 struct mktime;
@@ -16,7 +17,6 @@ extern void (*mach_init_IRQ) (void);
 extern void (*mach_get_model) (char *model);
 extern void (*mach_get_hardware_list) (struct seq_file *m);
 /* machine dependent timer functions */
-extern unsigned long (*mach_gettimeoffset)(void);
 extern int (*mach_hwclk)(int, struct rtc_time*);
 extern unsigned int (*mach_get_ss)(void);
 extern int (*mach_get_rtc_pll)(struct rtc_pll_info *);
index d872ce4807c96f36f81de1f60adc67c99de9627b..80cfbe56ea32150e634574de9f24b8451069e968 100644 (file)
@@ -84,7 +84,6 @@ void (*mach_init_IRQ) (void) __initdata = NULL;
 void (*mach_get_model) (char *model);
 void (*mach_get_hardware_list) (struct seq_file *m);
 /* machine dependent timer functions */
-unsigned long (*mach_gettimeoffset) (void);
 int (*mach_hwclk) (int, struct rtc_time*);
 EXPORT_SYMBOL(mach_hwclk);
 int (*mach_set_clock_mmss) (unsigned long);
index 5d0bcaad2e552f5d9587911b241bfe2369eb855e..bea6bcf8f9b8ec53958a34dd5f224e2057f6b723 100644 (file)
@@ -80,18 +80,8 @@ void read_persistent_clock(struct timespec *ts)
        }
 }
 
-void __init time_init(void)
-{
-       mach_sched_init(timer_interrupt);
-}
-
 #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
 
-u32 arch_gettimeoffset(void)
-{
-       return mach_gettimeoffset() * 1000;
-}
-
 static int __init rtc_init(void)
 {
        struct platform_device *pdev;
@@ -106,3 +96,8 @@ static int __init rtc_init(void)
 module_init(rtc_init);
 
 #endif /* CONFIG_ARCH_USES_GETTIMEOFFSET */
+
+void __init time_init(void)
+{
+       mach_sched_init(timer_interrupt);
+}
index d9f62e0f46c0b8861aff1509549be510c0b2a514..afb95d5fb26b3b29b172d730d8b5bacc4c3c664a 100644 (file)
@@ -52,7 +52,7 @@ struct mac_booter_data mac_bi_data;
 static unsigned long mac_orig_videoaddr;
 
 /* Mac specific timer functions */
-extern unsigned long mac_gettimeoffset(void);
+extern u32 mac_gettimeoffset(void);
 extern int mac_hwclk(int, struct rtc_time *);
 extern int mac_set_clock_mmss(unsigned long);
 extern void iop_preinit(void);
@@ -177,7 +177,7 @@ void __init config_mac(void)
        mach_sched_init = mac_sched_init;
        mach_init_IRQ = mac_init_IRQ;
        mach_get_model = mac_get_model;
-       mach_gettimeoffset = mac_gettimeoffset;
+       arch_gettimeoffset = mac_gettimeoffset;
        mach_hwclk = mac_hwclk;
        mach_set_clock_mmss = mac_set_clock_mmss;
        mach_reset = mac_reset;
index 2d85662715fba3a9d6332c19a45eecd4c428e141..5d1458bb871b8bd5e55eb25c5501067adef4810b 100644 (file)
@@ -327,7 +327,7 @@ void via_debug_dump(void)
  * TBI: get time offset between scheduling timer ticks
  */
 
-unsigned long mac_gettimeoffset (void)
+u32 mac_gettimeoffset(void)
 {
        unsigned long ticks, offset = 0;
 
@@ -341,7 +341,7 @@ unsigned long mac_gettimeoffset (void)
        ticks = MAC_CLOCK_TICK - ticks;
        ticks = ticks * 10000L / MAC_CLOCK_TICK;
 
-       return ticks + offset;
+       return (ticks + offset) * 1000;
 }
 
 /*
index a41c09149e2353158ec8ba18530a4bfc09a301e5..1c6262803b9455d46fbde9b05587fc910b1687f5 100644 (file)
@@ -37,7 +37,7 @@
 
 static void mvme147_get_model(char *model);
 extern void mvme147_sched_init(irq_handler_t handler);
-extern unsigned long mvme147_gettimeoffset (void);
+extern u32 mvme147_gettimeoffset(void);
 extern int mvme147_hwclk (int, struct rtc_time *);
 extern int mvme147_set_clock_mmss (unsigned long);
 extern void mvme147_reset (void);
@@ -88,7 +88,7 @@ void __init config_mvme147(void)
        mach_max_dma_address    = 0x01000000;
        mach_sched_init         = mvme147_sched_init;
        mach_init_IRQ           = mvme147_init_IRQ;
-       mach_gettimeoffset      = mvme147_gettimeoffset;
+       arch_gettimeoffset      = mvme147_gettimeoffset;
        mach_hwclk              = mvme147_hwclk;
        mach_set_clock_mmss     = mvme147_set_clock_mmss;
        mach_reset              = mvme147_reset;
@@ -127,7 +127,7 @@ void mvme147_sched_init (irq_handler_t timer_routine)
 
 /* This is always executed with interrupts disabled.  */
 /* XXX There are race hazards in this code XXX */
-unsigned long mvme147_gettimeoffset (void)
+u32 mvme147_gettimeoffset(void)
 {
        volatile unsigned short *cp = (volatile unsigned short *)0xfffe1012;
        unsigned short n;
@@ -137,7 +137,7 @@ unsigned long mvme147_gettimeoffset (void)
                n = *cp;
 
        n -= PCC_TIMER_PRELOAD;
-       return (unsigned long)n * 25 / 4;
+       return ((unsigned long)n * 25 / 4) * 1000;
 }
 
 static int bcd2int (unsigned char b)
index b6d7d8a7a3dd52ba1188067a51393e21d129df42..080a342458a1934162aa61f44d72d59dfc1afbd9 100644 (file)
@@ -43,7 +43,7 @@ static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE;
 
 static void mvme16x_get_model(char *model);
 extern void mvme16x_sched_init(irq_handler_t handler);
-extern unsigned long mvme16x_gettimeoffset (void);
+extern u32 mvme16x_gettimeoffset(void);
 extern int mvme16x_hwclk (int, struct rtc_time *);
 extern int mvme16x_set_clock_mmss (unsigned long);
 extern void mvme16x_reset (void);
@@ -289,7 +289,7 @@ void __init config_mvme16x(void)
     mach_max_dma_address = 0xffffffff;
     mach_sched_init      = mvme16x_sched_init;
     mach_init_IRQ        = mvme16x_init_IRQ;
-    mach_gettimeoffset   = mvme16x_gettimeoffset;
+    arch_gettimeoffset   = mvme16x_gettimeoffset;
     mach_hwclk           = mvme16x_hwclk;
     mach_set_clock_mmss         = mvme16x_set_clock_mmss;
     mach_reset          = mvme16x_reset;
@@ -405,9 +405,9 @@ void mvme16x_sched_init (irq_handler_t timer_routine)
 
 
 /* This is always executed with interrupts disabled.  */
-unsigned long mvme16x_gettimeoffset (void)
+u32 mvme16x_gettimeoffset(void)
 {
-    return (*(volatile unsigned long *)0xfff42008);
+    return (*(volatile u32 *)0xfff42008) * 1000;
 }
 
 int bcd2int (unsigned char b)
index 1adb5b7b0d1a141e19463a2b61fa571885af0f7d..658542b914fc0fb37476ca3df10461e1438e3049 100644 (file)
@@ -40,7 +40,7 @@ extern void q40_init_IRQ(void);
 static void q40_get_model(char *model);
 extern void q40_sched_init(irq_handler_t handler);
 
-static unsigned long q40_gettimeoffset(void);
+static u32 q40_gettimeoffset(void);
 static int q40_hwclk(int, struct rtc_time *);
 static unsigned int q40_get_ss(void);
 static int q40_set_clock_mmss(unsigned long);
@@ -170,7 +170,7 @@ void __init config_q40(void)
        mach_sched_init = q40_sched_init;
 
        mach_init_IRQ = q40_init_IRQ;
-       mach_gettimeoffset = q40_gettimeoffset;
+       arch_gettimeoffset = q40_gettimeoffset;
        mach_hwclk = q40_hwclk;
        mach_get_ss = q40_get_ss;
        mach_get_rtc_pll = q40_get_rtc_pll;
@@ -204,9 +204,9 @@ int q40_parse_bootinfo(const struct bi_record *rec)
 }
 
 
-static unsigned long q40_gettimeoffset(void)
+static u32 q40_gettimeoffset(void)
 {
-       return 5000 * (ql_ticks != 0);
+       return 5000 * (ql_ticks != 0) * 1000;
 }
 
 
index 2ca25bd01a961c37bbdd8a6b12efbf330e252f79..f59ec58083f8b41545665a0dfab1492bfd1d3007 100644 (file)
@@ -36,7 +36,7 @@
 
 char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
 
-extern unsigned long sun3_gettimeoffset(void);
+extern u32 sun3_gettimeoffset(void);
 static void sun3_sched_init(irq_handler_t handler);
 extern void sun3_get_model (char* model);
 extern int sun3_hwclk(int set, struct rtc_time *t);
@@ -141,7 +141,7 @@ void __init config_sun3(void)
         mach_sched_init      =  sun3_sched_init;
         mach_init_IRQ        =  sun3_init_IRQ;
         mach_reset           =  sun3_reboot;
-       mach_gettimeoffset   =  sun3_gettimeoffset;
+       arch_gettimeoffset   =  sun3_gettimeoffset;
        mach_get_model       =  sun3_get_model;
        mach_hwclk           =  sun3_hwclk;
        mach_halt            =  sun3_halt;
index 94fe8016f1f08a492e774c4e9bc014cf5b7ad68a..889829e11f1dbeba727a2ecff18580e416ee94ba 100644 (file)
@@ -23,9 +23,9 @@
 #define START_VAL (INTERSIL_RUN | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
 
 /* does this need to be implemented? */
-unsigned long sun3_gettimeoffset(void)
+u32 sun3_gettimeoffset(void)
 {
-  return 1;
+  return 1000;
 }
 
 
index dd306c84d36d6fb8fc57b17e431b55b1160df388..0532d64d191e75646be2e725e245e0689978512f 100644 (file)
@@ -48,7 +48,7 @@ void __init config_sun3x(void)
        mach_sched_init      = sun3x_sched_init;
        mach_init_IRQ        = sun3_init_IRQ;
 
-       mach_gettimeoffset   = sun3x_gettimeoffset;
+       arch_gettimeoffset   = sun3x_gettimeoffset;
        mach_reset           = sun3x_reboot;
 
        mach_hwclk           = sun3x_hwclk;
index 1d0a724804090fd52bb025755c4c5b7b40ff0292..c8eb08add6b0801cb03718d012657f21cdeded6f 100644 (file)
@@ -71,7 +71,7 @@ int sun3x_hwclk(int set, struct rtc_time *t)
        return 0;
 }
 /* Not much we can do here */
-unsigned long sun3x_gettimeoffset (void)
+u32 sun3x_gettimeoffset(void)
 {
     return 0L;
 }
index 6909e1297534a17e810dd216cdbd2f4a31465601..a4f9126be7e28495cc0dca6fb439fc43a3332272 100644 (file)
@@ -2,7 +2,7 @@
 #define SUN3X_TIME_H
 
 extern int sun3x_hwclk(int set, struct rtc_time *t);
-unsigned long sun3x_gettimeoffset (void);
+u32 sun3x_gettimeoffset(void);
 void sun3x_sched_init(irq_handler_t vector);
 
 struct mostek_dt {
index d7af29f1fcf0079c7ccdcae5af9f0add4c8c2c80..ba611927749b9f81def164126a2b2b1d00bf42c5 100644 (file)
@@ -8,8 +8,10 @@ config BCM47XX_SSB
        select SSB_DRIVER_EXTIF
        select SSB_EMBEDDED
        select SSB_B43_PCI_BRIDGE if PCI
+       select SSB_DRIVER_PCICORE if PCI
        select SSB_PCICORE_HOSTMODE if PCI
        select SSB_DRIVER_GPIO
+       select GPIOLIB
        default y
        help
         Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support.
@@ -25,6 +27,7 @@ config BCM47XX_BCMA
        select BCMA_HOST_PCI if PCI
        select BCMA_DRIVER_PCI_HOSTMODE if PCI
        select BCMA_DRIVER_GPIO
+       select GPIOLIB
        default y
        help
         Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus.
index 9f883bf769530d18c880416850060cd738bb0fa8..33b72144db3100625bd17991c1651ddd803ddf2b 100644 (file)
@@ -30,6 +30,7 @@
  * measurement, and debugging facilities.
  */
 
+#include <linux/compiler.h>
 #include <linux/irqflags.h>
 #include <asm/octeon/cvmx.h>
 #include <asm/octeon/cvmx-l2c.h>
@@ -285,22 +286,22 @@ uint64_t cvmx_l2c_read_perf(uint32_t counter)
  */
 static void fault_in(uint64_t addr, int len)
 {
-       volatile char *ptr;
-       volatile char dummy;
+       char *ptr;
+
        /*
         * Adjust addr and length so we get all cache lines even for
         * small ranges spanning two cache lines.
         */
        len += addr & CVMX_CACHE_LINE_MASK;
        addr &= ~CVMX_CACHE_LINE_MASK;
-       ptr = (volatile char *)cvmx_phys_to_ptr(addr);
+       ptr = cvmx_phys_to_ptr(addr);
        /*
         * Invalidate L1 cache to make sure all loads result in data
         * being in L2.
         */
        CVMX_DCACHE_INVALIDATE;
        while (len > 0) {
-               dummy += *ptr;
+               ACCESS_ONCE(*ptr);
                len -= CVMX_CACHE_LINE_SIZE;
                ptr += CVMX_CACHE_LINE_SIZE;
        }
diff --git a/arch/mips/include/asm/break.h b/arch/mips/include/asm/break.h
deleted file mode 100644 (file)
index 9161e68..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1995, 2003 by Ralf Baechle
- * Copyright (C) 1999 Silicon Graphics, Inc.
- */
-#ifndef __ASM_BREAK_H
-#define __ASM_BREAK_H
-
-/*
- * The following break codes are or were in use for specific purposes in
- * other MIPS operating systems.  Linux/MIPS doesn't use all of them.  The
- * unused ones are here as placeholders; we might encounter them in
- * non-Linux/MIPS object files or make use of them in the future.
- */
-#define BRK_USERBP     0       /* User bp (used by debuggers) */
-#define BRK_KERNELBP   1       /* Break in the kernel */
-#define BRK_ABORT      2       /* Sometimes used by abort(3) to SIGIOT */
-#define BRK_BD_TAKEN   3       /* For bd slot emulation - not implemented */
-#define BRK_BD_NOTTAKEN        4       /* For bd slot emulation - not implemented */
-#define BRK_SSTEPBP    5       /* User bp (used by debuggers) */
-#define BRK_OVERFLOW   6       /* Overflow check */
-#define BRK_DIVZERO    7       /* Divide by zero check */
-#define BRK_RANGE      8       /* Range error check */
-#define BRK_STACKOVERFLOW 9    /* For Ada stackchecking */
-#define BRK_NORLD      10      /* No rld found - not used by Linux/MIPS */
-#define _BRK_THREADBP  11      /* For threads, user bp (used by debuggers) */
-#define BRK_BUG                512     /* Used by BUG() */
-#define BRK_KDB                513     /* Used in KDB_ENTER() */
-#define BRK_MEMU       514     /* Used by FPU emulator */
-#define BRK_KPROBE_BP  515     /* Kprobe break */
-#define BRK_KPROBE_SSTEPBP 516 /* Kprobe single step software implementation */
-#define BRK_MULOVF     1023    /* Multiply overflow */
-
-#endif /* __ASM_BREAK_H */
index e9bfc0813c72e99a46b29dadb1c3556843fc31a1..7bfad0520e25731c548c949ccecc045e91bba002 100644 (file)
@@ -16,7 +16,7 @@
 #include <asm/mipsregs.h>
 
 #define DSP_DEFAULT    0x00000000
-#define DSP_MASK       0x3ff
+#define DSP_MASK       0x3f
 
 #define __enable_dsp_hazard()                                          \
 do {                                                                   \
index ab84064283db2c50d847d888b32e42a4d316dd7d..33c34adbecfa19ae457699d449d8242ed5a0f43c 100644 (file)
@@ -353,6 +353,7 @@ union mips_instruction {
        struct u_format u_format;
        struct c_format c_format;
        struct r_format r_format;
+       struct p_format p_format;
        struct f_format f_format;
        struct ma_format ma_format;
        struct b_format b_format;
index edaa06d9d492171090e10ee08ad370fae79bebe9..e410df4e1b3a650d99d8981c7b63c04d4218daf4 100644 (file)
@@ -21,4 +21,4 @@
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
 
-#endif /* __ASM_MIPS_MACH_PNX8550_WAR_H */
+#endif /* __ASM_MIPS_MACH_PNX833X_WAR_H */
index c63191055e695c5a49812f3f32ed0c913d941a0a..013d5f781263e20cf3d9e93cf14b6552c4386cc8 100644 (file)
@@ -230,6 +230,7 @@ static inline void pud_clear(pud_t *pudp)
 #else
 #define pte_pfn(x)             ((unsigned long)((x).pte >> _PFN_SHIFT))
 #define pfn_pte(pfn, prot)     __pte(((pfn) << _PFN_SHIFT) | pgprot_val(prot))
+#define pfn_pmd(pfn, prot)     __pmd(((pfn) << _PFN_SHIFT) | pgprot_val(prot))
 #endif
 
 #define __pgd_offset(address)  pgd_index(address)
index a1a0452ac1853333b07dac4dc7495c9bdd2514a5..77d4fb33f75ad1dd765ba69f697ed771312b3e9a 100644 (file)
@@ -3,6 +3,7 @@ include include/uapi/asm-generic/Kbuild.asm
 
 header-y += auxvec.h
 header-y += bitsperlong.h
+header-y += break.h
 header-y += byteorder.h
 header-y += cachectl.h
 header-y += errno.h
diff --git a/arch/mips/include/uapi/asm/break.h b/arch/mips/include/uapi/asm/break.h
new file mode 100644 (file)
index 0000000..9161e68
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 2003 by Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#ifndef __ASM_BREAK_H
+#define __ASM_BREAK_H
+
+/*
+ * The following break codes are or were in use for specific purposes in
+ * other MIPS operating systems.  Linux/MIPS doesn't use all of them.  The
+ * unused ones are here as placeholders; we might encounter them in
+ * non-Linux/MIPS object files or make use of them in the future.
+ */
+#define BRK_USERBP     0       /* User bp (used by debuggers) */
+#define BRK_KERNELBP   1       /* Break in the kernel */
+#define BRK_ABORT      2       /* Sometimes used by abort(3) to SIGIOT */
+#define BRK_BD_TAKEN   3       /* For bd slot emulation - not implemented */
+#define BRK_BD_NOTTAKEN        4       /* For bd slot emulation - not implemented */
+#define BRK_SSTEPBP    5       /* User bp (used by debuggers) */
+#define BRK_OVERFLOW   6       /* Overflow check */
+#define BRK_DIVZERO    7       /* Divide by zero check */
+#define BRK_RANGE      8       /* Range error check */
+#define BRK_STACKOVERFLOW 9    /* For Ada stackchecking */
+#define BRK_NORLD      10      /* No rld found - not used by Linux/MIPS */
+#define _BRK_THREADBP  11      /* For threads, user bp (used by debuggers) */
+#define BRK_BUG                512     /* Used by BUG() */
+#define BRK_KDB                513     /* Used in KDB_ENTER() */
+#define BRK_MEMU       514     /* Used by FPU emulator */
+#define BRK_KPROBE_BP  515     /* Kprobe break */
+#define BRK_KPROBE_SSTEPBP 516 /* Kprobe single step software implementation */
+#define BRK_MULOVF     1023    /* Multiply overflow */
+
+#endif /* __ASM_BREAK_H */
index 6a2d758dd8e9ed0b4a0afb043d2972869620834c..83fa1460e294e02cf602cd5d611af6d02abbba39 100644 (file)
 #define MCOUNT_OFFSET_INSNS 4
 #endif
 
+/* Arch override because MIPS doesn't need to run this from stop_machine() */
+void arch_ftrace_update_code(int command)
+{
+       ftrace_modify_all_code(command);
+}
+
 /*
  * Check if the address is in kernel space
  *
@@ -89,6 +95,24 @@ static int ftrace_modify_code(unsigned long ip, unsigned int new_code)
        return 0;
 }
 
+#ifndef CONFIG_64BIT
+static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
+                               unsigned int new_code2)
+{
+       int faulted;
+
+       safe_store_code(new_code1, ip, faulted);
+       if (unlikely(faulted))
+               return -EFAULT;
+       ip += 4;
+       safe_store_code(new_code2, ip, faulted);
+       if (unlikely(faulted))
+               return -EFAULT;
+       flush_icache_range(ip, ip + 8); /* original ip + 12 */
+       return 0;
+}
+#endif
+
 /*
  * The details about the calling site of mcount on MIPS
  *
@@ -131,8 +155,18 @@ int ftrace_make_nop(struct module *mod,
         * needed.
         */
        new = in_kernel_space(ip) ? INSN_NOP : INSN_B_1F;
-
+#ifdef CONFIG_64BIT
        return ftrace_modify_code(ip, new);
+#else
+       /*
+        * On 32 bit MIPS platforms, gcc adds a stack adjust
+        * instruction in the delay slot after the branch to
+        * mcount and expects mcount to restore the sp on return.
+        * This is based on a legacy API and does nothing but
+        * waste instructions so it's being removed at runtime.
+        */
+       return ftrace_modify_code_2(ip, new, INSN_NOP);
+#endif
 }
 
 int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
index 4c968e7efb747d997ec20ba8ceeb500f4c12807d..1658676733576e74867347f0f7d122df0c5a023e 100644 (file)
@@ -46,9 +46,8 @@
        PTR_L   a5, PT_R9(sp)
        PTR_L   a6, PT_R10(sp)
        PTR_L   a7, PT_R11(sp)
-       PTR_ADDIU       sp, PT_SIZE
 #else
-       PTR_ADDIU       sp, (PT_SIZE + 8)
+       PTR_ADDIU       sp, PT_SIZE
 #endif
 .endm
 
@@ -69,7 +68,9 @@ NESTED(ftrace_caller, PT_SIZE, ra)
        .globl _mcount
 _mcount:
        b       ftrace_stub
-        nop
+       addiu sp,sp,8
+
+       /* When tracing is activated, it calls ftrace_caller+8 (aka here) */
        lw      t1, function_trace_stop
        bnez    t1, ftrace_stub
         nop
index eec690af6581616957089993e2decfd91f13b4fd..147cec19621d7a433429e66433fdd993c2abd62e 100644 (file)
@@ -705,7 +705,7 @@ static int vpe_run(struct vpe * v)
 
                        printk(KERN_WARNING
                               "VPE loader: TC %d is already in use.\n",
-                               t->index);
+                              v->tc->index);
                        return -ENOEXEC;
                }
        } else {
index f36acd1b38086d341458d927c4c4db99d3a40e0f..a7935bf0fecbf789299a2547abb7b0b2e8677e2b 100644 (file)
@@ -408,7 +408,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
 #endif
 
        /* tell oprofile which irq to use */
-       cp0_perfcount_irq = LTQ_PERF_IRQ;
+       cp0_perfcount_irq = irq_create_mapping(ltq_domain, LTQ_PERF_IRQ);
 
        /*
         * if the timer irq is not one of the mips irqs we need to
index dc81ca8dc0dd4b0ccd81ae2edc78b059aa8fd016..288f7954988d06ef61cc94bbf29dfeab322796b8 100644 (file)
@@ -21,7 +21,7 @@ void __delay(unsigned long loops)
        "       .set    noreorder                               \n"
        "       .align  3                                       \n"
        "1:     bnez    %0, 1b                                  \n"
-#if __SIZEOF_LONG__ == 4
+#if BITS_PER_LONG == 32
        "       subu    %0, 1                                   \n"
 #else
        "       dsubu   %0, 1                                   \n"
index 7657fd21cd3fb35779ad6a37ff65c73547cedc88..cacfd31e8ec9d1121c86e81feb35fac4344a9a3b 100644 (file)
@@ -190,9 +190,3 @@ void __iounmap(const volatile void __iomem *addr)
 
 EXPORT_SYMBOL(__ioremap);
 EXPORT_SYMBOL(__iounmap);
-
-int __virt_addr_valid(const volatile void *kaddr)
-{
-       return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
-}
-EXPORT_SYMBOL_GPL(__virt_addr_valid);
index d9be7540a6be7979a265a3ce32acbbe241b2b91c..7e5fe2790d8a212a8d0163989280918d26a46a3c 100644 (file)
@@ -192,3 +192,9 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
 
        return ret;
 }
+
+int __virt_addr_valid(const volatile void *kaddr)
+{
+       return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
+}
+EXPORT_SYMBOL_GPL(__virt_addr_valid);
index 4e7f49d3d5a8105c45dd09a6b86999ed0506a7d7..c5ce6992ac4c7086aea4167a7460723a5d0cb7be 100644 (file)
@@ -193,8 +193,11 @@ static void nlm_init_node(void)
 
 void __init prom_init(void)
 {
-       int i, *argv, *envp;            /* passed as 32 bit ptrs */
+       int *argv, *envp;               /* passed as 32 bit ptrs */
        struct psb_info *prom_infop;
+#ifdef CONFIG_SMP
+       int i;
+#endif
 
        /* truncate to 32 bit and sign extend all args */
        argv = (int *)(long)(int)fw_arg1;
index 1552522b8718bffb86762229ef5279b93094df16..6eaa4f2d0e38cb8c85e31734c7e090ec9a491cb3 100644 (file)
@@ -24,7 +24,7 @@
 #include <asm/mach-ath79/pci.h>
 
 #define AR71XX_PCI_MEM_BASE    0x10000000
-#define AR71XX_PCI_MEM_SIZE    0x08000000
+#define AR71XX_PCI_MEM_SIZE    0x07000000
 
 #define AR71XX_PCI_WIN0_OFFS           0x10000000
 #define AR71XX_PCI_WIN1_OFFS           0x11000000
index 86d77a666458bae80c60f94c9fc405dca5f8459c..c11c75be2d7e06ab0b1232c35926a8ec3c5ba574 100644 (file)
@@ -21,7 +21,7 @@
 #define AR724X_PCI_CTRL_SIZE   0x100
 
 #define AR724X_PCI_MEM_BASE    0x10000000
-#define AR724X_PCI_MEM_SIZE    0x08000000
+#define AR724X_PCI_MEM_SIZE    0x04000000
 
 #define AR724X_PCI_REG_RESET           0x18
 #define AR724X_PCI_REG_INT_STATUS      0x4c
index d22e73e4618b7924879517f1f59cb99dcd63b43e..e514de57a125333a4ce174cb399070b6cc62e3b4 100644 (file)
@@ -439,6 +439,8 @@ ret_from_fork:
 ret_from_kernel_thread:
        REST_NVGPRS(r1)
        bl      schedule_tail
+       li      r3,0
+       stw     r3,0(r1)
        mtlr    r14
        mr      r3,r15
        PPC440EP_ERR42
index b310a0573625dec8a672c267ab6158f8e90b37a6..3d990d3bd8baf5923d019208f7782d42e7f8a458 100644 (file)
@@ -664,6 +664,19 @@ resume_kernel:
        ld      r4,TI_FLAGS(r9)
        andi.   r0,r4,_TIF_NEED_RESCHED
        bne     1b
+
+       /*
+        * arch_local_irq_restore() from preempt_schedule_irq above may
+        * enable hard interrupt but we really should disable interrupts
+        * when we return from the interrupt, and so that we don't get
+        * interrupted after loading SRR0/1.
+        */
+#ifdef CONFIG_PPC_BOOK3E
+       wrteei  0
+#else
+       ld      r10,PACAKMSR(r13) /* Get kernel MSR without EE */
+       mtmsrd  r10,1             /* Update machine state */
+#endif /* CONFIG_PPC_BOOK3E */
 #endif /* CONFIG_PREEMPT */
 
        .globl  fast_exc_return_irq
index c470a40b29f5d4937883cfcd8a40dd1c6bbdcfd1..a7bc7521c0645c6eb697308f039fb74eaad6b4af 100644 (file)
@@ -154,12 +154,12 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs)
 static int kgdb_singlestep(struct pt_regs *regs)
 {
        struct thread_info *thread_info, *exception_thread_info;
-       struct thread_info *backup_current_thread_info = \
-               (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
+       struct thread_info *backup_current_thread_info;
 
        if (user_mode(regs))
                return 0;
 
+       backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
        /*
         * On Book E and perhaps other processors, singlestep is handled on
         * the critical exception stack.  This causes current_thread_info()
@@ -185,6 +185,7 @@ static int kgdb_singlestep(struct pt_regs *regs)
                /* Restore current_thread_info lastly. */
                memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info);
 
+       kfree(backup_current_thread_info);
        return 1;
 }
 
index 6f6b1cccc91662037115e69dc072ac1f7a376be5..127361e093f49931a87f3fdbc8cad4c88eae5679 100644 (file)
@@ -494,10 +494,15 @@ void timer_interrupt(struct pt_regs * regs)
        set_dec(DECREMENTER_MAX);
 
        /* Some implementations of hotplug will get timer interrupts while
-        * offline, just ignore these
+        * offline, just ignore these and we also need to set
+        * decrementers_next_tb as MAX to make sure __check_irq_replay
+        * don't replay timer interrupt when return, otherwise we'll trap
+        * here infinitely :(
         */
-       if (!cpu_online(smp_processor_id()))
+       if (!cpu_online(smp_processor_id())) {
+               *next_tb = ~(u64)0;
                return;
+       }
 
        /* Conditionally hard-enable interrupts now that the DEC has been
         * bumped to its maximum value
index 315f9495e9b2b5aa42a6c9aaba5a6307ac03ddde..f444b94935f560f6a7abf1a1de46d88cd32e71d5 100644 (file)
@@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1)
        for (pmc = 0; pmc < 4; pmc++) {
                psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK
                                << (OPROFILE_MAX_PMC_NUM - pmc)
-                               * OPROFILE_MAX_PMC_NUM);
+                               * OPROFILE_PMSEL_FIELD_WIDTH);
                psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc)
                                 * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL;
                unit = mmcr1 & (OPROFILE_PM_UNIT_MSK
index 95d00173029f52c498902a586a24917f09e99d4b..890f30e70f98fc52a39f063172cfbadc5e8713b4 100644 (file)
@@ -236,6 +236,13 @@ out:
 
 static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
+       /*
+        * We don't support CPU hotplug. Don't unmap after the system
+        * has already made it to a running state.
+        */
+       if (system_state != SYSTEM_BOOTING)
+               return 0;
+
        if (sdcasr_mapbase)
                iounmap(sdcasr_mapbase);
        if (sdcpwr_mapbase)
index c1d7930a82f4527657fa6eda9501dae446c164a9..098adbb62660be234d4d2ed5171d5c0615027f31 100644 (file)
@@ -1365,6 +1365,18 @@ static inline void pmdp_invalidate(struct vm_area_struct *vma,
        __pmd_idte(address, pmdp);
 }
 
+#define __HAVE_ARCH_PMDP_SET_WRPROTECT
+static inline void pmdp_set_wrprotect(struct mm_struct *mm,
+                                     unsigned long address, pmd_t *pmdp)
+{
+       pmd_t pmd = *pmdp;
+
+       if (pmd_write(pmd)) {
+               __pmd_idte(address, pmdp);
+               set_pmd_at(mm, address, pmdp, pmd_wrprotect(pmd));
+       }
+}
+
 static inline pmd_t mk_pmd_phys(unsigned long physpage, pgprot_t pgprot)
 {
        pmd_t __pmd;
index 79795af598105e9998f0de234b279fb6c61ca42f..225543bf45a5ca551f9609b18cf8711f729f71e7 100644 (file)
@@ -2138,6 +2138,7 @@ config OLPC_XO1_RTC
 config OLPC_XO1_SCI
        bool "OLPC XO-1 SCI extras"
        depends on OLPC && OLPC_XO1_PM
+       depends on INPUT=y
        select POWER_SUPPLY
        select GPIO_CS5535
        select MFD_CORE
index ccce0ed67dde703a80c78309252abbef17828291..379814bc41e3a956dc037a5f1d4ca23709854fbc 100644 (file)
@@ -71,7 +71,7 @@ GCOV_PROFILE := n
 $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 
 quiet_cmd_image = BUILD   $@
-cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
+cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/zoffset.h > $@
 
 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
        $(call if_changed,image)
@@ -92,7 +92,7 @@ targets += voffset.h
 $(obj)/voffset.h: vmlinux FORCE
        $(call if_changed,voffset)
 
-sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
+sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi_pe_entry\|efi_stub_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p'
 
 quiet_cmd_zoffset = ZOFFSET $@
       cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@
index 18e329ca108e5f720adf1974fa1e90c8b2626991..f8fa41190c3526f61ec7bb6e1dc5b0ebf08b3c4d 100644 (file)
@@ -256,10 +256,10 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
        int i;
        struct setup_data *data;
 
-       data = (struct setup_data *)params->hdr.setup_data;
+       data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
 
        while (data && data->next)
-               data = (struct setup_data *)data->next;
+               data = (struct setup_data *)(unsigned long)data->next;
 
        status = efi_call_phys5(sys_table->boottime->locate_handle,
                                EFI_LOCATE_BY_PROTOCOL, &pci_proto,
@@ -295,16 +295,18 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
                if (!pci)
                        continue;
 
+#ifdef CONFIG_X86_64
                status = efi_call_phys4(pci->attributes, pci,
                                        EfiPciIoAttributeOperationGet, 0,
                                        &attributes);
-
+#else
+               status = efi_call_phys5(pci->attributes, pci,
+                                       EfiPciIoAttributeOperationGet, 0, 0,
+                                       &attributes);
+#endif
                if (status != EFI_SUCCESS)
                        continue;
 
-               if (!(attributes & EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM))
-                       continue;
-
                if (!pci->romimage || !pci->romsize)
                        continue;
 
@@ -345,9 +347,9 @@ static efi_status_t setup_efi_pci(struct boot_params *params)
                memcpy(rom->romdata, pci->romimage, pci->romsize);
 
                if (data)
-                       data->next = (uint64_t)rom;
+                       data->next = (unsigned long)rom;
                else
-                       params->hdr.setup_data = (uint64_t)rom;
+                       params->hdr.setup_data = (unsigned long)rom;
 
                data = (struct setup_data *)rom;
 
@@ -432,10 +434,9 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
                         * Once we've found a GOP supporting ConOut,
                         * don't bother looking any further.
                         */
+                       first_gop = gop;
                        if (conout_found)
                                break;
-
-                       first_gop = gop;
                }
        }
 
index aa4aaf1b23803e8ef0e180e3cbeedc7a4db6c556..1e3184f6072f913250b3b18371978a4fd1b3f63d 100644 (file)
@@ -35,11 +35,11 @@ ENTRY(startup_32)
 #ifdef CONFIG_EFI_STUB
        jmp     preferred_addr
 
-       .balign 0x10
        /*
         * We don't need the return address, so set up the stack so
-        * efi_main() can find its arugments.
+        * efi_main() can find its arguments.
         */
+ENTRY(efi_pe_entry)
        add     $0x4, %esp
 
        call    make_boot_params
@@ -50,8 +50,10 @@ ENTRY(startup_32)
        pushl   %eax
        pushl   %esi
        pushl   %ecx
+       sub     $0x4, %esp
 
-       .org 0x30,0x90
+ENTRY(efi_stub_entry)
+       add     $0x4, %esp
        call    efi_main
        cmpl    $0, %eax
        movl    %eax, %esi
index 2c4b171eec337619e8f2dab2b3c3b2048e622e51..f5d1aaa0dec87ce844317f2a343a90739408ac22 100644 (file)
@@ -201,12 +201,12 @@ ENTRY(startup_64)
         */
 #ifdef CONFIG_EFI_STUB
        /*
-        * The entry point for the PE/COFF executable is 0x210, so only
-        * legacy boot loaders will execute this jmp.
+        * The entry point for the PE/COFF executable is efi_pe_entry, so
+        * only legacy boot loaders will execute this jmp.
         */
        jmp     preferred_addr
 
-       .org 0x210
+ENTRY(efi_pe_entry)
        mov     %rcx, %rdi
        mov     %rdx, %rsi
        pushq   %rdi
@@ -218,7 +218,7 @@ ENTRY(startup_64)
        popq    %rsi
        popq    %rdi
 
-       .org 0x230,0x90
+ENTRY(efi_stub_entry)
        call    efi_main
        movq    %rax,%rsi
        cmpq    $0,%rax
index 8c132a625b94991c179def21973bb8ad3c3a56d5..944ce595f767621f07a47d6c89cdea9415627663 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/e820.h>
 #include <asm/page_types.h>
 #include <asm/setup.h>
+#include <asm/bootparam.h>
 #include "boot.h"
 #include "voffset.h"
 #include "zoffset.h"
@@ -255,6 +256,9 @@ section_table:
        # header, from the old boot sector.
 
        .section ".header", "a"
+       .globl  sentinel
+sentinel:      .byte 0xff, 0xff        /* Used to detect broken loaders */
+
        .globl  hdr
 hdr:
 setup_sects:   .byte 0                 /* Filled in by build.c */
@@ -279,7 +283,7 @@ _start:
        # Part 2 of the header, from the old setup.S
 
                .ascii  "HdrS"          # header signature
-               .word   0x020b          # header version number (>= 0x0105)
+               .word   0x020c          # header version number (>= 0x0105)
                                        # or else old loadlin-1.5 will fail)
                .globl realmode_swtch
 realmode_swtch:        .word   0, 0            # default_switch, SETUPSEG
@@ -297,13 +301,7 @@ type_of_loader:    .byte   0               # 0 means ancient bootloader, newer
 
 # flags, unused bits must be zero (RFU) bit within loadflags
 loadflags:
-LOADED_HIGH    = 1                     # If set, the kernel is loaded high
-CAN_USE_HEAP   = 0x80                  # If set, the loader also has set
-                                       # heap_end_ptr to tell how much
-                                       # space behind setup.S can be used for
-                                       # heap purposes.
-                                       # Only the loader knows what is free
-               .byte   LOADED_HIGH
+               .byte   LOADED_HIGH     # The kernel is to be loaded high
 
 setup_move_size: .word  0x8000         # size to move, when setup is not
                                        # loaded at 0x90000. We will move setup
@@ -369,7 +367,23 @@ relocatable_kernel:    .byte 1
 relocatable_kernel:    .byte 0
 #endif
 min_alignment:         .byte MIN_KERNEL_ALIGN_LG2      # minimum alignment
-pad3:                  .word 0
+
+xloadflags:
+#ifdef CONFIG_X86_64
+# define XLF0 XLF_KERNEL_64                    /* 64-bit kernel */
+#else
+# define XLF0 0
+#endif
+#ifdef CONFIG_EFI_STUB
+# ifdef CONFIG_X86_64
+#  define XLF23 XLF_EFI_HANDOVER_64            /* 64-bit EFI handover ok */
+# else
+#  define XLF23 XLF_EFI_HANDOVER_32            /* 32-bit EFI handover ok */
+# endif
+#else
+# define XLF23 0
+#endif
+                       .word XLF0 | XLF23
 
 cmdline_size:   .long   COMMAND_LINE_SIZE-1     #length of the command line,
                                                 #added with boot protocol
@@ -397,8 +411,13 @@ pref_address:              .quad LOAD_PHYSICAL_ADDR        # preferred load addr
 #define INIT_SIZE VO_INIT_SIZE
 #endif
 init_size:             .long INIT_SIZE         # kernel initialization size
-handover_offset:       .long 0x30              # offset to the handover
+handover_offset:
+#ifdef CONFIG_EFI_STUB
+                       .long 0x30              # offset to the handover
                                                # protocol entry point
+#else
+                       .long 0
+#endif
 
 # End of setup header #####################################################
 
index 03c0683636b6fbf859a8795262f249631e6157f9..96a6c7563538364d2dee7e307846815156c11c33 100644 (file)
@@ -13,7 +13,7 @@ SECTIONS
        .bstext         : { *(.bstext) }
        .bsdata         : { *(.bsdata) }
 
-       . = 497;
+       . = 495;
        .header         : { *(.header) }
        .entrytext      : { *(.entrytext) }
        .inittext       : { *(.inittext) }
index 4b8e165ee5723643dcd89619a341c7559eafe2bd..94c54465002003e34af8f6fb3d14a1be839fdeba 100644 (file)
@@ -52,6 +52,10 @@ int is_big_kernel;
 
 #define PECOFF_RELOC_RESERVE 0x20
 
+unsigned long efi_stub_entry;
+unsigned long efi_pe_entry;
+unsigned long startup_64;
+
 /*----------------------------------------------------------------------*/
 
 static const u32 crctab32[] = {
@@ -132,7 +136,7 @@ static void die(const char * str, ...)
 
 static void usage(void)
 {
-       die("Usage: build setup system [> image]");
+       die("Usage: build setup system [zoffset.h] [> image]");
 }
 
 #ifdef CONFIG_EFI_STUB
@@ -206,30 +210,54 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz)
         */
        put_unaligned_le32(file_sz - 512, &buf[pe_header + 0x1c]);
 
-#ifdef CONFIG_X86_32
        /*
-        * Address of entry point.
-        *
-        * The EFI stub entry point is +16 bytes from the start of
-        * the .text section.
+        * Address of entry point for PE/COFF executable
         */
-       put_unaligned_le32(text_start + 16, &buf[pe_header + 0x28]);
-#else
-       /*
-        * Address of entry point. startup_32 is at the beginning and
-        * the 64-bit entry point (startup_64) is always 512 bytes
-        * after. The EFI stub entry point is 16 bytes after that, as
-        * the first instruction allows legacy loaders to jump over
-        * the EFI stub initialisation
-        */
-       put_unaligned_le32(text_start + 528, &buf[pe_header + 0x28]);
-#endif /* CONFIG_X86_32 */
+       put_unaligned_le32(text_start + efi_pe_entry, &buf[pe_header + 0x28]);
 
        update_pecoff_section_header(".text", text_start, text_sz);
 }
 
 #endif /* CONFIG_EFI_STUB */
 
+
+/*
+ * Parse zoffset.h and find the entry points. We could just #include zoffset.h
+ * but that would mean tools/build would have to be rebuilt every time. It's
+ * not as if parsing it is hard...
+ */
+#define PARSE_ZOFS(p, sym) do { \
+       if (!strncmp(p, "#define ZO_" #sym " ", 11+sizeof(#sym)))       \
+               sym = strtoul(p + 11 + sizeof(#sym), NULL, 16);         \
+} while (0)
+
+static void parse_zoffset(char *fname)
+{
+       FILE *file;
+       char *p;
+       int c;
+
+       file = fopen(fname, "r");
+       if (!file)
+               die("Unable to open `%s': %m", fname);
+       c = fread(buf, 1, sizeof(buf) - 1, file);
+       if (ferror(file))
+               die("read-error on `zoffset.h'");
+       buf[c] = 0;
+
+       p = (char *)buf;
+
+       while (p && *p) {
+               PARSE_ZOFS(p, efi_stub_entry);
+               PARSE_ZOFS(p, efi_pe_entry);
+               PARSE_ZOFS(p, startup_64);
+
+               p = strchr(p, '\n');
+               while (p && (*p == '\r' || *p == '\n'))
+                       p++;
+       }
+}
+
 int main(int argc, char ** argv)
 {
        unsigned int i, sz, setup_sectors;
@@ -241,7 +269,19 @@ int main(int argc, char ** argv)
        void *kernel;
        u32 crc = 0xffffffffUL;
 
-       if (argc != 3)
+       /* Defaults for old kernel */
+#ifdef CONFIG_X86_32
+       efi_pe_entry = 0x10;
+       efi_stub_entry = 0x30;
+#else
+       efi_pe_entry = 0x210;
+       efi_stub_entry = 0x230;
+       startup_64 = 0x200;
+#endif
+
+       if (argc == 4)
+               parse_zoffset(argv[3]);
+       else if (argc != 3)
                usage();
 
        /* Copy the setup code */
@@ -299,6 +339,11 @@ int main(int argc, char ** argv)
 
 #ifdef CONFIG_EFI_STUB
        update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz));
+
+#ifdef CONFIG_X86_64 /* Yes, this is really how we defined it :( */
+       efi_stub_entry -= 0x200;
+#endif
+       put_unaligned_le32(efi_stub_entry, &buf[0x264]);
 #endif
 
        crc = partial_crc32(buf, i, crc);
index 6e8fdf5ad1135c0100c8b7a5220bb79db2359ddb..28677c55113f8cea59e59c67e7cd53cfcd615b6d 100644 (file)
@@ -94,6 +94,7 @@ extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size,
 #endif /* CONFIG_X86_32 */
 
 extern int add_efi_memmap;
+extern unsigned long x86_efi_facility;
 extern void efi_set_executable(efi_memory_desc_t *md, bool executable);
 extern int efi_memblock_x86_reserve_range(void);
 extern void efi_call_phys_prelog(void);
index b47c2a82ff1546a7efcd77a820a990d1e08bef00..062921ef34e9136100d3b4820826642dd45f223b 100644 (file)
@@ -16,7 +16,7 @@ extern void uv_system_init(void);
 extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
                                                 struct mm_struct *mm,
                                                 unsigned long start,
-                                                unsigned end,
+                                                unsigned long end,
                                                 unsigned int cpu);
 
 #else  /* X86_UV */
index 92862cd902012b9fb174d03e6e2cd687787136cf..c15ddaf907107134d6cd2f8d86f554e510a6f848 100644 (file)
@@ -1,6 +1,31 @@
 #ifndef _ASM_X86_BOOTPARAM_H
 #define _ASM_X86_BOOTPARAM_H
 
+/* setup_data types */
+#define SETUP_NONE                     0
+#define SETUP_E820_EXT                 1
+#define SETUP_DTB                      2
+#define SETUP_PCI                      3
+
+/* ram_size flags */
+#define RAMDISK_IMAGE_START_MASK       0x07FF
+#define RAMDISK_PROMPT_FLAG            0x8000
+#define RAMDISK_LOAD_FLAG              0x4000
+
+/* loadflags */
+#define LOADED_HIGH    (1<<0)
+#define QUIET_FLAG     (1<<5)
+#define KEEP_SEGMENTS  (1<<6)
+#define CAN_USE_HEAP   (1<<7)
+
+/* xloadflags */
+#define XLF_KERNEL_64                  (1<<0)
+#define XLF_CAN_BE_LOADED_ABOVE_4G     (1<<1)
+#define XLF_EFI_HANDOVER_32            (1<<2)
+#define XLF_EFI_HANDOVER_64            (1<<3)
+
+#ifndef __ASSEMBLY__
+
 #include <linux/types.h>
 #include <linux/screen_info.h>
 #include <linux/apm_bios.h>
@@ -9,12 +34,6 @@
 #include <asm/ist.h>
 #include <video/edid.h>
 
-/* setup data types */
-#define SETUP_NONE                     0
-#define SETUP_E820_EXT                 1
-#define SETUP_DTB                      2
-#define SETUP_PCI                      3
-
 /* extensible setup data list node */
 struct setup_data {
        __u64 next;
@@ -28,9 +47,6 @@ struct setup_header {
        __u16   root_flags;
        __u32   syssize;
        __u16   ram_size;
-#define RAMDISK_IMAGE_START_MASK       0x07FF
-#define RAMDISK_PROMPT_FLAG            0x8000
-#define RAMDISK_LOAD_FLAG              0x4000
        __u16   vid_mode;
        __u16   root_dev;
        __u16   boot_flag;
@@ -42,10 +58,6 @@ struct setup_header {
        __u16   kernel_version;
        __u8    type_of_loader;
        __u8    loadflags;
-#define LOADED_HIGH    (1<<0)
-#define QUIET_FLAG     (1<<5)
-#define KEEP_SEGMENTS  (1<<6)
-#define CAN_USE_HEAP   (1<<7)
        __u16   setup_move_size;
        __u32   code32_start;
        __u32   ramdisk_image;
@@ -58,7 +70,8 @@ struct setup_header {
        __u32   initrd_addr_max;
        __u32   kernel_alignment;
        __u8    relocatable_kernel;
-       __u8    _pad2[3];
+       __u8    min_alignment;
+       __u16   xloadflags;
        __u32   cmdline_size;
        __u32   hardware_subarch;
        __u64   hardware_subarch_data;
@@ -106,7 +119,10 @@ struct boot_params {
        __u8  hd1_info[16];     /* obsolete! */         /* 0x090 */
        struct sys_desc_table sys_desc_table;           /* 0x0a0 */
        struct olpc_ofw_header olpc_ofw_header;         /* 0x0b0 */
-       __u8  _pad4[128];                               /* 0x0c0 */
+       __u32 ext_ramdisk_image;                        /* 0x0c0 */
+       __u32 ext_ramdisk_size;                         /* 0x0c4 */
+       __u32 ext_cmd_line_ptr;                         /* 0x0c8 */
+       __u8  _pad4[116];                               /* 0x0cc */
        struct edid_info edid_info;                     /* 0x140 */
        struct efi_info efi_info;                       /* 0x1c0 */
        __u32 alt_mem_k;                                /* 0x1e0 */
@@ -115,7 +131,20 @@ struct boot_params {
        __u8  eddbuf_entries;                           /* 0x1e9 */
        __u8  edd_mbr_sig_buf_entries;                  /* 0x1ea */
        __u8  kbd_status;                               /* 0x1eb */
-       __u8  _pad6[5];                                 /* 0x1ec */
+       __u8  _pad5[3];                                 /* 0x1ec */
+       /*
+        * The sentinel is set to a nonzero value (0xff) in header.S.
+        *
+        * A bootloader is supposed to only take setup_header and put
+        * it into a clean boot_params buffer. If it turns out that
+        * it is clumsy or too generous with the buffer, it most
+        * probably will pick up the sentinel variable too. The fact
+        * that this variable then is still 0xff will let kernel
+        * know that some variables in boot_params are invalid and
+        * kernel should zero out certain portions of boot_params.
+        */
+       __u8  sentinel;                                 /* 0x1ef */
+       __u8  _pad6[1];                                 /* 0x1f0 */
        struct setup_header hdr;    /* setup header */  /* 0x1f1 */
        __u8  _pad7[0x290-0x1f1-sizeof(struct setup_header)];
        __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX];      /* 0x290 */
@@ -134,6 +163,6 @@ enum {
        X86_NR_SUBARCHS,
 };
 
-
+#endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_X86_BOOTPARAM_H */
index 07a7a04529bc5d7849ffc21b79819edd7b23ffd9..cb3c591339aa3d4242e420d181b83f3a62ced2c3 100644 (file)
@@ -1781,6 +1781,7 @@ first_nmi:
         * Leave room for the "copied" frame
         */
        subq $(5*8), %rsp
+       CFI_ADJUST_CFA_OFFSET 5*8
 
        /* Copy the stack frame to the Saved frame */
        .rept 5
@@ -1863,10 +1864,8 @@ end_repeat_nmi:
 nmi_swapgs:
        SWAPGS_UNSAFE_STACK
 nmi_restore:
-       RESTORE_ALL 8
-
-       /* Pop the extra iret frame */
-       addq $(5*8), %rsp
+       /* Pop the extra iret frame at once */
+       RESTORE_ALL 6*8
 
        /* Clear the NMI executing stack variable */
        movq $0, 5*8(%rsp)
index 8e7f6556028f7ff50d90c73eac405d3cdcb7b881..c8932c79e78bbaad99c4969a1ea1a0ff2f7f1802 100644 (file)
@@ -300,6 +300,12 @@ ENTRY(startup_32_smp)
        leal -__PAGE_OFFSET(%ecx),%esp
 
 default_entry:
+#define CR0_STATE      (X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \
+                        X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \
+                        X86_CR0_PG)
+       movl $(CR0_STATE & ~X86_CR0_PG),%eax
+       movl %eax,%cr0
+
 /*
  *     New page tables may be in 4Mbyte page mode and may
  *     be using the global pages. 
@@ -364,8 +370,7 @@ default_entry:
  */
        movl $pa(initial_page_table), %eax
        movl %eax,%cr3          /* set the page table pointer.. */
-       movl %cr0,%eax
-       orl  $X86_CR0_PG,%eax
+       movl $CR0_STATE,%eax
        movl %eax,%cr0          /* ..and set paging (PG) bit */
        ljmp $__BOOT_CS,$1f     /* Clear prefetch and normalize %eip */
 1:
index a7c5661f84962a2f6eb80509c1791392352a6fc8..4929502c1372db979d7e1b176b22a9981e8ec96e 100644 (file)
@@ -174,6 +174,9 @@ static int msr_open(struct inode *inode, struct file *file)
        unsigned int cpu;
        struct cpuinfo_x86 *c;
 
+       if (!capable(CAP_SYS_RAWIO))
+               return -EPERM;
+
        cpu = iminor(file->f_path.dentry->d_inode);
        if (cpu >= nr_cpu_ids || !cpu_online(cpu))
                return -ENXIO;  /* No such CPU */
index 0f5dec5c80e0fccbba37474463e724970503faf2..872079a67e4d262151dfdbe74f537033be5ebcc0 100644 (file)
@@ -56,7 +56,7 @@ struct device x86_dma_fallback_dev = {
 EXPORT_SYMBOL(x86_dma_fallback_dev);
 
 /* Number of entries preallocated for DMA-API debugging */
-#define PREALLOC_DMA_DEBUG_ENTRIES       32768
+#define PREALLOC_DMA_DEBUG_ENTRIES       65536
 
 int dma_set_mask(struct device *dev, u64 mask)
 {
index 4e8ba39eaf0fd93cbca557eaecf3efcd954ee05b..76fa1e9a2b39399b1944e4a13c68a054c9a5c386 100644 (file)
@@ -584,7 +584,7 @@ static void native_machine_emergency_restart(void)
                        break;
 
                case BOOT_EFI:
-                       if (efi_enabled)
+                       if (efi_enabled(EFI_RUNTIME_SERVICES))
                                efi.reset_system(reboot_mode ?
                                                 EFI_RESET_WARM :
                                                 EFI_RESET_COLD,
index 00f6c1472b850472e5f9759dd5ad9613f6c026be..8b24289cc10c0f2239623918e587810b81c43c9b 100644 (file)
@@ -807,15 +807,15 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_EFI
        if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
                     "EL32", 4)) {
-               efi_enabled = 1;
-               efi_64bit = false;
+               set_bit(EFI_BOOT, &x86_efi_facility);
        } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
                     "EL64", 4)) {
-               efi_enabled = 1;
-               efi_64bit = true;
+               set_bit(EFI_BOOT, &x86_efi_facility);
+               set_bit(EFI_64BIT, &x86_efi_facility);
        }
-       if (efi_enabled && efi_memblock_x86_reserve_range())
-               efi_enabled = 0;
+
+       if (efi_enabled(EFI_BOOT))
+               efi_memblock_x86_reserve_range();
 #endif
 
        x86_init.oem.arch_setup();
@@ -888,7 +888,7 @@ void __init setup_arch(char **cmdline_p)
 
        finish_e820_parsing();
 
-       if (efi_enabled)
+       if (efi_enabled(EFI_BOOT))
                efi_init();
 
        dmi_scan_machine();
@@ -971,7 +971,7 @@ void __init setup_arch(char **cmdline_p)
         * The EFI specification says that boot service code won't be called
         * after ExitBootServices(). This is, in fact, a lie.
         */
-       if (efi_enabled)
+       if (efi_enabled(EFI_MEMMAP))
                efi_reserve_boot_services();
 
        /* preallocate 4k for mptable mpc */
@@ -1114,7 +1114,7 @@ void __init setup_arch(char **cmdline_p)
 
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
-       if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
+       if (!efi_enabled(EFI_BOOT) || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
                conswitchp = &vga_con;
 #elif defined(CONFIG_DUMMY_CONSOLE)
        conswitchp = &dummy_con;
@@ -1131,14 +1131,14 @@ void __init setup_arch(char **cmdline_p)
        register_refined_jiffies(CLOCK_TICK_RATE);
 
 #ifdef CONFIG_EFI
-       /* Once setup is done above, disable efi_enabled on mismatched
-        * firmware/kernel archtectures since there is no support for
-        * runtime services.
+       /* Once setup is done above, unmap the EFI memory map on
+        * mismatched firmware/kernel archtectures since there is no
+        * support for runtime services.
         */
-       if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) {
+       if (efi_enabled(EFI_BOOT) &&
+           IS_ENABLED(CONFIG_X86_64) != efi_enabled(EFI_64BIT)) {
                pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
                efi_unmap_memmap();
-               efi_enabled = 0;
        }
 #endif
 }
index ad4439145f858314dfe518cf7cd9336c5fe9c96d..77cf0090c0a3ef7890ea24d4e5e47d1d68e0b024 100644 (file)
@@ -51,9 +51,6 @@
 
 #define EFI_DEBUG      1
 
-int efi_enabled;
-EXPORT_SYMBOL(efi_enabled);
-
 struct efi __read_mostly efi = {
        .mps        = EFI_INVALID_TABLE_ADDR,
        .acpi       = EFI_INVALID_TABLE_ADDR,
@@ -69,19 +66,28 @@ EXPORT_SYMBOL(efi);
 
 struct efi_memory_map memmap;
 
-bool efi_64bit;
-
 static struct efi efi_phys __initdata;
 static efi_system_table_t efi_systab __initdata;
 
 static inline bool efi_is_native(void)
 {
-       return IS_ENABLED(CONFIG_X86_64) == efi_64bit;
+       return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT);
+}
+
+unsigned long x86_efi_facility;
+
+/*
+ * Returns 1 if 'facility' is enabled, 0 otherwise.
+ */
+int efi_enabled(int facility)
+{
+       return test_bit(facility, &x86_efi_facility) != 0;
 }
+EXPORT_SYMBOL(efi_enabled);
 
 static int __init setup_noefi(char *arg)
 {
-       efi_enabled = 0;
+       clear_bit(EFI_BOOT, &x86_efi_facility);
        return 0;
 }
 early_param("noefi", setup_noefi);
@@ -426,6 +432,7 @@ void __init efi_reserve_boot_services(void)
 
 void __init efi_unmap_memmap(void)
 {
+       clear_bit(EFI_MEMMAP, &x86_efi_facility);
        if (memmap.map) {
                early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
                memmap.map = NULL;
@@ -460,7 +467,7 @@ void __init efi_free_boot_services(void)
 
 static int __init efi_systab_init(void *phys)
 {
-       if (efi_64bit) {
+       if (efi_enabled(EFI_64BIT)) {
                efi_system_table_64_t *systab64;
                u64 tmp = 0;
 
@@ -552,7 +559,7 @@ static int __init efi_config_init(u64 tables, int nr_tables)
        void *config_tables, *tablep;
        int i, sz;
 
-       if (efi_64bit)
+       if (efi_enabled(EFI_64BIT))
                sz = sizeof(efi_config_table_64_t);
        else
                sz = sizeof(efi_config_table_32_t);
@@ -572,7 +579,7 @@ static int __init efi_config_init(u64 tables, int nr_tables)
                efi_guid_t guid;
                unsigned long table;
 
-               if (efi_64bit) {
+               if (efi_enabled(EFI_64BIT)) {
                        u64 table64;
                        guid = ((efi_config_table_64_t *)tablep)->guid;
                        table64 = ((efi_config_table_64_t *)tablep)->table;
@@ -684,7 +691,6 @@ void __init efi_init(void)
        if (boot_params.efi_info.efi_systab_hi ||
            boot_params.efi_info.efi_memmap_hi) {
                pr_info("Table located above 4GB, disabling EFI.\n");
-               efi_enabled = 0;
                return;
        }
        efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
@@ -694,10 +700,10 @@ void __init efi_init(void)
                          ((__u64)boot_params.efi_info.efi_systab_hi<<32));
 #endif
 
-       if (efi_systab_init(efi_phys.systab)) {
-               efi_enabled = 0;
+       if (efi_systab_init(efi_phys.systab))
                return;
-       }
+
+       set_bit(EFI_SYSTEM_TABLES, &x86_efi_facility);
 
        /*
         * Show what we know for posterity
@@ -715,10 +721,10 @@ void __init efi_init(void)
                efi.systab->hdr.revision >> 16,
                efi.systab->hdr.revision & 0xffff, vendor);
 
-       if (efi_config_init(efi.systab->tables, efi.systab->nr_tables)) {
-               efi_enabled = 0;
+       if (efi_config_init(efi.systab->tables, efi.systab->nr_tables))
                return;
-       }
+
+       set_bit(EFI_CONFIG_TABLES, &x86_efi_facility);
 
        /*
         * Note: We currently don't support runtime services on an EFI
@@ -727,15 +733,17 @@ void __init efi_init(void)
 
        if (!efi_is_native())
                pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n");
-       else if (efi_runtime_init()) {
-               efi_enabled = 0;
-               return;
+       else {
+               if (efi_runtime_init())
+                       return;
+               set_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility);
        }
 
-       if (efi_memmap_init()) {
-               efi_enabled = 0;
+       if (efi_memmap_init())
                return;
-       }
+
+       set_bit(EFI_MEMMAP, &x86_efi_facility);
+
 #ifdef CONFIG_X86_32
        if (efi_is_native()) {
                x86_platform.get_wallclock = efi_get_time;
@@ -941,7 +949,7 @@ void __init efi_enter_virtual_mode(void)
         *
         * Call EFI services through wrapper functions.
         */
-       efi.runtime_version = efi_systab.fw_revision;
+       efi.runtime_version = efi_systab.hdr.revision;
        efi.get_time = virt_efi_get_time;
        efi.set_time = virt_efi_set_time;
        efi.get_wakeup_time = virt_efi_get_wakeup_time;
@@ -969,6 +977,9 @@ u32 efi_mem_type(unsigned long phys_addr)
        efi_memory_desc_t *md;
        void *p;
 
+       if (!efi_enabled(EFI_MEMMAP))
+               return 0;
+
        for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
                md = p;
                if ((md->phys_addr <= phys_addr) &&
index 95fd505dfeb6e43dd37b0c41954f0b0db6535d1c..2b2003860615fbc5e24ef12e1c1fa3d855a1f09d 100644 (file)
@@ -38,7 +38,7 @@
 #include <asm/cacheflush.h>
 #include <asm/fixmap.h>
 
-static pgd_t save_pgd __initdata;
+static pgd_t *save_pgd __initdata;
 static unsigned long efi_flags __initdata;
 
 static void __init early_code_mapping_set_exec(int executable)
@@ -61,12 +61,20 @@ static void __init early_code_mapping_set_exec(int executable)
 void __init efi_call_phys_prelog(void)
 {
        unsigned long vaddress;
+       int pgd;
+       int n_pgds;
 
        early_code_mapping_set_exec(1);
        local_irq_save(efi_flags);
-       vaddress = (unsigned long)__va(0x0UL);
-       save_pgd = *pgd_offset_k(0x0UL);
-       set_pgd(pgd_offset_k(0x0UL), *pgd_offset_k(vaddress));
+
+       n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);
+       save_pgd = kmalloc(n_pgds * sizeof(pgd_t), GFP_KERNEL);
+
+       for (pgd = 0; pgd < n_pgds; pgd++) {
+               save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE);
+               vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);
+               set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));
+       }
        __flush_tlb_all();
 }
 
@@ -75,7 +83,11 @@ void __init efi_call_phys_epilog(void)
        /*
         * After the lock is released, the original page table is restored.
         */
-       set_pgd(pgd_offset_k(0x0UL), save_pgd);
+       int pgd;
+       int n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);
+       for (pgd = 0; pgd < n_pgds; pgd++)
+               set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), save_pgd[pgd]);
+       kfree(save_pgd);
        __flush_tlb_all();
        local_irq_restore(efi_flags);
        early_code_mapping_set_exec(0);
index b8b3a37c80cd75e96559e67876206ad603b53741..dbbdca5f508c45bdfb34395aeeb42e500e9f1f1f 100644 (file)
@@ -1034,7 +1034,8 @@ static int set_distrib_bits(struct cpumask *flush_mask, struct bau_control *bcp,
  * globally purge translation cache of a virtual address or all TLB's
  * @cpumask: mask of all cpu's in which the address is to be removed
  * @mm: mm_struct containing virtual address range
- * @va: virtual address to be removed (or TLB_FLUSH_ALL for all TLB's on cpu)
+ * @start: start virtual address to be removed from TLB
+ * @end: end virtual address to be remove from TLB
  * @cpu: the current cpu
  *
  * This is the entry point for initiating any UV global TLB shootdown.
@@ -1056,7 +1057,7 @@ static int set_distrib_bits(struct cpumask *flush_mask, struct bau_control *bcp,
  */
 const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
                                struct mm_struct *mm, unsigned long start,
-                               unsigned end, unsigned int cpu)
+                               unsigned long end, unsigned int cpu)
 {
        int locals = 0;
        int remotes = 0;
@@ -1113,7 +1114,10 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
 
        record_send_statistics(stat, locals, hubs, remotes, bau_desc);
 
-       bau_desc->payload.address = start;
+       if (!end || (end - start) <= PAGE_SIZE)
+               bau_desc->payload.address = start;
+       else
+               bau_desc->payload.address = TLB_FLUSH_ALL;
        bau_desc->payload.sending_cpu = cpu;
        /*
         * uv_flush_send_and_wait returns 0 if all cpu's were messaged,
index 5a1847d619306e5f0ed5ed5570c53c69a8ce2315..79d67bd507fa6c5bd779defa312943b1d99a47f6 100644 (file)
@@ -814,12 +814,14 @@ int main(int argc, char **argv)
        read_relocs(fp);
        if (show_absolute_syms) {
                print_absolute_symbols();
-               return 0;
+               goto out;
        }
        if (show_absolute_relocs) {
                print_absolute_relocs();
-               return 0;
+               goto out;
        }
        emit_relocs(as_text, use_real_mode);
+out:
+       fclose(fp);
        return 0;
 }
index 3ff267861541f7570a5b110b7893e0cb012f5917..bd22f8667eed65e3889e61dcc357d85f5f3d1239 100644 (file)
@@ -250,7 +250,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
                return acpi_rsdp;
 #endif
 
-       if (efi_enabled) {
+       if (efi_enabled(EFI_CONFIG_TABLES)) {
                if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
                        return efi.acpi20;
                else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
index b00000e8aef6f9cb06955049d3fa4faaba25e38b..33c9a44a967899ac5b46e9b3e9951b2e80ff164d 100644 (file)
@@ -77,10 +77,15 @@ static struct usb_device_id ath3k_table[] = {
        { USB_DEVICE(0x0CF3, 0x311D) },
        { USB_DEVICE(0x13d3, 0x3375) },
        { USB_DEVICE(0x04CA, 0x3005) },
+       { USB_DEVICE(0x04CA, 0x3006) },
+       { USB_DEVICE(0x04CA, 0x3008) },
        { USB_DEVICE(0x13d3, 0x3362) },
        { USB_DEVICE(0x0CF3, 0xE004) },
        { USB_DEVICE(0x0930, 0x0219) },
        { USB_DEVICE(0x0489, 0xe057) },
+       { USB_DEVICE(0x13d3, 0x3393) },
+       { USB_DEVICE(0x0489, 0xe04e) },
+       { USB_DEVICE(0x0489, 0xe056) },
 
        /* Atheros AR5BBU12 with sflash firmware */
        { USB_DEVICE(0x0489, 0xE02C) },
@@ -104,10 +109,15 @@ static struct usb_device_id ath3k_blist_tbl[] = {
        { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
 
        /* Atheros AR5BBU22 with sflash firmware */
        { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
index a1d4ede5b892d4516b294f91aca91633864e7d43..7e351e345476c1bcc2141f95e41fe43a3e65e612 100644 (file)
@@ -135,10 +135,15 @@ static struct usb_device_id blacklist_table[] = {
        { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
        { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
+       { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
 
        /* Atheros AR5BBU12 with sflash firmware */
        { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
index e69991aab43ade84d0d32beb44be9e3c7baa91b8..792bc57a9db7c910d247eb47d4801a27f08792c8 100644 (file)
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include <linux/clk/bcm2835.h>
+#include <linux/clk-provider.h>
+#include <linux/of.h>
+
+static const __initconst struct of_device_id clk_match[] = {
+       { .compatible = "fixed-clock", .data = of_fixed_clk_setup, },
+       { }
+};
 
 /*
  * These are fixed clocks. They're probably not all root clocks and it may
@@ -56,4 +63,6 @@ void __init bcm2835_init_clocks(void)
        ret = clk_register_clkdev(clk, NULL, "20215000.uart");
        if (ret)
                pr_err("uart1_pclk alias not registered\n");
+
+       of_clk_init(clk_match);
 }
index 7fdcbd3f4da5a7756f2f1fb01a467a11b107092b..7d978c1bd5280331f9b183de53464f4610438ce1 100644 (file)
@@ -1,3 +1,6 @@
+config CLKSRC_OF
+       bool
+
 config CLKSRC_I8253
        bool
 
@@ -25,6 +28,9 @@ config ARMADA_370_XP_TIMER
 config SUNXI_TIMER
        bool
 
+config VT8500_TIMER
+       bool
+
 config CLKSRC_NOMADIK_MTU
        bool
        depends on (ARCH_NOMADIK || ARCH_U8500)
index f93453d0167305d7633495661a5f92d7720aa32a..440449c1ca21e139e7c5d79e19c0feab9934e550 100644 (file)
@@ -1,3 +1,4 @@
+obj-$(CONFIG_CLKSRC_OF)        += clksrc-of.o
 obj-$(CONFIG_ATMEL_TCB_CLKSRC) += tcb_clksrc.o
 obj-$(CONFIG_X86_CYCLONE_TIMER)        += cyclone.o
 obj-$(CONFIG_X86_PM_TIMER)     += acpi_pm.o
@@ -16,5 +17,6 @@ obj-$(CONFIG_CLKSRC_DBX500_PRCMU)     += clksrc-dbx500-prcmu.o
 obj-$(CONFIG_ARMADA_370_XP_TIMER)      += time-armada-370-xp.o
 obj-$(CONFIG_ARCH_BCM2835)     += bcm2835_timer.o
 obj-$(CONFIG_SUNXI_TIMER)      += sunxi_timer.o
+obj-$(CONFIG_VT8500_TIMER)     += vt8500_timer.o
 
 obj-$(CONFIG_CLKSRC_ARM_GENERIC)       += arm_generic.o
index bc19f12c20ced747eb2afa33f5e918ab97f8a42c..7f796d8f7505cfe4784c8ec5559b7e9a196d011c 100644 (file)
@@ -101,7 +101,7 @@ static struct of_device_id bcm2835_time_match[] __initconst = {
        {}
 };
 
-static void __init bcm2835_time_init(void)
+void __init bcm2835_timer_init(void)
 {
        struct device_node *node;
        void __iomem *base;
@@ -155,7 +155,3 @@ static void __init bcm2835_time_init(void)
 
        pr_info("bcm2835: system timer (irq = %d)\n", irq);
 }
-
-struct sys_timer bcm2835_timer = {
-       .init = bcm2835_time_init,
-};
diff --git a/drivers/clocksource/clksrc-of.c b/drivers/clocksource/clksrc-of.c
new file mode 100644 (file)
index 0000000..bdabdaa
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/init.h>
+#include <linux/of.h>
+
+extern struct of_device_id __clksrc_of_table[];
+
+static const struct of_device_id __clksrc_of_table_sentinel
+       __used __section(__clksrc_of_table_end);
+
+void __init clocksource_of_init(void)
+{
+       struct device_node *np;
+       const struct of_device_id *match;
+       void (*init_func)(void);
+
+       for_each_matching_node_and_match(np, __clksrc_of_table, &match) {
+               init_func = match->data;
+               init_func();
+       }
+}
index d9279385304d8b86fff47d58f3b623b0c804a046..ea210482dd2099af6ce35e31bd234fcc18a4d970 100644 (file)
@@ -100,7 +100,6 @@ static struct clock_event_device cs5535_clockevent = {
        .set_mode = mfgpt_set_mode,
        .set_next_event = mfgpt_next_event,
        .rating = 250,
-       .shift = 32
 };
 
 static irqreturn_t mfgpt_tick(int irq, void *dev_id)
@@ -169,17 +168,11 @@ static int __init cs5535_mfgpt_init(void)
        cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, val);
 
        /* Set up the clock event */
-       cs5535_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC,
-                       cs5535_clockevent.shift);
-       cs5535_clockevent.min_delta_ns = clockevent_delta2ns(0xF,
-                       &cs5535_clockevent);
-       cs5535_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE,
-                       &cs5535_clockevent);
-
        printk(KERN_INFO DRV_NAME
                ": Registering MFGPT timer as a clock event, using IRQ %d\n",
                timer_irq);
-       clockevents_register_device(&cs5535_clockevent);
+       clockevents_config_and_register(&cs5535_clockevent, MFGPT_HZ,
+                                       0xF, 0xFFFE);
 
        return 0;
 
index f7dba5b79b44425f72e1cc887edc248634683982..ab09ed3742ee6c585ed6a607ce2adfbd7d0a5929 100644 (file)
@@ -107,7 +107,7 @@ static const struct of_device_id osctimer_ids[] __initconst = {
        {},
 };
 
-static void __init timer_init(void)
+void __init dw_apb_timer_init(void)
 {
        struct device_node *event_timer, *source_timer;
 
@@ -125,7 +125,3 @@ static void __init timer_init(void)
 
        init_sched_clock();
 }
-
-struct sys_timer dw_apb_timer = {
-       .init = timer_init,
-};
index 8914c3c1c88b08d8c183a23b17f1e2bd1ffb1e06..025afc6dd324949897968f0fac83e1e90eee3d7a 100644 (file)
@@ -134,12 +134,32 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode,
        }
 }
 
+void nmdk_clksrc_reset(void)
+{
+       /* Disable */
+       writel(0, mtu_base + MTU_CR(0));
+
+       /* ClockSource: configure load and background-load, and fire it up */
+       writel(nmdk_cycle, mtu_base + MTU_LR(0));
+       writel(nmdk_cycle, mtu_base + MTU_BGLR(0));
+
+       writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA,
+              mtu_base + MTU_CR(0));
+}
+
+static void nmdk_clkevt_resume(struct clock_event_device *cedev)
+{
+       nmdk_clkevt_reset();
+       nmdk_clksrc_reset();
+}
+
 static struct clock_event_device nmdk_clkevt = {
        .name           = "mtu_1",
        .features       = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
        .rating         = 200,
        .set_mode       = nmdk_clkevt_mode,
        .set_next_event = nmdk_clkevt_next,
+       .resume         = nmdk_clkevt_resume,
 };
 
 /*
@@ -161,19 +181,6 @@ static struct irqaction nmdk_timer_irq = {
        .dev_id         = &nmdk_clkevt,
 };
 
-void nmdk_clksrc_reset(void)
-{
-       /* Disable */
-       writel(0, mtu_base + MTU_CR(0));
-
-       /* ClockSource: configure load and background-load, and fire it up */
-       writel(nmdk_cycle, mtu_base + MTU_LR(0));
-       writel(nmdk_cycle, mtu_base + MTU_BGLR(0));
-
-       writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA,
-              mtu_base + MTU_CR(0));
-}
-
 void __init nmdk_timer_init(void __iomem *base, int irq)
 {
        unsigned long rate;
index 3cd1bd3d7aee7fd0f6c77143bfb11b8d1100e59e..0ce85e29769b80ac7c9e2b958e84bf87505c09eb 100644 (file)
@@ -74,7 +74,6 @@ static int sunxi_clkevt_next_event(unsigned long evt,
 
 static struct clock_event_device sunxi_clockevent = {
        .name = "sunxi_tick",
-       .shift = 32,
        .rating = 300,
        .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .set_mode = sunxi_clkevt_mode,
@@ -104,7 +103,7 @@ static struct of_device_id sunxi_timer_dt_ids[] = {
        { }
 };
 
-static void __init sunxi_timer_init(void)
+void __init sunxi_timer_init(void)
 {
        struct device_node *node;
        unsigned long rate = 0;
@@ -154,18 +153,8 @@ static void __init sunxi_timer_init(void)
        val = readl(timer_base + TIMER_CTL_REG);
        writel(val | TIMER_CTL_ENABLE, timer_base + TIMER_CTL_REG);
 
-       sunxi_clockevent.mult = div_sc(rate / TIMER_SCAL,
-                               NSEC_PER_SEC,
-                               sunxi_clockevent.shift);
-       sunxi_clockevent.max_delta_ns = clockevent_delta2ns(0xff,
-                                                           &sunxi_clockevent);
-       sunxi_clockevent.min_delta_ns = clockevent_delta2ns(0x1,
-                                                           &sunxi_clockevent);
        sunxi_clockevent.cpumask = cpumask_of(0);
 
-       clockevents_register_device(&sunxi_clockevent);
+       clockevents_config_and_register(&sunxi_clockevent, rate / TIMER_SCAL,
+                                       0x1, 0xff);
 }
-
-struct sys_timer sunxi_timer = {
-       .init = sunxi_timer_init,
-};
index 32cb929b8eb62ae387fc20b122c5d5a21da3f10b..8a6187225dd0e7faa9b25c14147be31f3b7a9539 100644 (file)
@@ -157,7 +157,6 @@ static struct tc_clkevt_device clkevt = {
                .name           = "tc_clkevt",
                .features       = CLOCK_EVT_FEAT_PERIODIC
                                        | CLOCK_EVT_FEAT_ONESHOT,
-               .shift          = 32,
                /* Should be lower than at91rm9200's system timer */
                .rating         = 125,
                .set_next_event = tc_next_event,
@@ -196,13 +195,9 @@ static void __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx)
 
        timer_clock = clk32k_divisor_idx;
 
-       clkevt.clkevt.mult = div_sc(32768, NSEC_PER_SEC, clkevt.clkevt.shift);
-       clkevt.clkevt.max_delta_ns
-               = clockevent_delta2ns(0xffff, &clkevt.clkevt);
-       clkevt.clkevt.min_delta_ns = clockevent_delta2ns(1, &clkevt.clkevt) + 1;
        clkevt.clkevt.cpumask = cpumask_of(0);
 
-       clockevents_register_device(&clkevt.clkevt);
+       clockevents_config_and_register(&clkevt.clkevt, 32768, 1, 0xffff);
 
        setup_irq(irq, &tc_irqaction);
 }
diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
new file mode 100644 (file)
index 0000000..ed66cf0
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ *  arch/arm/mach-vt8500/timer.c
+ *
+ *  Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
+ *  Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/*
+ * This file is copied and modified from the original timer.c provided by
+ * Alexey Charkov. Minor changes have been made for Device Tree Support.
+ */
+
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+#include <linux/clocksource.h>
+#include <linux/clockchips.h>
+#include <linux/delay.h>
+#include <asm/mach/time.h>
+
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+
+#define VT8500_TIMER_OFFSET    0x0100
+#define VT8500_TIMER_HZ                3000000
+#define TIMER_MATCH_VAL                0x0000
+#define TIMER_COUNT_VAL                0x0010
+#define TIMER_STATUS_VAL       0x0014
+#define TIMER_IER_VAL          0x001c          /* interrupt enable */
+#define TIMER_CTRL_VAL         0x0020
+#define TIMER_AS_VAL           0x0024          /* access status */
+#define TIMER_COUNT_R_ACTIVE   (1 << 5)        /* not ready for read */
+#define TIMER_COUNT_W_ACTIVE   (1 << 4)        /* not ready for write */
+#define TIMER_MATCH_W_ACTIVE   (1 << 0)        /* not ready for write */
+
+#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
+
+static void __iomem *regbase;
+
+static cycle_t vt8500_timer_read(struct clocksource *cs)
+{
+       int loops = msecs_to_loops(10);
+       writel(3, regbase + TIMER_CTRL_VAL);
+       while ((readl((regbase + TIMER_AS_VAL)) & TIMER_COUNT_R_ACTIVE)
+                                               && --loops)
+               cpu_relax();
+       return readl(regbase + TIMER_COUNT_VAL);
+}
+
+static struct clocksource clocksource = {
+       .name           = "vt8500_timer",
+       .rating         = 200,
+       .read           = vt8500_timer_read,
+       .mask           = CLOCKSOURCE_MASK(32),
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+};
+
+static int vt8500_timer_set_next_event(unsigned long cycles,
+                                   struct clock_event_device *evt)
+{
+       int loops = msecs_to_loops(10);
+       cycle_t alarm = clocksource.read(&clocksource) + cycles;
+       while ((readl(regbase + TIMER_AS_VAL) & TIMER_MATCH_W_ACTIVE)
+                                               && --loops)
+               cpu_relax();
+       writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);
+
+       if ((signed)(alarm - clocksource.read(&clocksource)) <= 16)
+               return -ETIME;
+
+       writel(1, regbase + TIMER_IER_VAL);
+
+       return 0;
+}
+
+static void vt8500_timer_set_mode(enum clock_event_mode mode,
+                             struct clock_event_device *evt)
+{
+       switch (mode) {
+       case CLOCK_EVT_MODE_RESUME:
+       case CLOCK_EVT_MODE_PERIODIC:
+               break;
+       case CLOCK_EVT_MODE_ONESHOT:
+       case CLOCK_EVT_MODE_UNUSED:
+       case CLOCK_EVT_MODE_SHUTDOWN:
+               writel(readl(regbase + TIMER_CTRL_VAL) | 1,
+                       regbase + TIMER_CTRL_VAL);
+               writel(0, regbase + TIMER_IER_VAL);
+               break;
+       }
+}
+
+static struct clock_event_device clockevent = {
+       .name           = "vt8500_timer",
+       .features       = CLOCK_EVT_FEAT_ONESHOT,
+       .rating         = 200,
+       .set_next_event = vt8500_timer_set_next_event,
+       .set_mode       = vt8500_timer_set_mode,
+};
+
+static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id)
+{
+       struct clock_event_device *evt = dev_id;
+       writel(0xf, regbase + TIMER_STATUS_VAL);
+       evt->event_handler(evt);
+
+       return IRQ_HANDLED;
+}
+
+static struct irqaction irq = {
+       .name    = "vt8500_timer",
+       .flags   = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+       .handler = vt8500_timer_interrupt,
+       .dev_id  = &clockevent,
+};
+
+static struct of_device_id vt8500_timer_ids[] = {
+       { .compatible = "via,vt8500-timer" },
+       { }
+};
+
+void __init vt8500_timer_init(void)
+{
+       struct device_node *np;
+       int timer_irq;
+
+       np = of_find_matching_node(NULL, vt8500_timer_ids);
+       if (!np) {
+               pr_err("%s: Timer description missing from Device Tree\n",
+                                                               __func__);
+               return;
+       }
+       regbase = of_iomap(np, 0);
+       if (!regbase) {
+               pr_err("%s: Missing iobase description in Device Tree\n",
+                                                               __func__);
+               of_node_put(np);
+               return;
+       }
+       timer_irq = irq_of_parse_and_map(np, 0);
+       if (!timer_irq) {
+               pr_err("%s: Missing irq description in Device Tree\n",
+                                                               __func__);
+               of_node_put(np);
+               return;
+       }
+
+       writel(1, regbase + TIMER_CTRL_VAL);
+       writel(0xf, regbase + TIMER_STATUS_VAL);
+       writel(~0, regbase + TIMER_MATCH_VAL);
+
+       if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ))
+               pr_err("%s: vt8500_timer_init: clocksource_register failed for %s\n",
+                                       __func__, clocksource.name);
+
+       clockevent.cpumask = cpumask_of(0);
+
+       if (setup_irq(timer_irq, &irq))
+               pr_err("%s: setup_irq failed for %s\n", __func__,
+                                                       clockevent.name);
+       clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ,
+                                       4, 0xf0000000);
+}
+
index 281f566a5513d907fefc67da9237a2ec41ab8679..d1e9eb191f2bd77ff72614c0819885d31dcf473d 100644 (file)
@@ -340,7 +340,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
        /*
         * Alocate and fill the csrow/channels structs
         */
-       mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL);
+       mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL);
        if (!mci->csrows)
                goto error;
        for (row = 0; row < tot_csrows; row++) {
@@ -351,7 +351,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
                csr->csrow_idx = row;
                csr->mci = mci;
                csr->nr_channels = tot_channels;
-               csr->channels = kcalloc(sizeof(*csr->channels), tot_channels,
+               csr->channels = kcalloc(tot_channels, sizeof(*csr->channels),
                                        GFP_KERNEL);
                if (!csr->channels)
                        goto error;
@@ -369,7 +369,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
        /*
         * Allocate and fill the dimm structs
         */
-       mci->dimms  = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL);
+       mci->dimms  = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL);
        if (!mci->dimms)
                goto error;
 
index dc6e905ee1a5402126496bd06838302a1b26165f..0056c4dae9d52cc24985200dbb58b724be73c3ed 100644 (file)
@@ -256,7 +256,7 @@ static ssize_t edac_pci_dev_store(struct kobject *kobj,
        struct edac_pci_dev_attribute *edac_pci_dev;
        edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
 
-       if (edac_pci_dev->show)
+       if (edac_pci_dev->store)
                return edac_pci_dev->store(edac_pci_dev->value, buffer, count);
        return -EIO;
 }
index fd3ae6290d71ecfd927cc4447a942c099bd223ea..982f1f5f5742f21da9206f62fa622ce17adefe9f 100644 (file)
@@ -471,7 +471,7 @@ void __init dmi_scan_machine(void)
        char __iomem *p, *q;
        int rc;
 
-       if (efi_enabled) {
+       if (efi_enabled(EFI_CONFIG_TABLES)) {
                if (efi.smbios == EFI_INVALID_TABLE_ADDR)
                        goto error;
 
index 7b1c37497c9a2683569f8a1ac9c959e8d5bc7636..f5596db0cf583dc16226bc629a42977de0f9fa05 100644 (file)
@@ -674,7 +674,7 @@ static int efi_status_to_err(efi_status_t status)
                err = -EACCES;
                break;
        case EFI_NOT_FOUND:
-               err = -ENOENT;
+               err = -EIO;
                break;
        default:
                err = -EINVAL;
@@ -793,6 +793,7 @@ static ssize_t efivarfs_file_write(struct file *file,
                spin_unlock(&efivars->lock);
                efivar_unregister(var);
                drop_nlink(inode);
+               d_delete(file->f_dentry);
                dput(file->f_dentry);
 
        } else {
@@ -994,7 +995,7 @@ static int efivarfs_unlink(struct inode *dir, struct dentry *dentry)
                list_del(&var->list);
                spin_unlock(&efivars->lock);
                efivar_unregister(var);
-               drop_nlink(dir);
+               drop_nlink(dentry->d_inode);
                dput(dentry);
                return 0;
        }
@@ -1782,7 +1783,7 @@ efivars_init(void)
        printk(KERN_INFO "EFI Variables Facility v%s %s\n", EFIVARS_VERSION,
               EFIVARS_DATE);
 
-       if (!efi_enabled)
+       if (!efi_enabled(EFI_RUNTIME_SERVICES))
                return 0;
 
        /* For now we'll register the efi directory at /sys/firmware/efi */
@@ -1822,7 +1823,7 @@ err_put:
 static void __exit
 efivars_exit(void)
 {
-       if (efi_enabled) {
+       if (efi_enabled(EFI_RUNTIME_SERVICES)) {
                unregister_efivars(&__efivars);
                kobject_put(efi_kobj);
        }
index 4da4eb9ae92604c35349ebaeb39b4a612bac3ed6..2224f1dc074b1329d7ce9c80b78bef4fffc6e98b 100644 (file)
@@ -99,7 +99,7 @@ unsigned long __init find_ibft_region(unsigned long *sizep)
        /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will
         * only use ACPI for this */
 
-       if (!efi_enabled)
+       if (!efi_enabled(EFI_BOOT))
                find_ibft_in_mem();
 
        if (ibft_addr) {
index 1d1f1e5e33f0ff267daa1d8ed4818b0a4e00fc7e..046bcda36abe7aa0f60e53f79f9988eaef61bd17 100644 (file)
@@ -24,7 +24,7 @@ config DRM_EXYNOS_DMABUF
 
 config DRM_EXYNOS_FIMD
        bool "Exynos DRM FIMD"
-       depends on DRM_EXYNOS && !FB_S3C
+       depends on DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM
        help
          Choose this option if you want to use Exynos FIMD for DRM.
 
@@ -48,7 +48,7 @@ config DRM_EXYNOS_G2D
 
 config DRM_EXYNOS_IPP
        bool "Exynos DRM IPP"
-       depends on DRM_EXYNOS
+       depends on DRM_EXYNOS && !ARCH_MULTIPLATFORM
        help
          Choose this option if you want to use IPP feature for DRM.
 
index ab37437bad8a9f0f5baa8b0425584ba95f5eb2c0..4c5b6859c9ea5cab2aa856ce43d3675f0240235e 100644 (file)
@@ -18,7 +18,6 @@
 #include "exynos_drm_drv.h"
 #include "exynos_drm_encoder.h"
 
-#define MAX_EDID 256
 #define to_exynos_connector(x) container_of(x, struct exynos_drm_connector,\
                                drm_connector)
 
@@ -96,7 +95,9 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
                                        to_exynos_connector(connector);
        struct exynos_drm_manager *manager = exynos_connector->manager;
        struct exynos_drm_display_ops *display_ops = manager->display_ops;
-       unsigned int count;
+       struct edid *edid = NULL;
+       unsigned int count = 0;
+       int ret;
 
        DRM_DEBUG_KMS("%s\n", __FILE__);
 
@@ -114,27 +115,21 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
         * because lcd panel has only one mode.
         */
        if (display_ops->get_edid) {
-               int ret;
-               void *edid;
-
-               edid = kzalloc(MAX_EDID, GFP_KERNEL);
-               if (!edid) {
-                       DRM_ERROR("failed to allocate edid\n");
-                       return 0;
+               edid = display_ops->get_edid(manager->dev, connector);
+               if (IS_ERR_OR_NULL(edid)) {
+                       ret = PTR_ERR(edid);
+                       edid = NULL;
+                       DRM_ERROR("Panel operation get_edid failed %d\n", ret);
+                       goto out;
                }
 
-               ret = display_ops->get_edid(manager->dev, connector,
-                                               edid, MAX_EDID);
-               if (ret < 0) {
-                       DRM_ERROR("failed to get edid data.\n");
-                       kfree(edid);
-                       edid = NULL;
-                       return 0;
+               count = drm_add_edid_modes(connector, edid);
+               if (count < 0) {
+                       DRM_ERROR("Add edid modes failed %d\n", count);
+                       goto out;
                }
 
                drm_mode_connector_update_edid_property(connector, edid);
-               count = drm_add_edid_modes(connector, edid);
-               kfree(edid);
        } else {
                struct exynos_drm_panel_info *panel;
                struct drm_display_mode *mode = drm_mode_create(connector->dev);
@@ -161,6 +156,8 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
                count = 1;
        }
 
+out:
+       kfree(edid);
        return count;
 }
 
index 9df97714b6c0b8a2244fa1f61da5eb4a76c774dd..ba0a3aa785474f27ca0ba23b181e71d7d5bf82a9 100644 (file)
@@ -19,6 +19,7 @@
 struct exynos_drm_dmabuf_attachment {
        struct sg_table sgt;
        enum dma_data_direction dir;
+       bool is_mapped;
 };
 
 static int exynos_gem_attach_dma_buf(struct dma_buf *dmabuf,
@@ -72,17 +73,10 @@ static struct sg_table *
 
        DRM_DEBUG_PRIME("%s\n", __FILE__);
 
-       if (WARN_ON(dir == DMA_NONE))
-               return ERR_PTR(-EINVAL);
-
        /* just return current sgt if already requested. */
-       if (exynos_attach->dir == dir)
+       if (exynos_attach->dir == dir && exynos_attach->is_mapped)
                return &exynos_attach->sgt;
 
-       /* reattaching is not allowed. */
-       if (WARN_ON(exynos_attach->dir != DMA_NONE))
-               return ERR_PTR(-EBUSY);
-
        buf = gem_obj->buffer;
        if (!buf) {
                DRM_ERROR("buffer is null.\n");
@@ -107,13 +101,17 @@ static struct sg_table *
                wr = sg_next(wr);
        }
 
-       nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir);
-       if (!nents) {
-               DRM_ERROR("failed to map sgl with iommu.\n");
-               sgt = ERR_PTR(-EIO);
-               goto err_unlock;
+       if (dir != DMA_NONE) {
+               nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir);
+               if (!nents) {
+                       DRM_ERROR("failed to map sgl with iommu.\n");
+                       sg_free_table(sgt);
+                       sgt = ERR_PTR(-EIO);
+                       goto err_unlock;
+               }
        }
 
+       exynos_attach->is_mapped = true;
        exynos_attach->dir = dir;
        attach->priv = exynos_attach;
 
index b9e51bc09e81ad3ba81943e860ebb7a2580e0f2d..4606fac7241a0f2762dd0f10e8674efda02ac7d3 100644 (file)
@@ -148,8 +148,8 @@ struct exynos_drm_overlay {
 struct exynos_drm_display_ops {
        enum exynos_drm_output_type type;
        bool (*is_connected)(struct device *dev);
-       int (*get_edid)(struct device *dev, struct drm_connector *connector,
-                               u8 *edid, int len);
+       struct edid *(*get_edid)(struct device *dev,
+                       struct drm_connector *connector);
        void *(*get_panel)(struct device *dev);
        int (*check_timing)(struct device *dev, void *timing);
        int (*power_on)(struct device *dev, int mode);
index 36c3905536a65e824766ec61a385bb44a5f6c3f9..9a4c08e7453c35b2566c2c76b3bc7fa4406d7696 100644 (file)
@@ -324,7 +324,7 @@ out:
        g2d_userptr = NULL;
 }
 
-dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev,
+static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev,
                                        unsigned long userptr,
                                        unsigned long size,
                                        struct drm_file *filp,
index 850e9950b7da06c44d7fddaed4afdee812ce88ac..28644539b3056620912df744aaac7cccad6fa9a4 100644 (file)
@@ -108,18 +108,17 @@ static bool drm_hdmi_is_connected(struct device *dev)
        return false;
 }
 
-static int drm_hdmi_get_edid(struct device *dev,
-               struct drm_connector *connector, u8 *edid, int len)
+static struct edid *drm_hdmi_get_edid(struct device *dev,
+                       struct drm_connector *connector)
 {
        struct drm_hdmi_context *ctx = to_context(dev);
 
        DRM_DEBUG_KMS("%s\n", __FILE__);
 
        if (hdmi_ops && hdmi_ops->get_edid)
-               return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector, edid,
-                                         len);
+               return hdmi_ops->get_edid(ctx->hdmi_ctx->ctx, connector);
 
-       return 0;
+       return NULL;
 }
 
 static int drm_hdmi_check_timing(struct device *dev, void *timing)
index 784a7e9a766c4a178e2f73e628e63adce5f6c364..d80516fc9ed7efd4675dd582ba3601118a4ffbad 100644 (file)
@@ -30,8 +30,8 @@ struct exynos_drm_hdmi_context {
 struct exynos_hdmi_ops {
        /* display */
        bool (*is_connected)(void *ctx);
-       int (*get_edid)(void *ctx, struct drm_connector *connector,
-                       u8 *edid, int len);
+       struct edid *(*get_edid)(void *ctx,
+                       struct drm_connector *connector);
        int (*check_timing)(void *ctx, void *timing);
        int (*power_on)(void *ctx, int mode);
 
index 0bda96454a02fe6e8cf31ced93c37249355a5f99..1a556354e92fa15ee5b051600662a9f0d98a868b 100644 (file)
@@ -869,7 +869,7 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node,
        }
 }
 
-void ipp_handle_cmd_work(struct device *dev,
+static void ipp_handle_cmd_work(struct device *dev,
                struct exynos_drm_ippdrv *ippdrv,
                struct drm_exynos_ipp_cmd_work *cmd_work,
                struct drm_exynos_ipp_cmd_node *c_node)
index e9e83ef688f0c3a4ccf0253154975eebddb1d378..f976e29def6effa8adc973e92b28ba9f9add4443 100644 (file)
@@ -734,7 +734,7 @@ static int rotator_remove(struct platform_device *pdev)
        return 0;
 }
 
-struct rot_limit_table rot_limit_tbl = {
+static struct rot_limit_table rot_limit_tbl = {
        .ycbcr420_2p = {
                .min_w = 32,
                .min_h = 32,
@@ -751,7 +751,7 @@ struct rot_limit_table rot_limit_tbl = {
        },
 };
 
-struct platform_device_id rotator_driver_ids[] = {
+static struct platform_device_id rotator_driver_ids[] = {
        {
                .name           = "exynos-rot",
                .driver_data    = (unsigned long)&rot_limit_tbl,
index d0ca3c4e06c60bbeca05e87b783d1e7e4b690f16..13ccbd4bcfaa8c863f27d24870101c32166ecb47 100644 (file)
@@ -98,10 +98,12 @@ static bool vidi_display_is_connected(struct device *dev)
        return ctx->connected ? true : false;
 }
 
-static int vidi_get_edid(struct device *dev, struct drm_connector *connector,
-                               u8 *edid, int len)
+static struct edid *vidi_get_edid(struct device *dev,
+                       struct drm_connector *connector)
 {
        struct vidi_context *ctx = get_vidi_context(dev);
+       struct edid *edid;
+       int edid_len;
 
        DRM_DEBUG_KMS("%s\n", __FILE__);
 
@@ -111,13 +113,18 @@ static int vidi_get_edid(struct device *dev, struct drm_connector *connector,
         */
        if (!ctx->raw_edid) {
                DRM_DEBUG_KMS("raw_edid is null.\n");
-               return -EFAULT;
+               return ERR_PTR(-EFAULT);
        }
 
-       memcpy(edid, ctx->raw_edid, min((1 + ctx->raw_edid->extensions)
-                                       * EDID_LENGTH, len));
+       edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH;
+       edid = kzalloc(edid_len, GFP_KERNEL);
+       if (!edid) {
+               DRM_DEBUG_KMS("failed to allocate edid\n");
+               return ERR_PTR(-ENOMEM);
+       }
 
-       return 0;
+       memcpy(edid, ctx->raw_edid, edid_len);
+       return edid;
 }
 
 static void *vidi_get_panel(struct device *dev)
@@ -514,7 +521,6 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
        struct exynos_drm_manager *manager;
        struct exynos_drm_display_ops *display_ops;
        struct drm_exynos_vidi_connection *vidi = data;
-       struct edid *raw_edid;
        int edid_len;
 
        DRM_DEBUG_KMS("%s\n", __FILE__);
@@ -551,11 +557,11 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
        }
 
        if (vidi->connection) {
-               if (!vidi->edid) {
-                       DRM_DEBUG_KMS("edid data is null.\n");
+               struct edid *raw_edid  = (struct edid *)(uint32_t)vidi->edid;
+               if (!drm_edid_is_valid(raw_edid)) {
+                       DRM_DEBUG_KMS("edid data is invalid.\n");
                        return -EINVAL;
                }
-               raw_edid = (struct edid *)(uint32_t)vidi->edid;
                edid_len = (1 + raw_edid->extensions) * EDID_LENGTH;
                ctx->raw_edid = kzalloc(edid_len, GFP_KERNEL);
                if (!ctx->raw_edid) {
index 41ff79d8ac8ec27db3f4b5cd3edadb0d86dde241..fbab3c4686031ce9c07a1b19546ab73ddb4f92e7 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/regulator/consumer.h>
 #include <linux/io.h>
 #include <linux/of_gpio.h>
-#include <plat/gpio-cfg.h>
 
 #include <drm/exynos_drm.h>
 
@@ -98,8 +97,7 @@ struct hdmi_context {
 
        void __iomem                    *regs;
        void                            *parent_ctx;
-       int                             external_irq;
-       int                             internal_irq;
+       int                             irq;
 
        struct i2c_client               *ddc_port;
        struct i2c_client               *hdmiphy_port;
@@ -1391,8 +1389,7 @@ static bool hdmi_is_connected(void *ctx)
        return hdata->hpd;
 }
 
-static int hdmi_get_edid(void *ctx, struct drm_connector *connector,
-                               u8 *edid, int len)
+static struct edid *hdmi_get_edid(void *ctx, struct drm_connector *connector)
 {
        struct edid *raw_edid;
        struct hdmi_context *hdata = ctx;
@@ -1400,22 +1397,18 @@ static int hdmi_get_edid(void *ctx, struct drm_connector *connector,
        DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
        if (!hdata->ddc_port)
-               return -ENODEV;
+               return ERR_PTR(-ENODEV);
 
        raw_edid = drm_get_edid(connector, hdata->ddc_port->adapter);
-       if (raw_edid) {
-               hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid);
-               memcpy(edid, raw_edid, min((1 + raw_edid->extensions)
-                                       * EDID_LENGTH, len));
-               DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n",
-                       (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"),
-                       raw_edid->width_cm, raw_edid->height_cm);
-               kfree(raw_edid);
-       } else {
-               return -ENODEV;
-       }
+       if (!raw_edid)
+               return ERR_PTR(-ENODEV);
 
-       return 0;
+       hdata->dvi_mode = !drm_detect_hdmi_monitor(raw_edid);
+       DRM_DEBUG_KMS("%s : width[%d] x height[%d]\n",
+               (hdata->dvi_mode ? "dvi monitor" : "hdmi monitor"),
+               raw_edid->width_cm, raw_edid->height_cm);
+
+       return raw_edid;
 }
 
 static int hdmi_v13_check_timing(struct fb_videomode *check_timing)
@@ -1652,16 +1645,16 @@ static void hdmi_conf_reset(struct hdmi_context *hdata)
 
        /* resetting HDMI core */
        hdmi_reg_writemask(hdata, reg,  0, HDMI_CORE_SW_RSTOUT);
-       mdelay(10);
+       usleep_range(10000, 12000);
        hdmi_reg_writemask(hdata, reg, ~0, HDMI_CORE_SW_RSTOUT);
-       mdelay(10);
+       usleep_range(10000, 12000);
 }
 
 static void hdmi_conf_init(struct hdmi_context *hdata)
 {
        struct hdmi_infoframe infoframe;
 
-       /* disable HPD interrupts */
+       /* disable HPD interrupts from HDMI IP block, use GPIO instead */
        hdmi_reg_writemask(hdata, HDMI_INTC_CON, 0, HDMI_INTC_EN_GLOBAL |
                HDMI_INTC_EN_HPD_PLUG | HDMI_INTC_EN_HPD_UNPLUG);
 
@@ -1779,7 +1772,7 @@ static void hdmi_v13_timing_apply(struct hdmi_context *hdata)
                u32 val = hdmi_reg_read(hdata, HDMI_V13_PHY_STATUS);
                if (val & HDMI_PHY_STATUS_READY)
                        break;
-               mdelay(1);
+               usleep_range(1000, 2000);
        }
        /* steady state not achieved */
        if (tries == 0) {
@@ -1946,7 +1939,7 @@ static void hdmi_v14_timing_apply(struct hdmi_context *hdata)
                u32 val = hdmi_reg_read(hdata, HDMI_PHY_STATUS_0);
                if (val & HDMI_PHY_STATUS_READY)
                        break;
-               mdelay(1);
+               usleep_range(1000, 2000);
        }
        /* steady state not achieved */
        if (tries == 0) {
@@ -1998,9 +1991,9 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata)
 
        /* reset hdmiphy */
        hdmi_reg_writemask(hdata, reg, ~0, HDMI_PHY_SW_RSTOUT);
-       mdelay(10);
+       usleep_range(10000, 12000);
        hdmi_reg_writemask(hdata, reg,  0, HDMI_PHY_SW_RSTOUT);
-       mdelay(10);
+       usleep_range(10000, 12000);
 }
 
 static void hdmiphy_poweron(struct hdmi_context *hdata)
@@ -2048,7 +2041,7 @@ static void hdmiphy_conf_apply(struct hdmi_context *hdata)
                return;
        }
 
-       mdelay(10);
+       usleep_range(10000, 12000);
 
        /* operation mode */
        operation[0] = 0x1f;
@@ -2170,6 +2163,13 @@ static void hdmi_commit(void *ctx)
 
        DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
+       mutex_lock(&hdata->hdmi_mutex);
+       if (!hdata->powered) {
+               mutex_unlock(&hdata->hdmi_mutex);
+               return;
+       }
+       mutex_unlock(&hdata->hdmi_mutex);
+
        hdmi_conf_apply(hdata);
 }
 
@@ -2265,7 +2265,7 @@ static struct exynos_hdmi_ops hdmi_ops = {
        .dpms           = hdmi_dpms,
 };
 
-static irqreturn_t hdmi_external_irq_thread(int irq, void *arg)
+static irqreturn_t hdmi_irq_thread(int irq, void *arg)
 {
        struct exynos_drm_hdmi_context *ctx = arg;
        struct hdmi_context *hdata = ctx->ctx;
@@ -2280,31 +2280,6 @@ static irqreturn_t hdmi_external_irq_thread(int irq, void *arg)
        return IRQ_HANDLED;
 }
 
-static irqreturn_t hdmi_internal_irq_thread(int irq, void *arg)
-{
-       struct exynos_drm_hdmi_context *ctx = arg;
-       struct hdmi_context *hdata = ctx->ctx;
-       u32 intc_flag;
-
-       intc_flag = hdmi_reg_read(hdata, HDMI_INTC_FLAG);
-       /* clearing flags for HPD plug/unplug */
-       if (intc_flag & HDMI_INTC_FLAG_HPD_UNPLUG) {
-               DRM_DEBUG_KMS("unplugged\n");
-               hdmi_reg_writemask(hdata, HDMI_INTC_FLAG, ~0,
-                       HDMI_INTC_FLAG_HPD_UNPLUG);
-       }
-       if (intc_flag & HDMI_INTC_FLAG_HPD_PLUG) {
-               DRM_DEBUG_KMS("plugged\n");
-               hdmi_reg_writemask(hdata, HDMI_INTC_FLAG, ~0,
-                       HDMI_INTC_FLAG_HPD_PLUG);
-       }
-
-       if (ctx->drm_dev)
-               drm_helper_hpd_irq_event(ctx->drm_dev);
-
-       return IRQ_HANDLED;
-}
-
 static int hdmi_resources_init(struct hdmi_context *hdata)
 {
        struct device *dev = hdata->dev;
@@ -2555,39 +2530,24 @@ static int hdmi_probe(struct platform_device *pdev)
 
        hdata->hdmiphy_port = hdmi_hdmiphy;
 
-       hdata->external_irq = gpio_to_irq(hdata->hpd_gpio);
-       if (hdata->external_irq < 0) {
-               DRM_ERROR("failed to get GPIO external irq\n");
-               ret = hdata->external_irq;
-               goto err_hdmiphy;
-       }
-
-       hdata->internal_irq = platform_get_irq(pdev, 0);
-       if (hdata->internal_irq < 0) {
-               DRM_ERROR("failed to get platform internal irq\n");
-               ret = hdata->internal_irq;
+       hdata->irq = gpio_to_irq(hdata->hpd_gpio);
+       if (hdata->irq < 0) {
+               DRM_ERROR("failed to get GPIO irq\n");
+               ret = hdata->irq;
                goto err_hdmiphy;
        }
 
        hdata->hpd = gpio_get_value(hdata->hpd_gpio);
 
-       ret = request_threaded_irq(hdata->external_irq, NULL,
-                       hdmi_external_irq_thread, IRQF_TRIGGER_RISING |
+       ret = request_threaded_irq(hdata->irq, NULL,
+                       hdmi_irq_thread, IRQF_TRIGGER_RISING |
                        IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
-                       "hdmi_external", drm_hdmi_ctx);
+                       "hdmi", drm_hdmi_ctx);
        if (ret) {
-               DRM_ERROR("failed to register hdmi external interrupt\n");
+               DRM_ERROR("failed to register hdmi interrupt\n");
                goto err_hdmiphy;
        }
 
-       ret = request_threaded_irq(hdata->internal_irq, NULL,
-                       hdmi_internal_irq_thread, IRQF_ONESHOT,
-                       "hdmi_internal", drm_hdmi_ctx);
-       if (ret) {
-               DRM_ERROR("failed to register hdmi internal interrupt\n");
-               goto err_free_irq;
-       }
-
        /* Attach HDMI Driver to common hdmi. */
        exynos_hdmi_drv_attach(drm_hdmi_ctx);
 
@@ -2598,8 +2558,6 @@ static int hdmi_probe(struct platform_device *pdev)
 
        return 0;
 
-err_free_irq:
-       free_irq(hdata->external_irq, drm_hdmi_ctx);
 err_hdmiphy:
        i2c_del_driver(&hdmiphy_driver);
 err_ddc:
@@ -2617,8 +2575,7 @@ static int hdmi_remove(struct platform_device *pdev)
 
        pm_runtime_disable(dev);
 
-       free_irq(hdata->internal_irq, hdata);
-       free_irq(hdata->external_irq, hdata);
+       free_irq(hdata->irq, hdata);
 
 
        /* hdmiphy i2c driver */
@@ -2637,8 +2594,7 @@ static int hdmi_suspend(struct device *dev)
 
        DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
-       disable_irq(hdata->internal_irq);
-       disable_irq(hdata->external_irq);
+       disable_irq(hdata->irq);
 
        hdata->hpd = false;
        if (ctx->drm_dev)
@@ -2663,8 +2619,7 @@ static int hdmi_resume(struct device *dev)
 
        hdata->hpd = gpio_get_value(hdata->hpd_gpio);
 
-       enable_irq(hdata->external_irq);
-       enable_irq(hdata->internal_irq);
+       enable_irq(hdata->irq);
 
        if (!pm_runtime_suspended(dev)) {
                DRM_DEBUG_KMS("%s : Already resumed\n", __func__);
index c187ea33b748c031b91d10e45479d98368b297f6..c414584bfbaecf36d285be933e9e212fbea7784d 100644 (file)
@@ -600,7 +600,7 @@ static void vp_win_reset(struct mixer_context *ctx)
                /* waiting until VP_SRESET_PROCESSING is 0 */
                if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
                        break;
-               mdelay(10);
+               usleep_range(10000, 12000);
        }
        WARN(tries == 0, "failed to reset Video Processor\n");
 }
@@ -776,6 +776,13 @@ static void mixer_win_commit(void *ctx, int win)
 
        DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
 
+       mutex_lock(&mixer_ctx->mixer_mutex);
+       if (!mixer_ctx->powered) {
+               mutex_unlock(&mixer_ctx->mixer_mutex);
+               return;
+       }
+       mutex_unlock(&mixer_ctx->mixer_mutex);
+
        if (win > 1 && mixer_ctx->vp_enabled)
                vp_video_buffer(mixer_ctx, win);
        else
index 7944d301518ac80f2ef1b72e1b5e29b5213bc33f..9d4a2c2adf0e0883d76d13070fa09f7aa32e1526 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/debugfs.h>
 #include <linux/slab.h>
 #include <linux/export.h>
+#include <generated/utsrelease.h>
 #include <drm/drmP.h>
 #include "intel_drv.h"
 #include "intel_ringbuffer.h"
@@ -690,6 +691,7 @@ static int i915_error_state(struct seq_file *m, void *unused)
 
        seq_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec,
                   error->time.tv_usec);
+       seq_printf(m, "Kernel: " UTS_RELEASE);
        seq_printf(m, "PCI ID: 0x%04x\n", dev->pci_device);
        seq_printf(m, "EIR: 0x%08x\n", error->eir);
        seq_printf(m, "IER: 0x%08x\n", error->ier);
index b401788e1791f2057cee7d17a1e3c1024adfa99a..59afb7eb6db635cf2f9bbe5477ffc8bd75fddd30 100644 (file)
 #define MI_MODE                0x0209c
 # define VS_TIMER_DISPATCH                             (1 << 6)
 # define MI_FLUSH_ENABLE                               (1 << 12)
+# define ASYNC_FLIP_PERF_DISABLE                       (1 << 14)
 
 #define GEN6_GT_MODE   0x20d0
 #define   GEN6_GT_MODE_HI                              (1 << 9)
index ae253e04c39105502fa1b82e05889970139f123f..42ff97d667d2b84ad339b27ab1f59110ba5831e8 100644 (file)
@@ -505,13 +505,25 @@ static int init_render_ring(struct intel_ring_buffer *ring)
        struct drm_i915_private *dev_priv = dev->dev_private;
        int ret = init_ring_common(ring);
 
-       if (INTEL_INFO(dev)->gen > 3) {
+       if (INTEL_INFO(dev)->gen > 3)
                I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(VS_TIMER_DISPATCH));
-               if (IS_GEN7(dev))
-                       I915_WRITE(GFX_MODE_GEN7,
-                                  _MASKED_BIT_DISABLE(GFX_TLB_INVALIDATE_ALWAYS) |
-                                  _MASKED_BIT_ENABLE(GFX_REPLAY_MODE));
-       }
+
+       /* We need to disable the AsyncFlip performance optimisations in order
+        * to use MI_WAIT_FOR_EVENT within the CS. It should already be
+        * programmed to '1' on all products.
+        */
+       if (INTEL_INFO(dev)->gen >= 6)
+               I915_WRITE(MI_MODE, _MASKED_BIT_ENABLE(ASYNC_FLIP_PERF_DISABLE));
+
+       /* Required for the hardware to program scanline values for waiting */
+       if (INTEL_INFO(dev)->gen == 6)
+               I915_WRITE(GFX_MODE,
+                          _MASKED_BIT_ENABLE(GFX_TLB_INVALIDATE_ALWAYS));
+
+       if (IS_GEN7(dev))
+               I915_WRITE(GFX_MODE_GEN7,
+                          _MASKED_BIT_DISABLE(GFX_TLB_INVALIDATE_ALWAYS) |
+                          _MASKED_BIT_ENABLE(GFX_REPLAY_MODE));
 
        if (INTEL_INFO(dev)->gen >= 5) {
                ret = init_pipe_control(ring);
index 59acabb45c9b94a0798e75ded14c8d12d221a795..835992d8d067bf199bdf2ec633e634133ed16a4a 100644 (file)
@@ -1216,7 +1216,7 @@ void cayman_dma_stop(struct radeon_device *rdev)
 int cayman_dma_resume(struct radeon_device *rdev)
 {
        struct radeon_ring *ring;
-       u32 rb_cntl, dma_cntl;
+       u32 rb_cntl, dma_cntl, ib_cntl;
        u32 rb_bufsz;
        u32 reg_offset, wb_offset;
        int i, r;
@@ -1265,7 +1265,11 @@ int cayman_dma_resume(struct radeon_device *rdev)
                WREG32(DMA_RB_BASE + reg_offset, ring->gpu_addr >> 8);
 
                /* enable DMA IBs */
-               WREG32(DMA_IB_CNTL + reg_offset, DMA_IB_ENABLE | CMD_VMID_FORCE);
+               ib_cntl = DMA_IB_ENABLE | CMD_VMID_FORCE;
+#ifdef __BIG_ENDIAN
+               ib_cntl |= DMA_IB_SWAP_ENABLE;
+#endif
+               WREG32(DMA_IB_CNTL + reg_offset, ib_cntl);
 
                dma_cntl = RREG32(DMA_CNTL + reg_offset);
                dma_cntl &= ~CTXEMPTY_INT_ENABLE;
index 3cb9d6089373250165af9b33ad7f53aa762d8c3f..bc2540b17c5effb5f065a715218f1c9be472898d 100644 (file)
@@ -2313,7 +2313,7 @@ void r600_dma_stop(struct radeon_device *rdev)
 int r600_dma_resume(struct radeon_device *rdev)
 {
        struct radeon_ring *ring = &rdev->ring[R600_RING_TYPE_DMA_INDEX];
-       u32 rb_cntl, dma_cntl;
+       u32 rb_cntl, dma_cntl, ib_cntl;
        u32 rb_bufsz;
        int r;
 
@@ -2353,7 +2353,11 @@ int r600_dma_resume(struct radeon_device *rdev)
        WREG32(DMA_RB_BASE, ring->gpu_addr >> 8);
 
        /* enable DMA IBs */
-       WREG32(DMA_IB_CNTL, DMA_IB_ENABLE);
+       ib_cntl = DMA_IB_ENABLE;
+#ifdef __BIG_ENDIAN
+       ib_cntl |= DMA_IB_SWAP_ENABLE;
+#endif
+       WREG32(DMA_IB_CNTL, ib_cntl);
 
        dma_cntl = RREG32(DMA_CNTL);
        dma_cntl &= ~CTXEMPTY_INT_ENABLE;
index 469661fd190331f53230a6d1a524bbaebb040012..5407459e56d2b5dd9619e698c2ec306c56104f4a 100644 (file)
@@ -286,6 +286,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
                            p->chunks[p->chunk_ib_idx].kpage[1] == NULL) {
                                kfree(p->chunks[p->chunk_ib_idx].kpage[0]);
                                kfree(p->chunks[p->chunk_ib_idx].kpage[1]);
+                               p->chunks[p->chunk_ib_idx].kpage[0] = NULL;
+                               p->chunks[p->chunk_ib_idx].kpage[1] = NULL;
                                return -ENOMEM;
                        }
                }
index ad6df625e8b8a1cf869ac06bb898503022406a6b..0d67674b64b13e9a4618548fb1ca3d2d2211f797 100644 (file)
@@ -241,7 +241,8 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
                y = 0;
        }
 
-       if (ASIC_IS_AVIVO(rdev)) {
+       /* fixed on DCE6 and newer */
+       if (ASIC_IS_AVIVO(rdev) && !ASIC_IS_DCE6(rdev)) {
                int i = 0;
                struct drm_crtc *crtc_p;
 
index edfc54e41842248f4dad035c1ece973ca08837b5..0d6562bb0c93e61e7b57e4fd09f31a802ba34d99 100644 (file)
@@ -429,7 +429,8 @@ bool radeon_card_posted(struct radeon_device *rdev)
 {
        uint32_t reg;
 
-       if (efi_enabled && rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE)
+       if (efi_enabled(EFI_BOOT) &&
+           rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE)
                return false;
 
        /* first check CRTCs */
index 1da2386d7cf74a9eac82674a53ac2cee3e8e52a5..ff3def7846197bc9f69b929f9fe745d01759f537 100644 (file)
@@ -1122,7 +1122,7 @@ radeon_user_framebuffer_create(struct drm_device *dev,
        if (ret) {
                kfree(radeon_fb);
                drm_gem_object_unreference_unlocked(obj);
-               return NULL;
+               return ERR_PTR(ret);
        }
 
        return &radeon_fb->base;
index 4dfa605e2d14417203e734c4a68dc2447e86f5c2..34e25471aeaaaa547f1e4ea1a1879426d7350444 100644 (file)
 #define USB_VENDOR_ID_EZKEY            0x0518
 #define USB_DEVICE_ID_BTC_8193         0x0002
 
+#define USB_VENDOR_ID_FORMOSA          0x147a
+#define USB_DEVICE_ID_FORMOSA_IR_RECEIVER      0xe03e
+
 #define USB_VENDOR_ID_FREESCALE                0x15A2
 #define USB_DEVICE_ID_FREESCALE_MX28   0x004F
 
index 12e4fdc810bf22c0c3334cb1939b6de1e73ee2d3..e766b5614ef59fcae45aaeff49a98df9de3e9693 100644 (file)
@@ -540,13 +540,24 @@ static int i2c_hid_output_raw_report(struct hid_device *hid, __u8 *buf,
 {
        struct i2c_client *client = hid->driver_data;
        int report_id = buf[0];
+       int ret;
 
        if (report_type == HID_INPUT_REPORT)
                return -EINVAL;
 
-       return i2c_hid_set_report(client,
+       if (report_id) {
+               buf++;
+               count--;
+       }
+
+       ret = i2c_hid_set_report(client,
                                report_type == HID_FEATURE_REPORT ? 0x03 : 0x02,
                                report_id, buf, count);
+
+       if (report_id && ret >= 0)
+               ret++; /* add report_id to the number of transfered bytes */
+
+       return ret;
 }
 
 static int i2c_hid_parse(struct hid_device *hid)
index ac9e35228254f0e6a942845520bb542752ca0921..e0e6abf1cd3bd9b3cfa3d7cc73a2247c84c31be4 100644 (file)
@@ -70,6 +70,7 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
+       { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS },
        { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS },
index 81837b0710a9ba0240b1eba3c1b3f8b51d997e2f..faf10ba1ed9ad1dcfcd00dabc26c725cf7e9ad00 100644 (file)
@@ -974,6 +974,38 @@ static void __init free_iommu_all(void)
        }
 }
 
+/*
+ * Family15h Model 10h-1fh erratum 746 (IOMMU Logging May Stall Translations)
+ * Workaround:
+ *     BIOS should disable L2B micellaneous clock gating by setting
+ *     L2_L2B_CK_GATE_CONTROL[CKGateL2BMiscDisable](D0F2xF4_x90[2]) = 1b
+ */
+static void __init amd_iommu_erratum_746_workaround(struct amd_iommu *iommu)
+{
+       u32 value;
+
+       if ((boot_cpu_data.x86 != 0x15) ||
+           (boot_cpu_data.x86_model < 0x10) ||
+           (boot_cpu_data.x86_model > 0x1f))
+               return;
+
+       pci_write_config_dword(iommu->dev, 0xf0, 0x90);
+       pci_read_config_dword(iommu->dev, 0xf4, &value);
+
+       if (value & BIT(2))
+               return;
+
+       /* Select NB indirect register 0x90 and enable writing */
+       pci_write_config_dword(iommu->dev, 0xf0, 0x90 | (1 << 8));
+
+       pci_write_config_dword(iommu->dev, 0xf4, value | 0x4);
+       pr_info("AMD-Vi: Applying erratum 746 workaround for IOMMU at %s\n",
+               dev_name(&iommu->dev->dev));
+
+       /* Clear the enable writing bit */
+       pci_write_config_dword(iommu->dev, 0xf0, 0x90);
+}
+
 /*
  * This function clues the initialization function for one IOMMU
  * together and also allocates the command buffer and programs the
@@ -1172,6 +1204,8 @@ static int iommu_init_pci(struct amd_iommu *iommu)
                        iommu->stored_l2[i] = iommu_read_l2(iommu, i);
        }
 
+       amd_iommu_erratum_746_workaround(iommu);
+
        return pci_enable_device(iommu->dev);
 }
 
index b9d091157884570f636492be2e49e2e346697664..eca28014ef3e4a9d509d9d5472fc73da707806ef 100644 (file)
@@ -4234,6 +4234,21 @@ static struct iommu_ops intel_iommu_ops = {
        .pgsize_bitmap  = INTEL_IOMMU_PGSIZES,
 };
 
+static void quirk_iommu_g4x_gfx(struct pci_dev *dev)
+{
+       /* G4x/GM45 integrated gfx dmar support is totally busted. */
+       printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n");
+       dmar_map_gfx = 0;
+}
+
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e00, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e10, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e20, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e40, quirk_iommu_g4x_gfx);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e90, quirk_iommu_g4x_gfx);
+
 static void quirk_iommu_rwbf(struct pci_dev *dev)
 {
        /*
@@ -4242,12 +4257,6 @@ static void quirk_iommu_rwbf(struct pci_dev *dev)
         */
        printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n");
        rwbf_quirk = 1;
-
-       /* https://bugzilla.redhat.com/show_bug.cgi?id=538163 */
-       if (dev->revision == 0x07) {
-               printk(KERN_INFO "DMAR: Disabling IOMMU for graphics on this chipset\n");
-               dmar_map_gfx = 0;
-       }
 }
 
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);
index 62ca575701d34752d1cdd7c9c0ff699d9e8c6749..a350969e5efe4254c65b7ed7841609bebb1b0102 100644 (file)
@@ -1,3 +1,30 @@
+config IRQCHIP
+       def_bool y
+       depends on OF_IRQ
+
+config ARM_GIC
+       bool
+       select IRQ_DOMAIN
+       select MULTI_IRQ_HANDLER
+
+config GIC_NON_BANKED
+       bool
+
+config ARM_VIC
+       bool
+       select IRQ_DOMAIN
+       select MULTI_IRQ_HANDLER
+
+config ARM_VIC_NR
+       int
+       default 4 if ARCH_S5PV210
+       default 3 if ARCH_S5PC100
+       default 2
+       depends on ARM_VIC
+       help
+         The maximum number of VICs available in the system, for
+         power management.
+
 config VERSATILE_FPGA_IRQ
        bool
        select IRQ_DOMAIN
index bf4609a5bd9d527c582f839127f5bad899f04cea..0fb8655743904c93eab9d623151530bbb10b023d 100644 (file)
@@ -1,4 +1,8 @@
+obj-$(CONFIG_IRQCHIP)                  += irqchip.o
+
 obj-$(CONFIG_ARCH_BCM2835)             += irq-bcm2835.o
 obj-$(CONFIG_ARCH_SUNXI)               += irq-sunxi.o
-obj-$(CONFIG_VERSATILE_FPGA_IRQ)       += irq-versatile-fpga.o
 obj-$(CONFIG_ARCH_SPEAR3XX)            += spear-shirq.o
+obj-$(CONFIG_ARM_GIC)                  += irq-gic.o
+obj-$(CONFIG_ARM_VIC)                  += irq-vic.o
+obj-$(CONFIG_VERSATILE_FPGA_IRQ)       += irq-versatile-fpga.o
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
new file mode 100644 (file)
index 0000000..69d9a39
--- /dev/null
@@ -0,0 +1,824 @@
+/*
+ *  linux/arch/arm/common/gic.c
+ *
+ *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Interrupt architecture for the GIC:
+ *
+ * o There is one Interrupt Distributor, which receives interrupts
+ *   from system devices and sends them to the Interrupt Controllers.
+ *
+ * o There is one CPU Interface per CPU, which sends interrupts sent
+ *   by the Distributor, and interrupts generated locally, to the
+ *   associated CPU. The base address of the CPU interface is usually
+ *   aliased so that the same address points to different chips depending
+ *   on the CPU it is accessed from.
+ *
+ * Note that IRQs 0-31 are special - they are local to each CPU.
+ * As such, the enable set/clear, pending set/clear and active bit
+ * registers are banked per-cpu for these sources.
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/list.h>
+#include <linux/smp.h>
+#include <linux/cpu_pm.h>
+#include <linux/cpumask.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/irqdomain.h>
+#include <linux/interrupt.h>
+#include <linux/percpu.h>
+#include <linux/slab.h>
+#include <linux/irqchip/arm-gic.h>
+
+#include <asm/irq.h>
+#include <asm/exception.h>
+#include <asm/smp_plat.h>
+#include <asm/mach/irq.h>
+
+#include "irqchip.h"
+
+union gic_base {
+       void __iomem *common_base;
+       void __percpu __iomem **percpu_base;
+};
+
+struct gic_chip_data {
+       union gic_base dist_base;
+       union gic_base cpu_base;
+#ifdef CONFIG_CPU_PM
+       u32 saved_spi_enable[DIV_ROUND_UP(1020, 32)];
+       u32 saved_spi_conf[DIV_ROUND_UP(1020, 16)];
+       u32 saved_spi_target[DIV_ROUND_UP(1020, 4)];
+       u32 __percpu *saved_ppi_enable;
+       u32 __percpu *saved_ppi_conf;
+#endif
+       struct irq_domain *domain;
+       unsigned int gic_irqs;
+#ifdef CONFIG_GIC_NON_BANKED
+       void __iomem *(*get_base)(union gic_base *);
+#endif
+};
+
+static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+
+/*
+ * The GIC mapping of CPU interfaces does not necessarily match
+ * the logical CPU numbering.  Let's use a mapping as returned
+ * by the GIC itself.
+ */
+#define NR_GIC_CPU_IF 8
+static u8 gic_cpu_map[NR_GIC_CPU_IF] __read_mostly;
+
+/*
+ * Supported arch specific GIC irq extension.
+ * Default make them NULL.
+ */
+struct irq_chip gic_arch_extn = {
+       .irq_eoi        = NULL,
+       .irq_mask       = NULL,
+       .irq_unmask     = NULL,
+       .irq_retrigger  = NULL,
+       .irq_set_type   = NULL,
+       .irq_set_wake   = NULL,
+};
+
+#ifndef MAX_GIC_NR
+#define MAX_GIC_NR     1
+#endif
+
+static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly;
+
+#ifdef CONFIG_GIC_NON_BANKED
+static void __iomem *gic_get_percpu_base(union gic_base *base)
+{
+       return *__this_cpu_ptr(base->percpu_base);
+}
+
+static void __iomem *gic_get_common_base(union gic_base *base)
+{
+       return base->common_base;
+}
+
+static inline void __iomem *gic_data_dist_base(struct gic_chip_data *data)
+{
+       return data->get_base(&data->dist_base);
+}
+
+static inline void __iomem *gic_data_cpu_base(struct gic_chip_data *data)
+{
+       return data->get_base(&data->cpu_base);
+}
+
+static inline void gic_set_base_accessor(struct gic_chip_data *data,
+                                        void __iomem *(*f)(union gic_base *))
+{
+       data->get_base = f;
+}
+#else
+#define gic_data_dist_base(d)  ((d)->dist_base.common_base)
+#define gic_data_cpu_base(d)   ((d)->cpu_base.common_base)
+#define gic_set_base_accessor(d,f)
+#endif
+
+static inline void __iomem *gic_dist_base(struct irq_data *d)
+{
+       struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
+       return gic_data_dist_base(gic_data);
+}
+
+static inline void __iomem *gic_cpu_base(struct irq_data *d)
+{
+       struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d);
+       return gic_data_cpu_base(gic_data);
+}
+
+static inline unsigned int gic_irq(struct irq_data *d)
+{
+       return d->hwirq;
+}
+
+/*
+ * Routines to acknowledge, disable and enable interrupts
+ */
+static void gic_mask_irq(struct irq_data *d)
+{
+       u32 mask = 1 << (gic_irq(d) % 32);
+
+       raw_spin_lock(&irq_controller_lock);
+       writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
+       if (gic_arch_extn.irq_mask)
+               gic_arch_extn.irq_mask(d);
+       raw_spin_unlock(&irq_controller_lock);
+}
+
+static void gic_unmask_irq(struct irq_data *d)
+{
+       u32 mask = 1 << (gic_irq(d) % 32);
+
+       raw_spin_lock(&irq_controller_lock);
+       if (gic_arch_extn.irq_unmask)
+               gic_arch_extn.irq_unmask(d);
+       writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4);
+       raw_spin_unlock(&irq_controller_lock);
+}
+
+static void gic_eoi_irq(struct irq_data *d)
+{
+       if (gic_arch_extn.irq_eoi) {
+               raw_spin_lock(&irq_controller_lock);
+               gic_arch_extn.irq_eoi(d);
+               raw_spin_unlock(&irq_controller_lock);
+       }
+
+       writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
+}
+
+static int gic_set_type(struct irq_data *d, unsigned int type)
+{
+       void __iomem *base = gic_dist_base(d);
+       unsigned int gicirq = gic_irq(d);
+       u32 enablemask = 1 << (gicirq % 32);
+       u32 enableoff = (gicirq / 32) * 4;
+       u32 confmask = 0x2 << ((gicirq % 16) * 2);
+       u32 confoff = (gicirq / 16) * 4;
+       bool enabled = false;
+       u32 val;
+
+       /* Interrupt configuration for SGIs can't be changed */
+       if (gicirq < 16)
+               return -EINVAL;
+
+       if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
+               return -EINVAL;
+
+       raw_spin_lock(&irq_controller_lock);
+
+       if (gic_arch_extn.irq_set_type)
+               gic_arch_extn.irq_set_type(d, type);
+
+       val = readl_relaxed(base + GIC_DIST_CONFIG + confoff);
+       if (type == IRQ_TYPE_LEVEL_HIGH)
+               val &= ~confmask;
+       else if (type == IRQ_TYPE_EDGE_RISING)
+               val |= confmask;
+
+       /*
+        * As recommended by the spec, disable the interrupt before changing
+        * the configuration
+        */
+       if (readl_relaxed(base + GIC_DIST_ENABLE_SET + enableoff) & enablemask) {
+               writel_relaxed(enablemask, base + GIC_DIST_ENABLE_CLEAR + enableoff);
+               enabled = true;
+       }
+
+       writel_relaxed(val, base + GIC_DIST_CONFIG + confoff);
+
+       if (enabled)
+               writel_relaxed(enablemask, base + GIC_DIST_ENABLE_SET + enableoff);
+
+       raw_spin_unlock(&irq_controller_lock);
+
+       return 0;
+}
+
+static int gic_retrigger(struct irq_data *d)
+{
+       if (gic_arch_extn.irq_retrigger)
+               return gic_arch_extn.irq_retrigger(d);
+
+       return -ENXIO;
+}
+
+#ifdef CONFIG_SMP
+static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
+                           bool force)
+{
+       void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
+       unsigned int shift = (gic_irq(d) % 4) * 8;
+       unsigned int cpu = cpumask_any_and(mask_val, cpu_online_mask);
+       u32 val, mask, bit;
+
+       if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
+               return -EINVAL;
+
+       mask = 0xff << shift;
+       bit = gic_cpu_map[cpu] << shift;
+
+       raw_spin_lock(&irq_controller_lock);
+       val = readl_relaxed(reg) & ~mask;
+       writel_relaxed(val | bit, reg);
+       raw_spin_unlock(&irq_controller_lock);
+
+       return IRQ_SET_MASK_OK;
+}
+#endif
+
+#ifdef CONFIG_PM
+static int gic_set_wake(struct irq_data *d, unsigned int on)
+{
+       int ret = -ENXIO;
+
+       if (gic_arch_extn.irq_set_wake)
+               ret = gic_arch_extn.irq_set_wake(d, on);
+
+       return ret;
+}
+
+#else
+#define gic_set_wake   NULL
+#endif
+
+static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
+{
+       u32 irqstat, irqnr;
+       struct gic_chip_data *gic = &gic_data[0];
+       void __iomem *cpu_base = gic_data_cpu_base(gic);
+
+       do {
+               irqstat = readl_relaxed(cpu_base + GIC_CPU_INTACK);
+               irqnr = irqstat & ~0x1c00;
+
+               if (likely(irqnr > 15 && irqnr < 1021)) {
+                       irqnr = irq_find_mapping(gic->domain, irqnr);
+                       handle_IRQ(irqnr, regs);
+                       continue;
+               }
+               if (irqnr < 16) {
+                       writel_relaxed(irqstat, cpu_base + GIC_CPU_EOI);
+#ifdef CONFIG_SMP
+                       handle_IPI(irqnr, regs);
+#endif
+                       continue;
+               }
+               break;
+       } while (1);
+}
+
+static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
+{
+       struct gic_chip_data *chip_data = irq_get_handler_data(irq);
+       struct irq_chip *chip = irq_get_chip(irq);
+       unsigned int cascade_irq, gic_irq;
+       unsigned long status;
+
+       chained_irq_enter(chip, desc);
+
+       raw_spin_lock(&irq_controller_lock);
+       status = readl_relaxed(gic_data_cpu_base(chip_data) + GIC_CPU_INTACK);
+       raw_spin_unlock(&irq_controller_lock);
+
+       gic_irq = (status & 0x3ff);
+       if (gic_irq == 1023)
+               goto out;
+
+       cascade_irq = irq_find_mapping(chip_data->domain, gic_irq);
+       if (unlikely(gic_irq < 32 || gic_irq > 1020))
+               do_bad_IRQ(cascade_irq, desc);
+       else
+               generic_handle_irq(cascade_irq);
+
+ out:
+       chained_irq_exit(chip, desc);
+}
+
+static struct irq_chip gic_chip = {
+       .name                   = "GIC",
+       .irq_mask               = gic_mask_irq,
+       .irq_unmask             = gic_unmask_irq,
+       .irq_eoi                = gic_eoi_irq,
+       .irq_set_type           = gic_set_type,
+       .irq_retrigger          = gic_retrigger,
+#ifdef CONFIG_SMP
+       .irq_set_affinity       = gic_set_affinity,
+#endif
+       .irq_set_wake           = gic_set_wake,
+};
+
+void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
+{
+       if (gic_nr >= MAX_GIC_NR)
+               BUG();
+       if (irq_set_handler_data(irq, &gic_data[gic_nr]) != 0)
+               BUG();
+       irq_set_chained_handler(irq, gic_handle_cascade_irq);
+}
+
+static void __init gic_dist_init(struct gic_chip_data *gic)
+{
+       unsigned int i;
+       u32 cpumask;
+       unsigned int gic_irqs = gic->gic_irqs;
+       void __iomem *base = gic_data_dist_base(gic);
+
+       writel_relaxed(0, base + GIC_DIST_CTRL);
+
+       /*
+        * Set all global interrupts to be level triggered, active low.
+        */
+       for (i = 32; i < gic_irqs; i += 16)
+               writel_relaxed(0, base + GIC_DIST_CONFIG + i * 4 / 16);
+
+       /*
+        * Set all global interrupts to this CPU only.
+        */
+       cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0);
+       for (i = 32; i < gic_irqs; i += 4)
+               writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
+
+       /*
+        * Set priority on all global interrupts.
+        */
+       for (i = 32; i < gic_irqs; i += 4)
+               writel_relaxed(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4);
+
+       /*
+        * Disable all interrupts.  Leave the PPI and SGIs alone
+        * as these enables are banked registers.
+        */
+       for (i = 32; i < gic_irqs; i += 32)
+               writel_relaxed(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32);
+
+       writel_relaxed(1, base + GIC_DIST_CTRL);
+}
+
+static void __cpuinit gic_cpu_init(struct gic_chip_data *gic)
+{
+       void __iomem *dist_base = gic_data_dist_base(gic);
+       void __iomem *base = gic_data_cpu_base(gic);
+       unsigned int cpu_mask, cpu = smp_processor_id();
+       int i;
+
+       /*
+        * Get what the GIC says our CPU mask is.
+        */
+       BUG_ON(cpu >= NR_GIC_CPU_IF);
+       cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0);
+       gic_cpu_map[cpu] = cpu_mask;
+
+       /*
+        * Clear our mask from the other map entries in case they're
+        * still undefined.
+        */
+       for (i = 0; i < NR_GIC_CPU_IF; i++)
+               if (i != cpu)
+                       gic_cpu_map[i] &= ~cpu_mask;
+
+       /*
+        * Deal with the banked PPI and SGI interrupts - disable all
+        * PPI interrupts, ensure all SGI interrupts are enabled.
+        */
+       writel_relaxed(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR);
+       writel_relaxed(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET);
+
+       /*
+        * Set priority on PPI and SGI interrupts
+        */
+       for (i = 0; i < 32; i += 4)
+               writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4);
+
+       writel_relaxed(0xf0, base + GIC_CPU_PRIMASK);
+       writel_relaxed(1, base + GIC_CPU_CTRL);
+}
+
+#ifdef CONFIG_CPU_PM
+/*
+ * Saves the GIC distributor registers during suspend or idle.  Must be called
+ * with interrupts disabled but before powering down the GIC.  After calling
+ * this function, no interrupts will be delivered by the GIC, and another
+ * platform-specific wakeup source must be enabled.
+ */
+static void gic_dist_save(unsigned int gic_nr)
+{
+       unsigned int gic_irqs;
+       void __iomem *dist_base;
+       int i;
+
+       if (gic_nr >= MAX_GIC_NR)
+               BUG();
+
+       gic_irqs = gic_data[gic_nr].gic_irqs;
+       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
+
+       if (!dist_base)
+               return;
+
+       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
+               gic_data[gic_nr].saved_spi_conf[i] =
+                       readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
+
+       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
+               gic_data[gic_nr].saved_spi_target[i] =
+                       readl_relaxed(dist_base + GIC_DIST_TARGET + i * 4);
+
+       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
+               gic_data[gic_nr].saved_spi_enable[i] =
+                       readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
+}
+
+/*
+ * Restores the GIC distributor registers during resume or when coming out of
+ * idle.  Must be called before enabling interrupts.  If a level interrupt
+ * that occured while the GIC was suspended is still present, it will be
+ * handled normally, but any edge interrupts that occured will not be seen by
+ * the GIC and need to be handled by the platform-specific wakeup source.
+ */
+static void gic_dist_restore(unsigned int gic_nr)
+{
+       unsigned int gic_irqs;
+       unsigned int i;
+       void __iomem *dist_base;
+
+       if (gic_nr >= MAX_GIC_NR)
+               BUG();
+
+       gic_irqs = gic_data[gic_nr].gic_irqs;
+       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
+
+       if (!dist_base)
+               return;
+
+       writel_relaxed(0, dist_base + GIC_DIST_CTRL);
+
+       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 16); i++)
+               writel_relaxed(gic_data[gic_nr].saved_spi_conf[i],
+                       dist_base + GIC_DIST_CONFIG + i * 4);
+
+       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
+               writel_relaxed(0xa0a0a0a0,
+                       dist_base + GIC_DIST_PRI + i * 4);
+
+       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 4); i++)
+               writel_relaxed(gic_data[gic_nr].saved_spi_target[i],
+                       dist_base + GIC_DIST_TARGET + i * 4);
+
+       for (i = 0; i < DIV_ROUND_UP(gic_irqs, 32); i++)
+               writel_relaxed(gic_data[gic_nr].saved_spi_enable[i],
+                       dist_base + GIC_DIST_ENABLE_SET + i * 4);
+
+       writel_relaxed(1, dist_base + GIC_DIST_CTRL);
+}
+
+static void gic_cpu_save(unsigned int gic_nr)
+{
+       int i;
+       u32 *ptr;
+       void __iomem *dist_base;
+       void __iomem *cpu_base;
+
+       if (gic_nr >= MAX_GIC_NR)
+               BUG();
+
+       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
+       cpu_base = gic_data_cpu_base(&gic_data[gic_nr]);
+
+       if (!dist_base || !cpu_base)
+               return;
+
+       ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
+       for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
+               ptr[i] = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
+
+       ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
+       for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
+               ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);
+
+}
+
+static void gic_cpu_restore(unsigned int gic_nr)
+{
+       int i;
+       u32 *ptr;
+       void __iomem *dist_base;
+       void __iomem *cpu_base;
+
+       if (gic_nr >= MAX_GIC_NR)
+               BUG();
+
+       dist_base = gic_data_dist_base(&gic_data[gic_nr]);
+       cpu_base = gic_data_cpu_base(&gic_data[gic_nr]);
+
+       if (!dist_base || !cpu_base)
+               return;
+
+       ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
+       for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
+               writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4);
+
+       ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
+       for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
+               writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4);
+
+       for (i = 0; i < DIV_ROUND_UP(32, 4); i++)
+               writel_relaxed(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4);
+
+       writel_relaxed(0xf0, cpu_base + GIC_CPU_PRIMASK);
+       writel_relaxed(1, cpu_base + GIC_CPU_CTRL);
+}
+
+static int gic_notifier(struct notifier_block *self, unsigned long cmd,        void *v)
+{
+       int i;
+
+       for (i = 0; i < MAX_GIC_NR; i++) {
+#ifdef CONFIG_GIC_NON_BANKED
+               /* Skip over unused GICs */
+               if (!gic_data[i].get_base)
+                       continue;
+#endif
+               switch (cmd) {
+               case CPU_PM_ENTER:
+                       gic_cpu_save(i);
+                       break;
+               case CPU_PM_ENTER_FAILED:
+               case CPU_PM_EXIT:
+                       gic_cpu_restore(i);
+                       break;
+               case CPU_CLUSTER_PM_ENTER:
+                       gic_dist_save(i);
+                       break;
+               case CPU_CLUSTER_PM_ENTER_FAILED:
+               case CPU_CLUSTER_PM_EXIT:
+                       gic_dist_restore(i);
+                       break;
+               }
+       }
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block gic_notifier_block = {
+       .notifier_call = gic_notifier,
+};
+
+static void __init gic_pm_init(struct gic_chip_data *gic)
+{
+       gic->saved_ppi_enable = __alloc_percpu(DIV_ROUND_UP(32, 32) * 4,
+               sizeof(u32));
+       BUG_ON(!gic->saved_ppi_enable);
+
+       gic->saved_ppi_conf = __alloc_percpu(DIV_ROUND_UP(32, 16) * 4,
+               sizeof(u32));
+       BUG_ON(!gic->saved_ppi_conf);
+
+       if (gic == &gic_data[0])
+               cpu_pm_register_notifier(&gic_notifier_block);
+}
+#else
+static void __init gic_pm_init(struct gic_chip_data *gic)
+{
+}
+#endif
+
+#ifdef CONFIG_SMP
+void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
+{
+       int cpu;
+       unsigned long map = 0;
+
+       /* Convert our logical CPU mask into a physical one. */
+       for_each_cpu(cpu, mask)
+               map |= 1 << cpu_logical_map(cpu);
+
+       /*
+        * Ensure that stores to Normal memory are visible to the
+        * other CPUs before issuing the IPI.
+        */
+       dsb();
+
+       /* this always happens on GIC0 */
+       writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
+}
+#endif
+
+static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
+                               irq_hw_number_t hw)
+{
+       if (hw < 32) {
+               irq_set_percpu_devid(irq);
+               irq_set_chip_and_handler(irq, &gic_chip,
+                                        handle_percpu_devid_irq);
+               set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
+       } else {
+               irq_set_chip_and_handler(irq, &gic_chip,
+                                        handle_fasteoi_irq);
+               set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       }
+       irq_set_chip_data(irq, d->host_data);
+       return 0;
+}
+
+static int gic_irq_domain_xlate(struct irq_domain *d,
+                               struct device_node *controller,
+                               const u32 *intspec, unsigned int intsize,
+                               unsigned long *out_hwirq, unsigned int *out_type)
+{
+       if (d->of_node != controller)
+               return -EINVAL;
+       if (intsize < 3)
+               return -EINVAL;
+
+       /* Get the interrupt number and add 16 to skip over SGIs */
+       *out_hwirq = intspec[1] + 16;
+
+       /* For SPIs, we need to add 16 more to get the GIC irq ID number */
+       if (!intspec[0])
+               *out_hwirq += 16;
+
+       *out_type = intspec[2] & IRQ_TYPE_SENSE_MASK;
+       return 0;
+}
+
+const struct irq_domain_ops gic_irq_domain_ops = {
+       .map = gic_irq_domain_map,
+       .xlate = gic_irq_domain_xlate,
+};
+
+void __init gic_init_bases(unsigned int gic_nr, int irq_start,
+                          void __iomem *dist_base, void __iomem *cpu_base,
+                          u32 percpu_offset, struct device_node *node)
+{
+       irq_hw_number_t hwirq_base;
+       struct gic_chip_data *gic;
+       int gic_irqs, irq_base, i;
+
+       BUG_ON(gic_nr >= MAX_GIC_NR);
+
+       gic = &gic_data[gic_nr];
+#ifdef CONFIG_GIC_NON_BANKED
+       if (percpu_offset) { /* Frankein-GIC without banked registers... */
+               unsigned int cpu;
+
+               gic->dist_base.percpu_base = alloc_percpu(void __iomem *);
+               gic->cpu_base.percpu_base = alloc_percpu(void __iomem *);
+               if (WARN_ON(!gic->dist_base.percpu_base ||
+                           !gic->cpu_base.percpu_base)) {
+                       free_percpu(gic->dist_base.percpu_base);
+                       free_percpu(gic->cpu_base.percpu_base);
+                       return;
+               }
+
+               for_each_possible_cpu(cpu) {
+                       unsigned long offset = percpu_offset * cpu_logical_map(cpu);
+                       *per_cpu_ptr(gic->dist_base.percpu_base, cpu) = dist_base + offset;
+                       *per_cpu_ptr(gic->cpu_base.percpu_base, cpu) = cpu_base + offset;
+               }
+
+               gic_set_base_accessor(gic, gic_get_percpu_base);
+       } else
+#endif
+       {                       /* Normal, sane GIC... */
+               WARN(percpu_offset,
+                    "GIC_NON_BANKED not enabled, ignoring %08x offset!",
+                    percpu_offset);
+               gic->dist_base.common_base = dist_base;
+               gic->cpu_base.common_base = cpu_base;
+               gic_set_base_accessor(gic, gic_get_common_base);
+       }
+
+       /*
+        * Initialize the CPU interface map to all CPUs.
+        * It will be refined as each CPU probes its ID.
+        */
+       for (i = 0; i < NR_GIC_CPU_IF; i++)
+               gic_cpu_map[i] = 0xff;
+
+       /*
+        * For primary GICs, skip over SGIs.
+        * For secondary GICs, skip over PPIs, too.
+        */
+       if (gic_nr == 0 && (irq_start & 31) > 0) {
+               hwirq_base = 16;
+               if (irq_start != -1)
+                       irq_start = (irq_start & ~31) + 16;
+       } else {
+               hwirq_base = 32;
+       }
+
+       /*
+        * Find out how many interrupts are supported.
+        * The GIC only supports up to 1020 interrupt sources.
+        */
+       gic_irqs = readl_relaxed(gic_data_dist_base(gic) + GIC_DIST_CTR) & 0x1f;
+       gic_irqs = (gic_irqs + 1) * 32;
+       if (gic_irqs > 1020)
+               gic_irqs = 1020;
+       gic->gic_irqs = gic_irqs;
+
+       gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */
+       irq_base = irq_alloc_descs(irq_start, 16, gic_irqs, numa_node_id());
+       if (IS_ERR_VALUE(irq_base)) {
+               WARN(1, "Cannot allocate irq_descs @ IRQ%d, assuming pre-allocated\n",
+                    irq_start);
+               irq_base = irq_start;
+       }
+       gic->domain = irq_domain_add_legacy(node, gic_irqs, irq_base,
+                                   hwirq_base, &gic_irq_domain_ops, gic);
+       if (WARN_ON(!gic->domain))
+               return;
+
+#ifdef CONFIG_SMP
+       set_smp_cross_call(gic_raise_softirq);
+#endif
+
+       set_handle_irq(gic_handle_irq);
+
+       gic_chip.flags |= gic_arch_extn.flags;
+       gic_dist_init(gic);
+       gic_cpu_init(gic);
+       gic_pm_init(gic);
+}
+
+void __cpuinit gic_secondary_init(unsigned int gic_nr)
+{
+       BUG_ON(gic_nr >= MAX_GIC_NR);
+
+       gic_cpu_init(&gic_data[gic_nr]);
+}
+
+#ifdef CONFIG_OF
+static int gic_cnt __initdata = 0;
+
+int __init gic_of_init(struct device_node *node, struct device_node *parent)
+{
+       void __iomem *cpu_base;
+       void __iomem *dist_base;
+       u32 percpu_offset;
+       int irq;
+
+       if (WARN_ON(!node))
+               return -ENODEV;
+
+       dist_base = of_iomap(node, 0);
+       WARN(!dist_base, "unable to map gic dist registers\n");
+
+       cpu_base = of_iomap(node, 1);
+       WARN(!cpu_base, "unable to map gic cpu registers\n");
+
+       if (of_property_read_u32(node, "cpu-offset", &percpu_offset))
+               percpu_offset = 0;
+
+       gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset, node);
+
+       if (parent) {
+               irq = irq_of_parse_and_map(node, 0);
+               gic_cascade_irq(gic_cnt, irq);
+       }
+       gic_cnt++;
+       return 0;
+}
+IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init);
+IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init);
+IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init);
+IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
+
+#endif
diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c
new file mode 100644 (file)
index 0000000..3cf97aa
--- /dev/null
@@ -0,0 +1,489 @@
+/*
+ *  linux/arch/arm/common/vic.c
+ *
+ *  Copyright (C) 1999 - 2003 ARM Limited
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/export.h>
+#include <linux/init.h>
+#include <linux/list.h>
+#include <linux/io.h>
+#include <linux/irqdomain.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/syscore_ops.h>
+#include <linux/device.h>
+#include <linux/amba/bus.h>
+#include <linux/irqchip/arm-vic.h>
+
+#include <asm/exception.h>
+#include <asm/mach/irq.h>
+
+#include "irqchip.h"
+
+#define VIC_IRQ_STATUS                 0x00
+#define VIC_FIQ_STATUS                 0x04
+#define VIC_INT_SELECT                 0x0c    /* 1 = FIQ, 0 = IRQ */
+#define VIC_INT_SOFT                   0x18
+#define VIC_INT_SOFT_CLEAR             0x1c
+#define VIC_PROTECT                    0x20
+#define VIC_PL190_VECT_ADDR            0x30    /* PL190 only */
+#define VIC_PL190_DEF_VECT_ADDR                0x34    /* PL190 only */
+
+#define VIC_VECT_ADDR0                 0x100   /* 0 to 15 (0..31 PL192) */
+#define VIC_VECT_CNTL0                 0x200   /* 0 to 15 (0..31 PL192) */
+#define VIC_ITCR                       0x300   /* VIC test control register */
+
+#define VIC_VECT_CNTL_ENABLE           (1 << 5)
+
+#define VIC_PL192_VECT_ADDR            0xF00
+
+/**
+ * struct vic_device - VIC PM device
+ * @irq: The IRQ number for the base of the VIC.
+ * @base: The register base for the VIC.
+ * @valid_sources: A bitmask of valid interrupts
+ * @resume_sources: A bitmask of interrupts for resume.
+ * @resume_irqs: The IRQs enabled for resume.
+ * @int_select: Save for VIC_INT_SELECT.
+ * @int_enable: Save for VIC_INT_ENABLE.
+ * @soft_int: Save for VIC_INT_SOFT.
+ * @protect: Save for VIC_PROTECT.
+ * @domain: The IRQ domain for the VIC.
+ */
+struct vic_device {
+       void __iomem    *base;
+       int             irq;
+       u32             valid_sources;
+       u32             resume_sources;
+       u32             resume_irqs;
+       u32             int_select;
+       u32             int_enable;
+       u32             soft_int;
+       u32             protect;
+       struct irq_domain *domain;
+};
+
+/* we cannot allocate memory when VICs are initially registered */
+static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
+
+static int vic_id;
+
+static void vic_handle_irq(struct pt_regs *regs);
+
+/**
+ * vic_init2 - common initialisation code
+ * @base: Base of the VIC.
+ *
+ * Common initialisation code for registration
+ * and resume.
+*/
+static void vic_init2(void __iomem *base)
+{
+       int i;
+
+       for (i = 0; i < 16; i++) {
+               void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
+               writel(VIC_VECT_CNTL_ENABLE | i, reg);
+       }
+
+       writel(32, base + VIC_PL190_DEF_VECT_ADDR);
+}
+
+#ifdef CONFIG_PM
+static void resume_one_vic(struct vic_device *vic)
+{
+       void __iomem *base = vic->base;
+
+       printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base);
+
+       /* re-initialise static settings */
+       vic_init2(base);
+
+       writel(vic->int_select, base + VIC_INT_SELECT);
+       writel(vic->protect, base + VIC_PROTECT);
+
+       /* set the enabled ints and then clear the non-enabled */
+       writel(vic->int_enable, base + VIC_INT_ENABLE);
+       writel(~vic->int_enable, base + VIC_INT_ENABLE_CLEAR);
+
+       /* and the same for the soft-int register */
+
+       writel(vic->soft_int, base + VIC_INT_SOFT);
+       writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR);
+}
+
+static void vic_resume(void)
+{
+       int id;
+
+       for (id = vic_id - 1; id >= 0; id--)
+               resume_one_vic(vic_devices + id);
+}
+
+static void suspend_one_vic(struct vic_device *vic)
+{
+       void __iomem *base = vic->base;
+
+       printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base);
+
+       vic->int_select = readl(base + VIC_INT_SELECT);
+       vic->int_enable = readl(base + VIC_INT_ENABLE);
+       vic->soft_int = readl(base + VIC_INT_SOFT);
+       vic->protect = readl(base + VIC_PROTECT);
+
+       /* set the interrupts (if any) that are used for
+        * resuming the system */
+
+       writel(vic->resume_irqs, base + VIC_INT_ENABLE);
+       writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR);
+}
+
+static int vic_suspend(void)
+{
+       int id;
+
+       for (id = 0; id < vic_id; id++)
+               suspend_one_vic(vic_devices + id);
+
+       return 0;
+}
+
+struct syscore_ops vic_syscore_ops = {
+       .suspend        = vic_suspend,
+       .resume         = vic_resume,
+};
+
+/**
+ * vic_pm_init - initicall to register VIC pm
+ *
+ * This is called via late_initcall() to register
+ * the resources for the VICs due to the early
+ * nature of the VIC's registration.
+*/
+static int __init vic_pm_init(void)
+{
+       if (vic_id > 0)
+               register_syscore_ops(&vic_syscore_ops);
+
+       return 0;
+}
+late_initcall(vic_pm_init);
+#endif /* CONFIG_PM */
+
+static struct irq_chip vic_chip;
+
+static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
+                            irq_hw_number_t hwirq)
+{
+       struct vic_device *v = d->host_data;
+
+       /* Skip invalid IRQs, only register handlers for the real ones */
+       if (!(v->valid_sources & (1 << hwirq)))
+               return -ENOTSUPP;
+       irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
+       irq_set_chip_data(irq, v->base);
+       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+       return 0;
+}
+
+/*
+ * Handle each interrupt in a single VIC.  Returns non-zero if we've
+ * handled at least one interrupt.  This reads the status register
+ * before handling each interrupt, which is necessary given that
+ * handle_IRQ may briefly re-enable interrupts for soft IRQ handling.
+ */
+static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
+{
+       u32 stat, irq;
+       int handled = 0;
+
+       while ((stat = readl_relaxed(vic->base + VIC_IRQ_STATUS))) {
+               irq = ffs(stat) - 1;
+               handle_IRQ(irq_find_mapping(vic->domain, irq), regs);
+               handled = 1;
+       }
+
+       return handled;
+}
+
+/*
+ * Keep iterating over all registered VIC's until there are no pending
+ * interrupts.
+ */
+static asmlinkage void __exception_irq_entry vic_handle_irq(struct pt_regs *regs)
+{
+       int i, handled;
+
+       do {
+               for (i = 0, handled = 0; i < vic_id; ++i)
+                       handled |= handle_one_vic(&vic_devices[i], regs);
+       } while (handled);
+}
+
+static struct irq_domain_ops vic_irqdomain_ops = {
+       .map = vic_irqdomain_map,
+       .xlate = irq_domain_xlate_onetwocell,
+};
+
+/**
+ * vic_register() - Register a VIC.
+ * @base: The base address of the VIC.
+ * @irq: The base IRQ for the VIC.
+ * @valid_sources: bitmask of valid interrupts
+ * @resume_sources: bitmask of interrupts allowed for resume sources.
+ * @node: The device tree node associated with the VIC.
+ *
+ * Register the VIC with the system device tree so that it can be notified
+ * of suspend and resume requests and ensure that the correct actions are
+ * taken to re-instate the settings on resume.
+ *
+ * This also configures the IRQ domain for the VIC.
+ */
+static void __init vic_register(void __iomem *base, unsigned int irq,
+                               u32 valid_sources, u32 resume_sources,
+                               struct device_node *node)
+{
+       struct vic_device *v;
+       int i;
+
+       if (vic_id >= ARRAY_SIZE(vic_devices)) {
+               printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__);
+               return;
+       }
+
+       v = &vic_devices[vic_id];
+       v->base = base;
+       v->valid_sources = valid_sources;
+       v->resume_sources = resume_sources;
+       v->irq = irq;
+       set_handle_irq(vic_handle_irq);
+       vic_id++;
+       v->domain = irq_domain_add_simple(node, fls(valid_sources), irq,
+                                         &vic_irqdomain_ops, v);
+       /* create an IRQ mapping for each valid IRQ */
+       for (i = 0; i < fls(valid_sources); i++)
+               if (valid_sources & (1 << i))
+                       irq_create_mapping(v->domain, i);
+}
+
+static void vic_ack_irq(struct irq_data *d)
+{
+       void __iomem *base = irq_data_get_irq_chip_data(d);
+       unsigned int irq = d->hwirq;
+       writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
+       /* moreover, clear the soft-triggered, in case it was the reason */
+       writel(1 << irq, base + VIC_INT_SOFT_CLEAR);
+}
+
+static void vic_mask_irq(struct irq_data *d)
+{
+       void __iomem *base = irq_data_get_irq_chip_data(d);
+       unsigned int irq = d->hwirq;
+       writel(1 << irq, base + VIC_INT_ENABLE_CLEAR);
+}
+
+static void vic_unmask_irq(struct irq_data *d)
+{
+       void __iomem *base = irq_data_get_irq_chip_data(d);
+       unsigned int irq = d->hwirq;
+       writel(1 << irq, base + VIC_INT_ENABLE);
+}
+
+#if defined(CONFIG_PM)
+static struct vic_device *vic_from_irq(unsigned int irq)
+{
+        struct vic_device *v = vic_devices;
+       unsigned int base_irq = irq & ~31;
+       int id;
+
+       for (id = 0; id < vic_id; id++, v++) {
+               if (v->irq == base_irq)
+                       return v;
+       }
+
+       return NULL;
+}
+
+static int vic_set_wake(struct irq_data *d, unsigned int on)
+{
+       struct vic_device *v = vic_from_irq(d->irq);
+       unsigned int off = d->hwirq;
+       u32 bit = 1 << off;
+
+       if (!v)
+               return -EINVAL;
+
+       if (!(bit & v->resume_sources))
+               return -EINVAL;
+
+       if (on)
+               v->resume_irqs |= bit;
+       else
+               v->resume_irqs &= ~bit;
+
+       return 0;
+}
+#else
+#define vic_set_wake NULL
+#endif /* CONFIG_PM */
+
+static struct irq_chip vic_chip = {
+       .name           = "VIC",
+       .irq_ack        = vic_ack_irq,
+       .irq_mask       = vic_mask_irq,
+       .irq_unmask     = vic_unmask_irq,
+       .irq_set_wake   = vic_set_wake,
+};
+
+static void __init vic_disable(void __iomem *base)
+{
+       writel(0, base + VIC_INT_SELECT);
+       writel(0, base + VIC_INT_ENABLE);
+       writel(~0, base + VIC_INT_ENABLE_CLEAR);
+       writel(0, base + VIC_ITCR);
+       writel(~0, base + VIC_INT_SOFT_CLEAR);
+}
+
+static void __init vic_clear_interrupts(void __iomem *base)
+{
+       unsigned int i;
+
+       writel(0, base + VIC_PL190_VECT_ADDR);
+       for (i = 0; i < 19; i++) {
+               unsigned int value;
+
+               value = readl(base + VIC_PL190_VECT_ADDR);
+               writel(value, base + VIC_PL190_VECT_ADDR);
+       }
+}
+
+/*
+ * The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
+ * The original cell has 32 interrupts, while the modified one has 64,
+ * replocating two blocks 0x00..0x1f in 0x20..0x3f. In that case
+ * the probe function is called twice, with base set to offset 000
+ *  and 020 within the page. We call this "second block".
+ */
+static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
+                              u32 vic_sources, struct device_node *node)
+{
+       unsigned int i;
+       int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;
+
+       /* Disable all interrupts initially. */
+       vic_disable(base);
+
+       /*
+        * Make sure we clear all existing interrupts. The vector registers
+        * in this cell are after the second block of general registers,
+        * so we can address them using standard offsets, but only from
+        * the second base address, which is 0x20 in the page
+        */
+       if (vic_2nd_block) {
+               vic_clear_interrupts(base);
+
+               /* ST has 16 vectors as well, but we don't enable them by now */
+               for (i = 0; i < 16; i++) {
+                       void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
+                       writel(0, reg);
+               }
+
+               writel(32, base + VIC_PL190_DEF_VECT_ADDR);
+       }
+
+       vic_register(base, irq_start, vic_sources, 0, node);
+}
+
+void __init __vic_init(void __iomem *base, int irq_start,
+                             u32 vic_sources, u32 resume_sources,
+                             struct device_node *node)
+{
+       unsigned int i;
+       u32 cellid = 0;
+       enum amba_vendor vendor;
+
+       /* Identify which VIC cell this one is, by reading the ID */
+       for (i = 0; i < 4; i++) {
+               void __iomem *addr;
+               addr = (void __iomem *)((u32)base & PAGE_MASK) + 0xfe0 + (i * 4);
+               cellid |= (readl(addr) & 0xff) << (8 * i);
+       }
+       vendor = (cellid >> 12) & 0xff;
+       printk(KERN_INFO "VIC @%p: id 0x%08x, vendor 0x%02x\n",
+              base, cellid, vendor);
+
+       switch(vendor) {
+       case AMBA_VENDOR_ST:
+               vic_init_st(base, irq_start, vic_sources, node);
+               return;
+       default:
+               printk(KERN_WARNING "VIC: unknown vendor, continuing anyways\n");
+               /* fall through */
+       case AMBA_VENDOR_ARM:
+               break;
+       }
+
+       /* Disable all interrupts initially. */
+       vic_disable(base);
+
+       /* Make sure we clear all existing interrupts */
+       vic_clear_interrupts(base);
+
+       vic_init2(base);
+
+       vic_register(base, irq_start, vic_sources, resume_sources, node);
+}
+
+/**
+ * vic_init() - initialise a vectored interrupt controller
+ * @base: iomem base address
+ * @irq_start: starting interrupt number, must be muliple of 32
+ * @vic_sources: bitmask of interrupt sources to allow
+ * @resume_sources: bitmask of interrupt sources to allow for resume
+ */
+void __init vic_init(void __iomem *base, unsigned int irq_start,
+                    u32 vic_sources, u32 resume_sources)
+{
+       __vic_init(base, irq_start, vic_sources, resume_sources, NULL);
+}
+
+#ifdef CONFIG_OF
+int __init vic_of_init(struct device_node *node, struct device_node *parent)
+{
+       void __iomem *regs;
+
+       if (WARN(parent, "non-root VICs are not supported"))
+               return -EINVAL;
+
+       regs = of_iomap(node, 0);
+       if (WARN_ON(!regs))
+               return -EIO;
+
+       /*
+        * Passing 0 as first IRQ makes the simple domain allocate descriptors
+        */
+       __vic_init(regs, 0, ~0, ~0, node);
+
+       return 0;
+}
+IRQCHIP_DECLARE(arm_pl190_vic, "arm,pl190-vic", vic_of_init);
+IRQCHIP_DECLARE(arm_pl192_vic, "arm,pl192-vic", vic_of_init);
+IRQCHIP_DECLARE(arm_versatile_vic, "arm,versatile-vic", vic_of_init);
+#endif /* CONFIG OF */
diff --git a/drivers/irqchip/irqchip.c b/drivers/irqchip/irqchip.c
new file mode 100644 (file)
index 0000000..f496afc
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2012 Thomas Petazzoni
+ *
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/init.h>
+#include <linux/of_irq.h>
+
+#include "irqchip.h"
+
+/*
+ * This special of_device_id is the sentinel at the end of the
+ * of_device_id[] array of all irqchips. It is automatically placed at
+ * the end of the array by the linker, thanks to being part of a
+ * special section.
+ */
+static const struct of_device_id
+irqchip_of_match_end __used __section(__irqchip_of_end);
+
+extern struct of_device_id __irqchip_begin[];
+
+void __init irqchip_init(void)
+{
+       of_irq_init(__irqchip_begin);
+}
diff --git a/drivers/irqchip/irqchip.h b/drivers/irqchip/irqchip.h
new file mode 100644 (file)
index 0000000..e445ba2
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2012 Thomas Petazzoni
+ *
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef _IRQCHIP_H
+#define _IRQCHIP_H
+
+/*
+ * This macro must be used by the different irqchip drivers to declare
+ * the association between their DT compatible string and their
+ * initialization function.
+ *
+ * @name: name that must be unique accross all IRQCHIP_DECLARE of the
+ * same file.
+ * @compstr: compatible string of the irqchip driver
+ * @fn: initialization function
+ */
+#define IRQCHIP_DECLARE(name,compstr,fn)                               \
+       static const struct of_device_id irqchip_of_match_##name        \
+       __used __section(__irqchip_of_table)                            \
+       = { .compatible = compstr, .data = fn }
+
+#endif
index 80e1d2fd9d4c383522c2cb96d3d4b3f7d2b89a42..8527743b5cef14ad608307f6ffe6e0341ffb9b28 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/of_irq.h>
 #include <linux/spinlock.h>
 
+#include "irqchip.h"
+
 static DEFINE_SPINLOCK(lock);
 
 /* spear300 shared irq registers offsets and masks */
@@ -300,6 +302,7 @@ int __init spear300_shirq_of_init(struct device_node *np,
        return shirq_init(spear300_shirq_blocks,
                        ARRAY_SIZE(spear300_shirq_blocks), np);
 }
+IRQCHIP_DECLARE(spear300_shirq, "st,spear300-shirq", spear300_shirq_of_init);
 
 int __init spear310_shirq_of_init(struct device_node *np,
                struct device_node *parent)
@@ -307,6 +310,7 @@ int __init spear310_shirq_of_init(struct device_node *np,
        return shirq_init(spear310_shirq_blocks,
                        ARRAY_SIZE(spear310_shirq_blocks), np);
 }
+IRQCHIP_DECLARE(spear310_shirq, "st,spear310-shirq", spear310_shirq_of_init);
 
 int __init spear320_shirq_of_init(struct device_node *np,
                struct device_node *parent)
@@ -314,3 +318,4 @@ int __init spear320_shirq_of_init(struct device_node *np,
        return shirq_init(spear320_shirq_blocks,
                        ARRAY_SIZE(spear320_shirq_blocks), np);
 }
+IRQCHIP_DECLARE(spear320_shirq, "st,spear320-shirq", spear320_shirq_of_init);
index 68452b768da23dc31c5409b113446802476886c2..03a0a01a405451c8a85e0e9b83647c105a710f53 100644 (file)
@@ -248,6 +248,8 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag,
                CAPIMSG_APPID(data), CAPIMSG_MSGID(data), l,
                CAPIMSG_CONTROL(data));
        l -= 12;
+       if (l <= 0)
+               return;
        dbgline = kmalloc(3 * l, GFP_ATOMIC);
        if (!dbgline)
                return;
index 3d8984edeff79b4dda6910670d95d34802411f6e..9e58dbd8d8cba839da9613e5f4e4060795cd0dc1 100644 (file)
@@ -340,24 +340,22 @@ static int validate_region_size(struct raid_set *rs, unsigned long region_size)
 }
 
 /*
- * validate_rebuild_devices
+ * validate_raid_redundancy
  * @rs
  *
- * Determine if the devices specified for rebuild can result in a valid
- * usable array that is capable of rebuilding the given devices.
+ * Determine if there are enough devices in the array that haven't
+ * failed (or are being rebuilt) to form a usable array.
  *
  * Returns: 0 on success, -EINVAL on failure.
  */
-static int validate_rebuild_devices(struct raid_set *rs)
+static int validate_raid_redundancy(struct raid_set *rs)
 {
        unsigned i, rebuild_cnt = 0;
        unsigned rebuilds_per_group, copies, d;
 
-       if (!(rs->print_flags & DMPF_REBUILD))
-               return 0;
-
        for (i = 0; i < rs->md.raid_disks; i++)
-               if (!test_bit(In_sync, &rs->dev[i].rdev.flags))
+               if (!test_bit(In_sync, &rs->dev[i].rdev.flags) ||
+                   !rs->dev[i].rdev.sb_page)
                        rebuild_cnt++;
 
        switch (rs->raid_type->level) {
@@ -393,27 +391,24 @@ static int validate_rebuild_devices(struct raid_set *rs)
                 *          A    A    B    B    C
                 *          C    D    D    E    E
                 */
-               rebuilds_per_group = 0;
                for (i = 0; i < rs->md.raid_disks * copies; i++) {
+                       if (!(i % copies))
+                               rebuilds_per_group = 0;
                        d = i % rs->md.raid_disks;
-                       if (!test_bit(In_sync, &rs->dev[d].rdev.flags) &&
+                       if ((!rs->dev[d].rdev.sb_page ||
+                            !test_bit(In_sync, &rs->dev[d].rdev.flags)) &&
                            (++rebuilds_per_group >= copies))
                                goto too_many;
-                       if (!((i + 1) % copies))
-                               rebuilds_per_group = 0;
                }
                break;
        default:
-               DMERR("The rebuild parameter is not supported for %s",
-                     rs->raid_type->name);
-               rs->ti->error = "Rebuild not supported for this RAID type";
-               return -EINVAL;
+               if (rebuild_cnt)
+                       return -EINVAL;
        }
 
        return 0;
 
 too_many:
-       rs->ti->error = "Too many rebuild devices specified";
        return -EINVAL;
 }
 
@@ -664,9 +659,6 @@ static int parse_raid_params(struct raid_set *rs, char **argv,
        }
        rs->md.dev_sectors = sectors_per_dev;
 
-       if (validate_rebuild_devices(rs))
-               return -EINVAL;
-
        /* Assume there are no metadata devices until the drives are parsed */
        rs->md.persistent = 0;
        rs->md.external = 1;
@@ -995,28 +987,10 @@ static int super_validate(struct mddev *mddev, struct md_rdev *rdev)
 static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
 {
        int ret;
-       unsigned redundancy = 0;
        struct raid_dev *dev;
        struct md_rdev *rdev, *tmp, *freshest;
        struct mddev *mddev = &rs->md;
 
-       switch (rs->raid_type->level) {
-       case 1:
-               redundancy = rs->md.raid_disks - 1;
-               break;
-       case 4:
-       case 5:
-       case 6:
-               redundancy = rs->raid_type->parity_devs;
-               break;
-       case 10:
-               redundancy = raid10_md_layout_to_copies(mddev->layout) - 1;
-               break;
-       default:
-               ti->error = "Unknown RAID type";
-               return -EINVAL;
-       }
-
        freshest = NULL;
        rdev_for_each_safe(rdev, tmp, mddev) {
                /*
@@ -1045,44 +1019,43 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
                        break;
                default:
                        dev = container_of(rdev, struct raid_dev, rdev);
-                       if (redundancy--) {
-                               if (dev->meta_dev)
-                                       dm_put_device(ti, dev->meta_dev);
-
-                               dev->meta_dev = NULL;
-                               rdev->meta_bdev = NULL;
+                       if (dev->meta_dev)
+                               dm_put_device(ti, dev->meta_dev);
 
-                               if (rdev->sb_page)
-                                       put_page(rdev->sb_page);
+                       dev->meta_dev = NULL;
+                       rdev->meta_bdev = NULL;
 
-                               rdev->sb_page = NULL;
+                       if (rdev->sb_page)
+                               put_page(rdev->sb_page);
 
-                               rdev->sb_loaded = 0;
+                       rdev->sb_page = NULL;
 
-                               /*
-                                * We might be able to salvage the data device
-                                * even though the meta device has failed.  For
-                                * now, we behave as though '- -' had been
-                                * set for this device in the table.
-                                */
-                               if (dev->data_dev)
-                                       dm_put_device(ti, dev->data_dev);
+                       rdev->sb_loaded = 0;
 
-                               dev->data_dev = NULL;
-                               rdev->bdev = NULL;
+                       /*
+                        * We might be able to salvage the data device
+                        * even though the meta device has failed.  For
+                        * now, we behave as though '- -' had been
+                        * set for this device in the table.
+                        */
+                       if (dev->data_dev)
+                               dm_put_device(ti, dev->data_dev);
 
-                               list_del(&rdev->same_set);
+                       dev->data_dev = NULL;
+                       rdev->bdev = NULL;
 
-                               continue;
-                       }
-                       ti->error = "Failed to load superblock";
-                       return ret;
+                       list_del(&rdev->same_set);
                }
        }
 
        if (!freshest)
                return 0;
 
+       if (validate_raid_redundancy(rs)) {
+               rs->ti->error = "Insufficient redundancy to activate array";
+               return -EINVAL;
+       }
+
        /*
         * Validation of the freshest device provides the source of
         * validation for the remaining devices.
@@ -1432,7 +1405,7 @@ static void raid_resume(struct dm_target *ti)
 
 static struct target_type raid_target = {
        .name = "raid",
-       .version = {1, 4, 0},
+       .version = {1, 4, 1},
        .module = THIS_MODULE,
        .ctr = raid_ctr,
        .dtr = raid_dtr,
index 675ae5274016da37484b2c05bfefccad8e158543..5409607d487533593d29c2207d857896121364a3 100644 (file)
@@ -2746,19 +2746,9 @@ static int thin_iterate_devices(struct dm_target *ti,
        return 0;
 }
 
-/*
- * A thin device always inherits its queue limits from its pool.
- */
-static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits)
-{
-       struct thin_c *tc = ti->private;
-
-       *limits = bdev_get_queue(tc->pool_dev->bdev)->limits;
-}
-
 static struct target_type thin_target = {
        .name = "thin",
-       .version = {1, 6, 0},
+       .version = {1, 7, 0},
        .module = THIS_MODULE,
        .ctr = thin_ctr,
        .dtr = thin_dtr,
@@ -2767,7 +2757,6 @@ static struct target_type thin_target = {
        .postsuspend = thin_postsuspend,
        .status = thin_status,
        .iterate_devices = thin_iterate_devices,
-       .io_hints = thin_io_hints,
 };
 
 /*----------------------------------------------------------------*/
index c72e4d5a96178c6a542442e2e66bd3da92473b50..314a0e2faf79d6c097e7c1201bf25af8600baaf6 100644 (file)
@@ -1188,6 +1188,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
 {
        struct dm_target *ti;
        sector_t len;
+       unsigned num_requests;
 
        do {
                ti = dm_table_find_target(ci->map, ci->sector);
@@ -1200,7 +1201,8 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
                 * reconfiguration might also have changed that since the
                 * check was performed.
                 */
-               if (!get_num_requests || !get_num_requests(ti))
+               num_requests = get_num_requests ? get_num_requests(ti) : 0;
+               if (!num_requests)
                        return -EOPNOTSUPP;
 
                if (is_split_required && !is_split_required(ti))
@@ -1208,7 +1210,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
                else
                        len = min(ci->sector_count, max_io_len(ci->sector, ti));
 
-               __issue_target_requests(ci, ti, ti->num_discard_requests, len);
+               __issue_target_requests(ci, ti, num_requests, len);
 
                ci->sector += len;
        } while (ci->sector_count -= len);
index 47ad4e270877706e3b3e864ac1e8f77ac7b11c42..ff553babf455025c2a5ce303297a15f404d2d5e3 100644 (file)
@@ -237,6 +237,7 @@ config MFD_TPS65910
        depends on I2C=y && GPIOLIB
        select MFD_CORE
        select REGMAP_I2C
+       select REGMAP_IRQ
        select IRQ_DOMAIN
        help
          if you say yes here you get support for the TPS65910 series of
index e1650badd106da6e3992b219e77fdc35e20ad1c8..4778bb124efe09b27da77446896dfd6ae9e97f0e 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/mfd/core.h>
 #include <linux/mfd/abx500.h>
 #include <linux/mfd/abx500/ab8500.h>
+#include <linux/mfd/abx500/ab8500-bm.h>
 #include <linux/mfd/dbx500-prcmu.h>
 #include <linux/regulator/ab8500.h>
 #include <linux/of.h>
index bc8a3edb6bbf2b2fdc9c3f15a425eafb0bcb23af..222c03a5ddc0b3d3e9a37af453d4a1745f1b35e3 100644 (file)
@@ -239,7 +239,12 @@ static int arizona_runtime_resume(struct device *dev)
                return ret;
        }
 
-       regcache_sync(arizona->regmap);
+       ret = regcache_sync(arizona->regmap);
+       if (ret != 0) {
+               dev_err(arizona->dev, "Failed to restore register cache\n");
+               regulator_disable(arizona->dcvdd);
+               return ret;
+       }
 
        return 0;
 }
index 74713bf5371fa42361dbb2342407c0dfe9c039b6..2bec5f0db3ee5e80733a88043d96b3219405d2f0 100644 (file)
@@ -176,14 +176,7 @@ int arizona_irq_init(struct arizona *arizona)
                aod = &wm5102_aod;
                irq = &wm5102_irq;
 
-               switch (arizona->rev) {
-               case 0:
-               case 1:
-                       ctrlif_error = false;
-                       break;
-               default:
-                       break;
-               }
+               ctrlif_error = false;
                break;
 #endif
 #ifdef CONFIG_MFD_WM5110
@@ -191,14 +184,7 @@ int arizona_irq_init(struct arizona *arizona)
                aod = &wm5110_aod;
                irq = &wm5110_irq;
 
-               switch (arizona->rev) {
-               case 0:
-               case 1:
-                       ctrlif_error = false;
-                       break;
-               default:
-                       break;
-               }
+               ctrlif_error = false;
                break;
 #endif
        default:
index ac74a4d1daead1848ef00e9ac096013d69e67a21..885e567803583a42473ffb532beead311ad68cf2 100644 (file)
 #include <linux/of_device.h>
 #endif
 
+/* I2C safe register check */
+static inline bool i2c_safe_reg(unsigned char reg)
+{
+       switch (reg) {
+       case DA9052_STATUS_A_REG:
+       case DA9052_STATUS_B_REG:
+       case DA9052_STATUS_C_REG:
+       case DA9052_STATUS_D_REG:
+       case DA9052_ADC_RES_L_REG:
+       case DA9052_ADC_RES_H_REG:
+       case DA9052_VDD_RES_REG:
+       case DA9052_ICHG_AV_REG:
+       case DA9052_TBAT_RES_REG:
+       case DA9052_ADCIN4_RES_REG:
+       case DA9052_ADCIN5_RES_REG:
+       case DA9052_ADCIN6_RES_REG:
+       case DA9052_TJUNC_RES_REG:
+       case DA9052_TSI_X_MSB_REG:
+       case DA9052_TSI_Y_MSB_REG:
+       case DA9052_TSI_LSB_REG:
+       case DA9052_TSI_Z_MSB_REG:
+               return true;
+       default:
+               return false;
+       }
+}
+
+/*
+ * There is an issue with DA9052 and DA9053_AA/BA/BB PMIC where the PMIC
+ * gets lockup up or fails to respond following a system reset.
+ * This fix is to follow any read or write with a dummy read to a safe
+ * register.
+ */
+int da9052_i2c_fix(struct da9052 *da9052, unsigned char reg)
+{
+       int val;
+
+       switch (da9052->chip_id) {
+       case DA9052:
+       case DA9053_AA:
+       case DA9053_BA:
+       case DA9053_BB:
+               /* A dummy read to a safe register address. */
+       if (!i2c_safe_reg(reg))
+                       return regmap_read(da9052->regmap,
+                                          DA9052_PARK_REGISTER,
+                                          &val);
+               break;
+       default:
+               /*
+                * For other chips parking of I2C register
+                * to a safe place is not required.
+                */
+               break;
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL(da9052_i2c_fix);
+
 static int da9052_i2c_enable_multiwrite(struct da9052 *da9052)
 {
        int reg_val, ret;
@@ -83,6 +143,7 @@ static int da9052_i2c_probe(struct i2c_client *client,
 
        da9052->dev = &client->dev;
        da9052->chip_irq = client->irq;
+       da9052->fix_io = da9052_i2c_fix;
 
        i2c_set_clientdata(client, da9052);
 
index dc8826d8d69da0d1ee8c29911dc6c95ade7f1da2..6fbe1c96a40447eb01c095f2602329092ac6bc6e 100644 (file)
 #include <linux/fs.h>
 #include <linux/platform_device.h>
 #include <linux/uaccess.h>
+#include <linux/irqchip/arm-gic.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/dbx500-prcmu.h>
 #include <linux/mfd/abx500/ab8500.h>
 #include <linux/regulator/db8500-prcmu.h>
 #include <linux/regulator/machine.h>
 #include <linux/cpufreq.h>
-#include <asm/hardware/gic.h>
 #include <mach/hardware.h>
 #include <mach/irqs.h>
 #include <mach/db8500-regs.h>
@@ -2524,7 +2524,7 @@ static bool read_mailbox_0(void)
 
                for (n = 0; n < NUM_PRCMU_WAKEUPS; n++) {
                        if (ev & prcmu_irq_bit[n])
-                               generic_handle_irq(IRQ_PRCMU_BASE + n);
+                               generic_handle_irq(irq_find_mapping(db8500_irq_domain, n));
                }
                r = true;
                break;
@@ -2737,13 +2737,14 @@ static int db8500_irq_map(struct irq_domain *d, unsigned int virq,
 }
 
 static struct irq_domain_ops db8500_irq_ops = {
-        .map    = db8500_irq_map,
-        .xlate  = irq_domain_xlate_twocell,
+       .map    = db8500_irq_map,
+       .xlate  = irq_domain_xlate_twocell,
 };
 
 static int db8500_irq_init(struct device_node *np)
 {
-       int irq_base = -1;
+       int irq_base = 0;
+       int i;
 
        /* In the device tree case, just take some IRQs */
        if (!np)
@@ -2758,6 +2759,10 @@ static int db8500_irq_init(struct device_node *np)
                return -ENOSYS;
        }
 
+       /* All wakeups will be used, so create mappings for all */
+       for (i = 0; i < NUM_PRCMU_WAKEUPS; i++)
+               irq_create_mapping(db8500_irq_domain, i);
+
        return 0;
 }
 
index f6878f8db57d105b663d399bc2830bbb0ce0b4bf..4d73963cd8f0188d2f9e09c9bbdcde0cf5c35007 100644 (file)
@@ -93,15 +93,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
        if (max77686 == NULL)
                return -ENOMEM;
 
-       max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
-       if (IS_ERR(max77686->regmap)) {
-               ret = PTR_ERR(max77686->regmap);
-               dev_err(max77686->dev, "Failed to allocate register map: %d\n",
-                               ret);
-               kfree(max77686);
-               return ret;
-       }
-
        i2c_set_clientdata(i2c, max77686);
        max77686->dev = &i2c->dev;
        max77686->i2c = i2c;
@@ -111,6 +102,15 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
        max77686->irq_gpio = pdata->irq_gpio;
        max77686->irq = i2c->irq;
 
+       max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
+       if (IS_ERR(max77686->regmap)) {
+               ret = PTR_ERR(max77686->regmap);
+               dev_err(max77686->dev, "Failed to allocate register map: %d\n",
+                               ret);
+               kfree(max77686);
+               return ret;
+       }
+
        if (regmap_read(max77686->regmap,
                         MAX77686_REG_DEVICE_ID, &data) < 0) {
                dev_err(max77686->dev,
index cc5155e20494726c2ae6954e64128f61973ebafd..9e60fed5ff82a81dbf774c7d8af7547f12861516 100644 (file)
@@ -114,35 +114,37 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
        u8 reg_data;
        int ret = 0;
 
+       if (!pdata) {
+               dev_err(&i2c->dev, "No platform data found.\n");
+               return -EINVAL;
+       }
+
        max77693 = devm_kzalloc(&i2c->dev,
                        sizeof(struct max77693_dev), GFP_KERNEL);
        if (max77693 == NULL)
                return -ENOMEM;
 
-       max77693->regmap = devm_regmap_init_i2c(i2c, &max77693_regmap_config);
-       if (IS_ERR(max77693->regmap)) {
-               ret = PTR_ERR(max77693->regmap);
-               dev_err(max77693->dev,"failed to allocate register map: %d\n",
-                               ret);
-               goto err_regmap;
-       }
-
        i2c_set_clientdata(i2c, max77693);
        max77693->dev = &i2c->dev;
        max77693->i2c = i2c;
        max77693->irq = i2c->irq;
        max77693->type = id->driver_data;
 
-       if (!pdata)
-               goto err_regmap;
+       max77693->regmap = devm_regmap_init_i2c(i2c, &max77693_regmap_config);
+       if (IS_ERR(max77693->regmap)) {
+               ret = PTR_ERR(max77693->regmap);
+               dev_err(max77693->dev, "failed to allocate register map: %d\n",
+                               ret);
+               return ret;
+       }
 
        max77693->wakeup = pdata->wakeup;
 
-       if (max77693_read_reg(max77693->regmap,
-                               MAX77693_PMIC_REG_PMIC_ID2, &reg_data) < 0) {
+       ret = max77693_read_reg(max77693->regmap, MAX77693_PMIC_REG_PMIC_ID2,
+                               &reg_data);
+       if (ret < 0) {
                dev_err(max77693->dev, "device not found on this channel\n");
-               ret = -ENODEV;
-               goto err_regmap;
+               return ret;
        } else
                dev_info(max77693->dev, "device ID: 0x%x\n", reg_data);
 
@@ -163,7 +165,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
                ret = PTR_ERR(max77693->regmap_muic);
                dev_err(max77693->dev,
                        "failed to allocate register map: %d\n", ret);
-               goto err_regmap;
+               goto err_regmap_muic;
        }
 
        ret = max77693_irq_init(max77693);
@@ -184,9 +186,9 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
 err_mfd:
        max77693_irq_exit(max77693);
 err_irq:
+err_regmap_muic:
        i2c_unregister_device(max77693->muic);
        i2c_unregister_device(max77693->haptic);
-err_regmap:
        return ret;
 }
 
index 64803f13bcecc4f6e8f221ecacf814e419d07104..d11567307fbed6c930f955abf198de1157dfb237 100644 (file)
@@ -208,6 +208,8 @@ static int pcf50633_probe(struct i2c_client *client,
        if (!pcf)
                return -ENOMEM;
 
+       i2c_set_clientdata(client, pcf);
+       pcf->dev = &client->dev;
        pcf->pdata = pdata;
 
        mutex_init(&pcf->lock);
@@ -219,9 +221,6 @@ static int pcf50633_probe(struct i2c_client *client,
                return ret;
        }
 
-       i2c_set_clientdata(client, pcf);
-       pcf->dev = &client->dev;
-
        version = pcf50633_reg_read(pcf, 0);
        variant = pcf50633_reg_read(pcf, 1);
        if (version < 0 || variant < 0) {
index 89f046ca9e410292b9b1a51423544ab1a40aebf2..3d3b4addf81a9b73b480ae3874e2675e1678b52b 100644 (file)
@@ -112,6 +112,21 @@ static int rtl8411_card_power_off(struct rtsx_pcr *pcr, int card)
                        BPP_LDO_POWB, BPP_LDO_SUSPEND);
 }
 
+static int rtl8411_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+       u8 mask, val;
+
+       mask = (BPP_REG_TUNED18 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_MASK;
+       if (voltage == OUTPUT_3V3)
+               val = (BPP_ASIC_3V3 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_3V3;
+       else if (voltage == OUTPUT_1V8)
+               val = (BPP_ASIC_1V8 << BPP_TUNED18_SHIFT_8411) | BPP_PAD_1V8;
+       else
+               return -EINVAL;
+
+       return rtsx_pci_write_register(pcr, LDO_CTL, mask, val);
+}
+
 static unsigned int rtl8411_cd_deglitch(struct rtsx_pcr *pcr)
 {
        unsigned int card_exist;
@@ -163,6 +178,18 @@ static unsigned int rtl8411_cd_deglitch(struct rtsx_pcr *pcr)
        return card_exist;
 }
 
+static int rtl8411_conv_clk_and_div_n(int input, int dir)
+{
+       int output;
+
+       if (dir == CLK_TO_DIV_N)
+               output = input * 4 / 5 - 2;
+       else
+               output = (input + 2) * 5 / 4;
+
+       return output;
+}
+
 static const struct pcr_ops rtl8411_pcr_ops = {
        .extra_init_hw = rtl8411_extra_init_hw,
        .optimize_phy = NULL,
@@ -172,7 +199,9 @@ static const struct pcr_ops rtl8411_pcr_ops = {
        .disable_auto_blink = rtl8411_disable_auto_blink,
        .card_power_on = rtl8411_card_power_on,
        .card_power_off = rtl8411_card_power_off,
+       .switch_output_voltage = rtl8411_switch_output_voltage,
        .cd_deglitch = rtl8411_cd_deglitch,
+       .conv_clk_and_div_n = rtl8411_conv_clk_and_div_n,
 };
 
 /* SD Pull Control Enable:
index 283a4f148084ab29f34d2444d8f264e72345e846..98fe0f39463ed1596f1e0881f5d7352349da400d 100644 (file)
@@ -144,6 +144,25 @@ static int rts5209_card_power_off(struct rtsx_pcr *pcr, int card)
        return rtsx_pci_send_cmd(pcr, 100);
 }
 
+static int rts5209_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+       int err;
+
+       if (voltage == OUTPUT_3V3) {
+               err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
+               if (err < 0)
+                       return err;
+       } else if (voltage == OUTPUT_1V8) {
+               err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
+               if (err < 0)
+                       return err;
+       } else {
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
 static const struct pcr_ops rts5209_pcr_ops = {
        .extra_init_hw = rts5209_extra_init_hw,
        .optimize_phy = rts5209_optimize_phy,
@@ -153,7 +172,9 @@ static const struct pcr_ops rts5209_pcr_ops = {
        .disable_auto_blink = rts5209_disable_auto_blink,
        .card_power_on = rts5209_card_power_on,
        .card_power_off = rts5209_card_power_off,
+       .switch_output_voltage = rts5209_switch_output_voltage,
        .cd_deglitch = NULL,
+       .conv_clk_and_div_n = NULL,
 };
 
 /* SD Pull Control Enable:
index b9dbab266fdadc9f3f60e219f6dc5e25b9322036..29d889cbb9c5183262897bc5e29818c536bb227d 100644 (file)
@@ -114,6 +114,25 @@ static int rts5229_card_power_off(struct rtsx_pcr *pcr, int card)
        return rtsx_pci_send_cmd(pcr, 100);
 }
 
+static int rts5229_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+       int err;
+
+       if (voltage == OUTPUT_3V3) {
+               err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
+               if (err < 0)
+                       return err;
+       } else if (voltage == OUTPUT_1V8) {
+               err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
+               if (err < 0)
+                       return err;
+       } else {
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
 static const struct pcr_ops rts5229_pcr_ops = {
        .extra_init_hw = rts5229_extra_init_hw,
        .optimize_phy = rts5229_optimize_phy,
@@ -123,7 +142,9 @@ static const struct pcr_ops rts5229_pcr_ops = {
        .disable_auto_blink = rts5229_disable_auto_blink,
        .card_power_on = rts5229_card_power_on,
        .card_power_off = rts5229_card_power_off,
+       .switch_output_voltage = rts5229_switch_output_voltage,
        .cd_deglitch = NULL,
+       .conv_clk_and_div_n = NULL,
 };
 
 /* SD Pull Control Enable:
index 7a7b0bda4618926fffea21dc23a3f386e1303777..9fc57009e22813fe257481b39352533f2fbd5d45 100644 (file)
@@ -630,7 +630,10 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
        if (clk == pcr->cur_clock)
                return 0;
 
-       N = (u8)(clk - 2);
+       if (pcr->ops->conv_clk_and_div_n)
+               N = (u8)pcr->ops->conv_clk_and_div_n(clk, CLK_TO_DIV_N);
+       else
+               N = (u8)(clk - 2);
        if ((clk <= 2) || (N > max_N))
                return -EINVAL;
 
@@ -641,7 +644,14 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
        /* Make sure that the SSC clock div_n is equal or greater than min_N */
        div = CLK_DIV_1;
        while ((N < min_N) && (div < max_div)) {
-               N = (N + 2) * 2 - 2;
+               if (pcr->ops->conv_clk_and_div_n) {
+                       int dbl_clk = pcr->ops->conv_clk_and_div_n(N,
+                                       DIV_N_TO_CLK) * 2;
+                       N = (u8)pcr->ops->conv_clk_and_div_n(dbl_clk,
+                                       CLK_TO_DIV_N);
+               } else {
+                       N = (N + 2) * 2 - 2;
+               }
                div++;
        }
        dev_dbg(&(pcr->pci->dev), "N = %d, div = %d\n", N, div);
@@ -703,6 +713,15 @@ int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card)
 }
 EXPORT_SYMBOL_GPL(rtsx_pci_card_power_off);
 
+int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage)
+{
+       if (pcr->ops->switch_output_voltage)
+               return pcr->ops->switch_output_voltage(pcr, voltage);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(rtsx_pci_switch_output_voltage);
+
 unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr)
 {
        unsigned int val;
@@ -767,10 +786,10 @@ static void rtsx_pci_card_detect(struct work_struct *work)
 
        spin_unlock_irqrestore(&pcr->lock, flags);
 
-       if (card_detect & SD_EXIST)
+       if ((card_detect & SD_EXIST) && pcr->slots[RTSX_SD_CARD].card_event)
                pcr->slots[RTSX_SD_CARD].card_event(
                                pcr->slots[RTSX_SD_CARD].p_dev);
-       if (card_detect & MS_EXIST)
+       if ((card_detect & MS_EXIST) && pcr->slots[RTSX_MS_CARD].card_event)
                pcr->slots[RTSX_MS_CARD].card_event(
                                pcr->slots[RTSX_MS_CARD].p_dev);
 }
index a06d66b929b1ea96743826435d18899464fb24b5..ecc092c7f7453e4cfb7146fc222546869239f8b0 100644 (file)
@@ -219,25 +219,18 @@ static void tc3589x_irq_unmap(struct irq_domain *d, unsigned int virq)
 }
 
 static struct irq_domain_ops tc3589x_irq_ops = {
-        .map    = tc3589x_irq_map,
+       .map    = tc3589x_irq_map,
        .unmap  = tc3589x_irq_unmap,
-        .xlate  = irq_domain_xlate_twocell,
+       .xlate  = irq_domain_xlate_twocell,
 };
 
 static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
 {
        int base = tc3589x->irq_base;
 
-       if (base) {
-               tc3589x->domain = irq_domain_add_legacy(
-                       NULL, TC3589x_NR_INTERNAL_IRQS, base,
-                       0, &tc3589x_irq_ops, tc3589x);
-       }
-       else {
-               tc3589x->domain = irq_domain_add_linear(
-                       np, TC3589x_NR_INTERNAL_IRQS,
-                       &tc3589x_irq_ops, tc3589x);
-       }
+       tc3589x->domain = irq_domain_add_simple(
+               np, TC3589x_NR_INTERNAL_IRQS, base,
+               &tc3589x_irq_ops, tc3589x);
 
        if (!tc3589x->domain) {
                dev_err(tc3589x->dev, "Failed to create irqdomain\n");
index 4dae241e501734f66c9080283a0c43188729b0b5..dd362c1078e1438b3751ec69dc1c8b1ad3efa0bb 100644 (file)
@@ -159,7 +159,7 @@ out:
 static int twl4030_write_script(u8 address, struct twl4030_ins *script,
                                       int len)
 {
-       int err;
+       int err = -EINVAL;
 
        for (; len; len--, address++, script++) {
                if (len == 1) {
index fae15d880758cc197ed0bfe8e095daca74f01bd5..3c1723aa62250c28c61aab4b3f83442e28770dc8 100644 (file)
@@ -67,6 +67,7 @@ struct vexpress_config_bridge *vexpress_config_bridge_register(
 
        return bridge;
 }
+EXPORT_SYMBOL(vexpress_config_bridge_register);
 
 void vexpress_config_bridge_unregister(struct vexpress_config_bridge *bridge)
 {
@@ -83,6 +84,7 @@ void vexpress_config_bridge_unregister(struct vexpress_config_bridge *bridge)
        while (!list_empty(&__bridge.transactions))
                cpu_relax();
 }
+EXPORT_SYMBOL(vexpress_config_bridge_unregister);
 
 
 struct vexpress_config_func {
@@ -142,6 +144,7 @@ struct vexpress_config_func *__vexpress_config_func_get(struct device *dev,
 
        return func;
 }
+EXPORT_SYMBOL(__vexpress_config_func_get);
 
 void vexpress_config_func_put(struct vexpress_config_func *func)
 {
@@ -149,7 +152,7 @@ void vexpress_config_func_put(struct vexpress_config_func *func)
        of_node_put(func->bridge->node);
        kfree(func);
 }
-
+EXPORT_SYMBOL(vexpress_config_func_put);
 
 struct vexpress_config_trans {
        struct vexpress_config_func *func;
@@ -229,6 +232,7 @@ void vexpress_config_complete(struct vexpress_config_bridge *bridge,
 
        complete(&trans->completion);
 }
+EXPORT_SYMBOL(vexpress_config_complete);
 
 int vexpress_config_wait(struct vexpress_config_trans *trans)
 {
@@ -236,7 +240,7 @@ int vexpress_config_wait(struct vexpress_config_trans *trans)
 
        return trans->status;
 }
-
+EXPORT_SYMBOL(vexpress_config_wait);
 
 int vexpress_config_read(struct vexpress_config_func *func, int offset,
                u32 *data)
index 088872ab63389e49d04dd3f38fb02664fdc929ba..1133a64c2dc9388609ff125c480a82840d9285d1 100644 (file)
@@ -1882,7 +1882,7 @@ static bool wm5102_volatile_register(struct device *dev, unsigned int reg)
        }
 }
 
-#define WM5102_MAX_REGISTER 0x1a8fff
+#define WM5102_MAX_REGISTER 0x1a9800
 
 const struct regmap_config wm5102_spi_regmap = {
        .reg_bits = 32,
index 571915dfb218382f0d29ea72136b05669b9271ea..f74b5adca64232dd4a8ab7d4a397281b8f02c7a0 100644 (file)
@@ -1060,26 +1060,6 @@ static int sd_wait_voltage_stable_2(struct realtek_pci_sdmmc *host)
        return 0;
 }
 
-static int sd_change_bank_voltage(struct realtek_pci_sdmmc *host, u8 voltage)
-{
-       struct rtsx_pcr *pcr = host->pcr;
-       int err;
-
-       if (voltage == SD_IO_3V3) {
-               err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4FC0 | 0x24);
-               if (err < 0)
-                       return err;
-       } else if (voltage == SD_IO_1V8) {
-               err = rtsx_pci_write_phy_register(pcr, 0x08, 0x4C40 | 0x24);
-               if (err < 0)
-                       return err;
-       } else {
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
 static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
 {
        struct realtek_pci_sdmmc *host = mmc_priv(mmc);
@@ -1098,11 +1078,11 @@ static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
        rtsx_pci_start_run(pcr);
 
        if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330)
-               voltage = SD_IO_3V3;
+               voltage = OUTPUT_3V3;
        else
-               voltage = SD_IO_1V8;
+               voltage = OUTPUT_1V8;
 
-       if (voltage == SD_IO_1V8) {
+       if (voltage == OUTPUT_1V8) {
                err = rtsx_pci_write_register(pcr,
                                SD30_DRIVE_SEL, 0x07, DRIVER_TYPE_B);
                if (err < 0)
@@ -1113,11 +1093,11 @@ static int sdmmc_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
                        goto out;
        }
 
-       err = sd_change_bank_voltage(host, voltage);
+       err = rtsx_pci_switch_output_voltage(pcr, voltage);
        if (err < 0)
                goto out;
 
-       if (voltage == SD_IO_1V8) {
+       if (voltage == OUTPUT_1V8) {
                err = sd_wait_voltage_stable_2(host);
                if (err < 0)
                        goto out;
index 5233b8f58d773b6edb44f306f477674f05415084..58607f196c9ee5e5c3d214c70ca9abe0e2a5b6d0 100644 (file)
@@ -960,7 +960,7 @@ static int c_can_handle_bus_err(struct net_device *dev,
                break;
        case LEC_ACK_ERROR:
                netdev_dbg(dev, "ack error\n");
-               cf->data[2] |= (CAN_ERR_PROT_LOC_ACK |
+               cf->data[3] |= (CAN_ERR_PROT_LOC_ACK |
                                CAN_ERR_PROT_LOC_ACK_DEL);
                break;
        case LEC_BIT1_ERROR:
@@ -973,7 +973,7 @@ static int c_can_handle_bus_err(struct net_device *dev,
                break;
        case LEC_CRC_ERROR:
                netdev_dbg(dev, "CRC error\n");
-               cf->data[2] |= (CAN_ERR_PROT_LOC_CRC_SEQ |
+               cf->data[3] |= (CAN_ERR_PROT_LOC_CRC_SEQ |
                                CAN_ERR_PROT_LOC_CRC_DEL);
                break;
        default:
index 7d1748575b1fffc45f38351ea3f071269545548a..5c314a961970b0041c7776da283979f00c4114f8 100644 (file)
@@ -560,7 +560,7 @@ static void pch_can_error(struct net_device *ndev, u32 status)
                stats->rx_errors++;
                break;
        case PCH_CRC_ERR:
-               cf->data[2] |= CAN_ERR_PROT_LOC_CRC_SEQ |
+               cf->data[3] |= CAN_ERR_PROT_LOC_CRC_SEQ |
                               CAN_ERR_PROT_LOC_CRC_DEL;
                priv->can.can_stats.bus_error++;
                stats->rx_errors++;
index f898c6363729b2a41be58c824f3f3bb145a95897..300581b24ff32860447e3646079024646e77a592 100644 (file)
@@ -746,12 +746,12 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
                }
                if (err_status & HECC_CANES_CRCE) {
                        hecc_set_bit(priv, HECC_CANES, HECC_CANES_CRCE);
-                       cf->data[2] |= CAN_ERR_PROT_LOC_CRC_SEQ |
+                       cf->data[3] |= CAN_ERR_PROT_LOC_CRC_SEQ |
                                        CAN_ERR_PROT_LOC_CRC_DEL;
                }
                if (err_status & HECC_CANES_ACKE) {
                        hecc_set_bit(priv, HECC_CANES, HECC_CANES_ACKE);
-                       cf->data[2] |= CAN_ERR_PROT_LOC_ACK |
+                       cf->data[3] |= CAN_ERR_PROT_LOC_ACK |
                                        CAN_ERR_PROT_LOC_ACK_DEL;
                }
        }
index 66df936380859b55ab0b8b15595319bfeb98c98a..ffd8de28a76ad2c69a96daab3c59dbe29127faa1 100644 (file)
@@ -432,7 +432,7 @@ static int tc574_config(struct pcmcia_device *link)
        netdev_info(dev, "%s at io %#3lx, irq %d, hw_addr %pM\n",
                    cardname, dev->base_addr, dev->irq, dev->dev_addr);
        netdev_info(dev, " %dK FIFO split %s Rx:Tx, %sMII interface.\n",
-                   8 << config & Ram_size,
+                   8 << (config & Ram_size),
                    ram_split[(config & Ram_split) >> Ram_split_shift],
                    config & Autoselect ? "autoselect " : "");
 
index 78ea90c40e1902af09272a80b09010da52ae6c6b..bdb086934cd95de72cd1aa02cf1cb4b6baaaafc3 100644 (file)
@@ -1283,14 +1283,26 @@ static int tg3_phy_auxctl_write(struct tg3 *tp, int reg, u32 set)
        return tg3_writephy(tp, MII_TG3_AUX_CTRL, set | reg);
 }
 
-#define TG3_PHY_AUXCTL_SMDSP_ENABLE(tp) \
-       tg3_phy_auxctl_write((tp), MII_TG3_AUXCTL_SHDWSEL_AUXCTL, \
-                            MII_TG3_AUXCTL_ACTL_SMDSP_ENA | \
-                            MII_TG3_AUXCTL_ACTL_TX_6DB)
+static int tg3_phy_toggle_auxctl_smdsp(struct tg3 *tp, bool enable)
+{
+       u32 val;
+       int err;
 
-#define TG3_PHY_AUXCTL_SMDSP_DISABLE(tp) \
-       tg3_phy_auxctl_write((tp), MII_TG3_AUXCTL_SHDWSEL_AUXCTL, \
-                            MII_TG3_AUXCTL_ACTL_TX_6DB);
+       err = tg3_phy_auxctl_read(tp, MII_TG3_AUXCTL_SHDWSEL_AUXCTL, &val);
+
+       if (err)
+               return err;
+       if (enable)
+
+               val |= MII_TG3_AUXCTL_ACTL_SMDSP_ENA;
+       else
+               val &= ~MII_TG3_AUXCTL_ACTL_SMDSP_ENA;
+
+       err = tg3_phy_auxctl_write((tp), MII_TG3_AUXCTL_SHDWSEL_AUXCTL,
+                                  val | MII_TG3_AUXCTL_ACTL_TX_6DB);
+
+       return err;
+}
 
 static int tg3_bmcr_reset(struct tg3 *tp)
 {
@@ -2223,7 +2235,7 @@ static void tg3_phy_apply_otp(struct tg3 *tp)
 
        otp = tp->phy_otp;
 
-       if (TG3_PHY_AUXCTL_SMDSP_ENABLE(tp))
+       if (tg3_phy_toggle_auxctl_smdsp(tp, true))
                return;
 
        phy = ((otp & TG3_OTP_AGCTGT_MASK) >> TG3_OTP_AGCTGT_SHIFT);
@@ -2248,7 +2260,7 @@ static void tg3_phy_apply_otp(struct tg3 *tp)
              ((otp & TG3_OTP_RCOFF_MASK) >> TG3_OTP_RCOFF_SHIFT);
        tg3_phydsp_write(tp, MII_TG3_DSP_EXP97, phy);
 
-       TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+       tg3_phy_toggle_auxctl_smdsp(tp, false);
 }
 
 static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
@@ -2284,9 +2296,9 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
 
        if (!tp->setlpicnt) {
                if (current_link_up == 1 &&
-                  !TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
+                  !tg3_phy_toggle_auxctl_smdsp(tp, true)) {
                        tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, 0x0000);
-                       TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+                       tg3_phy_toggle_auxctl_smdsp(tp, false);
                }
 
                val = tr32(TG3_CPMU_EEE_MODE);
@@ -2302,11 +2314,11 @@ static void tg3_phy_eee_enable(struct tg3 *tp)
            (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
             GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
             tg3_flag(tp, 57765_CLASS)) &&
-           !TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
+           !tg3_phy_toggle_auxctl_smdsp(tp, true)) {
                val = MII_TG3_DSP_TAP26_ALNOKO |
                      MII_TG3_DSP_TAP26_RMRXSTO;
                tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
-               TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+               tg3_phy_toggle_auxctl_smdsp(tp, false);
        }
 
        val = tr32(TG3_CPMU_EEE_MODE);
@@ -2450,7 +2462,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
                tg3_writephy(tp, MII_CTRL1000,
                             CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER);
 
-               err = TG3_PHY_AUXCTL_SMDSP_ENABLE(tp);
+               err = tg3_phy_toggle_auxctl_smdsp(tp, true);
                if (err)
                        return err;
 
@@ -2471,7 +2483,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
        tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x8200);
        tg3_writephy(tp, MII_TG3_DSP_CONTROL, 0x0000);
 
-       TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+       tg3_phy_toggle_auxctl_smdsp(tp, false);
 
        tg3_writephy(tp, MII_CTRL1000, phy9_orig);
 
@@ -2572,10 +2584,10 @@ static int tg3_phy_reset(struct tg3 *tp)
 
 out:
        if ((tp->phy_flags & TG3_PHYFLG_ADC_BUG) &&
-           !TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
+           !tg3_phy_toggle_auxctl_smdsp(tp, true)) {
                tg3_phydsp_write(tp, 0x201f, 0x2aaa);
                tg3_phydsp_write(tp, 0x000a, 0x0323);
-               TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+               tg3_phy_toggle_auxctl_smdsp(tp, false);
        }
 
        if (tp->phy_flags & TG3_PHYFLG_5704_A0_BUG) {
@@ -2584,14 +2596,14 @@ out:
        }
 
        if (tp->phy_flags & TG3_PHYFLG_BER_BUG) {
-               if (!TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
+               if (!tg3_phy_toggle_auxctl_smdsp(tp, true)) {
                        tg3_phydsp_write(tp, 0x000a, 0x310b);
                        tg3_phydsp_write(tp, 0x201f, 0x9506);
                        tg3_phydsp_write(tp, 0x401f, 0x14e2);
-                       TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+                       tg3_phy_toggle_auxctl_smdsp(tp, false);
                }
        } else if (tp->phy_flags & TG3_PHYFLG_JITTER_BUG) {
-               if (!TG3_PHY_AUXCTL_SMDSP_ENABLE(tp)) {
+               if (!tg3_phy_toggle_auxctl_smdsp(tp, true)) {
                        tg3_writephy(tp, MII_TG3_DSP_ADDRESS, 0x000a);
                        if (tp->phy_flags & TG3_PHYFLG_ADJUST_TRIM) {
                                tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x110b);
@@ -2600,7 +2612,7 @@ out:
                        } else
                                tg3_writephy(tp, MII_TG3_DSP_RW_PORT, 0x010b);
 
-                       TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+                       tg3_phy_toggle_auxctl_smdsp(tp, false);
                }
        }
 
@@ -4009,7 +4021,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
        tw32(TG3_CPMU_EEE_MODE,
             tr32(TG3_CPMU_EEE_MODE) & ~TG3_CPMU_EEEMD_LPI_ENABLE);
 
-       err = TG3_PHY_AUXCTL_SMDSP_ENABLE(tp);
+       err = tg3_phy_toggle_auxctl_smdsp(tp, true);
        if (!err) {
                u32 err2;
 
@@ -4042,7 +4054,7 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
                                                 MII_TG3_DSP_CH34TP2_HIBW01);
                }
 
-               err2 = TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
+               err2 = tg3_phy_toggle_auxctl_smdsp(tp, false);
                if (!err)
                        err = err2;
        }
@@ -6950,6 +6962,9 @@ static void tg3_poll_controller(struct net_device *dev)
        int i;
        struct tg3 *tp = netdev_priv(dev);
 
+       if (tg3_irq_sync(tp))
+               return;
+
        for (i = 0; i < tp->irq_cnt; i++)
                tg3_interrupt(tp->napi[i].irq_vec, &tp->napi[i]);
 }
@@ -16367,6 +16382,7 @@ static int tg3_init_one(struct pci_dev *pdev,
        tp->pm_cap = pm_cap;
        tp->rx_mode = TG3_DEF_RX_MODE;
        tp->tx_mode = TG3_DEF_TX_MODE;
+       tp->irq_sync = 1;
 
        if (tg3_debug > 0)
                tp->msg_enable = tg3_debug;
index b407043ce9b0df3c1286fb3c0051f012cfa5e5b0..f7f02900f6508f0c8a7f8b6b41558aa85550e291 100644 (file)
@@ -548,6 +548,10 @@ static int desc_get_rx_status(struct xgmac_priv *priv, struct xgmac_dma_desc *p)
                return -1;
        }
 
+       /* All frames should fit into a single buffer */
+       if (!(status & RXDESC_FIRST_SEG) || !(status & RXDESC_LAST_SEG))
+               return -1;
+
        /* Check if packet has checksum already */
        if ((status & RXDESC_FRAME_TYPE) && (status & RXDESC_EXT_STATUS) &&
                !(ext_status & RXDESC_IP_PAYLOAD_MASK))
index f0718e1a83696b0e2ec0b8fad9121288ecda81bc..c306df7d45684ce1fcd2f25012e8100da98abdd2 100644 (file)
@@ -1994,9 +1994,20 @@ static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
 {
        const struct port_info *pi = netdev_priv(dev);
        struct adapter *adap = pi->adapter;
-
-       return set_rxq_intr_params(adap, &adap->sge.ethrxq[pi->first_qset].rspq,
-                       c->rx_coalesce_usecs, c->rx_max_coalesced_frames);
+       struct sge_rspq *q;
+       int i;
+       int r = 0;
+
+       for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) {
+               q = &adap->sge.ethrxq[i].rspq;
+               r = set_rxq_intr_params(adap, q, c->rx_coalesce_usecs,
+                       c->rx_max_coalesced_frames);
+               if (r) {
+                       dev_err(&dev->dev, "failed to set coalesce %d\n", r);
+                       break;
+               }
+       }
+       return r;
 }
 
 static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
index f3a632bf8d96f8bd76983e8990c80f1cefe984ac..687c83d1bdabb7589ac4492e9763b863ac5fcef0 100644 (file)
@@ -32,7 +32,7 @@
 
 obj-$(CONFIG_IXGBE) += ixgbe.o
 
-ixgbe-objs := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o ixgbe_debugfs.o\
+ixgbe-objs := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o \
               ixgbe_82599.o ixgbe_82598.o ixgbe_phy.o ixgbe_sriov.o \
               ixgbe_mbx.o ixgbe_x540.o ixgbe_lib.o ixgbe_ptp.o
 
@@ -40,4 +40,5 @@ ixgbe-$(CONFIG_IXGBE_DCB) +=  ixgbe_dcb.o ixgbe_dcb_82598.o \
                               ixgbe_dcb_82599.o ixgbe_dcb_nl.o
 
 ixgbe-$(CONFIG_IXGBE_HWMON) += ixgbe_sysfs.o
+ixgbe-$(CONFIG_DEBUG_FS) += ixgbe_debugfs.o
 ixgbe-$(CONFIG_FCOE:m=y) += ixgbe_fcoe.o
index 50aa546b8c7a589100be6bd88eac590adf314d98..3504686d3af515ed7f5e04924be29cd9098f2061 100644 (file)
@@ -24,9 +24,6 @@
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 
 *******************************************************************************/
-
-#ifdef CONFIG_DEBUG_FS
-
 #include <linux/debugfs.h>
 #include <linux/module.h>
 
@@ -277,5 +274,3 @@ void ixgbe_dbg_exit(void)
 {
        debugfs_remove_recursive(ixgbe_dbg_root);
 }
-
-#endif /* CONFIG_DEBUG_FS */
index 1a751c9d09c47f319e45d76a9c2bbad8573016d3..bb9256a1b0a9b467412ce127911ed3cfb53a7053 100644 (file)
@@ -660,11 +660,11 @@ int ixgbe_ptp_hwtstamp_ioctl(struct ixgbe_adapter *adapter,
                break;
        case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
                tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_L4_V1;
-               tsync_rx_mtrl = IXGBE_RXMTRL_V1_SYNC_MSG;
+               tsync_rx_mtrl |= IXGBE_RXMTRL_V1_SYNC_MSG;
                break;
        case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
                tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_L4_V1;
-               tsync_rx_mtrl = IXGBE_RXMTRL_V1_DELAY_REQ_MSG;
+               tsync_rx_mtrl |= IXGBE_RXMTRL_V1_DELAY_REQ_MSG;
                break;
        case HWTSTAMP_FILTER_PTP_V2_EVENT:
        case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
index 2b799f4f1c37100f06eab93aef628d4124182230..6771b69f40d562bf58909a1f806bddd1ace9ea65 100644 (file)
@@ -630,10 +630,15 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
                ring->tx_csum++;
        }
 
-       /* Copy dst mac address to wqe */
-       ethh = (struct ethhdr *)skb->data;
-       tx_desc->ctrl.srcrb_flags16[0] = get_unaligned((__be16 *)ethh->h_dest);
-       tx_desc->ctrl.imm = get_unaligned((__be32 *)(ethh->h_dest + 2));
+       if (mlx4_is_mfunc(mdev->dev) || priv->validate_loopback) {
+               /* Copy dst mac address to wqe. This allows loopback in eSwitch,
+                * so that VFs and PF can communicate with each other
+                */
+               ethh = (struct ethhdr *)skb->data;
+               tx_desc->ctrl.srcrb_flags16[0] = get_unaligned((__be16 *)ethh->h_dest);
+               tx_desc->ctrl.imm = get_unaligned((__be32 *)(ethh->h_dest + 2));
+       }
+
        /* Handle LSO (TSO) packets */
        if (lso_header_size) {
                /* Mark opcode as LSO */
index e1bafffbc3b1d261f4cf0972dd3f95c942c5fc3d..a6542d75374cdce3f7a17c21f7022fadff109850 100644 (file)
@@ -1790,15 +1790,8 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
        int i;
 
        if (msi_x) {
-               /* In multifunction mode each function gets 2 msi-X vectors
-                * one for data path completions anf the other for asynch events
-                * or command completions */
-               if (mlx4_is_mfunc(dev)) {
-                       nreq = 2;
-               } else {
-                       nreq = min_t(int, dev->caps.num_eqs -
-                                    dev->caps.reserved_eqs, nreq);
-               }
+               nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
+                            nreq);
 
                entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);
                if (!entries)
index bc165f4d0f65cebb6cc82e3aa99590863963f767..695667d471a1bef8dc81dd8034a593a118993e07 100644 (file)
@@ -144,7 +144,7 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter)
                                         buffrag->length, PCI_DMA_TODEVICE);
                        buffrag->dma = 0ULL;
                }
-               for (j = 0; j < cmd_buf->frag_count; j++) {
+               for (j = 1; j < cmd_buf->frag_count; j++) {
                        buffrag++;
                        if (buffrag->dma) {
                                pci_unmap_page(adapter->pdev, buffrag->dma,
index 6098fd4adfeb89ef5ed9c15407799ddbdcf02e7a..69e321a650779c9d3bae975a273035b922fca08f 100644 (file)
@@ -1963,10 +1963,12 @@ unwind:
        while (--i >= 0) {
                nf = &pbuf->frag_array[i+1];
                pci_unmap_page(pdev, nf->dma, nf->length, PCI_DMA_TODEVICE);
+               nf->dma = 0ULL;
        }
 
        nf = &pbuf->frag_array[0];
        pci_unmap_single(pdev, nf->dma, skb_headlen(skb), PCI_DMA_TODEVICE);
+       nf->dma = 0ULL;
 
 out_err:
        return -ENOMEM;
index ed96f309bca8e030a0c098df8b8e728314f04bb0..11702324a071b87deff9ef13f919be57e99b024b 100644 (file)
@@ -1826,8 +1826,6 @@ static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb)
 
        if (opts2 & RxVlanTag)
                __vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff));
-
-       desc->opts2 = 0;
 }
 
 static int rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd)
@@ -6064,8 +6062,6 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
                            !(status & (RxRWT | RxFOVF)) &&
                            (dev->features & NETIF_F_RXALL))
                                goto process_pkt;
-
-                       rtl8169_mark_to_asic(desc, rx_buf_sz);
                } else {
                        struct sk_buff *skb;
                        dma_addr_t addr;
@@ -6086,16 +6082,14 @@ process_pkt:
                        if (unlikely(rtl8169_fragmented_frame(status))) {
                                dev->stats.rx_dropped++;
                                dev->stats.rx_length_errors++;
-                               rtl8169_mark_to_asic(desc, rx_buf_sz);
-                               continue;
+                               goto release_descriptor;
                        }
 
                        skb = rtl8169_try_rx_copy(tp->Rx_databuff[entry],
                                                  tp, pkt_size, addr);
-                       rtl8169_mark_to_asic(desc, rx_buf_sz);
                        if (!skb) {
                                dev->stats.rx_dropped++;
-                               continue;
+                               goto release_descriptor;
                        }
 
                        rtl8169_rx_csum(skb, status);
@@ -6111,13 +6105,10 @@ process_pkt:
                        tp->rx_stats.bytes += pkt_size;
                        u64_stats_update_end(&tp->rx_stats.syncp);
                }
-
-               /* Work around for AMD plateform. */
-               if ((desc->opts2 & cpu_to_le32(0xfffe000)) &&
-                   (tp->mac_version == RTL_GIGA_MAC_VER_05)) {
-                       desc->opts2 = 0;
-                       cur_rx++;
-               }
+release_descriptor:
+               desc->opts2 = 0;
+               wmb();
+               rtl8169_mark_to_asic(desc, rx_buf_sz);
        }
 
        count = cur_rx - tp->cur_rx;
index 5fd6f4674326f0d3236ae8a97127b842ffffa008..e6fe0d80d6122fcd8dfcf7bb65fa71dac68c1e73 100644 (file)
@@ -84,7 +84,7 @@ struct hv_netvsc_packet {
 };
 
 struct netvsc_device_info {
-       unsigned char mac_adr[6];
+       unsigned char mac_adr[ETH_ALEN];
        bool link_state;        /* 0 - link up, 1 - link down */
        int  ring_size;
 };
index f825a629a699cfe5fac73803353da4b47ca18974..8264f0ef7692f5c832a12336a1188f9c7620190f 100644 (file)
@@ -349,7 +349,7 @@ static int netvsc_set_mac_addr(struct net_device *ndev, void *p)
        struct net_device_context *ndevctx = netdev_priv(ndev);
        struct hv_device *hdev =  ndevctx->device_ctx;
        struct sockaddr *addr = p;
-       char save_adr[14];
+       char save_adr[ETH_ALEN];
        unsigned char save_aatype;
        int err;
 
index 81f8f9e31db510892acae3cdb39a799de7e21be9..fcbf680c3e62f73af4933896641045de34f1f68c 100644 (file)
@@ -77,6 +77,11 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
 
        skb_orphan(skb);
 
+       /* Before queueing this packet to netif_rx(),
+        * make sure dst is refcounted.
+        */
+       skb_dst_force(skb);
+
        skb->protocol = eth_type_trans(skb, dev);
 
        /* it's OK to use per_cpu_ptr() because BHs are off */
index 68a43fe602e7a89ccffa54d1a5b82e2da4e5330c..d3fb97d97cbcb61f68deda7c3009a83393515656 100644 (file)
@@ -822,7 +822,10 @@ static int macvlan_changelink(struct net_device *dev,
 
 static size_t macvlan_get_size(const struct net_device *dev)
 {
-       return nla_total_size(4);
+       return (0
+               + nla_total_size(4) /* IFLA_MACVLAN_MODE */
+               + nla_total_size(2) /* IFLA_MACVLAN_FLAGS */
+               );
 }
 
 static int macvlan_fill_info(struct sk_buff *skb,
index d5199cb4caecd06c1774295765476d3a508e4a10..b5ddd5077a80dd9c6324c92e68a1ecd8a03314e7 100644 (file)
@@ -36,8 +36,9 @@ MODULE_LICENSE("GPL");
 
 /* IP101A/G - IP1001 */
 #define IP10XX_SPEC_CTRL_STATUS                16      /* Spec. Control Register */
+#define IP1001_RXPHASE_SEL             (1<<0)  /* Add delay on RX_CLK */
+#define IP1001_TXPHASE_SEL             (1<<1)  /* Add delay on TX_CLK */
 #define IP1001_SPEC_CTRL_STATUS_2      20      /* IP1001 Spec. Control Reg 2 */
-#define IP1001_PHASE_SEL_MASK          3       /* IP1001 RX/TXPHASE_SEL */
 #define IP1001_APS_ON                  11      /* IP1001 APS Mode  bit */
 #define IP101A_G_APS_ON                        2       /* IP101A/G APS Mode bit */
 #define IP101A_G_IRQ_CONF_STATUS       0x11    /* Conf Info IRQ & Status Reg */
@@ -138,19 +139,24 @@ static int ip1001_config_init(struct phy_device *phydev)
        if (c < 0)
                return c;
 
-       /* INTR pin used: speed/link/duplex will cause an interrupt */
-       c = phy_write(phydev, IP101A_G_IRQ_CONF_STATUS, IP101A_G_IRQ_DEFAULT);
-       if (c < 0)
-               return c;
+       if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
+           (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
+           (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
+           (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
 
-       if (phydev->interface == PHY_INTERFACE_MODE_RGMII) {
-               /* Additional delay (2ns) used to adjust RX clock phase
-                * at RGMII interface */
                c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
                if (c < 0)
                        return c;
 
-               c |= IP1001_PHASE_SEL_MASK;
+               c &= ~(IP1001_RXPHASE_SEL | IP1001_TXPHASE_SEL);
+
+               if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+                       c |= (IP1001_RXPHASE_SEL | IP1001_TXPHASE_SEL);
+               else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
+                       c |= IP1001_RXPHASE_SEL;
+               else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
+                       c |= IP1001_TXPHASE_SEL;
+
                c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
                if (c < 0)
                        return c;
@@ -167,6 +173,11 @@ static int ip101a_g_config_init(struct phy_device *phydev)
        if (c < 0)
                return c;
 
+       /* INTR pin used: speed/link/duplex will cause an interrupt */
+       c = phy_write(phydev, IP101A_G_IRQ_CONF_STATUS, IP101A_G_IRQ_DEFAULT);
+       if (c < 0)
+               return c;
+
        /* Enable Auto Power Saving mode */
        c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
        c |= IP101A_G_APS_ON;
index 5d2a3f2158876bb39ffc02f2647a57676b1bb718..22dec9c7ef05d7480e87b575605e2240f4476a20 100644 (file)
@@ -353,15 +353,6 @@ static int m88e1111_config_init(struct phy_device *phydev)
        int err;
        int temp;
 
-       /* Enable Fiber/Copper auto selection */
-       temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
-       temp &= ~MII_M1111_HWCFG_FIBER_COPPER_AUTO;
-       phy_write(phydev, MII_M1111_PHY_EXT_SR, temp);
-
-       temp = phy_read(phydev, MII_BMCR);
-       temp |= BMCR_RESET;
-       phy_write(phydev, MII_BMCR, temp);
-
        if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
            (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
            (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
index af372d0957fe3c6c7bc47e12df7d2c1e827c7f20..cc09b67c23bcd30402d73a93594f7aef9cb100da 100644 (file)
@@ -109,11 +109,11 @@ struct tap_filter {
        unsigned char   addr[FLT_EXACT_COUNT][ETH_ALEN];
 };
 
-/* 1024 is probably a high enough limit: modern hypervisors seem to support on
- * the order of 100-200 CPUs so this leaves us some breathing space if we want
- * to match a queue per guest CPU.
- */
-#define MAX_TAP_QUEUES 1024
+/* DEFAULT_MAX_NUM_RSS_QUEUES were choosed to let the rx/tx queues allocated for
+ * the netdevice to be fit in one page. So we can make sure the success of
+ * memory allocation. TODO: increase the limit. */
+#define MAX_TAP_QUEUES DEFAULT_MAX_NUM_RSS_QUEUES
+#define MAX_TAP_FLOWS  4096
 
 #define TUN_FLOW_EXPIRE (3 * HZ)
 
@@ -185,6 +185,8 @@ struct tun_struct {
        unsigned long ageing_time;
        unsigned int numdisabled;
        struct list_head disabled;
+       void *security;
+       u32 flow_count;
 };
 
 static inline u32 tun_hashfn(u32 rxhash)
@@ -218,6 +220,7 @@ static struct tun_flow_entry *tun_flow_create(struct tun_struct *tun,
                e->queue_index = queue_index;
                e->tun = tun;
                hlist_add_head_rcu(&e->hash_link, head);
+               ++tun->flow_count;
        }
        return e;
 }
@@ -228,6 +231,7 @@ static void tun_flow_delete(struct tun_struct *tun, struct tun_flow_entry *e)
                  e->rxhash, e->queue_index);
        hlist_del_rcu(&e->hash_link);
        kfree_rcu(e, rcu);
+       --tun->flow_count;
 }
 
 static void tun_flow_flush(struct tun_struct *tun)
@@ -317,7 +321,8 @@ static void tun_flow_update(struct tun_struct *tun, u32 rxhash,
                e->updated = jiffies;
        } else {
                spin_lock_bh(&tun->lock);
-               if (!tun_flow_find(head, rxhash))
+               if (!tun_flow_find(head, rxhash) &&
+                   tun->flow_count < MAX_TAP_FLOWS)
                        tun_flow_create(tun, head, rxhash, queue_index);
 
                if (!timer_pending(&tun->flow_gc_timer))
@@ -490,6 +495,10 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
        struct tun_file *tfile = file->private_data;
        int err;
 
+       err = security_tun_dev_attach(tfile->socket.sk, tun->security);
+       if (err < 0)
+               goto out;
+
        err = -EINVAL;
        if (rtnl_dereference(tfile->tun))
                goto out;
@@ -1373,6 +1382,7 @@ static void tun_free_netdev(struct net_device *dev)
 
        BUG_ON(!(list_empty(&tun->disabled)));
        tun_flow_uninit(tun);
+       security_tun_dev_free_security(tun->security);
        free_netdev(dev);
 }
 
@@ -1562,7 +1572,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 
                if (tun_not_capable(tun))
                        return -EPERM;
-               err = security_tun_dev_attach(tfile->socket.sk);
+               err = security_tun_dev_open(tun->security);
                if (err < 0)
                        return err;
 
@@ -1577,6 +1587,8 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
        else {
                char *name;
                unsigned long flags = 0;
+               int queues = ifr->ifr_flags & IFF_MULTI_QUEUE ?
+                            MAX_TAP_QUEUES : 1;
 
                if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
                        return -EPERM;
@@ -1600,8 +1612,8 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
                        name = ifr->ifr_name;
 
                dev = alloc_netdev_mqs(sizeof(struct tun_struct), name,
-                                      tun_setup,
-                                      MAX_TAP_QUEUES, MAX_TAP_QUEUES);
+                                      tun_setup, queues, queues);
+
                if (!dev)
                        return -ENOMEM;
 
@@ -1619,7 +1631,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 
                spin_lock_init(&tun->lock);
 
-               security_tun_dev_post_create(&tfile->sk);
+               err = security_tun_dev_alloc_security(&tun->security);
+               if (err < 0)
+                       goto err_free_dev;
 
                tun_net_init(dev);
 
@@ -1789,10 +1803,14 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr)
 
        if (ifr->ifr_flags & IFF_ATTACH_QUEUE) {
                tun = tfile->detached;
-               if (!tun)
+               if (!tun) {
                        ret = -EINVAL;
-               else
-                       ret = tun_attach(tun, file);
+                       goto unlock;
+               }
+               ret = security_tun_dev_attach_queue(tun->security);
+               if (ret < 0)
+                       goto unlock;
+               ret = tun_attach(tun, file);
        } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) {
                tun = rtnl_dereference(tfile->tun);
                if (!tun || !(tun->flags & TUN_TAP_MQ))
@@ -1802,6 +1820,7 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr)
        } else
                ret = -EINVAL;
 
+unlock:
        rtnl_unlock();
        return ret;
 }
index 42f51c71ec1fc7444c668153bdaa200a2b0f4315..248d2dc765a5c06c64ab3c27c47f38d36bf14c20 100644 (file)
@@ -374,6 +374,21 @@ static const struct driver_info cdc_mbim_info = {
        .tx_fixup = cdc_mbim_tx_fixup,
 };
 
+/* MBIM and NCM devices should not need a ZLP after NTBs with
+ * dwNtbOutMaxSize length. This driver_info is for the exceptional
+ * devices requiring it anyway, allowing them to be supported without
+ * forcing the performance penalty on all the sane devices.
+ */
+static const struct driver_info cdc_mbim_info_zlp = {
+       .description = "CDC MBIM",
+       .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_WWAN | FLAG_SEND_ZLP,
+       .bind = cdc_mbim_bind,
+       .unbind = cdc_mbim_unbind,
+       .manage_power = cdc_mbim_manage_power,
+       .rx_fixup = cdc_mbim_rx_fixup,
+       .tx_fixup = cdc_mbim_tx_fixup,
+};
+
 static const struct usb_device_id mbim_devs[] = {
        /* This duplicate NCM entry is intentional. MBIM devices can
         * be disguised as NCM by default, and this is necessary to
@@ -385,6 +400,10 @@ static const struct usb_device_id mbim_devs[] = {
        { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
          .driver_info = (unsigned long)&cdc_mbim_info,
        },
+       /* Sierra Wireless MC7710 need ZLPs */
+       { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x68a2, USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
+         .driver_info = (unsigned long)&cdc_mbim_info_zlp,
+       },
        { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MBIM, USB_CDC_PROTO_NONE),
          .driver_info = (unsigned long)&cdc_mbim_info,
        },
index 71b6e92b8e9b687c70d0eda9416f1e235a788747..9197b2c72ca36dd9e62bbccafbea388d5fc99793 100644 (file)
@@ -435,6 +435,13 @@ advance:
                len -= temp;
        }
 
+       /* some buggy devices have an IAD but no CDC Union */
+       if (!ctx->union_desc && intf->intf_assoc && intf->intf_assoc->bInterfaceCount == 2) {
+               ctx->control = intf;
+               ctx->data = usb_ifnum_to_if(dev->udev, intf->cur_altsetting->desc.bInterfaceNumber + 1);
+               dev_dbg(&intf->dev, "CDC Union missing - got slave from IAD\n");
+       }
+
        /* check if we got everything */
        if ((ctx->control == NULL) || (ctx->data == NULL) ||
            ((!ctx->mbim_desc) && ((ctx->ether_desc == NULL) || (ctx->control != intf))))
@@ -497,7 +504,8 @@ advance:
 error2:
        usb_set_intfdata(ctx->control, NULL);
        usb_set_intfdata(ctx->data, NULL);
-       usb_driver_release_interface(driver, ctx->data);
+       if (ctx->data != ctx->control)
+               usb_driver_release_interface(driver, ctx->data);
 error:
        cdc_ncm_free((struct cdc_ncm_ctx *)dev->data[0]);
        dev->data[0] = 0;
@@ -1155,6 +1163,20 @@ static const struct driver_info wwan_info = {
        .tx_fixup = cdc_ncm_tx_fixup,
 };
 
+/* Same as wwan_info, but with FLAG_NOARP  */
+static const struct driver_info wwan_noarp_info = {
+       .description = "Mobile Broadband Network Device (NO ARP)",
+       .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET
+                       | FLAG_WWAN | FLAG_NOARP,
+       .bind = cdc_ncm_bind,
+       .unbind = cdc_ncm_unbind,
+       .check_connect = cdc_ncm_check_connect,
+       .manage_power = usbnet_manage_power,
+       .status = cdc_ncm_status,
+       .rx_fixup = cdc_ncm_rx_fixup,
+       .tx_fixup = cdc_ncm_tx_fixup,
+};
+
 static const struct usb_device_id cdc_devs[] = {
        /* Ericsson MBM devices like F5521gw */
        { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
@@ -1194,6 +1216,13 @@ static const struct usb_device_id cdc_devs[] = {
          .driver_info = (unsigned long)&wwan_info,
        },
 
+       /* Infineon(now Intel) HSPA Modem platform */
+       { USB_DEVICE_AND_INTERFACE_INFO(0x1519, 0x0443,
+               USB_CLASS_COMM,
+               USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
+         .driver_info = (unsigned long)&wwan_noarp_info,
+       },
+
        /* Generic CDC-NCM devices */
        { USB_INTERFACE_INFO(USB_CLASS_COMM,
                USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
index 3f554c1149f36d2cf3221ee38e4f02507d566ba7..d7e99445518eb5981d064a7378d7fcf02e4bf5cd 100644 (file)
 #define DM_MCAST_ADDR  0x16    /* 8 bytes */
 #define DM_GPR_CTRL    0x1e
 #define DM_GPR_DATA    0x1f
+#define DM_CHIP_ID     0x2c
+#define DM_MODE_CTRL   0x91    /* only on dm9620 */
+
+/* chip id values */
+#define ID_DM9601      0
+#define ID_DM9620      1
 
 #define DM_MAX_MCAST   64
 #define DM_MCAST_SIZE  8
@@ -53,7 +59,6 @@
 #define DM_RX_OVERHEAD 7       /* 3 byte header + 4 byte crc tail */
 #define DM_TIMEOUT     1000
 
-
 static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data)
 {
        int err;
@@ -84,32 +89,23 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)
 
 static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value)
 {
-       return usbnet_write_cmd(dev, DM_WRITE_REGS,
+       return usbnet_write_cmd(dev, DM_WRITE_REG,
                                USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                                value, reg, NULL, 0);
 }
 
-static void dm_write_async_helper(struct usbnet *dev, u8 reg, u8 value,
-                                 u16 length, void *data)
+static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
 {
        usbnet_write_cmd_async(dev, DM_WRITE_REGS,
                               USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-                              value, reg, data, length);
-}
-
-static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
-{
-       netdev_dbg(dev->net, "dm_write_async() reg=0x%02x length=%d\n", reg, length);
-
-       dm_write_async_helper(dev, reg, 0, length, data);
+                              0, reg, data, length);
 }
 
 static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
 {
-       netdev_dbg(dev->net, "dm_write_reg_async() reg=0x%02x value=0x%02x\n",
-                  reg, value);
-
-       dm_write_async_helper(dev, reg, value, 0, NULL);
+       usbnet_write_cmd_async(dev, DM_WRITE_REG,
+                              USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+                              value, reg, NULL, 0);
 }
 
 static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *value)
@@ -358,7 +354,7 @@ static const struct net_device_ops dm9601_netdev_ops = {
 static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
 {
        int ret;
-       u8 mac[ETH_ALEN];
+       u8 mac[ETH_ALEN], id;
 
        ret = usbnet_get_endpoints(dev, intf);
        if (ret)
@@ -399,6 +395,24 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
                __dm9601_set_mac_address(dev);
        }
 
+       if (dm_read_reg(dev, DM_CHIP_ID, &id) < 0) {
+               netdev_err(dev->net, "Error reading chip ID\n");
+               ret = -ENODEV;
+               goto out;
+       }
+
+       /* put dm9620 devices in dm9601 mode */
+       if (id == ID_DM9620) {
+               u8 mode;
+
+               if (dm_read_reg(dev, DM_MODE_CTRL, &mode) < 0) {
+                       netdev_err(dev->net, "Error reading MODE_CTRL\n");
+                       ret = -ENODEV;
+                       goto out;
+               }
+               dm_write_reg(dev, DM_MODE_CTRL, mode & 0x7f);
+       }
+
        /* power up phy */
        dm_write_reg(dev, DM_GPR_CTRL, 1);
        dm_write_reg(dev, DM_GPR_DATA, 0);
@@ -581,6 +595,10 @@ static const struct usb_device_id products[] = {
         USB_DEVICE(0x0a46, 0x9000),    /* DM9000E */
         .driver_info = (unsigned long)&dm9601_info,
         },
+       {
+        USB_DEVICE(0x0a46, 0x9620),    /* DM9620 USB to Fast Ethernet Adapter */
+        .driver_info = (unsigned long)&dm9601_info,
+        },
        {},                     // END
 };
 
index 6a1ca500e61267e9ba8858d3ed7405990b28e43d..575a5839ee3458434d355677d785589d3472395d 100644 (file)
@@ -433,6 +433,7 @@ static const struct usb_device_id products[] = {
        {QMI_FIXED_INTF(0x19d2, 0x0199, 1)},    /* ZTE MF820S */
        {QMI_FIXED_INTF(0x19d2, 0x0200, 1)},
        {QMI_FIXED_INTF(0x19d2, 0x0257, 3)},    /* ZTE MF821 */
+       {QMI_FIXED_INTF(0x19d2, 0x0265, 4)},    /* ONDA MT8205 4G LTE */
        {QMI_FIXED_INTF(0x19d2, 0x0284, 4)},    /* ZTE MF880 */
        {QMI_FIXED_INTF(0x19d2, 0x0326, 4)},    /* ZTE MF821D */
        {QMI_FIXED_INTF(0x19d2, 0x1008, 4)},    /* ZTE (Vodafone) K3570-Z */
@@ -459,6 +460,7 @@ static const struct usb_device_id products[] = {
        {QMI_FIXED_INTF(0x1199, 0x68a2, 19)},   /* Sierra Wireless MC7710 in QMI mode */
        {QMI_FIXED_INTF(0x1199, 0x901c, 8)},    /* Sierra Wireless EM7700 */
        {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)},    /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
+       {QMI_FIXED_INTF(0x2357, 0x0201, 4)},    /* TP-LINK HSUPA Modem MA180 */
 
        /* 4. Gobi 1000 devices */
        {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)},    /* Acer Gobi Modem Device */
index 3d4bf01641b49f0f7c5d820a547885806378c4e2..f34b2ebee815ff6b832ef280e26ce7039ef6bfd6 100644 (file)
@@ -1448,6 +1448,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
                if ((dev->driver_info->flags & FLAG_WWAN) != 0)
                        strcpy(net->name, "wwan%d");
 
+               /* devices that cannot do ARP */
+               if ((dev->driver_info->flags & FLAG_NOARP) != 0)
+                       net->flags |= IFF_NOARP;
+
                /* maybe the remote can't receive an Ethernet MTU */
                if (net->mtu > (dev->hard_mtu - net->hard_header_len))
                        net->mtu = dev->hard_mtu - net->hard_header_len;
index a6fcf15adc4ff3d36d928f44cc0ac1f49d249820..35c00c5ea02adcbdf6f2855b7ee506544944843a 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/scatterlist.h>
 #include <linux/if_vlan.h>
 #include <linux/slab.h>
+#include <linux/cpu.h>
 
 static int napi_weight = 128;
 module_param(napi_weight, int, 0444);
@@ -123,6 +124,12 @@ struct virtnet_info {
 
        /* Does the affinity hint is set for virtqueues? */
        bool affinity_hint_set;
+
+       /* Per-cpu variable to show the mapping from CPU to virtqueue */
+       int __percpu *vq_index;
+
+       /* CPU hot plug notifier */
+       struct notifier_block nb;
 };
 
 struct skb_vnet_hdr {
@@ -1013,32 +1020,75 @@ static int virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid)
        return 0;
 }
 
-static void virtnet_set_affinity(struct virtnet_info *vi, bool set)
+static void virtnet_clean_affinity(struct virtnet_info *vi, long hcpu)
 {
        int i;
+       int cpu;
+
+       if (vi->affinity_hint_set) {
+               for (i = 0; i < vi->max_queue_pairs; i++) {
+                       virtqueue_set_affinity(vi->rq[i].vq, -1);
+                       virtqueue_set_affinity(vi->sq[i].vq, -1);
+               }
+
+               vi->affinity_hint_set = false;
+       }
+
+       i = 0;
+       for_each_online_cpu(cpu) {
+               if (cpu == hcpu) {
+                       *per_cpu_ptr(vi->vq_index, cpu) = -1;
+               } else {
+                       *per_cpu_ptr(vi->vq_index, cpu) =
+                               ++i % vi->curr_queue_pairs;
+               }
+       }
+}
+
+static void virtnet_set_affinity(struct virtnet_info *vi)
+{
+       int i;
+       int cpu;
 
        /* In multiqueue mode, when the number of cpu is equal to the number of
         * queue pairs, we let the queue pairs to be private to one cpu by
         * setting the affinity hint to eliminate the contention.
         */
-       if ((vi->curr_queue_pairs == 1 ||
-            vi->max_queue_pairs != num_online_cpus()) && set) {
-               if (vi->affinity_hint_set)
-                       set = false;
-               else
-                       return;
+       if (vi->curr_queue_pairs == 1 ||
+           vi->max_queue_pairs != num_online_cpus()) {
+               virtnet_clean_affinity(vi, -1);
+               return;
        }
 
-       for (i = 0; i < vi->max_queue_pairs; i++) {
-               int cpu = set ? i : -1;
+       i = 0;
+       for_each_online_cpu(cpu) {
                virtqueue_set_affinity(vi->rq[i].vq, cpu);
                virtqueue_set_affinity(vi->sq[i].vq, cpu);
+               *per_cpu_ptr(vi->vq_index, cpu) = i;
+               i++;
        }
 
-       if (set)
-               vi->affinity_hint_set = true;
-       else
-               vi->affinity_hint_set = false;
+       vi->affinity_hint_set = true;
+}
+
+static int virtnet_cpu_callback(struct notifier_block *nfb,
+                               unsigned long action, void *hcpu)
+{
+       struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb);
+
+       switch(action & ~CPU_TASKS_FROZEN) {
+       case CPU_ONLINE:
+       case CPU_DOWN_FAILED:
+       case CPU_DEAD:
+               virtnet_set_affinity(vi);
+               break;
+       case CPU_DOWN_PREPARE:
+               virtnet_clean_affinity(vi, (long)hcpu);
+               break;
+       default:
+               break;
+       }
+       return NOTIFY_OK;
 }
 
 static void virtnet_get_ringparam(struct net_device *dev,
@@ -1082,13 +1132,15 @@ static int virtnet_set_channels(struct net_device *dev,
        if (queue_pairs > vi->max_queue_pairs)
                return -EINVAL;
 
+       get_online_cpus();
        err = virtnet_set_queues(vi, queue_pairs);
        if (!err) {
                netif_set_real_num_tx_queues(dev, queue_pairs);
                netif_set_real_num_rx_queues(dev, queue_pairs);
 
-               virtnet_set_affinity(vi, true);
+               virtnet_set_affinity(vi);
        }
+       put_online_cpus();
 
        return err;
 }
@@ -1127,12 +1179,19 @@ static int virtnet_change_mtu(struct net_device *dev, int new_mtu)
 
 /* To avoid contending a lock hold by a vcpu who would exit to host, select the
  * txq based on the processor id.
- * TODO: handle cpu hotplug.
  */
 static u16 virtnet_select_queue(struct net_device *dev, struct sk_buff *skb)
 {
-       int txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) :
-                 smp_processor_id();
+       int txq;
+       struct virtnet_info *vi = netdev_priv(dev);
+
+       if (skb_rx_queue_recorded(skb)) {
+               txq = skb_get_rx_queue(skb);
+       } else {
+               txq = *__this_cpu_ptr(vi->vq_index);
+               if (txq == -1)
+                       txq = 0;
+       }
 
        while (unlikely(txq >= dev->real_num_tx_queues))
                txq -= dev->real_num_tx_queues;
@@ -1248,7 +1307,7 @@ static void virtnet_del_vqs(struct virtnet_info *vi)
 {
        struct virtio_device *vdev = vi->vdev;
 
-       virtnet_set_affinity(vi, false);
+       virtnet_clean_affinity(vi, -1);
 
        vdev->config->del_vqs(vdev);
 
@@ -1371,7 +1430,10 @@ static int init_vqs(struct virtnet_info *vi)
        if (ret)
                goto err_free;
 
-       virtnet_set_affinity(vi, true);
+       get_online_cpus();
+       virtnet_set_affinity(vi);
+       put_online_cpus();
+
        return 0;
 
 err_free:
@@ -1453,6 +1515,10 @@ static int virtnet_probe(struct virtio_device *vdev)
        if (vi->stats == NULL)
                goto free;
 
+       vi->vq_index = alloc_percpu(int);
+       if (vi->vq_index == NULL)
+               goto free_stats;
+
        mutex_init(&vi->config_lock);
        vi->config_enable = true;
        INIT_WORK(&vi->config_work, virtnet_config_changed_work);
@@ -1476,7 +1542,7 @@ static int virtnet_probe(struct virtio_device *vdev)
        /* Allocate/initialize the rx/tx queues, and invoke find_vqs */
        err = init_vqs(vi);
        if (err)
-               goto free_stats;
+               goto free_index;
 
        netif_set_real_num_tx_queues(dev, 1);
        netif_set_real_num_rx_queues(dev, 1);
@@ -1499,6 +1565,13 @@ static int virtnet_probe(struct virtio_device *vdev)
                }
        }
 
+       vi->nb.notifier_call = &virtnet_cpu_callback;
+       err = register_hotcpu_notifier(&vi->nb);
+       if (err) {
+               pr_debug("virtio_net: registering cpu notifier failed\n");
+               goto free_recv_bufs;
+       }
+
        /* Assume link up if device can't report link status,
           otherwise get link status from config. */
        if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
@@ -1520,6 +1593,8 @@ free_recv_bufs:
 free_vqs:
        cancel_delayed_work_sync(&vi->refill);
        virtnet_del_vqs(vi);
+free_index:
+       free_percpu(vi->vq_index);
 free_stats:
        free_percpu(vi->stats);
 free:
@@ -1543,6 +1618,8 @@ static void virtnet_remove(struct virtio_device *vdev)
 {
        struct virtnet_info *vi = vdev->priv;
 
+       unregister_hotcpu_notifier(&vi->nb);
+
        /* Prevent config work handler from accessing the device. */
        mutex_lock(&vi->config_lock);
        vi->config_enable = false;
@@ -1554,6 +1631,7 @@ static void virtnet_remove(struct virtio_device *vdev)
 
        flush_work(&vi->config_work);
 
+       free_percpu(vi->vq_index);
        free_percpu(vi->stats);
        free_netdev(vi->dev);
 }
index 8b0d8dcd76255239e7451b4a1258adca79ef8342..56317b0fb6b692f3f9ae20b8ba681ec18371788f 100644 (file)
@@ -976,6 +976,8 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
                                          AR_PHY_CL_TAB_1,
                                          AR_PHY_CL_TAB_2 };
 
+       ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask);
+
        if (rtt) {
                if (!ar9003_hw_rtt_restore(ah, chan))
                        run_rtt_cal = true;
index ce19c09fa8e84aec2877e2f14861b0284f4d958e..3afc24bde6d65d88a0d469abb0ef73d93856edcb 100644 (file)
@@ -586,32 +586,19 @@ static void ar9003_hw_init_bb(struct ath_hw *ah,
        ath9k_hw_synth_delay(ah, chan, synthDelay);
 }
 
-static void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx)
+void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx)
 {
-       switch (rx) {
-       case 0x5:
+       if (ah->caps.tx_chainmask == 5 || ah->caps.rx_chainmask == 5)
                REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP,
                            AR_PHY_SWAP_ALT_CHAIN);
-       case 0x3:
-       case 0x1:
-       case 0x2:
-       case 0x7:
-               REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx);
-               REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx);
-               break;
-       default:
-               break;
-       }
+
+       REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx);
+       REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx);
 
        if ((ah->caps.hw_caps & ATH9K_HW_CAP_APM) && (tx == 0x7))
-               REG_WRITE(ah, AR_SELFGEN_MASK, 0x3);
-       else
-               REG_WRITE(ah, AR_SELFGEN_MASK, tx);
+               tx = 3;
 
-       if (tx == 0x5) {
-               REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP,
-                           AR_PHY_SWAP_ALT_CHAIN);
-       }
+       REG_WRITE(ah, AR_SELFGEN_MASK, tx);
 }
 
 /*
index 86e26a19efdac1923395543c1a50fb53a6cb8958..42794c546a4068ac91b47c1252153b9040362555 100644 (file)
@@ -317,7 +317,6 @@ struct ath_rx {
        u32 *rxlink;
        u32 num_pkts;
        unsigned int rxfilter;
-       spinlock_t rxbuflock;
        struct list_head rxbuf;
        struct ath_descdma rxdma;
        struct ath_buf *rx_bufptr;
@@ -328,7 +327,6 @@ struct ath_rx {
 
 int ath_startrecv(struct ath_softc *sc);
 bool ath_stoprecv(struct ath_softc *sc);
-void ath_flushrecv(struct ath_softc *sc);
 u32 ath_calcrxfilter(struct ath_softc *sc);
 int ath_rx_init(struct ath_softc *sc, int nbufs);
 void ath_rx_cleanup(struct ath_softc *sc);
@@ -646,7 +644,6 @@ void ath_ant_comb_update(struct ath_softc *sc);
 enum sc_op_flags {
        SC_OP_INVALID,
        SC_OP_BEACONS,
-       SC_OP_RXFLUSH,
        SC_OP_ANI_RUN,
        SC_OP_PRIM_STA_VIF,
        SC_OP_HW_RESET,
index 531fffd801a34eaa11b8d483aca51ac07e7a7fab..2ca355e94da65467e36595990423c80be1b897b6 100644 (file)
@@ -147,6 +147,7 @@ static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw,
                                 skb->len, DMA_TO_DEVICE);
                dev_kfree_skb_any(skb);
                bf->bf_buf_addr = 0;
+               bf->bf_mpdu = NULL;
        }
 
        skb = ieee80211_beacon_get(hw, vif);
@@ -359,7 +360,6 @@ void ath9k_beacon_tasklet(unsigned long data)
                return;
 
        bf = ath9k_beacon_generate(sc->hw, vif);
-       WARN_ON(!bf);
 
        if (sc->beacon.bmisscnt != 0) {
                ath_dbg(common, BSTUCK, "resume beacon xmit after %u misses\n",
index 13ff9edc24015e5e2126fc4f6c7fde8dcb003c90..e585fc827c50b2e9d5ff2fe08afb15cd49cedba6 100644 (file)
@@ -861,7 +861,6 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
        RXS_ERR("RX-LENGTH-ERR", rx_len_err);
        RXS_ERR("RX-OOM-ERR", rx_oom_err);
        RXS_ERR("RX-RATE-ERR", rx_rate_err);
-       RXS_ERR("RX-DROP-RXFLUSH", rx_drop_rxflush);
        RXS_ERR("RX-TOO-MANY-FRAGS", rx_too_many_frags_err);
 
        PHY_ERR("UNDERRUN ERR", ATH9K_PHYERR_UNDERRUN);
index 375c3b46411eee6cd140dbc22e6e435fe0e32ad9..6df2ab62dcb706df5bef4a8afdf04593651f111a 100644 (file)
@@ -216,7 +216,6 @@ struct ath_tx_stats {
  * @rx_oom_err:  No. of frames dropped due to OOM issues.
  * @rx_rate_err:  No. of frames dropped due to rate errors.
  * @rx_too_many_frags_err:  Frames dropped due to too-many-frags received.
- * @rx_drop_rxflush: No. of frames dropped due to RX-FLUSH.
  * @rx_beacons:  No. of beacons received.
  * @rx_frags:  No. of rx-fragements received.
  */
@@ -235,7 +234,6 @@ struct ath_rx_stats {
        u32 rx_oom_err;
        u32 rx_rate_err;
        u32 rx_too_many_frags_err;
-       u32 rx_drop_rxflush;
        u32 rx_beacons;
        u32 rx_frags;
 };
index 4a9570dfba72605d2f492ddf51cde8e8e7db835b..aac4a406a5134727e49fef2999e563e39169d83f 100644 (file)
@@ -344,6 +344,8 @@ void ath9k_htc_txcompletion_cb(struct htc_target *htc_handle,
                        endpoint->ep_callbacks.tx(endpoint->ep_callbacks.priv,
                                                  skb, htc_hdr->endpoint_id,
                                                  txok);
+               } else {
+                       kfree_skb(skb);
                }
        }
 
index 7f1a8e91c908c2dea314a7171e1d1d59139e6c6a..9d26fc56ca56a6bf7d4e8ac0ed91366df0de50cd 100644 (file)
@@ -1066,6 +1066,7 @@ void ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain);
 int ar9003_paprd_init_table(struct ath_hw *ah);
 bool ar9003_paprd_is_done(struct ath_hw *ah);
 bool ar9003_is_paprd_enabled(struct ath_hw *ah);
+void ar9003_hw_set_chain_masks(struct ath_hw *ah, u8 rx, u8 tx);
 
 /* Hardware family op attach helpers */
 void ar5008_hw_attach_phy_ops(struct ath_hw *ah);
index be30a9af152884d8e073b7a3be5b79e6b3d5a8ee..dd91f8fdc01c3ea44c922bbbbd14bee2df4fd6db 100644 (file)
@@ -182,7 +182,7 @@ static void ath_restart_work(struct ath_softc *sc)
        ath_start_ani(sc);
 }
 
-static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush)
+static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx)
 {
        struct ath_hw *ah = sc->sc_ah;
        bool ret = true;
@@ -202,14 +202,6 @@ static bool ath_prepare_reset(struct ath_softc *sc, bool retry_tx, bool flush)
        if (!ath_drain_all_txq(sc, retry_tx))
                ret = false;
 
-       if (!flush) {
-               if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
-                       ath_rx_tasklet(sc, 1, true);
-               ath_rx_tasklet(sc, 1, false);
-       } else {
-               ath_flushrecv(sc);
-       }
-
        return ret;
 }
 
@@ -262,11 +254,11 @@ static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan,
        struct ath_common *common = ath9k_hw_common(ah);
        struct ath9k_hw_cal_data *caldata = NULL;
        bool fastcc = true;
-       bool flush = false;
        int r;
 
        __ath_cancel_work(sc);
 
+       tasklet_disable(&sc->intr_tq);
        spin_lock_bh(&sc->sc_pcu_lock);
 
        if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) {
@@ -276,11 +268,10 @@ static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan,
 
        if (!hchan) {
                fastcc = false;
-               flush = true;
                hchan = ah->curchan;
        }
 
-       if (!ath_prepare_reset(sc, retry_tx, flush))
+       if (!ath_prepare_reset(sc, retry_tx))
                fastcc = false;
 
        ath_dbg(common, CONFIG, "Reset to %u MHz, HT40: %d fastcc: %d\n",
@@ -302,6 +293,8 @@ static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan,
 
 out:
        spin_unlock_bh(&sc->sc_pcu_lock);
+       tasklet_enable(&sc->intr_tq);
+
        return r;
 }
 
@@ -804,7 +797,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
                ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
        }
 
-       ath_prepare_reset(sc, false, true);
+       ath_prepare_reset(sc, false);
 
        if (sc->rx.frag) {
                dev_kfree_skb_any(sc->rx.frag);
@@ -1833,6 +1826,9 @@ static u32 fill_chainmask(u32 cap, u32 new)
 
 static bool validate_antenna_mask(struct ath_hw *ah, u32 val)
 {
+       if (AR_SREV_9300_20_OR_LATER(ah))
+               return true;
+
        switch (val & 0x7) {
        case 0x1:
        case 0x3:
index d4df98a938bf4755d1af6238d41e5df0753970c6..90752f2469704bbbb2bf7cae86a1c2cb4029435a 100644 (file)
@@ -254,8 +254,6 @@ rx_init_fail:
 
 static void ath_edma_start_recv(struct ath_softc *sc)
 {
-       spin_lock_bh(&sc->rx.rxbuflock);
-
        ath9k_hw_rxena(sc->sc_ah);
 
        ath_rx_addbuffer_edma(sc, ATH9K_RX_QUEUE_HP,
@@ -267,8 +265,6 @@ static void ath_edma_start_recv(struct ath_softc *sc)
        ath_opmode_init(sc);
 
        ath9k_hw_startpcureceive(sc->sc_ah, !!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL));
-
-       spin_unlock_bh(&sc->rx.rxbuflock);
 }
 
 static void ath_edma_stop_recv(struct ath_softc *sc)
@@ -285,8 +281,6 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
        int error = 0;
 
        spin_lock_init(&sc->sc_pcu_lock);
-       spin_lock_init(&sc->rx.rxbuflock);
-       clear_bit(SC_OP_RXFLUSH, &sc->sc_flags);
 
        common->rx_bufsize = IEEE80211_MAX_MPDU_LEN / 2 +
                             sc->sc_ah->caps.rx_status_len;
@@ -447,7 +441,6 @@ int ath_startrecv(struct ath_softc *sc)
                return 0;
        }
 
-       spin_lock_bh(&sc->rx.rxbuflock);
        if (list_empty(&sc->rx.rxbuf))
                goto start_recv;
 
@@ -468,26 +461,31 @@ start_recv:
        ath_opmode_init(sc);
        ath9k_hw_startpcureceive(ah, !!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL));
 
-       spin_unlock_bh(&sc->rx.rxbuflock);
-
        return 0;
 }
 
+static void ath_flushrecv(struct ath_softc *sc)
+{
+       if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
+               ath_rx_tasklet(sc, 1, true);
+       ath_rx_tasklet(sc, 1, false);
+}
+
 bool ath_stoprecv(struct ath_softc *sc)
 {
        struct ath_hw *ah = sc->sc_ah;
        bool stopped, reset = false;
 
-       spin_lock_bh(&sc->rx.rxbuflock);
        ath9k_hw_abortpcurecv(ah);
        ath9k_hw_setrxfilter(ah, 0);
        stopped = ath9k_hw_stopdmarecv(ah, &reset);
 
+       ath_flushrecv(sc);
+
        if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
                ath_edma_stop_recv(sc);
        else
                sc->rx.rxlink = NULL;
-       spin_unlock_bh(&sc->rx.rxbuflock);
 
        if (!(ah->ah_flags & AH_UNPLUGGED) &&
            unlikely(!stopped)) {
@@ -499,15 +497,6 @@ bool ath_stoprecv(struct ath_softc *sc)
        return stopped && !reset;
 }
 
-void ath_flushrecv(struct ath_softc *sc)
-{
-       set_bit(SC_OP_RXFLUSH, &sc->sc_flags);
-       if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
-               ath_rx_tasklet(sc, 1, true);
-       ath_rx_tasklet(sc, 1, false);
-       clear_bit(SC_OP_RXFLUSH, &sc->sc_flags);
-}
-
 static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb)
 {
        /* Check whether the Beacon frame has DTIM indicating buffered bc/mc */
@@ -744,6 +733,7 @@ static struct ath_buf *ath_get_next_rx_buf(struct ath_softc *sc,
                        return NULL;
        }
 
+       list_del(&bf->list);
        if (!bf->bf_mpdu)
                return bf;
 
@@ -1059,16 +1049,12 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
                dma_type = DMA_FROM_DEVICE;
 
        qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP;
-       spin_lock_bh(&sc->rx.rxbuflock);
 
        tsf = ath9k_hw_gettsf64(ah);
        tsf_lower = tsf & 0xffffffff;
 
        do {
                bool decrypt_error = false;
-               /* If handling rx interrupt and flush is in progress => exit */
-               if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags) && (flush == 0))
-                       break;
 
                memset(&rs, 0, sizeof(rs));
                if (edma)
@@ -1111,15 +1097,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
 
                ath_debug_stat_rx(sc, &rs);
 
-               /*
-                * If we're asked to flush receive queue, directly
-                * chain it back at the queue without processing it.
-                */
-               if (test_bit(SC_OP_RXFLUSH, &sc->sc_flags)) {
-                       RX_STAT_INC(rx_drop_rxflush);
-                       goto requeue_drop_frag;
-               }
-
                memset(rxs, 0, sizeof(struct ieee80211_rx_status));
 
                rxs->mactime = (tsf & ~0xffffffffULL) | rs.rs_tstamp;
@@ -1254,19 +1231,18 @@ requeue_drop_frag:
                        sc->rx.frag = NULL;
                }
 requeue:
+               list_add_tail(&bf->list, &sc->rx.rxbuf);
+               if (flush)
+                       continue;
+
                if (edma) {
-                       list_add_tail(&bf->list, &sc->rx.rxbuf);
                        ath_rx_edma_buf_link(sc, qtype);
                } else {
-                       list_move_tail(&bf->list, &sc->rx.rxbuf);
                        ath_rx_buf_link(sc, bf);
-                       if (!flush)
-                               ath9k_hw_rxena(ah);
+                       ath9k_hw_rxena(ah);
                }
        } while (1);
 
-       spin_unlock_bh(&sc->rx.rxbuflock);
-
        if (!(ah->imask & ATH9K_INT_RXEOL)) {
                ah->imask |= (ATH9K_INT_RXEOL | ATH9K_INT_RXORN);
                ath9k_hw_set_interrupts(ah);
index 1fbd8ecbe2ea293a28d6a65648fe011a2fff3fa6..0f71d1d4339dc38ccfdd89428fdc4a62bb5b7bd9 100644 (file)
@@ -1407,9 +1407,10 @@ void brcms_add_timer(struct brcms_timer *t, uint ms, int periodic)
 #endif
        t->ms = ms;
        t->periodic = (bool) periodic;
-       t->set = true;
-
-       atomic_inc(&t->wl->callbacks);
+       if (!t->set) {
+               t->set = true;
+               atomic_inc(&t->wl->callbacks);
+       }
 
        ieee80211_queue_delayed_work(hw, &t->dly_wrk, msecs_to_jiffies(ms));
 }
index 7e16d10a7f140e4bc0a1414af1ec317f7284b9c6..90b8970eadf0fa7c296be194c2d18ef9266b1043 100644 (file)
@@ -3958,17 +3958,21 @@ il_connection_init_rx_config(struct il_priv *il)
 
        memset(&il->staging, 0, sizeof(il->staging));
 
-       if (!il->vif) {
+       switch (il->iw_mode) {
+       case NL80211_IFTYPE_UNSPECIFIED:
                il->staging.dev_type = RXON_DEV_TYPE_ESS;
-       } else if (il->vif->type == NL80211_IFTYPE_STATION) {
+               break;
+       case NL80211_IFTYPE_STATION:
                il->staging.dev_type = RXON_DEV_TYPE_ESS;
                il->staging.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
-       } else if (il->vif->type == NL80211_IFTYPE_ADHOC) {
+               break;
+       case NL80211_IFTYPE_ADHOC:
                il->staging.dev_type = RXON_DEV_TYPE_IBSS;
                il->staging.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
                il->staging.filter_flags =
                    RXON_FILTER_BCON_AWARE_MSK | RXON_FILTER_ACCEPT_GRP_MSK;
-       } else {
+               break;
+       default:
                IL_ERR("Unsupported interface type %d\n", il->vif->type);
                return;
        }
@@ -4550,8 +4554,7 @@ out:
 EXPORT_SYMBOL(il_mac_add_interface);
 
 static void
-il_teardown_interface(struct il_priv *il, struct ieee80211_vif *vif,
-                     bool mode_change)
+il_teardown_interface(struct il_priv *il, struct ieee80211_vif *vif)
 {
        lockdep_assert_held(&il->mutex);
 
@@ -4560,9 +4563,7 @@ il_teardown_interface(struct il_priv *il, struct ieee80211_vif *vif,
                il_force_scan_end(il);
        }
 
-       if (!mode_change)
-               il_set_mode(il);
-
+       il_set_mode(il);
 }
 
 void
@@ -4575,8 +4576,8 @@ il_mac_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 
        WARN_ON(il->vif != vif);
        il->vif = NULL;
-
-       il_teardown_interface(il, vif, false);
+       il->iw_mode = NL80211_IFTYPE_UNSPECIFIED;
+       il_teardown_interface(il, vif);
        memset(il->bssid, 0, ETH_ALEN);
 
        D_MAC80211("leave\n");
@@ -4685,18 +4686,10 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        }
 
        /* success */
-       il_teardown_interface(il, vif, true);
        vif->type = newtype;
        vif->p2p = false;
-       err = il_set_mode(il);
-       WARN_ON(err);
-       /*
-        * We've switched internally, but submitting to the
-        * device may have failed for some reason. Mask this
-        * error, because otherwise mac80211 will not switch
-        * (and set the interface type back) and we'll be
-        * out of sync with it.
-        */
+       il->iw_mode = newtype;
+       il_teardown_interface(il, vif);
        err = 0;
 
 out:
index a790599fe2c219b63526a833c3db63ac09d84e84..31534f7c05488ba38d4c65c7ce0209a43712fd51 100644 (file)
@@ -1079,6 +1079,8 @@ static void iwlagn_set_tx_status(struct iwl_priv *priv,
 {
        u16 status = le16_to_cpu(tx_resp->status.status);
 
+       info->flags &= ~IEEE80211_TX_CTL_AMPDU;
+
        info->status.rates[0].count = tx_resp->failure_frame + 1;
        info->flags |= iwl_tx_status_to_mac80211(status);
        iwlagn_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags),
index efe525be27dd3607f63c76e49d089d5f7e34d0d5..cdb11b3964e27dd68de20ac68ab8442772a070a1 100644 (file)
@@ -1459,7 +1459,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
        struct cfg80211_ssid req_ssid;
        int ret, auth_type = 0;
        struct cfg80211_bss *bss = NULL;
-       u8 is_scanning_required = 0, config_bands = 0;
+       u8 is_scanning_required = 0;
 
        memset(&req_ssid, 0, sizeof(struct cfg80211_ssid));
 
@@ -1478,19 +1478,6 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
        /* disconnect before try to associate */
        mwifiex_deauthenticate(priv, NULL);
 
-       if (channel) {
-               if (mode == NL80211_IFTYPE_STATION) {
-                       if (channel->band == IEEE80211_BAND_2GHZ)
-                               config_bands = BAND_B | BAND_G | BAND_GN;
-                       else
-                               config_bands = BAND_A | BAND_AN;
-
-                       if (!((config_bands | priv->adapter->fw_bands) &
-                             ~priv->adapter->fw_bands))
-                               priv->adapter->config_bands = config_bands;
-               }
-       }
-
        /* As this is new association, clear locally stored
         * keys and security related flags */
        priv->sec_info.wpa_enabled = false;
@@ -1707,7 +1694,7 @@ static int mwifiex_set_ibss_params(struct mwifiex_private *priv,
 
                if (cfg80211_get_chandef_type(&params->chandef) !=
                                                NL80211_CHAN_NO_HT)
-                       config_bands |= BAND_GN;
+                       config_bands |= BAND_G | BAND_GN;
        } else {
                if (cfg80211_get_chandef_type(&params->chandef) ==
                                                NL80211_CHAN_NO_HT)
index 13fbc4eb15952fe375be1e10c55518bb2b6b3836..b879e1338a54f5347a7a5f0b955b98a3f3566b66 100644 (file)
@@ -161,7 +161,7 @@ static int mwifiex_pcie_suspend(struct pci_dev *pdev, pm_message_t state)
 
        if (pdev) {
                card = (struct pcie_service_card *) pci_get_drvdata(pdev);
-               if (!card || card->adapter) {
+               if (!card || !card->adapter) {
                        pr_err("Card or adapter structure is not valid\n");
                        return 0;
                }
index 60e88b58039de129f060160f9e18baa49fde0a3d..f542bb8ccbc8d4ce6859e8fff1e45784183f8fbb 100644 (file)
@@ -283,6 +283,20 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
                if (ret)
                        goto done;
 
+               if (bss_desc) {
+                       u8 config_bands = 0;
+
+                       if (mwifiex_band_to_radio_type((u8) bss_desc->bss_band)
+                           == HostCmd_SCAN_RADIO_TYPE_BG)
+                               config_bands = BAND_B | BAND_G | BAND_GN;
+                       else
+                               config_bands = BAND_A | BAND_AN;
+
+                       if (!((config_bands | adapter->fw_bands) &
+                             ~adapter->fw_bands))
+                               adapter->config_bands = config_bands;
+               }
+
                ret = mwifiex_check_network_compatibility(priv, bss_desc);
                if (ret)
                        goto done;
index 21b1bbb93a7e41452720a6f9ede17cba3951393e..b80bc4612581857455c2e076de835f66ac5be710 100644 (file)
@@ -57,12 +57,12 @@ config RTL8192CU
 
 config RTLWIFI
        tristate
-       depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE
+       depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE || RTL8723AE
        default m
 
 config RTLWIFI_DEBUG
        bool "Additional debugging output"
-       depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE
+       depends on RTL8192CE || RTL8192CU || RTL8192SE || RTL8192DE || RTL8723AE
        default y
 
 config RTL8192C_COMMON
index c31aeb01bb0002cc648b603c6c526ad83f9ab9a9..efaecefe3f8cc5fda8326c5dbd647e56076a4984 100644 (file)
@@ -181,7 +181,6 @@ config PINCTRL_COH901
 
 config PINCTRL_SAMSUNG
        bool
-       depends on OF && GPIOLIB
        select PINMUX
        select PINCONF
 
index 69aba3697287d02e749fc5c27155c026518601b7..428ea96a94d356a3caee8b971a1df51d8c9564c3 100644 (file)
@@ -588,7 +588,7 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
 {
        const struct of_device_id *match =
                of_match_device(dove_pinctrl_of_match, &pdev->dev);
-       pdev->dev.platform_data = match->data;
+       pdev->dev.platform_data = (void *)match->data;
 
        /*
         * General MPP Configuration Register is part of pdma registers.
index f12084e180579afe19cb3914ff8d4e4db7573eed..cdd483df673eaf5d38d522ba3e8f5ef26f835c3c 100644 (file)
@@ -66,9 +66,9 @@ static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
                MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0)),
                MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1, 0))),
        MPP_MODE(6,
-               MPP_VAR_FUNCTION(0x0, "sysrst", "out",   V(1, 1, 1, 1, 1, 1)),
-               MPP_VAR_FUNCTION(0x1, "spi", "mosi",     V(1, 1, 1, 1, 1, 1)),
-               MPP_VAR_FUNCTION(0x2, "ptp", "trig",     V(1, 1, 1, 1, 0, 0))),
+               MPP_VAR_FUNCTION(0x1, "sysrst", "out",   V(1, 1, 1, 1, 1, 1)),
+               MPP_VAR_FUNCTION(0x2, "spi", "mosi",     V(1, 1, 1, 1, 1, 1)),
+               MPP_VAR_FUNCTION(0x3, "ptp", "trig",     V(1, 1, 1, 1, 0, 0))),
        MPP_MODE(7,
                MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
                MPP_VAR_FUNCTION(0x1, "pex", "rsto",     V(1, 1, 1, 1, 0, 1)),
@@ -458,7 +458,7 @@ static int kirkwood_pinctrl_probe(struct platform_device *pdev)
 {
        const struct of_device_id *match =
                of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
-       pdev->dev.platform_data = match->data;
+       pdev->dev.platform_data = (void *)match->data;
        return mvebu_pinctrl_probe(pdev);
 }
 
index de05b64f0da695708f2c5ef201c5438c96946d88..142729914c347fc305e32449c11f637a44ad654f 100644 (file)
@@ -599,7 +599,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse
 }
 
 /* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */
-static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,
+static int exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,
                        struct device_node *cfg_np, unsigned int **pin_list,
                        unsigned int *npins)
 {
@@ -630,7 +630,7 @@ static int __init exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,
  * Parse the information about all the available pin groups and pin functions
  * from device node of the pin-controller.
  */
-static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
+static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
                                struct exynos5440_pinctrl_priv_data *priv)
 {
        struct device *dev = &pdev->dev;
@@ -723,7 +723,7 @@ static int __init exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
 }
 
 /* register the pinctrl interface with the pinctrl subsystem */
-static int __init exynos5440_pinctrl_register(struct platform_device *pdev,
+static int exynos5440_pinctrl_register(struct platform_device *pdev,
                                struct exynos5440_pinctrl_priv_data *priv)
 {
        struct device *dev = &pdev->dev;
@@ -798,7 +798,7 @@ static int __init exynos5440_pinctrl_register(struct platform_device *pdev,
 }
 
 /* register the gpiolib interface with the gpiolib subsystem */
-static int __init exynos5440_gpiolib_register(struct platform_device *pdev,
+static int exynos5440_gpiolib_register(struct platform_device *pdev,
                                struct exynos5440_pinctrl_priv_data *priv)
 {
        struct gpio_chip *gc;
@@ -831,7 +831,7 @@ static int __init exynos5440_gpiolib_register(struct platform_device *pdev,
 }
 
 /* unregister the gpiolib interface with the gpiolib subsystem */
-static int __init exynos5440_gpiolib_unregister(struct platform_device *pdev,
+static int exynos5440_gpiolib_unregister(struct platform_device *pdev,
                                struct exynos5440_pinctrl_priv_data *priv)
 {
        int ret = gpiochip_remove(priv->gc);
index dd227d21dcf28563c1d0902d51fa8a3b8140aeed..23af9f1f9c35e6d9d7793075ad7ec2df92070043 100644 (file)
@@ -146,7 +146,7 @@ free:
 static void mxs_dt_free_map(struct pinctrl_dev *pctldev,
                            struct pinctrl_map *map, unsigned num_maps)
 {
-       int i;
+       u32 i;
 
        for (i = 0; i < num_maps; i++) {
                if (map[i].type == PIN_MAP_TYPE_MUX_GROUP)
@@ -203,7 +203,7 @@ static int mxs_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned selector,
        void __iomem *reg;
        u8 bank, shift;
        u16 pin;
-       int i;
+       u32 i;
 
        for (i = 0; i < g->npins; i++) {
                bank = PINID_TO_BANK(g->pins[i]);
@@ -256,7 +256,7 @@ static int mxs_pinconf_group_set(struct pinctrl_dev *pctldev,
        void __iomem *reg;
        u8 ma, vol, pull, bank, shift;
        u16 pin;
-       int i;
+       u32 i;
 
        ma = CONFIG_TO_MA(config);
        vol = CONFIG_TO_VOL(config);
@@ -345,8 +345,7 @@ static int mxs_pinctrl_parse_group(struct platform_device *pdev,
        const char *propname = "fsl,pinmux-ids";
        char *group;
        int length = strlen(np->name) + SUFFIX_LEN;
-       int i;
-       u32 val;
+       u32 val, i;
 
        group = devm_kzalloc(&pdev->dev, length, GFP_KERNEL);
        if (!group)
index 1bb16ffb4e41a9d0f252fc8a563188f97f343642..5767b18ebdff6d1639bd37c6007f9c93553a3f58 100644 (file)
@@ -676,7 +676,7 @@ int nmk_gpio_set_mode(int gpio, int gpio_mode)
 }
 EXPORT_SYMBOL(nmk_gpio_set_mode);
 
-static int nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio)
+static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio)
 {
        int i;
        u16 reg;
index f6a360b86eb6465fef029e777147ccbd3bc95b66..5c32e880bcb24315b4b2db260294106765eb4240 100644 (file)
@@ -30,7 +30,6 @@
 #define PCS_MUX_BITS_NAME              "pinctrl-single,bits"
 #define PCS_REG_NAME_LEN               ((sizeof(unsigned long) * 2) + 1)
 #define PCS_OFF_DISABLED               ~0U
-#define PCS_MAX_GPIO_VALUES            2
 
 /**
  * struct pcs_pingroup - pingroups for a function
@@ -77,16 +76,6 @@ struct pcs_function {
        struct list_head node;
 };
 
-/**
- * struct pcs_gpio_range - pinctrl gpio range
- * @range:     subrange of the GPIO number space
- * @gpio_func: gpio function value in the pinmux register
- */
-struct pcs_gpio_range {
-       struct pinctrl_gpio_range range;
-       int gpio_func;
-};
-
 /**
  * struct pcs_data - wrapper for data needed by pinctrl framework
  * @pa:                pindesc array
@@ -414,26 +403,9 @@ static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector,
 }
 
 static int pcs_request_gpio(struct pinctrl_dev *pctldev,
-                           struct pinctrl_gpio_range *range, unsigned pin)
+                       struct pinctrl_gpio_range *range, unsigned offset)
 {
-       struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
-       struct pcs_gpio_range *gpio = NULL;
-       int end, mux_bytes;
-       unsigned data;
-
-       gpio = container_of(range, struct pcs_gpio_range, range);
-       end = range->pin_base + range->npins - 1;
-       if (pin < range->pin_base || pin > end) {
-               dev_err(pctldev->dev,
-                       "pin %d isn't in the range of %d to %d\n",
-                       pin, range->pin_base, end);
-               return -EINVAL;
-       }
-       mux_bytes = pcs->width / BITS_PER_BYTE;
-       data = pcs->read(pcs->base + pin * mux_bytes) & ~pcs->fmask;
-       data |= gpio->gpio_func;
-       pcs->write(data, pcs->base + pin * mux_bytes);
-       return 0;
+       return -ENOTSUPP;
 }
 
 static struct pinmux_ops pcs_pinmux_ops = {
@@ -907,49 +879,6 @@ static void pcs_free_resources(struct pcs_device *pcs)
 
 static struct of_device_id pcs_of_match[];
 
-static int pcs_add_gpio_range(struct device_node *node, struct pcs_device *pcs)
-{
-       struct pcs_gpio_range *gpio;
-       struct device_node *child;
-       struct resource r;
-       const char name[] = "pinctrl-single";
-       u32 gpiores[PCS_MAX_GPIO_VALUES];
-       int ret, i = 0, mux_bytes = 0;
-
-       for_each_child_of_node(node, child) {
-               ret = of_address_to_resource(child, 0, &r);
-               if (ret < 0)
-                       continue;
-               memset(gpiores, 0, sizeof(u32) * PCS_MAX_GPIO_VALUES);
-               ret = of_property_read_u32_array(child, "pinctrl-single,gpio",
-                                                gpiores, PCS_MAX_GPIO_VALUES);
-               if (ret < 0)
-                       continue;
-               gpio = devm_kzalloc(pcs->dev, sizeof(*gpio), GFP_KERNEL);
-               if (!gpio) {
-                       dev_err(pcs->dev, "failed to allocate pcs gpio\n");
-                       return -ENOMEM;
-               }
-               gpio->range.name = devm_kzalloc(pcs->dev, sizeof(name),
-                                               GFP_KERNEL);
-               if (!gpio->range.name) {
-                       dev_err(pcs->dev, "failed to allocate range name\n");
-                       return -ENOMEM;
-               }
-               memcpy((char *)gpio->range.name, name, sizeof(name));
-
-               gpio->range.id = i++;
-               gpio->range.base = gpiores[0];
-               gpio->gpio_func = gpiores[1];
-               mux_bytes = pcs->width / BITS_PER_BYTE;
-               gpio->range.pin_base = (r.start - pcs->res->start) / mux_bytes;
-               gpio->range.npins = (r.end - r.start) / mux_bytes + 1;
-
-               pinctrl_add_gpio_range(pcs->pctl, &gpio->range);
-       }
-       return 0;
-}
-
 static int pcs_probe(struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
@@ -1046,10 +975,6 @@ static int pcs_probe(struct platform_device *pdev)
                goto free;
        }
 
-       ret = pcs_add_gpio_range(np, pcs);
-       if (ret < 0)
-               goto free;
-
        dev_info(pcs->dev, "%i pins at pa %p size %u\n",
                 pcs->desc.npins, pcs->base, pcs->size);
 
index 7481146a5b473c1cab6745a7d6ac1ae76e66257e..97c2be195efc36eeb76bd848f2c1327be7f168c2 100644 (file)
@@ -244,7 +244,7 @@ static int __init ibm_rtl_init(void) {
        if (force)
                pr_warn("module loaded by force\n");
        /* first ensure that we are running on IBM HW */
-       else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table))
+       else if (efi_enabled(EFI_BOOT) || !dmi_check_system(ibm_rtl_dmi_table))
                return -ENODEV;
 
        /* Get the address for the Extended BIOS Data Area */
index 71623a2ff3e87b0cffe3d5e85ae96480600a7e59..d1f0300531766f64ab741ccbd4d388db0644d427 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
 #include <linux/ctype.h>
+#include <linux/efi.h>
 #include <acpi/video.h>
 
 /*
@@ -1544,6 +1545,9 @@ static int __init samsung_init(void)
        struct samsung_laptop *samsung;
        int ret;
 
+       if (efi_enabled(EFI_BOOT))
+               return -ENODEV;
+
        quirks = &samsung_unknown;
        if (!force && !dmi_check_system(samsung_dmi_table))
                return -ENODEV;
index 261f3d2299bc0a5d2d074824211172be7a6b8448..89bd2faaef8cf627cddcd9f1b7a03c9b4cab5fae 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
+#include <linux/module.h>
 
 #include "dbx500-prcmu.h"
 
index b15d711bc8c66634c9792c26e15885e055aabe11..9019d0e7ecb6ad9868fa96e23fa0f77a1275fc75 100644 (file)
@@ -728,7 +728,7 @@ static int tps80031_regulator_probe(struct platform_device *pdev)
                        }
                }
                rdev = regulator_register(&ri->rinfo->desc, &config);
-               if (IS_ERR_OR_NULL(rdev)) {
+               if (IS_ERR(rdev)) {
                        dev_err(&pdev->dev,
                                "register regulator failed %s\n",
                                        ri->rinfo->desc.name);
index d73fdcfeb45a19e1695dc188b045e29c72e57557..2839baa82a5a458d0035d59e8a5666ac07690779 100644 (file)
@@ -633,7 +633,7 @@ static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                return -ENOMEM;
        pci_set_drvdata(pdev, pci_info);
 
-       if (efi_enabled)
+       if (efi_enabled(EFI_RUNTIME_SERVICES))
                orom = isci_get_efi_var(pdev);
 
        if (!orom)
index b906ed17a8391a99ffbc15d8ea62c6861be90689..9802de0f85e61fe061ea150d15177c39b4128ca3 100644 (file)
@@ -281,6 +281,7 @@ static void gdlm_put_lock(struct gfs2_glock *gl)
 {
        struct gfs2_sbd *sdp = gl->gl_sbd;
        struct lm_lockstruct *ls = &sdp->sd_lockstruct;
+       int lvb_needs_unlock = 0;
        int error;
 
        if (gl->gl_lksb.sb_lkid == 0) {
@@ -294,8 +295,12 @@ static void gdlm_put_lock(struct gfs2_glock *gl)
        gfs2_update_request_times(gl);
 
        /* don't want to skip dlm_unlock writing the lvb when lock is ex */
+
+       if (gl->gl_lksb.sb_lvbptr && (gl->gl_state == LM_ST_EXCLUSIVE))
+               lvb_needs_unlock = 1;
+
        if (test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags) &&
-           gl->gl_lksb.sb_lvbptr && (gl->gl_state != LM_ST_EXCLUSIVE)) {
+           !lvb_needs_unlock) {
                gfs2_glock_free(gl);
                return;
        }
index dd057bc6b65b28d3822229e0c0d5d0777b7955b9..fc8dc20fdeb9c90274d5acb8ef2bb831af297425 100644 (file)
@@ -177,11 +177,31 @@ out_nofree:
        return mnt;
 }
 
+static int
+nfs_namespace_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
+{
+       if (NFS_FH(dentry->d_inode)->size != 0)
+               return nfs_getattr(mnt, dentry, stat);
+       generic_fillattr(dentry->d_inode, stat);
+       return 0;
+}
+
+static int
+nfs_namespace_setattr(struct dentry *dentry, struct iattr *attr)
+{
+       if (NFS_FH(dentry->d_inode)->size != 0)
+               return nfs_setattr(dentry, attr);
+       return -EACCES;
+}
+
 const struct inode_operations nfs_mountpoint_inode_operations = {
        .getattr        = nfs_getattr,
+       .setattr        = nfs_setattr,
 };
 
 const struct inode_operations nfs_referral_inode_operations = {
+       .getattr        = nfs_namespace_getattr,
+       .setattr        = nfs_namespace_setattr,
 };
 
 static void nfs_expire_automounts(struct work_struct *work)
index acc3472681244d004f743a198e802709a38927b4..2e9779b58b7af6f3d143e60af3fba6abc8902a11 100644 (file)
@@ -236,11 +236,10 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
        error = nfs4_discover_server_trunking(clp, &old);
        if (error < 0)
                goto error;
+       nfs_put_client(clp);
        if (clp != old) {
                clp->cl_preserve_clid = true;
-               nfs_put_client(clp);
                clp = old;
-               atomic_inc(&clp->cl_count);
        }
 
        return clp;
@@ -306,7 +305,7 @@ int nfs40_walk_client_list(struct nfs_client *new,
                .clientid       = new->cl_clientid,
                .confirm        = new->cl_confirm,
        };
-       int status;
+       int status = -NFS4ERR_STALE_CLIENTID;
 
        spin_lock(&nn->nfs_client_lock);
        list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) {
@@ -332,40 +331,33 @@ int nfs40_walk_client_list(struct nfs_client *new,
 
                if (prev)
                        nfs_put_client(prev);
+               prev = pos;
 
                status = nfs4_proc_setclientid_confirm(pos, &clid, cred);
-               if (status == 0) {
+               switch (status) {
+               case -NFS4ERR_STALE_CLIENTID:
+                       break;
+               case 0:
                        nfs4_swap_callback_idents(pos, new);
 
-                       nfs_put_client(pos);
+                       prev = NULL;
                        *result = pos;
                        dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",
                                __func__, pos, atomic_read(&pos->cl_count));
-                       return 0;
-               }
-               if (status != -NFS4ERR_STALE_CLIENTID) {
-                       nfs_put_client(pos);
-                       dprintk("NFS: <-- %s status = %d, no result\n",
-                               __func__, status);
-                       return status;
+               default:
+                       goto out;
                }
 
                spin_lock(&nn->nfs_client_lock);
-               prev = pos;
        }
+       spin_unlock(&nn->nfs_client_lock);
 
-       /*
-        * No matching nfs_client found.  This should be impossible,
-        * because the new nfs_client has already been added to
-        * nfs_client_list by nfs_get_client().
-        *
-        * Don't BUG(), since the caller is holding a mutex.
-        */
+       /* No match found. The server lost our clientid */
+out:
        if (prev)
                nfs_put_client(prev);
-       spin_unlock(&nn->nfs_client_lock);
-       pr_err("NFS: %s Error: no matching nfs_client found\n", __func__);
-       return -NFS4ERR_STALE_CLIENTID;
+       dprintk("NFS: <-- %s status = %d\n", __func__, status);
+       return status;
 }
 
 #ifdef CONFIG_NFS_V4_1
@@ -432,7 +424,7 @@ int nfs41_walk_client_list(struct nfs_client *new,
 {
        struct nfs_net *nn = net_generic(new->cl_net, nfs_net_id);
        struct nfs_client *pos, *n, *prev = NULL;
-       int error;
+       int status = -NFS4ERR_STALE_CLIENTID;
 
        spin_lock(&nn->nfs_client_lock);
        list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) {
@@ -448,14 +440,17 @@ int nfs41_walk_client_list(struct nfs_client *new,
                                nfs_put_client(prev);
                        prev = pos;
 
-                       error = nfs_wait_client_init_complete(pos);
-                       if (error < 0) {
+                       nfs4_schedule_lease_recovery(pos);
+                       status = nfs_wait_client_init_complete(pos);
+                       if (status < 0) {
                                nfs_put_client(pos);
                                spin_lock(&nn->nfs_client_lock);
                                continue;
                        }
-
+                       status = pos->cl_cons_state;
                        spin_lock(&nn->nfs_client_lock);
+                       if (status < 0)
+                               continue;
                }
 
                if (pos->rpc_ops != new->rpc_ops)
@@ -473,6 +468,7 @@ int nfs41_walk_client_list(struct nfs_client *new,
                if (!nfs4_match_serverowners(pos, new))
                        continue;
 
+               atomic_inc(&pos->cl_count);
                spin_unlock(&nn->nfs_client_lock);
                dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",
                        __func__, pos, atomic_read(&pos->cl_count));
@@ -481,16 +477,10 @@ int nfs41_walk_client_list(struct nfs_client *new,
                return 0;
        }
 
-       /*
-        * No matching nfs_client found.  This should be impossible,
-        * because the new nfs_client has already been added to
-        * nfs_client_list by nfs_get_client().
-        *
-        * Don't BUG(), since the caller is holding a mutex.
-        */
+       /* No matching nfs_client found. */
        spin_unlock(&nn->nfs_client_lock);
-       pr_err("NFS: %s Error: no matching nfs_client found\n", __func__);
-       return -NFS4ERR_STALE_CLIENTID;
+       dprintk("NFS: <-- %s status = %d\n", __func__, status);
+       return status;
 }
 #endif /* CONFIG_NFS_V4_1 */
 
index 9448c579d41a40068897f99cbc5db09bccf3e063..e61f68d5ef218dd64cdfec220bab02069cf1d72e 100644 (file)
@@ -136,16 +136,11 @@ int nfs40_discover_server_trunking(struct nfs_client *clp,
        clp->cl_confirm = clid.confirm;
 
        status = nfs40_walk_client_list(clp, result, cred);
-       switch (status) {
-       case -NFS4ERR_STALE_CLIENTID:
-               set_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state);
-       case 0:
+       if (status == 0) {
                /* Sustain the lease, even if it's empty.  If the clientid4
                 * goes stale it's of no use for trunking discovery. */
                nfs4_schedule_state_renewal(*result);
-               break;
        }
-
 out:
        return status;
 }
@@ -1863,6 +1858,7 @@ again:
        case -ETIMEDOUT:
        case -EAGAIN:
                ssleep(1);
+       case -NFS4ERR_STALE_CLIENTID:
                dprintk("NFS: %s after status %d, retrying\n",
                        __func__, status);
                goto again;
@@ -2022,8 +2018,18 @@ static int nfs4_reset_session(struct nfs_client *clp)
        nfs4_begin_drain_session(clp);
        cred = nfs4_get_exchange_id_cred(clp);
        status = nfs4_proc_destroy_session(clp->cl_session, cred);
-       if (status && status != -NFS4ERR_BADSESSION &&
-           status != -NFS4ERR_DEADSESSION) {
+       switch (status) {
+       case 0:
+       case -NFS4ERR_BADSESSION:
+       case -NFS4ERR_DEADSESSION:
+               break;
+       case -NFS4ERR_BACK_CHAN_BUSY:
+       case -NFS4ERR_DELAY:
+               set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state);
+               status = 0;
+               ssleep(1);
+               goto out;
+       default:
                status = nfs4_recovery_handle_error(clp, status);
                goto out;
        }
index 2e7e8c878e5d157418e91a3ce742b8810168c5d3..b056b1628722218bbbadce33e86255e6953c8994 100644 (file)
@@ -2589,27 +2589,23 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags,
        struct nfs_server *server;
        struct dentry *mntroot = ERR_PTR(-ENOMEM);
        struct nfs_subversion *nfs_mod = NFS_SB(data->sb)->nfs_client->cl_nfs_mod;
-       int error;
 
-       dprintk("--> nfs_xdev_mount_common()\n");
+       dprintk("--> nfs_xdev_mount()\n");
 
        mount_info.mntfh = mount_info.cloned->fh;
 
        /* create a new volume representation */
        server = nfs_mod->rpc_ops->clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor);
-       if (IS_ERR(server)) {
-               error = PTR_ERR(server);
-               goto out_err;
-       }
 
-       mntroot = nfs_fs_mount_common(server, flags, dev_name, &mount_info, nfs_mod);
-       dprintk("<-- nfs_xdev_mount_common() = 0\n");
-out:
-       return mntroot;
+       if (IS_ERR(server))
+               mntroot = ERR_CAST(server);
+       else
+               mntroot = nfs_fs_mount_common(server, flags,
+                               dev_name, &mount_info, nfs_mod);
 
-out_err:
-       dprintk("<-- nfs_xdev_mount_common() = %d [error]\n", error);
-       goto out;
+       dprintk("<-- nfs_xdev_mount() = %ld\n",
+                       IS_ERR(mntroot) ? PTR_ERR(mntroot) : 0L);
+       return mntroot;
 }
 
 #if IS_ENABLED(CONFIG_NFS_V4)
index 4111a40ebe1a17dde31f89e5154c0d257c6e5d6c..5f707e5371717a331131f72f5babff24670d9bef 100644 (file)
@@ -86,11 +86,11 @@ xfs_destroy_ioend(
        }
 
        if (ioend->io_iocb) {
+               inode_dio_done(ioend->io_inode);
                if (ioend->io_isasync) {
                        aio_complete(ioend->io_iocb, ioend->io_error ?
                                        ioend->io_error : ioend->io_result, 0);
                }
-               inode_dio_done(ioend->io_inode);
        }
 
        mempool_free(ioend, xfs_ioend_pool);
index 0e92d12765d2670146b0325cd1215b449fb60dfe..cdb2d33485837bcd314f380f6d0c6737424626ec 100644 (file)
@@ -4680,9 +4680,6 @@ __xfs_bmapi_allocate(
                        return error;
        }
 
-       if (bma->flags & XFS_BMAPI_STACK_SWITCH)
-               bma->stack_switch = 1;
-
        error = xfs_bmap_alloc(bma);
        if (error)
                return error;
@@ -4956,6 +4953,9 @@ xfs_bmapi_write(
        bma.flist = flist;
        bma.firstblock = firstblock;
 
+       if (flags & XFS_BMAPI_STACK_SWITCH)
+               bma.stack_switch = 1;
+
        while (bno < end && n < *nmap) {
                inhole = eof || bma.got.br_startoff > bno;
                wasdelay = !inhole && isnullstartblock(bma.got.br_startblock);
index 56d1614760cfba8b58957f37146d417d120fc087..fbbb9eb92e32a7b38ec32c954313cffdb39a8508 100644 (file)
@@ -487,6 +487,7 @@ _xfs_buf_find(
        struct rb_node          *parent;
        xfs_buf_t               *bp;
        xfs_daddr_t             blkno = map[0].bm_bn;
+       xfs_daddr_t             eofs;
        int                     numblks = 0;
        int                     i;
 
@@ -498,6 +499,23 @@ _xfs_buf_find(
        ASSERT(!(numbytes < (1 << btp->bt_sshift)));
        ASSERT(!(BBTOB(blkno) & (xfs_off_t)btp->bt_smask));
 
+       /*
+        * Corrupted block numbers can get through to here, unfortunately, so we
+        * have to check that the buffer falls within the filesystem bounds.
+        */
+       eofs = XFS_FSB_TO_BB(btp->bt_mount, btp->bt_mount->m_sb.sb_dblocks);
+       if (blkno >= eofs) {
+               /*
+                * XXX (dgc): we should really be returning EFSCORRUPTED here,
+                * but none of the higher level infrastructure supports
+                * returning a specific error on buffer lookup failures.
+                */
+               xfs_alert(btp->bt_mount,
+                         "%s: Block out of range: block 0x%llx, EOFS 0x%llx ",
+                         __func__, blkno, eofs);
+               return NULL;
+       }
+
        /* get tree root */
        pag = xfs_perag_get(btp->bt_mount,
                                xfs_daddr_to_agno(btp->bt_mount, blkno));
@@ -1487,6 +1505,8 @@ restart:
        while (!list_empty(&btp->bt_lru)) {
                bp = list_first_entry(&btp->bt_lru, struct xfs_buf, b_lru);
                if (atomic_read(&bp->b_hold) > 1) {
+                       trace_xfs_buf_wait_buftarg(bp, _RET_IP_);
+                       list_move_tail(&bp->b_lru, &btp->bt_lru);
                        spin_unlock(&btp->bt_lru_lock);
                        delay(100);
                        goto restart;
index 77b09750e92c3e05964a2924507342205fc463b1..3f9949fee391b11cdfd73c12799cccba4ce1b56b 100644 (file)
@@ -652,7 +652,10 @@ xfs_buf_item_unlock(
 
        /*
         * If the buf item isn't tracking any data, free it, otherwise drop the
-        * reference we hold to it.
+        * reference we hold to it. If we are aborting the transaction, this may
+        * be the only reference to the buf item, so we free it anyway
+        * regardless of whether it is dirty or not. A dirty abort implies a
+        * shutdown, anyway.
         */
        clean = 1;
        for (i = 0; i < bip->bli_format_count; i++) {
@@ -664,7 +667,12 @@ xfs_buf_item_unlock(
        }
        if (clean)
                xfs_buf_item_relse(bp);
-       else
+       else if (aborted) {
+               if (atomic_dec_and_test(&bip->bli_refcount)) {
+                       ASSERT(XFS_FORCED_SHUTDOWN(lip->li_mountp));
+                       xfs_buf_item_relse(bp);
+               }
+       } else
                atomic_dec(&bip->bli_refcount);
 
        if (!hold)
index d0e9c74d3d96a75c18d40f175efd51eec85aab18..a8bd26b82ecb00dd14063da4c62c1a64011f0caa 100644 (file)
@@ -246,10 +246,10 @@ xfs_swap_extents(
                goto out_unlock;
        }
 
-       error = -filemap_write_and_wait(VFS_I(ip)->i_mapping);
+       error = -filemap_write_and_wait(VFS_I(tip)->i_mapping);
        if (error)
                goto out_unlock;
-       truncate_pagecache_range(VFS_I(ip), 0, -1);
+       truncate_pagecache_range(VFS_I(tip), 0, -1);
 
        /* Verify O_DIRECT for ftmp */
        if (VN_CACHED(VFS_I(tip)) != 0) {
index add06b4e9a635511afc3e2716836e210ff794c46..364818eef40e55720a6a4509afbde63a1b48cd05 100644 (file)
@@ -351,6 +351,15 @@ xfs_iomap_prealloc_size(
                }
                if (shift)
                        alloc_blocks >>= shift;
+
+               /*
+                * If we are still trying to allocate more space than is
+                * available, squash the prealloc hard. This can happen if we
+                * have a large file on a small filesystem and the above
+                * lowspace thresholds are smaller than MAXEXTLEN.
+                */
+               while (alloc_blocks >= freesp)
+                       alloc_blocks >>= 4;
        }
 
        if (alloc_blocks < mp->m_writeio_blocks)
index da508463ff1006b7b4b5371d5f2c19495cb5d44b..7d6df7c00c36fb22e8f864285c6d2352b44a7cdd 100644 (file)
@@ -658,7 +658,7 @@ xfs_sb_quiet_read_verify(
                return;
        }
        /* quietly fail */
-       xfs_buf_ioerror(bp, EFSCORRUPTED);
+       xfs_buf_ioerror(bp, EWRONGFS);
 }
 
 static void
index 2e137d4a85ae66bc3a9172a4d93f734ba7aabb99..16a812977eab3d8fcf001e0175e6cfd773dcfe67 100644 (file)
@@ -341,6 +341,7 @@ DEFINE_BUF_EVENT(xfs_buf_item_relse);
 DEFINE_BUF_EVENT(xfs_buf_item_iodone);
 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
 DEFINE_BUF_EVENT(xfs_buf_error_relse);
+DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
 DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
 
index d1ea7ce0b4cb95c9e61935aefbcb09c12f49bdbc..fc62ac5c6d4fa5324712cc3578be327261a6872c 100644 (file)
 #define TRACE_SYSCALLS()
 #endif
 
+#ifdef CONFIG_CLKSRC_OF
+#define CLKSRC_OF_TABLES() . = ALIGN(8);                               \
+                          VMLINUX_SYMBOL(__clksrc_of_table) = .;       \
+                          *(__clksrc_of_table)                         \
+                          *(__clksrc_of_table_end)
+#else
+#define CLKSRC_OF_TABLES()
+#endif
+
+#ifdef CONFIG_IRQCHIP
+#define IRQCHIP_OF_MATCH_TABLE()                                       \
+       . = ALIGN(8);                                                   \
+       VMLINUX_SYMBOL(__irqchip_begin) = .;                            \
+       *(__irqchip_of_table)                                           \
+       *(__irqchip_of_end)
+#else
+#define IRQCHIP_OF_MATCH_TABLE()
+#endif
 
 #define KERNEL_DTB()                                                   \
        STRUCT_ALIGN();                                                 \
        DEV_DISCARD(init.rodata)                                        \
        CPU_DISCARD(init.rodata)                                        \
        MEM_DISCARD(init.rodata)                                        \
-       KERNEL_DTB()
+       CLKSRC_OF_TABLES()                                              \
+       KERNEL_DTB()                                                    \
+       IRQCHIP_OF_MATCH_TABLE()
 
 #define INIT_TEXT                                                      \
        *(.init.text)                                                   \
index 25680fe0903c3ab73de1b16bba9a421fd4f56c8b..ca17aa81700643f1b00c9654460df1cb40a0f316 100644 (file)
@@ -17,6 +17,6 @@
 
 #include <asm/mach/time.h>
 
-extern struct sys_timer bcm2835_timer;
+extern void bcm2835_timer_init(void);
 
 #endif
index 4dceaf8ae1525e57a0d6f7911e8dddac7047da4d..7944f14ea947970446ce61d36e5c3a53aa882a7c 100644 (file)
@@ -332,4 +332,13 @@ extern int clocksource_mmio_init(void __iomem *, const char *,
 
 extern int clocksource_i8253_init(void);
 
+#ifdef CONFIG_CLKSRC_OF
+extern void clocksource_of_init(void);
+
+#define CLOCKSOURCE_OF_DECLARE(name, compat, fn)                       \
+       static const struct of_device_id __clksrc_of_table_##name       \
+               __used __section(__clksrc_of_table)                     \
+                = { .compatible = compat, .data = fn };
+#endif
+
 #endif /* _LINUX_CLOCKSOURCE_H */
index 1148575fd134e1b02e02acaa2d8892f4e6e91237..dd755ce2a5ebdb867b959f6efc21b696500c5732 100644 (file)
@@ -53,5 +53,5 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
 cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs);
 void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs);
 
-extern struct sys_timer dw_apb_timer;
+extern void dw_apb_timer_init(void);
 #endif /* __DW_APB_TIMER_H__ */
index 8b84916dc6719ce46430fa791aa27c0bf8b16835..7a9498ab3c2d10dedf8af5c5dae3b2fd56753684 100644 (file)
@@ -618,18 +618,30 @@ extern int __init efi_setup_pcdp_console(char *);
 #endif
 
 /*
- * We play games with efi_enabled so that the compiler will, if possible, remove
- * EFI-related code altogether.
+ * We play games with efi_enabled so that the compiler will, if
+ * possible, remove EFI-related code altogether.
  */
+#define EFI_BOOT               0       /* Were we booted from EFI? */
+#define EFI_SYSTEM_TABLES      1       /* Can we use EFI system tables? */
+#define EFI_CONFIG_TABLES      2       /* Can we use EFI config tables? */
+#define EFI_RUNTIME_SERVICES   3       /* Can we use runtime services? */
+#define EFI_MEMMAP             4       /* Can we use EFI memory map? */
+#define EFI_64BIT              5       /* Is the firmware 64-bit? */
+
 #ifdef CONFIG_EFI
 # ifdef CONFIG_X86
-   extern int efi_enabled;
-   extern bool efi_64bit;
+extern int efi_enabled(int facility);
 # else
-#  define efi_enabled 1
+static inline int efi_enabled(int facility)
+{
+       return 1;
+}
 # endif
 #else
-# define efi_enabled 0
+static inline int efi_enabled(int facility)
+{
+       return 0;
+}
 #endif
 
 /*
diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
new file mode 100644 (file)
index 0000000..e0006f1
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2012 Thomas Petazzoni
+ *
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef _LINUX_IRQCHIP_H
+#define _LINUX_IRQCHIP_H
+
+void irqchip_init(void);
+
+#endif
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
new file mode 100644 (file)
index 0000000..a67ca55
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ *  include/linux/irqchip/arm-gic.h
+ *
+ *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __LINUX_IRQCHIP_ARM_GIC_H
+#define __LINUX_IRQCHIP_ARM_GIC_H
+
+#define GIC_CPU_CTRL                   0x00
+#define GIC_CPU_PRIMASK                        0x04
+#define GIC_CPU_BINPOINT               0x08
+#define GIC_CPU_INTACK                 0x0c
+#define GIC_CPU_EOI                    0x10
+#define GIC_CPU_RUNNINGPRI             0x14
+#define GIC_CPU_HIGHPRI                        0x18
+
+#define GIC_DIST_CTRL                  0x000
+#define GIC_DIST_CTR                   0x004
+#define GIC_DIST_ENABLE_SET            0x100
+#define GIC_DIST_ENABLE_CLEAR          0x180
+#define GIC_DIST_PENDING_SET           0x200
+#define GIC_DIST_PENDING_CLEAR         0x280
+#define GIC_DIST_ACTIVE_BIT            0x300
+#define GIC_DIST_PRI                   0x400
+#define GIC_DIST_TARGET                        0x800
+#define GIC_DIST_CONFIG                        0xc00
+#define GIC_DIST_SOFTINT               0xf00
+
+struct device_node;
+
+extern struct irq_chip gic_arch_extn;
+
+void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
+                   u32 offset, struct device_node *);
+void gic_secondary_init(unsigned int);
+void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
+
+static inline void gic_init(unsigned int nr, int start,
+                           void __iomem *dist , void __iomem *cpu)
+{
+       gic_init_bases(nr, start, dist, cpu, 0, NULL);
+}
+
+#endif
diff --git a/include/linux/irqchip/arm-vic.h b/include/linux/irqchip/arm-vic.h
new file mode 100644 (file)
index 0000000..e3c82dc
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  arch/arm/include/asm/hardware/vic.h
+ *
+ *  Copyright (c) ARM Limited 2003.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef __ASM_ARM_HARDWARE_VIC_H
+#define __ASM_ARM_HARDWARE_VIC_H
+
+#include <linux/types.h>
+
+#define VIC_RAW_STATUS                 0x08
+#define VIC_INT_ENABLE                 0x10    /* 1 = enable, 0 = disable */
+#define VIC_INT_ENABLE_CLEAR           0x14
+
+struct device_node;
+struct pt_regs;
+
+void __vic_init(void __iomem *base, int irq_start, u32 vic_sources,
+               u32 resume_sources, struct device_node *node);
+void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources);
+
+#endif
index 2138bd33021a629f59b868d5a3938aefa4f87449..e53dcfeaee69bb052181261f4843c9da57f04e05 100644 (file)
@@ -272,8 +272,6 @@ struct abx500_bm_data {
        const struct abx500_fg_parameters *fg_params;
 };
 
-extern struct abx500_bm_data ab8500_bm_data;
-
 enum {
        NTC_EXTERNAL = 0,
        NTC_INTERNAL,
index 44310c98ee6eb59f38ca3024622966e6b528bf1d..9bd037df97d95a673d80f771cb9b1eaf56bce1c1 100644 (file)
@@ -422,7 +422,10 @@ struct ab8500_chargalg_platform_data {
 struct ab8500_btemp;
 struct ab8500_gpadc;
 struct ab8500_fg;
+
 #ifdef CONFIG_AB8500_BM
+extern struct abx500_bm_data ab8500_bm_data;
+
 void ab8500_fg_reinit(void);
 void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA);
 struct ab8500_btemp *ab8500_btemp_get(void);
@@ -434,31 +437,7 @@ int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res);
 int ab8500_fg_inst_curr_done(struct ab8500_fg *di);
 
 #else
-int ab8500_fg_inst_curr_done(struct ab8500_fg *di)
-{
-}
-static void ab8500_fg_reinit(void)
-{
-}
-static void ab8500_charger_usb_state_changed(u8 bm_usb_state, u16 mA)
-{
-}
-static struct ab8500_btemp *ab8500_btemp_get(void)
-{
-       return NULL;
-}
-static int ab8500_btemp_get_batctrl_temp(struct ab8500_btemp *btemp)
-{
-       return 0;
-}
-struct ab8500_fg *ab8500_fg_get(void)
-{
-       return NULL;
-}
-static int ab8500_fg_inst_curr_blocking(struct ab8500_fg *dev)
-{
-       return -ENODEV;
-}
+static struct abx500_bm_data ab8500_bm_data;
 
 static inline int ab8500_fg_inst_curr_start(struct ab8500_fg *di)
 {
index 86dd93de6ff2b70ac4c693e8a9a05083bea72503..786d02eb79d2210ef8c3dfe145e3c8d0e0123ef1 100644 (file)
@@ -99,6 +99,9 @@ struct da9052 {
        u8 chip_id;
 
        int chip_irq;
+
+       /* SOC I/O transfer related fixes for DA9052/53 */
+       int (*fix_io) (struct da9052 *da9052, unsigned char reg);
 };
 
 /* ADC API */
@@ -113,32 +116,87 @@ static inline int da9052_reg_read(struct da9052 *da9052, unsigned char reg)
        ret = regmap_read(da9052->regmap, reg, &val);
        if (ret < 0)
                return ret;
+
+       if (da9052->fix_io) {
+               ret = da9052->fix_io(da9052, reg);
+               if (ret < 0)
+                       return ret;
+       }
+
        return val;
 }
 
 static inline int da9052_reg_write(struct da9052 *da9052, unsigned char reg,
                                    unsigned char val)
 {
-       return regmap_write(da9052->regmap, reg, val);
+       int ret;
+
+       ret = regmap_write(da9052->regmap, reg, val);
+       if (ret < 0)
+               return ret;
+
+       if (da9052->fix_io) {
+               ret = da9052->fix_io(da9052, reg);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return ret;
 }
 
 static inline int da9052_group_read(struct da9052 *da9052, unsigned char reg,
                                     unsigned reg_cnt, unsigned char *val)
 {
-       return regmap_bulk_read(da9052->regmap, reg, val, reg_cnt);
+       int ret;
+
+       ret = regmap_bulk_read(da9052->regmap, reg, val, reg_cnt);
+       if (ret < 0)
+               return ret;
+
+       if (da9052->fix_io) {
+               ret = da9052->fix_io(da9052, reg);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return ret;
 }
 
 static inline int da9052_group_write(struct da9052 *da9052, unsigned char reg,
                                      unsigned reg_cnt, unsigned char *val)
 {
-       return regmap_raw_write(da9052->regmap, reg, val, reg_cnt);
+       int ret;
+
+       ret = regmap_raw_write(da9052->regmap, reg, val, reg_cnt);
+       if (ret < 0)
+               return ret;
+
+       if (da9052->fix_io) {
+               ret = da9052->fix_io(da9052, reg);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return ret;
 }
 
 static inline int da9052_reg_update(struct da9052 *da9052, unsigned char reg,
                                     unsigned char bit_mask,
                                     unsigned char reg_val)
 {
-       return regmap_update_bits(da9052->regmap, reg, bit_mask, reg_val);
+       int ret;
+
+       ret = regmap_update_bits(da9052->regmap, reg, bit_mask, reg_val);
+       if (ret < 0)
+               return ret;
+
+       if (da9052->fix_io) {
+               ret = da9052->fix_io(da9052, reg);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return ret;
 }
 
 int da9052_device_init(struct da9052 *da9052, u8 chip_id);
index b97f7309d7f69e7189d74aead8ac4281a8ed0881..c4dd3a8add21b94cc526843c117734c506cc5233 100644 (file)
@@ -34,6 +34,9 @@
 #define DA9052_STATUS_C_REG            3
 #define DA9052_STATUS_D_REG            4
 
+/* PARK REGISTER */
+#define DA9052_PARK_REGISTER           DA9052_STATUS_D_REG
+
 /* EVENT REGISTERS */
 #define DA9052_EVENT_A_REG             5
 #define DA9052_EVENT_B_REG             6
index a8d393e3066b74465f14994740b758f1a134850b..2b13970596f53732cda07a6fd3b270cc9e933e5b 100644 (file)
@@ -38,6 +38,9 @@
 #define RTSX_SD_CARD                   0
 #define RTSX_MS_CARD                   1
 
+#define CLK_TO_DIV_N                   0
+#define DIV_N_TO_CLK                   1
+
 struct platform_device;
 
 struct rtsx_slot {
index 060b721fcbfb93b690d51191daeb95da692eef8c..4b117a3f54d493f59393226c6351e1fa8c1e16ca 100644 (file)
 #define SG_TRANS_DATA          (0x02 << 4)
 #define SG_LINK_DESC           (0x03 << 4)
 
-/* SD bank voltage */
-#define SD_IO_3V3              0
-#define SD_IO_1V8              1
-
+/* Output voltage */
+#define OUTPUT_3V3             0
+#define OUTPUT_1V8             1
 
 /* Card Clock Enable Register */
 #define SD_CLK_EN                      0x04
 #define CHANGE_CLK                     0x01
 
 /* LDO_CTL */
+#define BPP_ASIC_1V7                   0x00
+#define BPP_ASIC_1V8                   0x01
+#define BPP_ASIC_1V9                   0x02
+#define BPP_ASIC_2V0                   0x03
+#define BPP_ASIC_2V7                   0x04
+#define BPP_ASIC_2V8                   0x05
+#define BPP_ASIC_3V2                   0x06
+#define BPP_ASIC_3V3                   0x07
+#define BPP_REG_TUNED18                        0x07
+#define BPP_TUNED18_SHIFT_8402         5
+#define BPP_TUNED18_SHIFT_8411         4
+#define BPP_PAD_MASK                   0x04
+#define BPP_PAD_3V3                    0x04
+#define BPP_PAD_1V8                    0x00
 #define BPP_LDO_POWB                   0x03
 #define BPP_LDO_ON                     0x00
 #define BPP_LDO_SUSPEND                        0x02
@@ -688,7 +701,10 @@ struct pcr_ops {
        int             (*disable_auto_blink)(struct rtsx_pcr *pcr);
        int             (*card_power_on)(struct rtsx_pcr *pcr, int card);
        int             (*card_power_off)(struct rtsx_pcr *pcr, int card);
+       int             (*switch_output_voltage)(struct rtsx_pcr *pcr,
+                                               u8 voltage);
        unsigned int    (*cd_deglitch)(struct rtsx_pcr *pcr);
+       int             (*conv_clk_and_div_n)(int clk, int dir);
 };
 
 enum PDEV_STAT  {PDEV_STAT_IDLE, PDEV_STAT_RUN};
@@ -783,6 +799,7 @@ int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
                u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk);
 int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card);
 int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card);
+int rtsx_pci_switch_output_voltage(struct rtsx_pcr *pcr, u8 voltage);
 unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr);
 void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr);
 
index 0f6afc657f778f2e682e7fb108e97b6788a53973..eee7478cda701ddeabc00150f607f368a4239350 100644 (file)
@@ -989,17 +989,29 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     tells the LSM to decrement the number of secmark labeling rules loaded
  * @req_classify_flow:
  *     Sets the flow's sid to the openreq sid.
+ * @tun_dev_alloc_security:
+ *     This hook allows a module to allocate a security structure for a TUN
+ *     device.
+ *     @security pointer to a security structure pointer.
+ *     Returns a zero on success, negative values on failure.
+ * @tun_dev_free_security:
+ *     This hook allows a module to free the security structure for a TUN
+ *     device.
+ *     @security pointer to the TUN device's security structure
  * @tun_dev_create:
  *     Check permissions prior to creating a new TUN device.
- * @tun_dev_post_create:
- *     This hook allows a module to update or allocate a per-socket security
- *     structure.
- *     @sk contains the newly created sock structure.
+ * @tun_dev_attach_queue:
+ *     Check permissions prior to attaching to a TUN device queue.
+ *     @security pointer to the TUN device's security structure.
  * @tun_dev_attach:
- *     Check permissions prior to attaching to a persistent TUN device.  This
- *     hook can also be used by the module to update any security state
+ *     This hook can be used by the module to update any security state
  *     associated with the TUN device's sock structure.
  *     @sk contains the existing sock structure.
+ *     @security pointer to the TUN device's security structure.
+ * @tun_dev_open:
+ *     This hook can be used by the module to update any security state
+ *     associated with the TUN device's security structure.
+ *     @security pointer to the TUN devices's security structure.
  *
  * Security hooks for XFRM operations.
  *
@@ -1620,9 +1632,12 @@ struct security_operations {
        void (*secmark_refcount_inc) (void);
        void (*secmark_refcount_dec) (void);
        void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl);
-       int (*tun_dev_create)(void);
-       void (*tun_dev_post_create)(struct sock *sk);
-       int (*tun_dev_attach)(struct sock *sk);
+       int (*tun_dev_alloc_security) (void **security);
+       void (*tun_dev_free_security) (void *security);
+       int (*tun_dev_create) (void);
+       int (*tun_dev_attach_queue) (void *security);
+       int (*tun_dev_attach) (struct sock *sk, void *security);
+       int (*tun_dev_open) (void *security);
 #endif /* CONFIG_SECURITY_NETWORK */
 
 #ifdef CONFIG_SECURITY_NETWORK_XFRM
@@ -2566,9 +2581,12 @@ void security_inet_conn_established(struct sock *sk,
 int security_secmark_relabel_packet(u32 secid);
 void security_secmark_refcount_inc(void);
 void security_secmark_refcount_dec(void);
+int security_tun_dev_alloc_security(void **security);
+void security_tun_dev_free_security(void *security);
 int security_tun_dev_create(void);
-void security_tun_dev_post_create(struct sock *sk);
-int security_tun_dev_attach(struct sock *sk);
+int security_tun_dev_attach_queue(void *security);
+int security_tun_dev_attach(struct sock *sk, void *security);
+int security_tun_dev_open(void *security);
 
 #else  /* CONFIG_SECURITY_NETWORK */
 static inline int security_unix_stream_connect(struct sock *sock,
@@ -2733,16 +2751,31 @@ static inline void security_secmark_refcount_dec(void)
 {
 }
 
+static inline int security_tun_dev_alloc_security(void **security)
+{
+       return 0;
+}
+
+static inline void security_tun_dev_free_security(void *security)
+{
+}
+
 static inline int security_tun_dev_create(void)
 {
        return 0;
 }
 
-static inline void security_tun_dev_post_create(struct sock *sk)
+static inline int security_tun_dev_attach_queue(void *security)
+{
+       return 0;
+}
+
+static inline int security_tun_dev_attach(struct sock *sk, void *security)
 {
+       return 0;
 }
 
-static inline int security_tun_dev_attach(struct sock *sk)
+static inline int security_tun_dev_open(void *security)
 {
        return 0;
 }
index b9165bba6e61b7781850b08c0e7008a1c4fa47e4..18081787e5f31254314b3468d1be31c0bcc14c4c 100644 (file)
@@ -19,6 +19,6 @@
 
 #include <asm/mach/time.h>
 
-extern struct sys_timer sunxi_timer;
+void sunxi_timer_init(void);
 
 #endif
index 4d358e9d10f100757176df607b502a451aafc6bb..05e32a72103c68a059602101e82c05ad3c80027e 100644 (file)
@@ -142,9 +142,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta);
  * finer then tick granular time.
  */
 #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
-extern u32 arch_gettimeoffset(void);
-#else
-static inline u32 arch_gettimeoffset(void) { return 0; }
+extern u32 (*arch_gettimeoffset)(void);
 #endif
 
 extern void do_gettimeofday(struct timeval *tv);
index bd45eb7bedc8f365ab70704c552e93041af4ac94..5de7a220e98680f9c9cfc7b36c1f5c2114d7144f 100644 (file)
@@ -100,6 +100,7 @@ struct driver_info {
 #define FLAG_LINK_INTR 0x0800          /* updates link (carrier) status */
 
 #define FLAG_POINTTOPOINT 0x1000       /* possibly use "usb%d" names */
+#define FLAG_NOARP     0x2000          /* device can't do ARP */
 
 /*
  * Indicates to usbnet, that USB driver accumulates multiple IP packets.
diff --git a/include/linux/vt8500_timer.h b/include/linux/vt8500_timer.h
new file mode 100644 (file)
index 0000000..33b0ee8
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2012 Tony Prisk <linux@prisktech.co.nz>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __VT8500_TIMER_H
+#define __VT8500_TIMER_H
+
+#include <asm/mach/time.h>
+
+void vt8500_timer_init(void);
+
+#endif
index 0707fb9551aa4c1011c88969a42cd4482450d035..a68f838a132c522df397b9398f8f2d64646008c0 100644 (file)
@@ -143,6 +143,8 @@ static inline struct sk_buff *ip_finish_skb(struct sock *sk, struct flowi4 *fl4)
 extern int             ip4_datagram_connect(struct sock *sk, 
                                             struct sockaddr *uaddr, int addr_len);
 
+extern void ip4_datagram_release_cb(struct sock *sk);
+
 struct ip_reply_arg {
        struct kvec iov[1];   
        int         flags;
index d8f5b9f5216939d2053c8c99ad54925fb5a0ce5c..e98aeb3da033a38e29f745d5f043a33d3888bcc3 100644 (file)
@@ -31,6 +31,8 @@ extern void nf_conntrack_cleanup(struct net *net);
 extern int nf_conntrack_proto_init(struct net *net);
 extern void nf_conntrack_proto_fini(struct net *net);
 
+extern void nf_conntrack_cleanup_end(void);
+
 extern bool
 nf_ct_get_tuple(const struct sk_buff *skb,
                unsigned int nhoff,
index 92d728a32d51d89686d73f86f41a00fc37dfa1ad..cee4b5c66d81e1362fba3c7890eb1c86ab8c1abd 100644 (file)
@@ -604,7 +604,7 @@ asmlinkage void __init start_kernel(void)
        pidmap_init();
        anon_vma_init();
 #ifdef CONFIG_X86
-       if (efi_enabled)
+       if (efi_enabled(EFI_RUNTIME_SERVICES))
                efi_enter_virtual_mode();
 #endif
        thread_info_cache_init();
@@ -632,7 +632,7 @@ asmlinkage void __init start_kernel(void)
        acpi_early_init(); /* before LAPIC and SMP init */
        sfi_init_late();
 
-       if (efi_enabled) {
+       if (efi_enabled(EFI_RUNTIME_SERVICES)) {
                efi_late_init();
                efi_free_boot_services();
        }
index 357f714ddd4983e75e3816577b237d8c8d38bd3f..267ce780abe8dd0c18b3c6f1d93f3974b75697ed 100644 (file)
@@ -87,12 +87,6 @@ static DEFINE_SEMAPHORE(console_sem);
 struct console *console_drivers;
 EXPORT_SYMBOL_GPL(console_drivers);
 
-#ifdef CONFIG_LOCKDEP
-static struct lockdep_map console_lock_dep_map = {
-       .name = "console_lock"
-};
-#endif
-
 /*
  * This is used for debugging the mess that is the VT code by
  * keeping track if we have the console semaphore held. It's
@@ -1924,7 +1918,6 @@ void console_lock(void)
                return;
        console_locked = 1;
        console_may_schedule = 1;
-       mutex_acquire(&console_lock_dep_map, 0, 0, _RET_IP_);
 }
 EXPORT_SYMBOL(console_lock);
 
@@ -1946,7 +1939,6 @@ int console_trylock(void)
        }
        console_locked = 1;
        console_may_schedule = 0;
-       mutex_acquire(&console_lock_dep_map, 0, 1, _RET_IP_);
        return 1;
 }
 EXPORT_SYMBOL(console_trylock);
@@ -2107,7 +2099,6 @@ skip:
                local_irq_restore(flags);
        }
        console_locked = 0;
-       mutex_release(&console_lock_dep_map, 1, _RET_IP_);
 
        /* Release the exclusive_console once it is used */
        if (unlikely(exclusive_console))
index 29dd40a9f2f403ab86f39c96ddb505851b1d36c2..69f38bd98b423a53ada73c7a6b7a2217e91a77b4 100644 (file)
@@ -33,6 +33,7 @@ struct call_function_data {
        struct call_single_data csd;
        atomic_t                refs;
        cpumask_var_t           cpumask;
+       cpumask_var_t           cpumask_ipi;
 };
 
 static DEFINE_PER_CPU_SHARED_ALIGNED(struct call_function_data, cfd_data);
@@ -56,6 +57,9 @@ hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu)
                if (!zalloc_cpumask_var_node(&cfd->cpumask, GFP_KERNEL,
                                cpu_to_node(cpu)))
                        return notifier_from_errno(-ENOMEM);
+               if (!zalloc_cpumask_var_node(&cfd->cpumask_ipi, GFP_KERNEL,
+                               cpu_to_node(cpu)))
+                       return notifier_from_errno(-ENOMEM);
                break;
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -65,6 +69,7 @@ hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu)
        case CPU_DEAD:
        case CPU_DEAD_FROZEN:
                free_cpumask_var(cfd->cpumask);
+               free_cpumask_var(cfd->cpumask_ipi);
                break;
 #endif
        };
@@ -526,6 +531,12 @@ void smp_call_function_many(const struct cpumask *mask,
                return;
        }
 
+       /*
+        * After we put an entry into the list, data->cpumask
+        * may be cleared again when another CPU sends another IPI for
+        * a SMP function call, so data->cpumask will be zero.
+        */
+       cpumask_copy(data->cpumask_ipi, data->cpumask);
        raw_spin_lock_irqsave(&call_function.lock, flags);
        /*
         * Place entry at the _HEAD_ of the list, so that any cpu still
@@ -549,7 +560,7 @@ void smp_call_function_many(const struct cpumask *mask,
        smp_mb();
 
        /* Send a message to all CPUs in the map */
-       arch_send_call_function_ipi_mask(data->cpumask);
+       arch_send_call_function_ipi_mask(data->cpumask_ipi);
 
        /* Optionally wait for the CPUs to complete */
        if (wait)
index 30b6de0d977c4734eb479d7489f61e56b35afaa8..c6d6400ee137f2a3c51647739b03113b48da7a10 100644 (file)
@@ -339,6 +339,7 @@ void clockevents_config_and_register(struct clock_event_device *dev,
        clockevents_config(dev, freq);
        clockevents_register_device(dev);
 }
+EXPORT_SYMBOL_GPL(clockevents_config_and_register);
 
 /**
  * clockevents_update_freq - Update frequency and reprogram a clock event device.
index cbc6acb0db3fafbaa4830da34cdb22e538892764..8ed9346015879ddb3851bbed8a908151b6f887a9 100644 (file)
@@ -135,6 +135,20 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock)
 }
 
 /* Timekeeper helper functions. */
+
+#ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
+u32 (*arch_gettimeoffset)(void);
+
+u32 get_arch_timeoffset(void)
+{
+       if (likely(arch_gettimeoffset))
+               return arch_gettimeoffset();
+       return 0;
+}
+#else
+static inline u32 get_arch_timeoffset(void) { return 0; }
+#endif
+
 static inline s64 timekeeping_get_ns(struct timekeeper *tk)
 {
        cycle_t cycle_now, cycle_delta;
@@ -151,8 +165,8 @@ static inline s64 timekeeping_get_ns(struct timekeeper *tk)
        nsec = cycle_delta * tk->mult + tk->xtime_nsec;
        nsec >>= tk->shift;
 
-       /* If arch requires, add in gettimeoffset() */
-       return nsec + arch_gettimeoffset();
+       /* If arch requires, add in get_arch_timeoffset() */
+       return nsec + get_arch_timeoffset();
 }
 
 static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk)
@@ -171,8 +185,8 @@ static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk)
        /* convert delta to nanoseconds. */
        nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift);
 
-       /* If arch requires, add in gettimeoffset() */
-       return nsec + arch_gettimeoffset();
+       /* If arch requires, add in get_arch_timeoffset() */
+       return nsec + get_arch_timeoffset();
 }
 
 static RAW_NOTIFIER_HEAD(pvclock_gtod_chain);
@@ -254,8 +268,8 @@ static void timekeeping_forward_now(struct timekeeper *tk)
 
        tk->xtime_nsec += cycle_delta * tk->mult;
 
-       /* If arch requires, add in gettimeoffset() */
-       tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift;
+       /* If arch requires, add in get_arch_timeoffset() */
+       tk->xtime_nsec += (u64)get_arch_timeoffset() << tk->shift;
 
        tk_normalize_xtime(tk);
 
index 8e1d89d2b1c1cada56f190bcca967525a2b7a2e7..183f97a86bb24c8099f4d3b7b7d4a5919d3432c4 100644 (file)
@@ -738,6 +738,7 @@ static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv,
        struct arphdr *arphdr;
        struct ethhdr *ethhdr;
        __be32 ip_src, ip_dst;
+       uint8_t *hw_src, *hw_dst;
        uint16_t type = 0;
 
        /* pull the ethernet header */
@@ -777,9 +778,23 @@ static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv,
        ip_src = batadv_arp_ip_src(skb, hdr_size);
        ip_dst = batadv_arp_ip_dst(skb, hdr_size);
        if (ipv4_is_loopback(ip_src) || ipv4_is_multicast(ip_src) ||
-           ipv4_is_loopback(ip_dst) || ipv4_is_multicast(ip_dst))
+           ipv4_is_loopback(ip_dst) || ipv4_is_multicast(ip_dst) ||
+           ipv4_is_zeronet(ip_src) || ipv4_is_lbcast(ip_src) ||
+           ipv4_is_zeronet(ip_dst) || ipv4_is_lbcast(ip_dst))
                goto out;
 
+       hw_src = batadv_arp_hw_src(skb, hdr_size);
+       if (is_zero_ether_addr(hw_src) || is_multicast_ether_addr(hw_src))
+               goto out;
+
+       /* we don't care about the destination MAC address in ARP requests */
+       if (arphdr->ar_op != htons(ARPOP_REQUEST)) {
+               hw_dst = batadv_arp_hw_dst(skb, hdr_size);
+               if (is_zero_ether_addr(hw_dst) ||
+                   is_multicast_ether_addr(hw_dst))
+                       goto out;
+       }
+
        type = ntohs(arphdr->ar_op);
 out:
        return type;
@@ -1012,6 +1027,8 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
         */
        ret = !batadv_is_my_client(bat_priv, hw_dst);
 out:
+       if (ret)
+               kfree_skb(skb);
        /* if ret == false -> packet has to be delivered to the interface */
        return ret;
 }
index 596660d37c5e56d6a0178b16b288a2d3c868f965..0f78e34220c9025aae08f3b38b49924b6c397ff6 100644 (file)
@@ -2810,14 +2810,6 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
        if (conn) {
                hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF);
 
-               hci_dev_lock(hdev);
-               if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
-                   !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
-                       mgmt_device_connected(hdev, &conn->dst, conn->type,
-                                             conn->dst_type, 0, NULL, 0,
-                                             conn->dev_class);
-               hci_dev_unlock(hdev);
-
                /* Send to upper protocol */
                l2cap_recv_acldata(conn, skb, flags);
                return;
index 705078a0cc393c023054ad1d55aea1a548e3da1d..81b44481d0d93a8dd8513dd15f97f9a21b8a32d6 100644 (file)
@@ -2688,7 +2688,7 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
        if (ev->opcode != HCI_OP_NOP)
                del_timer(&hdev->cmd_timer);
 
-       if (ev->ncmd) {
+       if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
                atomic_set(&hdev->cmd_cnt, 1);
                if (!skb_queue_empty(&hdev->cmd_q))
                        queue_work(hdev->workqueue, &hdev->cmd_work);
index b2bcbe2dc328ba8473227035c39a7ff467ee5659..a7352ff3fd1e7884c2fc43142fba9bc0033063b8 100644 (file)
@@ -931,7 +931,7 @@ static int hidp_setup_hid(struct hidp_session *session,
        hid->version = req->version;
        hid->country = req->country;
 
-       strncpy(hid->name, req->name, 128);
+       strncpy(hid->name, req->name, sizeof(req->name) - 1);
 
        snprintf(hid->phys, sizeof(hid->phys), "%pMR",
                 &bt_sk(session->ctrl_sock->sk)->src);
index 2c78208d793eb8db838cf85a480e029a4dc3567b..22e658322845b9f16bcf8de52c1ba7c401bfef87 100644 (file)
@@ -3727,6 +3727,17 @@ sendresp:
 static int l2cap_connect_req(struct l2cap_conn *conn,
                             struct l2cap_cmd_hdr *cmd, u8 *data)
 {
+       struct hci_dev *hdev = conn->hcon->hdev;
+       struct hci_conn *hcon = conn->hcon;
+
+       hci_dev_lock(hdev);
+       if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
+           !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &hcon->flags))
+               mgmt_device_connected(hdev, &hcon->dst, hcon->type,
+                                     hcon->dst_type, 0, NULL, 0,
+                                     hcon->dev_class);
+       hci_dev_unlock(hdev);
+
        l2cap_connect(conn, cmd, data, L2CAP_CONN_RSP, 0);
        return 0;
 }
index 531a93d613d4f3f86eff5174cdbb1236b75cfb53..57f250c20e399851ca6998d9813dc60e3ffa3455 100644 (file)
@@ -352,7 +352,7 @@ static void __sco_sock_close(struct sock *sk)
 
        case BT_CONNECTED:
        case BT_CONFIG:
-               if (sco_pi(sk)->conn) {
+               if (sco_pi(sk)->conn->hcon) {
                        sk->sk_state = BT_DISCONN;
                        sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT);
                        hci_conn_put(sco_pi(sk)->conn->hcon);
index c31d9e8668c30346894adbf3be55eed4beeb1258..4425148d2b51592626b92a1451d9bc1208213fb8 100644 (file)
@@ -186,8 +186,6 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,
        struct fastopen_queue *fastopenq =
            inet_csk(lsk)->icsk_accept_queue.fastopenq;
 
-       BUG_ON(!spin_is_locked(&sk->sk_lock.slock) && !sock_owned_by_user(sk));
-
        tcp_sk(sk)->fastopen_rsk = NULL;
        spin_lock_bh(&fastopenq->lock);
        fastopenq->qlen--;
index 57fb1ee6649f65a0994d86c6f8763fe6e14ba081..905dcc6ad1e3b480c01f87df5157f4e37de112a1 100644 (file)
@@ -35,6 +35,7 @@
 #include <net/sock.h>
 #include <net/compat.h>
 #include <net/scm.h>
+#include <net/cls_cgroup.h>
 
 
 /*
@@ -302,8 +303,10 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
                }
                /* Bump the usage count and install the file. */
                sock = sock_from_file(fp[i], &err);
-               if (sock)
+               if (sock) {
                        sock_update_netprioidx(sock->sk, current);
+                       sock_update_classid(sock->sk, current);
+               }
                fd_install(new_fd, get_file(fp[i]));
        }
 
index 3ab989b0de42a0bfe7905ee99d98901ee9e9a075..a9a2ae3e2213a3769bd79df65229822768c09264 100644 (file)
@@ -1649,7 +1649,7 @@ static void sock_spd_release(struct splice_pipe_desc *spd, unsigned int i)
 
 static struct page *linear_to_page(struct page *page, unsigned int *len,
                                   unsigned int *offset,
-                                  struct sk_buff *skb, struct sock *sk)
+                                  struct sock *sk)
 {
        struct page_frag *pfrag = sk_page_frag(sk);
 
@@ -1682,14 +1682,14 @@ static bool spd_can_coalesce(const struct splice_pipe_desc *spd,
 static bool spd_fill_page(struct splice_pipe_desc *spd,
                          struct pipe_inode_info *pipe, struct page *page,
                          unsigned int *len, unsigned int offset,
-                         struct sk_buff *skb, bool linear,
+                         bool linear,
                          struct sock *sk)
 {
        if (unlikely(spd->nr_pages == MAX_SKB_FRAGS))
                return true;
 
        if (linear) {
-               page = linear_to_page(page, len, &offset, skb, sk);
+               page = linear_to_page(page, len, &offset, sk);
                if (!page)
                        return true;
        }
@@ -1706,23 +1706,9 @@ static bool spd_fill_page(struct splice_pipe_desc *spd,
        return false;
 }
 
-static inline void __segment_seek(struct page **page, unsigned int *poff,
-                                 unsigned int *plen, unsigned int off)
-{
-       unsigned long n;
-
-       *poff += off;
-       n = *poff / PAGE_SIZE;
-       if (n)
-               *page = nth_page(*page, n);
-
-       *poff = *poff % PAGE_SIZE;
-       *plen -= off;
-}
-
 static bool __splice_segment(struct page *page, unsigned int poff,
                             unsigned int plen, unsigned int *off,
-                            unsigned int *len, struct sk_buff *skb,
+                            unsigned int *len,
                             struct splice_pipe_desc *spd, bool linear,
                             struct sock *sk,
                             struct pipe_inode_info *pipe)
@@ -1737,23 +1723,19 @@ static bool __splice_segment(struct page *page, unsigned int poff,
        }
 
        /* ignore any bits we already processed */
-       if (*off) {
-               __segment_seek(&page, &poff, &plen, *off);
-               *off = 0;
-       }
+       poff += *off;
+       plen -= *off;
+       *off = 0;
 
        do {
                unsigned int flen = min(*len, plen);
 
-               /* the linear region may spread across several pages  */
-               flen = min_t(unsigned int, flen, PAGE_SIZE - poff);
-
-               if (spd_fill_page(spd, pipe, page, &flen, poff, skb, linear, sk))
+               if (spd_fill_page(spd, pipe, page, &flen, poff,
+                                 linear, sk))
                        return true;
-
-               __segment_seek(&page, &poff, &plen, flen);
+               poff += flen;
+               plen -= flen;
                *len -= flen;
-
        } while (*len && plen);
 
        return false;
@@ -1777,7 +1759,7 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
        if (__splice_segment(virt_to_page(skb->data),
                             (unsigned long) skb->data & (PAGE_SIZE - 1),
                             skb_headlen(skb),
-                            offset, len, skb, spd,
+                            offset, len, spd,
                             skb_head_is_locked(skb),
                             sk, pipe))
                return true;
@@ -1790,7 +1772,7 @@ static bool __skb_splice_bits(struct sk_buff *skb, struct pipe_inode_info *pipe,
 
                if (__splice_segment(skb_frag_page(f),
                                     f->page_offset, skb_frag_size(f),
-                                    offset, len, skb, spd, false, sk, pipe))
+                                    offset, len, spd, false, sk, pipe))
                        return true;
        }
 
index a0d8392491c3c3e947876c943457227e4ed4ad92..a69b4e4a02b5099043d98e5278355274e18ea72b 100644 (file)
@@ -269,7 +269,11 @@ static void ah_input_done(struct crypto_async_request *base, int err)
        skb->network_header += ah_hlen;
        memcpy(skb_network_header(skb), work_iph, ihl);
        __skb_pull(skb, ah_hlen + ihl);
-       skb_set_transport_header(skb, -ihl);
+
+       if (x->props.mode == XFRM_MODE_TUNNEL)
+               skb_reset_transport_header(skb);
+       else
+               skb_set_transport_header(skb, -ihl);
 out:
        kfree(AH_SKB_CB(skb)->tmp);
        xfrm_input_resume(skb, err);
@@ -381,7 +385,10 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
        skb->network_header += ah_hlen;
        memcpy(skb_network_header(skb), work_iph, ihl);
        __skb_pull(skb, ah_hlen + ihl);
-       skb_set_transport_header(skb, -ihl);
+       if (x->props.mode == XFRM_MODE_TUNNEL)
+               skb_reset_transport_header(skb);
+       else
+               skb_set_transport_header(skb, -ihl);
 
        err = nexthdr;
 
@@ -413,9 +420,12 @@ static void ah4_err(struct sk_buff *skb, u32 info)
        if (!x)
                return;
 
-       if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH)
+       if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) {
+               atomic_inc(&flow_cache_genid);
+               rt_genid_bump(net);
+
                ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0);
-       else
+       else
                ipv4_redirect(skb, net, 0, 0, IPPROTO_AH, 0);
        xfrm_state_put(x);
 }
index 424fafbc8cb02c49fb2dd3551f3583290f2fc330..b28e863fe0a7143b199bee51cfdf242c125f31cf 100644 (file)
@@ -85,3 +85,28 @@ out:
        return err;
 }
 EXPORT_SYMBOL(ip4_datagram_connect);
+
+void ip4_datagram_release_cb(struct sock *sk)
+{
+       const struct inet_sock *inet = inet_sk(sk);
+       const struct ip_options_rcu *inet_opt;
+       __be32 daddr = inet->inet_daddr;
+       struct flowi4 fl4;
+       struct rtable *rt;
+
+       if (! __sk_dst_get(sk) || __sk_dst_check(sk, 0))
+               return;
+
+       rcu_read_lock();
+       inet_opt = rcu_dereference(inet->inet_opt);
+       if (inet_opt && inet_opt->opt.srr)
+               daddr = inet_opt->opt.faddr;
+       rt = ip_route_output_ports(sock_net(sk), &fl4, sk, daddr,
+                                  inet->inet_saddr, inet->inet_dport,
+                                  inet->inet_sport, sk->sk_protocol,
+                                  RT_CONN_FLAGS(sk), sk->sk_bound_dev_if);
+       if (!IS_ERR(rt))
+               __sk_dst_set(sk, &rt->dst);
+       rcu_read_unlock();
+}
+EXPORT_SYMBOL_GPL(ip4_datagram_release_cb);
index b61e9deb7c7ecc9cae92ab0365b871a773627cc4..3b4f0cd2e63edbd136683577873b288712a4b92a 100644 (file)
@@ -346,7 +346,10 @@ static int esp_input_done2(struct sk_buff *skb, int err)
 
        pskb_trim(skb, skb->len - alen - padlen - 2);
        __skb_pull(skb, hlen);
-       skb_set_transport_header(skb, -ihl);
+       if (x->props.mode == XFRM_MODE_TUNNEL)
+               skb_reset_transport_header(skb);
+       else
+               skb_set_transport_header(skb, -ihl);
 
        err = nexthdr[1];
 
@@ -499,9 +502,12 @@ static void esp4_err(struct sk_buff *skb, u32 info)
        if (!x)
                return;
 
-       if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH)
+       if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) {
+               atomic_inc(&flow_cache_genid);
+               rt_genid_bump(net);
+
                ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ESP, 0);
-       else
+       else
                ipv4_redirect(skb, net, 0, 0, IPPROTO_ESP, 0);
        xfrm_state_put(x);
 }
index 303012adf9e6e0b442268b6f53b50ac8aea745fe..e81b1caf2ea2a0ceaa20ef8e1847ebd4f71cd98e 100644 (file)
@@ -963,8 +963,12 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
                        ptr--;
                }
                if (tunnel->parms.o_flags&GRE_CSUM) {
+                       int offset = skb_transport_offset(skb);
+
                        *ptr = 0;
-                       *(__sum16 *)ptr = ip_compute_csum((void *)(iph+1), skb->len - sizeof(struct iphdr));
+                       *(__sum16 *)ptr = csum_fold(skb_checksum(skb, offset,
+                                                                skb->len - offset,
+                                                                0));
                }
        }
 
index d3ab47e19a896277161c2bf1b87706c20ebd73be..9a46daed2f3c05be9ed82138edac731fcc571145 100644 (file)
@@ -47,9 +47,12 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
        if (!x)
                return;
 
-       if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH)
+       if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) {
+               atomic_inc(&flow_cache_genid);
+               rt_genid_bump(net);
+
                ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_COMP, 0);
-       else
+       else
                ipv4_redirect(skb, net, 0, 0, IPPROTO_COMP, 0);
        xfrm_state_put(x);
 }
index 8f3d05424a3e8f2f318c36bf007fd17724533997..6f9c07268cf6d433379898421e978d74fa49952f 100644 (file)
@@ -738,6 +738,7 @@ struct proto ping_prot = {
        .recvmsg =      ping_recvmsg,
        .bind =         ping_bind,
        .backlog_rcv =  ping_queue_rcv_skb,
+       .release_cb =   ip4_datagram_release_cb,
        .hash =         ping_v4_hash,
        .unhash =       ping_v4_unhash,
        .get_port =     ping_v4_get_port,
index 73d1e4df4bf630f176f385b96639b4e803469458..6f08991409c3ad9d3620357d04d1f59005f7e2fa 100644 (file)
@@ -894,6 +894,7 @@ struct proto raw_prot = {
        .recvmsg           = raw_recvmsg,
        .bind              = raw_bind,
        .backlog_rcv       = raw_rcv_skb,
+       .release_cb        = ip4_datagram_release_cb,
        .hash              = raw_hash_sk,
        .unhash            = raw_unhash_sk,
        .obj_size          = sizeof(struct raw_sock),
index 844a9ef60dbd89f459515101ebb0db6e7cfaa8a3..a0fcc47fee732744baf42bf1e61772faad87982d 100644 (file)
@@ -912,6 +912,9 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
        struct dst_entry *dst = &rt->dst;
        struct fib_result res;
 
+       if (dst_metric_locked(dst, RTAX_MTU))
+               return;
+
        if (dst->dev->mtu < mtu)
                return;
 
@@ -962,7 +965,7 @@ void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu,
 }
 EXPORT_SYMBOL_GPL(ipv4_update_pmtu);
 
-void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
+static void __ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
 {
        const struct iphdr *iph = (const struct iphdr *) skb->data;
        struct flowi4 fl4;
@@ -975,6 +978,53 @@ void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
                ip_rt_put(rt);
        }
 }
+
+void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
+{
+       const struct iphdr *iph = (const struct iphdr *) skb->data;
+       struct flowi4 fl4;
+       struct rtable *rt;
+       struct dst_entry *dst;
+       bool new = false;
+
+       bh_lock_sock(sk);
+       rt = (struct rtable *) __sk_dst_get(sk);
+
+       if (sock_owned_by_user(sk) || !rt) {
+               __ipv4_sk_update_pmtu(skb, sk, mtu);
+               goto out;
+       }
+
+       __build_flow_key(&fl4, sk, iph, 0, 0, 0, 0, 0);
+
+       if (!__sk_dst_check(sk, 0)) {
+               rt = ip_route_output_flow(sock_net(sk), &fl4, sk);
+               if (IS_ERR(rt))
+                       goto out;
+
+               new = true;
+       }
+
+       __ip_rt_update_pmtu((struct rtable *) rt->dst.path, &fl4, mtu);
+
+       dst = dst_check(&rt->dst, 0);
+       if (!dst) {
+               if (new)
+                       dst_release(&rt->dst);
+
+               rt = ip_route_output_flow(sock_net(sk), &fl4, sk);
+               if (IS_ERR(rt))
+                       goto out;
+
+               new = true;
+       }
+
+       if (new)
+               __sk_dst_set(sk, &rt->dst);
+
+out:
+       bh_unlock_sock(sk);
+}
 EXPORT_SYMBOL_GPL(ipv4_sk_update_pmtu);
 
 void ipv4_redirect(struct sk_buff *skb, struct net *net,
@@ -1120,7 +1170,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst)
        if (!mtu || time_after_eq(jiffies, rt->dst.expires))
                mtu = dst_metric_raw(dst, RTAX_MTU);
 
-       if (mtu && rt_is_output_route(rt))
+       if (mtu)
                return mtu;
 
        mtu = dst->dev->mtu;
index 54139fa514e6ee2d82c4cf9ca8528e012b546a90..70b09ef2463b3678c5da4a1d5fc0edb4656e4940 100644 (file)
@@ -369,11 +369,10 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
         * We do take care of PMTU discovery (RFC1191) special case :
         * we can receive locally generated ICMP messages while socket is held.
         */
-       if (sock_owned_by_user(sk) &&
-           type != ICMP_DEST_UNREACH &&
-           code != ICMP_FRAG_NEEDED)
-               NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
-
+       if (sock_owned_by_user(sk)) {
+               if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED))
+                       NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
+       }
        if (sk->sk_state == TCP_CLOSE)
                goto out;
 
index 79c8dbe59b5474bdc3e23ba8adc227e1bee016a4..1f4d405eafba746d2b8085132a740b17a6658c80 100644 (file)
@@ -1952,6 +1952,7 @@ struct proto udp_prot = {
        .recvmsg           = udp_recvmsg,
        .sendpage          = udp_sendpage,
        .backlog_rcv       = __udp_queue_rcv_skb,
+       .release_cb        = ip4_datagram_release_cb,
        .hash              = udp_lib_hash,
        .unhash            = udp_lib_unhash,
        .rehash            = udp_v4_rehash,
index ecc35b93314bb1b73c70df219c9cf8f125c77908..384233188ac1e38468b5edf71c105c21e6bf38bc 100644 (file)
@@ -472,7 +472,10 @@ static void ah6_input_done(struct crypto_async_request *base, int err)
        skb->network_header += ah_hlen;
        memcpy(skb_network_header(skb), work_iph, hdr_len);
        __skb_pull(skb, ah_hlen + hdr_len);
-       skb_set_transport_header(skb, -hdr_len);
+       if (x->props.mode == XFRM_MODE_TUNNEL)
+               skb_reset_transport_header(skb);
+       else
+               skb_set_transport_header(skb, -hdr_len);
 out:
        kfree(AH_SKB_CB(skb)->tmp);
        xfrm_input_resume(skb, err);
@@ -593,9 +596,13 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb)
 
        skb->network_header += ah_hlen;
        memcpy(skb_network_header(skb), work_iph, hdr_len);
-       skb->transport_header = skb->network_header;
        __skb_pull(skb, ah_hlen + hdr_len);
 
+       if (x->props.mode == XFRM_MODE_TUNNEL)
+               skb_reset_transport_header(skb);
+       else
+               skb_set_transport_header(skb, -hdr_len);
+
        err = nexthdr;
 
 out_free:
index 282f3723ee194704ab7fa0757e2c032254903300..40ffd72243a4f2d1ec9e5da494b3f2650dd027a6 100644 (file)
@@ -300,7 +300,10 @@ static int esp_input_done2(struct sk_buff *skb, int err)
 
        pskb_trim(skb, skb->len - alen - padlen - 2);
        __skb_pull(skb, hlen);
-       skb_set_transport_header(skb, -hdr_len);
+       if (x->props.mode == XFRM_MODE_TUNNEL)
+               skb_reset_transport_header(skb);
+       else
+               skb_set_transport_header(skb, -hdr_len);
 
        err = nexthdr[1];
 
index b4a9fd51dae74bd8143b2d32e791e089f1d8562f..fff5bdd8b6800d56679957a62e201e84fd846d09 100644 (file)
@@ -81,10 +81,22 @@ static inline struct sock *icmpv6_sk(struct net *net)
        return net->ipv6.icmp_sk[smp_processor_id()];
 }
 
+static void icmpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
+                      u8 type, u8 code, int offset, __be32 info)
+{
+       struct net *net = dev_net(skb->dev);
+
+       if (type == ICMPV6_PKT_TOOBIG)
+               ip6_update_pmtu(skb, net, info, 0, 0);
+       else if (type == NDISC_REDIRECT)
+               ip6_redirect(skb, net, 0, 0);
+}
+
 static int icmpv6_rcv(struct sk_buff *skb);
 
 static const struct inet6_protocol icmpv6_protocol = {
        .handler        =       icmpv6_rcv,
+       .err_handler    =       icmpv6_err,
        .flags          =       INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
 };
 
index 5552d13ae92f8554c04ec912b82317dfeef065a5..0c7c03d50dc0342c7caad25c9d24c3931c50438b 100644 (file)
@@ -1213,10 +1213,10 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
                if (dst_allfrag(rt->dst.path))
                        cork->flags |= IPCORK_ALLFRAG;
                cork->length = 0;
-               exthdrlen = (opt ? opt->opt_flen : 0) - rt->rt6i_nfheader_len;
+               exthdrlen = (opt ? opt->opt_flen : 0);
                length += exthdrlen;
                transhdrlen += exthdrlen;
-               dst_exthdrlen = rt->dst.header_len;
+               dst_exthdrlen = rt->dst.header_len - rt->rt6i_nfheader_len;
        } else {
                rt = (struct rt6_info *)cork->dst;
                fl6 = &inet->cork.fl.u.ip6;
index 26dcdec9e3a5f6cbbe799402c39bb5d09c9d561d..8fd154e5f07966dd049bcdb8e93d9f7b8ab5452e 100644 (file)
@@ -1710,6 +1710,9 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
                        return -EINVAL;
                if (get_user(v, (u32 __user *)optval))
                        return -EFAULT;
+               /* "pim6reg%u" should not exceed 16 bytes (IFNAMSIZ) */
+               if (v != RT_TABLE_DEFAULT && v >= 100000000)
+                       return -EINVAL;
                if (sk == mrt->mroute6_sk)
                        return -EBUSY;
 
index 47e0aca614b78462e876cbdb5cbd31695af630c5..516fbc96feff11831a9ad308541e6bdc16a7089d 100644 (file)
@@ -164,7 +164,17 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
                        sta = sta_info_get(sdata, mac_addr);
                else
                        sta = sta_info_get_bss(sdata, mac_addr);
-               if (!sta) {
+               /*
+                * The ASSOC test makes sure the driver is ready to
+                * receive the key. When wpa_supplicant has roamed
+                * using FT, it attempts to set the key before
+                * association has completed, this rejects that attempt
+                * so it will set the key again after assocation.
+                *
+                * TODO: accept the key if we have a station entry and
+                *       add it to the device after the station.
+                */
+               if (!sta || !test_sta_flag(sta, WLAN_STA_ASSOC)) {
                        ieee80211_key_free(sdata->local, key);
                        err = -ENOENT;
                        goto out_unlock;
index 8563b9a5cac325aa8ddb5fe817712462de2b6561..2ed065c095629403c42574872fec6a8b85819871 100644 (file)
@@ -1358,10 +1358,8 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
 void ieee80211_sched_scan_stopped_work(struct work_struct *work);
 
 /* off-channel helpers */
-void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
-                                   bool offchannel_ps_enable);
-void ieee80211_offchannel_return(struct ieee80211_local *local,
-                                bool offchannel_ps_disable);
+void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local);
+void ieee80211_offchannel_return(struct ieee80211_local *local);
 void ieee80211_roc_setup(struct ieee80211_local *local);
 void ieee80211_start_next_roc(struct ieee80211_local *local);
 void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata);
index 47aeee2d8db160f6fa9eb62c32131bbd686acc29..2659e428b80c86cf367a75b034c8d89a856f28a1 100644 (file)
@@ -215,6 +215,7 @@ static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata,
        skb->priority = 7;
 
        info->control.vif = &sdata->vif;
+       info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
        ieee80211_set_qos_hdr(sdata, skb);
 }
 
@@ -246,11 +247,13 @@ int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn,
                return -EAGAIN;
 
        skb = dev_alloc_skb(local->tx_headroom +
+                           IEEE80211_ENCRYPT_HEADROOM +
+                           IEEE80211_ENCRYPT_TAILROOM +
                            hdr_len +
                            2 + 15 /* PERR IE */);
        if (!skb)
                return -1;
-       skb_reserve(skb, local->tx_headroom);
+       skb_reserve(skb, local->tx_headroom + IEEE80211_ENCRYPT_HEADROOM);
        mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
        memset(mgmt, 0, hdr_len);
        mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
index a5379aea7d09d2410c70a3b467a1f336aa32dc43..a3ad4c3c80a34229801bdbdd1124201485a2f671 100644 (file)
@@ -102,8 +102,7 @@ static void ieee80211_offchannel_ps_disable(struct ieee80211_sub_if_data *sdata)
        ieee80211_sta_reset_conn_monitor(sdata);
 }
 
-void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
-                                   bool offchannel_ps_enable)
+void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local)
 {
        struct ieee80211_sub_if_data *sdata;
 
@@ -134,8 +133,7 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
 
                if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
                        netif_tx_stop_all_queues(sdata->dev);
-                       if (offchannel_ps_enable &&
-                           (sdata->vif.type == NL80211_IFTYPE_STATION) &&
+                       if (sdata->vif.type == NL80211_IFTYPE_STATION &&
                            sdata->u.mgd.associated)
                                ieee80211_offchannel_ps_enable(sdata);
                }
@@ -143,8 +141,7 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
        mutex_unlock(&local->iflist_mtx);
 }
 
-void ieee80211_offchannel_return(struct ieee80211_local *local,
-                                bool offchannel_ps_disable)
+void ieee80211_offchannel_return(struct ieee80211_local *local)
 {
        struct ieee80211_sub_if_data *sdata;
 
@@ -163,11 +160,9 @@ void ieee80211_offchannel_return(struct ieee80211_local *local,
                        continue;
 
                /* Tell AP we're back */
-               if (offchannel_ps_disable &&
-                   sdata->vif.type == NL80211_IFTYPE_STATION) {
-                       if (sdata->u.mgd.associated)
-                               ieee80211_offchannel_ps_disable(sdata);
-               }
+               if (sdata->vif.type == NL80211_IFTYPE_STATION &&
+                   sdata->u.mgd.associated)
+                       ieee80211_offchannel_ps_disable(sdata);
 
                if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
                        /*
@@ -385,7 +380,7 @@ void ieee80211_sw_roc_work(struct work_struct *work)
                        local->tmp_channel = NULL;
                        ieee80211_hw_config(local, 0);
 
-                       ieee80211_offchannel_return(local, true);
+                       ieee80211_offchannel_return(local);
                }
 
                ieee80211_recalc_idle(local);
index d59fc6818b1cc7c8d239e579166c04aa56461553..bf82e69d0601bf9210e817837b2af7725a9f7d87 100644 (file)
@@ -292,7 +292,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
        if (!was_hw_scan) {
                ieee80211_configure_filter(local);
                drv_sw_scan_complete(local);
-               ieee80211_offchannel_return(local, true);
+               ieee80211_offchannel_return(local);
        }
 
        ieee80211_recalc_idle(local);
@@ -341,7 +341,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
        local->next_scan_state = SCAN_DECISION;
        local->scan_channel_idx = 0;
 
-       ieee80211_offchannel_stop_vifs(local, true);
+       ieee80211_offchannel_stop_vifs(local);
 
        ieee80211_configure_filter(local);
 
@@ -678,12 +678,8 @@ static void ieee80211_scan_state_suspend(struct ieee80211_local *local,
        local->scan_channel = NULL;
        ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
 
-       /*
-        * Re-enable vifs and beaconing.  Leave PS
-        * in off-channel state..will put that back
-        * on-channel at the end of scanning.
-        */
-       ieee80211_offchannel_return(local, false);
+       /* disable PS */
+       ieee80211_offchannel_return(local);
 
        *next_delay = HZ / 5;
        /* afterwards, resume scan & go to next channel */
@@ -693,8 +689,7 @@ static void ieee80211_scan_state_suspend(struct ieee80211_local *local,
 static void ieee80211_scan_state_resume(struct ieee80211_local *local,
                                        unsigned long *next_delay)
 {
-       /* PS already is in off-channel mode */
-       ieee80211_offchannel_stop_vifs(local, false);
+       ieee80211_offchannel_stop_vifs(local);
 
        if (local->ops->flush) {
                drv_flush(local, false);
index e9eadc40c09cc20bce9ad37531ef45ae767f62e8..467c1d1b66f2f5615182abd689349027b88abe64 100644 (file)
@@ -1673,10 +1673,13 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
                        chanctx_conf =
                                rcu_dereference(tmp_sdata->vif.chanctx_conf);
        }
-       if (!chanctx_conf)
-               goto fail_rcu;
 
-       chan = chanctx_conf->def.chan;
+       if (chanctx_conf)
+               chan = chanctx_conf->def.chan;
+       else if (!local->use_chanctx)
+               chan = local->_oper_channel;
+       else
+               goto fail_rcu;
 
        /*
         * Frame injection is not allowed if beaconing is not allowed
index 016d95ead930cba8e6d2e9335cd2b64f473c09d1..e4a0c4fb3a7cef64d1f15c9173d5a3e62ad616b4 100644 (file)
@@ -1376,11 +1376,12 @@ void nf_conntrack_cleanup(struct net *net)
        synchronize_net();
        nf_conntrack_proto_fini(net);
        nf_conntrack_cleanup_net(net);
+}
 
-       if (net_eq(net, &init_net)) {
-               RCU_INIT_POINTER(nf_ct_destroy, NULL);
-               nf_conntrack_cleanup_init_net();
-       }
+void nf_conntrack_cleanup_end(void)
+{
+       RCU_INIT_POINTER(nf_ct_destroy, NULL);
+       nf_conntrack_cleanup_init_net();
 }
 
 void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls)
index 363285d544a1c7402152e6a7da3a7129d94b83ae..e7185c68481659445b571ab5e7866728dd3947ec 100644 (file)
@@ -575,6 +575,7 @@ static int __init nf_conntrack_standalone_init(void)
 static void __exit nf_conntrack_standalone_fini(void)
 {
        unregister_pernet_subsys(&nf_conntrack_net_ops);
+       nf_conntrack_cleanup_end();
 }
 
 module_init(nf_conntrack_standalone_init);
index 8d987c3573fd4ca9e1708e188d487e53ebd7dfd7..7b3a9e5999c0664cebe524fefba7130a6df003ce 100644 (file)
@@ -345,19 +345,27 @@ int xt_find_revision(u8 af, const char *name, u8 revision, int target,
 }
 EXPORT_SYMBOL_GPL(xt_find_revision);
 
-static char *textify_hooks(char *buf, size_t size, unsigned int mask)
+static char *
+textify_hooks(char *buf, size_t size, unsigned int mask, uint8_t nfproto)
 {
-       static const char *const names[] = {
+       static const char *const inetbr_names[] = {
                "PREROUTING", "INPUT", "FORWARD",
                "OUTPUT", "POSTROUTING", "BROUTING",
        };
-       unsigned int i;
+       static const char *const arp_names[] = {
+               "INPUT", "FORWARD", "OUTPUT",
+       };
+       const char *const *names;
+       unsigned int i, max;
        char *p = buf;
        bool np = false;
        int res;
 
+       names = (nfproto == NFPROTO_ARP) ? arp_names : inetbr_names;
+       max   = (nfproto == NFPROTO_ARP) ? ARRAY_SIZE(arp_names) :
+                                          ARRAY_SIZE(inetbr_names);
        *p = '\0';
-       for (i = 0; i < ARRAY_SIZE(names); ++i) {
+       for (i = 0; i < max; ++i) {
                if (!(mask & (1 << i)))
                        continue;
                res = snprintf(p, size, "%s%s", np ? "/" : "", names[i]);
@@ -402,8 +410,10 @@ int xt_check_match(struct xt_mtchk_param *par,
                pr_err("%s_tables: %s match: used from hooks %s, but only "
                       "valid from %s\n",
                       xt_prefix[par->family], par->match->name,
-                      textify_hooks(used, sizeof(used), par->hook_mask),
-                      textify_hooks(allow, sizeof(allow), par->match->hooks));
+                      textify_hooks(used, sizeof(used), par->hook_mask,
+                                    par->family),
+                      textify_hooks(allow, sizeof(allow), par->match->hooks,
+                                    par->family));
                return -EINVAL;
        }
        if (par->match->proto && (par->match->proto != proto || inv_proto)) {
@@ -575,8 +585,10 @@ int xt_check_target(struct xt_tgchk_param *par,
                pr_err("%s_tables: %s target: used from hooks %s, but only "
                       "usable from %s\n",
                       xt_prefix[par->family], par->target->name,
-                      textify_hooks(used, sizeof(used), par->hook_mask),
-                      textify_hooks(allow, sizeof(allow), par->target->hooks));
+                      textify_hooks(used, sizeof(used), par->hook_mask,
+                                    par->family),
+                      textify_hooks(allow, sizeof(allow), par->target->hooks,
+                                    par->family));
                return -EINVAL;
        }
        if (par->target->proto && (par->target->proto != proto || inv_proto)) {
index 2a0843081840c0cd937a3fb0e749965bf9e28d0c..bde009ed8d3bf36d6defdbdbad8aca991c539281 100644 (file)
@@ -109,7 +109,7 @@ static int xt_ct_tg_check_v0(const struct xt_tgchk_param *par)
        struct xt_ct_target_info *info = par->targinfo;
        struct nf_conntrack_tuple t;
        struct nf_conn *ct;
-       int ret;
+       int ret = -EOPNOTSUPP;
 
        if (info->flags & ~XT_CT_NOTRACK)
                return -EINVAL;
@@ -247,7 +247,7 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
        struct xt_ct_target_info_v1 *info = par->targinfo;
        struct nf_conntrack_tuple t;
        struct nf_conn *ct;
-       int ret;
+       int ret = -EOPNOTSUPP;
 
        if (info->flags & ~XT_CT_NOTRACK)
                return -EINVAL;
index 379c81dee9d1256b3a1af84b84bc23b28092f12b..9bcdbd02d77713a5973dd9afd71a9c4783919648 100644 (file)
@@ -224,7 +224,7 @@ void sctp_outq_init(struct sctp_association *asoc, struct sctp_outq *q)
 
 /* Free the outqueue structure and any related pending chunks.
  */
-void sctp_outq_teardown(struct sctp_outq *q)
+static void __sctp_outq_teardown(struct sctp_outq *q)
 {
        struct sctp_transport *transport;
        struct list_head *lchunk, *temp;
@@ -277,8 +277,6 @@ void sctp_outq_teardown(struct sctp_outq *q)
                sctp_chunk_free(chunk);
        }
 
-       q->error = 0;
-
        /* Throw away any leftover control chunks. */
        list_for_each_entry_safe(chunk, tmp, &q->control_chunk_list, list) {
                list_del_init(&chunk->list);
@@ -286,11 +284,17 @@ void sctp_outq_teardown(struct sctp_outq *q)
        }
 }
 
+void sctp_outq_teardown(struct sctp_outq *q)
+{
+       __sctp_outq_teardown(q);
+       sctp_outq_init(q->asoc, q);
+}
+
 /* Free the outqueue structure and any related pending chunks.  */
 void sctp_outq_free(struct sctp_outq *q)
 {
        /* Throw away leftover chunks. */
-       sctp_outq_teardown(q);
+       __sctp_outq_teardown(q);
 
        /* If we were kmalloc()'d, free the memory.  */
        if (q->malloced)
index 618ec7e216cae9bb17038c07ff5d87a75c8f6208..5131fcfedb03c0b09e8c7e451341cebd82e49692 100644 (file)
@@ -1779,8 +1779,10 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net,
 
        /* Update the content of current association. */
        sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
-       sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
        sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev));
+       sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
+                       SCTP_STATE(SCTP_STATE_ESTABLISHED));
+       sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
        return SCTP_DISPOSITION_CONSUME;
 
 nomem_ev:
index 043889ac86c0419b3d368481b202864077034efa..bf3c6e8fc4017a64f93ff91c0ce96c8debbf44f4 100644 (file)
@@ -366,7 +366,11 @@ int sctp_sysctl_net_register(struct net *net)
 
 void sctp_sysctl_net_unregister(struct net *net)
 {
+       struct ctl_table *table;
+
+       table = net->sctp.sysctl_header->ctl_table_arg;
        unregister_net_sysctl_table(net->sctp.sysctl_header);
+       kfree(table);
 }
 
 static struct ctl_table_header * sctp_sysctl_header;
index bfa31714581f52e27f51c312aa0288a9cb4fd411..fb20f25ddec9b70c805ad65d675441d02b62055b 100644 (file)
@@ -98,9 +98,25 @@ __rpc_add_timer(struct rpc_wait_queue *queue, struct rpc_task *task)
        list_add(&task->u.tk_wait.timer_list, &queue->timer_list.list);
 }
 
+static void rpc_rotate_queue_owner(struct rpc_wait_queue *queue)
+{
+       struct list_head *q = &queue->tasks[queue->priority];
+       struct rpc_task *task;
+
+       if (!list_empty(q)) {
+               task = list_first_entry(q, struct rpc_task, u.tk_wait.list);
+               if (task->tk_owner == queue->owner)
+                       list_move_tail(&task->u.tk_wait.list, q);
+       }
+}
+
 static void rpc_set_waitqueue_priority(struct rpc_wait_queue *queue, int priority)
 {
-       queue->priority = priority;
+       if (queue->priority != priority) {
+               /* Fairness: rotate the list when changing priority */
+               rpc_rotate_queue_owner(queue);
+               queue->priority = priority;
+       }
 }
 
 static void rpc_set_waitqueue_owner(struct rpc_wait_queue *queue, pid_t pid)
index 41eabc46f110d9cb607cb24f8af68054b91bcccd..07c585756d2a52530dc3fd1f5b14192b1a3c4cd6 100644 (file)
@@ -2656,7 +2656,7 @@ static void xfrm_policy_fini(struct net *net)
                WARN_ON(!hlist_empty(&net->xfrm.policy_inexact[dir]));
 
                htab = &net->xfrm.policy_bydst[dir];
-               sz = (htab->hmask + 1);
+               sz = (htab->hmask + 1) * sizeof(struct hlist_head);
                WARN_ON(!hlist_empty(htab->table));
                xfrm_hash_free(htab->table, sz);
        }
index 765f6fe951ebc7ed8fabaed3a4dc6ea4299aebfa..35754cc8a9e5b9c51cdaf52693128ee2098718f7 100644 (file)
@@ -242,11 +242,13 @@ static void xfrm_replay_advance_bmp(struct xfrm_state *x, __be32 net_seq)
        u32 diff;
        struct xfrm_replay_state_esn *replay_esn = x->replay_esn;
        u32 seq = ntohl(net_seq);
-       u32 pos = (replay_esn->seq - 1) % replay_esn->replay_window;
+       u32 pos;
 
        if (!replay_esn->replay_window)
                return;
 
+       pos = (replay_esn->seq - 1) % replay_esn->replay_window;
+
        if (seq > replay_esn->seq) {
                diff = seq - replay_esn->seq;
 
index 0fe5a026aef8d22ac83619dd0bbc2ba50965b63e..579775088967fdb11a044beb75c70de48d572ad6 100644 (file)
@@ -709,16 +709,31 @@ static void cap_req_classify_flow(const struct request_sock *req,
 {
 }
 
+static int cap_tun_dev_alloc_security(void **security)
+{
+       return 0;
+}
+
+static void cap_tun_dev_free_security(void *security)
+{
+}
+
 static int cap_tun_dev_create(void)
 {
        return 0;
 }
 
-static void cap_tun_dev_post_create(struct sock *sk)
+static int cap_tun_dev_attach_queue(void *security)
+{
+       return 0;
+}
+
+static int cap_tun_dev_attach(struct sock *sk, void *security)
 {
+       return 0;
 }
 
-static int cap_tun_dev_attach(struct sock *sk)
+static int cap_tun_dev_open(void *security)
 {
        return 0;
 }
@@ -1050,8 +1065,11 @@ void __init security_fixup_ops(struct security_operations *ops)
        set_to_cap_if_null(ops, secmark_refcount_inc);
        set_to_cap_if_null(ops, secmark_refcount_dec);
        set_to_cap_if_null(ops, req_classify_flow);
+       set_to_cap_if_null(ops, tun_dev_alloc_security);
+       set_to_cap_if_null(ops, tun_dev_free_security);
        set_to_cap_if_null(ops, tun_dev_create);
-       set_to_cap_if_null(ops, tun_dev_post_create);
+       set_to_cap_if_null(ops, tun_dev_open);
+       set_to_cap_if_null(ops, tun_dev_attach_queue);
        set_to_cap_if_null(ops, tun_dev_attach);
 #endif /* CONFIG_SECURITY_NETWORK */
 #ifdef CONFIG_SECURITY_NETWORK_XFRM
index daa97f4ac9d13515909028bf1ffa6903d8aed0c7..7b88c6aeaed43e5f37b449fd8ec87610b3b69a93 100644 (file)
@@ -1254,24 +1254,42 @@ void security_secmark_refcount_dec(void)
 }
 EXPORT_SYMBOL(security_secmark_refcount_dec);
 
+int security_tun_dev_alloc_security(void **security)
+{
+       return security_ops->tun_dev_alloc_security(security);
+}
+EXPORT_SYMBOL(security_tun_dev_alloc_security);
+
+void security_tun_dev_free_security(void *security)
+{
+       security_ops->tun_dev_free_security(security);
+}
+EXPORT_SYMBOL(security_tun_dev_free_security);
+
 int security_tun_dev_create(void)
 {
        return security_ops->tun_dev_create();
 }
 EXPORT_SYMBOL(security_tun_dev_create);
 
-void security_tun_dev_post_create(struct sock *sk)
+int security_tun_dev_attach_queue(void *security)
 {
-       return security_ops->tun_dev_post_create(sk);
+       return security_ops->tun_dev_attach_queue(security);
 }
-EXPORT_SYMBOL(security_tun_dev_post_create);
+EXPORT_SYMBOL(security_tun_dev_attach_queue);
 
-int security_tun_dev_attach(struct sock *sk)
+int security_tun_dev_attach(struct sock *sk, void *security)
 {
-       return security_ops->tun_dev_attach(sk);
+       return security_ops->tun_dev_attach(sk, security);
 }
 EXPORT_SYMBOL(security_tun_dev_attach);
 
+int security_tun_dev_open(void *security)
+{
+       return security_ops->tun_dev_open(security);
+}
+EXPORT_SYMBOL(security_tun_dev_open);
+
 #endif /* CONFIG_SECURITY_NETWORK */
 
 #ifdef CONFIG_SECURITY_NETWORK_XFRM
index 61a53367d0292600fbb2d11da95c21118164fca4..ef26e9611ffbab91ad50faefa81a56a425cefb93 100644 (file)
@@ -4399,6 +4399,24 @@ static void selinux_req_classify_flow(const struct request_sock *req,
        fl->flowi_secid = req->secid;
 }
 
+static int selinux_tun_dev_alloc_security(void **security)
+{
+       struct tun_security_struct *tunsec;
+
+       tunsec = kzalloc(sizeof(*tunsec), GFP_KERNEL);
+       if (!tunsec)
+               return -ENOMEM;
+       tunsec->sid = current_sid();
+
+       *security = tunsec;
+       return 0;
+}
+
+static void selinux_tun_dev_free_security(void *security)
+{
+       kfree(security);
+}
+
 static int selinux_tun_dev_create(void)
 {
        u32 sid = current_sid();
@@ -4414,8 +4432,17 @@ static int selinux_tun_dev_create(void)
                            NULL);
 }
 
-static void selinux_tun_dev_post_create(struct sock *sk)
+static int selinux_tun_dev_attach_queue(void *security)
 {
+       struct tun_security_struct *tunsec = security;
+
+       return avc_has_perm(current_sid(), tunsec->sid, SECCLASS_TUN_SOCKET,
+                           TUN_SOCKET__ATTACH_QUEUE, NULL);
+}
+
+static int selinux_tun_dev_attach(struct sock *sk, void *security)
+{
+       struct tun_security_struct *tunsec = security;
        struct sk_security_struct *sksec = sk->sk_security;
 
        /* we don't currently perform any NetLabel based labeling here and it
@@ -4425,20 +4452,19 @@ static void selinux_tun_dev_post_create(struct sock *sk)
         * cause confusion to the TUN user that had no idea network labeling
         * protocols were being used */
 
-       /* see the comments in selinux_tun_dev_create() about why we don't use
-        * the sockcreate SID here */
-
-       sksec->sid = current_sid();
+       sksec->sid = tunsec->sid;
        sksec->sclass = SECCLASS_TUN_SOCKET;
+
+       return 0;
 }
 
-static int selinux_tun_dev_attach(struct sock *sk)
+static int selinux_tun_dev_open(void *security)
 {
-       struct sk_security_struct *sksec = sk->sk_security;
+       struct tun_security_struct *tunsec = security;
        u32 sid = current_sid();
        int err;
 
-       err = avc_has_perm(sid, sksec->sid, SECCLASS_TUN_SOCKET,
+       err = avc_has_perm(sid, tunsec->sid, SECCLASS_TUN_SOCKET,
                           TUN_SOCKET__RELABELFROM, NULL);
        if (err)
                return err;
@@ -4446,8 +4472,7 @@ static int selinux_tun_dev_attach(struct sock *sk)
                           TUN_SOCKET__RELABELTO, NULL);
        if (err)
                return err;
-
-       sksec->sid = sid;
+       tunsec->sid = sid;
 
        return 0;
 }
@@ -5642,9 +5667,12 @@ static struct security_operations selinux_ops = {
        .secmark_refcount_inc =         selinux_secmark_refcount_inc,
        .secmark_refcount_dec =         selinux_secmark_refcount_dec,
        .req_classify_flow =            selinux_req_classify_flow,
+       .tun_dev_alloc_security =       selinux_tun_dev_alloc_security,
+       .tun_dev_free_security =        selinux_tun_dev_free_security,
        .tun_dev_create =               selinux_tun_dev_create,
-       .tun_dev_post_create =          selinux_tun_dev_post_create,
+       .tun_dev_attach_queue =         selinux_tun_dev_attach_queue,
        .tun_dev_attach =               selinux_tun_dev_attach,
+       .tun_dev_open =                 selinux_tun_dev_open,
 
 #ifdef CONFIG_SECURITY_NETWORK_XFRM
        .xfrm_policy_alloc_security =   selinux_xfrm_policy_alloc,
index df2de54a958debfab56caf3483cd5d93856e5be4..14d04e63b1f0e09ef15b4cf64057bd7cc861ed1d 100644 (file)
@@ -150,6 +150,6 @@ struct security_class_mapping secclass_map[] = {
            NULL } },
        { "kernel_service", { "use_as_override", "create_files_as", NULL } },
        { "tun_socket",
-         { COMMON_SOCK_PERMS, NULL } },
+         { COMMON_SOCK_PERMS, "attach_queue", NULL } },
        { NULL }
   };
index 26c7eee1c309b0a2f45a23c8b70d2157841c1670..aa47bcabb5f65e728aadbaa39cdecfa55d20aa16 100644 (file)
@@ -110,6 +110,10 @@ struct sk_security_struct {
        u16 sclass;                     /* sock security class */
 };
 
+struct tun_security_struct {
+       u32 sid;                        /* SID for the tun device sockets */
+};
+
 struct key_security_struct {
        u32 sid;        /* SID of key */
 };
index 0b6aebacc56b6bb2df187dbaf3604e2c28aef784..c78286f6e5d8133e070d34e3927a12c70be626f1 100644 (file)
@@ -656,29 +656,43 @@ static char *driver_short_names[] = {
 #define get_azx_dev(substream) (substream->runtime->private_data)
 
 #ifdef CONFIG_X86
-static void __mark_pages_wc(struct azx *chip, void *addr, size_t size, bool on)
+static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on)
 {
+       int pages;
+
        if (azx_snoop(chip))
                return;
-       if (addr && size) {
-               int pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
+       if (!dmab || !dmab->area || !dmab->bytes)
+               return;
+
+#ifdef CONFIG_SND_DMA_SGBUF
+       if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_SG) {
+               struct snd_sg_buf *sgbuf = dmab->private_data;
                if (on)
-                       set_memory_wc((unsigned long)addr, pages);
+                       set_pages_array_wc(sgbuf->page_table, sgbuf->pages);
                else
-                       set_memory_wb((unsigned long)addr, pages);
+                       set_pages_array_wb(sgbuf->page_table, sgbuf->pages);
+               return;
        }
+#endif
+
+       pages = (dmab->bytes + PAGE_SIZE - 1) >> PAGE_SHIFT;
+       if (on)
+               set_memory_wc((unsigned long)dmab->area, pages);
+       else
+               set_memory_wb((unsigned long)dmab->area, pages);
 }
 
 static inline void mark_pages_wc(struct azx *chip, struct snd_dma_buffer *buf,
                                 bool on)
 {
-       __mark_pages_wc(chip, buf->area, buf->bytes, on);
+       __mark_pages_wc(chip, buf, on);
 }
 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev,
-                                  struct snd_pcm_runtime *runtime, bool on)
+                                  struct snd_pcm_substream *substream, bool on)
 {
        if (azx_dev->wc_marked != on) {
-               __mark_pages_wc(chip, runtime->dma_area, runtime->dma_bytes, on);
+               __mark_pages_wc(chip, snd_pcm_get_dma_buf(substream), on);
                azx_dev->wc_marked = on;
        }
 }
@@ -689,7 +703,7 @@ static inline void mark_pages_wc(struct azx *chip, struct snd_dma_buffer *buf,
 {
 }
 static inline void mark_runtime_wc(struct azx *chip, struct azx_dev *azx_dev,
-                                  struct snd_pcm_runtime *runtime, bool on)
+                                  struct snd_pcm_substream *substream, bool on)
 {
 }
 #endif
@@ -1968,11 +1982,10 @@ static int azx_pcm_hw_params(struct snd_pcm_substream *substream,
 {
        struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
        struct azx *chip = apcm->chip;
-       struct snd_pcm_runtime *runtime = substream->runtime;
        struct azx_dev *azx_dev = get_azx_dev(substream);
        int ret;
 
-       mark_runtime_wc(chip, azx_dev, runtime, false);
+       mark_runtime_wc(chip, azx_dev, substream, false);
        azx_dev->bufsize = 0;
        azx_dev->period_bytes = 0;
        azx_dev->format_val = 0;
@@ -1980,7 +1993,7 @@ static int azx_pcm_hw_params(struct snd_pcm_substream *substream,
                                        params_buffer_bytes(hw_params));
        if (ret < 0)
                return ret;
-       mark_runtime_wc(chip, azx_dev, runtime, true);
+       mark_runtime_wc(chip, azx_dev, substream, true);
        return ret;
 }
 
@@ -1989,7 +2002,6 @@ static int azx_pcm_hw_free(struct snd_pcm_substream *substream)
        struct azx_pcm *apcm = snd_pcm_substream_chip(substream);
        struct azx_dev *azx_dev = get_azx_dev(substream);
        struct azx *chip = apcm->chip;
-       struct snd_pcm_runtime *runtime = substream->runtime;
        struct hda_pcm_stream *hinfo = apcm->hinfo[substream->stream];
 
        /* reset BDL address */
@@ -2002,7 +2014,7 @@ static int azx_pcm_hw_free(struct snd_pcm_substream *substream)
 
        snd_hda_codec_cleanup(apcm->codec, hinfo, substream);
 
-       mark_runtime_wc(chip, azx_dev, runtime, false);
+       mark_runtime_wc(chip, azx_dev, substream, false);
        return snd_pcm_lib_free_pages(substream);
 }
 
@@ -3613,13 +3625,12 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
        /* 5 Series/3400 */
        { PCI_DEVICE(0x8086, 0x3b56),
          .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH },
-       /* SCH */
+       /* Poulsbo */
        { PCI_DEVICE(0x8086, 0x811b),
-         .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |
-         AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_LPIB }, /* Poulsbo */
+         .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },
+       /* Oaktrail */
        { PCI_DEVICE(0x8086, 0x080a),
-         .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_SCH_SNOOP |
-         AZX_DCAPS_BUFSIZE | AZX_DCAPS_POSFIX_LPIB }, /* Oaktrail */
+         .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },
        /* ICH */
        { PCI_DEVICE(0x8086, 0x2668),
          .driver_data = AZX_DRIVER_ICH | AZX_DCAPS_OLD_SSYNC |
index cf38861711095b3279fede741adce3467d5e0984..5faaad219a7f37e588e8b5a27b298cbb7adfa69d 100644 (file)
@@ -4694,6 +4694,7 @@ static const struct snd_pci_quirk alc880_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
        SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
        SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
+       SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST),
        SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_FIXUP_F1734),
        SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
        SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
@@ -5708,6 +5709,7 @@ static const struct alc_model_fixup alc268_fixup_models[] = {
 };
 
 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
+       SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
        /* below is codec SSID since multiple Toshiba laptops have the
         * same PCI SSID 1179:ff00
         */
index 1d8bb591759435d5bca70cee52f81c6bbe81ed94..ef62c435848eb776421776d7e80e90527e3f2b72 100644 (file)
@@ -685,7 +685,7 @@ static int arizona_hw_params(struct snd_pcm_substream *substream,
        }
        sr_val = i;
 
-       lrclk = snd_soc_params_to_bclk(params) / params_rate(params);
+       lrclk = rates[bclk] / params_rate(params);
 
        arizona_aif_dbg(dai, "BCLK %dHz LRCLK %dHz\n",
                        rates[bclk], rates[bclk] / lrclk);
@@ -1082,6 +1082,9 @@ int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq,
                        id, ret);
        }
 
+       regmap_update_bits(arizona->regmap, fll->base + 1,
+                          ARIZONA_FLL1_FREERUN, 0);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(arizona_init_fll);
index e6cefe1ac677fcd6cd0610b148300be39858cc36..d8c65f5746583474b4cdfb286d339c512f3562d6 100644 (file)
@@ -1019,8 +1019,6 @@ static const char *wm2200_mixer_texts[] = {
        "EQR",
        "LHPF1",
        "LHPF2",
-       "LHPF3",
-       "LHPF4",
        "DSP1.1",
        "DSP1.2",
        "DSP1.3",
@@ -1053,7 +1051,6 @@ static int wm2200_mixer_values[] = {
        0x25,
        0x50,   /* EQ */
        0x51,
-       0x52,
        0x60,   /* LHPF1 */
        0x61,   /* LHPF2 */
        0x68,   /* DSP1 */
index 7a9048dad1cdfd66e1f33a4d9a45b4642c387125..1440b3f9b7bbe1e04afdfd3d6857808f52972fa9 100644 (file)
@@ -896,8 +896,7 @@ static const unsigned int wm5102_aec_loopback_values[] = {
 
 static const struct soc_enum wm5102_aec_loopback =
        SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1,
-                             ARIZONA_AEC_LOOPBACK_SRC_SHIFT,
-                             ARIZONA_AEC_LOOPBACK_SRC_MASK,
+                             ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf,
                              ARRAY_SIZE(wm5102_aec_loopback_texts),
                              wm5102_aec_loopback_texts,
                              wm5102_aec_loopback_values);
index ae80c8c285360cffd1ef82af06626ceccf2769d2..7a090968c4f737bd360f05c2c7a66dc362350d21 100644 (file)
@@ -344,8 +344,7 @@ static const unsigned int wm5110_aec_loopback_values[] = {
 
 static const struct soc_enum wm5110_aec_loopback =
        SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1,
-                             ARIZONA_AEC_LOOPBACK_SRC_SHIFT,
-                             ARIZONA_AEC_LOOPBACK_SRC_MASK,
+                             ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf,
                              ARRAY_SIZE(wm5110_aec_loopback_texts),
                              wm5110_aec_loopback_texts,
                              wm5110_aec_loopback_values);
index 7b198c38f3efdd2e5d23db6c18332527f842e2f9..b6b65483758518f8b8cab7672af882ef923d2768 100644 (file)
@@ -324,7 +324,7 @@ static int wm_adsp_load(struct wm_adsp *dsp)
 
                if (reg) {
                        buf = kmemdup(region->data, le32_to_cpu(region->len),
-                                     GFP_KERNEL);
+                                     GFP_KERNEL | GFP_DMA);
                        if (!buf) {
                                adsp_err(dsp, "Out of memory\n");
                                return -ENOMEM;
@@ -396,7 +396,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
        hdr = (void*)&firmware->data[0];
        if (memcmp(hdr->magic, "WMDR", 4) != 0) {
                adsp_err(dsp, "%s: invalid magic\n", file);
-               return -EINVAL;
+               goto out_fw;
        }
 
        adsp_dbg(dsp, "%s: v%d.%d.%d\n", file,
@@ -439,7 +439,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
 
                if (reg) {
                        buf = kmemdup(blk->data, le32_to_cpu(blk->len),
-                                     GFP_KERNEL);
+                                     GFP_KERNEL | GFP_DMA);
                        if (!buf) {
                                adsp_err(dsp, "Out of memory\n");
                                return -ENOMEM;
index 3b98159d9645a8ecf917fb8c86c41de6a401c929..a210c8d7b4bce6d85afdb371b32b8b866d21da50 100644 (file)
@@ -108,18 +108,13 @@ if SND_IMX_SOC
 config SND_SOC_IMX_SSI
        tristate
 
-config SND_SOC_IMX_PCM
-       tristate
-
 config SND_SOC_IMX_PCM_FIQ
-       bool
+       tristate
        select FIQ
-       select SND_SOC_IMX_PCM
 
 config SND_SOC_IMX_PCM_DMA
-       bool
+       tristate
        select SND_SOC_DMAENGINE_PCM
-       select SND_SOC_IMX_PCM
 
 config SND_SOC_IMX_AUDMUX
        tristate
index afd34794db539a0f5de4154a5a635a69f40913e1..ec1457915d7c13ae5e97fd9482b34b46fc7f77b6 100644 (file)
@@ -41,7 +41,10 @@ endif
 obj-$(CONFIG_SND_SOC_IMX_SSI) += snd-soc-imx-ssi.o
 obj-$(CONFIG_SND_SOC_IMX_AUDMUX) += snd-soc-imx-audmux.o
 
-obj-$(CONFIG_SND_SOC_IMX_PCM) += snd-soc-imx-pcm.o
+obj-$(CONFIG_SND_SOC_IMX_PCM_FIQ) += snd-soc-imx-pcm-fiq.o
+snd-soc-imx-pcm-fiq-y := imx-pcm-fiq.o imx-pcm.o
+obj-$(CONFIG_SND_SOC_IMX_PCM_DMA) += snd-soc-imx-pcm-dma.o
+snd-soc-imx-pcm-dma-y := imx-pcm-dma.o imx-pcm.o
 
 # i.MX Machine Support
 snd-soc-eukrea-tlv320-objs := eukrea-tlv320.o
index d5cd9eff3b48e92ca77349b930fe84056fcd7017..0c9f188ddc683e77110d788f5150fc8d6098a703 100644 (file)
@@ -31,7 +31,6 @@ int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,
                        runtime->dma_bytes);
        return ret;
 }
-EXPORT_SYMBOL_GPL(snd_imx_pcm_mmap);
 
 static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 {
@@ -80,7 +79,6 @@ int imx_pcm_new(struct snd_soc_pcm_runtime *rtd)
 out:
        return ret;
 }
-EXPORT_SYMBOL_GPL(imx_pcm_new);
 
 void imx_pcm_free(struct snd_pcm *pcm)
 {
@@ -102,7 +100,6 @@ void imx_pcm_free(struct snd_pcm *pcm)
                buf->area = NULL;
        }
 }
-EXPORT_SYMBOL_GPL(imx_pcm_free);
 
 MODULE_DESCRIPTION("Freescale i.MX PCM driver");
 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
index 1e36bc81e5af1fb015ffef62f628781910984bbb..258acadb9e7d238a97b7af6508ffc21bd1a4488e 100644 (file)
@@ -1023,7 +1023,7 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w,
 
        if (SND_SOC_DAPM_EVENT_ON(event)) {
                if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) {
-                       ret = regulator_allow_bypass(w->regulator, true);
+                       ret = regulator_allow_bypass(w->regulator, false);
                        if (ret != 0)
                                dev_warn(w->dapm->dev,
                                         "ASoC: Failed to bypass %s: %d\n",
@@ -1033,7 +1033,7 @@ int dapm_regulator_event(struct snd_soc_dapm_widget *w,
                return regulator_enable(w->regulator);
        } else {
                if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) {
-                       ret = regulator_allow_bypass(w->regulator, false);
+                       ret = regulator_allow_bypass(w->regulator, true);
                        if (ret != 0)
                                dev_warn(w->dapm->dev,
                                         "ASoC: Failed to unbypass %s: %d\n",
@@ -3039,6 +3039,14 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
                                w->name, ret);
                        return NULL;
                }
+
+               if (w->invert & SND_SOC_DAPM_REGULATOR_BYPASS) {
+                       ret = regulator_allow_bypass(w->regulator, true);
+                       if (ret != 0)
+                               dev_warn(w->dapm->dev,
+                                        "ASoC: Failed to unbypass %s: %d\n",
+                                        w->name, ret);
+               }
                break;
        case snd_soc_dapm_clock_supply:
 #ifdef CONFIG_CLKDEV_LOOKUP
index ed4d89c8b52a52e6425ce5c992cc5d324b339d35..e90daf8cdaa8726f8311092636461a9fee10b187 100644 (file)
@@ -1331,16 +1331,23 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
                }
                channels = (hdr->bLength - 7) / csize - 1;
                bmaControls = hdr->bmaControls;
+               if (hdr->bLength < 7 + csize) {
+                       snd_printk(KERN_ERR "usbaudio: unit %u: "
+                                  "invalid UAC_FEATURE_UNIT descriptor\n",
+                                  unitid);
+                       return -EINVAL;
+               }
        } else {
                struct uac2_feature_unit_descriptor *ftr = _ftr;
                csize = 4;
                channels = (hdr->bLength - 6) / 4 - 1;
                bmaControls = ftr->bmaControls;
-       }
-
-       if (hdr->bLength < 7 || !csize || hdr->bLength < 7 + csize) {
-               snd_printk(KERN_ERR "usbaudio: unit %u: invalid UAC_FEATURE_UNIT descriptor\n", unitid);
-               return -EINVAL;
+               if (hdr->bLength < 6 + csize) {
+                       snd_printk(KERN_ERR "usbaudio: unit %u: "
+                                  "invalid UAC_FEATURE_UNIT descriptor\n",
+                                  unitid);
+                       return -EINVAL;
+               }
        }
 
        /* parse the source unit */
This page took 1.059239 seconds and 5 git commands to generate.